query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Deletes an existing DollInfo model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n $id= @$_POST['id'];\n if($this->findModel($id)->delete()){\n echo 1;\n }\n else{\n echo 0;\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$model=$this->loadModel($_POST['id']);\n\t\t $model->delete();\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tEstateImage::deleteAllImages($model->id);\t\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->tour);\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->image);\n\t\t\n\t\t$model->delete();\n\t\t\n\t\t\n\t\tModeratorLogHelper::AddToLog('deleted-estate-'.$model->id,'Удален объект #'.$model->id.' '.$model->title,null,$model->user_id);\n\t\t$this->redirect('/cabinet/index');\n\t\t\n\t}", "public function actionDelete($id) {\n $model=$this->findModel($id);\n\t\t$id_operacion=$model->id_operacion;\n\t\t$model->delete();\n\t\t\n\t\treturn $this->redirect(['index', 'id_operacion' => $id_operacion]);\n //return $this->redirect(['index']);\n }", "public function actionDelete($id)\n { \n\t\t$model = $this->findModel($id); \n $model->isdel = 1;\n $model->save();\n //$model->delete(); //this will true delete\n \n return $this->redirect(['index']);\n }", "public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }", "public function actionDelete($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t\n\t\tif ($model) {\n\t\t\t$model->delete();\n\t\t}\n\n // if AJAX request (triggered by deletion via list grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));\n\t}", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function actionDelete($id)\n {\n\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }", "public function delete() {\n $flg = $this->Seatmodel->delete();\n\n if (!empty($flg)) {\n $this->session->set_flashdata('successmessage', 'Data deleted successfully');\n } else {\n $this->session->set_flashdata('errormessage', 'Oops! Something went wrong');\n }\n\n redirect(base_url('admin-seat-list'));\n }", "public function actionDelete($id){\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\n\t\t$id = intval( Yii::app()->getRequest()->getParam('id') );\n\n\t\tif (!Yii::app()->getRequest()->getIsAjaxRequest() || empty($id))\n\t\t\tthrow new CHttpException(404);\n\n\t\t$model = MainRoom::model()->findByPk($id);\n\t\tif (is_null($model))\n\t\t\tthrow new CHttpException(404);\n\n\t\t$model->status = MainRoom::STATUS_DELETED;\n\t\t$model->save(false);\n\t\tdie ( CJSON::encode( array('success'=>true) ) );\n\n\t}", "public function actionDelete($id)\n {\n\t$model = static::findModel($id);\n\n\t$this->processData($model, 'delete');\n\n\t$model->delete();\n\n \treturn $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n { \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n \n try {\n $model = $this->findModel($id);\n \n $this->deshacer_renglones($model);\n\n $model->delete();\n \n $transaction->commit();\n \n return $this->redirect(['index']);\n\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n\n }", "public function actionDelete() {\n// print_r($_POST);\n Comment::model()->findByPk($_POST['id'])->delete();\n echo CJSON::encode(array(\"data\" => 'berhasil'));\n// $this->loadModel($_POST['id'])->delete();\n // if AJAX request (triggered by deletion via dashboard grid view), we should not redirect the browser\n// if (!isset($_GET['ajax']))\n// $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('dashboard'));\n }", "public function actionDelete($id)\n {\n $model=$this->findModel ( $id );\n\t\t$model->is_delete=1;\n\t\t$model->save ();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\n\t\t$id = intval($_GET['iId']);\n\t\t$this->loadModel($id)->delete();\n\t\t$this->redirect('/app/DayPush/index');\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n $model=$this->findModel($id);\n $inmueble_id=$model->inmueble_id;\n $model->delete();\n \n return $this->redirect(['index','id' => $inmueble_id]);\n }", "public function actionDeletedetail()\n\t{\n\t\t$id=$_POST['id'];\n\t\tforeach($id as $ids)\n\t\t{\n\t\t $model=Dodetail::model()->findbyPK($ids);\n\t\t $model->delete();\n\t\t}\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n return $this->redirect(['index']);\r\n }", "public function delete()\n {\n if(!$GLOBALS['discountlevel_permission']['delete'] || !$this->input->post('id')){\n access_denied('discountlevel');\n }\n\n $response = $this->Discountlevel_model->delete($this->input->post('id'));\n if ($response==1) {\n\n $this->db->where('discountnr', $this->input->post('id'));\n $this->db->delete('tblfields');\n\n //History\n $Action_data = array('actionname'=>'discountlevel', 'actionid'=>$this->input->post('id'), 'actiontitle'=>'discountlevel_deleted');\n do_action_history($Action_data);\n\n set_alert('success', sprintf(lang('deleted_successfully'),lang('page_discountlevel')));\n }else{\n set_alert('danger', $response);\n }\n redirect(site_url('admin/discountlevels/'));\n }", "public function actionDelete($id)\r\n {\r\n // $this->findModel($id)->delete();\r\n echo 'Not Allowed';\r\n exit();\r\n return $this->redirect(['index']);\r\n\r\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n\t\t\n\t\t$model = $this->findModel($id);\n\t\t$model->dte_exclusao = 'NOW()';\n\t\t\n\t\tif ($model->save())\n\t\t{\n\t\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'delete' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$this->session->setFlashProjeto( 'danger', 'delete' );\n\t\t}\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n return $this->redirect(['index' , 'goods_id' => $model->goods_id]);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['site/verleih']);\n }", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }", "public function actionDelete() {\n $model = new \\UsersModel();\n $login = $this->getParam('login');\n\n if ( $model->delete($login) ) {\n $this->flashMessage('Odstraněno', self::FLASH_GREEN);\n } else {\n $this->flashMessage('Záznam nelze odstranit', self::FLASH_RED);\n }\n\n $this->redirect('default');\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n \n $model->delete();\n return $this->redirect([\n 'index'\n ]);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n $model = Pengalaman::findOne($id);\n var_dump($model);die();\n return $this->redirect(['//keterangan/updatepencaker','id'=>$model->id_daftar]);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->isDelete = 1;\n $model->save();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n #$this->findModel($id)->delete();\n $model = $this->findModel($id);\n $model->status=0;\n $model->save();\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\r\n\t\t$this->findModel ( $id )->delete ();\r\n\t\t\r\n\t\treturn $this->redirect ( [ \r\n\t\t\t\t'index' \r\n\t\t] );\r\n\t}", "function delete() {\n if (isset($_GET['id'])) {\n $coche=new coches_model();\n\n $id = $_GET['id'];\n\n $error = $coche->delete($id);\n\n if (!$error) {\n header( \"Location: index.php?controller=coches&action=listado\");\n }\n else {\n echo $error;\n }\n }\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function deleteAction()\n {\n if (!Auth::loggedIn()) {\n return redirect('auth/login');\n }\n\n // Get first parameter from URL as comment $id.($this->params are from Controller)\n // $id = $this->params[0];\n $id = $this->getParam();\n\n // Call static function from Model which return comment object or null.\n $article = Article::findById($id);\n\n if (!$article) {\n return redirect();\n }\n\n if (!$article->canDelete()) {\n return redirect('articles/details/' . $article->id);\n }\n\n $comments = $article->getComments();\n\n // Delete each comment in the loop\n foreach ($comments as $comment) {\n $comment->delete();\n }\n\n // Delete article on the end\n $article->delete();\n\n set_alert('info', '<b>Success!</b> Your article has been deleted!');\n\n return redirect('articles');\n }", "public function actionDelete($id)\r\n {\r\n if(file_exists($this->findModel($id)->path)){\r\n unlink($this->findModel($id)->path);\r\n }\r\n \r\n $this->findModel($id)->delete();\r\n \r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id) {\n\n $model = $this->findModel($id);\n $model->dte_exclusao = 'NOW()';\n\n if ($model->save()) {\n\n $this->session->setFlashProjeto('success', 'delete');\n } else {\n\n $this->session->setFlashProjeto('danger', 'delete');\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\t\t\\Yii::$app->session->setFlash('updated',\\Yii::t('admin', 'Данные успешно удалены'));\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->_findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDel($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }" ]
[ "0.7279666", "0.72754496", "0.7192253", "0.7155263", "0.7096817", "0.70520663", "0.7026414", "0.6988397", "0.6950694", "0.69315875", "0.6922457", "0.6919875", "0.6915286", "0.6915286", "0.68868", "0.6875842", "0.6872508", "0.6860226", "0.6843781", "0.68397176", "0.6833335", "0.6814418", "0.6791105", "0.6791105", "0.6790923", "0.6790426", "0.67830545", "0.6774679", "0.67736274", "0.6772725", "0.6772725", "0.67672044", "0.6744478", "0.672232", "0.67195886", "0.67177397", "0.67173076", "0.67158574", "0.6705724", "0.67015666", "0.6687708", "0.66803354", "0.66803354", "0.66803354", "0.66803354", "0.66726184", "0.66726184", "0.66683555", "0.66680664", "0.66680664", "0.666047", "0.6658457", "0.66560274", "0.66560274", "0.66491824", "0.66491824", "0.66491824", "0.66491824", "0.66491824", "0.66491824", "0.66491824", "0.6647437", "0.6638095", "0.6635843", "0.6632163", "0.66251874", "0.6624046", "0.6623268", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.66182154", "0.6612804", "0.66117257", "0.6609506", "0.6609153", "0.6608797", "0.6608797", "0.6608073", "0.66056377" ]
0.0
-1
Finds the DollInfo model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = DollInfo::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function find($primary_key, $model);", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public function returnDetailFindByPK($id);", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }", "public function show($pk)\n {\n return $this->model->findOrFail($pk);\n }", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function returnFindByPK($id);", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function find($id):Default_Model_Model{\n\n\n\t\t$result=$this->getDbTable()->find($id);\n\n\t\t//echo \"id=>$id\";\n\n\t\tif(0 == count($result)) return false;\n\n\t\t$row = $result->current();\n\t\t$object = $this->getModel($row->toArray ());\n\n\t\treturn $object;\n\n\t}", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=Information::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function findModel($clz, $key);", "public function find(int $id): ?Model;", "public function find(int $id): ?Model;", "public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}", "public function find($model, $id);", "public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "public function find($id = null) {\n $argument = $id?? $this->request->fetch('id')?? null;\n return $this->model->find($argument);\n }", "abstract public function find($id);", "protected function findModel($id)\n {\n if (($model = JackpotDetails::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Docingresados::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El enlace o direccion solicitado no existe');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Consultor::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }", "public function actionFind()\n\t{\n\t\t$requestedId = craft()->request->getParam('id');\n\t\t// build criteria to find model\n\t\t$criteria = craft()->elements->getCriteria(ElementType::Entry);\n\t\t$criteria->id = $requestedId;\n\t\t$criteria->limit = 1;\n\t\t\n\t\t// fire !\n\t\t$entries = $criteria->find();\n\t\t$entry = count($entries) > 0 ? $entries[0] : null;\n\n\t\t// redirect if possible\n\t\tif($entry && $entry->url) {\n\n\t\t\t// build new query, but remove id from query path\n\t\t\t$newLocation = $entry->url . ( craft()->request->getParam('L') ? '?L='.craft()->request->getParam('L') : '');\n\n\t\t\theader(\"HTTP/1.1 302 Found\"); \n\t\t\theader(\"Location: \" . $newLocation); \n\t\t\texit();\n\t\t}else{\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\theader(\"Location: /404.html\"); \n\t\t\texit();\n\t\t}\n\n\t\tcraft()->end();\n\t}", "protected function findModel($id, $del_status = '0') {\n $class = get_class($this->getPrimaryModel());\n if (($model = $class::findOne(['id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function find($primary_key)\n {\n return static::select()\n ->where(static::getPrimaryKey(), $primary_key)\n ->fetchOne();\n }", "protected function findModel($ClearByID, $ClearanceLevelCode, $Department, $StudentID)\n {\n if (($model = Clearanceentries::findOne(['Clear By ID' => $ClearByID, 'Clearance Level Code' => $ClearanceLevelCode, 'Department' => $Department, 'Student ID' => $StudentID])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function find($id, $key = 'id');", "public function loadModel($id)\n\t{\n\t\t$model=RequestFuel::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('rdt','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = Catalog2::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Klient::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id)\n {\n $model = InfoSpares::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Knowledgecatalogue::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "public function find($id)\n {\n return $this->model->findOrFail($id);\n }", "public function find($id)\n {\n return $this->model->findOrFail($id);\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT ID, ROUTEID, PROVIDERID, PROVIDERNAME, NAMEZH, NAMEEN, PATHATTRIBUTEID, PATHATTRIBUTENAME, PATHATTRIBUTEENAME, BUILDPERIOD, DEPARTUREZH, DEPARTUREEN, DESTINATIONZH, DESTINATIONEN, REALSEQUENCE, DISTANCE, GOFIRSTBUSTIME, BACKFIRSTBUSTIME, GOLASTBUSTIME, BACKLASTBUSTIME, OFFPEAKHEADWAY FROM routes_2011 WHERE ID = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Routes2011();\n\t\t\t$obj->hydrate($row);\n\t\t\tRoutes2011Peer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "protected function findModel($id)\n {\n if (($model = ComingsRepository::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `USER_ID`, `NAME`, `DESCRIPTION`, `BARE_PATH`, `CLONE_PATH`, `FORKED_FROM_ID`, `FORKED_AT`, `CREATED_AT`, `UPDATED_AT` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function find($id)\n\t{\n\t\treturn Model::where('id', $id)->first();\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=CollectionShop::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n {\n $model=Seat::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = CompPrep::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Clap::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Coordocs::model()->findByPk($id+0);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `ID_API_ID`, `ID_NAME`, `ID_EMAIL`, `ID_FBID`, `CDATE`, `MDATE`, `ID_TWID`, `ID_IMAGE` FROM `invite_detail` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new InviteDetail();\n\t\t\t$obj->hydrate($row);\n\t\t\tInviteDetailPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public static function Get($key) {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$primary = $model->index('primary');\r\n\t\tif (is_null($primary)) {\r\n\t\t\tthrow new Exception(\"The schema for {$cls} does not identify a primary key\");\r\n\t\t}\r\n\t\tif (!is_array($key)) {\r\n\t\t\tif (count($primary['fields']) > 1) {\r\n\t\t\t\tthrow new Exception(\"The schema for {$cls} has more than one field in its primary key\");\r\n\t\t\t}\r\n\t\t\t$key = array(\r\n\t\t\t\t$primary['fields'][0] => $key\r\n\t\t\t);\r\n\t\t}\r\n\t\tforeach ($primary['fields'] as $field) {\r\n\t\t\tif (!isset($key[$field])) {\r\n\t\t\t\tthrow new Exception(\"No value provided for the {$field} field in the primary key for \" . get_called_class());\r\n\t\t\t}\r\n\t\t\t$model->where(\"{$field} = ?\", $key[$field]);\r\n\t\t}\r\n\t\t//$src = Dbi_Source::GetModelSource($model);\r\n\t\t$result = $model->select();\r\n\t\tif ($result->count()) {\r\n\t\t\tif ($result->count() > 1) {\r\n\t\t\t\tthrow new Exception(\"{$cls} returned multiple records for primary key {$id}\");\r\n\t\t\t}\r\n\t\t\t$record = $result[0];\r\n\t\t} else {\r\n\t\t\t$record = new Dbi_Record($model, null);\r\n\t\t\t$record->setArray($key, false);\r\n\t\t}\r\n\t\treturn $record;\r\n\t}", "protected function findModel($id)\n {\n$model = Reports::findOne($id);\n\t\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']))\n\t\t{\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n }", "public function loadModel($id)\n\t{\n\t\t$model=Cooperativepartner::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function findById ($id);", "public function loadModel($id)\n\t{\n\t\t$model=Sale::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = DetailPkl::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function getModelByPrimaryKey($action = null, $keyValue = null)\n {\n $keyName = $this->model->getKeyName();\n\n if ($keyValue == '_') {\n if ($this->request()->has(\"data.primaryKey.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.primaryKey.{$keyName}\");\n } elseif ($this->request()->has(\"data.old.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.old.{$keyName}\");\n } elseif ($this->request()->has('data.items')) {\n $items = $this->request()->input('data.items');\n if (Arr::has($items, $keyName)) {\n $keyValue = Arr::get($items, $keyName);\n } else {\n $first = Arr::first($items);\n if (Arr::has($first, $keyName)) {\n $keyValue = Arr::get($first, $keyName);\n }\n }\n }\n }\n\n $data = [$keyName => $keyValue];\n\n $r = $this->validateData($data, null, 'primaryKey', $action, [$keyName => ['includeUniqueRules' => false]]);\n if ($r !== true) {\n return $r;\n }\n\n $modelClass = get_class($this->model);\n if ($model = $modelClass::find($data[$keyName])) {\n return $model;\n }\n\n return CrudJsonResponse::error(CrudHttpErrors::TARGET_DATA_MODEL_NOT_FOUND, null, [\n 'action' => 'primaryKey',\n 'parent_action' => $action,\n 'target' => $data,\n ]);\n }", "public function loadModel($id) {\r\n $model = ProductStockEntries::model()->findByPk($id);\r\n if ($model === null)\r\n throw new CHttpException(404, 'The requested page does not exist.');\r\n return $model;\r\n }", "protected function findModel($id)\n {\n if (($model = Creditortmp::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=CerDoc::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n $model = Info::find()->alias('i')->select(['i.*', 'c.cname as cname', 'c.id as cid', 'c.lang as lang'])->leftJoin(Column::tableName().' as c', ' i.columnid = c.id')->current()->andWhere(['c.id' => $id])->one();\n if ($model !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('请求的页面不存在。');\n }\n }", "protected function findModel($id)\n {\n if(Yii::$app->session->get('Rules')['comp_id'] ==1){\n if (($model = Customer::findOne(['id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }else{\n\n \n if (($model = Customer::findOne(['id' => $id,'comp_id' => Yii::$app->session->get('Rules')['comp_id']])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }\n }", "protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}", "protected function findModel($id)\n\t{\n if (($model = UserLevel::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "protected\n\tfunction findModel(\n\t\t$id\n\t) {\n\t\tif ( ( $model = Building::findOne( $id ) ) !== null ) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException( 'The requested page does not exist.' );\n\t\t}\n\t}", "public function loadModel($id){\r\r\n\r\r\n\t $model=OrdenConsumo::model()->findByPk($id);\r\r\n\r\r\n\t if($model===null)\r\r\n\t throw new CHttpException(404,'The requested page does not exist.');\r\r\n\t return $model;\r\r\n\r\r\n\t}", "protected function findModel($id)\n\t{\n\t\tif (($model = Operation::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Ios::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public static function find($id);", "public function loadModel($id)\r\n\t{\r\n\t\t$model=MoneyTransfer::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function findModel($class, $id)\n {\n $model = call_user_func([$class, 'findOne'], $id);\n if (!$model) {\n $this->raise404();\n }\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Results::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "function findById($id);", "public function loadModel($id) {\n $model = Fddemandreceipt::model()->findByPk((int) $id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id) {\n if (($model = Stakeholder::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=PPJadwaldokterM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `NAME`, `VALUE`, `REMOTE` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "function find($id);", "public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);" ]
[ "0.71941656", "0.7070218", "0.6959412", "0.68656343", "0.66086125", "0.6526582", "0.6505071", "0.65028816", "0.6485276", "0.64529216", "0.6446302", "0.64317465", "0.64182156", "0.63893473", "0.6387858", "0.63688385", "0.636823", "0.63472277", "0.6336669", "0.63326156", "0.63326156", "0.6331872", "0.63181084", "0.6296066", "0.62787616", "0.62617975", "0.6247298", "0.62278986", "0.6224279", "0.62200373", "0.621454", "0.62078124", "0.62078124", "0.62078124", "0.61932665", "0.61839396", "0.6183687", "0.6180971", "0.61738294", "0.6172681", "0.6163291", "0.61593455", "0.6155244", "0.6145359", "0.6144723", "0.6144649", "0.6134781", "0.6128908", "0.6128908", "0.6128536", "0.6115949", "0.6115047", "0.61147994", "0.6114588", "0.61094505", "0.6108212", "0.61030847", "0.61017925", "0.60917985", "0.6091204", "0.6090102", "0.6087675", "0.60874504", "0.60872436", "0.60867083", "0.60822934", "0.60813266", "0.60788524", "0.60785216", "0.607733", "0.60751146", "0.6074683", "0.60598207", "0.60590243", "0.60564613", "0.6056208", "0.60559213", "0.605589", "0.6055244", "0.6053049", "0.6052275", "0.605002", "0.60475314", "0.60473436", "0.6043735", "0.60422784", "0.6041657", "0.60402966", "0.60388565", "0.6037741", "0.6037741", "0.6037741", "0.6037741", "0.6037741", "0.6037741", "0.6037741", "0.6037741", "0.6037741", "0.6037741", "0.6037741" ]
0.6558912
5
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.839992", "0.8375952", "0.8375952", "0.8342815", "0.8252745", "0.82473254", "0.8211478", "0.81453574", "0.810956", "0.80823004", "0.79912364", "0.7989508", "0.7982261", "0.7959524", "0.79507357", "0.7948338", "0.79256135", "0.79145455", "0.79002494", "0.7893071", "0.7889318", "0.7889047", "0.7859889", "0.78410757", "0.78410757", "0.783742", "0.7823091", "0.7812151", "0.7807754", "0.77919126", "0.7786674", "0.7781593", "0.7780777", "0.7762826", "0.7753834", "0.77178144", "0.77178144", "0.771564", "0.77118343", "0.77043885", "0.7693797", "0.7691735", "0.76900935", "0.76898056", "0.76733977", "0.76662993", "0.7664653", "0.76545596", "0.764996", "0.7642534", "0.764228", "0.7641884", "0.7634402", "0.762985", "0.76291037", "0.7626811", "0.76197964", "0.76197964", "0.76127744", "0.76032645", "0.7603009", "0.7601598", "0.7601598", "0.7600797", "0.7598501", "0.75954676", "0.75872594", "0.7584999", "0.7580122", "0.756261", "0.7553521", "0.7551973", "0.75506663", "0.7544154", "0.754182", "0.7538652", "0.7537086", "0.7529288", "0.75156945", "0.7513393", "0.74994284", "0.74953514", "0.7494652", "0.7491306", "0.7486971", "0.74858564", "0.74782985", "0.74769115", "0.7471861", "0.7470534", "0.7463947", "0.74632055", "0.74620247", "0.7461856", "0.7460523", "0.7448737", "0.7438837", "0.7435204", "0.74337536", "0.7430899", "0.74234605" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'ids' => 'required|array', 'ids.*' => 'exists:products,id', ]; }
{ "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
Displays the transactions grouped by the given Stock.
function displayTransactions($code){ return $this->group($code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Stocks $stocks)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function show(Stock $stock)\n {\n //\n }", "public function actionIndex()\n {\n $searchModel = new StockSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function showAction(Stock $stock)\n {\n $deleteForm = $this->createDeleteForm($stock);\n\n return $this->render('stock/show.html.twig', array(\n 'stock' => $stock,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Stock $stock)\n {\n return $stock;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $stocks = $em->getRepository('IschaBackOfficeBundle:Stock')->findAll();\n\n return $this->render('stock/index.html.twig', array(\n 'stocks' => $stocks,\n ));\n }", "function getAllTransactions()\n {\n $transactions = $this->all();\n\n /* Add additional attributes to each Stock */\n foreach ($transactions as $transaction)\n {\n // Add a link to each stock's history page\n $transaction->href = '/transaction/' . $transaction->DateTime;\n }\n\n return $transactions;\n }", "public function index()\n {\n $reactifs = Reactif::limit(5)->get();\n $vaccins = Vaccin::limit(5)->get();\n $echantillons = Echantillon::limit(5)->get();\n $substances = Substancespures::limit(5)->get();\n return view('stocks.index', compact('reactifs', 'vaccins', 'echantillons', 'substances'));\n }", "public function getSalesTransactions($stock){\n\n $this->db->select('*');\n $this->db->from('transactions t');\n $this->db->where('t.Stock', $stock);\n $query = $this->db->get();\n\n $item = [\n \"DateTime\" => \"N/A\",\n \"Player\" => \"N/A\",\n \"Stock\" => \"N/A\",\n \"Trans\" => \"N/A\",\n \"Quantity\" => \"N/A\"\n ];\n\n $resultset = array();\n\n array_push($resultset, $item);\n\n if($query->num_rows() != 0)\n {\n $resultset = $query->result_array();\n }\n\n return $resultset;\n }", "public function index()\n {\n $stocks = Stock::all();\n\n return view('admin.stock.index')\n ->with('stocks', $stocks);\n }", "public function showAction(Stock $stock)\n {\n return $this->render('ManagerBundle:stock:show.html.twig', array(\n 'stock' => $stock,\n ));\n }", "public function index()\n {\n $business_id = request()->session()->get('user.business_id');\n if (!auth()->user()->can('stocktackign.view') ) {\n abort(403, 'Unauthorized action.');\n }\n\n $transactions=\\DB::table('transactions')->join('business_locations','business_locations.id','transactions.location_id')\n ->where('transactions.type','stocktacking')\n ->where('transactions.business_id',$business_id)\n ->select(\n 'transactions.*',\n 'business_locations.name as location_name'\n )\n ->get();\n return view('stocktacking.index',['transactions'=>$transactions]);\n }", "public function stockAction()\n {\n $user = $this->getUser();\n $em = $this->getDoctrine()->getManager();\n $listesProduits = $em->getRepository('KountacBundle:Produits_1')->getProduitsAdminByStock();\n $produits = $this->get('knp_paginator')->paginate($listesProduits,$this->get('request')->query->get('page', 1),10);\n return $this->render('produits/index.html.twig', array(\n 'produits' => $produits,\n 'user' => $user\n ));\n }", "public function index()\n {\n $userId = auth()->id();\n $data = Stocks::where('user_id', $userId)->with('user')->get();\n return view('backend.stocks.list', compact('data'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $produitStockes = $em->getRepository('AppBundle:Business\\ProduitStocke')->findAll();\n\n return $this->render('AppBundle:Business:ProduitStocke/index.html.twig', array(\n 'produitStockes' => $produitStockes,\n ));\n }", "function ViewStockAdjustmentTransaction()\n {\n $sql=\"select * from INVT_T_STOCK_ADJ_HEAD \";\n return $this->db->query($sql, $return_object = TRUE)->result_array();\n }", "public function view_list(){\n\t\treturn view(mProvider::$view_prefix.mProvider::$view_prefix_priv.'stock');\n\t}", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => StockRequests::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return view('admin.stock.stock');\n }", "public function index()\n {\n $stocks = Stock::paginate(20);\n return view('stock.index', compact('stocks'));\n }", "public function show(tb_vendor $tb_stock_keluar)\n {\n //\n }", "public function index()\n { \n $stocks = Stock::all();\n // Tổng doanh thu\n $totalAmount= DB::table('orders')\n ->select(DB::raw('SUM(amount) AS total_sale'))\n ->where('orders.status', '<>', 3)\n ->get();//Lấy ra số lượng đã bán của từng sản phẩm\n $sumAmount = $totalAmount[0]->total_sale;\n // Tổng chi phí\n $totalFee = DB::table('stock_details')\n ->select(DB::raw('SUM(import_quantity*original_price) AS sum_original_price'))\n ->get();\n $sumFee = $totalFee[0]->sum_original_price;\n\n return view('admin.stocks.index',compact('stocks','sumAmount','sumFee'));\n \n }", "public function index() {\n $data = UserStock::where('flag', '=', '1')->get();\n \n return view('store.manageUserStock')->with('userStocks', $data);\n }", "public function transactions()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the users transaction\n $transactions = OrdersModel::transactions();\n\n $this->View->Render('dashboard/transactions', ['transactions' => $transactions]);\n }", "public function actionViewTransaction() {\n\t\t$params = ['status' => [Yii::$app->params['STATUS_PROCESS'], Yii::$app->params['STATUS_CLOSED']]];\n\t\t$trxSearchModel = new TrxTransactionsSearch();\n\t\t$trxDataProvider = $trxSearchModel->search(Yii::$app->request->queryParams, $params);\n\n \treturn $this->render('view-transaction', ['dataProvider' => $trxDataProvider,\n \t\t\t\t\t\t\t\t\t\t\t 'searchModel' => $trxSearchModel,]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $bars = $em->getRepository('AppBundle:Bar')->findAll();\n\n return $this->render('AppBundle:Stock:index.html.twig', array(\n 'bars' => $bars,\n ));\n }", "public function index(){\n\t\t\n\t\t$data = $this->Stock->find('all');\n\t\t$title_for_layout = 'Акции';\n\t\t$this->set(compact('data', 'title_for_layout'));\n\t}", "function avisos_listado_stock()\n\t{\n\t\t$query=\"SELECT id,codigo from productos \";\n\t\t$result= mysql_query($query);\n\t\t?><TABLE border=\"1\">\n\t\t<TR>\n\t\t\t<TH>CODIGO</TH>\n\t\t\t<TH>COLOR</TH>\n\t\t\t<TH>TALLE</TH>\n\t\t\t<TH>CANTIDAD TOTAL</TH>\n\t\t\t<TH>STOCK BAJO MINIMO</TH>\n\n\t\t</TR>\n\t\t<? $contador = 0;\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{ //recorro todos los productos 1 por 1\n\t\t$contador++;\n\n\t\t\t// AHORA SE RECORRO LOS COLORES\n\t\t\t$query_color=\"SELECT * FROM colores\";\n\t\t\t$result_color= mysql_query($query_color);\n\t\t\twhile ($row_color = mysql_fetch_assoc($result_color))\n\t\t\t{\n\n\t\t\t\t$query_talle=\"SELECT * FROM talles\";\n\t\t\t\t$result_talle= mysql_query($query_talle);\n\t\t\t\twhile ($row_talle = mysql_fetch_assoc($result_talle))\n\t\t\t\t{\n\n\n\t\t\t\t\t$query_avisos=\"SELECT SUM(cantidad) AS cantidad_total, aviso_stock FROM productos AS P inner join productos_stock as PS ON PS.idProducto = P.codigo WHERE codigo = '\".$row[\"codigo\"]. \"' and idcolor = '\".$row_color[\"id\"]. \"' and idtalle = '\".$row_talle[\"id\"]. \"' group by codigo\";\n\t\t\t\t\t$result_avisos = mysql_query($query_avisos);\n\t\t\t\t\tif($row_avisos = mysql_fetch_assoc($result_avisos))\n\t\t\t\t\t{\n\t\t\t\t\t\t//if($row_avisos[\"cantidad_total\"] < $row_avisos[\"aviso_stock\"])\n\t\t\t\t\t\t//{\t\n\t\t\t\t\t\t//\tECHO \"<FONT SIZE=3 COLOR=blue>EL PRODUCTO <A HREF='http://localhost/control_stock/admin/productos/index.php?accion=detail&id=\".$row[\"id\"].\"'>\" . $row[\"codigo\"] . \"</a> COLOR : \".$row_color[\"nombre\"].\" TALLE : \".$row_talle[\"nombre\"].\" TIENE DE STOCK : \".$row_avisos[\"cantidad_total\"].\" </FONT><br>\";\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<TR class=\"<?=($contador%2==0? \"fila_par\":\"fila_impar\");?>\">\n\t\t\t\t\t\t\t<TD><A HREF='<?=ADMIN?>productos/index.php?accion=detail&id=<?=$row[\"id\"]?>'><?= $row[\"codigo\"];?></a></TD>\n\t\t\t\t\t\t\t<TD><?= $row_color[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_talle[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_avisos[\"cantidad_total\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_avisos[\"aviso_stock\"];?></TD>\n\t\t\t\t\t\t</TR>\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}//END WHILE TALLES\n\t\t\t}//END WHILE COLORES\n\t\t}//EN DWHILE PRODUCTOS\n\t\t?></TABLE><?\n\t}", "public function table()\n {\n return \"stocks\";\n }", "public function index()\n {\n $title = 'Dashboard - Stock';\n $stocks = StockDetail::all();\n return view('stock.index')->with(compact('stocks','title'));\n\n }", "public function index()\n {\n $sbus = Sbu::all();\n $items = Item::all();\n $report = null;\n return view('add-stock.index', compact('report','sbus','items'));\n }", "public function index()\n {\n $organization_id = Session::get('organization_id');\n\n $warehouses = InventoryItem::select('inventory_items.name','global_item_categories.display_name AS category_name', 'inventory_item_stocks.in_stock as total_quantity', 'units.name as unit') \n ->leftjoin('inventory_item_stocks', 'inventory_item_stocks.id', '=', 'inventory_items.id' ) \n ->leftjoin('units', 'units.id', '=', 'inventory_items.unit_id' )\n ->leftjoin('global_item_models', 'global_item_models.id', '=', 'inventory_items.global_item_model_id')\n ->leftjoin('global_item_categories', 'global_item_categories.id', '=', 'global_item_models.category_id' ) \n ->where('inventory_items.organization_id', $organization_id)\n ->where('inventory_items.status', '1')\n ->groupby('inventory_items.name')->get();\n\n //return $warehouses->all();\n\n return view('trade.warehouse_summary', compact('warehouses'));\n }", "public function index()\n {\n $carts= NursingCartRestock::all()->sortByDesc('created_at');\n return view('admin.pharmacy.stockcart', compact('carts'));\n\n }", "public function index()\n {\n // $stock= \\App\\Models\\Stock::all();\n $stock = DB::table('stock')->select('TIMESTAMP','keterangan','masuk','keluar',DB::raw('masuk - keluar as stocks'))->where('id_bahan_baku','BB000000006')->get();\n $stock1 = DB::table('stock')->where('id_bahan_baku','BB000000006')->sum('masuk');\n $stock2 = DB::table('stock')->where('id_bahan_baku','BB000000006')->sum('masuk');\n return view('gudangbawang.stockbawangkulit', ['stock' => $stock]);\n \n }", "public function index()\n {\n return Stock::get();\n }", "public function list()\n {\n return view('transactions.graphs');\n }", "public function index()\n {\n \n $auser = Auth()->user();\n $products = product::where([['sold_out','=',NULL],['shop_id','=',$auser->shop_id]])->get();\n $other_charges = OtherCharges::all();\n $item_name = ItemName::all();\n $item_model = ItemModel::all();\n $color = color::all();\n $type = type::all();\n $ltype = ltype::all();\n $shops = shop::all();\n return view('stock.stock',compact('products','shops','type','ltype','other_charges','item_name','item_model','color','auser'));\n }", "public function index()\n {\n //static user this will be logined\n $user = User::where('id', 1)->first();\n $branches = $user->branch;\n $row = new Branch();\n $branch_id = 0;\n $reverts =Stocks_transaction::join('invoices', function ($join)use ($branch_id) {\n $join->on('invoices.id', '=', 'stocks_transactions.invoice_id')\n ->where('invoices.branch_id', '=',$branch_id);\n })->where('transaction_type_id',102)\n ->select('*','stocks_transactions.id')->get();\n\n return view($this->viewName . 'index', compact('branches', 'row', 'reverts', ));\n }", "public function index()\n {\n if (session('success_message')) {\n Alert::success('success', session('success_message'))->showConfirmButton('Close', '#0f9b0f');\n } elseif (session('error_message')) {\n Alert::error('error', session('error_message'))->showConfirmButton('Close', '#b92b53');\n }\n $this->authorize('viewAny',Product::class);\n $stocks = StockTake::query()->orderBy('created_at', 'desc')->get();\n return view('stockTake.index', compact('stocks'));\n }", "public function showCart()\n {\n $carts=Cart::content();\n foreach ($carts as $cart) {\n $products = Products::findOrFail($cart->id);\n $quantityInStock = $products->quantityInStock - $cart->qty;\n DB::table('products')\n ->where('id','=', $cart->id)\n ->update(['quantityInStock' => $quantityInStock]);\n }\n $total=Cart::total();\n return view('users.pages.cart', compact('carts', 'total'));\n }", "public function index()\n {\n// $vendors = Customer::get();\n// DB::enableQueryLog();\n\n\n $stock = DB::table('products as p')\n ->leftjoin('receive_details as r', 'p.id','=','r.product_id')\n ->select( DB::raw('p.id,p.name, sum(r.total_price) as r_total_price, sum(r.qty) as r_qty,\n (select sum(a.total_price) from sells_details as a where p.id=a.product_id) as s_total_price,\n (select sum(b.qty) from sells_details as b where p.id=b.product_id) as s_qty') )\n\n ->groupBy('p.id' )\n ->orderBy('p.id' )\n\n\n ->get();\n\n// dd(DB::getQueryLog());\n\n\n return view(\"admin.report.stock\", ['stocks' => $stock]);\n }", "public function getStockItem()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Stock Items (Linnworks API)');\n\t\t}", "public function stock() {\n \n if ($this->session->userdata('validated')) {\n \n if ($this->MRecurso->validaRecurso(2)){\n\n /*Consulta Modelo para obtener listado de Productos creados*/\n $listProducts = $this->MProduct->list_products();\n /*Consulta Modelo para obtener listado de Grupos creados*/\n $listGroups = $this->MService->list_group_service();\n /*Retorna a la vista con los datos obtenidos*/\n $info['list_products'] = $listProducts;\n $info['list_groups'] = $listGroups;\n $this->load->view('products/stock',$info);\n \n } else {\n \n show_404();\n \n }\n \n } else {\n \n $this->load->view('login');\n \n }\n \n }", "public function ajaxShowPartnerTopupTransactionAction() {\n $this->_helper->layout->disableLayout();\n if(null == $partnerId = $this->_request->getParam('partnerId',null)){\n die('Error');\n }\n $groupBy = $this->_getParam('groupBy', 'year');\n \n $partnerTopupTransactions = $this->_model->getPartnerTopupTransactions($partnerId, $groupBy);\n// var_dump($partnerTopupTransactions);die;\n \n $this->view->data = $partnerTopupTransactions;\n $this->view->groupBy = $groupBy;\n }", "function viewtransactionAction() {\n /**\n * Checked that user is loggin or not.\n */\n if (! $this->_getSession ()->isLoggedIn ()) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You must have a Seller Account to access this page' ) );\n $this->_redirect ( 'marketplace/seller/login' );\n return;\n }\n /**\n * load and render layout\n */\n $this->loadLayout ();\n $this->getLayout ()->getBlock ( 'head' )->setTitle ( $this->__ ( 'Transaction History' ) );\n $this->renderLayout ();\n }", "public function actionIndex()\n {\n $searchModel = new TransactionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->where('gtransactions.clientId = '.Yii::$app->user->id);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index(){\n\t\t\n\t\t$data['stores'] = $this->Stock_of_storeModel->GetStores(); \n\t\t$data['stock'] = $this->Stock_of_storeModel->GetStoresStock(); \n\t\t\n\t\t//$this->load->view('common/header');\n\t\t$this->HeaderModel->header();\n\t\t$this->load->view('stock_of_store', $data);\n\t\t$this->FooterModel->footer();\n\t}", "public function show(Materiel $stock): View\n\t{\n\t\treturn view(\"web.materiels.stocks.show\", compact(\"stock\"));\n\t}", "public function index()\n {\n $stock_ins = StockIn::orderBy('in_at', 'desc')->with('commodity')->paginate(10);\n return view('admin.stock.in.index', compact('stock_ins'));\n }", "public function show(Transaction $transaction)\n {\n //\n }", "public function show(Transaction $transaction)\n {\n //\n }", "public function show(Transaction $transaction)\n {\n //\n }", "public function view_item(){\n\t\treturn view(mProvider::$view_prefix.mProvider::$view_prefix_priv.'stock_view');\n\t}", "public function index()\n {\n $data = [];\n $generation = Generation::where('status', 'verify')->orderBy('time', 'asc')->with(['stock'])->get();\n $data['generation'] = $generation;\n // $data['sd'] = StockDistribution::where('status', 'submission')-with(['stock'])->get();\n return view('pages.stock.index', $data);\n }", "public function index()\n {\n //\n // dd(Auth::user()->userstock()->get());\n $orders=Auth::user()->userstock()->get();\n // dd($orders);\n return view('farmer.stock.index',compact('orders'));\n }", "public function index()\n\t{\n\t\treturn view('ocs/finance::transactions.index');\n\t}", "public function index() {\n $se = new Service();\n $user_id = $_SESSION['current_user_id'];\n $userStocks = $se->getSaldosByUserId($user_id);\n $firm_names = array();\n $stocks = array();\n foreach($userStocks as $user_stock) {\n //da bi u view-u imali imena firmi jer je to prirodnije za pokazat\n //ovdje spremam u polje p[stock_id]=ime_firme\n $firm = $se->getFirmsById($user_stock->firm_id);\n $firm_names[$user_stock->firm_id] = $firm->name;\n if($user_stock->total_amount > 0){\n $stocks[] = $user_stock;\n }\n }\n $this->registry->template->userStocks = $stocks;\n $this->registry->template->firm_names = $firm_names;\n $this->registry->template->show('saldos_index');\n }", "public function index()\n {\n $transactions = Transaction::all();\n $categories = Category::all();\n return view('admin.transaction.index', compact('transactions', 'categories'));\n }", "public function showHistory()\n {\n return view('customer.purchase-history', ['cart_items' => Cart::where('user_id', auth()->user()->id)->where('checkout_id', '!=', null)->simplePaginate(10)]);\n }", "public function show(Transaction $transaction)\n {\n }", "public function render()\n {\n return view('components.stocks.index');\n }", "public function getQIKUsage()\n {\n\n // $stock_id = array();\n // foreach ($stocks as $stock) {\n // $stock_id[] = $stock->id;\n // }\n \n $usages = Qikusage::orderBy('created_at', 'desc')->get();\n // $newusages = [];\n // foreach($stocks as $stock) {\n // foreach($usages as $usage) {\n // if($stock->name == $usage->qikstock->name) {\n // array_push($newusages, $usage);\n // }\n // }\n // }\n // dd($newusages);\n return view('qikusages.index')\n ->withUsages($usages);\n }", "function avisos_stock_bis()\n\t{\n\t\t$query=\"SELECT id,codigo from productos \";\n\t\t$result= mysql_query($query);\n\t\t?><TABLE border=\"1\">\n\t\t<TR>\n\t\t\t<TH>CODIGO</TH>\n\t\t\t<TH>COLOR</TH>\n\t\t\t<TH>TALLE</TH>\n\t\t\t<TH>CANTIDAD TOTAL</TH>\n\t\t</TR>\n\t\t<? $contador = 0;\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{ //recorro todos los productos 1 por 1\n\n\t\t\t// AHORA SE RECORRO LOS COLORES\n\t\t\t$query_color=\"SELECT * FROM colores\";\n\t\t\t$result_color= mysql_query($query_color);\n\t\t\twhile ($row_color = mysql_fetch_assoc($result_color))\n\t\t\t{\n\n\t\t\t\t$query_talle=\"SELECT * FROM talles\";\n\t\t\t\t$result_talle= mysql_query($query_talle);\n\t\t\t\twhile ($row_talle = mysql_fetch_assoc($result_talle))\n\t\t\t\t{\n\n\n\t\t\t\t\t$query_avisos=\"SELECT SUM(cantidad) AS cantidad_total, aviso_stock FROM productos AS P inner join productos_stock as PS ON PS.idProducto = P.codigo WHERE codigo = '\".$row[\"codigo\"]. \"' and idcolor = '\".$row_color[\"id\"]. \"' and idtalle = '\".$row_talle[\"id\"]. \"' group by codigo\";\n\t\t\t\t\t$result_avisos = mysql_query($query_avisos);\n\t\t\t\t\tif($row_avisos = mysql_fetch_assoc($result_avisos))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($row_avisos[\"cantidad_total\"] < $row_avisos[\"aviso_stock\"])\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t//\tECHO \"<FONT SIZE=3 COLOR=blue>EL PRODUCTO <A HREF='http://localhost/control_stock/admin/productos/index.php?accion=detail&id=\".$row[\"id\"].\"'>\" . $row[\"codigo\"] . \"</a> COLOR : \".$row_color[\"nombre\"].\" TALLE : \".$row_talle[\"nombre\"].\" TIENE DE STOCK : \".$row_avisos[\"cantidad_total\"].\" </FONT><br>\";\n\t\t\t\t\t\t$contador++;\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<TR class=\"<?=($contador%2==0? \"fila_par\":\"fila_impar\");?>\">\n\t\t\t\t\t\t\t<TD><A HREF='<?=ADMIN?>productos/index.php?accion=detail&id=<?=$row[\"id\"]?>'><?= $row[\"codigo\"];?></a></TD>\n\t\t\t\t\t\t\t<TD><?= $row_color[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_talle[\"nombre\"];?></TD>\n\t\t\t\t\t\t\t<TD><?= $row_avisos[\"cantidad_total\"];?></TD>\t\t\t\t\t\t\t\n\t\t\t\t\t\t</TR>\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}//END WHILE TALLES\n\t\t\t}//END WHILE COLORES\n\t\t}//EN DWHILE PRODUCTOS\n\t\t?></TABLE><?\n\t}", "public function htmlTemplate()\n\t{\t\n\t\treturn 'stock_row';\n\t}", "public function actionProduct_stock_info() {\r\n\r\n if ((Yii::app()->user->isGuest) || (!Yii::app()->request->isAjaxRequest)) {\r\n throw new CHttpException(403, 'Access Forbidden.');\r\n }\r\n\r\n $prod_id = Yii::app()->request->getParam('prod_id');\r\n $ref_num = Yii::app()->request->getParam('ref_num');\r\n\r\n $cost = 0;\r\n $price = 0;\r\n $cur_stock = 0;\r\n\r\n $model = new ProductStockEntries();\r\n $model = $model->getProductStockInfo($prod_id, $ref_num);\r\n\r\n if (!empty($model)) {\r\n $cost = ( empty($model['productDetails']->purchase_price) || ($model['productDetails']->purchase_price <= 0 ) ) ? $model->purchase_price : $model['productDetails']->purchase_price;\r\n $price = ( empty($model['productDetails']->selling_price) || ($model['productDetails']->selling_price <= 0 ) ) ? $model->selling_price : $model['productDetails']->selling_price;\r\n $cur_stock = $model['productDetails']['productStockAvails']->quantity;\r\n }\r\n\r\n $response['cost'] = $cost;\r\n $response['price'] = $price;\r\n $response['cur_stock'] = $cur_stock;\r\n\r\n echo CJSON::encode($response);\r\n exit;\r\n }", "public function index(LogStockDataTable $logStockDataTable)\n {\n return $logStockDataTable->render('log_stocks.index');\n }", "public function index()\n {\n $data['transactions'] = Transaction::with(['category', 'source', 'user'])->get();;\n return view('transactions.list', $data);\n }", "public function index()\n {\n //\n $categories=Category::get();\n $transactions= auth()->user()->getTransactionByDate();\n $total_expense= auth()->user()->getTodayExpense();\n $total_income = auth()->user()->getTodayIncome();\n $net_total=$total_expense-$total_income;\n $totals=[\n 'total_expense'=>$total_expense,\n 'total_income' =>$total_income,\n 'net_total' =>$net_total\n ];\n return view('transaction.index',compact('transactions','categories','totals'));\n }", "public function actionFundsSent()\n\t{\n\t\t$operations = Operation::find()\n\t\t\t->andWhere('sender_id = :senderId', [\n\t\t\t\t':senderId' => Yii::$app->user->id,\n\t\t\t])\n\t\t\t->orderBy('id DESC')->all();\n\n\t\t$dataProvider = new ArrayDataProvider([\n\t\t\t'allModels' => $operations,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 10,\n\t\t\t],\n\t\t]);\n\n\t\treturn $this->render('fundsSent', [\n\t\t\t'dataProvider' => $dataProvider,\n\t\t]);\n\t}", "public function index()\n {\n $data = DB::table('transactions')->where('user_id', Auth::user()->id)->orderBy('created_at','desc')->get();\n return view('wallet.transaction.list_all', compact('data'));\n }", "public function tradinghistory()\n {\n\n return view('user.thistory')\n ->with(array(\n\n 't_history' => tp_transactions::where('user', Auth::user()->id)\n ->where('type', 'ROI')\n ->orderBy('id', 'desc')\n ->get(),\n 'title' => 'Trading History',\n 'settings' => settings::where('id', '=', '1')->first(),\n ));\n }", "public function index()\n {\n $stock_keluar = tb_stock_keluar::all();\n $tb_outlet = tb_outlet::all();\n return view('pengiriman.pengiriman-tampil_stockKeluar', compact('stock_keluar', 'tb_outlet'));\n }", "public static function stockReport()\n {\n $rawData = DB::table('rewards')\n ->selectRaw('COUNT(*) count, reward_providers.name, SUM(value) total_value, value')\n ->leftJoin('reward_providers', 'rewards.reward_provider_id', '=', 'reward_providers.id')\n ->whereNull('complaint_id')\n ->groupBy('reward_provider_id', 'value')\n ->get();\n\n return static::formatStockReportForTable($rawData);\n }", "public function actionViewCart()\n {\n $groupCart = [];\n\n $cart = Cart::find()->where('uid = :uid',[':uid' => Yii::$app->user->identity->id])->joinWith(['food','selection','nick'])->all();\n \n foreach($cart as $i=> $single)\n {\n $promotion = PromotionController::getPromotioinPrice($single->price,$single->fid,1);\n if(is_array($promotion))\n {\n\n $single->promotion_enable = 1;\n \n }\n if(!empty($single['selection']))\n {\n foreach($single['selection'] as $selection)\n {\n $data = foodSelection::find()->where('foodselection.ID = :id',[':id' => $selection->selectionid])->joinWith('selectedtpye')->one();\n $groupSelection[$data['selectedtpye']['cookieName']][] = $data['cookieName'];\n }\n \n $cart[$i]->groupselection = $groupSelection; \n }\n\n $groupSelection = [];\n }\n\n foreach($cart as $single)\n {\n $groupCart[$single['area']][] = $single;\n \n }\n\n return $this->render('cart',['groupCart' => $groupCart]);\n }", "public function index()\n {\n $transactions = Transaction::get();\n return view('admin.transaction.index',[\n 'transactions' => $transactions\n\n ]);\n }", "public function show(StockDetail $stockDetail)\n {\n //\n }", "public function index()\n {\n $books=Book::all();\n return view('Backend.Pages.Book.Stock.index',compact('books'));\n }", "protected function showTransactions($transactions)\n {\n foreach ($transactions as $transaction) {\n $transaction[2] = number_format($transaction[2], self::DECIMALS);\n $transaction[2] = self::GBP . $transaction[2];\n\n echo implode(self::SEPARATOR, $transaction);\n echo PHP_EOL;\n }\n }", "public function index()\n {\n $transactions=Transaction::all();\n $accountings= Transaction::where('department', 'Accounting')->get();\n $cashiers= Transaction::where('department', 'Cashier')->get();;\n $registrars= Transaction::where('department', 'Registrar')->get();;\n\n\n return view('transactions.index',['transactions'=>$transactions, 'accountings' => $accountings, 'registrars' => $registrars, 'cashiers' => $cashiers]);\n }", "public function index()\n {\n $getAllTransaction = \\seekit\\transaction::orderBy('created_at','desc')->paginate(10);\n return view('transaction.index')->with('queriedTransaction',$getAllTransaction);\n }", "public function stock()\n {\n if($this->quantity <= 5)\n {\n return \"Low Stock\";\n }\n\n return \"In Stock\";\n\n }", "public function actionStock($ACCESS_GROUP,$PRODUCT_ID,$STORE_ID)\r\n {\r\n $model = new ProductStock();\r\n if ($model->load(Yii::$app->request->post())) {\r\n $models = Product::find()->where(['PRODUCT_ID'=>$PRODUCT_ID])->one();\r\n $model->PRODUCT_ID=$PRODUCT_ID;\r\n $model->ACCESS_GROUP=$ACCESS_GROUP;\r\n $model->STORE_ID=$STORE_ID;\r\n date_default_timezone_set('Asia/Jakarta');\r\n $model->INPUT_TIME=date('H:i:s');\r\n $model->INPUT_DATE=date('Y-m-d');\r\n if ($model->save(false)) {\r\n Yii::$app->session->setFlash('success', \"Penyimpanan Stock Produk <b>\".$models->PRODUCT_NM.\"</b> Berhasil\");\r\n return $this->redirect(['index-stock','productid'=>$PRODUCT_ID]);\r\n }\r\n }\r\n $productdetail = ProductSearch::find()->joinWith('store')->where(['store.ACCESS_GROUP'=>$ACCESS_GROUP,'PRODUCT_ID'=>$PRODUCT_ID,'store.STORE_ID'=>$STORE_ID])->one();\r\n \r\n return $this->renderAjax('_form_stock', [\r\n 'model' => $model,\r\n 'productdetail'=>$productdetail\r\n ]);\r\n }", "public function sales()\n {\n $orders = Order::seller(auth()->id())->paginate(20);\n $transactioncount = Order::transactioncount(auth()->id());\n\n return view('frontend.order.sales', compact('orders', 'transactioncount'));\n }", "public function productStocks($product_id)\n {\n $product_id = Hashids::decode($product_id)[0];\n\n $product = Product::find($product_id);\n\n return view('company.products.stock_history', compact('product'));\n }", "public function index()\n {\n //\n $transactions = Transaction::all();\n return view('admin.transaction.index', compact('transactions'));\n }", "public function create()\n {\n return view('admin.stock.create')\n ->with('categories', StockCategory::all())\n ->with('branches', Branch::all());\n }", "function show_cart(){\n \t$output = '';\n \t$no = 0;\n \tforeach ($this->cart->contents() as $items) {\n \t\t$no++;\n \t\t$output .='\n \t\t<tr>\n \t\t<td>'.$items['name'].'</td>\n \t\t<td>'.number_format($items['price']).'</td>\n \t\t<td>'.$items['qty'].'</td>\n \t\t<td>'.number_format($items['subtotal']).'</td>\n \t\t<td><button type=\"button\" id=\"'.$items['rowid'].'\" class=\"hapus_cart btn btn-danger btn-xs\">Batal</button></td>\n \t\t</tr>\n \t\t';\n \t}\n \t$output .= '\n \t<tr>\n \t<th colspan=\"3\">Total</th>\n \t<th colspan=\"2\">'.'Rp '.number_format($this->cart->total()).'</th>\n \t</tr>\n \t';\n \treturn $output;\n }", "public static function getLowStock() {\n $dataUnit = ArrayHelper::map(Unit::find()->where(['<>','status','inactive'])->all(), 'id', 'unit');\n /* custom sql query */\n $sqlQuery = \" \n SELECT \n s.id,\n s.part_id,\n p.part_no,\n p.restock,\n p.manufacturer\n FROM \n stock s,\n part p\n WHERE \n s.part_id = p.id AND\n s.status = 'active'\n GROUP by\n s.part_id\n \";\n\n $stockQuery = Yii::$app->db->createCommand($sqlQuery)->queryAll();\n // d($stockQuery);exit;\n /* custom sql query for grand total only */\n foreach ( $stockQuery as $key => $sQ){\n $partId = $sQ['part_id'];\n $sqlQueryTotal = \" \n SELECT \n sum(quantity) sumsQ,\n unit_id\n FROM \n stock s\n WHERE\n s.status = 'active' AND \n s.part_id = $partId\n \";\n\n $stockQtyTotal = Yii::$app->db->createCommand($sqlQueryTotal)->queryOne();\n if ( number_format($stockQtyTotal['sumsQ'], 3, '.', '') >= $stockQuery[$key]['restock'] ) {\n unset($stockQuery[$key]);\n } else {\n $stockQuery[$key]['sumsQ'] = number_format($stockQtyTotal['sumsQ'], 3, '.', '');\n $stockQuery[$key]['unit_id'] = $dataUnit[$stockQtyTotal['unit_id']];\n }\n }\n\n\n /* get result data here */\n $data['dataProvider'] = [\n 'key'=>'id',\n 'pagination' => [\n 'pageSize' => 20,\n ],\n 'allModels' => $stockQuery,\n 'sort' => [\n 'attributes' => ['part_id'],\n ],\n ];\n $data['stockQuery'] = $stockQuery;\n\n\n\n return $data;\n }", "public function actionTransaction(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $transactionsIn = Transaction::find()->joinWith('order')->joinWith('post')->joinWith('withdraw')->where([\n 'payment_status'=>'completed', \n 'post_services.owner_id'=>\\Yii::$app->user->getId(),\n ])->all();\n $transactionsOut = Transaction::find()->joinWith('order')->joinWith('post')->where([\n 'payment_status'=>'completed', \n 'accepted_orders.user_id'=>\\Yii::$app->user->getId(),\n ])->all();\n return $this->render('transactions', ['transactionsIn'=>$transactionsIn, 'transactionsOut'=>$transactionsOut, 'user'=>$user]);\n }", "public function index()\n {\n //TransactionFinal::with(\"transactionDetails\")->first();\n\n return view(\"backend.transaction.transaction-detail.view\", [\n \"transactionFinals\" => TransactionFinal::with([\"transactionDetails\", \"transactionType\", \"transactionCategory\"])->get()\n ]);\n }", "public function create()\n {\n return view('log_stocks.create');\n }", "public function index()\n {\n //\n return view('mes.reports.transactions');\n }", "public function index()\n {\n $companies = Company::all();\n return view('stock.create')\n ->with('companies', $companies);\n }", "public function showStock($id)\n\t{\n\t\treturn $this->stock->where('id',$id)->first();\n\t}", "public function index()\n {\n //\n $barang = Barang::with('barangmasuk','barangkeluar')->get();\n $new_barang = [];\n\n foreach ($barang as $key => $value) {\n $countbm = 0;\n $countbk= 0;\n foreach ($value[\"barangmasuk\"] as $key => $bm) {\n $countbm += $bm->jumlah_masuk;\n }\n foreach ($value[\"barangkeluar\"] as $key => $bk) {\n $countbk += $bk->jumlah_keluar;\n }\n\n $sementara = $value;\n $sementara [\"total_barang_keluar\"] = $countbk;\n $sementara[\"total_barang_masuk\"] = $countbm;\n array_push($new_barang,$sementara);\n }\n // dd($new_barang);\n return view('stock.main',compact('new_barang'));\n }", "public function index()\n {\n try {\n $groupedCartItems = [];\n $carts = ShoppingCart::where('username', Auth::user()->username)->get();\n foreach ($carts as $item) {\n $groupedCartItems[$item->shop][] = $item->toArray();\n }\n //var_dump($groupedCartItems); die();\n return view('front.carts.index', compact('groupedCartItems'));\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n \n }", "function view_items() {\n $items = \\Model\\Item::all();\n \n $this->SC->CP->load_view('stock/view_items',array('items'=>$items));\n }", "public function index()\n\t{\n\t\t$sharetransactions = Sharetransaction::all();\n\n\t\treturn View::make('sharetransactions.index', compact('sharetransactions'));\n\t}" ]
[ "0.66544664", "0.65513986", "0.65513986", "0.65513986", "0.6292575", "0.6291591", "0.61816627", "0.6169857", "0.60764563", "0.60250205", "0.6018863", "0.5996812", "0.59531486", "0.5904189", "0.58546036", "0.5835758", "0.5807579", "0.58060265", "0.5802812", "0.5801791", "0.5761326", "0.5752478", "0.5750103", "0.5739775", "0.5717905", "0.57082015", "0.56751335", "0.5654401", "0.56380415", "0.56350034", "0.5634598", "0.5619827", "0.5605152", "0.55780345", "0.5574208", "0.5574065", "0.557364", "0.5568882", "0.55466634", "0.55179185", "0.54855585", "0.548047", "0.5474811", "0.54719615", "0.5466118", "0.5455223", "0.5430513", "0.5425361", "0.54250115", "0.5417092", "0.5415474", "0.5396757", "0.5396757", "0.5396757", "0.5380937", "0.53713936", "0.53653306", "0.5359419", "0.5354234", "0.5345723", "0.53444076", "0.53421926", "0.53378797", "0.5330974", "0.5330687", "0.53099006", "0.5308736", "0.5307155", "0.5294619", "0.52823764", "0.5273745", "0.52667737", "0.52646357", "0.52623767", "0.5260534", "0.52587885", "0.52557045", "0.5250827", "0.52416897", "0.5238513", "0.5233652", "0.523331", "0.5223632", "0.5221278", "0.52209336", "0.521657", "0.5214893", "0.52143025", "0.5199943", "0.5197664", "0.517674", "0.51754564", "0.5173727", "0.5171414", "0.51704806", "0.5170123", "0.5167888", "0.51676184", "0.51666933", "0.51491934" ]
0.5739939
23
Grabs the latest Transaction.
function latestTransaction() { $this->db->select('Player'); $this->db->from('transactions'); $this->db->order_by('Datetime', 'desc'); $this->db->limit(1); $query = $this->db->get(); $result = $query->result_array(); if(empty($result)) return null; return $result[0]["Player"]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTransaction();", "public function trans()\n {\n $transaction = new Transaction;\n $transaction_last = $transaction->orderBy('id', 'desc')->first();\n\n $transaction_type = $transaction_last->payment_type;\n $transaction_last_id = $transaction_last->id;\n $current_transaction = $transaction->find($transaction_last_id);\n $current_transaction->payment_status = true;\n $current_transaction->save();\n\n sleep(3);\n\n $transaction_last = $transaction->orderBy('id', 'desc')->first();\n\n return $transaction_last->toJson();\n\n // if($transaction_type == \"ewallet\"){\n // $transaction_last = $transaction->orderBy('id', 'desc')->first();\n\n // return $transaction_last->toJson();\n // }\n // else{\n // // Update status to true\n // $transaction_last_id = $transaction_last->id;\n // $current_transaction = $transaction->find($transaction_last_id);\n // $current_transaction->payment_status = true;\n // $current_transaction->save();\n\n // sleep(3);\n\n // $transaction_last = $transaction->orderBy('id', 'desc')->first();\n\n // return $transaction_last->toJson();\n // }\n }", "public function getLastTxn()\n {\n if (isset($this->resultArrayTransaction) === \\FALSE)\n {\n return NULL;\n }\n $cnt = count($this->resultArrayTransaction);\n if ($cnt == 0)\n {\n return NULL;\n }\n return $this->resultArrayTransaction[$cnt-1]->getResult();\n }", "public function first(): TransactionJournal;", "public function getTransaction()\r\n\t{\r\n\t\treturn $this->transaction;\r\n\t}", "public function getTransaction()\n {\n return $this->transaction;\n }", "public function getTransaction()\n {\n return $this->transaction;\n }", "public function getTransaction()\n {\n return $this->transaction;\n }", "protected function getLastOrder(){\n return $this->_orderFactory->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($this->onepage->getLastOrderId());\n }", "public function getTransaction(): Transaction\n {\n return $this->transaction;\n }", "public function getTransaction(): Transaction\n {\n return $this->transaction;\n }", "protected function _getLastOrder()\n {\n $lastOrderId = $this->_getLastOrderId();\n /** @var Mage_Sales_Model_Order $order */\n $order = Mage::getModel('sales/order');\n $order->load($lastOrderId);\n return $order;\n }", "public function getLastbuy()\n {\n return $this->get(self::_LASTBUY);\n }", "public function getTransaction() {\r\n\t\treturn $this->objDatabaseConnection->transaction();\r\n\t}", "public function getLatestRecord();", "public function getCurrentTransaction()\n {\n if ($this->_transaction !== null) {\n if ($this->_transaction->getActive()) {\n return $this->_transaction;\n }\n }\n return null;\n }", "public function getLastTransactionID()\n {\n }", "public function rolltrans(){\n\t\t$this->query(\"ROLLBACK\");\n\t\treturn $this->transaction;\n\t}", "public function getTransaction()\n {\n return $this->_transaction && $this->_transaction->getIsActive() ? $this->_transaction : null;\n }", "public function getTransactionRecord()\n {\n return $this->transactionRecord;\n }", "public function getTransaction()\n {\n return self::createTransaction($this, $this->printBuffer, $this->pdfDocument, $this->totalWidth);\n }", "abstract protected function getTransactions();", "public function latest();", "public function last()\n {\n return $this->execGetRequest(['allow_state' => true], UrlBuilder::RESOURCE_GET_LATEST_NEWS);\n }", "public function addTransaction()\n {\n if(null === $this->obj_txn) {\n $this->obj_txn = new Transaction();\n }\n return $this->obj_txn;\n }", "public function getDatabaseTransaction() {\n\t\t\treturn $this->databaseTransaction;\n\t\t}", "public function getDatabaseTransaction() {\n\t\t\treturn $this->databaseTransaction;\n\t\t}", "public function getLastRequest()\n {\n $last = end($this->transactions);\n\n return $last['request'];\n }", "abstract public function determineTransaction();", "protected function _getTransactionModel()\n\t{\n\t\treturn $this->getModelFromCache('Brivium_Store_Model_Transaction');\n\t}", "protected function _getTransactionModel()\n\t{\n\t\treturn $this->getModelFromCache('Brivium_Store_Model_Transaction');\n\t}", "public function getTransactions();", "protected function recordLastTransactionID()\n {\n }", "public function getTransactionId();", "public function getTransactionId();", "public function getTransaction($txid);", "public function getLatestReport()\n {\n return RoadDamageReport::where('roaddamage_id', $this->id)->latest()->first();\n }", "public function getLastOrder();", "public static function getObject()\n {\n return new TX(self::getJson());\n }", "public function doTransaction()\n\t{\n\t\t$this->initRequest();\n\n\t\t$this->setTransaction([\n\t\t\t'ReportTxnDetail' => [\n\t\t\t\t'TxnId' => $this->TxnId\n\t\t\t]\n\t\t]);\n\t\t\n\t\treturn $this->Transaction();\n\t}", "public function last()\n {\n $record = R::findOne( $this->table_name(), \" order by id desc \");\n\n return $this->map_reford_to_object( $record );\n }", "public function getTransaction($id){\n\n $gateway = $this->getGateway();\n \n $transaction = $gateway->transaction()->find($id);\n\n return $transaction;\n\n }", "public function getLast()\n {\n // inicia transao\n if ($conn = TTransaction::get()) {\n // instancia instruo de SELECT\n $sql = new TSqlSelect;\n $sql->addColumn('max(ID) as ID');\n $sql->setEntity($this->getEntity());\n\n\n // cria log e executa instruo SQL\n TTransaction::log($sql->getInstruction());\n $result = $conn->Query($sql->getInstruction());\n // retorna os dados do banco\n $row = $result->fetch();\n\n return $row[0];\n } else {\n // se no tiver transao, retorna uma exceo\n throw new Exception('No h transao ativa !!');\n }\n }", "public function getReturnOwnerTransaction()\n {\n $result = null;\n\n $xpcBackReference = \\XLite\\Core\\Request::getInstance()->xpcBackReference;\n\n if ($xpcBackReference) {\n\n $result = $this->searchTransactionByBackReference($xpcBackReference);\n\n if (!$result) {\n // Hack against broken GET-parameter\n $xpcBackReference = substr($xpcBackReference, 0, 32);\n\n $result = $this->searchTransactionByBackReference($xpcBackReference);\n }\n }\n\n return $result;\n }", "public function getTransactionId()\n {\n return $this->transactionId++;\n }", "public function getTx()\n {\n $client = new Client(['baseUrl' => 'https://blockchain.info']);\n $response = $client->get('rawaddr/' . $this->address)->send();\n if ($response->statusCode == '200') {\n $json = $response->getContent();\n $info = json_decode($json, true);\n if (isset($info['n_tx']) && $info['n_tx'] > 0) {\n foreach ($info['txs'] as $tx) {\n /* check outs */\n foreach ($tx['out'] as $output) {\n if ($output['addr'] == $this->address && ($output['value'] / 100000000) == $this->request_balance) {\n /* get tx info/ check double spend */\n return $this->verifyTx($tx['hash']);\n }\n }\n }\n }\n }\n return null;\n }", "public function last()\n {\n return (null === $this->getDraft()) ? $this->getData($this->count() - 1) : $this->getDraft()->last();\n }", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "public function getLatestTrans($sender, $params)\r\n\t{\r\n\t\t$results = $errors = array ();\r\n\t\ttry {\r\n\t\t\t$transactions = Transaction::getAllByCriteria ('trans.organizationId = ?', array(Core::getOrganization()->getId()), true, 1, 10, array ('trans.id' => 'desc') );\r\n\t\t\t$results ['items'] = array();\r\n\t\t\tforeach($transactions as $trans)\r\n\t\t\t\t$results ['items'][] = $trans->getJson();\r\n\t\t} catch ( Exception $ex ) {\r\n\t\t\t$errors [] = $ex->getMessage ();\r\n\t\t}\r\n\t\t$params->ResponseData = StringUtilsAbstract::getJson ( $results, $errors );\r\n\t}", "static function fetchLastManualTransactions() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \"SELECT job_id, MAX(booking_reference) AS booking_reference, MAX(post_date) AS post_date, \n MAX(masked_card_number) AS masked_card_number, MAX(payment_amount) AS payment_amount, \n\t MAX(successful) AS successful, MAX(help_text) AS help_text, MAX(status) AS status, \n\t MAX(data_href) AS data_href,\n\t MAX(checkin_date) AS checkin_date,\n\t MAX(last_updated_date) AS last_updated_date\n FROM (\n SELECT j.job_id, jp1.value AS booking_reference, p.post_date, p.masked_card_number, \n COALESCE(p.payment_amount, CAST(jp2.value AS DECIMAL(10,2))) AS payment_amount, \n\t\t p.successful, p.help_text, j.status, \n (SELECT MAX(c.data_href) FROM wp_lh_calendar c WHERE c.booking_reference = jp1.value) AS data_href,\n (SELECT MAX(c.checkin_date) FROM wp_lh_calendar c WHERE c.booking_reference = jp1.value) AS checkin_date,\n COALESCE(j.last_updated_date, j.created_date) AS last_updated_date\n FROM wp_lh_jobs j\n JOIN wp_lh_job_param jp1 ON j.job_id = jp1.job_id AND jp1.name = 'booking_ref'\n JOIN wp_lh_job_param jp2 ON j.job_id = jp2.job_id AND jp2.name = 'amount'\n LEFT OUTER JOIN wp_pxpost_transaction p ON p.job_id = j.job_id\n WHERE j.classname IN ('com.macbackpackers.jobs.ManualChargeJob')\n ) t \n GROUP BY job_id\n ORDER BY last_updated_date DESC\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n // if empty, then no jobs exists\n if(empty($resultset)) {\n return null;\n }\n return $resultset;\n }", "public function getTransactionId() { return $this->transactionId; }", "public function getLatestReceiptInfo()\n {\n return $this->_latest_receipt_info;\n }", "public function getTransaction()\n {\n $transaction = new Transaction($this->getCustomer(), $this->getPayment());\n $transaction->setBackUrl(\n $this->urlHelper->getBackUrl($this->paymentAdapter->getBackUrl())\n )->setConfirmUrl(\n $this->urlHelper->getNotificationUrl($this->paymentAdapter->getConfirmUrl())\n )->setCustomerAdditionalData($this->getCustomerAdditionalData());\n\n return $transaction;\n }", "public function gettransaction($transaction){\n return $this->bitcoin->gettransaction($transaction);\n }", "public function transaction()\n {\n return $this->hasOne('App\\Models\\Transaction');\n }", "public function getTransactionReference()\n {\n return $this->transactionReference;\n }", "function GoodReceiptTransaction()\n {\n $sql=\"SELECT * FROM INVT_T_GR_HEAD\";\n return $this->db->query($sql, $return_object = TRUE)->result_array();\n }", "public function last() {\n $this->_active_query->order(['DESC' => 'id']);\n return $this->first();\n }", "public function findLatest(): Booking\n {\n return $this->bookingRepository->getLatest();\n }", "public function receipts() {\n $station = auth()->user()->station_id;\n\n $trans = DB::select('select * from trans_info where rcv_stn_id = ? order by id desc', [$station]);\n\n return $trans;\n }", "public function getWalletTransaction()\n {\n return $this->hasOne(WalletTransaction::class, ['id' => 'transaction_id']);\n }", "public function getSerializedTransaction()\n {\n return $this->serialized_transaction;\n }", "public function getTransactionCollection()\n {\n if (!$this->collection) {\n $customerId = $this->customerSession->getCustomerId();\n\n $orderCollection = $this->orderCollectionFactory->create();\n $orderCollection->addFieldToFilter('customer_id', $customerId);\n $orderCollection->addFieldToFilter('state', ['neq' => Order::STATE_CANCELED]);\n $orderCollection->addFieldToFilter('state', ['neq' => Order::STATE_CLOSED]);\n $orderCollection->addFieldToFilter('rp.earn_points', ['gt' => 0]);\n $orderCollection->setOrder('main_table.entity_id', 'DESC');\n\n $orderSelect = $orderCollection->getSelect();\n $orderSelect->joinLeft(\n ['rt' => $orderCollection->getTable('mst_rewards_transaction')],\n 'main_table.entity_id = REPLACE(rt.code, \"order_earn-\", \"\")',\n ['rt.transaction_id', 'rt.created_at as transaction_created_at', 'rt.activated_at', 'rt.is_activated']\n );\n $orderSelect->joinLeft(\n [\n 'rp' => $orderCollection->getTable('mst_rewards_purchase')\n ],\n 'main_table.entity_id = rp.order_id AND rt.transaction_id IS NULL',\n [\n 'rp.purchase_id',\n 'rt.created_at as purchase_created_at',\n 'IF(rt.amount, rt.amount, rp.earn_points) as amount'\n ]\n );\n\n $this->collection = $orderCollection;\n }\n\n return $this->collection;\n }", "public function getLastActivity()\r\n {\r\n $lastId = end($this->messages);\r\n\r\n $lastMsg = new TicketMessage($lastId);\r\n $lastActive = $lastMsg->getTimeCreated();\r\n \r\n return $lastActive; \r\n }", "public function getLatest(): Job;", "public function getTransactionReference()\n {\n foreach (['vpc_MerchTxnRef', 'vpc_TransactionNo'] as $key) {\n if (isset($this->data[$key])) {\n return $this->data[$key];\n }\n }\n }", "public function getTransactionResult() {\n\t\treturn $this->transaction_result;\n\t}", "public function commitTransaction()\n {\n\t\treturn $this->db->fireFastSqlQuery(\"COMMIT\");\n\t}", "public function transaction()\n {\n return $this->hasOne('App\\Model\\Transaction','request_id');\n }", "private function getNextTransactionID(){\n $db = $this->connectDB();\n $query = \"SELECT MAX(id) as curr_max_id FROM transaction;\";\n $stmt = $db->prepare($query);\n $stmt->execute();\n $stmt->store_result();\n $stmt->bind_result($curr_max_id);\n $stmt->fetch();\n // Return the current largest id plus 1 as the new ID.\n return $curr_max_id + 1;\n }", "public function getAutoAddCardTransaction()\n {\n return $this->autoAddCardTransaction;\n }", "function getParent() {\n if (!empty($this->parent_txn_id)) {\n return userpoints_transaction_load($this->parent_txn_id);\n }\n }", "public function GetCommit()\n\t{\n\t\treturn $this->commit;\n\t}", "function getRecentPurchaseId(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT MAX(idPurchase)AS idPurchase from purchases\");\n \n $results=[];\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n else{\n $results = false;\n }\n return $results;\n }", "public function getLast ()\n {\n return reset ( $this->_list ) ;\n }", "public function last()\n {\n return $this->execute(\n $this->syntax->selectSyntax(get_object_vars($this->order($this->key, 'DESC')->limit(1)))\n );\n }", "public function getLatestItem()\n {\n return end($this->items);\n }", "function fetchLastBetID() {\n $query = \"SELECT BETID FROM \" . $this->table_name_1 . \n \" WHERE BETID = (select MAX(BETID) FROM \" . $this->table_name_1 . \n \" WHERE ACCOUNTID=\" . $this->accountID . \")\";\n\n $stmt = $this->database->executePlainSQL($query);\n return $stmt;\n }", "function _getTransactions()\n {\n $pr = new PostingRules();\n $pr->getTransactions(&$this);\n }", "public function getTransactionId() {\n return $this->transactionId;\n }", "public function getLastChange()\n {\n return $this->get(self::_LAST_CHANGE);\n }", "public function getLastChange()\n {\n return $this->get(self::_LAST_CHANGE);\n }", "public function getTransactionResult()\n {\n return $this->transactionResult;\n }", "function last_transaction($blog_id) {\r\n\t $trans_meta = get_blog_option($blog_id, 'psts_payments_log');\r\n\r\n\t if ( is_array( $trans_meta ) ) {\r\n\t return array_pop( $trans_meta );\r\n\t } else {\r\n\t return false;\r\n\t }\r\n\t}", "private function getTX()\n {\n return $this->getRemote($this->RemoteQuery['ip'], \".1.3.6.1.2.1.10.127.1.2.2.1.3.2\", $this->RemoteQuery['community']);\n }", "public function getTransactionLog()\n {\n if($this->transactionLog==null)\n {\n $this->transactionLog = new TransactionLog();\n }\n return $this->transactionLog;\n }", "function getTxnId() {\n return $this->txn_id;\n }", "public function getTransactionReference()\n {\n return $this->getDataItem('transactionReference');\n }", "public function getNew() { return $this->getNewItem(); }", "abstract public function getLatestCommitTime($ref);", "function getLastUpdate(): \\Carbon\\Carbon\n{\n return cache()->remember('i.lastUpdate', getCacheILifetime('lastUpdate'), function () {\n $lastUpdate = \\App\\Models\\Transaction::select('updated_at')->orderBy('created_at', 'desc')\n ->limit(1)\n ->first();\n return !empty($lastUpdate->craeted_at) ? \\Carbon\\Carbon::parse($lastUpdate->created_at) : \\Carbon\\Carbon::now();\n });\n}", "public function flip()\n {\n $transaction = new Transaction;\n $transaction_last = $transaction->orderBy('id', 'desc')->first();\n\n $transaction_last_id = $transaction_last->id;\n $current_transaction = $transaction->find($transaction_last_id);\n $current_transaction->payment_status = true;\n $current_transaction->save();\n\n sleep(3);\n\n $transaction_last = $transaction->orderBy('id', 'desc')->first();\n\n return $transaction_last->toJson();\n }", "public function transaction();", "public function transaction();", "public static function last()\n\t{\n\t\treturn self::new_instance_records()->last();\n\t}", "public function getLastchange()\n {\n return $this->get(self::_LASTCHANGE);\n }", "public function scopeGetLastId()\n {\n return $this->latest()->first()->id;\n }", "function trans_commit()\r\n\t{\r\n\t\treturn $this->db->trans_commit();\r\n\t}", "public function beginTransaction()\n {\n return $this->db->beginTransaction();\n }", "public function getTransactionId()\n {\n return $this->transaction_id;\n }" ]
[ "0.6835274", "0.6417674", "0.6339195", "0.6331585", "0.63169086", "0.63167953", "0.63167953", "0.63167953", "0.6281841", "0.6240788", "0.6240788", "0.62021065", "0.6184833", "0.61526763", "0.6104941", "0.6082612", "0.6027036", "0.6007436", "0.5971324", "0.5940315", "0.59023917", "0.5860366", "0.5804999", "0.57937557", "0.5782942", "0.57413596", "0.57413596", "0.5730287", "0.56973153", "0.5643422", "0.5643422", "0.5643377", "0.5606094", "0.56043476", "0.56043476", "0.5599735", "0.55971694", "0.5566781", "0.55630034", "0.5558675", "0.5555355", "0.55552024", "0.5534323", "0.5526009", "0.55059874", "0.5503112", "0.54926914", "0.5491006", "0.54889965", "0.54845643", "0.5463141", "0.54522055", "0.5450597", "0.5442655", "0.5438293", "0.54318655", "0.54281783", "0.5415482", "0.5403845", "0.5402081", "0.53838557", "0.5370295", "0.5363943", "0.5356352", "0.5356031", "0.5351216", "0.53468865", "0.53423655", "0.5324014", "0.53231096", "0.53109837", "0.5306605", "0.5306333", "0.53013676", "0.5291226", "0.5281079", "0.5278775", "0.52767384", "0.5275667", "0.52754766", "0.527488", "0.5274314", "0.52678746", "0.5266484", "0.5266423", "0.52617604", "0.52594036", "0.5241635", "0.5235976", "0.52340335", "0.5232178", "0.5231234", "0.52193", "0.52193", "0.52062", "0.5201345", "0.5179949", "0.5178132", "0.51710165", "0.5165949" ]
0.6359319
2
Get all the Transactions.
function getAllTransactions() { $transactions = $this->all(); /* Add additional attributes to each Stock */ foreach ($transactions as $transaction) { // Add a link to each stock's history page $transaction->href = '/transaction/' . $transaction->DateTime; } return $transactions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAll()\n {\n return $this->transactions;\n }", "public function getTransactions();", "private function getTransactions()\n {\n //====================================================================//\n // Load All Transactions on this Order\n /** @var Transaction $model */\n $model = Mage::getModel('sales/order_payment_transaction');\n\n return $model->getCollection()\n ->setOrderFilter($this->payment->getOrder())\n ->addPaymentIdFilter($this->payment->getId())\n ->setOrder('transaction_id', Varien_Data_Collection::SORT_ORDER_ASC);\n }", "public function index()\n {\n return Transactions::all();\n }", "public function getTransactions()\n {\n return $this->transactions;\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions() {\n\t\treturn $this->transactions;\n\t}", "public function transactions()\n {\n $collection = Transaction::search([\n TransactionSearch::ids()->in($this->transactionIds),\n ]);\n\n return $collection;\n }", "function get_all_transactions(){\n $str_query=\"select * from pos_transaction\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "public function getTransactions() {\n if (!$this->isInit()) {\n return null;\n }\n return $this->transactions;\n }", "public function index()\n {\n $transactions = Transaction::with([\n 'payment',\n 'customer',\n 'supplier', \n ])->get()->toArray();\n return $transactions;\n }", "abstract protected function getTransactions();", "public function getActiveTransactions()\n\t{\n\t\treturn $this->active_transactions;\n\t}", "public function transactions()\n {\n return $this->hasMany(Transaction::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function getAllTransaction()\n {\n $this->db->query(\n \"SELECT * FROM {$this->table} t INNER JOIN schedule s ON t.schedule_ID=s.schedule_ID INNER JOIN film f ON s.film_id=f.film_id\"\n );\n return $this->db->resultSet();\n }", "public function fetchAllTransactions()\n {\n try{\n $payments = Array();\n $sql = \"SELECT * FROM payment\";\n $result = $this->conn->query($sql);\n if($result->num_rows > 0){\n while ($row = $result->fetch_assoc()){\n $payments[] = $row;\n }\n return $payments;\n }else{\n return [];\n }\n }catch (Exception $e){\n return $e->getMessage();\n }\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class);\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class);\n }", "public static function get_transactions()\n\t{\n\t\tglobal $user_ID;\n\t\t\n\t\t$args = array(\n\t\t\t'posts_per_page'\t=> -1,\n\t\t\t'post_type'\t\t\t=> 'pxp_transactions',\n\t\t\t'post_status'\t\t=> 'private',\n\t\t\t'order'\t\t\t\t=> 'date',\n\t\t\t'orderby'\t\t\t=> 'ASC',\n\t\t\t'author'\t\t\t=> $user_ID\n\t\t);\n\n\t\t$query = get_posts( $args );\n\t\t\n\t\t$transactions = array();\n\t\t\n\t\tforeach( $query as $transaction )\n\t\t{\n\t\t\t$transactions[] = array(\n\t\t\t\t'ID'\t\t\t\t\t\t=> $transaction->ID,\n\t\t\t\t'transaction_description'\t=> $transaction->post_content,\n\t\t\t\t'transaction_date'\t\t\t=> date( 'F j, Y g:i A', strtotime( $transaction->post_date ) ),\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $transactions;\n\t}", "public function transactions()\n {\n return $this->hasManyThrough('App\\Transaction', 'App\\Individual',\n 'sacco_id', // Foreign key on Individuals table...\n 'individual_id', // Foreign key on Transactions table...\n 'id', // Local key on saccos table...\n 'id' // Local key on Individuals table...\n );\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class, $this->getForeignKey());\n }", "public function all($transactionToken = null)\n {\n $append = '';\n\n if ($transactionToken) {\n $append = '?since_token='.$transactionToken;\n }\n\n return $this->client->get('v1/transactions.json'.$append);\n }", "public function getconnectTransactions() {\n $yesterday = new \\DateTime('yesterday');\n $start_date = $yesterday->format('Y-m-d');\n $today = new \\DateTime('now');\n $end_date = $today->format('Y-m-d');\n $status = ApplaneConstentInterface::COMPLETED;\n //create the query\n $query = $this->createQueryBuilder('c');\n $query->select()\n ->Where('c.date >=:create_at', 'c.date <:end_at', 'c.status =:status')\n ->setParameter('create_at', $start_date)\n ->setParameter('end_at', $end_date)\n ->setParameter('status', $status);\n\n $result = $query->getQuery();\n $result_res = $result->getResult();\n return $result_res;\n }", "public function whmcs_get_transactions($params = array()) {\n\t\t$params['action'] = 'GetTransactions';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function index()\n {\n //\n $transactions = DB::table('transactions')->where('transaction_status', '=', 'Completed')->orderBy('created_at', 'desc')->get();\n\n return $transactions;\n }", "public function getTransactionInfos() {\n return $this->transactionInfos;\n }", "public function index()\n {\n $transactions = RecurringTransaction::getTransactionsForUser($this->user, $this->with);\n\n $transactions = TransactionMutator::set($this->set, $transactions);\n\n return $transactions->keyBy('id');\n }", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions ORDER BY DateTime DESC;\");\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function index()\n {\n $uid = auth()->user()->id;\n return Transaction::where('user_id', $uid)->get();\n }", "public static function getTransaction()\n {\n $query = new Query;\n return $query->select([ 'c.*', 'u.username', 'u.email','t.transaction_id', 't.transaction_amount',\n 't.payment_date as tn_payment_date'])\n ->from('contest as c')\n ->LeftJoin('transaction_details as t', 't.contest_id=c.id')\n ->LeftJoin('user as u', 'u.id=c.user_id')\n ->orderBy(['t.payment_date' => SORT_DESC]); \n }", "public function all() {\n $station = auth()->user()->station_id;\n\n $trans = DB::select('select * from trans_info where isu_stn_id = ? or rcv_stn_id = ? order by id desc',\n [$station, $station]);\n\n return response($trans);\n }", "public function index()\n {\n // Get transactions\n // Use Laravel’s pagination for showing Clients/Transactions list, 10 entries per page\n $transactions = Transaction::paginate(10);\n return TransactionResource::collection($transactions);\n }", "public function getTransactions(){\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions t JOIN products p ON p.Product_ID = t.Product_ID;\");\r\n $stmt->execute();\r\n $purchases = $stmt->fetchAll (PDO::FETCH_ASSOC);\r\n\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions WHERE Transaction_Type='DONATION';\");\r\n $stmt->execute();\r\n $donations = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n return array_merge($purchases,$donations);\r\n }", "public function transactions() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('transaction_id'));\n $data['transaction'] = $this->account_model->getTransactions(array('ttransactions.ttransaction_id' => $id));\n } else {\n $mfinancialyear_id = null;\n if ($this->session->has_userdata('financialyear')) {\n $financialyear_data = $this->session->userdata('financialyear');\n $mfinancialyear_id = $financialyear_data['mfinancialyear_id'];\n }\n if ($this->input->get('unlimited')) {\n $data['unlimited'] = true;\n $data['transactions'] = $this->account_model->getTransactions(false, array('mfinancialyear_id' => $mfinancialyear_id));\n } else {\n $data['transactions'] = $this->account_model->getTransactions(FALSE, array('mfinancialyear_id' => $mfinancialyear_id), 10);\n }\n }\n $this->view('transactions', $data);\n }", "public function transactionsAction() {\n\t\ttry {\n\t\t\t\t\n $pageHeading = \"Transactions\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n\t\t\t$objPaggination \t\t\t= new Base_Model_ObtorLib_Base_Lib_Paggination();\n \n\t\t\t$objTransactionsService \t\t= new Base_Model_Lib_Invoice_Service_Transaction();\n $objTransactionsEntity \t\t= new Base_Model_Lib_Invoice_Entity_Transaction();\n $objTransactionsService->transaction = $objTransactionsEntity;\n $totalResult = $objTransactionsService->searchCount();\n $page=$this->_getParam('page',1);\n\t\t\t$objPaggination->CurrentPage = $page;\n\t\t\t$objPaggination->TotalResults = $totalResult;\n\t\t\t$paginationData = $objPaggination->getPaggingData();\n\t\t\t$pageLimit1 = $paginationData['MYSQL_LIMIT1'];\n\t\t\t$pageLimit2 = $paginationData['MYSQL_LIMIT2'];\n\t\t\t\t\t\n\t\t\t$limit \t\t\t\t\t\t = \" LIMIT $pageLimit1,$pageLimit2\";\n \n if($page == ''){\n\t\t\t\t$page = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$result \t\t = $objTransactionsService->search($limit);\n\t\t\t$this->view->transactions = $result;\n\t\t\t$this->view->paggination = $objPaggination;\n\t\t\t$this->view->pageNum = $page;\n\t\t\t\n\t\t\t\n\t\t} catch ( Exception $ex ) {\n\t\t\tthrow new Exception ( '<ERROR>' . $ex->getMessage () . \"\\n\" );\n\t\t}\n\n\t}", "public function walletTransactionIdList()\n {\n return WalletTransaction::all();\n }", "public function getTransactions($params)\n {\n $whereData = [];\n\n foreach ($params as $param) {\n $whereData[] = [$param['col'], $param['op'], $param['val']];\n }\n\n return $transactions = self::where($whereData)->get();\n }", "public function getTransaction();", "public function actionIndex()\n {\n $searchModel = new TransactionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->sort->defaultOrder = ['created_at' => SORT_DESC];\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function transactions()\n {\n \treturn $this->hasMany('App\\Transaction');\n }", "private function transactions()\n {\n $invoiceModel = new InvoiceModel();\n $transactions = $invoiceModel->getAllInvoices();\n\n $csvData = [];\n $csvData[] = [\"Invoice ID\", \"Company Name\", \"Invoice Amount\"];\n if (!empty($transactions)) {\n foreach ($transactions as $transaction) {\n $csvData[] = [$transaction[\"id\"], $transaction[\"client\"], $transaction[\"invoice_amount_plus_vat\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"transactions_\" . time() . \".csv\");\n }", "public function getTxObservaciones()\n\t{\n\t\treturn $this->tx_observaciones;\n\t}", "public function getAll()\n {\n return $this->get();\n }", "public function show($id)\n {\n return Transactions::find($id);\n }", "public function get_transactions(){\n $this->load->database();\n\n $query = $this->db->select('type,is_of,date,amount,payment_mode,id')\n ->get('tbl_transactions');\n return $query->result_array();\n }", "public function getTransactionsAttribute() {\n return DB::table('transactions')\n -> leftjoin('accounts as paying', 'transactions.paying_id', '=', 'paying.id')\n -> leftjoin('accounts as receiving', 'transactions.receiving_id', '=', 'receiving.id')\n -> leftjoin('banks as paying_bank', 'paying.bank_id', '=', 'paying_bank.id')\n -> leftjoin('banks as receiving_bank', 'receiving.bank_id', '=', 'receiving_bank.id')\n -> leftjoin('users as payer', 'paying.user_id', '=', 'payer.id')\n -> leftjoin('users as receiver', 'receiving.user_id', '=', 'receiver.id')\n -> where('payer.id', $this -> id)\n -> orWhere('receiver.id', $this -> id)\n -> get(['transactions.id',\n 'paying.id as paying_account_id',\n 'payer.first_name as paying_first',\n 'payer.last_name as paying_last',\n 'paying_bank.id as paying_bank_id',\n 'paying_bank.name as paying_bank_name',\n 'receiving.id as receiving_account_id',\n 'receiver.first_name as receiving_first',\n 'receiver.last_name as receiving_last',\n 'receiving_bank.id as receiving_bank_id',\n 'receiving_bank.name as receiving_bank_name',\n 'transactions.ammount as ammount',\n 'transactions.created_at as created_at']) -> all();\n }", "public function getTransactionCollection()\n {\n if (!$this->collection) {\n $customerId = $this->customerSession->getCustomerId();\n\n $orderCollection = $this->orderCollectionFactory->create();\n $orderCollection->addFieldToFilter('customer_id', $customerId);\n $orderCollection->addFieldToFilter('state', ['neq' => Order::STATE_CANCELED]);\n $orderCollection->addFieldToFilter('state', ['neq' => Order::STATE_CLOSED]);\n $orderCollection->addFieldToFilter('rp.earn_points', ['gt' => 0]);\n $orderCollection->setOrder('main_table.entity_id', 'DESC');\n\n $orderSelect = $orderCollection->getSelect();\n $orderSelect->joinLeft(\n ['rt' => $orderCollection->getTable('mst_rewards_transaction')],\n 'main_table.entity_id = REPLACE(rt.code, \"order_earn-\", \"\")',\n ['rt.transaction_id', 'rt.created_at as transaction_created_at', 'rt.activated_at', 'rt.is_activated']\n );\n $orderSelect->joinLeft(\n [\n 'rp' => $orderCollection->getTable('mst_rewards_purchase')\n ],\n 'main_table.entity_id = rp.order_id AND rt.transaction_id IS NULL',\n [\n 'rp.purchase_id',\n 'rt.created_at as purchase_created_at',\n 'IF(rt.amount, rt.amount, rp.earn_points) as amount'\n ]\n );\n\n $this->collection = $orderCollection;\n }\n\n return $this->collection;\n }", "public function getAll() {\n $sql = 'select * from Envelopes';\n $envelopes = $this->executerRequete($sql);\n return $envelopes->fetchAll(PDO::FETCH_ASSOC);\n }", "public function actionTransaction(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $transactionsIn = Transaction::find()->joinWith('order')->joinWith('post')->joinWith('withdraw')->where([\n 'payment_status'=>'completed', \n 'post_services.owner_id'=>\\Yii::$app->user->getId(),\n ])->all();\n $transactionsOut = Transaction::find()->joinWith('order')->joinWith('post')->where([\n 'payment_status'=>'completed', \n 'accepted_orders.user_id'=>\\Yii::$app->user->getId(),\n ])->all();\n return $this->render('transactions', ['transactionsIn'=>$transactionsIn, 'transactionsOut'=>$transactionsOut, 'user'=>$user]);\n }", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function actionIndex()\n {\n $searchModel = new TransactionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->where('gtransactions.clientId = '.Yii::$app->user->id);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getTransactions($merchantId)\n {\n $transactionModel = new Application_Model_TransactionTable();\n\t\t$transactionDataArr = $transactionModel->getTransactionsByMerchantID($merchantId);\n\t\t\n\t\t$transactionDataArr = $this->applyCurrencyConverter($transactionDataArr, 'GBP');\n\t\t\n\t\treturn $transactionDataArr;\n }", "public function getAll()\n {\n return $this->query()->get();\n }", "public function getAll()\n {\n return $this->query()->get();\n }", "public function index()\n {\n $data = DB::table('transactions')->where('user_id', Auth::user()->id)->orderBy('created_at','desc')->get();\n return view('wallet.transaction.list_all', compact('data'));\n }", "function readAllPTransactions()\n\t{\n\t\t$query = \"SELECT\n t.id,\n t.tipo,\n t.amount, \n t.macroarea,\n\t\t\t\tt.anno,\n\t\t\t\tp.T_DATE\n\t\t\t\tFROM TRANSAZIONi AS t INNER JOIN TPRECISA AS p ON t.id = p.ID_TRANSAZIONE\n\t\t\t\tWHERE t.FLOW_ID = ?\n ORDER BY t.id DESC\n LIMIT ?, ?\";\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id, PDO::PARAM_INT);\n\t\t$stmt->bindParam(2, $from_record_num, PDO::PARAM_INT);\n\t\t$stmt->bindParam(3, $records_per_page, PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "function loadTransactions() {\n\t\t$trans = json_decode(\n\t\t\t\t\tfile_get_contents(\"data/trans.json\"),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\treturn $trans;\n\t}", "public function get_transaction($id){\n $this->load->database();\n\n $query = $this->db->select('*')\n ->get_where('tbl_transactions',array('id' => $id));\n return $query->result_array();\n }", "function readAllBTransactions()\n\t{\n\t\t$query = \"SELECT\n t.id,\n t.tipo,\n t.amount, \n t.macroarea,\n\t\t\t\tt.anno,\n\t\t\t\tb.T_MESE\n\t\t\t\tFROM TRANSAZIONi AS t INNER JOIN TBOH AS b ON b.id = p.ID_TRANSAZIONE\n\t\t\t\tWHERE t.FLOW_ID = ?\n ORDER BY t.id DESC\n LIMIT ?, ?\";\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id, PDO::PARAM_INT);\n\t\t$stmt->bindParam(2, $from_record_num, PDO::PARAM_INT);\n\t\t$stmt->bindParam(3, $records_per_page, PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "public function query_in_transactions(){\n\t\t$response = $this->execute($this->query_in_transaction_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in communication\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "function exeGetTransactions() {\n $exeGetTransactions = $this->db->query(\"SELECT *\n FROM transactions \");\n \n if($exeGetTransactions->num_rows() > 0) {\n return $exeGetTransactions->result_array();\n } else {\n return false;\n } \n }", "public function getAll() {\n $sql = \"SELECT * FROM contatos\";\n $sql = $this->pdo->query($sql);\n\n if($sql->rowCount() > 0 ) {\n return $sql->fetchAll();\n } else {\n return array();\n }\n }", "public function getCorpoAdminAccountTransactionsbyId($id)\n {\n $account = $this->em->getRepository('CorporateBundle:CorpoAccountTransactions')->getAccountTransactionsById($id);\n return $account;\n }", "public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM contenidos';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public function getTransaction($id){\n\n $gateway = $this->getGateway();\n \n $transaction = $gateway->transaction()->find($id);\n\n return $transaction;\n\n }", "public function get_client_transactions($client_id)\n {\n $sql=\"SELECT * FROM transactions where client_id=$client_id order by trans_date desc\";\n $q=$this->db->query($sql);\n return $q->result_array();\n }", "public static function getAll() {\n $conn = self::connect();\n $row = $conn->getAll(self::baseQuery());\n return $row;\n }", "public function getAll()\n {\n return $this->findAll();\n }", "public function transactions(){\n return $this->hasMany('App\\Transaction');\n }", "public function all()\n {\n return $this->service->all();\n }", "public function getAll() {\n return $this->db->getAllFromTable($this->table);\n }", "public function transactions()\n {\n return [\n 'default' => self::OP_ALL,\n ];\n }", "public function getAll() {\n try {\n return $this->vueloDao->getAll();\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function transaction()\n {\n return $this->hasMany('App\\Transaction');\n }", "public function test_getTransactions()\n {\n factory( Transaction::class, 20 )->create();\n /**\n * @var $builder TransactionsListBuilder\n */\n $builder = app( TransactionsListBuilder::class );\n $viewModel = $builder->GetModel();\n $response = $this->get('/api/transactions');\n $response\n ->assertStatus(200)\n ->assertJson([\n 'items' => [\n [\n 'id' => $viewModel->items[0]->id,\n 'value' => $viewModel->items[0]->value\n ]\n ],\n 'total' => $viewModel->total\n ]);\n }", "public function getAll()\n {\n return $this->taskResourceModel->getAll();\n }", "public function all()\n {\n return $this->query()->get();\n }", "public function viewSuccessfulTransactions()\n {\n return $this->getSuccessfulTransactions(self::GATEWAY);\n }", "public function all()\n {\n return $this->db->query('SELECT * FROM '.$this->table.' ORDER by created_at DESC')->get();\n }", "public function transactions()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the users transaction\n $transactions = OrdersModel::transactions();\n\n $this->View->Render('dashboard/transactions', ['transactions' => $transactions]);\n }", "public function getAll()\n {\n return $this->wrapper(\n $this->model->getAll()\n );\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM $this->table\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll();\n }", "public function getAll()\r\n\t{\r\n\t\treturn $this->findAll();\r\n\t}", "public function transactions(){\n\n return $this->hasMany(Account_transactions::class);\n\n }", "public function getAll(){\n\t\treturn $this->db->get($this->table);\n\t}", "public function getAll(){\n $adapter = $this->createAdapter();\n $results = $adapter->query($this->getSelectStatement());\n return $results;\n $adapter = null;\n }", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function index()\n {\n $this->authorize('viewAny', Transaction::class);\n //users can only index transactions belongs to them\n return Auth::user()->transactions;\n }", "public function transactions(?TransactionsConfiguration $config = null): Transactions\n {\n return new Transactions($this->core, $config ?: $this->options->getTransactionsConfiguration());\n }", "public function GetPendingTransactions() {\r\n if (!$this->bootstrap_node) {\r\n $transactionsByPeer = BootstrapNode::GetPendingTransactions($this->chaindata,$this->isTestNet);\r\n foreach ($transactionsByPeer as $transactionByPeer) {\r\n $this->chaindata->addPendingTransactionByBootstrap($transactionByPeer);\r\n }\r\n }\r\n }", "public function actionIndex() {\n $searchModel = new CustomerTransactionsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function all() {\n return $this->model->orderBy('created_at', 'ASC')->get();\n }", "public function deleteAllTransactions() {\n AccPayPalTransaction::model()->deleteTransactions($this->transactionIds);\n }", "public function transaction()\n {\n return $this->hasMany(Transaction::class, 'transaction_detailID');\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_task';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function all()\n {\n return $this->model->get();\n }" ]
[ "0.8506087", "0.817479", "0.79812175", "0.78252673", "0.77811307", "0.7769247", "0.7769247", "0.7769247", "0.7730517", "0.7475605", "0.7475044", "0.74089676", "0.7310387", "0.72962594", "0.72624266", "0.7250696", "0.7160681", "0.7141753", "0.7085928", "0.70088166", "0.70088166", "0.6984322", "0.6905748", "0.6889691", "0.6865295", "0.67524624", "0.6748422", "0.6735984", "0.6716344", "0.670815", "0.67032325", "0.6690191", "0.66476196", "0.6626538", "0.66254485", "0.6589695", "0.6586044", "0.65711236", "0.65579015", "0.64930755", "0.64835185", "0.6423769", "0.6420342", "0.63795924", "0.62626797", "0.625129", "0.6233302", "0.6223236", "0.62202376", "0.6213956", "0.6194421", "0.6184779", "0.6172526", "0.6168149", "0.616782", "0.6163693", "0.6163693", "0.6135632", "0.6126036", "0.61145604", "0.6092649", "0.6082165", "0.60816175", "0.60781395", "0.60711944", "0.60701776", "0.60678935", "0.6067589", "0.60659975", "0.6036404", "0.60195816", "0.601515", "0.60136086", "0.60090095", "0.6005332", "0.5989169", "0.5985845", "0.59842265", "0.597856", "0.5977275", "0.5974437", "0.5971606", "0.59633523", "0.59552443", "0.5950732", "0.5950633", "0.5950411", "0.5921212", "0.5913753", "0.5913027", "0.5912539", "0.5907336", "0.59057444", "0.5904387", "0.5886624", "0.5878772", "0.58724856", "0.5871906", "0.5869868", "0.5864575" ]
0.7508905
9
Grabs the Transactions of the given Player.
public function getPlayerTransactions($player){ $this->db->select('*'); $this->db->from('transactions t'); $this->db->where('t.Player', $player); $query = $this->db->get(); $noData = array(); $noPlayer = [ "DateTime" => "N/A", "Player" => "N/A", "Stock" => "N/A", "Trans" => "N/A", "Quantity" => "N/A", ]; array_push($noData, $noPlayer); if($query->num_rows() != 0) { $resultset = $query->result_array(); }else{ $resultset = $noData; } return $resultset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPlayerTransactions($player){\n\t\t$this->player = $player;\n\t\t$this->getTransactions(-1,-1,-1,-1,$player->getPlayerID());\n\t}", "function getPlayerActivity($player)\n {\n $queryString = \"SELECT * FROM transactions WHERE Player='\" . $player . \"' ORDER BY DateTime DESC\";\n $result = $this->db->query($queryString);\n\n return $result;\n }", "function transactions_by_player($playerName){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions WHERE Player = '$playerName';\");\n\t\treturn $query->result_array();\n\t}", "function getPlayerStocks($player)\n {\n $queryString = \"SELECT * FROM transactions WHERE Player='\" . $player . \"'\";\n $result = $this->db->query($queryString);\n\n return $result;\n }", "public function requestPlayerBet(Player $player);", "function getPlayerHoldings($player)\n {\n $queryString = \"SELECT transactions.*, stocks.Value AS customValue FROM transactions JOIN stocks ON stocks.Code = transactions.Stock WHERE Player='\" . $player . \"'\";\n $activity = $this->db->query($queryString);\n\n $stockArray = array();\n foreach ($activity->result() as $thisStock) {\n if (!isset($stockArray[$thisStock->Stock])) {\n $stockArray[$thisStock->Stock] = 0;\n }\n if ($thisStock->Trans == 'sell') {\n $stockArray[$thisStock->Stock] -= (int)$thisStock->Quantity;\n } else if ($thisStock->Trans == 'buy') {\n $stockArray[$thisStock->Stock] += (int)$thisStock->Quantity;\n }\n }\n\n $returnArray = array();\n foreach ($stockArray as $key => $value) {\n $returnArray[] = array(\n 'Stock' => $key,\n 'Quantity' => $value\n );\n }\n return $returnArray;\n }", "public function passGo($player){\n $player->collect($this->go_amount);\n }", "function getTransfers($user){\r\n\t\t$transfers=array();\r\n\r\n\r\n $db_players=new ConnectDatabasePlayers($this->mysqli);\r\n\r\n $players=$db_players->dumpSingoliToList(null,null);\r\n \r\n $id_user = $user;\r\n \r\n\r\n\t\ttry{\r\n\t\t\t$tempQuery=\"Select * , UNIX_TIMESTAMP(date) as time from `transfers` where id_user=? order by date ASC\";\r\n\r\n\t\t\tif(!($stmt = $this->mysqli->prepare($tempQuery))) {\r\n\t\t\t echo \"Prepare failed: (\" . $this->mysqli->errno . \") \" . $this->mysqli->error;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$stmt->bind_param(\"i\", $id_user)) {\r\n\t\t\t echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$stmt->execute()) {\r\n\t\t\t echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n\t\t\t}\r\n \r\n\t\t\t$res=$stmt->get_result();\r\n\t\t\t$res->data_seek(0);\r\n\t\t\t\r\n\t\t\twhile ($row = $res->fetch_assoc()) {\r\n\t\t\t\t$id=$row['id_transfer'];\r\n\t\t\t\t$old_cost=$row['old_player_cost'];\r\n\t\t\t\t$new_cost=$row['new_player_cost'];\r\n\t\t\t\t$old_player=new RosterPlayer($db_players->dumpPlayerById(intval($row['id_old_player'])),$old_cost);\r\n\t\t\t\t$new_player=new RosterPlayer($db_players->dumpPlayerById(intval($row['id_new_player'])),$new_cost);\r\n\t\t\t\t$datetemp = date (\"Y-m-d H:i:s\", $row['time']);\r\n\t\t\t\t$date=new DateTime($datetemp);;\r\n\t\t\t\t$id_market=$row['id_market'];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$free = $row[\"free\"];\r\n\t\t\t\t\r\n \r\n\t\t\t\t$transfers[$id]=new Transfer($id,$user,$id_market,$old_player,$new_player,$date,$free);\r\n\t\t\t}\r\n\r\n\t\t\treturn $transfers;\r\n\r\n\r\n\t\t}catch(exception $e) {\r\n\t\t\techo \"\\nERRORE DUMP TRANSFERS: \".$e;\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public function getPlayer();", "public function getTransfers()\n {\n return Wrapper\\Player\\Senior::transfershistory($this->getId());\n }", "public function getPlayers();", "public function getPlayers();", "public function getCurrentHoldings($player){\n $resultset = null;\n $results = array();\n $stocks = $this->stocks->all();\n $this->db->select('Quantity, Trans, Stock, Value');\n $this->db->from('transactions t');\n $this->db->join('stocks s', 's.Code=t.Stock', 'left');\n $this->db->join('players p', 'p.Player=t.Player', 'left');\n $this->db->where('t.Player', $player);\n $query = $this->db->get();\n\n if($query->num_rows() != 0)\n {\n $resultset = $query->result_array();\n }\n\n foreach( $stocks as $item )\n {\n $results[$item->Code] = 0;\n }\n\n if ( count( $resultset ) > 0 )\n foreach( $resultset as $result )\n {\n $amount = $result[\"Quantity\"];\n $action = $result[\"Trans\"];\n $stock = $result[\"Stock\"];\n $price = $result[\"Value\"];\n\n $sign = ( $action == \"buy\" ) ? 1 : -1;\n $results[$stock] += $sign * $amount * $price;\n }\n return array($results);\n }", "public function players(){\n return $this->playerX()->merge($this.$this->playerO());\n }", "public function transfeMoneyForm($player){\n\t\t$form = new CustomForm(function (Player $player, $data) {\n\t\t\tif($data === null){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t$target = $this->plugin->getServer()->getPlayer($data[1]);\n\t\t\tif($target instanceof Player) {\n\t\t\t\t$targetName = $this->plugin->bank->getNested($target->getName().\".Name\");\n\t\t\t\t$targetRek = $this->plugin->bank->getNested($target->getName().\".Rekening\");\n\t\t\t\t$targetMoney = $this->plugin->bank->getNested($target->getName().\".Money\");\n\t\t\t\n\t\t\t\t$playerMoney = $this->plugin->bank->getNested($player->getName().\".Money\");\n\t\t\t\t$playerPin = $this->plugin->bank->getNested($player->getName().\".Pin\");\n\t\t\t\tif(isset($data[2]) && $data[2] == $targetName) {\n\t\t\t\t\tif(is_numeric($data[3]) && $data[3] == $targetRek){\n\t\t\t\t\t\tif(is_numeric($data[4]) && $data[4] == $playerPin) {\n\t\t\t\t\t\t\tif(is_numeric($data[5])){\n\t\t\t\t\t\t\t\tif(!$playerMoney == 0){\n\t\t\t\t\t\t\t\t\t$this->plugin->bank->setNested($target->getName().\".Money\", $targetMoney + $data[5]);\n\t\t\t\t\t\t\t\t\t$this->plugin->bank->setNested($player->getName().\".Money\", $playerMoney - $data[5]); \n\t\t\t\t\t\t\t\t\t$this->plugin->bank->save();\n\t\t\t\t\t\t\t\t\t$player->sendMessage(Main::PREFIX.\"§aTelah berhasil mengirim uang Anda kepada \".$target->getName().\". sebesar: \".$data[5]);\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$player->sendMessage(Main::PREFIX.\"§cMaaf, Anda tidak memiliki uang ditabungan\");\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$player->sendMessage(Main::PREFIX.\"§c[ERROR] Nominal harus type number\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$player->sendMessage(Main::PREFIX.\"§c[ERROR] Pin Anda salah\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$player->sendMessage(Main::PREFIX.\"§c[ERROR] Rekening yang akan dikirim salah!\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$player->sendMessage(Main::PREFIX.\"§cAtas Nama: \".$data[2].\". tidak ada!\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$player->sendMessage(Main::PREFIX.\"§cAtas Nama: \".$data[1].\". tidak ada!\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t$form->setTitle(\"§lTransfer Uang\");\n\t\t$form->addLabel(\"§fHallo, \".$player->getName().\" Selamat datang di BankUI\\n\".\n\t\t\t\t\t\t\"§fDisini bisa mentrasfer uang Anda kepada Player lain\\n\".\n\t\t\t\t\t\t\"§fAnda yakin memberikan uang kepada player lain?\");\n $form->addInput(\"\\n§fPlayer yang dituju.\", \"§7Type string\");\n $form->addInput(\"\\n§fMasukan Atas Nama yang mau diberi.\", \"§7Type string\");\n $form->addInput(\"\\n§fMasukan Rekening yang mau diberi.\", \"§7Type string\");\n $form->addInput(\"\\n§fMasukan Pin Anda.\", \"§7Type string\");\n $form->addInput(\"\\n§fMasukan Nominal.\", \"§7Type string\");\n\t\t$form->sendToPlayer($player);\n\t\treturn $form;\n }", "function getPlayersAndEquity($player = '')\n {\n $queryString = \"SELECT * FROM `players` \";\n if (!empty($player)) {\n $queryString .= \"WHERE Player='$player'\";\n }\n $result = $this->db->query($queryString)->result();\n\n $playerArray = array();\n foreach ($result as $thisPlayer) {\n $playerArray[$thisPlayer->Player] = [\n 'Player' => $thisPlayer->Player,\n 'Cash' => $thisPlayer->Cash,\n 'Equity' => $this->getPlayerEquity($thisPlayer->Player)\n ];\n }\n\n return $playerArray;\n }", "function getPlayerEquity($player)\n {\n $queryString = \"SELECT transactions.*, stocks.Value AS customValue FROM transactions JOIN stocks ON stocks.Code = transactions.Stock WHERE Player='\" . $player . \"'\";\n $activity = $this->db->query($queryString);\n\n $stockArray = array();\n foreach ($activity->result() as $thisStock) {\n if (!isset($stockArray[$thisStock->Stock])) {\n $stockArray[$thisStock->Stock] = 0;\n }\n if ($thisStock->Trans == 'sell') {\n $stockArray[$thisStock->Stock] -= $thisStock->Quantity * $thisStock->customValue;\n } else if ($thisStock->Trans == 'buy') {\n $stockArray[$thisStock->Stock] += $thisStock->Quantity * $thisStock->customValue;\n }\n }\n $equity = 0;\n foreach ($stockArray as $thisStock) {\n $equity += $thisStock;\n }\n return $equity;\n }", "function stInterPlayerTurn() {\n \n // Give him extra time for his actions to come\n self::giveExtraTime(self::getActivePlayerId());\n \n // Does he plays again?\n if (self::getGameStateValue('first_player_with_only_one_action')) {\n // First turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('first_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('second_player_with_only_one_action')) {\n // 4 players at least and this is the second turn: the player had only one action to make\n $next_player = true;\n self::setGameStateValue('second_player_with_only_one_action', 0);\n }\n else if (self::getGameStateValue('has_second_action')) {\n // The player took his first action and has another one\n $next_player = false;\n self::setGameStateValue('has_second_action', 0);\n }\n else {\n // The player took his second action\n $next_player = true;\n self::setGameStateValue('has_second_action', 1);\n }\n if ($next_player) { // The turn for the current player is over\n // Reset the flags for Monument special achievement\n self::resetFlagsForMonument();\n \n // Activate the next player in turn\n $this->activeNextPlayer();\n $player_id = self::getActivePlayerId();\n self::setGameStateValue('active_player', $player_id);\n }\n self::notifyGeneralInfo('<!--empty-->');\n self::trace('interPlayerTurn->playerTurn');\n $this->gamestate->nextState();\n }", "function getTransferInfoWithTwoPlayersInvolved($location_from, $location_to, $player_id_is_owner_from, $you_must, $player_must, $your, $player_name, $opponent_name, $number, $cards) {\n if ($player_id_is_owner_from) {\n switch($location_from . '->' . $location_to) {\n case 'hand->hand':\n $message_for_player = clienttranslate('{You must} transfer {number} {card} from your hand to {opponent_name}\\'s hand');\n $message_for_opponent = clienttranslate('{player must} transfer {number} {card} from his hand to {your} hand');\n $message_for_others = clienttranslate('{player must} transfer {number} {card} from his hand to {opponent_name}\\'s hand');\n break;\n \n case 'hand->score':\n $message_for_player = clienttranslate('{You must} transfer {number} {card} from your hand to {opponent_name}\\'s score pile');\n $message_for_opponent = clienttranslate('{player must} transfer {number} {card} from his hand to {your} score pile');\n $message_for_others = clienttranslate('{player must} transfer {number} {card} from his hand to {opponent_name}\\'s score pile');\n break;\n \n case 'board->board':\n $message_for_player = clienttranslate('{You must} transfer {number} top {card} from your board to {opponent_name}\\'s board');\n $message_for_opponent = clienttranslate('{player must} transfer {number} top {card} from his board to {your} board');\n $message_for_others = clienttranslate('{player must} transfer {number} top {card} from his board to {opponent_name}\\'s board');\n break;\n \n case 'board->score':\n $message_for_player = clienttranslate('{You must} transfer {number} top {card} from your board to {opponent_name}\\'s score pile');\n $message_for_opponent = clienttranslate('{player must} transfer {number} top {card} from his board to {your} score pile');\n $message_for_others = clienttranslate('{player must} transfer {number} top {card} from his board to {opponent_name}\\'s score pile');\n break;\n \n case 'score->score':\n $message_for_player = clienttranslate('{You must} transfer {number} {card} from your score pile to {opponent_name}\\'s score pile');\n $message_for_opponent = clienttranslate('{player must} transfer {number} {card} from his score pile to {your} score pile');\n $message_for_others = clienttranslate('{player must} transfer {number} {card} from his score pile to {opponent_name}\\'s score pile');\n break;\n default:\n break;\n }\n }\n else { // $player_id_is_owner_to\n switch($location_from . '->' . $location_to) {\n case 'board->board':\n $message_for_player = clienttranslate('{You must} transfer {number} top {card} from {opponent_name}\\'s board to your board');\n $message_for_opponent = clienttranslate('{player must} transfer {number} top {card} from {your} board to his board');\n $message_for_others = clienttranslate('{player must} transfer {number} top {card} from {opponent_name}\\'s board to his board');\n break;\n \n case 'board->hand':\n $message_for_player = clienttranslate('{You must} transfer {number} top {card} from {opponent_name}\\'s board to your hand');\n $message_for_opponent = clienttranslate('{player must} transfer {number} top {card} from {your} board to his hand');\n $message_for_others = clienttranslate('{player must} transfer {number} top {card} from {opponent_name}\\'s board to his hand');\n break;\n \n case 'revealed->board': // Collaboration\n $message_for_player = clienttranslate('{You must} transfer {number} revealed {card} to your board.');\n $message_for_opponent = clienttranslate('{player must} transfer {number} revealed {card} to his board.');\n $message_for_others = clienttranslate('{player must} transfer {number} revealed {card} to his board.');\n break;\n \n default:\n break;\n }\n }\n \n $message_for_player = self::format($message_for_player, array('You must' => $you_must, 'number' => $number, 'card' => $cards, 'opponent_name' => $opponent_name));\n $message_for_opponent = self::format($message_for_opponent, array('player must' => $player_must, 'number' => $number, 'card' => $cards, 'your' => $your));\n $message_for_others = self::format($message_for_others, array('player must' => $player_must, 'number' => $number, 'card' => $cards, 'opponent_name' => $opponent_name));\n \n return array(\n 'message_for_player' => $message_for_player,\n 'message_for_opponent' => $message_for_opponent,\n 'message_for_others' => $message_for_others\n );\n }", "public function getPlayers ()\r\n {\r\n return $this->players;\r\n }", "function playerCoins($currentPlayer, $playerCoins) {\n\t}", "public function transfert()\n {\n\n $account = \\Stripe\\Account::create([\n 'country' => 'US',\n 'type' => 'custom',\n 'requested_capabilities' => ['card_payments', 'transfers'],\n ]);\n\n $transfer = Transfer::create([\n 'amount' => 7000,\n 'currency' => 'usd',\n 'destination' => $account->id,\n 'transfer_group' => '{ORDER10}',\n ]);\n }", "public function requestPlayerAction(Player $player, HandBetPair $hand);", "public function allPlayers()\n {\n return array_values($this->players);\n }", "function getAllPlayers(){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by rating DESC\";\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "function playerSentToPenaltyBox($currentPlayer) {\n\t}", "public function getPlayer(string $account, bool $withBalance = true): Player;", "static function bySeaAttack($player1,$player2,&$logManager,$language){\r\n\t\t$p1Unit = $player1;\r\n\t\t$p2Unit = $player2;\r\n\t\t\r\n\t\t$p1UnitLost = $p2UnitLost = 0;\r\n\t\twhile ($p1Unit > 0 && $p2Unit > 0){\r\n\t\t\t$p1Dice = ($p1Unit <= 3) ? $p1Unit : 3;\r\n\t\t\t$p2Dice = ($p2Unit <= 3) ? $p2Unit : 3;\r\n\t\t\t$unitLost = CombatManager::terranAttack($p1Dice, $p2Dice,$logManager,$language);\r\n\t\t\t$p1Unit = $p1Unit-$unitLost[0];\r\n\t\t\t$p1UnitLost += $unitLost[0];\r\n\t\t\t$p2Unit = $p2Unit-$unitLost[1];\r\n\t\t\t$p2UnitLost += $unitLost[1];\r\n\t\t}\r\n\t\t\r\n\t\techo 'ciao';\r\n\t\t\r\n\t\t$logManager->addLog('{Player1} '.$language['losts'].' '.$p1UnitLost.' '.$language['units']);\r\n\t\t$logManager->addLog('{Player2} '.$language['losts'].' '.$p2UnitLost.' '.$language['units']);\r\n\t\t\r\n\t\treturn array($p1UnitLost,$p2UnitLost);\r\n\t}", "public function getPlayers(): array;", "public function getGoalStatisticsForPlayer(User $player) {\n $qT1 = $this\n ->createQueryBuilder('r')\n ->add('select', 'SUM(r.team1Score) as scored, SUM(r.team2Score) as conceded')\n ->add('from', 'FoosLeaderCoreBundle:Result r')\n ->add('where', '((r.player1 = :user OR r.player3 = :user) AND r.team1Confirmed = true AND r.team2Confirmed = true)')\n ->setParameter('user', $player)\n ->getQuery();\n $qT2 = $this\n ->createQueryBuilder('r')\n ->add('select', 'SUM(r.team2Score) as scored, SUM(r.team1Score) as conceded')\n ->add('from', 'FoosLeaderCoreBundle:Result r')\n ->add('where', '((r.player2 = :user OR r.player4 = :user) AND r.team1Confirmed = true AND r.team2Confirmed = true)')\n ->setParameter('user', $player)\n ->getQuery();\n\n $resultT1 = $qT1->getResult();\n $resultT2 = $qT2->getResult();\n\n if ((is_array($resultT1) && count($resultT1) === 0) || (is_array($resultT2) && count($resultT2) === 0)) {\n return null;\n } else {\n $statistics = new PlayerGoalStatistics(\n $player,\n ($resultT1[0]['scored'] + $resultT2[0]['scored']),\n ($resultT1[0]['conceded'] + $resultT2[0]['conceded'])\n );\n return $statistics;\n }\n }", "public function getPlayers()\n {\n return $this->players;\n }", "public function transfer()\n {\n $transfer = oxNew('tc_cleverreach_transfer');\n\n $complete = (boolean)oxRegistry::getConfig()->getRequestParameter('full');\n $offset = (int)oxRegistry::getConfig()->getRequestParameter('offset');\n\n $transfer->setOffset($offset);\n\n try {\n list($count, $transferResult) = $transfer->run($this->getTimer(), $complete);\n } catch (tc_group_not_found_exception $e) {\n $this->error = $e->getMessage();\n $this->_aViewData['blShowListResetPopUp'] = true;\n\n return;\n } catch (\\Exception $e) {\n $this->error = $e->getMessage();\n\n return;\n }\n\n if (is_array($transferResult) === true && (count($transferResult) === 0 || $transferResult[0] === false)) {\n $this->metaRefreshValues['end'] = true;\n // Transfer fertig\n $this->transferComplete();\n\n return;\n }\n\n // Daten sind fehlerhaft\n if ($transferResult === false) {\n $lang = oxRegistry::getLang();\n $msg = $lang->translateString('TC_CLEVERREACH_ERROR_NO_KEY');\n $this->tcError = $msg;\n\n return false;\n\n // Alle Daten übertragen\n } elseif ($transferResult === true) {\n $this->metaRefreshValues['end'] = true;\n // Transfer fertig\n $this->transferComplete();\n\n return;\n // Anzeige ? Nutzer|Bestellungen\n } elseif (is_array($transferResult) === true) {\n $transferType = 'user';\n $iReceiver = $count;\n\n // add full flag, to check for full list export\n $full = (int)oxRegistry::getConfig()->getRequestParameter('full');\n $this->metaRefreshValues['full'] = $full;\n $this->metaRefreshValues['function'] = 'transfer';\n $this->metaRefreshValues['transfer'] = $transferType;\n $this->metaRefreshValues['iReceiver'] = $iReceiver;\n $this->metaRefreshValues['refresh'] = 0;\n $this->metaRefreshValues['offset'] = $this->getTimer() + (int)oxRegistry::getConfig()->getRequestParameter('offset');\n }\n }", "function chcekTheWinner($dom, $owner){\n $instance = DbConnector::getInstance();\n $playersList = handEvaluator();\n usort($playersList, array(\"Player\", \"cmp\")); \n $i = 0;\n echo \"<div id=\\\"summary\\\"><div>--- Summary ---</div>\";\n echo \"<table border=\\\"1\\\" BORDERCOLOR=RED style=\\\"width:100%\\\"><tr><th>Player</th><th>Score</th><th>Hand</th><th>Cards</th></tr>\";\n foreach($playersList as $player){ \n if($i === 0){\n $sql = \"SELECT `TotalMoneyOnTable`, `Transfer` FROM `TableCreatedBy_\" . $owner . \"` where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n while ($row = mysql_fetch_row($retval)) {\n $value = $row[0];\n $flag = $row[1];\n }\n if($flag == 0){ //transfer money to accunt\n $sql = \"UPDATE `TableCreatedBy_\" . $owner . \"` SET `Money` = `Money` + \".$value.\", `Transfer`=1 where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n }\n echo \"<td>\" . $player->player . \" won \".$value.\"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }else{\n echo \"<td>\" . $player->player . \"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }\n $i++;\n }\n echo \"</table></div>\";\n}", "function getTransferInfoWithOnePlayerInvolved($location_from, $location_to, $bottom_to, $you_must, $player_must, $player_name, $number, $cards, $targetable_players) {\n if ($location_from == $location_to && $location_from = 'board') { // Used only for Self service\n $message_for_player = clienttranslate('{You must} choose {number} other top {card} from your board');\n $message_for_others = clienttranslate('{player must} choose {number} other top {card} from his board'); \n }\n else if ($targetable_players !== null) { // Used when several players can be targeted\n switch($location_from . '->' . $location_to) {\n case 'score->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} from the score pile of {targetable_players}');\n $message_for_others = clienttranslate('{player must} return {number} {card} from the score pile of {targetable_players}');\n break;\n \n case 'board->deck':\n $message_for_player = clienttranslate('{You must} return {number} top {card} from the board of {targetable_players}');\n $message_for_others = clienttranslate('{player must} return {number} top {card} from the board of {targetable_players}');\n break;\n\n case 'board->score':\n $message_for_player = clienttranslate('{You must} transfer {number} top {card} from the board of {targetable_players} to your score pile');\n $message_for_others = clienttranslate('{player must} transfer {number} top {card} from the board of {targetable_players} to his score pile');\n break;\n \n default:\n break;\n }\n }\n else {\n switch($location_from . '->' . $location_to) { \n case 'hand->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} return {number} {card} from his hand');\n break;\n case 'hand->hand':\n // Impossible case\n break; \n case 'hand->board':\n if ($bottom_to) {\n $message_for_player = clienttranslate('{You must} tuck {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} tuck {number} {card} from his hand');\n }\n else {\n $message_for_player = clienttranslate('{You must} meld {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} meld {number} {card} from his hand');\n }\n break;\n case 'hand->score':\n $message_for_player = clienttranslate('{You must} score {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} score {number} {card} from his hand');\n break;\n case 'hand->revealed':\n $message_for_player = clienttranslate('{You must} reveal {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} reveal {number} {card} from his hand');\n break;\n case 'hand->achievements':\n // Impossible case\n break;\n \n case 'board->deck':\n $message_for_player = clienttranslate('{You must} return {number} top {card} from your board');\n $message_for_others = clienttranslate('{player must} return {number} top {card} from his board');\n break;\n case 'board->hand':\n $message_for_player = clienttranslate('{You must} take back {number} top {card} from your board to your hand');\n $message_for_others = clienttranslate('{player must} take back {number} top {card} from his board to his hand');\n break;\n case 'board->board':\n // Impossible case\n break;\n case 'board->score':\n $message_for_player = clienttranslate('{You must} score {number} top {card} from your board');\n $message_for_others = clienttranslate('{player must} score {number} top {card} from his board');\n break;\n case 'board->revealed':\n // Impossible case\n break;\n case 'board->achievements':\n // Impossible case\n break;\n \n case 'score->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} from your score pile');\n $message_for_others = clienttranslate('{player must} return {number} {card} from his score pile');\n break;\n case 'score->hand':\n $message_for_player = clienttranslate('{You must} transfer {number} {card} from your score pile to your hand');\n $message_for_others = clienttranslate('{player must} transfer {number} {card} from his score pile to his hand');\n break;\n case 'score->board':\n if ($bottom_to) {\n $message_for_player = clienttranslate('{You must} tuck {number} {card} from your score pile');\n $message_for_others = clienttranslate('{player must} tucks {number} {card} from his score pile');\n }\n else {\n $message_for_player = clienttranslate('{You must} meld {number} {card} from your score pile');\n $message_for_others = clienttranslate('{player must} meld {number} {card} from his score pile');\n }\n break;\n case 'score->score':\n // Impossible case\n break;\n case 'score->revealed':\n // Impossible case\n break;\n case 'score->achievements':\n // Impossible case\n break;\n \n case 'revealed->deck':\n $message_for_player = clienttranslate('{You must} return {number} {card} you revealed');\n $message_for_others = clienttranslate('{player must} return {number} {card} he revealed');\n break; \n case 'revealed->hand':\n // Impossible case\n break;\n case 'revealed->board':\n // Impossible case\n break;\n case 'revealed->score':\n // Impossible case\n break;\n case 'revealed->revealed':\n // Impossible case\n break;\n case 'revealed->achievements':\n // Impossible case\n break;\n \n case 'achievements->deck':\n // Impossible case\n break;\n case 'achievements->hand':\n // Impossible case\n break;\n case 'achievements->board':\n // Impossible case\n break;\n case 'achievements->score':\n // Impossible case\n break;\n case 'achievements->revealed':\n // Impossible case\n break;\n case 'achievements->achievements': // That is: unclaimed achievement to achievement claimed by player\n // Impossible case\n break;\n \n case 'revealed,hand->deck': // Alchemy, Physics\n $message_for_player = clienttranslate('{You must} return {number} {card} you revealed and {number} {card} in your hand');\n $message_for_others = clienttranslate('{player must} return {number} {card} he revealed and {number} {card} in his hand');\n break;\n \n case 'hand->revealed,deck': // Measurement\n $message_for_player = clienttranslate('{You must} reveal and return {number} {card} from your hand');\n $message_for_others = clienttranslate('{player must} reveal and return {number} {card} from his hand');\n break;\n \n case 'pile->deck': // Skyscrapers\n $message_for_player = clienttranslate('{You must} return {number} {card} from your board');\n $message_for_others = clienttranslate('{player must} return {number} {card} from his board');\n break;\n \n default:\n break;\n }\n }\n $message_for_player = self::format($message_for_player, array('You must' => $you_must, 'number' => $number, 'card' => $cards, 'targetable_players' => $targetable_players));\n $message_for_others = self::format($message_for_others, array('player must' => $player_must, 'number' => $number, 'card' => $cards, 'targetable_players' => $targetable_players));\n \n return array(\n 'message_for_player' => $message_for_player,\n 'message_for_others' => $message_for_others\n );\n }", "function getPlayers($player = '')\n {\n $queryString = \"SELECT * FROM `players` \";\n if (!empty($player)) {\n $queryString .= \"WHERE Player='$player'\";\n }\n $result = $this->db->query($queryString);\n\n return $result;\n }", "public function onTransaction(InventoryTransactionEvent $event){\n\t\t$transactions = $event->getTransaction()->getTransactions();\n\n\t\t$player = null;\n\t\t$chestinv = null;\n\t\t$action = null;\n\t\tforeach($transactions as $transaction){\n\t\t\tif(($inv = $transaction->getInventory()) instanceof CustomChestInventory){\n\t\t\t\tforeach($inv->getViewers() as $assumed){\n\t\t\t\t\tif($assumed instanceof Player){\n\t\t\t\t\t\t$player = $assumed;\n\t\t\t\t\t\t$chestinv = $inv;\n\t\t\t\t\t\t$action = $transaction;\n\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(($player ?? $chestinv ?? $action) === null){\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t* $player => Player interacting with the GUI.\n\t\t* $chestinv => The chest's inventory.\n\t\t* $action => BaseTransaction|Transaction|SimpleTransactionGroup\n\t\t*/\n\t\t$event->setCancelled();\n\t\t$item = $action->getSourceItem();\n\t\tif($item->getId() === Item::AIR){\n\t\t\treturn;\n\t\t}\n\n\t\tif(isset($item->getNamedTag()->turner)){\n\t\t\t$pagedata = $item->getNamedTag()->turner->getValue();\n\t\t\t$page = $pagedata[0] === 0 ? --$pagedata[1] : ++$pagedata[1];\n\t\t\t$this->plugin->fillInventoryWithShop($chestinv, $page);\n\t\t\treturn;\n\t\t}\n\n\t\t$data = isset($item->getNamedTag()->ChestShop) ? $item->getNamedTag()->ChestShop->getValue() : null;\n\t\tif($data === null){\n\t\t\treturn;\n\t\t}\n\n\t\t$price = $data[0] ?? $this->plugin->defaultprice;\n\t\tif(!isset($this->plugin->clicks[$player->getId()][$data[1]])){\n\t\t\t$this->plugin->clicks[$player->getId()][$data[1]] = 1;\n\t\t\treturn;\n\t\t}\n\n\t\tif(EconomyAPI::getInstance()->myMoney($player) >= $price){\n\t \t \t$item = $this->plugin->getItemFromShop($data[1]);\n\t\t\t$player->sendMessage(Main::PREFIX.TF::GREEN.'Purchased '.TF::BOLD.$item->getName().TF::RESET.TF::GREEN.TF::GRAY.' (x'.$item->getCount().')'.TF::GREEN.' for $'.$price.'.');\n\t\t\t$player->getInventory()->addItem($item);\n\t\t\tEconomyAPI::getInstance()->reduceMoney($player, $price);\n\t\t\tunset($this->plugin->clicks[$player->getId()]);\n\t\t}else{\n\t\t\t$player->sendMessage(Main::PREFIX.TF::RED.'You cannot afford this item.');\n\t\t\t$chestinv->onClose($player);\n\t\t}\n\t}", "function getPlayerTeammate($player_id) {\n return self::getUniqueValueFromDB(self::format(\"\n SELECT\n player_id\n FROM\n player\n WHERE\n player_id <> {player_id} AND\n player_team = (\n SELECT\n player_team\n FROM\n player\n WHERE\n player_id = {player_id}\n )\n \",\n array('player_id' => $player_id)\n ));\n }", "public function allPlayers (): array {\r\n $players = array();\r\n foreach($this->players as $player) array_push($players, $player);\r\n array_push($players, $this->dealer);\r\n return $players;\r\n }", "public function getAllAutoRefreshPlayers()\n {\n return Player::whereHas('dataPoints')->get();\n }", "public function acceptPlayerBet(Player $player, HandBetPair $hand, $amount);", "private function sendSavedMessage(Player $player) : void{\n $player->sendMessage(TextFormat::GOLD . \"You were teleported to safety while a mine was being reset :)\");\n }", "public function getAllPlayers()\n {\n return $this->players;\n }", "public function post_player()\n\t\t{\n\t\t\t$retArr = array();\n\t\t\t// Scaffolding Code For Single:\n\t\t\t$retArr = $this->obj->getBasics();\n\n\t\t\treturn $retArr;\n\t\t}", "public function get_players()\n {\n return $this->players;\n }", "private function displayIndividualStats($player)\n {\n $changes = $player->statChanges();\n if (count($changes) > 0) {\n $this->ui->display(\"| $player->name:\");\n foreach ($changes as $change) {\n $this->ui->display(\"| \" . $change->type . \": \" . $change->value);\n }\n }\n $player->saveStats();\n }", "public function getPlayer()\n {\n return $this->participation->getPlayer();\n }", "public function create(Player $player) {\r\n // on se connecte à la DB\r\n $this->connexion->connect();\r\n\r\n // on recupère l'ensemble des attrubut de notre objet player\r\n $shoots = serialize($player->getShoots());\r\n $pseudo = $player->getPseudo();\r\n $ships = serialize($player->getShips()); // on serialise le tableau pour faciliter l'enregistrement en DB\r\n\r\n // On lance la requête\r\n $result = pg_query_params(\r\n $this->connexion->getConnexion(),\r\n 'INSERT INTO player (pseudo, shoots, ships) VALUES ($1, $2, $3) RETURNING * ',\r\n array($pseudo, $shoots, $ships)\r\n );\r\n\r\n // pour toutes les lignes renvoyées, on créer un objet de type Player grace à la fonction toPlayerFromDB\r\n $players = null;\r\n while ($data = pg_fetch_object($result)) {\r\n $players = Player::toPlayerFromDB($data);\r\n }\r\n\r\n pg_free_result($result);\r\n\r\n return $players;\r\n }", "function buttons($instance, $owner, $doc, $dom) {\n\n $move = $dom->getElementsByTagName('currentMove');\n $currentPlayer = $move[0]->nodeValue;\n\n $sql = \"SELECT `USER`, `Move` FROM `TableCreatedBy_\" . $owner . \"`;\";\n $retval = $instance->sendRequest($sql);\n\n if ($_SESSION[\"user\"] === $currentPlayer) {\n while ($row = mysql_fetch_row($retval)) {\n if ($row[0] === $currentPlayer) {\n if ($row[1] === \"none\") {\n printCall($doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printPlayerButtons(\"Check\", \"Check\", \"checkFunction()\", $doc);\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n } else if ($row[1] !== \"fold\") {\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printCall($doc);\n }\n }\n }\n }\n}", "public function importPlayerJson() \n {\n return (new ImportPlayerJson($this->getPlayerDataProvider, $this->playerRepository))->import();\n }", "public function getPlayers() : array {\r\n\r\n return $this->players;\r\n\r\n }", "public function calculatePlayerForm(){\n ini_set('max_execution_time',300000);\n Service::loadModels('car', 'car');\n Service::loadModels('people', 'people');\n Service::loadModels('user', 'user');\n Service::loadModels('rally', 'rally');\n Service::loadModels('league', 'league');\n $teamService = parent::getService('team','team');\n $peopleService = parent::getService('people','people');\n $rallyService = parent::getService('rally','rally');\n \n // get all player rallies from last 4 weeks\n $playerRallies = $peopleService->getLastMonthPlayersRallies(Doctrine_Core::HYDRATE_ARRAY);\n \n // calculate actual form\n $playerFormCalculatedData = $peopleService->preparePlayerRalliesWeekly($playerRallies);\n \n // get player ids which are already calculated\n // this allows to get all players which has not raced within last month and set their form to 0\n $playerIds = $playerFormCalculatedData['playerIds'];\n \n $teamOrder = array();\n foreach($playerFormCalculatedData['playerList'] as $player_id => $playerRow):\n $newForm = $playerRow['form'];\n $player = $peopleService->getPerson($player_id);\n $player->set('form',$newForm);\n $player->save();\n endforeach;\n \n $noRalliesPlayers = $peopleService->getPlayersNoLastMonthRallies($playerIds);\n foreach($noRalliesPlayers as $player):\n $newForm = 0;\n $player->set('form',$newForm);\n $player->save();\n endforeach;\n echo \"done\";\n exit;\n \n }", "public function players()\n {\n return $this;\n }", "public function getPlayer()\n {\n return $this->player;\n }", "public function getPlayer()\n {\n return $this->player;\n }", "public function getPlayer()\n {\n return $this->player;\n }", "public function saveAllPlayers(): void;", "protected function handleSuccessPlayer($player, $cash)\n\t{\n\t\t$rank = \\Kofradia\\Game\\Rank\\Points::getRank($player['up_points']);\n\t\t$affect = $this->ut->getAffectedTable($rank);\n\n\t\t// can not have too little energy\n\t\tif ($player['up_energy'] < $affect['energy']*2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// now take money\n\t\t$a = \\Kofradia\\DB::get()->prepare(\"\n\t\t\tUPDATE users_players\n\t\t\tSET up_bank = IF(up_cash < ?, up_bank - ?, up_bank),\n\t\t\t\tup_cash = IF(up_cash >= ?, up_cash - ?, up_cash)\n\t\t\tWHERE up_id = ? AND (up_cash >= ? OR up_bank >= ?)\");\n\t\tif (!$a->execute(array($cash, $cash, $cash, $cash, $player['up_id'], $cash, $cash)))\n\t\t{\n\t\t\t// did not succeed\n\t\t\treturn;\n\t\t}\n\n\t\t$this->result->up = \\player::get($player['up_id']);\n\t\t$this->result->cashLost = $cash;\n\t\t$this->result->fromBank = $this->result->up->data['up_cash'] < $cash; // TODO: this cannot be checked this way?\n\n\t\t// notify victim\n\t\t$this->result->up->add_log(\"utpressing\", $this->ut->up->id, $cash);\n\n\t\t// log\n\t\tputlog(\"SPAMLOG\", \"%c11%bUTPRESSING:%b%c %u{$this->ut->up->data['up_name']}%u presset %u{$this->result->up->data['up_name']}%u for %u\".\\game::format_cash($cash).\"%u\".($this->result->fromBank ? ' (fra bankkonto)' : ''));\n\t\t\\Kofradia\\DB::get()->prepare(\"\n\t\t\tINSERT INTO utpressinger\n\t\t\tSET\n\t\t\t\tut_action_up_id = ?,\n\t\t\t\tut_affected_up_id = ?,\n\t\t\t\tut_b_id = ?,\n\t\t\t\tut_time = ?\")\n\t\t\t->execute(array(\n\t\t\t\t$this->ut->up->id,\n\t\t\t\t$this->result->up->id,\n\t\t\t\t$this->ut->up->data['up_b_id'],\n\t\t\t\ttime()));\n\n\t\t// the victim always looses energy\n\t\t// but only health if the money comes from the hand\n\t\t// (don't really know why we made it this way)\n\t\t$this->result->up->energy_use($affect['energy']);\n\t\tif (!$this->result->fromBank)\n\t\t{\n\t\t\t$this->result->attack = $this->result->up->health_decrease($affect['health'], $this->ut->up, \\player::ATTACK_TYPE_UTPRESSING);\n\t\t}\n\n\t\treturn true;\n\t}", "function getRemainingMatches($player, $matches) {\n\t$remaining = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($value['Status'] != 'Complete' && $value['MatchType'] == 'League') {\n\t\t\t$remaining++;\n\t\t}\n\t}\n\treturn $remaining;\n}", "public function spawnTo(Player $player) {\n\t\t$pk = new AddMobPacket();\n\t\t$pk->type = Slime::NETWORK_ID;\n\t\t$pk->eid = $this->getId();\n\t\t$pk->x = $this->x;\n\t\t$pk->y = $this->y;\n\t\t$pk->z = $this->z;\n\t\t$pk->pitch = $this->pitch;\n\t\t$pk->yaw = $this->yaw;\n\t\t$pk->metadata = $this->getData();\n\n\t\t$player->dataPacket($pk);\n\t\t$player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);\n\t\tparent::spawnTo($player);\n\t}", "public function setPlayer(Player $player);", "function postPlayer(){\r\n global $path_components;\r\n if ((count($path_components) >= 3) &&\r\n ($path_components[2] != \"\")) {\r\n $PlayerID= intval($path_components[2]);\r\n $Player = Player::findByID($PlayerID);\r\n if($Player==null){\r\n function createPlayer() {\r\n // Create new Player\r\n $new_PlayerID = false;\r\n if (isset($_REQUEST['PlayerID'])) {\r\n $new_PlayerID = intval(trim($_REQUEST['PlayerID']));\r\n } else {\r\n header(\"HTTP/1.0 400 Bad PlayerID Request\");\r\n print(\"PlayerID is is not given.\");\r\n exit();\r\n }\r\n $new_Username = false;\r\n if (isset($_REQUEST['Username'])) {\r\n $new_Username = trim($_REQUEST['Username']);\r\n } else {\r\n header(\"HTTP/1.0 400 Bad Username Request\");\r\n print(\"Username is is not given.\");\r\n exit();\r\n }\r\n $new_RoadsCount = false;\r\n if (isset($_REQUEST['RoadsCount'])) {\r\n $new_RoadsCount = intval(trim($_REQUEST['RoadsCount']));\r\n } else {\r\n header(\"HTTP/1.0 400 Bad RoadsCount Request\");\r\n print(\"RoadsCount is is not given.\");\r\n exit();\r\n }\r\n $new_SoldiersCount = false;\r\n if (isset($_REQUEST['SoldiersCount'])) {\r\n $new_SoldiersCount = intval(trim($_REQUEST['SoldiersCount']));\r\n } else {\r\n header(\"HTTP/1.0 400 Bad SoldiersCount Request\");\r\n print(\"SoldiersCount is is not given.\");\r\n exit();\r\n }\r\n $new_Points = false;\r\n if (isset($_REQUEST['Points'])) {\r\n $new_Points = intval(trim($_REQUEST['Points']));\r\n } else {\r\n header(\"HTTP/1.0 400 Bad Points Request\");\r\n print(\"Points is is not given.\");\r\n exit();\r\n }\r\n\r\n $new_HexColor = false;\r\n if (isset($_REQUEST['HexColor'])) {\r\n $new_HexColor = trim($_REQUEST['HexColor']);\r\n }\r\n // else {\r\n // header(\"HTTP/1.0 400 Bad HexColor Request\");\r\n // print(\"HexColor is not given\");\r\n // exit();\r\n // }\r\n\r\n if (isset($_REQUEST['PlayerID']) && isset($_REQUEST['Username']) &&\r\n isset($_REQUEST['Points']) && isset($_REQUEST['SoldiersCount']) &&\r\n isset($_REQUEST['RoadsCount']) && isset($_REQUEST['HexColor'])\r\n ) {\r\n $Player = Player::create($new_PlayerID, $new_Username,\r\n $new_RoadsCount, $new_SoldiersCount, $new_Points, $new_HexColor\r\n );\r\n if ($Player == null) {\r\n header(\"HTTP/1.0 500 Server Error\");\r\n print(\"Player was not inserted\");\r\n exit();\r\n }\r\n header(\"Content-type: application/json\");\r\n print($Player->getJSON());\r\n exit();\r\n }\r\n }\r\n createPlayer();\r\n }\r\n //check which values to update\r\n $new_PlayerID = false;\r\n if (isset($_REQUEST['PlayerID'])) {\r\n $new_PlayerID = intval(trim($_REQUEST['PlayerID']));\r\n }\r\n $new_Username = false;\r\n if(isset($_REQUEST['Username'])){\r\n $new_Username= trim($_REQUEST['Username']);\r\n if ($new_Username == \"\") {\r\n header(\"HTTP/1.0 400 Bad Username Request\");\r\n print(\"Bad Username\");\r\n exit();\r\n }\r\n }\r\n $new_RoadsCount= false;\r\n if(isset($_REQUEST['RoadsCount'])){\r\n $new_RoadsCount=intval(trim($_REQUEST['RoadsCount']));\r\n }\r\n $new_SoldiersCount= false;\r\n if(isset($_REQUEST['SoldiersCount'])){\r\n $new_SoldiersCount=intval(trim($_REQUEST['SoldiersCount']));\r\n }\r\n $new_Points=false;\r\n if(isset($_REQUEST['Points'])){\r\n $new_Points=intval(trim($_REQUEST['Points']));\r\n }\r\n $new_HexColor = false;\r\n if (isset($_REQUEST['HexColor'])) {\r\n $new_HexColor = trim($_REQUEST['HexColor']);\r\n }\r\n //update via ORM\r\n if ($new_PlayerID != false) {\r\n $Player->setPlayerID($new_PlayerID);\r\n }\r\n if($new_Username != false){\r\n $Player->setUsername($new_Username);\r\n }\r\n if($new_RoadsCount != false){\r\n $Player->setRoadsCount($new_RoadsCount);\r\n }\r\n if($new_SoldiersCount!= false){\r\n $Player->setSoldiersCount($new_SoldiersCount);\r\n }\r\n if($new_Points!= false){\r\n $Player->setPoints($new_Points);\r\n }\r\n if ($new_HexColor != false) {\r\n $Player->setHexColor($new_HexColor);\r\n }\r\n //return json\r\n header(\"Content-type: application/json\");\r\n print($Player->getJSON());\r\n exit();\r\n }\r\n header(\"HTTP/1.0 400 Bad Request\");\r\n print(\"Did not understand URL\");\r\n exit();\r\n }", "function notifyWithTwoPlayersInvolved($card, $transferInfo, $progressInfo) {\n $owner_from = $transferInfo['owner_from'];\n $owner_to = $transferInfo['owner_to'];\n \n $location_from = $transferInfo['location_from'];\n $location_to = $transferInfo['location_to'];\n \n $player_id = $transferInfo['player_id'];\n \n if ($owner_from == 0 || $owner_to == 0) { // Used only for Rocketry or Fission or Mass media\n switch($location_from . '->' . $location_to) {\n case 'score->deck':\n $message_for_player = clienttranslate('${You} return a ${<}${age}${>} from ${opponent_name}\\'s score pile.');\n $message_for_opponent = clienttranslate('${player_name} returns ${<}${age}${>} ${<<}${name}${>>} from ${your} score pile.');\n $message_for_others = clienttranslate('${player_name} returns a ${<}${age}${>} from ${opponent_name}\\'s score pile.');\n break;\n\n case 'board->deck':\n $message_for_player = clienttranslate('${You} return ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board.');\n $message_for_opponent = clienttranslate('${player_name} returns ${<}${age}${>} ${<<}${name}${>>} from ${your} board.');\n $message_for_others = clienttranslate('${player_name} returns ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board.');\n break;\n \n default:\n // This should not happens\n throw new BgaVisibleSystemException(self::format(self::_(\"Unreferenced transfer in section [*1]: '{code}'\"), array('code' => $location_from . '->' . $location_to)));\n break;\n }\n } \n else if ($player_id == $owner_from) {\n switch($location_from . '->' . $location_to) {\n case 'hand->hand':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from your hand to ${opponent_name}\\'s hand.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his hand to ${your} hand.');\n $message_for_others = clienttranslate('${player_name} transfers a ${<}${age}${>} from his hand to ${opponent_name}\\'s hand.');\n break;\n \n case 'hand->score':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from your hand to ${opponent_name}\\'s score pile.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his hand to ${your} score pile.');\n $message_for_others = clienttranslate('${player_name} transfers a ${<}${age}${>} from his hand to ${opponent_name}\\'s score pile.');\n break;\n \n case 'board->board':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from your board to ${opponent_name}\\'s board.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his board to ${your} board.');\n $message_for_others = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his board to ${opponent_name}\\'s board.');\n break;\n \n case 'board->score':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from your board to ${opponent_name}\\'s score pile.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his board to ${your} score pile.');\n $message_for_others = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his board to ${opponent_name}\\'s score pile.');\n break;\n \n case 'score->hand':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from your score pile to ${opponent_name}\\'s hand.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his score pile to ${your} hand.');\n $message_for_others = clienttranslate('${player_name} transfers a ${<}${age}${>} from his score pile to ${opponent_name}\\'s hand.');\n break;\n \n case 'score->score':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from your score pile to ${opponent_name}\\'s score pile.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from his score pile to ${your} score pile.');\n $message_for_others = clienttranslate('${player_name} transfers a ${<}${age}${>} from his score pile to ${opponent_name}\\'s score pile.');\n break;\n \n\n default:\n // This should not happens\n throw new BgaVisibleSystemException(self::format(self::_(\"Unreferenced transfer in section [*2]: '{code}'\"), array('code' => $location_from . '->' . $location_to)));\n break;\n }\n }\n else { // $transferInfo['player_id'] == $transferInfo['owner_to']\n switch($location_from . '->' . $location_to) {\n case 'hand->hand':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s hand to your hand.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from ${your} hand to his hand.');\n $message_for_others = clienttranslate('${player_name} transfers a ${<}${age}${>} from ${opponent_name}\\'s hand to his hand.');\n break;\n \n case 'board->board':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board to your board.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from ${your} board to his board.');\n $message_for_others = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board to his board.');\n break;\n \n case 'board->hand':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board to your hand.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from ${your} board to his hand.');\n $message_for_others = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board to his hand.');\n break; \n\n case 'board->score':\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board to your score pile.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from ${your} board to his score pile.');\n $message_for_others = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} from ${opponent_name}\\'s board to his score pile.');\n break;\n \n case 'revealed->board': // Collaboration\n $message_for_player = clienttranslate('${You} transfer ${<}${age}${>} ${<<}${name}${>>} to your board.');\n $message_for_opponent = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} to his board.');\n $message_for_others = clienttranslate('${player_name} transfers ${<}${age}${>} ${<<}${name}${>>} to his board.');\n break;\n \n default:\n // This should not happens\n throw new BgaVisibleSystemException(self::format(self::_(\"Unreferenced transfer in section [*3]: '{code}'\"), array('code' => $location_from . '->' . $location_to)));\n break;\n }\n }\n \n self::sendNotificationWithTwoPlayersInvolved($message_for_player, $message_for_opponent, $message_for_others, $card, $transferInfo, $progressInfo);\n }", "public function play()\n {\n $game = $this->getGame();\n $playerList = $game->getPlayerList();\n /** @var IPlayer $player */\n array_map(function($player){\n $player->removeCards();\n }, $playerList->getPlayers());\n $this->getGame()->setDeck((new \\FiveCardDraw\\Service\\Deck\\StandardDeckBuilder())->build());\n for ($i = 0; $i < 5; ++$i) {\n /** @var IPlayer $player */\n foreach ($playerList->getPlayers() as $player) {\n $player->addCard($game->getDeck()->draw());\n }\n }\n $game->changeState(new TradeState($game));\n }", "function echoPlayer(&$player, $name) {\n\t$total = getTotal($player);\n\tforeach ($player as $card) {\n\t\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n}", "function stPlayerInvolvedTurn() {\n $player_id = self::getGameStateValue('current_player_under_dogma_effect');\n $launcher_id = self::getGameStateValue('active_player');\n $nested_id_1 = self::getGameStateValue('nested_id_1');\n $card_id = $nested_id_1 == -1 ? self::getGameStateValue('dogma_card_id') : $nested_id_1 ;\n $current_effect_type = $nested_id_1 == -1 ? self::getGameStateValue('current_effect_type') : 1 /* Non-demand effects only*/;\n $current_effect_number = $nested_id_1 == -1 ? self::getGameStateValue('current_effect_number') : self::getGameStateValue('nested_current_effect_number_1');\n $step_max = null;\n $step = null;\n \n $qualified_effect = self::qualifyEffect($current_effect_type, $current_effect_number, self::getCardInfo($card_id)); \n self::notifyEffectOnPlayer($qualified_effect, $player_id, $launcher_id);\n \n $crown = self::getIconSquare(1);\n $leaf = self::getIconSquare(2);\n $lightbulb = self::getIconSquare(3);\n $tower = self::getIconSquare(4);\n $factory = self::getIconSquare(5);\n $clock = self::getIconSquare(6);\n \n try {\n //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n // [A] SPECIFIC CODE: what are the automatic actions to make and/or is there interaction needed?\n $code = $card_id.($current_effect_type == 0 ? \"D\" : \"N\" ).$current_effect_number;\n self::trace('[A]'.$code.' '.self::getPlayerNameFromId($player_id).'('.$player_id.')'.' | '.self::getPlayerNameFromId($launcher_id).'('.$launcher_id.')');\n switch($code) {\n // The first number is the id of the card\n // D1 means the first (and single) I demand effect\n // N1 means the first non-demand effect\n // N2 means the second non-demand effect\n // N3 means the third non-demand effect\n \n // Setting the $step_max variable means there is interaction needed with the player\n \n // id 0, age 1: Pottery\n case \"0N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n case \"0N2\":\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n break;\n\n // id 1, age 1: Tools\n case \"1N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n case \"1N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 2, age 1: Writing\n case \"2N1\":\n self::executeDraw($player_id, 2); // \"Draw a 2\"\n break;\n \n // id 3, age 1: Archery\n case \"3D1\":\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 4, age 1: Metalworking\n case \"4N1\":\n while(true) {\n $card = self::executeDraw($player_id, 1, 'revealed'); // \"Draw and reveal a 1\"\n if (self::hasRessource($card, 4)) { // \"If it as tower\"\n self::notifyGeneralInfo(clienttranslate('It has a ${tower}.'), array('tower' => $tower));\n self::transferCardFromTo($card, $player_id, 'score', false, true); // \"Score it\"\n continue; // \"Repeat this dogma effect\"\n }\n break; // \"Otherwise\" \n }\n self::notifyGeneralInfo(clienttranslate('It does not have a ${tower}.'), array('tower' => $tower));\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Keep it\"\n break;\n \n // id 5, age 1: Oars\n case \"5D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"5N1\":\n if (self::getGameStateValue('auxiliary_value') <= 0) { // \"If no cards were transfered due to this demand\"\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n }\n break;\n \n // id 6, age 1: Clothing\n case \"6N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n case \"6N2\":\n // \"Score a 1 for each color present on your board not present on any other player board\"\n // Compute the number of specific colors\n $number_to_be_scored = 0;\n $players = self::loadPlayersBasicInfos();\n $boards = self::getAllBoards($players);\n for ($color = 0; $color < 5; $color++) { // Evaluate each color\n if (count($boards[$player_id][$color]) == 0) { // The player does not have this color => no point\n continue;\n }\n // The player has this color, do opponents have?\n $color_on_opponent_board = false;\n foreach($players as $other_player_id => $player) {\n if ($other_player_id == $player_id || $other_player_id == self::getPlayerTeammate($player_id)) {\n continue; // Skip the player being evaluated and his teammate\n }\n if (count($boards[$other_player_id][$color]) > 0) { // This opponent has this color => no point\n $color_on_opponent_board = true;\n break;\n }\n }\n if (!$color_on_opponent_board) { // The opponents do not have this color => point\n $number_to_be_scored++;\n }\n }\n // Indicate this number\n if ($number_to_be_scored == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no specific color on your board.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no specific color on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else if ($number_to_be_scored == 1) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have one specific color on your board.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has one specific color on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else {\n $translated_number = self::getTranslatedNumber($number_to_be_scored);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} specific colors on your board.'), array('i18n' => array('n'), 'You' => 'You', 'n' => $translated_number));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} specific colors on his board.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $translated_number));\n }\n // Score this number of times\n for ($i=0; $i < $number_to_be_scored; $i++) {\n self::executeDraw($player_id, 1, 'score');\n }\n break;\n \n // id 7, age 1: Sailing\n case \"7N1\":\n self::executeDraw($player_id, 1, 'board'); // \"Draw and meld a 1\"\n break;\n \n // id 8, age 1: The wheel\n case \"8N1\":\n self::executeDraw($player_id, 1); // \"Draw two 1\"\n self::executeDraw($player_id, 1); // \n break;\n \n // id 9, age 1: Agriculture\n case \"9N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 10, age 1: Domestication\n case \"10N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 11, age 1: Masonry\n case \"11N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 12, age 1: City states\n case \"12D1\":\n $number_of_towers = self::getUniqueValueFromDB(self::format(\"\n SELECT\n player_icon_count_4\n FROM\n player\n WHERE\n player_id = {player_id}\n \",\n array('player_id' => $player_id)\n ));\n \n if ($number_of_towers >= 4) { // \"If you have at least four towers on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have at least four ${icon} on your board.'), array('You' => 'You', 'icon' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has at least four ${icon} on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'icon' => $tower));\n $step_max = 1; // --> 1 interaction: see B\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have less than four ${icon} on your board.'), array('You' => 'You', 'icon' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has less than four ${icon} on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'icon' => $tower));\n }\n break;\n \n // id 13, age 1: Code of laws\n case \"13N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 14, age 1: Mysticism\n case \"14N1\":\n $card = self::executeDraw($player_id, 1, 'revealed'); // \"Draw and reveal a 1\n $color = $card['color'];\n if (self::hasThisColorOnBoard($player_id, $color)) { // \"If it is the same color of any card on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('This card is ${color}; ${you} have this color on your board.'), array('i18n' => array('color'), 'you' => 'you', 'color' => self::getColorInClear($color)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('This card is ${color}; ${player_name} has this color on his board.'), array('i18n' => array('color'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'color' => self::getColorInClear($color)));\n self::transferCardFromTo($card, $player_id, 'board'); // \"Meld it\"\n self::executeDraw($player_id, 1); // \"Draw a 1\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('This card is ${color}; ${you} do not have this color on your board.'), array('i18n' => array('color'), 'you' => 'you', 'color' => self::getColorInClear($color)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('This card is ${color}; ${player_name} does not have this color on his board.'), array('i18n' => array('color'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'color' => self::getColorInClear($color)));\n self::transferCardFromTo($card, $player_id, 'hand'); // (Put the card in your hand)\n }\n break;\n \n // id 15, age 2: Calendar\n case \"15N1\":\n if (self::countCardsInLocation($player_id, 'score') > self::countCardsInLocation($player_id, 'hand')) { // \"If you have more cards in your score pile than in your hand\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have more cards in your score pile than in your hand.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has more cards in his score pile than in his hand.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n \n self::executeDraw($player_id, 3); // \"Draw two 3\"\n self::executeDraw($player_id, 3); // \n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} do not have more cards in your score pile than in your hand.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} does not have more cards in his score pile than in his hand.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n break;\n \n // id 16, age 2: Mathematics\n case \"16N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 17, age 2: Construction\n case \"17D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"17N1\":\n $boards = self::getAllBoards(self::loadPlayersBasicInfos());\n $eligible = true;\n foreach($boards as $current_id => $board) {\n if ($current_id == self::getPlayerTeammate($player_id)) { // Ignore teammate\n continue;\n }\n $number_of_top_cards = 0;\n for($color=0; $color<5; $color++) {\n if (count($board[$color]) > 0) { // This player has a top card for this color.\n $number_of_top_cards++;\n }\n }\n if ($current_id == $player_id && $number_of_top_cards < 5 || $current_id != $player_id && $number_of_top_cards == 5) { // This player is the active player and has not 5 top cards, or he is an opponent who has 5 top cards\n $eligible = false;\n }\n }\n if ($eligible) { // \"If you are the only player with five top cards\"\n $achievement = self::getCardInfo(105);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} are the only player with five top cards.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} is the only player with five top cards.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the Empire achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} are the only player with five top cards but the Empire achievement has already been claimed.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} is the only player with five top cards but the Empire achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n }\n break;\n \n // id 18, age 2: Road building\n case \"18N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 19, age 2: Currency\n case \"19N1\":\n self::setGameStateValueFromArray('auxiliary_value', array());\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 20, age 2: Mapmaking\n case \"20D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"20N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was transfered due to the demand\"\n self::executeDraw($player_id, 1, 'score'); // \"Draw and score a 1\"\n }\n break;\n \n // id 21, age 2: Canal building \n case \"21N1\":\n if (self::countCardsInLocation($player_id, 'score') == 0 && self::countCardsInLocation($player_id, 'hand') == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no cards in your hand or score pile to exchange.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no cards in their hand or score pile to exchange.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n } else {\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n // id 22, age 2: Fermenting \n case \"22N1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $number = 0;\n for($color=0; $color<5; $color++) {\n if (self::boardPileHasRessource($player_id, $color, 2 /* leaf */)) { // There is at least one visible leaf in that color\n $number++;\n }\n }\n if ($number <= 1) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} color with one or more visible ${leaves}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} color with one or more ${leaves}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n }\n else { // $number > 1\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} colors with one or more visible ${leaves}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} colors with one or more ${leaves}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'leaves' => $leaf));\n }\n // \"For each color of your board that have one leaf or more\"\n }\n else {\n $number_of_leaves = self::getPlayerSingleRessourceCount($player_id, 2 /* leaf */);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${leaves}.'), array('You' => 'You', 'n' => $number_of_leaves, 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${leaves}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_leaves, 'leaves' => $leaf));\n $number = self::intDivision($number_of_leaves,2); // \"For every two leaves on your board\"\n }\n \n for($i=0; $i<$number; $i++) {\n self::executeDraw($player_id, 2); // \"Draw a 2\"\n }\n break;\n \n // id 23, age 2: Monotheism \n case \"23D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"23N1\":\n self::executeDraw($player_id, 1, 'board', true); // \"Draw and tuck a 1\"\n break;\n \n // id 24, age 2: Philosophy \n case \"24N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"24N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 25, age 3: Alchemy \n case \"25N1\":\n $number_of_towers = self::getPlayerSingleRessourceCount($player_id, 4);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${towers}.'), array('You' => 'You', 'n' => $number_of_towers, 'towers' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${towers}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_towers, 'towers' => $tower));\n $any_card_red = false;\n $cards = array();\n for($i=0; $i<self::intDivision($number_of_towers,3); $i++) { // \"For every three towers on your board\"\n $card = self::executeDraw($player_id, 4, 'revealed'); // \"Draw and reveal a 4\"\n if ($card['color'] == 1) { // This card is red\n $any_card_red = true;\n }\n $cards[] = $card;\n }\n \n if ($any_card_red) { // \"If any of the drawn cards are red\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} drew a red card.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} drew a red card.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n\n $step_max = 1; // --> 1 interactions: see B\n }\n else { // \"Otherwise\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} did not draw a red card.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} did not draw a red card.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n foreach($cards as $card) {\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Keep them\" (ie place them in your hand)\n }\n }\n break;\n \n case \"25N2\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 26, age 3: Translation \n case \"26N1\":\n $step_max = 1; // --> 1 interactions: see B\n break;\n \n case \"26N2\":\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card !== null && !self::hasRessource($top_card, 1)) { // This top card is present, with no crown on it\n $eligible = false;\n }\n }\n if ($eligible) { // \"If each card on your board has a crown\"\n $achievement = self::getCardInfo(108);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('Each top card on ${your} board has a ${crown}.'), array('your' => 'your', 'crown' => $crown));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('Each top card on ${player_name} board has a ${crown}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'crown' => $crown));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the World achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('Each top card on ${your} board has a ${crown} but the Empire achievement has already been claimed.'), array('your' => 'your', 'crown' => $crown));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('Each top card on ${player_name} board has a ${crown} but the World achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'crown' => $crown));\n }\n }\n break;\n \n // id 27, age 3: Engineering \n case \"27D1\":\n // \"I demand you transfer all top cards with a tower from your board to my score pile\"\n $no_top_card_with_tower = true;\n for($color = 0; $color < 5 ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card !== null && self::hasRessource($top_card, 4)) { // This top card is present, with a tower on it\n $no_top_card_with_tower = false;\n self::transferCardFromTo($top_card, $launcher_id, 'score');\n }\n }\n if ($no_top_card_with_tower) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no top card with a ${tower} on your board.'), array('You' => 'You', 'tower' => $tower));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no top card with a ${tower} on his board.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'tower' => $tower));\n }\n break;\n \n case \"27N1\":\n $step_max = 1; // --> 1 interactions: see B\n break;\n \n // id 28, age 3: Optics \n case \"28N1\":\n $card = self::executeDraw($player_id, 3, 'board'); // \"Draw and meld a 3\"\n if (self::hasRessource($card, 1)) { // \"If it has a crown\"\n self::notifyGeneralInfo(clienttranslate('It has a ${crown}.'), array('crown' => $crown));\n self::executeDraw($player_id, 4, 'score'); // \"Draw and score a 4\"\n }\n else { // \"Otherwise\"\n self::notifyGeneralInfo(clienttranslate('It does not have a ${crown}.'), array('crown' => $crown));\n $number_of_players_with_fewer_points = self::getUniqueValueFromDB(self::format(\"\n SELECT\n COUNT(*)\n FROM\n player\n WHERE\n player_id <> {player_id} AND\n player_innovation_score < (\n SELECT\n player_innovation_score\n FROM\n player\n WHERE\n player_id = {player_id}\n ) AND\n player_team <> (\n SELECT\n player_team\n FROM\n player\n WHERE\n player_id = {player_id}\n )\n \"\n ,\n array('player_id' => $player_id)\n ));\n if ($number_of_players_with_fewer_points == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('There is no opponent who has fewer points than ${you}.'), array('you' => 'you'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('There is no opponent who has fewer points than ${player_name}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else {\n $step_max = 2; // --> 2 interactions: see B\n }\n }\n break;\n \n // id 29, age 3: Compass\n case \"29D1\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 30, age 3: Paper \n case \"30N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"30N2\":\n $number_of_colors_splayed_left = 0;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) == 1 /* left */) {\n $number_of_colors_splayed_left++;\n }\n }\n if ($number_of_colors_splayed_left < 2) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} color splayed left.'), array('i18n' => array('n'), 'You' => 'You', 'n' => $number_of_colors_splayed_left));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} color splayed left.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_colors_splayed_left));\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} colors splayed left.'), array('i18n' => array('n'), 'You' => 'You', 'n' => $number_of_colors_splayed_left));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} colors splayed left.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_colors_splayed_left));\n }\n \n for($i=0;$i<$number_of_colors_splayed_left;$i++) { // For every color you have splayed left\n self::executeDraw($player_id, 4); // Draw a 4\n }\n break;\n \n // id 31, age 3: Machinery \n case \"31D1\":\n // \"Exchange all the cards in your hand with all the highest cards in my hand\"\n \n // Get cards in hand\n $ids_of_cards_in_player_hand = self::getIdsOfCardsInLocation($player_id, 'hand');\n $ids_of_highest_cards_in_launcher_hand = self::getIdsOfHighestCardsInLocation($launcher_id, 'hand');\n \n // Make the transfers\n foreach($ids_of_cards_in_player_hand as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $launcher_id, 'hand');\n }\n foreach($ids_of_highest_cards_in_launcher_hand as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $player_id, 'hand');\n }\n break;\n \n case \"31N1\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 32, age 3: Medicine \n case \"32D1\":\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 33, age 3: Education \n case \"33N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 34, age 3: Feudalism \n case \"34D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"34N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 35, age 4: Experimentation \n case \"35N1\":\n self::executeDraw($player_id, 5, 'board'); // \"Draw and meld a 5\"\n break;\n \n // id 36, age 4: Printing press \n case \"36N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"36N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 37, age 4: Colonialism\n case \"37N1\":\n do {\n $card = self::executeDraw($player_id, 3, 'board', true); // \"Draw and tuck a 3\"\n } while(self::hasRessource($card, 1 /* crown */)); // \"If it has a crown, repeat this dogma effect\"\n break;\n \n // id 38, age 4: Gunpowder\n case \"38D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"38N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was transfered due to the demand\"\n self::executeDraw($player_id, 2, 'score'); // \"Draw and score a 2\"\n }\n break;\n \n // id 39, age 4: Invention\n case \"39N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"39N2\":\n $eligible = true;\n for($color = 0; $color < 5 ; $color++) {\n if (self::getCurrentSplayDirection($player_id, $color) == 0) { // This color is missing or unsplayed\n $eligible = false;\n };\n }\n if ($eligible) { // \"If you have colors splayed, each in any direction\"\n $achievement = self::getCardInfo(107);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have all your five colors splayed.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has all his five colors splayed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the Wonder achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have all your five colors splayed but the Wonder achievement has already been claimed.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has all his five colors splayed but the Wonder achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n }\n break;\n \n // id 40, age 4: Navigation\n case \"40D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 41, age 4: Anatomy\n case \"41D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 42, age 4: Perspective\n case \"42N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 43, age 4: Enterprise\n case \"43D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"43N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 44, age 4: Reformation\n case \"44N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"44N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 45, age 5: Chemistry\n case \"45N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"45N2\":\n // \"Draw and score a card of value one higher than the highest top card on your board\"\n self::executeDraw($player_id, self::getMaxAgeOnBoardTopCards($player_id) + 1, 'score');\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 46, age 5: Physics\n case \"46N1\":\n $cards = array();\n $colors = array();\n $same_color = false;\n for($i=0; $i<3; $i++) { // \"Three times\"\n $card = self::executeDraw($player_id, 6, 'revealed'); // \"Draw and reveal a 6\"\n if (in_array($card['color'], $colors)) { // This card has the same color than one that has already been drawn\n $same_color = true;\n }\n else {\n $colors[] = $card['color'];\n }\n $cards[] = $card;\n }\n \n if ($same_color) { // \"If two or more cards are the same color\"\n $step_max = 1; // --> 1 interactions: see B\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} drew two cards of the same color.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} drew two cards of the same color.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n }\n else { // \"Otherwise\"\n self::notifyPlayer($player_id, 'log', clienttranslate('All the cards ${you} drew have different colors.'), array('you' => 'you'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('All the cards ${player_name} drew have different colors.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n foreach($cards as $card) {\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Keep them\" (ie place them in your hand)\n }\n }\n break;\n \n // id 47, age 5: Coal\n case \"47N1\":\n self::executeDraw($player_id, 5, 'board', true); // \"Draw and tuck a 5\"\n break;\n\n case \"47N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"47N3\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 48, age 5: The pirate code\n case \"48D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"48N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was transfered due to the demand\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n // id 49, age 5: Banking\n case \"49D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"49N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 50, age 5: Measurement\n case \"50N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 51, age 5: Statistics\n case \"51D1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n // Get highest cards in score\n $ids_of_highest_cards_in_score = self::getIdsOfHighestCardsInLocation($player_id, 'score');\n\n // Make the transfers\n foreach($ids_of_highest_cards_in_score as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $player_id, 'hand'); // \"Transfer all the highest cards in your score pile to your hand\"\n }\n }\n else { // First edition\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n\n case \"51N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 52, age 5: Steam engine\n case \"52N1\":\n self::executeDraw($player_id, 4, 'board', true); // \"Draw and tuck two 1\"\n self::executeDraw($player_id, 4, 'board', true); //\n $card = self::getBottomCardOnBoard($player_id, 3 /* yellow */);\n if ($card !== null) {\n self::transferCardFromTo($card, $player_id, 'score', false, true); // \"Score your bottom yellow card\"\n }\n break;\n \n // id 53, age 5: Astronomy\n case \"53N1\":\n while(true) {\n $card = self::executeDraw($player_id, 6, 'revealed'); // \"Draw and reveal a 6\"\n if ($card['color'] != 0 /* blue */ && $card['color'] != 2 /* green */) {\n self::notifyGeneralInfo(clienttranslate(\"This card is neither blue nor green.\"));\n break; // \"Otherwise\"\n };\n // \"If the card is green or blue\"\n self::notifyGeneralInfo($card['color'] == 0 ? clienttranslate(\"This card is blue.\") : clienttranslate(\"This card is green.\"));\n self::transferCardFromTo($card, $player_id, 'board'); // \"Meld it\"\n }\n self::transferCardFromTo($card, $player_id, 'hand'); // (\"Keep it\")\n break;\n \n case \"53N2\":\n $eligible = true;\n for($color = 0; $color < 4 /* purple is not tested */ ; $color++) {\n $top_card = self::getTopCardOnBoard($player_id, $color);\n if ($top_card !== null && $top_card['age'] < 6) { // This top card is value 5 or fewer\n $eligible = false;\n }\n }\n if ($eligible) { // \"If all your non-purple top cards on your board are value 6 or higher\"\n $achievement = self::getCardInfo(109);\n if ($achievement['owner'] == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('All non-purple top cards on ${your} board are value ${age_6} or higher.'), array('your' => 'your', 'age_6' => self::getAgeSquare(6)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('All non-purple top cards on ${player_name}\\'s board are value ${age_6} or higher.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'age_6' => self::getAgeSquare(6)));\n self::transferCardFromTo($achievement, $player_id, 'achievements'); // \"Claim the Universe achievement\"\n }\n else {\n self::notifyPlayer($player_id, 'log', clienttranslate('All non-purple top cards on ${your} board are value ${age_6} or higher but the Universe achievement has already been claimed.'), array('your' => 'your', 'age_6' => self::getAgeSquare(6)));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('All non-purple top cards on ${player_name}\\'s board are value ${age_6} or higher but the Universe achievement has already been claimed.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'age_6' => self::getAgeSquare(6)));\n }\n }\n break;\n \n // id 54, age 5: Societies\n case \"54D1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $colors = array();\n // Determine colors which top cards with a lightbulb of the player have a value higher than the tops cards of the launcher\n for($color=0; $color<5; $color++) {\n $player_top_card = self::getTopCardOnBoard($player_id, $color);\n if ($player_top_card === null || !self::hasRessource($player_top_card, 3 /* lightbulb */)) {\n continue;\n }\n $launcher_top_card = self::getTopCardOnBoard($launcher_id, $color);\n if ($launcher_top_card === null /* => Value 0, so the color is selectable */ || $player_top_card['age'] > $launcher_top_card['age']) {\n $colors[] = $color; // This color is selectable\n }\n }\n }\n else { // First edition\n $colors = array(0,1,2,3); // All but purple\n }\n self::setGameStateValueFromArray('auxiliary_value', $colors);\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 55, age 6: Atomic theory\n case \"55N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"55N2\":\n self::executeDraw($player_id, 7, 'board'); // \"Draw and meld a 7\"\n break;\n \n // id 56, age 6: Encyclopedia\n case \"56N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 57, age 6: Industrialisation\n case \"57N1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $number = 0;\n for($color=0; $color<5; $color++) {\n if (self::boardPileHasRessource($player_id, $color, 5 /* factory */)) { // There is at least one visible factory in that color\n $number++;\n }\n }\n if ($number <= 1) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} color with one or more visible ${factories}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} color with one or more ${factories}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n }\n else { // $number > 1\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} colors with one or more visible ${factories}.'), array('i18n' => array('n'), 'You' => 'You', 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} colors with one or more ${factories}.'), array('i18n' => array('n'), 'player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => self::getTranslatedNumber($number), 'factories' => $factory));\n }\n // \"For each color of your board that have one factory or more\"\n }\n else {\n $number_of_factories = self::getPlayerSingleRessourceCount($player_id, 5 /* factory */);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${factories}.'), array('You' => 'You', 'n' => $number_of_factories, 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${factories}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_factories, 'factories' => $factory));\n $number = self::intDivision($number_of_factories,2); // \"For every two factories on your board\"\n }\n \n for($i=0; $i<$number; $i++) {\n self::executeDraw($player_id, 6, 'board', true); // \"Draw and tuck a 6\"\n }\n break;\n \n case \"57N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 58, age 6: Machine tools\n case \"58N1\":\n self::executeDraw($player_id, self::getMaxAgeInScore($player_id), 'score'); // \"Draw and score a card of value equal to the highest card in your score pile\"\n break;\n \n // id 59, age 6: Classification\n case \"59N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 60, age 6: Metric system\n case \"60N1\":\n if (self::getCurrentSplayDirection($player_id, 2 /* green */) == 2 /* right */) { // \"If your green cards are splayed right\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n case \"60N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 61, age 6: Canning\n case \"61N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"61N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 62, age 6: Vaccination\n case \"62D1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"62N1\":\n if (self::getGameStateValue('auxiliary_value') == 1) { // \"If any card was returned as a result of the demand\"\n self::executeDraw($player_id, 7, 'board'); // \"Draw and meld a 7\"\n }\n break;\n \n // id 63, age 6: Democracy \n case \"63N1\":\n if (self::getGameStateValue('auxiliary_value') == -1) { // If this variable has not been set before\n self::setGameStateValue('auxiliary_value', 0);\n }\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 64, age 6: Emancipation\n case \"64D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"64N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 65, age 7: Evolution \n case \"65N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 66, age 7: Publications\n case \"66N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"66N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 67, age 7: Combustion\n case \"67D1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $number_of_crowns = self::getPlayerSingleRessourceCount($launcher_id, 1 /* crown */);\n self::notifyPlayer($launcher_id, 'log', clienttranslate('${You} have ${n} ${crowns}.'), array('You' => 'You', 'n' => $number_of_crowns, 'crowns' => $crown));\n self::notifyAllPlayersBut($launcher_id, 'log', clienttranslate('${player_name} has ${n} ${crowns}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_crowns, 'crowns' => $crown));\n $number = self::intDivision($number_of_crowns, 4);\n if ($number == 0) {\n self::notifyGeneralInfo(clienttranslate('No card has to be transfered.'));\n break;\n }\n }\n else { // First edition\n $number = 2;\n }\n self::setGameStateValue('auxiliary_value', $number);\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"67N1\":\n if (self::getGameStateValue('game_rules') == 1) { // Last edition\n $bottom_red_card = self::getBottomCardOnBoard($player_id, 1 /* red */);\n if ($bottom_red_card !== null) {\n self::transferCardFromTo($bottom_red_card, 0, 'deck'); // \"Return your bottom red card\"\n }\n }\n break;\n \n // id 68, age 7: Explosives\n case \"68D1\":\n self::setGameStateValue('auxiliary_value', 0); // Flag to indicate if the player has transfered a card or not\n $step_max = 3; // --> 3 interactions: see B\n break;\n \n // id 69, age 7: Bicycle\n case \"69N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 70, age 7: Electricity\n case \"70N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 71, age 7: Refrigeration\n case \"71D1\":\n if (self::countCardsInLocation($player_id, 'hand') > 1) {\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n case \"71N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 72, age 7: Sanitation \n case \"72D1\":\n $step_max = 3; // --> 3 interactions: see B\n break;\n \n // id 73, age 7: Lighting \n case \"73N1\":\n self::setGameStateValueFromArray('auxiliary_value', array()); // Flag to indicate what ages have been tucked\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 74, age 7: Railroad \n case \"74N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"74N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 75, age 8: Quantum theory \n case \"75N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 76, age 8: Rocketry \n case \"76N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 77, age 8: Flight\n case \"77N1\":\n if (self::getCurrentSplayDirection($player_id, 1 /* red */) == 3 /* up */) { // \"If your red cards are splayed up\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n case \"77N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 78, age 8: Mobility \n case \"78D1\":\n self::setGameStateValueFromArray('auxiliary_value', array(0,2,3,4)); // Flag to indicate the colors the player can still choose (not red at the start)\n $step_max = 2; // --> 2 interactions: see B\n break;\n \n // id 79, age 8: Corporations \n case \"79D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"79N1\":\n self::executeDraw($player_id, 8, 'board'); // \"Draw and meld an ${age_8}\"\n break;\n \n // id 80, age 8: Mass media \n case \"80N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"80N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 81, age 8: Antibiotics\n case \"81N1\":\n self::setGameStateValueFromArray('auxiliary_value', array()); // Flag to indicate what ages have been tucked\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 82, age 8: Skyscrapers\n case \"82D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 83, age 8: Empiricism \n case \"83N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"83N2\":\n if (self::getPlayerSingleRessourceCount($player_id, 3 /* lightbulb */) >= 20) { // \"If you have twenty or more lightbulbs on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have at least twenty ${lightbulbs}.'), array('You' => 'You', 'lightbulbs' => $lightbulb));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has at least twenty ${lightbulbs}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'lightbulbs' => $lightbulb));\n self::setGameStateValue('winner_by_dogma', $player_id); // \"You win\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Empiricism');\n throw new EndOfGame(); \n }\n break;\n \n // id 84, age 8: Socialism \n case \"84N1\":\n self::setGameStateValue('auxiliary_value', 0); // Flag to indicate if one purple card has been tuckeds or not\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 85, age 9: Computers \n case \"85N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"85N2\":\n $card = self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\"\n self::checkAndPushCardIntoNestedDogmaStack($card); // \"Execute each of its non-demand dogma effects\"\n break;\n \n // id 86, age 9: Genetics \n case \"86N1\":\n $card = self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\"\n $board = self::getCardsInLocation($player_id, 'board', false, true);\n $pile = $board[$card['color']];\n for($p=0; $p < count($pile)-1; $p++) { // \"For each card beneath it\"\n $card = self::getCardInfo($pile[$p]['id']);\n self::transferCardFromTo($card, $player_id, 'score', false, true); // \"Score that card\"\n }\n break;\n \n // id 87, age 9: Composites \n case \"87D1\":\n $step_max = 2; // --> 2 interactions: see B\n if (self::countCardsInLocation($player_id, 'hand') <= 1) {\n $step = 2; // --> (All but one card when there is 0 or 1 card means that nothing is to be done) Jump directly to step 2\n }\n break;\n \n // id 88, age 9: Fission\n case \"88D1\":\n $card = self::executeDraw($player_id, 10, 'revealed'); // \"Draw a 10\"\n if ($card['color'] == 1 /* red */) { // \"If it is red\"\n self::notifyGeneralInfo(clienttranslate('This card is red.'));\n self::removeAllHandsBoardsAndScores(); // \"Remove all hands, boards and score piles from the game\"\n self::notifyAll('removedHandsBoardsAndScores', clienttranslate('All hands, boards and score piles are removed from the game. Achievements are kept.'), array());\n \n // Stats\n self::setStat(true, 'fission_triggered');\n \n // \"If this occurs, the dogma action is complete\"\n // (Set the flags has if the launcher had completed the non-demand dogma effect)\n self::setGameStateValue('current_player_under_dogma_effect', $launcher_id);\n self::setGameStateValue('current_effect_type', 1);\n self::setGameStateValue('current_effect_number', 1);\n }\n else {\n self::notifyGeneralInfo(clienttranslate('This card is not red.'));\n // (Implicit) \"Place it into your hand\"\n self::transferCardFromTo($card, $player_id, 'hand');\n }\n break;\n \n case \"88N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 89, age 9: Collaboration\n case \"89D1\":\n self::executeDraw($player_id, 9, 'revealed'); // \"Draw two 9 and reveal them\"\n self::executeDraw($player_id, 9, 'revealed'); //\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"89N1\":\n $number_of_cards_on_board = self::countCardsInLocation($player_id, 'board', false, true);\n $number_of_green_cards = $number_of_cards_on_board[2];\n if ($number_of_green_cards >= 10) { // \"If you have ten or more green cards on your board\"\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have at least ten green cards.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has at least ten green cards.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n self::setGameStateValue('winner_by_dogma', $player_id); // \"You win\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Collaboration');\n throw new EndOfGame(); \n }\n break;\n \n // id 90, age 9: Satellites\n case \"90N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"90N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"90N3\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 91, age 9: Ecology\n case \"91N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n // id 92, age 9: Suburbia\n case \"92N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 93, age 9: Services\n case \"93D1\":\n $ids_of_highest_cards_in_score = self::getIdsOfHighestCardsInLocation($player_id, 'score');\n foreach($ids_of_highest_cards_in_score as $id) {\n $card = self::getCardInfo($id);\n self::transferCardFromTo($card, $launcher_id, 'hand'); // \"Transfer all the highest cards from your score pile to my hand\"\n }\n \n if (count($ids_of_highest_cards_in_score) > 0) { // \"If you transferred any cards\"\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n\n // id 94, age 9: Specialization\n case \"94N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"94N2\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 95, age 10: Bioengineering\n case \"95N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"95N2\":\n $players = self::loadPlayersBasicInfos();\n $max_number_of_leaves = -1;\n $any_under_three_leaves = false;\n foreach ($players as $player_id => $player) {\n $number_of_leaves = self::getPlayerSingleRessourceCount($player_id, 2);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${leaves}.'), array('You' => 'You', 'n' => $number_of_leaves, 'leaves' => $leaf));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${leaves}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_leaves, 'leaves' => $leaf));\n if (!$any_under_three_leaves && $number_of_leaves < 3) { // Less than three\n self::notifyGeneralInfo(clienttranslate('That is less than 3.'));\n $any_under_three_leaves = true;\n }\n if ($number_of_leaves > $max_number_of_leaves) {\n $max_number_of_leaves = $number_of_leaves;\n $owner_of_max_number_of_leaves = $player_id;\n $tie = false; \n }\n else if ($number_of_leaves == $max_number_of_leaves && $player_id != self::getPlayerTeammate($owner_of_max_number_of_leaves)) {\n $tie = true;\n }\n }\n \n if (!$any_under_three_leaves) {\n self::notifyGeneralInfo(clienttranslate('Nobody has less than three ${leaves}.'), array('leaves' => $leaf));\n }\n else if ($tie) {\n self::notifyGeneralInfo(clienttranslate('There is a tie for the most number of ${leaves}. The game continues.'), array('leaves' => $leaf));\n }\n else { // \"If any player has less than three leaves, the single player with the most number of leaves\"\n self::notifyPlayer($owner_of_max_number_of_leaves, 'log', clienttranslate('${You} have more ${leaves} than each opponent.'), array('You' => 'You', 'leaves' => $leaf));\n self::notifyAllPlayersBut($owner_of_max_number_of_leaves, 'log', clienttranslate('${player_name} has more ${leaves} than each opponent.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($owner_of_max_number_of_leaves), $owner_of_max_number_of_leaves), 'leaves' => $leaf));\n self::setGameStateValue('winner_by_dogma', $owner_of_max_number_of_leaves); // \"Wins\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Bioengineering');\n throw new EndOfGame();\n }\n \n break;\n\n // id 96, age 10: Software\n case \"96N1\":\n self::executeDraw($player_id, 10, 'score', false, true /* score keyword*/); // \"Draw and score a 10\"\n break;\n \n case \"96N2\":\n self::executeDraw($player_id, 10, 'board'); // \"Draw and meld two 10\"\n $card = self::executeDraw($player_id, 10, 'board'); //\n self::checkAndPushCardIntoNestedDogmaStack($card); // \"Execute each of the second card's non-demand dogma effects\"\n break;\n \n // id 97, age 10: Miniaturization\n case \"97N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n // id 98, age 10: Robotics\n case \"98N1\":\n $top_green_card = self::getTopCardOnBoard($player_id, 2 /* green */);\n if ($top_green_card !== null) {\n self::transferCardFromTo($top_green_card, $player_id, 'score', false, true /* score keyword*/); // \"Score your top green card\"\n }\n $card = self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\n self::checkAndPushCardIntoNestedDogmaStack($card); // \"Execute each its non-demand dogma effects\"\n break;\n \n // id 99, age 10: Databases\n case \"99D1\":\n if (self::countCardsInLocation($player_id, 'score') > 0) { // (Nothing to do if the player has nothing in his score pile)\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n // id 100, age 10: Self service\n case \"100N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n \n case \"100N2\":\n $players = self::loadPlayersBasicInfos();\n $number_of_achievements = self::getPlayerNumberOfAchievements($player_id);\n $most_achievements = true;\n foreach ($players as $other_player_id => $player) {\n if ($other_player_id == $player_id || $other_player_id == self::getPlayerTeammate($player_id)) {\n continue; // Skip the player being evaluated and his teammate\n }\n \n if (self::getPlayerNumberOfAchievements($other_player_id) >= $number_of_achievements) {\n $most_achievements = false;\n }\n }\n if ($most_achievements) { // \"If you have more achievements than each other player\"\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n self::notifyAllPlayersBut($player_id, \"log\", clienttranslate('${player_name} has more achievements than each other player.'), array(\n 'player_name' => self::getPlayerNameFromId($player_id)\n ));\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('${You} have more achievements than each other player.'), array(\n 'You' => 'You'\n ));\n }\n else { // self::getGameStateValue('game_type')) == 'team'\n $teammate_id = self::getPlayerTeammate($player_id);\n $winning_team = array($player_id, $teammate_id);\n self::notifyAllPlayersBut($winning_team, \"log\", clienttranslate('The other team has more achievements than yours.'), array());\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('Your team has more achievements than the other.'), array());\n \n self::notifyPlayer($teammate_id, \"log\", clienttranslate('Your team has more achievements than the other.'), array());\n }\n self::setGameStateValue('winner_by_dogma', $player_id); // \"You win\"\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Self service');\n throw new EndOfGame();\n }\n break;\n \n // id 101, age 10: Globalization\n case \"101D1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"101N1\":\n self::executeDraw($player_id, 6, 'score', false, true); // \"Draw and score a 6\"\n \n $players = self::loadPlayersBasicInfos();\n $nobody_more_leaves_than_factories = true;\n foreach ($players as $player_id => $player) {\n $number_of_leaves = self::getPlayerSingleRessourceCount($player_id, 2);\n $number_of_factories = self::getPlayerSingleRessourceCount($player_id, 5);\n \n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${m} ${leaves} and ${n} ${factories}.'), array('You' => 'You', 'm' => $number_of_leaves, 'leaves' => $leaf, 'n' => $number_of_factories, 'factories' => $factory));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${m} ${leaves} and ${n} ${factories}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'm' => $number_of_leaves, 'leaves' => $leaf, 'n' => $number_of_factories, 'factories' => $factory));\n \n if ($nobody_more_leaves_than_factories && $number_of_leaves > $number_of_factories) {\n self::notifyGeneralInfo(clienttranslate('That is more ${leaves} than ${factories}'), array('leaves' => $leaf, 'factories' => $factory));\n $nobody_more_leaves_than_factories = false;\n }\n }\n \n if ($nobody_more_leaves_than_factories) { // \"If no player has more leaves than factories on their board\"\n $teams = array();\n $scores = array();\n foreach ($players as $player_id => $player) {\n $team = self::getPlayerTeam($player_id);\n $score = self::getPlayerScore($player_id);\n if (!array_key_exists($team, $teams)) {\n $teams[$team] = array($player_id);\n $scores[$team] = $score;\n }\n else {\n $teams[$team][] = $player_id;\n $scores[$team] += $score;\n }\n }\n \n $max_score = -1;\n foreach($scores as $team => $score) {\n if ($score > $max_score) {\n $max_score = $score;\n $team_max = $team;\n $tie = false;\n }\n else if ($score == $max_score) {\n $tie = true;\n }\n \n // Display the score (or the combined score for the team)\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n $player_id = $teams[$team][0];\n if ($score < 2) {\n $message_for_others = clienttranslate('${player_name} has ${n} point.');\n $message_for_player = clienttranslate('${You} have ${n} point.');\n }\n else {\n $message_for_others = clienttranslate('${player_name} has ${n} points.');\n $message_for_player = clienttranslate('${You} have ${n} points.'); \n }\n self::notifyAllPlayersBut($player_id, \"log\", $message_for_others, array(\n 'player_name' => self::getPlayerNameFromId($player_id),\n 'n' => $score\n ));\n \n self::notifyPlayer($player_id, \"log\", $message_for_player, array(\n 'You' => 'You',\n 'n' => $score\n ));\n } \n else { // self::getGameStateValue('game_type') == 'team'\n $current_team = $teams[$team];\n $player_id = $current_team[0];\n $teammate_id = $current_team[1];\n if ($score < 2) {\n $message_for_team = clienttranslate('Your team has ${n} point.');\n $message_for_others = clienttranslate('The other team has ${n} point.');\n }\n else {\n $message_for_team = clienttranslate('Your team has ${n} points.');\n $message_for_others = clienttranslate('The other team has ${n} points.'); \n }\n self::notifyAllPlayersBut($current_team, \"log\", $message_for_others, array('n' => $score));\n \n self::notifyPlayer($player_id, \"log\", $message_for_team, array('n' => $score));\n \n self::notifyPlayer($teammate_id, \"log\",$message_for_team, array('n' => $score)); \n }\n }\n \n if ($tie) {\n self::notifyGeneralInfo(clienttranslate('There is a tie for the greatest score. The game continues.'));\n }\n else {\n $winning_team = $teams[$team_max];\n if (self::decodeGameType(self::getGameStateValue('game_type')) == 'individual') {\n $player_id = $winning_team[0];\n self::notifyAllPlayersBut($player_id, \"log\", clienttranslate('${player_name} has a greater score than each other player.'), array(\n 'player_name' => self::getPlayerNameFromId($player_id)\n ));\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('${You} have a greater score than each other player.'), array(\n 'You' => 'You'\n ));\n }\n else { // self::getGameStateValue('game_type')) == 'team'\n $player_id = $winning_team[0];\n $teammate_id = $winning_team[1];\n self::notifyAllPlayersBut($winning_team, \"log\", clienttranslate('The other team has a greater score than yours.'), array());\n \n self::notifyPlayer($player_id, \"log\", clienttranslate('Your team has a greater score than the other one.'), array());\n \n self::notifyPlayer($teammate_id, \"log\", clienttranslate('Your team has a greater score than the other one.'), array());\n }\n self::setGameStateValue('winner_by_dogma', $player_id); // \"The single player with the most points wins\" (or combined scores for team)\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn Globalization');\n throw new EndOfGame();\n }\n }\n break;\n \n // id 102, age 10: Stem cells\n case \"102N1\":\n if (self::countCardsInLocation($player_id, 'hand') == 0) {\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have no cards in your hand to score.'), array('You' => 'You'));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has no cards in their hand to score.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id)));\n } else {\n $step_max = 1; // --> 1 interaction: see B\n }\n break;\n \n \n // id 103, age 10: A. I.\n case \"103N1\":\n self::executeDraw($player_id, 10, 'score'); // \"Draw and score a 10\"\n break;\n\n case \"103N2\":\n $players = self::loadPlayersBasicInfos();\n $software_found = false;\n foreach ($players as $any_player_id => $player) {\n $top_blue_card = self::getTopCardOnBoard($any_player_id, 0 /* blue: color of Software*/);\n if ($top_blue_card !== null && $top_blue_card['id'] == 96 /* Software */) {\n $software_found = true;\n break;\n }\n }\n \n $robotics_found = false;\n foreach ($players as $any_player_id => $player) {\n $top_red_card = self::getTopCardOnBoard($any_player_id, 1 /* red: color of Robotics*/);\n if ($top_red_card !==null && $top_red_card['id'] == 98 /* Robotics */) {\n $robotics_found = true;\n break;\n }\n }\n \n if ($software_found && $robotics_found) { // \"If Robotics and Software are top cards on any board\"\n self::notifyGeneralInfo(clienttranslate('Robotics and Software are both visible as top cards.'));\n \n $min_score = 9999;\n foreach($players as $any_player_id => $player) {\n $score = self::getPlayerScore($any_player_id);\n if ($score < $min_score) {\n $min_score = $score;\n $player_with_min_score = $any_player_id;\n $tie = false;\n }\n else if ($score == $min_score) {\n $tie = true;\n }\n \n // Display the score (or the combined score for the team)\n if ($score < 2) {\n $message_for_others = clienttranslate('${player_name} has ${n} point.');\n $message_for_player = clienttranslate('${You} have ${n} point.');\n }\n else {\n $message_for_others = clienttranslate('${player_name} has ${n} points.');\n $message_for_player = clienttranslate('${You} have ${n} points.');\n }\n self::notifyAllPlayersBut($any_player_id, \"log\", $message_for_others, array(\n 'player_name' => self::getPlayerNameFromId($any_player_id),\n 'n' => $score\n ));\n \n self::notifyPlayer($any_player_id, \"log\", $message_for_player, array(\n 'You' => 'You',\n 'n' => $score\n ));\n }\n if ($tie) {\n self::notifyGeneralInfo(clienttranslate('There is a tie for the lowest score. The game continues.'));\n }\n else {\n self::notifyAllPlayersBut($player_with_min_score, \"log\", clienttranslate('${player_name} has the lowest score.'), array(\n 'player_name' => self::getPlayerNameFromId($player_with_min_score)\n ));\n \n self::notifyPlayer($player_with_min_score, \"log\", clienttranslate('${You} have the lowest score.'), array(\n 'You' => 'You'\n ));\n self::setGameStateValue('winner_by_dogma', $player_with_min_score); // \"The single player with the most points wins\" (scores are not combined for teams)\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn A. I.');\n throw new EndOfGame();\n }\n }\n break;\n\n // id 104, age 10: The internet.\n case \"104N1\":\n $step_max = 1; // --> 1 interaction: see B\n break;\n\n case \"104N2\":\n self::executeDraw($player_id, 10, 'score'); // \"Draw and score a 10\"\n break;\n\n case \"104N3\":\n $number_of_clocks = self::getPlayerSingleRessourceCount($player_id, 6 /* clock */);\n self::notifyPlayer($player_id, 'log', clienttranslate('${You} have ${n} ${clocks}.'), array('You' => 'You', 'n' => $number_of_clocks, 'clocks' => $clock));\n self::notifyAllPlayersBut($player_id, 'log', clienttranslate('${player_name} has ${n} ${clocks}.'), array('player_name' => self::getColoredText(self::getPlayerNameFromId($player_id), $player_id), 'n' => $number_of_clocks, 'clocks' => $clock));\n for($i=0; $i<self::intDivision($number_of_clocks,2); $i++) { // \"For every two clocks on your board\"\n self::executeDraw($player_id, 10, 'board'); // \"Draw and meld a 10\"\n }\n break;\n \n default:\n // This should not happens\n //throw new BgaVisibleSystemException(self::format(self::_(\"Unreferenced card effect code in section A: '{code}'\"), array('code' => $code)));\n break;\n }\n //[AA]||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::stPlayerInvolvedTurn');\n self::trace('playerInvolvedTurn->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n \n if ($step_max === null) {\n // End of the effect for this player\n self::trace('playerInvolvedTurn->interPlayerInvolvedTurn');\n $this->gamestate->nextState('interPlayerInvolvedTurn');\n return;\n }\n // There is an interaction needed\n self::setGameStateValue('step_max', $step_max);\n\n // Prepare the first step\n self::setGameStateValue('step', $step === null ? 1 : $step);\n self::trace('playerInvolvedTurn->interactionStep');\n $this->gamestate->nextState('interactionStep');\n }", "public function getPlayer()\n\t{\n\t\treturn $this->player;\n\t}", "public function getPlayers() {\n\t\treturn $this -> data['players'];\n\t}", "public function onPlayerInteract(Player $player) : void {\n\t}", "public function onPlayerAttackPlayer(PlayerAttackPlayerEvent $event) {\n if (!$event->getGameType()->equals(TypeList::Anni())) return;\n\n $target = $event->getTarget();\n $attacker = $event->getAttacker();\n $attackerData = AnniPlayerDataStorage::get($attacker->getName());\n $attackerJob = $attackerData->getCurrentJob();\n //Warriorならダメージ+1, Skill発動中ならさらに+1\n if ($attackerJob instanceof Warrior) {\n $additionalDamage = 1;\n if ($attackerJob->isOnFrenzy()) $additionalDamage++;\n\n $source = new EntityDamageByEntityEvent($attacker, $target, $event->getCause(), $event->getBaseDamage(), [], $event->getKnockBack());\n $target->setLastDamageCause($source);\n $target->setHealth($target->getHealth() - $additionalDamage);\n } else if ($attackerJob instanceof Lumberjack) {//Lumberjack\n //スキル発動中かつ斧での攻撃なら耐久値を16削る\n if ($attackerJob->isOnBruteForce() and $attacker->getInventory()->getItemInHand()->getId() instanceof Axe) {\n foreach ($target->getArmorInventory()->getContents() as $item) {\n if ($item instanceof Armor) {\n $item->applyDamage(16);\n //todo:音とエフェクト\n }\n }\n }\n } else if ($attackerJob instanceof Pyro) {\n //Pyroなら37%の確立で相手に火をつける\n if (mt_rand(1, 100) <= 37) {\n $target->setOnFire(2);\n }\n }\n\n //Assassinならスキルをキャンセルする\n $targetJob = AnniPlayerDataStorage::get($target->getName())->getCurrentJob();\n if ($targetJob instanceof Assassin) {\n $targetJob->cancelSkill();\n $targetJob->reverseArmor($event->getTarget()->getName());\n }\n }", "private function guardAgainstInsufficientAccess(\\App\\Player $player)\n {\n if($player->accessBalance()->quantity < env('MIN_ACCESS_GROUP'))\n {\n return 'Low Access Token Balance';\n }\n }", "public function transform($matchPlayer)\n {\n $name = null;\n $position = null;\n\n if ($matchPlayer->player) {\n $name = $matchPlayer->player->name;\n $position = (\n array_key_exists($matchPlayer->player->position, Player::POSITION_MAP)\n ? Player::POSITION_MAP[$matchPlayer->player->position]\n : null\n );\n }\n\n return [\n 'id' => $matchPlayer->player_id,\n 'number' => $matchPlayer->number,\n 'position' => $position,\n 'role' => $matchPlayer->role,\n 'name' => $name,\n ];\n }", "public function dotomdotom2 (Player $player)\r\n\t{\r\n\t\t$fvector = $this->getFrontalVector ($player);\r\n $player->teleport ($fvector);\r\n\t}", "function getGameProgression()\n { \n // Start or end of game\n $current_state = $this->gamestate->state();\n switch($current_state['name']) {\n case 'gameSetup':\n case 'turn0':\n return 0;\n case 'whoBegins':\n return 1;\n case 'justBeforeGameEnd':\n case 'gameEnd':\n return 100;\n }\n // For other states (all included in player action)\n $players = self::loadPlayersBasicInfos();\n \n // The total progression is a mix of:\n // -the progression of the decreasing number of cards in deck (end of game by score)\n // -the progression of each player in terms of the achievements they get\n \n // Progression in cards\n // Hypothesis: a card of age 9 is drawn three times quicker than a card of age 1. Cards of age 10 are worth six times a card of age 1 because if there are none left it is the end of the game\n $weight = 0;\n $total_weight = 0;\n \n $number_of_cards_in_decks = self::countCardsInLocation(0, 'deck', true);\n for($age=1; $age<=10; $age++) {\n $n = $number_of_cards_in_decks[$age];\n switch($age) {\n case 1:\n $n_max = 14 - 2 * count($players); // number of cards in the deck at the beginning: 14 (15 minus one taken for achievement) minus the cards dealt to the players at the beginning\n $w = 1; // weight for cards of age 1: 1\n break;\n case 10:\n $n++; // one more \"virtual\" card because the game is not over where the tenth age 10 card is drawn (but quite...)\n $n_max = 11; // number of cards in the deck at the beginning: 10, +1 one more \"virtual\" card because the game is not over when the last is drawn\n $w = 6; // weight for cards of age 10: 6\n break;\n default:\n $n_max = 9; // number of cards in the deck at the beginning: 9 (10 minus one taken for achievement)\n $w = ($age-1) / 4 + 1; // weight between 1.25 (for age 2) and 3 (for age 9)\n break;\n };\n $weight += ($n_max - $n) * $w; // What is really important are the cards already drawn\n $total_weight += $n_max * $w;\n }\n $progression_in_cards = $weight/$total_weight;\n \n // Progression of players\n // This is the ratio between the number of achievements the player have got so far and the number of achievements needed to win the game\n $progression_of_players = array();\n $n_max = self::getGameStateValue('number_of_achievements_needed_to_win');\n foreach($players as $player_id=>$player) {\n $n = self::getPlayerNumberOfAchievements($player_id);\n $progression_of_players[] = $n/$n_max;\n }\n \n // If any of the above progression was 100%, the game would be over. So, 100% is a kind of \"absorbing\" element. So,the method is to multiply the complements of the progression.\n // A complement is defined as 100% - progression\n $complement = 1 - $progression_in_cards;\n foreach($progression_of_players as $progression) {\n $complement *= 1 - $progression;\n }\n $final_progression = 1 - $complement;\n \n // Convert the final result in percentage\n $percentage = intval(100 * $final_progression);\n $percentage = min(max(1, $percentage), 99); // Set that progression between 1% and 99%\n return $percentage;\n }", "protected function getTurn1AttackOrder()\n {\n $order = [];\n $speedComparise = $this->getPlayer1()->properties()->getProperty('speed') <=> $this->getPlayer2()->properties()->getProperty('speed');\n\n switch ($speedComparise) {\n /**\n * If both players have same speed then compare luck\n */\n case 0:\n $luckComparise = $this->getPlayer1()->properties()->getProperty('luck') <=> $this->getPlayer2()->properties()->getProperty('luck');\n $order = $luckComparise >= 0 ? [$this->getPlayer1(), $this->getPlayer2()] : [$this->getPlayer2(), $this->getPlayer1()];\n break;\n /**\n * If Player2 is fastest\n */\n case -1:\n $order = [$this->getPlayer2(), $this->getPlayer1()];\n break;\n /**\n * If Player1 is fastest\n */\n case 1:\n $order = [$this->getPlayer1(), $this->getPlayer2()];\n }\n return $order;\n }", "public function EncargarTransResponsable(){\n $conn = new conexion();\n $user = null;\n try {\n if($conn->conectar()){\n $str_sql = \"SELECT usuarios.nom_usu,usuarios.id_usu from usuarios \"\n . \"WHERE usuarios.id_tp_usu = 2 and usuarios.estado = 'Activo' or usuarios.id_tp_usu = 4 and usuarios.estado = 'Activo'\";\n $sql = $conn->getConn()->prepare($str_sql);\n $sql->execute();\n $resultado = $sql->fetchAll();\n foreach ($resultado as $row){\n $user[] = array(\n \"Nom_usu\" => $row['nom_usu'],\n \"Id_usu\" => $row['id_usu']\n );\n }\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n $conn->desconectar();\n return $user;\n }", "public function GetPlayer($username)\n {\n $nono = new db($this->returnType);\n return $nono->Get(\"select * from players where username='$username';\");\n }", "public function simulateGame(Player $playerOne, Player $playerTwo): array\n {\n $playerOneProbabilityOfWinning = $this->calculateProbabilityOfWinning($playerOne, $playerTwo);\n $potentialRatingChangePlayerOne = self::K * (1 - $playerOneProbabilityOfWinning);\n\n // Calculate the potential point change for player two as well.\n $playerTwoProbabilityOfWinning = $this->calculateProbabilityOfWinning($playerTwo, $playerOne);\n $potentialRatingChangePlayerTwo = self::K * (1 - $playerTwoProbabilityOfWinning);\n\n $playerOneWon = $this->determineIfPlayerWon($playerOneProbabilityOfWinning);\n // In case player one lost, it should lose the points that player two could win.\n $playerOneRatingChange = $playerOneWon ? $potentialRatingChangePlayerOne : -1 * $potentialRatingChangePlayerTwo;\n // Player two should increment by the opposite.\n $playerTwoRatingChange = -1 * $playerOneRatingChange;\n\n // On a set there is no decrease but increasing a positive number with a negative number still works.\n $this->redis->hincrby(self::SET_OF_PLAYERS, $playerOne->getId(), (int) round($playerOneRatingChange));\n $this->redis->hincrby(self::SET_OF_PLAYERS, $playerTwo->getId(), (int) round($playerTwoRatingChange));\n\n return [\n $this->getPlayerPerformanceRating($playerOne),\n $this->getPlayerPerformanceRating($playerTwo)\n ];\n }", "function tplayer()\r\n{\r\n require_once(\"heading.php\");\r\n$telename = $_POST['tchar'];\r\n$tplace = $_POST['tplace'];\r\n\r\n mysql_select_db($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); ;\r\n $old_userid = (int)0;\r\n $old_userid = mysql_fetch_row(mysql_query(\"SELECT `account` FROM characters WHERE `name` = '$telename';\"));\r\n $old_userid = $old_userid[0];\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n $total_points = mysql_fetch_row(mysql_query(\"SELECT `points` FROM point_system WHERE `accountid` = '$user_id';\"));\r\n $total_points = $total_points[0];\r\n if($total_points <= 0)\r\n $total_points = (int)0;\r\nif($total_points > ($tp_cost-1))\r\n{\r\n if($old_userid == $user_id)\r\n {\r\n require_once \"scripts/PHPTelnet.php\";\r\n $telnet = new PHPTelnet();\r\n $result = $telnet->Connect($server[$realm_id]['addr'],$server[$realm_id]['game_acc'],$server[$realm_id]['game_pass']);\r\n if ($result == 0)\r\n {\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', 'Teleport to $tplace', '$datetime', '$telename', 'Yes');\");\r\n mysql_query(\"UPDATE point_system SET `points` = `points` - $tp_cost WHERE `accountid` = '$user_id';\");\r\n $telnet->DoCommand(\"tele name $telename $tplace\");\r\n $telnet->Disconnect();\r\n\r\n $output .= \"<div class=\\\"top\\\"><h1>$telename Has been teleported to $tplace!</h1></div>\";\r\n }\r\n else\r\n {\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', 'TP Error to $tplace', '$datetime', '$telename', 'Yes');\");\r\n $output .= \"<div class=\\\"top\\\"><h1>$telename, There was a connection error, try again later!</h1></div>\";\r\n }\r\n }\r\n else $output .= \"<div class=\\\"top\\\"><h1>$telename Is not your player, you cannot teleport him to $tplace!</h1></div>\";\r\n}\r\nelse $output .= \"<div class=\\\"top\\\"><h1>$telename You do not have enough points to teleport to $tplace!</h1></div>\"; \r\nrequire_once(\"footer.php\");\r\n\r\n}", "function getActions($user, $opponent, $type) {\n\tglobal $dbUser, $dbPass, $dbTable, $con;\n\n\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE Email = '$user' LIMIT 1\");\n\t$row = mysqli_fetch_assoc($playerResult);\n\t$player = $row['PlayerID'];\n\n\t// If we are trying to compare the logged in user with themselves on the list kill this function\n\tif ($player == $opponent) {\n\t\treturn false;\n\t}\n\n\t// Find any matches these two have\n\t$matchups = array();\n\n\t$matchResult = mysqli_query($con,\"SELECT MatchID, ChallengerID, DefenderID, Status FROM Games WHERE (ChallengerID = '$player' OR DefenderID = '$player') AND (ChallengerID = '$opponent' OR DefenderID = '$opponent') AND (Status = 'Pending' OR Status = 'Issued')\");\n\twhile($row = mysqli_fetch_assoc($matchResult)) {\n\t\t$matchups[] = $row;\n\t}\n\n\tif (count($matchups) > 0) {\n\t\tforeach ($matchups as $key => $value) {\n\t\t\tif ($value['Status'] == 'Pending') {\n\t\t\t\tif ($value['ChallengerID'] == $player) {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"reportMatch(' . $value['MatchID'] . ',' . $value['ChallengerID'] . ',' . $value['DefenderID'] . ',\\'' . getName($opponent) . '\\',\\'Ladder\\',\\'Challenge\\')\">Report Match</button>';\n\t\t\t\t} else {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"reportMatch(' . $value['MatchID'] . ',' . $value['DefenderID'] . ',' . $value['ChallengerID'] . ',\\'' . getName($opponent) . '\\',\\'Ladder\\',\\'Defend\\')\">Report Match</button>';\n\t\t\t\t}\n\t\t\t} else if ($value['Status'] == 'Issued') {\n\t\t\t\tif ($value['ChallengerID'] == $player) {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"withdrawChallenge(' . $value['MatchID'] . ')\">Withdraw</button>';\n\t\t\t\t} else {\n\t\t\t\t\t$actions = '<button class=\"btn\" onclick=\"acceptChallenge(' . $value['MatchID'] . ')\">Accept</button><button class=\"btn\" onclick=\"refuseChallenge(' . $value['MatchID'] . ')\">Refuse</button>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$actions = '<button class=\"btn\" onclick=\"issueChallenge(' . $player . ',' . $opponent . ',\\'' . getName($opponent) . '\\',\\'Ladder\\')\">Issue Challenge</button>';\n\t}\n\t\n\treturn $actions;\n}", "public function wallets();", "public function update(Player $player) {\r\n // on se connecte à la DB\r\n $this->connexion->connect();\r\n\r\n // on recupère l'ensemble des attrubut de notre objet player\r\n $shoots = serialize($player->getShoots());\r\n $pseudo = $player->getPseudo();\r\n $id = $player->getId();\r\n $ships = serialize($player->getShips());\r\n\r\n // on lance la requête\r\n $result = pg_query_params(\r\n $this->connexion->getConnexion(),\r\n 'UPDATE player SET pseudo=$1, shoots=$2, ships=$3 WHERE id=$4 RETURNING * ',\r\n array($pseudo, $shoots, $ships ,$id)\r\n );\r\n\r\n // pour toutes les lignes renvoyées, on créer un objet de type Player grace à la fonction toPlayerFromDB\r\n $players = null;\r\n while ($data = pg_fetch_object($result)) {\r\n $players = Player::toPlayerFromDB($data);\r\n }\r\n pg_free_result($result);\r\n\r\n return $players;\r\n }", "public function GetAllPlayers()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllPlayers();\n }", "public function ownedShips(string $player) : array{\n\t\t$ownedships = [];\n\t\t\tforeach($this->ships as $ship){\n\t\t\tif($ship->getOwner() == $player){\n\t\t\t\tarray_push($ownedships, $ship);\n\t\t\t}\n\t\t}\n\t\treturn $ownedships;\n\t}", "public static function player($row) {\n\t\t\t$result = new Player($row);\n\t\t\treturn \"<div id=\\\"player\\\">\".$result->getName().$result->getTeam().$result->getGP().$result->getMin().$result->getFG().$result->get3PT().$result->getFT().$result->getRebound().$result->getPPG().$result->getAst().\"</div>\";\n\t\t}", "function latestTransaction()\n {\n $this->db->select('Player');\n $this->db->from('transactions');\n $this->db->order_by('Datetime', 'desc');\n $this->db->limit(1);\n $query = $this->db->get();\n\n $result = $query->result_array();\n\n if(empty($result))\n return null;\n return $result[0][\"Player\"];\n }", "public function on_purchase( &$player )\n\t{\n\t\t$cards_in_booster = range( 1, 18, 1 );\n\t\t\n\t\t// and a random assortment of 12 cards from the remaining 24\n\t\t$remaining_cards = range( 19, 42, 1 );\n\t\t\n\t\tshuffle( $remaining_cards );\n\t\t\n\t\t// pick some random from the ones remaining\n\t\tfor( $i = 0; $i < 12; $i++ )\n\t\t{\n\t\t\t$cards_in_booster[] = array_pop( $remaining_cards );\n\t\t}\n\t\t\n\t\t// add the cards to the player\n\t\t$player->add_cards( $cards_in_booster );\n\t\t\n\t\t// return some JSON containing what the player got\n\t\t// Need to go from the IDs we're using internally to some\n\t\t// JSON the client(s) can use to display the results nicely\n\t\t\n\t\t$card_rows = DB::table(CARDS)\n\t\t\t->where_in( 'id', $cards_in_booster )\n\t\t\t->get();\n\t\t\n\t\t$results = array();\n\t\t\t\n\t\tforeach( $card_rows as $card_row )\n\t\t{\n\t\t\t$results[] = array(\n\t\t\t\t'type' => 'card',\n\t\t\t\t'id' => $card_row->id,\n\t\t\t\t'name' => $card_row->name,\n\t\t\t\t'image' => $card_row->image,\n\t\t\t\t'description' => $card_row->description );\n \t\t}\n\t\t\n \t\t// If the player doesn't have any decks, create them a deck named 'Starter Deck'\n \t\t// and add these cards into it\n \t\t\n \t\t$player_decks = DB::table(DECKS)\n \t\t\t->where( 'player_id', '=', $player->id )\n \t\t\t->get();\n \t\t\t\n \t\tif( empty( $player_decks ) )\n \t\t{\n \t\t\t$deck = new Deck();\n \t\t\t$deck->name = 'Starter Deck';\n \t\t\t$deck->player_id = $player->id;\n \t\t\t$deck->save();\n \t\t\t\n \t\t\tforeach( $cards_in_booster as $card_id )\n \t\t\t{\n \t\t\t\tDB::table(DECKS_X_CARDS)\n \t\t\t\t\t->insert( array( 'deck_id' => $deck->id, 'card_id' => $card_id ) );\n \t\t\t}\n \t\t}\n \t\t\n\t\treturn $results;\n\t}", "public function getAllPlayers() {\n $stmt = $this->dbh->prepare(\"SELECT * FROM players WHERE site_id = :site_id\");\n $stmt->bindValue(':site_id', $this->id, PDO::PARAM_INT);\n $stmt->setFetchMode(PDO::FETCH_CLASS, 'Player', [null, $this->register]);\n\n $stmt->execute();\n return $stmt->fetchAll();\n }", "function playerHit($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll){\n\t$newCard = drawACard($deck);\n\t$player[] = $newCard;\n\t$total = getTotal($player);\n\t//echo out each card and total\n\tforeach ($player as $card) {\n\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n\t//notify when player busts\n\tif (getTotal($player) > 21) {\n\t\tevaluateHands($name, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\t}\n\treturn $player;\n}", "public function player() : Player\n {\n return $this->player;\n }", "public function playersOfGame(): array\n {\n return $this->players;\n }", "public function getPlayer()\n {\n return $this->get(self::_PLAYER);\n }", "public function getPlayer()\n {\n return $this->get(self::_PLAYER);\n }", "public function get_players(){\n\t\t$players = $this->players;\n\t\t$classes_arr = array(\n\t\t\t'Sportorg_Games_Matchplayer' => 'sportorg_games_matchplayer',\n\t\t);\n\t\t$players = ORM::_sql_exclude_deleted($classes_arr, $players);\n\t\t$playerArr = null;\n\t\tforeach($players->find_all() as $player){\n\t\t\t$playerArr[] = $player->getBasics();\n\t\t}\n\n\t\treturn $playerArr;\n\t}", "public function getTransmissor()\r\n {\r\n }", "public function waitDraft()\n {\n\n if(!isset($_SESSION['id_user']) || !isset($_SESSION['id_league']))\n {\n header('Location: index.php?rt=teams');\n exit();\n }\n\n if(!isset($_POST['lastAccess']))\n sendErrorAndExit('lastAccess is not set.');\n\n $lastAccess = (int)$_POST['lastAccess'];\n\n $message['lastAccess'] = $lastAccess;\n //usleep(5000000);\n //sendJSONandExit($message);\n\n\n // while( 1 )\n // {\n // // zelimo samo za tu ligu\n $fst = new FantasyServiceTeams();\n $maxLastModified = $fst->getLastModified($_SESSION['id_league']);\n\n $timestamp = strtotime($maxLastModified);\n // echo \"timestamp = \".$timestamp.\"<br>\";\n //\n if($timestamp > $lastAccess)\n {\n $allSelected = $fst->getAllSelectedPlayersInLeague($_SESSION['id_league']);\n // $message['allSelected'] = $allSelected;\n\n $message = [];\n $new_na_redu = $fst->getMinimalCurrentUser($_SESSION['id_league']);\n\n $message['lastAccess'] = $timestamp;\n $message['na_redu'] = $new_na_redu->username;\n $message['allSelected'] = [];\n\n foreach($allSelected as $as)\n {\n $message['allSelected'][] = array('id' => $as->id,\n 'name' => $as->name, 'position' => $as->position);\n }\n\n sendJSONandExit( $message );\n\n\n }\n\n\n usleep(5000000); //5sec\n //\n // }\n\n }", "public function getPlayerStatSummaries()\n {\n return $this->get('playerStatSummaries', array());\n }", "public abstract function onPlayerSelect();", "public function getPlayersForMatchWithStatistics( $id_match, $id_season, $order_by = false )\n\t{\n\t\t$id_match\t= intval( $id_match );\n\t\t$id_season\t= intval( $id_season );\n\t\t$order_by\t= ( false === $order_by )? 'status_order, p4.position, num_times_rotated DESC' : $order_by;\n\n\t\t$query = <<<QUERY\nSELECT\n\tmp4.id_match,\n\tmp4.available,\n\tp4.id_player,\n\tp4.name,\n\tp4.position,\n\tp4.email,\n\tp4.sanitized_name,\n\tp4.middle_name,\n\tp4.image_url,\n\t(\n\t\tSELECT\n\t\t\tCOUNT( mp1.id_match ) AS num\n\t\tFROM\n\t\t\tmatches_player mp1\n\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\tWHERE\n\t\t\tp1.id_player = p4.id_player AND\n\t\t\tm2.id_season = $id_season AND\n\t\t\tm2.status = 'closed' AND\n\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\tm2.id_match != $id_match AND\n\t\t\tmp1.available = 'available'\n\t) AS num_times_rotated,\n\t(\n\t\t(\n\t\t\t1 * (\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT( mp1.id_match ) AS num\n\t\t\t\tFROM\n\t\t\t\t\tmatches_player mp1\n\t\t\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\t\t\tWHERE\n\t\t\t\t\tp1.id_player = p4.id_player AND\n\t\t\t\t\tm2.id_season = $id_season AND\n\t\t\t\t\tm2.status = 'closed' AND\n\t\t\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\tm2.id_match != $id_match AND\n\t\t\t\t\tmp1.available = 'available'\n\t\t\t)\n\t\t)\n\t\t- \n\t\t(\n\t\t\t(\n\t\t\t\t0.25 * (\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tCOUNT( m4.id_match ) AS num\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmatches m4\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tm4.id_season = $id_season AND\n\t\t\t\t\t\t\tm4.id_match != $id_match AND\n\t\t\t\t\t\t\tm4.status = 'closed' AND\n\t\t\t\t\t\t\tm4.type IN ( 'league', 'cup' )\n\t\t\t\t\t) - (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tCOUNT( mp3.id_match ) AS num\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tmatches_player mp3\n\t\t\t\t\t\t\tINNER JOIN matches m5 USING ( id_match )\n\t\t\t\t\t\t\tINNER JOIN player p3 USING ( id_player )\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp3.id_player = p4.id_player AND\n\t\t\t\t\t\t\tm5.id_season = $id_season AND\n\t\t\t\t\t\t\tm5.status = 'closed' AND\n\t\t\t\t\t\t\tm5.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\t\t\tm5.id_match != $id_match AND\n\t\t\t\t\t\t\tmp3.available IN ( 'available', 'injuried', 'called', 'if_necessary' )\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\t1 * (\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tCOUNT( mp1.id_match ) AS num\n\t\t\t\t\tFROM\n\t\t\t\t\t\tmatches_player mp1\n\t\t\t\t\t\tINNER JOIN matches m2 USING ( id_match )\n\t\t\t\t\t\tINNER JOIN player p1 USING ( id_player )\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp1.id_player = p4.id_player AND\n\t\t\t\t\t\tm2.id_season = $id_season AND\n\t\t\t\t\t\tm2.status = 'closed' AND\n\t\t\t\t\t\tm2.type IN ( 'league', 'cup' ) AND\n\t\t\t\t\t\tm2.id_match != $id_match AND\n\t\t\t\t\t\tmp1.available = 'missed'\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t) AS rotate_index,\n\t(\n\t\tCASE\n\t\t\tWHEN mp4.available = 'called' THEN 1\n\t\t\tWHEN mp4.available = 'available' THEN 2\n\t\t\tWHEN mp4.available = 'if_necessary' THEN 3\n\t\t\tELSE 4\n\t\tEND\n\t) AS status_order\nFROM\n\tmatches_player mp4\n\tINNER JOIN player p4 USING( id_player )\nWHERE\n\tmp4.id_match = $id_match\nORDER BY\n\t$order_by\nQUERY;\n\n\t\tif ( !$players = $this->database->query( $query, 'Get players for a match' ) )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$url = $this->getClass( 'Url' );\n\t\tforeach ( $players as &$player )\n\t\t{\n\t\t\t$player['player_url']\t= $url->buildUrl( 'player', 'index', array( $player['sanitized_name'] ) );\n\t\t}\n\n\t\treturn $players;\n\t}", "public function getPlayer() {\n return $this->db->getPlayerById($this->playerId);\n }", "public function get_stats()\n\t{\n\t\tglobal $_game;\n\t\t\n\t\t$expire = time() - 604800; // tell kun spillere som har vært pålogget siste uken\n\t\t$result = \\Kofradia\\DB::get()->query(\"SELECT up_b_id, COUNT(up_id) AS ant, SUM(up_cash) AS money FROM users_players WHERE up_access_level != 0 AND up_access_level < {$_game['access_noplay']} AND up_last_online > $expire GROUP BY up_b_id\");\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (!isset($this->bydeler[$row['up_b_id']])) continue;\n\t\t\t\n\t\t\t$this->bydeler[$row['up_b_id']]['num_players'] = $row['ant'];\n\t\t\t$this->bydeler[$row['up_b_id']]['sum_money'] = $row['money'];\n\t\t}\n\t}" ]
[ "0.745042", "0.6735207", "0.6200825", "0.6121497", "0.60035783", "0.5960483", "0.5683868", "0.53975844", "0.5393648", "0.53829867", "0.53798604", "0.53798604", "0.5239996", "0.5060802", "0.5057683", "0.4986378", "0.49434552", "0.49404597", "0.49334058", "0.49159315", "0.49078402", "0.483867", "0.48269868", "0.48101518", "0.4808789", "0.4802779", "0.47504508", "0.47249535", "0.47239286", "0.472118", "0.46878222", "0.4666899", "0.46657783", "0.466273", "0.46609408", "0.46532977", "0.46450827", "0.46387318", "0.4626374", "0.4622092", "0.46176466", "0.46108624", "0.46071854", "0.46061698", "0.4591286", "0.45852393", "0.4582203", "0.45802975", "0.45802137", "0.45626765", "0.45545176", "0.45543793", "0.45525244", "0.45525244", "0.45525244", "0.4549196", "0.45479342", "0.45366383", "0.45342687", "0.45273447", "0.45243353", "0.451891", "0.45171258", "0.45133734", "0.4511327", "0.45091417", "0.4504004", "0.45036584", "0.44943315", "0.44756955", "0.44687715", "0.44683328", "0.44608262", "0.4449591", "0.44462407", "0.44451615", "0.4439849", "0.44384164", "0.44345903", "0.44331148", "0.44302192", "0.44116852", "0.4399073", "0.43972862", "0.43968686", "0.43858397", "0.43786243", "0.43784535", "0.4376685", "0.43761656", "0.437596", "0.437596", "0.43751174", "0.43703395", "0.43699223", "0.43610606", "0.43557099", "0.4349896", "0.43498677", "0.43487749" ]
0.5694493
6
Joins the Transactions and Stocks together and returns the result set.
public function getSalesTransactions($stock){ $this->db->select('*'); $this->db->from('transactions t'); $this->db->where('t.Stock', $stock); $query = $this->db->get(); $item = [ "DateTime" => "N/A", "Player" => "N/A", "Stock" => "N/A", "Trans" => "N/A", "Quantity" => "N/A" ]; $resultset = array(); array_push($resultset, $item); if($query->num_rows() != 0) { $resultset = $query->result_array(); } return $resultset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTransactions();", "function getAllTransactions()\n {\n $transactions = $this->all();\n\n /* Add additional attributes to each Stock */\n foreach ($transactions as $transaction)\n {\n // Add a link to each stock's history page\n $transaction->href = '/transaction/' . $transaction->DateTime;\n }\n\n return $transactions;\n }", "abstract protected function getTransactions();", "function bwc_transactions_all($gets){\r\n\t$gets['output'] = \"obj\";\r\n\t$transactions_join = (object)[\r\n\t\t\"transactions\"=>bwc_transactions_mass($gets),\r\n\t\t\"prosto\"=>bwc_ajax_prosto_mass($gets),\r\n\t\t\"storage\"=>bwc_ajax_storage_mass($gets),\r\n\t\t\"processing\"=>bwc_ajax_storage_mass($gets)\r\n\t\t];\r\n\t// var_dump($transactions_join->prosto);\r\n\treturn $transactions_join;\r\n\r\n\t// $transactions_join->transactions = bwc_transactions_mass($gets);\r\n\t// $transactions_join->prosto = bwc_ajax_prosto_mass($gets);\r\n\t// $transactions_join->storage = bwc_ajax_storage_mass($gets);\r\n\t// $transactions_join->processing = bwc_ajax_storage_mass($gets);\r\n}", "public function getTransactions(){\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions t JOIN products p ON p.Product_ID = t.Product_ID;\");\r\n $stmt->execute();\r\n $purchases = $stmt->fetchAll (PDO::FETCH_ASSOC);\r\n\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions WHERE Transaction_Type='DONATION';\");\r\n $stmt->execute();\r\n $donations = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n return array_merge($purchases,$donations);\r\n }", "public function getAll()\n {\n return $this->transactions;\n }", "public function joinOrderItemObjects();", "public function getAllTransaction()\n {\n $this->db->query(\n \"SELECT * FROM {$this->table} t INNER JOIN schedule s ON t.schedule_ID=s.schedule_ID INNER JOIN film f ON s.film_id=f.film_id\"\n );\n return $this->db->resultSet();\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\r\n {\r\n return $this->transactions;\r\n }", "public function getTransactions()\n {\n return $this->transactions;\n }", "public function getTransactionCollection()\n {\n if (!$this->collection) {\n $customerId = $this->customerSession->getCustomerId();\n\n $orderCollection = $this->orderCollectionFactory->create();\n $orderCollection->addFieldToFilter('customer_id', $customerId);\n $orderCollection->addFieldToFilter('state', ['neq' => Order::STATE_CANCELED]);\n $orderCollection->addFieldToFilter('state', ['neq' => Order::STATE_CLOSED]);\n $orderCollection->addFieldToFilter('rp.earn_points', ['gt' => 0]);\n $orderCollection->setOrder('main_table.entity_id', 'DESC');\n\n $orderSelect = $orderCollection->getSelect();\n $orderSelect->joinLeft(\n ['rt' => $orderCollection->getTable('mst_rewards_transaction')],\n 'main_table.entity_id = REPLACE(rt.code, \"order_earn-\", \"\")',\n ['rt.transaction_id', 'rt.created_at as transaction_created_at', 'rt.activated_at', 'rt.is_activated']\n );\n $orderSelect->joinLeft(\n [\n 'rp' => $orderCollection->getTable('mst_rewards_purchase')\n ],\n 'main_table.entity_id = rp.order_id AND rt.transaction_id IS NULL',\n [\n 'rp.purchase_id',\n 'rt.created_at as purchase_created_at',\n 'IF(rt.amount, rt.amount, rp.earn_points) as amount'\n ]\n );\n\n $this->collection = $orderCollection;\n }\n\n return $this->collection;\n }", "public function transactions()\n {\n $collection = Transaction::search([\n TransactionSearch::ids()->in($this->transactionIds),\n ]);\n\n return $collection;\n }", "public function getconnectTransactions() {\n $yesterday = new \\DateTime('yesterday');\n $start_date = $yesterday->format('Y-m-d');\n $today = new \\DateTime('now');\n $end_date = $today->format('Y-m-d');\n $status = ApplaneConstentInterface::COMPLETED;\n //create the query\n $query = $this->createQueryBuilder('c');\n $query->select()\n ->Where('c.date >=:create_at', 'c.date <:end_at', 'c.status =:status')\n ->setParameter('create_at', $start_date)\n ->setParameter('end_at', $end_date)\n ->setParameter('status', $status);\n\n $result = $query->getQuery();\n $result_res = $result->getResult();\n return $result_res;\n }", "public function transactions()\n {\n return $this->hasManyThrough('App\\Transaction', 'App\\Individual',\n 'sacco_id', // Foreign key on Individuals table...\n 'individual_id', // Foreign key on Transactions table...\n 'id', // Local key on saccos table...\n 'id' // Local key on Individuals table...\n );\n }", "public function getTransactions() {\n\t\treturn $this->transactions;\n\t}", "public function actionTransaction(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $transactionsIn = Transaction::find()->joinWith('order')->joinWith('post')->joinWith('withdraw')->where([\n 'payment_status'=>'completed', \n 'post_services.owner_id'=>\\Yii::$app->user->getId(),\n ])->all();\n $transactionsOut = Transaction::find()->joinWith('order')->joinWith('post')->where([\n 'payment_status'=>'completed', \n 'accepted_orders.user_id'=>\\Yii::$app->user->getId(),\n ])->all();\n return $this->render('transactions', ['transactionsIn'=>$transactionsIn, 'transactionsOut'=>$transactionsOut, 'user'=>$user]);\n }", "private function getTransactions()\n {\n //====================================================================//\n // Load All Transactions on this Order\n /** @var Transaction $model */\n $model = Mage::getModel('sales/order_payment_transaction');\n\n return $model->getCollection()\n ->setOrderFilter($this->payment->getOrder())\n ->addPaymentIdFilter($this->payment->getId())\n ->setOrder('transaction_id', Varien_Data_Collection::SORT_ORDER_ASC);\n }", "public static function merge()\n {\n $mongo = Mage::getModel('hackathon_ordertransaction/mongo');\n $quotes = $mongo->getQuotes();\n foreach ($quotes as $quote) {\n try {\n $mongo->setToDelete($quote['quote_id']);\n $persistentOrder = Mage::getResourceModel('sales/order');\n $persistentOrder->setData($quote['order']);\n $persistentOrder->save();\n unset($persistentOrder);\n } catch (Exception $e) {\n $mongo->revertToOrder($quote['quote_id']);\n Mage::logException($e);\n }\n }\n unset($quotes, $mongo);\n }", "public function getVariantStocks()\n {\n return $this->getProductStocks()\n ->joinWith('stock');\n }", "public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}", "function bwc_transactions_selections(){\r\n\t$fermenters = bwc_exec_query(\"SELECT f.fermenterName as tankId, f.fermenterName as tankName, e.fermId as _id, e.dateTime as dt, e.type as type FROM `fermenter_master` as f LEFT JOIN (SELECT * FROM `fermenter_master` as a LEFT JOIN fermentation as b ON a.fermenterName = b.fermenter where b.clearingStatus IS NULL ) as e ON f.fermenterName = e.fermenter ORDER BY e.fermId DESC\", array());\r\n\t//$prods = bwc_exec_query(\"SELECT p.prodId as _id, p.dateTime as dt, p.type as type FROM production as p ORDER BY prodId DESC\", array());\r\n\t$prostos = bwc_exec_query(\"SELECT pt.tankId as tankId, pt.tankName as tankName, p.prostoId as _id, p.type as type, p.dateTime as dt FROM production_tanks_master as pt LEFT JOIN (SELECT * FROM production_tanks_master as q LEFT JOIN prosto as r ON q.tankId = r.tank where r.clearingStatus IS NULL) as p ON p.tank = pt.tankId ORDER BY p.prostoId DESC\", array());\r\n\t$storages = bwc_exec_query(\"SELECT b.barrelName as tankName, b.barrelId as tankId, e.storageId as _id, e.type as type FROM barrel_master as b LEFT JOIN (SELECT * FROM barrel_master as c LEFT JOIN storage as d on c.barrelId = d.barrel WHERE d.clearingStatus IS NULL) as e ON b.barrelId = e.barrelId ORDER BY e.storageId DESC\", array());\r\n\t//$products = bwc_exec_query(\"SELECT product as type FROM spirit_classes\", array());\r\n\t$return_array = [\r\n\t\t\"fermenter_master\"=>$fermenters,\r\n\t\t\"production_tanks_master\"=>$prostos,\r\n\t\t\"barrel_master\"=>$storages\r\n\t\t];\r\n\treturn array($return_array);\r\n}", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "public function getTransactions($params)\n {\n $whereData = [];\n\n foreach ($params as $param) {\n $whereData[] = [$param['col'], $param['op'], $param['val']];\n }\n\n return $transactions = self::where($whereData)->get();\n }", "private function transactions()\n {\n $invoiceModel = new InvoiceModel();\n $transactions = $invoiceModel->getAllInvoices();\n\n $csvData = [];\n $csvData[] = [\"Invoice ID\", \"Company Name\", \"Invoice Amount\"];\n if (!empty($transactions)) {\n foreach ($transactions as $transaction) {\n $csvData[] = [$transaction[\"id\"], $transaction[\"client\"], $transaction[\"invoice_amount_plus_vat\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"transactions_\" . time() . \".csv\");\n }", "public function gettransactions($startdate,$enddate,$id=false){\n\n$condition = \"\";\n//Are we looking transactions for only one account ?\n if ($id!=false) {\n $condition = \" AND account_id=$id \";\n }\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_1'));\n\n//Create temporary table that will store the mirrored table\n $this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_1').\"\n (SELECT * FROM \".$this->db->dbprefix('postings').\" \n WHERE (created_at BETWEEN '$startdate' AND '$enddate') $condition )\");\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_2'));\n\n$this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_2').\"(\nSELECT a.transaction_id,\n a.account_id AS from_account,\n b.account_id AS to_account,\n a.journal_id,\n a.amount,\n a.comment,\n a.created_at,\n a.created_by\nFROM \".$this->db->dbprefix('temp_postings_1').\" AS a , \".$this->db->dbprefix('postings').\" AS b \nWHERE a.journal_id=b.journal_id AND a.amount=b.amount*-1 \n AND a.comment=b.comment AND a.created_at=b.created_at\n AND a.created_by=b.created_by AND a.amount>0\n AND a.transaction_id=b.transaction_id)\");\n\n\n\n $dataset=$this->db->query(\"SELECT a.transaction_id,\n CONCAT(b.name,' [#',b.code,'] ') AS from_account,\n CONCAT(c.name,' [#',c.code,'] ') AS to_account,\n d.type AS journal_type,\n a.amount,\n a.comment,\n a.created_at,\n CONCAT(e.first_name,' ',e.last_name) AS created_by\n\nFROM \".$this->db->dbprefix('temp_postings_2').\" AS a\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS b ON a.from_account=b.id\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS c ON a.to_account =c.id\nLEFT JOIN \".$this->db->dbprefix('journals').\" AS d ON a.journal_id =d.id\nLEFT JOIN \".$this->db->dbprefix('users').\" AS e ON a.created_by=e.id \nORDER BY created_at DESC\");\n\n return $dataset->result();\n}", "public function getAllTruckActive()\n\t{\n\t\t/*$sql = \"SELECT id_inventories, article, brand, model, description, id_product\n\t\t\t\tFROM inventories\n\t\t\t\tWHERE id_inventories \n\t\t\t\tIN (\n\t\t\t\t\tSELECT id_truck\n\t\t\t\t\tFROM shippings\n\t\t\t\t)\";\n\t\t\n\t\t$select = $this->dbAdapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n\t\t$result = $select->toArray();\n\t\treturn $result;*/\n\t\t\n\t\t$sql = new Sql($this->adapter);\n\t\t$select = $sql->select()->from(array('i' => $this->table));\n\t\t\n\t\t$subSelect = $sql->select()\n\t\t\t->from(array(\"s\" => \"shippings\"))\n\t\t\t->columns(array('id_truck'));\n\t\t\n\t\t$select\n\t\t\t->columns(array(\n\t\t\t\t\t'id_inventories', 'article', 'brand', 'model', 'id_product'\n\t\t\t))\n\t\t\t->join(array('shi' => 'shippings'), 'i.id_inventories = shi.id_truck', array('id_shipping', 'start_date'), 'LEFT')\n\t\t\t->where(array(\"shi.end_date\"=>\"0000-00-00\"))\n\t\t\t->where->in(\"id_inventories\", $subSelect);\n\t\t\t//->where->isNull(\"shi.end_date\");\n\t\t\t\n\t\t$selectString = $sql->getSqlStringForSqlObject($select);\n\t\t$execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\n\t\t$result = $execute->toArray();\n\t\treturn $result;\n\t}", "public function getTransactions() {\n if (!$this->isInit()) {\n return null;\n }\n return $this->transactions;\n }", "function getStocksPurchases($mysqli,$sale_id){\n\t$query = \"SELECT stocks.description,subsales.price_per_ton,subsales.quantity,subsales.subtotal FROM sales INNER join subsales ON sales.id = subsales.sale_id INNER JOIN stocks ON stocks.id = subsales.stock_id WHERE sales.id = '$sale_id'\";\n\n\tif($result = mysqli_query($mysqli,$query)){\n\t\treturn $result ;\n\t}\n\telse{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\t\n}", "function getPlayerStocks($player)\n {\n $queryString = \"SELECT * FROM transactions WHERE Player='\" . $player . \"'\";\n $result = $this->db->query($queryString);\n\n return $result;\n }", "public function gettransactionsbyjournal($startdate,$enddate,$id=false){\n\n$condition = \"\";\n//Are we looking transactions for only one account ?\n if ($id!=false) {\n $condition = \" AND journal_id=$id \";\n\n }\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_1'));\n\n//Create temporary table that will store the mirrored table\n $this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_1').\"\n (SELECT * FROM \".$this->db->dbprefix('postings').\" \n WHERE (created_at BETWEEN '$startdate' AND '$enddate') $condition )\");\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_2'));\n\n$this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_2').\"(\nSELECT a.transaction_id,\n a.account_id AS from_account,\n b.account_id AS to_account,\n a.journal_id,\n a.amount,\n a.comment,\n a.created_at,\n a.created_by\nFROM \".$this->db->dbprefix('temp_postings_1').\" AS a , \".$this->db->dbprefix('postings').\" AS b \nWHERE a.journal_id=b.journal_id AND a.amount=b.amount*-1 \n AND a.comment=b.comment AND a.created_at=b.created_at\n AND a.created_by=b.created_by AND a.amount>0\n AND a.transaction_id=b.transaction_id)\");\n\n\n\n $dataset=$this->db->query(\"SELECT a.transaction_id,\n CONCAT(b.name,' [#',b.code,'] ') AS from_account,\n CONCAT(c.name,' [#',c.code,'] ') AS to_account,\n d.type AS journal_type,\n a.amount,\n a.comment,\n a.created_at,\n CONCAT(e.first_name,' ',e.last_name) AS created_by\n\nFROM \".$this->db->dbprefix('temp_postings_2').\" AS a\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS b ON a.from_account=b.id\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS c ON a.to_account =c.id\nLEFT JOIN \".$this->db->dbprefix('journals').\" AS d ON a.journal_id =d.id\nLEFT JOIN \".$this->db->dbprefix('users').\" AS e ON a.created_by=e.id \nORDER BY created_at DESC\");\n\n return $dataset->result();\n}", "public function getTransactionsAttribute() {\n return DB::table('transactions')\n -> leftjoin('accounts as paying', 'transactions.paying_id', '=', 'paying.id')\n -> leftjoin('accounts as receiving', 'transactions.receiving_id', '=', 'receiving.id')\n -> leftjoin('banks as paying_bank', 'paying.bank_id', '=', 'paying_bank.id')\n -> leftjoin('banks as receiving_bank', 'receiving.bank_id', '=', 'receiving_bank.id')\n -> leftjoin('users as payer', 'paying.user_id', '=', 'payer.id')\n -> leftjoin('users as receiver', 'receiving.user_id', '=', 'receiver.id')\n -> where('payer.id', $this -> id)\n -> orWhere('receiver.id', $this -> id)\n -> get(['transactions.id',\n 'paying.id as paying_account_id',\n 'payer.first_name as paying_first',\n 'payer.last_name as paying_last',\n 'paying_bank.id as paying_bank_id',\n 'paying_bank.name as paying_bank_name',\n 'receiving.id as receiving_account_id',\n 'receiver.first_name as receiving_first',\n 'receiver.last_name as receiving_last',\n 'receiving_bank.id as receiving_bank_id',\n 'receiving_bank.name as receiving_bank_name',\n 'transactions.ammount as ammount',\n 'transactions.created_at as created_at']) -> all();\n }", "private function getOrders()\n {\n $OD = $this->dbclient->coins->OwnOrderBook;\n\n $ownOrders = $OD->find(\n array('$or'=>\n array(array('Status'=>'buying'), array('Status'=>'selling'))\n ));\n\n $output = ' {\n \"success\" : true,\n \"message\" : \"\",\n \"result\" : [';\n foreach ($ownOrders as $ownOrder) {\n\n if ($ownOrder) {\n if ($ownOrder->Status == 'buying' or $ownOrder->Status == 'selling') {\n $uri = $this->baseUrl . 'public/getorderbook';\n $params['market'] = $ownOrder->MarketName;\n if ($ownOrder->Status == 'buying') {\n $params['type'] = 'sell';\n $params['uuid'] = $ownOrder->BuyOrder->uuid;\n $limit = 'buy';\n } elseif ($ownOrder->Status == 'selling') {\n $params['type'] = 'buy';\n $params['uuid'] = $ownOrder->SellOrder->uuid;\n $limit = 'sell';\n }\n\n if (!empty($params)) {\n $uri .= '?' . http_build_query($params);\n }\n\n $sign = hash_hmac('sha512', $uri, $this->apiSecret);\n $ch = curl_init($uri);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign: ' . $sign));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n $answer = json_decode($result);\n $success = false;\n $quantity = 0;\n $rate = 0;\n\n if ($answer->success == true) {\n $closest_rate = $answer->result[0]->Rate;\n\n if ($ownOrder->Status == 'buying' && $ownOrder->BuyOrder->Rate >= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if ($ownOrder->Status == 'selling' && $ownOrder->SellOrder->Rate <= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if (!$success) {\n $output = $output.'{\n \"AccountId\" : null,\n \"OrderUuid\" : \"' . $params['uuid'] . '\",\n \"Exchange\" : \"' . $params['market'] . '\",\n \"Type\" : \"LIMIT_' . strtoupper($limit) . '\",\n \"Quantity\" : ' . $quantity . ',\n \"QuantityRemaining\" : 0.00000000,\n \"Limit\" : 0.00000001,\n \"Reserved\" : 0.00001000,\n \"ReserveRemaining\" : 0.00001000,\n \"CommissionReserved\" : 0.00000002,\n \"CommissionReserveRemaining\" : 0.00000002,\n \"CommissionPaid\" : 0.00000000,\n \"Price\" : ' . $rate . ',\n \"PricePerUnit\" : ' . $closest_rate . ',\n \"Opened\" : \"2014-07-13T07:45:46.27\",\n \"Closed\" : null,\n \"IsOpen\" : true,\n \"Sentinel\" : \"6c454604-22e2-4fb4-892e-179eede20972\",\n \"CancelInitiated\" : false,\n \"ImmediateOrCancel\" : false,\n \"IsConditional\" : false,\n \"Condition\" : \"NONE\",\n \"ConditionTarget\" : null\n },';\n\n }\n }\n }\n }\n }\n $output = rtrim($output, ',').']\n}';\n return $output;\n }", "public function getActiveTransactions()\n\t{\n\t\treturn $this->active_transactions;\n\t}", "public function getProductStocks($product_id)\n {\n\n $store_ids = Store::where('company_id',Auth::id())->pluck('id');\n\n $stocks = Stock::with(['store','product'])->where('product_id',$product_id)->whereIn('store_id',$store_ids)->orderBy('id','desc')->get();\n\n\n return Datatables::of($stocks)\n ->addColumn('created_at', function ($stock) {\n return date('d-m-Y h:i a', strtotime($stock->created_at));\n })\n ->addColumn('store_name', function ($stock) {\n return $stock->store->name;\n })\n ->addColumn('product_name', function ($stock) {\n return $stock->product->name;\n })\n ->addColumn('stock_type', function ($stock) {\n if($stock->stock_type==1)\n return \"IN\";\n elseif($stock->stock_type==2)\n return \"OUT\";\n })\n ->addColumn('origin', function ($stock) {\n switch ($stock->origin) {\n case 1:\n return \"Add Product\";\n break;\n case 2:\n return \"Update Product\";\n break;\n case 3:\n return \"Sale\";\n break;\n case 4:\n return \"Sale Return\";\n break;\n case 5:\n return \"Adjustment\";\n break;\n default:\n return \"Add Product\";\n }\n })\n ->editColumn('id', 'ID: {{$id}}')\n ->rawColumns(['store_name', 'product_name'])\n ->make(true);\n\n }", "public function whmcs_get_transactions($params = array()) {\n\t\t$params['action'] = 'GetTransactions';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function get_all_transactions(){\n $str_query=\"select * from pos_transaction\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class);\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class);\n }", "public function index()\n {\n $transactions = Transaction::with([\n 'payment',\n 'customer',\n 'supplier', \n ])->get()->toArray();\n return $transactions;\n }", "function readAllBTransactions()\n\t{\n\t\t$query = \"SELECT\n t.id,\n t.tipo,\n t.amount, \n t.macroarea,\n\t\t\t\tt.anno,\n\t\t\t\tb.T_MESE\n\t\t\t\tFROM TRANSAZIONi AS t INNER JOIN TBOH AS b ON b.id = p.ID_TRANSAZIONE\n\t\t\t\tWHERE t.FLOW_ID = ?\n ORDER BY t.id DESC\n LIMIT ?, ?\";\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id, PDO::PARAM_INT);\n\t\t$stmt->bindParam(2, $from_record_num, PDO::PARAM_INT);\n\t\t$stmt->bindParam(3, $records_per_page, PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "public function index()\n {\n return Transactions::all();\n }", "public function stock_join_stock_unit($condateion)\n {\n $this->db->from('stocks');\n $this->db->join('stock_units', 'stocks.stock_st_id = stock_units.st_id');\n $this->db->join('units', 'units.unit_id = stock_units.st_unit');\n if (!is_array($condateion))\n {\n $this->db->where('stock_ord_id', $condateion);\n }\n else\n {\n $this->db->where('stock_date > ', $condateion[0]);\n $this->db->or_where('stock_date < ', $condateion[1]);\n $this->db->where('stock_type', $condateion[2]);\n }\n $query = $this->db->get()->result();\n return $query;\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function to_stock_items($id) {\n $items_b = DB::select(\"select I.name, T.quantity, C.name as category, T.unit_price as unit_val\n from (transaction_bulk as T \n join items as I on T.item_id = I.id\n join categories as C on I.category_id = C.id)\n where T.transaction_id = ?\",\n [ $id ] );\n\n $items_i = DB::select(\"select * from\n (select R.item_id, I.name, count(*) as quantity, C.name as category\n from (transaction_inventory as T \n join inventory_items as R on T.inventory_item_id = R.id\n join items as I on R.item_id = I.id\n join categories as C on I.category_id = C.id)\n where T.transaction_id = ? group by R.item_id) as A \n natural join\n (select distinct R.item_id, R.price as unit_val\n from (transaction_inventory as T\n join inventory_items as R on T.inventory_item_id = R.id)\n where T.transaction_id = ?) as B\",\n [ $id, $id ] );\n\n return array_merge($items_b, $items_i);\n }", "public function purchasedBooks()\n { \n return $this->orders();\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class, $this->getForeignKey());\n }", "function createCommonTransactionsForCoinbaseTransactions($accountID, $userEncryptionKey, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t$responseObject\t\t\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t$responseObject['createCommonTransactionsForCoinbaseTransactions']\t= false;\n\t\t\n\t\t$transactionSourceID\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$transactionStatusID\t\t\t\t\t\t\t\t\t\t\t\t= 1;\n\t\t$transactionStatusLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"complete\";\n\t\t$transactionSourceLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Coinbase\";\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getCoinbaseTransactionRecords\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT\n\t\tCoinbaseTransactions.transactionID,\n\t\tCoinbaseTransactions.FK_ExchangeTileID,\n\t\tCoinbaseTransactions.FK_GlobalTransactionIdentificationRecordID,\n\t\tCoinbaseTransactions.FK_AuthorID AS authorID,\n\t\tCoinbaseTransactions.FK_AccountID AS accountID,\n\t\tCoinbaseTransactions.FK_TransactionTypeID AS transactionTypeID,\n\t\tCoinbaseTransactions.FK_AssetTypeID AS baseCurrencyID,\n\t\tAssetTypes.assetTypeLabel AS baseCurrencyName,\n\t\t2 AS quoteSpotPriceCurrencyID,\n\t\t'USD' AS quoteSpotPriceCurrencyName,\n\t\tCoinbaseTransactions.creationDate,\n\t\tCoinbaseTransactions.creationDate AS transactionDate,\n\t\tCoinbaseTransactions.transactionTimestamp,\n\t\tAES_DECRYPT(encryptedCoinbaseTransactionIDValue, UNHEX(SHA2(:userEncryptionKey,512))) AS vendorTransactionID,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount) AS btcQuantityTransacted,\n\t\tABS(CoinbaseTransactions.nativeAmount) AS usdQuantityTransacted,\n\t\tCoinbaseTransactions.spotPrice AS spotPriceAtTimeOfTransaction,\n\t\tCoinbaseTransactions.spotPrice AS btcPriceAtTimeOfTransaction,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) AS usdTransactionAmountWithFees,\n\t\tCoinbaseTransactions.networkTransactionFeeAmount,\n\t\tABS(CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice) AS usdFeeAmount,\n\t\tABS((CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) - (CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice)) AS transactionAmountMinusFeeInUSD,\n\t\tABS((CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) + (CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice)) AS transactionAmountPlusFeeInUSD,\n\t\tTRIM(\n\t\tCONCAT(\n\t\t\tAES_DECRYPT(encryptedDetailsTitle, UNHEX(SHA2(:userEncryptionKey,512))),\n\t\t\t' ',\n\t\t\tAES_DECRYPT(encryptedDetailsSubTitle, UNHEX(SHA2(:userEncryptionKey,512)))\n\t\t)\n\t\t) AS providerNotes,\n\t\tCoinbaseTransactions.isDebit,\n\t\tCoinbaseTransactions.FK_SourceAddressID,\n\t\tCoinbaseTransactions.FK_DestinationAddressID,\n\t\tTransactionTypes.displayTransactionTypeLabel,\n\t\tTransactionTypes.transactionTypeLabel\n\tFROM\n\t\tCoinbaseTransactions\n\t\tINNER JOIN TransactionTypes ON CoinbaseTransactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\tINNER JOIN AssetTypes ON CoinbaseTransactions.FK_AssetTypeID = AssetTypes.assetTypeID AND AssetTypes.languageCode = 'EN'\n\tWHERE\n\t\tCoinbaseTransactions.FK_AccountID = :accountID\n\tORDER BY\n\t\tCoinbaseTransactions.transactionTimestamp\");\n\t\n\t\t\t$getCoinbaseTransactionRecords -> bindValue(':accountID', $accountID);\n\t\t\t$getCoinbaseTransactionRecords -> bindValue(':userEncryptionKey', $userEncryptionKey);\n\t\t\n\t\t\tif ($getCoinbaseTransactionRecords -> execute() && $getCoinbaseTransactionRecords -> rowCount() > 0)\n\t\t\t{\n\t\t\t\terrorLog(\"began get coinbase crypto transaction records \".$getCoinbaseTransactionRecords -> rowCount() > 0);\n\t\t\t\t\n\t\t\t\twhile ($row = $getCoinbaseTransactionRecords -> fetchObject())\n\t\t\t\t{\t\t\n\t\t\t\t\t$transactionID\t\t\t\t\t\t\t\t\t\t\t= $row -> transactionID;\n\t\t\t\t\t$exchangeTileID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_ExchangeTileID;\n\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t\t= $row -> FK_GlobalTransactionIdentificationRecordID;\n\t\t\t\t\t$accountID\t\t\t\t\t\t\t\t\t\t\t\t= $row -> accountID;\t\n\t\t\t\t\t$authorID\t\t\t\t\t\t\t\t\t\t\t\t= $row -> authorID;\n\t\t\t\t\t\t\n\t\t\t\t\t$transactionTypeID\t\t\t\t\t\t\t\t\t\t= $row -> transactionTypeID;\n\t\t\t\t\t$baseCurrencyID\t\t\t\t\t\t\t\t\t\t\t= $row -> baseCurrencyID; // was assetTypeID - done\n\t\t\t\t\t$baseCurrencyName\t\t\t\t\t\t\t\t\t\t= $row -> baseCurrencyName; // assetTypeName - not needed\n\t\t\t\t\t\t\t\n\t\t\t\t\t$quoteSpotPriceCurrencyID\t\t\t\t\t\t\t\t= $row -> quoteSpotPriceCurrencyID; // was spotPriceCurrencyTypeID - done, needs verification\n\t\t\t\t\t$quoteSpotPriceCurrencyName\t\t\t\t\t\t\t\t= $row -> quoteSpotPriceCurrencyName; // was spotPriceCurrencyType\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t$amount\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> btcQuantityTransacted;\n\t\t\t\t\t$fee\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> networkTransactionFeeAmount;\n\t\t\t\t\t$baseToUSDCurrencySpotPrice\t\t\t\t\t\t\t\t= $row -> spotPriceAtTimeOfTransaction;\n\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t\t= $row -> btcPriceAtTimeOfTransaction;\n\t\t\t\t\t$creationDate\t\t\t\t\t\t\t\t\t\t\t= $row -> creationDate;\n\t\t\t\t\t$transactionDate\t\t\t\t\t\t\t\t\t\t= $row -> transactionDate;\n\t\t\t\t\t$transactionTimestamp\t\t\t\t\t\t\t\t\t= $row -> transactionTimestamp;\n\t\t\t\t\t$vendorTransactionID\t\t\t\t\t\t\t\t\t= $row -> vendorTransactionID;\t\n\t\t\t\t\t$transactionAmountInUSD\t\t\t\t\t\t\t\t\t= $row -> usdQuantityTransacted;\n\t\t\t\t\t$transactionAmountMinusFeeInUSD\t\t\t\t\t\t\t= $row -> transactionAmountMinusFeeInUSD;\n\t\t\t\t\t$transactionAmountPlusFeeInUSD\t\t\t\t\t\t\t= $row -> transactionAmountPlusFeeInUSD;\n\t\t\t\t\t$feeAmountInUSD\t\t\t\t\t\t\t\t\t\t\t= $row -> usdFeeAmount;\n\t\t\t\t\t$usdTransactionAmountWithFees\t\t\t\t\t\t\t= $row -> usdTransactionAmountWithFees;\n\t\t\t\t\t$providerNotes\t\t\t\t\t\t\t\t\t\t\t= $row -> providerNotes;\n\t\t\t\t\t$transactionTypeLabel\t\t\t\t\t\t\t\t\t= $row -> transactionTypeLabel;\n\t\t\t\t\t$displayTransactionTypeLabel\t\t\t\t\t\t\t= $row -> displayTransactionTypeLabel;\n\t\t\t\t\t$isDebit\t\t\t\t\t\t\t\t\t\t\t\t= $row -> isDebit;\n\t\t\t\t\t\t\n\t\t\t\t\t$sourceWalletID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_SourceAddressID;\n\t\t\t\t\t$destinationWalletID\t\t\t\t\t\t\t\t\t= $row -> FK_DestinationAddressID;\n\t\t\t\t\t\t\n\t\t\t\t\t$responseObject['processingTransaction'][]\t\t\t\t= $vendorTransactionID;\n\t\t\t\t\t\n\t\t\t\t\t$getNativeAndCommonTransactionRecordIDsResult\t\t\t= getNativeAndCommonTransactionRecordIDsForGlobalTransactionIdentificationRecordID($accountID, $baseCurrencyID, $vendorTransactionID, $transactionSourceID, $globalTransactionIdentificationRecordID, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\t\n\t\t\t\t\terrorLog(\"commonTransactionID: \". $getNativeAndCommonTransactionRecordIDsResult['commonTransactionRecordID']);\n\t\t\t\n\t\t\t\t\t$commonTransactionID\t\t\t\t\t\t\t\t\t= $getNativeAndCommonTransactionRecordIDsResult['commonTransactionRecordID'];\n\t\t\t\n\t\t\t\t\tif (empty($commonTransactionID))\n\t\t\t\t\t{\n\t\t\t\t\t\t$unspentTransactionTotal\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($isDebit == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$unspentTransactionTotal \t\t\t\t\t\t= $amount; // shouldn't this be the amount minus the fee amount\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($isDebit == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t= $amount; \t// shouldn't this be the amount minus the fee amount\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sourceWallet\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t\t$destinationWallet\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\n\t\t\t\t\t\t$sourceWalletResponseObject\t\t\t\t\t\t\t= $sourceWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $sourceWalletID, $userEncryptionKey, $dbh);\n\t\t\t\t\n\t\t\t\t\t\tif ($sourceWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"Could not instantiate source Complete Crypto Wallet record $accountID\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$destinationWalletResponseObject\t\t\t\t\t= $destinationWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $destinationWalletID, $userEncryptionKey, $dbh);\n\t\t\t\t\n\t\t\t\t\t\tif ($destinationWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"Could not instantiate destination Complete Crypto Wallet record $accountID, $destinationWalletID\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\terrorLog($vendorTransactionID.\"<BR>\");\n\t\t\t\t\t\n\t\t\t\t\t\t$cryptoTransaction\t\t\t\t\t\t\t\t\t= new CryptoTransaction();\n\t\t\t\t\t\n\t\t\t\t\t\t$cryptoTransaction -> setData(0, $accountID, $authorID, $exchangeTileID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid);\n\t\t\t\t\t\n\t\t\t\t\t\t$writeToDatabaseResponse\t\t\t\t\t\t\t= $cryptoTransaction -> writeToDatabase($userEncryptionKey, $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($writeToDatabaseResponse['wroteToDatabase'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$transactionID\t\t\t\t\t\t\t\t\t= $cryptoTransaction -> getTransactionID();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\terrorLog(\"wrote transaction $transactionID for $accountID, $authorID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid\", $GLOBALS['debugCoreFunctionality']);\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\terrorLog(\"could not create transaction for $accountID, $authorID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid\", $GLOBALS['debugCoreFunctionality']);\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\terrorLog(\"found transaction $commonTransactionID for $accountID, $authorID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid\", $GLOBALS['debugCoreFunctionality']);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\terrorLog(\"SELECT\n\t\tCoinbaseTransactions.transactionID,\n\t\tCoinbaseTransactions.FK_ExchangeTileID,\n\t\tCoinbaseTransactions.FK_GlobalTransactionIdentificationRecordID,\n\t\tCoinbaseTransactions.FK_AuthorID AS authorID,\n\t\tCoinbaseTransactions.FK_AccountID AS accountID,\n\t\tCoinbaseTransactions.FK_TransactionTypeID AS transactionTypeID,\n\t\tCoinbaseTransactions.FK_AssetTypeID AS baseCurrencyID,\n\t\tAssetTypes.assetTypeLabel AS baseCurrencyName,\n\t\t2 AS quoteSpotPriceCurrencyID,\n\t\t'USD' AS quoteSpotPriceCurrencyName,\n\t\tCoinbaseTransactions.creationDate,\n\t\tCoinbaseTransactions.creationDate AS transactionDate,\n\t\tCoinbaseTransactions.transactionTimestamp,\n\t\tAES_DECRYPT(encryptedCoinbaseTransactionIDValue, UNHEX(SHA2('$userEncryptionKey',512))) AS vendorTransactionID,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount) AS btcQuantityTransacted,\n\t\tABS(CoinbaseTransactions.nativeAmount) AS usdQuantityTransacted,\n\t\tCoinbaseTransactions.spotPrice AS spotPriceAtTimeOfTransaction,\n\t\tCoinbaseTransactions.spotPrice AS btcPriceAtTimeOfTransaction,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) AS usdTransactionAmountWithFees,\n\t\tCoinbaseTransactions.networkTransactionFeeAmount,\n\t\tABS(CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice) AS usdFeeAmount,\n\t\tTRIM(\n\t\tCONCAT(\n\t\t\tAES_DECRYPT(encryptedDetailsTitle, UNHEX(SHA2('$userEncryptionKey',512))),\n\t\t\t' ',\n\t\t\tAES_DECRYPT(encryptedDetailsSubTitle, UNHEX(SHA2('$userEncryptionKey',512)))\n\t\t)\n\t\t) AS providerNotes,\n\t\tCoinbaseTransactions.isDebit,\n\t\tCoinbaseTransactions.FK_SourceAddressID,\n\t\tCoinbaseTransactions.FK_DestinationAddressID,\n\t\tTransactionTypes.displayTransactionTypeLabel,\n\t\tTransactionTypes.transactionTypeLabel\n\tFROM\n\t\tCoinbaseTransactions\n\t\tINNER JOIN TransactionTypes ON CoinbaseTransactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\tINNER JOIN AssetTypes ON CoinbaseTransactions.FK_AssetTypeID = AssetTypes.assetTypeID AND AssetTypes.languageCode = 'EN'\n\tWHERE\n\t\tCoinbaseTransactions.FK_AccountID = $accountID\n\tORDER BY\n\t\tCoinbaseTransactions.transactionTimestamp\", $GLOBALS['debugCoreFunctionality']);\t\n\t\t\t}\n\t\t\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= true;\n\t\t}\n\t\tcatch (PDOException $e) \n\t\t{\n\t\t\t$cryptoTransaction \t\t\t\t\t\t\t\t\t\t\t\t= null;\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= false;\n\t\t\t\n\t\t\terrorLog($e -> getMessage(), $GLOBALS['criticalErrors']);\n\t\t\n\t\t\tdie();\n\t\t}\n\t\t\n\t\treturn $responseObject;\n\t}", "public static function get_transactions()\n\t{\n\t\tglobal $user_ID;\n\t\t\n\t\t$args = array(\n\t\t\t'posts_per_page'\t=> -1,\n\t\t\t'post_type'\t\t\t=> 'pxp_transactions',\n\t\t\t'post_status'\t\t=> 'private',\n\t\t\t'order'\t\t\t\t=> 'date',\n\t\t\t'orderby'\t\t\t=> 'ASC',\n\t\t\t'author'\t\t\t=> $user_ID\n\t\t);\n\n\t\t$query = get_posts( $args );\n\t\t\n\t\t$transactions = array();\n\t\t\n\t\tforeach( $query as $transaction )\n\t\t{\n\t\t\t$transactions[] = array(\n\t\t\t\t'ID'\t\t\t\t\t\t=> $transaction->ID,\n\t\t\t\t'transaction_description'\t=> $transaction->post_content,\n\t\t\t\t'transaction_date'\t\t\t=> date( 'F j, Y g:i A', strtotime( $transaction->post_date ) ),\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $transactions;\n\t}", "private function generateResults(): array\n {\n $contents = $this->getStockListContents();\n $results = [];\n $buy_broker_per = ($this->brokerFeeFrom - 1) * 100;\n $buy_tax_per = ($this->transTaxFrom - 1) * 100;\n $sell_broker_per = (1 - $this->brokerFeeTo) * 100;\n $sell_tax_per = (1 - $this->transTaxTo) * 100;\n\n $taxes = [\n \"list\" => $this->stockListName,\n \"buy_character\" => $this->characterFromName,\n \"sell_character\" => $this->characterToName,\n \"buy_station\" => $this->stationFromName,\n \"sell_station\" => $this->stationToName,\n \"buy_method\" => $this->characterFromMethod,\n \"sell_method\" => $this->characterToMethod,\n \"buy_broker\" => $buy_broker_per,\n \"buy_tax\" => $buy_tax_per,\n \"sell_broker\" => $sell_broker_per,\n \"sell_tax\" => $sell_tax_per,\n ];\n\n foreach ($contents as $row) {\n $this->RateLimiter->rateLimit();\n $item_id = (int) $row->id;\n $item_name = $row->name;\n $row->vol == 0 ? $item_vol = 1 : $item_vol = $row->vol;\n $best_buy_price = $this->getCrestData($item_id, $this->stationFromID, $this->characterFromMethod);\n $buy_broker_fee = $best_buy_price * ($this->brokerFeeFrom - 1);\n $best_sell_price = $this->getCrestData($item_id, $this->stationToID, $this->characterToMethod);\n $sell_broker_fee = $best_sell_price * (1 - $this->brokerFeeTo);\n $sell_trans_tax = $best_sell_price * (1 - $this->transTaxTo);\n\n $best_buy_price_taxed = $best_buy_price * $this->brokerFeeFrom;\n $best_sell_price_taxed = $best_sell_price * $this->brokerFeeTo * $this->transTaxTo;\n $profit_raw = $best_sell_price_taxed - $best_buy_price_taxed;\n $profit_m3 = $profit_raw / $item_vol;\n $best_buy_price_taxed != 0 ? $profit_margin = ($profit_raw / $best_buy_price_taxed) * 100 : $profit_margin = 0;\n\n $item_res = array(\"id\" => $item_id,\n \"name\" => $item_name,\n \"vol\" => $item_vol,\n \"buy_price\" => $best_buy_price,\n \"buy_broker\" => $buy_broker_fee,\n \"sell_price\" => $best_sell_price,\n \"sell_broker\" => $sell_broker_fee,\n \"sell_tax\" => $sell_trans_tax,\n \"profit_raw\" => $profit_raw,\n \"profit_m3\" => $profit_m3,\n \"profit_margin\" => $profit_margin);\n array_push($results, $item_res);\n }\n return array(\"results\" => $results, \"req\" => $taxes);\n }", "public function GetSubscriptionTransactions($subscriptionIdentifier){\n $result_dto = new dtoResultObject();\n $result_dto->Status = false;\n $result_dto->ErrorMessage = \"SOAP call not executed.\";\n try {\n $client = $this->GetSoapClient();\n $params = array(\n 'subscriptionIdentifier' => $subscriptionIdentifier,\n );\n $result = $client->GetSubscriptionTransactions($params);\n $transactions=array();\n foreach($result->GetSubscriptionTransactionsResult->Transaction as $transaction){\n $dtoTransaction=new dtoTransactionStatus();\n $dtoTransaction->Address=$transaction[\"Address\"];\n $dtoTransaction->Amount=$transaction[\"Amount\"];\n $dtoTransaction->ExpiryDate=$transaction[\"ExpirationDate\"];\n $dtoTransaction->Zip=$transaction[\"Zip\"];\n $dtoTransaction->City=$transaction[\"City\"];\n $dtoTransaction->Country=$transaction[\"Country\"];\n $dtoTransaction->Data=$transaction[\"DataXML\"];\n $dtoTransaction->Description=$transaction[\"Description\"];\n $dtoTransaction->Status=$transaction[\"Status\"];\n $dtoTransaction->Id=$transaction[\"Id\"];\n $dtoTransaction->Url=$transaction[\"Url\"];\n $dtoTransaction->State=$transaction[\"State\"];\n $dtoTransaction->MerchantIdentifier=$transaction[\"MerchantIdentifier\"];\n $dtoTransaction->TransactionIdentifier=$transaction[\"TransactionIdentifier\"];\n $transactions[]=$dtoTransaction;\n }\n return $transactions;\n } catch (Exception $e) {\n $result_dto->ErrorMessage = \"Exception occured: \" . $e;\n return $result_dto; \n }\n return $result_dto;\n }", "public function combinedHistory( $params )\n\t\t{\n\t\t\t$db = Zend_Registry::get( 'db' );\n\t\t\t$platforms = Table::_( 'platforms' )->fetchAll();\n\t\t\t$withoutTransactions = $withoutCharges = false;\n\t\t\t$platformByName = array ();\n\t\t\tforeach ( $platforms as $platform ) {\n\t\t\t\t$platformByName[ $platform->name ] = $platform;\n\t\t\t}\n\t\t\t// Prepare select for transaction table.\n\t\t\t$selectTransactions = $this->_tableTransactions->select()\n\t\t\t\t->setIntegrityCheck( false )\n\t\t\t\t->from(\n\t\t\t\t\tarray ( 't' => $this->_tableTransactions->info( 'name' ) ),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'platform_id' => 'pl.id', 'p.platform', 'id', 'invoice_id', 'shop' => 's.name', 's.email',\n\t\t\t\t\t\t'user' => 'u.name', 'plugin' => 'p.name', 'invoice_status', 'recurring', 'amount', 'date', 'details'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->joinLeft(\n\t\t\t\t\tarray ( 'p' => Table::_( 'plugins' )->info( 'name' ) ),\n\t\t\t\t\t'p.id = t.plugin_id',\n\t\t\t\t\tarray ()\n\t\t\t\t)\n\t\t\t\t->joinLeft(\n\t\t\t\t\tarray ( 'pl' => Table::_( 'platforms' )->info( 'name' ) ),\n\t\t\t\t\t'pl.name = p.platform',\n\t\t\t\t\tarray ()\n\t\t\t\t)\n\t\t\t\t->joinLeft(\n\t\t\t\t\tarray ( 's' => Table::_( 'shops' )->info( 'name' ) ),\n\t\t\t\t\t's.id = t.shop_id',\n\t\t\t\t\tarray ()\n\t\t\t\t)\n\t\t\t\t->joinLeft(\n\t\t\t\t\tarray ( 'u' => Table::_( 'users' )->info( 'name' ) ),\n\t\t\t\t\t'u.shop_id = t.shop_id',\n\t\t\t\t\tarray ()\n\t\t\t\t);\n\t\t\t// Prepare select for charge table.\n\t\t\t$selectCharges = $this->_tableCharges->select()\n\t\t\t\t->setIntegrityCheck( false )\n\t\t\t\t->from(\n\t\t\t\t\tarray ( 'c' => $this->_tableCharges->info( 'name' ) ),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'platform_id' => new Zend_Db_Expr( $platformByName['shopify']->id ),\n\t\t\t\t\t\t'platform' => new Zend_Db_Expr( '\\'shopify\\'' ),\n\t\t\t\t\t\t'cb.id', 'invoice_id' => 'charge_id', 'shop' => 's.name', 's.email', 'user' => 'u.name',\n\t\t\t\t\t\t'plugin' => 'p.name', 'invoice_status' => 'status', 'recurring', 'cb.amount', 'cb.date', 'details'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->join(\n\t\t\t\t\tarray ( 'cb' => Table::_( 'chargesBills' )->info( 'name' ) ),\n\t\t\t\t\t'cb.charge_id = c.charge_id',\n\t\t\t\t\tarray ()\n\t\t\t\t)\n\t\t\t\t->joinLeft(\n\t\t\t\t\tarray ( 'p' => Table::_( 'plugins' )->info( 'name' ) ),\n\t\t\t\t\t'p.id = c.plugin_id',\n\t\t\t\t\tarray ()\n\t\t\t\t)\n\t\t\t\t->joinLeft(\n\t\t\t\t\tarray ( 's' => Table::_( 'shops' )->info( 'name' ) ),\n\t\t\t\t\t's.id = c.shop_id',\n\t\t\t\t\tarray ()\n\t\t\t\t)\n\t\t\t\t->joinLeft(\n\t\t\t\t\tarray ( 'u' => Table::_( 'users' )->info( 'name' ) ),\n\t\t\t\t\t'u.shop_id = c.shop_id',\n\t\t\t\t\tarray ()\n\t\t\t\t);\n\t\t\t// Filter by start date.\n\t\t\tif ( isset ( $params['start_date'] ) && !empty ( $params['start_date'] ) ) {\n\t\t\t\t$date = new DateTime( $params['start_date'] );\n\t\t\t\t$selectTransactions->where( 'date > ?', $date->format( 'Y-m-d' ) );\n\t\t\t\t$selectCharges->where( 'date > ?', $date->format( 'Y-m-d' ) );\n\t\t\t}\n\t\t\t// Filter by end date.\n\t\t\tif ( isset ( $params['end_date'] ) && !empty ( $params['end_date'] ) ) {\n\t\t\t\t$date = new DateTime( $params['end_date'] );\n\t\t\t\t$selectTransactions->where( 'date < ?', $date->format( 'Y-m-d' ) );\n\t\t\t\t$selectCharges->where( 'date < ?', $date->format( 'Y-m-d' ) );\n\t\t\t}\n\t\t\t// Filter by platform.\n\t\t\tif ( isset ( $params['platform'] ) && !empty ( $params['platform'] ) ) {\n\t\t\t\tif ( ( $params['platform'] == $platformByName['shopify']->id ) && ( $platformByName['shopify']->payment == 'outer' ) ) {\n\t\t\t\t\t$withoutTransactions = true;\n\t\t\t\t} else {\n\t\t\t\t\t$selectTransactions->having( 'platform_id = ?', $params['platform'] );\n\t\t\t\t\t$withoutCharges = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Filter by plugin.\n\t\t\tif ( isset ( $params['plugin'] ) && !empty ( $params['plugin'] ) ) {\n\t\t\t\t$selectTransactions->where( 'plugin_id = ?', $params['plugin'] );\n\t\t\t\t$selectCharges->where( 'plugin_id = ?', $params['plugin'] );\n\t\t\t}\n\t\t\t// Filter by user.\n\t\t\tif ( isset ( $params['user'] ) && !empty ( $params['user'] ) ) {\n\t\t\t\t$selectTransactions->having( 'user LIKE ?', '%'. $params['user'] .'%' );\n\t\t\t\t$selectCharges->having( 'user LIKE ?', '%'. $params['user'] .'%' );\n\t\t\t}\n\t\t\t// Union elements.\n\t\t\t$union = array ();\n\t\t\tif ( !$withoutTransactions ) {\n\t\t\t\t$union[] = $selectTransactions;\n\t\t\t}\n\t\t\tif ( !$withoutCharges ) {\n\t\t\t\t$union[] = $selectCharges;\n\t\t\t}\n\t\t\t// Fetch.\n\t\t\t$db->setFetchMode( Zend_Db::FETCH_OBJ );\n\t\t\treturn $db->fetchAll(\n\t\t\t\t$db->select()\n\t\t\t\t\t->union( $union )\n\t\t\t\t\t->order( 'date DESC' )\n\t\t\t);\n\t\t}", "protected function addQuotes()\n {\n foreach ($this->data->Quotes as &$quote) {\n foreach (['OutboundLeg', 'InboundLeg'] as $leg) {\n if (isset($quote->$leg)) {\n foreach ($quote->$leg->CarrierIds as $key => $carrierId) {\n $carrier = $this->arraySearch($carrierId, $this->data->Carriers, 'CarrierId');\n $quote->Carriers[] = $this->data->Carriers[$carrier];\n }\n if ($this->flattenSingleCarrier === true && \\count($quote->$leg->CarrierIds) === 1) {\n $quote->Carrier = $quote->Carriers[0];\n unset($quote->Carriers);\n }\n foreach (['Origin' => 'OriginId', 'Destination' => 'DestinationId'] as $variable => $search) {\n $place = $this->arraySearch($quote->$leg->$search, $this->data->Places, 'PlaceId');\n $quote->$variable = $this->data->Places[$place];\n }\n }\n if ($this->removeIds === true) {\n unset($quote->$leg->CarrierIds, $quote->$leg->OriginId, $quote->$leg->DestinationId);\n }\n }\n }\n return $this->data->Quotes;\n }", "public function stockout()\n {\n $user_id = Auth::user()->id;\n $merchant = Merchant::where('user_id','=',$user_id)->first();\n return $merchant_pro = $merchant->products()\n ->whereNull('product.deleted_at')\n ->leftJoin('product as productb2b', function($join) {\n $join->on('product.id', '=', 'productb2b.parent_id')\n ->where('productb2b.segment','=','b2b');\n })\n ->leftJoin('product as producthyper', function($join) {\n $join->on('product.id', '=', 'producthyper.parent_id')\n ->where('producthyper.segment','=','hyper');\n })\n ->leftJoin('tproduct as tproduct', function($join) {\n $join->on('product.id', '=', 'tproduct.parent_id');\n })\n ->leftJoin('productbc','product.id','=','productbc.product_id')\n ->leftJoin('bc_management','bc_management.id','=','productbc.bc_management_id')\n ->select(DB::raw('\n product.id,\n product.parent_id,\n bc_management.id as bc_management_id,\n productbc.deleted_at as pbdeleted_at,\n product.name,\n product.thumb_photo as photo_1,\n product.available,\n productb2b.available as availableb2b,\n producthyper.available as availablehyper,\n tproduct.available as warehouse_available,\n product.sku'))\n ->groupBy('product.id')\n ->where(\"product.status\",\"!=\",\"transferred\")\n ->where(\"product.status\",\"!=\",\"deleted\")\n ->where(\"product.status\",\"!=\",\"\")\n ->orderBy('product.created_at','DESC')\n ->get();\n\t\treturn Response()->json($products);\n }", "public function all($transactionToken = null)\n {\n $append = '';\n\n if ($transactionToken) {\n $append = '?since_token='.$transactionToken;\n }\n\n return $this->client->get('v1/transactions.json'.$append);\n }", "function retrieveAll ()\n {\n\n $q = Doctrine_Query::create ()\n ->from ( 'MtnPriceListComponent mplc' )\n ->innerJoin ( 'mplc.MtnComponent mc' )\n ->innerJoin ( 'mplc.MtnPriceList mpl' );\n\n\n return $q->execute ();\n }", "protected function _joinFields()\n {\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku')->addAttributeToSelect('cost');\n\n $barcodeAttribute = $this->_scopeConfig->getValue('advancedstock/attributes/barcode_attribute');\n if ($barcodeAttribute)\n $this->addAttributeToSelect($barcodeAttribute);\n\n $this->addAttributeToFilter('type_id', ['nin' => ['grouped', 'configurable', 'bundle', 'configurator']]);\n\n $this->getSelect()->join(\n ['wi' => $this->getTable('bms_advancedstock_warehouse_item')],\n 'wi_product_id = e.entity_id',\n ['*']\n );\n\n $this->getSelect()->joinLeft(\n ['sh' => $this->getTable('bms_advancedstock_sales_history')],\n 'wi_id = sh_warehouse_item_id',\n ['*']\n );\n\n $this->getSelect()->join(\n ['csi' => $this->getTable('cataloginventory_stock_item')],\n '(product_id = e.entity_id and stock_id = 1)',\n []\n );\n $this->getSelect()->where('((use_config_manage_stock = 1) || (use_config_manage_stock = 0 and manage_stock = 1))');\n\n $this->getSelect()->columns(new \\Zend_Db_Expr($this->getAvgPerWeekExpression().' as average_per_week'));\n $this->getSelect()->columns(new \\Zend_Db_Expr($this->getRunOutExpression().' as run_out'));\n $this->getSelect()->columns(new \\Zend_Db_Expr($this->getQtyOrderExpression().' as qty_to_order'));\n\n //$this->getSelect()->columns(new \\Zend_Db_Expr('(wi.wi_physical_quantity * e.cost) as stock_value'));\n\n return $this;\n }", "function _getTransactions()\n {\n $pr = new PostingRules();\n $pr->getTransactions(&$this);\n }", "public static function updateTransactions($stockSplits, $security_id)\n {\n\n $transactionTypes = ['buy'];\n\n //sort $stockSplits by date in accending order\n\n usort($stockSplits, function ( $a, $b ) {\n return strtotime($a[\"date\"]) - strtotime($b[\"date\"]);\n });\n\n //here $stockSplits is the array of all stock splits from yahoo\n\n foreach ($stockSplits as $value) {\n\n $setOfTransactions = Transaction::where('security_id', $security_id)\n ->where(function($query) use ($value)\n {\n $query->where('last_stock_split_update', '<', $value['date'])\n ->orWhere('last_stock_split_update', NULL);\n })\n ->where('date', '<', $value['date'])\n ->where('inventory', '>', 0)\n ->whereIn('transaction_type', $transactionTypes)\n ->get();\n\n $splitRatio = explode(':', $value['value']);\n\n foreach ($setOfTransactions as $transactionToUpdate)\n {\n $newQuantity = floor(($transactionToUpdate->quantity * $splitRatio[0]) / $splitRatio[1]);\n $newInventory = floor(($transactionToUpdate->inventory * $splitRatio[0]) / $splitRatio[1]);\n\n $transactionToUpdate->quantity = $newQuantity;\n $transactionToUpdate->inventory = $newInventory;\n $transactionToUpdate->last_stock_split_update = $value['date'];\n\n $transactionToUpdate->save();\n }\n }\n }", "public function transactionsAction() {\n\t\ttry {\n\t\t\t\t\n $pageHeading = \"Transactions\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n\t\t\t$objPaggination \t\t\t= new Base_Model_ObtorLib_Base_Lib_Paggination();\n \n\t\t\t$objTransactionsService \t\t= new Base_Model_Lib_Invoice_Service_Transaction();\n $objTransactionsEntity \t\t= new Base_Model_Lib_Invoice_Entity_Transaction();\n $objTransactionsService->transaction = $objTransactionsEntity;\n $totalResult = $objTransactionsService->searchCount();\n $page=$this->_getParam('page',1);\n\t\t\t$objPaggination->CurrentPage = $page;\n\t\t\t$objPaggination->TotalResults = $totalResult;\n\t\t\t$paginationData = $objPaggination->getPaggingData();\n\t\t\t$pageLimit1 = $paginationData['MYSQL_LIMIT1'];\n\t\t\t$pageLimit2 = $paginationData['MYSQL_LIMIT2'];\n\t\t\t\t\t\n\t\t\t$limit \t\t\t\t\t\t = \" LIMIT $pageLimit1,$pageLimit2\";\n \n if($page == ''){\n\t\t\t\t$page = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$result \t\t = $objTransactionsService->search($limit);\n\t\t\t$this->view->transactions = $result;\n\t\t\t$this->view->paggination = $objPaggination;\n\t\t\t$this->view->pageNum = $page;\n\t\t\t\n\t\t\t\n\t\t} catch ( Exception $ex ) {\n\t\t\tthrow new Exception ( '<ERROR>' . $ex->getMessage () . \"\\n\" );\n\t\t}\n\n\t}", "public static function transactions($number=50, $pair='all') {\n\t\t\treturn self::get(self::transaction_index(), array('count' => $number, 'instrument' => $pair));\n\t\t}", "public function merge();", "public function query_out_transactions(){\n\t\t$response = $this->execute($this->query_out_transaction_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in communication\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "public function getTransaction();", "public function get_possible_spy_put_credit_spreads_weeklies()\n { \n $seen = [];\n \n // If no one is connected no need to do anything.\n if(count($this->clients) <= 0)\n {\n return false;\n }\n \n // Get a list of stocks I need to get qu\n foreach($this->clients AS $key => $row)\n {\n // Make sure the client is authenicated. \n if((! isset($row->user)) || (! is_object($row->user)))\n {\n continue;\n }\n \n // Have we already seen this UsersId (connected from more than one device).\n if(isset($seen[$row->user->UsersId]))\n {\n $row->send($seen[$row->user->UsersId]);\n continue;\n } \n \n // Get the possible trades.\n $t = new PutCreditSpread;\n $t->set_tradier_token(Crypt::decrypt($row->user->UsersTradierToken));\n \n // Look for trades.\n if(! $data = $t->spy_weekly_percent_away())\n {\n //$this->server->error('get_possible_spy_put_credit_spreads_weeklies: No Trades Found.'); \n } \n \n // Build data we return.\n $rt = [\n 'timestamp' => date('n/j/y g:i:s a'),\n 'type' => 'Autotrade:get_possible_spy_put_credit_spreads_weeklies',\n 'data' => $data\n ];\n \n // Send data down the wire.\n $row->send(json_encode($rt));\n \n // Mark as seen.\n $seen[$row->user->UsersId] = json_encode($rt); \n } \n }", "public function fetchWarehouseOrders() {\n $pullList = $this->find('all', array(\n 'conditions' => array(\n 'Order.status' => array('Released', 'Pulled')\n ),\n 'contain' => array(\n 'User',\n 'UserCustomer' => array(\n 'Customer' => array(\n 'fields' => array(\n 'id',\n 'allow_backorder'\n )\n )\n ),\n 'Budget',\n 'OrderItem' => array(\n 'Catalog' => array(\n 'ParentCatalog' => array(\n 'Item'\n )\n ),\n 'Item' => array(\n 'Image',\n 'Location'\n )\n ),\n 'Shipment',\n 'Document' => array(\n 'fields' => array(\n 'id'\n )\n )\n )));\n $this->groupWarehouseOrders($pullList);\n return $this->statusOutputOrder;\n }", "private function _calculateTotalsIn()\n {\n $inStockStatus = self::$IN_STOCK_STATUS;\n $sql = new SqlStatement();\n $sql->select(array(\n 'af.group_id', \n 'af.product_id', \n 'af.type',\n 'value' => 'IF(type = \\'STOCK_STATUS\\' AND p.quantity > 0, ' . $inStockStatus . ', value)'))\n ->from(array('af' => self::FILTERS_TABLE))\n ->innerJoin(array('p' => 'product'), 'af.product_id = p.product_id')\n ->innerJoin(array('exclude' => self::RESULTS_TABLE), 'af.product_id = exclude.product_id');\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n }\n \n if ( self::$HIDE_OUT_OF_STOCK ) {\n $sql->leftJoin(array('pov' => 'product_option_value'), 'af.product_id = pov.product_id AND af.value = pov.option_value_id AND af.type = \"OPTION\"')\n ->leftJoin(array('pov1' => 'product_option_value'), 'p.product_id = pov1.product_id')\n ->where('( (pov1.quantity IS NULL AND p.quantity > 0) OR '\n . '(pov1.quantity > 0 AND af.type != \"OPTION\") OR '\n . 'pov.quantity > 0 )')\n ->group(array('af.type', 'group_id', 'value', 'p.product_id'));\n }\n \n $sql2 = new SqlStatement();\n $sql2->select(array(\n 'id' => \"af.group_id\", \n 'val' => 'af.value', \n 'c' => 'COUNT(*)',\n 'type' => 'af.type',\n ))\n ->from(array('af' => $sql))\n ->group(array('af.type', 'af.group_id', 'af.value'));\n \n if (count($this->aggregate)) {\n foreach ($this->aggregate as $type => $group) {\n $sql2->where(\"((af.type = '$type' AND af.group_id NOT IN (\" . implode(',', array_keys($group)) . \")) OR af.type != '$type')\");\n }\n }\n \n $res = $this->db->query($sql2);\n \n return $res->rows;\n }", "public function stockin()\n {\n $user_id = Auth::user()->id;\n \n $merchant = Merchant::where('user_id','=',$user_id)->first();\n return $merchant_pro = $merchant->products()\n ->whereNull('product.deleted_at')\n ->leftJoin('product as productb2b', function($join) {\n $join->on('product.id', '=', 'productb2b.parent_id')\n ->where('productb2b.segment','=','b2b');\n })\n ->leftJoin('product as producthyper', function($join) {\n $join->on('product.id', '=', 'producthyper.parent_id')\n ->where('producthyper.segment','=','hyper');\n })\n ->leftJoin('tproduct as tproduct', function($join) {\n $join->on('product.id', '=', 'tproduct.parent_id');\n })\n ->leftJoin('productbc','product.id','=','productbc.product_id')\n ->leftJoin('bc_management','bc_management.id','=','productbc.bc_management_id')\n ->select(DB::raw('\n product.id,\n product.parent_id,\n bc_management.id as bc_management_id,\n productbc.deleted_at as pbdeleted_at,\n product.name,\n product.thumb_photo as photo_1,\n product.available,\n productb2b.available as availableb2b,\n producthyper.available as availablehyper,\n tproduct.available as warehouse_available,\n product.sku'))\n ->groupBy('product.id')\n ->where(\"product.status\",\"!=\",\"transferred\")\n ->where(\"product.status\",\"!=\",\"deleted\")\n ->where(\"product.status\",\"!=\",\"\")\n ->orderBy('product.created_at','DESC')\n ->get();\n\t\treturn Response()->json($products);\n }", "public function extend() \n {\n // default transaction type does not extend transaction DTO.\n return [];\n }", "public function total_sales()\n {\n $product = DB::table('users')\n ->join('order_lists', 'users.id', '=', 'order_lists.user_id')\n ->join('order_details', 'order_lists.id', '=', 'order_details.order_list_id')\n ->join('payment_details', 'order_details.payment_details_id', '=', 'payment_details.id')\n ->join('products', 'order_lists.item_id', '=', 'products.id')\n ->select( 'order_lists.type', 'order_lists.quentity', 'products.title', 'order_lists.total_price', 'payment_details.created_at') \n ->where('order_lists.type', '=', 'product')\n ->latest();\n \n $pet = DB::table('users')\n ->join('order_lists', 'users.id', '=', 'order_lists.user_id')\n ->join('order_details', 'order_lists.id', '=', 'order_details.order_list_id')\n ->join('payment_details', 'order_details.payment_details_id', '=', 'payment_details.id')\n ->join('pets', 'order_lists.item_id', '=', 'pets.id')\n ->select( 'order_lists.type', 'order_lists.quentity', 'pets.title','order_lists.total_price', 'payment_details.created_at') \n ->where('order_lists.type', '=', 'pet')\n ->union($product)\n ->latest()\n ->get();\n\n return $pet;\n }", "public function transactionGetResults ($reference);", "function ViewStockAdjustmentTransaction()\n {\n $sql=\"select * from INVT_T_STOCK_ADJ_HEAD \";\n return $this->db->query($sql, $return_object = TRUE)->result_array();\n }", "public function index()\n {\n $business_id = request()->session()->get('user.business_id');\n if (!auth()->user()->can('stocktackign.view') ) {\n abort(403, 'Unauthorized action.');\n }\n\n $transactions=\\DB::table('transactions')->join('business_locations','business_locations.id','transactions.location_id')\n ->where('transactions.type','stocktacking')\n ->where('transactions.business_id',$business_id)\n ->select(\n 'transactions.*',\n 'business_locations.name as location_name'\n )\n ->get();\n return view('stocktacking.index',['transactions'=>$transactions]);\n }", "public function getAllOrders(){\n $transactions = $this->getAllTransactions();\n $trans_ids = array_keys($transactions);\n\n $orders = array();\n // For each transaction ID, find all associated products purchased\n foreach($trans_ids as $id){\n $item_counts = array();\n $item_names = array();\n $item_costs = array();\n\n // Dictionary with product_ids as keys, quantities as values.\n $contains = $this->getContains($id);\n // Get an array of product IDs associated with this transaction.\n $contains_product_ids = array_keys($contains);\n // For each product in this purchase, get the name, quantity and cost.\n $counter = 0;\n foreach($contains_product_ids as $pid){\n $current_product = $this->getProduct($pid);\n $item_counts[$pid] = $contains[$pid]; // load the count of the product\n $item_costs[$pid] = $current_product['unit_cost'];\n $item_names[$pid] = $current_product['name'];\n // Create an order with the current transaction information.\n //$this->errorLogger($current_order->formattedOrderString());\n $counter++;\n }\n $current_order = Order::createOrderWithArrays($item_counts, $item_names, $item_costs);\n array_push($orders, $current_order);\n }\n $this->errorLogger($counter);\n return $orders;\n }", "public function run()\n {\n $today = Carbon::now()->format('Y-m-d');\n $twoDaysAgo = Carbon::now()->subDay()->format('Y-m-d');\n $sevenDaysAgo = Carbon::now()->subDays(7)->format('Y-m-d');\n $lastMonth = Carbon::now()->subMonth()->format('Y-m-d');\n\n Transaction::factory()->create([\n 'category_id' => 1, //sales\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $today,\n 'amount' => 20000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $today,\n 'amount' => 15000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 4, //electric bill\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'inec',\n 'date' => $today,\n 'amount' => 17500\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 5, // internet\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'pldc',\n 'date' => $today,\n 'amount' => 12000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 6, // water\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'inwad',\n 'date' => $today,\n 'amount' => 10000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7, // fuel\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'van gas',\n 'date' => $today,\n 'amount' => 5000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $twoDaysAgo,\n 'amount' => 90000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7, // fuel\n 'admin_id' => 1,\n 'account_id' => 1,\n 'description' => 'ryan gas',\n 'date' => $twoDaysAgo,\n 'amount' => 30000\n ]);\n\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $sevenDaysAgo,\n 'amount' => 10000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $sevenDaysAgo,\n 'amount' => 20000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 1,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $lastMonth,\n 'amount' => 35000\n ]);\n\n Transaction::factory()->create([\n 'category_id' => 7,\n 'admin_id' => 1,\n 'account_id' => 1,\n 'date' => $lastMonth,\n 'amount' => 55000\n ]);\n }", "public function getSentraData($query)\n {\n // config\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\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\n $data = array();\n $data['granularity'] = $granularity;\n\n DB::enableQueryLog();\n // execute\n // TRANSACTION DATA\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n $transactionHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n // TRANSACTION\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n $data['transaction']['history'] = $transactionHistory;\n $data['transaction']['status'] = $transactionStatus;\n \n // BUYER\n $currentBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $prevBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $buyerHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.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('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['buyer'] = array();\n $data['buyer']['count'] = array();\n $data['buyer']['count']['current'] = $currentBuyers;\n $data['buyer']['count']['prev'] = $prevBuyers;\n $data['buyer']['history'] = $buyerHistory;\n\n\n // PRODUCT\n $product = DB::connection('marketplace')\n ->table('orderlines')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->select(DB::raw('products.id, products.name, count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('products.id')\n ->orderByRaw('sums desc, products.name asc')\n ->limit(5)\n ->get();\n\n for($i=0; $i<count($product); $i++) {\n $countData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->count();\n if($countData) {\n $prevData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->get();\n } else {\n $prevData = array();\n }\n if(count($prevData) != 0) {\n $product[$i]->count_change = (string) ($product[$i]->count - $prevData[0]->count);\n $product[$i]->sum_change = (string) ($product[$i]->sums - $prevData[0]->sums);\n $product[$i]->value_change = (string) ($product[$i]->value - $prevData[0]->value);\n } else {\n $product[$i]->count_change = (string) 0;\n $product[$i]->sum_change = (string) 0;\n $product[$i]->value_change = (string) 0;\n }\n }\n\n $data['product'] = $product;\n\n // RATING\n $currentRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $ratingTrend = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating,'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['rating'] = array();\n $data['rating']['average']['current'] = $currentRating[0]->rating;\n $data['rating']['average']['prev'] = $prevRating[0]->rating;\n $data['rating']['trend'] = $ratingTrend;\n\n $city = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orders','orderlines.order_id','orders.id')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orders.buyer_city as name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orders.buyer_city')\n ->orderByRaw('count desc')\n ->limit(5)\n ->get();\n\n $data['city'] = $city;\n\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]); \n }", "public function getSorders()\n {\n return $this->hasMany(Sorder::className(), ['currency_id' => 'currency_id']);\n }", "public function transactions()\n {\n \treturn $this->hasMany('App\\Transaction');\n }", "function getSubSales($connection,$sale_id){\n\t$query = \"SELECT subsales.stock_id AS stock_id, subsales.quantity AS quantity FROM `subsales` \n\tINNER JOIN sales ON sales.id = subsales.sale_id WHERE sales.id = '$sale_id'\";\n $object['sales']['sales'] = [];\n\tif ($result = mysqli_query($connection,$query)){\n\t while($subsale = mysqli_fetch_assoc($result)){\n\t \t $subsale = (object)$subsale;\n array_push($object['sales']['sales'],$subsale);\n\t }\n\t return (object)$object['sales'];\n\t}else{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t\treturn false;\n\t}\n}", "public function getAll()\n {\n return $this->_combined;\n }", "public function transactions() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('transaction_id'));\n $data['transaction'] = $this->account_model->getTransactions(array('ttransactions.ttransaction_id' => $id));\n } else {\n $mfinancialyear_id = null;\n if ($this->session->has_userdata('financialyear')) {\n $financialyear_data = $this->session->userdata('financialyear');\n $mfinancialyear_id = $financialyear_data['mfinancialyear_id'];\n }\n if ($this->input->get('unlimited')) {\n $data['unlimited'] = true;\n $data['transactions'] = $this->account_model->getTransactions(false, array('mfinancialyear_id' => $mfinancialyear_id));\n } else {\n $data['transactions'] = $this->account_model->getTransactions(FALSE, array('mfinancialyear_id' => $mfinancialyear_id), 10);\n }\n }\n $this->view('transactions', $data);\n }", "public function getStockGoods()\n {\n $reportStock = new ReportStock();\n return Collection::times(10)->map(function ($value) use ($reportStock) {\n $stock = $reportStock->getStockGoods(new Request([\n 'stock_date' => $date = Carbon::now()->subWeeks($value - 1)\n ]));\n\n return collect([\n 'date' => $date->toDateString(),\n 'stocks' => $stock->count()\n ]);\n });\n }", "public function trades() {\n return $this->hasMany(Trade::class);\n }", "public static function transactions(transaction... $transactions): transactions\n {\n return new transactions(false, $transactions);\n }", "public function trades() {\n\t\treturn $this->hasMany( 'App\\Trade', 'trader' );\n\t}", "function getCoinTrackingBuysForUser($accountID, $dataImportEventRecordID, $cryptoCurrencyTypesImported, $userEncryptionKey, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t$responseObject \t\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t\n\t\t$transactionTypeID\t\t\t\t\t\t\t\t\t\t\t\t\t= 1; // These are all buy records for now\n\t\t$transactionTypeLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Buy\";\n\t\t$displayTransactionTypeLabel\t\t\t\t\t\t\t\t\t\t= \"Bought\";\n\t\t$transactionSourceID\t\t\t\t\t\t\t\t\t\t\t\t= 20;\n\t\t$transactionSourceLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"CoinTracking\";\n\t\t$importTypeID\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 16;\n\t\t$authorID\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$isDebit\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$isDisabled\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$feeAmountInUSD\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$feeAmountInBaseCurrency\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$realizedReturnInUSD\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$sentCostBasisInUSD\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$receivedCostBasisInUSD\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$transactionStatusID\t\t\t\t\t\t\t\t\t\t\t\t= 1;\n\t\t$transactionStatusLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Completed\";\n\t\t\n\t\t$providerNotes\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"\";\n\t\t\n\t\t$creationDate\t\t\t\t\t\t\t\t\t\t\t\t\t \t= $globalCurrentDate;\n\t\t\n\t\t$quoteCurrencyID\t\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$quoteCurrency\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"USD\";\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getCoinTrackingRecords\t\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT\n\ttransactions_FIFO_Universal.transactionRecordID,\n\ttransactions_FIFO_Universal.FK_ProviderAccountWalletID,\n\ttransactions_FIFO_Universal.transactionDate AS transactionTime,\n\tUNIX_TIMESTAMP(transactions_FIFO_Universal.transactionDate) AS transactionTimestamp,\n\ttransactions_FIFO_Universal.FK_LedgerEntryTypeID,\n\ttransactions_FIFO_Universal.FK_TransactionTypeID AS FK_EffectiveTypeID,\n\ttransactions_FIFO_Universal.FK_TransactionTypeID,\n\ttransactions_FIFO_Universal.FK_ReceivedCurrencyID AS FK_AssetTypeID,\n\ttransactions_FIFO_Universal.sentQuantity AS amount,\n\ttransactions_FIFO_Universal.isDebit,\n\t(transactions_FIFO_Universal.sentQuantity / transactions_FIFO_Universal.receivedQuantity) AS baseToQuoteCurrencySpotPrice,\n\t(transactions_FIFO_Universal.sentQuantity / transactions_FIFO_Universal.receivedQuantity) AS baseToUSDCurrencySpotPrice,\n\ttransactions_FIFO_Universal.FK_ReceivedWalletID AS FK_BaseCurrencyWalletID,\n\ttransactions_FIFO_Universal.FK_SentWalletID AS FK_QuoteCurrencyWalletID,\n\ttransactions_FIFO_Universal.receivedQuantity,\n\ttransactions_FIFO_Universal.sentQuantity,\n\ttransactions_FIFO_Universal.isDisabled,\n\ttransactions_FIFO_Universal.FK_TransactionSourceID,\n\t20 AS FK_ExchangeID,\n\ttransactions_FIFO_Universal.FK_ReceivedCurrencyID,\n\ttransactions_FIFO_Universal.receivedCurrency,\n\ttransactions_FIFO_Universal.FK_SentCurrencyID,\n\ttransactions_FIFO_Universal.sentCurrency,\n\ttransactions_FIFO_Universal.FK_ReceivedWalletID,\n\ttransactions_FIFO_Universal.FK_SentWalletID,\n\ttransactions_FIFO_Universal.realizedReturnInUSD,\n\ttransactions_FIFO_Universal.sentCostBasisInUSD,\n\ttransactions_FIFO_Universal.receivedCostBasisInUSD,\n\ttransactions_FIFO_Universal.receivedWalletType,\n\ttransactions_FIFO_Universal.receivedWallet,\n\ttransactions_FIFO_Universal.sentWalletType,\n\ttransactions_FIFO_Universal.sentWallet,\n\ttransactions_FIFO_Universal.FK_ReceivedTransactionSourceID,\t\n\ttransactions_FIFO_Universal.FK_SentTransactionSourceID\nFROM\n\ttransactions_FIFO_Universal\nWHERE\n\ttransactions_FIFO_Universal.FK_TransactionTypeID = 1\nORDER BY\n\tUNIX_TIMESTAMP(transactions_FIFO_Universal.transactionDate)\");\n\t\n\t\t\t$insertCoinTrackingRecords\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"INSERT INTO CoinTrackingLedgerTransaction\n(\n\ttransactionRecordID,\n\tFK_GlobalTransactionRecordID,\n\tFK_AccountID,\n\tFK_ProviderAccountWalletID,\n\ttransactionTime,\n\ttransactionTimestamp,\n\tFK_EffectiveTypeID,\n\tFK_TransactionTypeID,\n\tFK_AssetTypeID,\n\tamount,\n\tisDebit,\n\tbaseToQuoteCurrencySpotPrice,\n\tbaseToUSDCurrencySpotPrice,\n\tbtcSpotPriceAtTimeOfTransaction,\n\tFK_BaseCurrencyWalletID,\n\tFK_QuoteCurrencyWalletID,\n\treceivedQuantity,\n\tsentQuantity,\n\tFK_TransactionSourceID,\n\tFK_ExchangeID,\n\tFK_ReceivedCurrencyID,\n\treceivedCurrencyAbbreviation,\n\tFK_SentCurrencyID,\n\tsentCurrencyAbbreviation,\n\tFK_ReceivedWalletID,\n\tFK_SentWalletID,\n\treceivedWalletType,\n\treceivedWallet,\n\tsentWalletType,\n\tsentWallet\n)\nVALUES\n(\n\t:transactionRecordID,\n\t:FK_GlobalTransactionRecordID,\n\t:FK_AccountID,\n\t:FK_ProviderAccountWalletID,\n\t:transactionTime,\n\t:transactionTimestamp,\n\t:FK_EffectiveTypeID,\n\t:FK_TransactionTypeID,\n\t:FK_AssetTypeID,\n\t:amount,\n\t:isDebit,\n\t:baseToQuoteCurrencySpotPrice,\n\t:baseToUSDCurrencySpotPrice,\n\t:btcSpotPriceAtTimeOfTransaction,\n\t:FK_BaseCurrencyWalletID,\n\t:FK_QuoteCurrencyWalletID,\n\t:receivedQuantity,\n\t:sentQuantity,\n\t:FK_TransactionSourceID,\n\t:FK_ExchangeID,\n\t:FK_ReceivedCurrencyID,\n\t:receivedCurrencyAbbreviation,\n\t:FK_SentCurrencyID,\n\t:sentCurrencyAbbreviation,\n\t:FK_ReceivedWalletID,\n\t:FK_SentWalletID,\n\t:receivedWalletType,\n\t:receivedWallet,\n\t:sentWalletType,\n\t:sentWallet\n)\");\n\t\n\t\t\tif ($getCoinTrackingRecords -> execute() && $getCoinTrackingRecords -> rowCount() > 0)\n\t\t\t{\n\t\t\t\terrorLog(\"began get cointracking buy transaction records \".$getCoinTrackingRecords -> rowCount() > 0);\n\t\t\t\t\n\t\t\t\twhile ($row = $getCoinTrackingRecords -> fetchObject())\n\t\t\t\t{\n\t\t\t\t\t$transactionRecordID\t\t\t\t\t\t\t\t\t= $row -> transactionRecordID;\n\t\t\t\t\t$FK_ProviderAccountWalletID\t\t\t\t\t\t\t\t= $row -> FK_ProviderAccountWalletID;\n\t\t\t\t\t$transactionTime\t\t\t\t\t\t\t\t\t\t= $row -> transactionTime;\n\t\t\t\t\t$transactionTimestamp\t\t\t\t\t\t\t\t\t= $row -> transactionTimestamp;\n\t\t\t\t\t$FK_LedgerEntryTypeID\t\t\t\t\t\t\t\t\t= $row -> FK_LedgerEntryTypeID;\n\t\t\t\t\t$FK_EffectiveTypeID\t\t\t\t\t\t\t\t\t\t= $row -> FK_EffectiveTypeID;\n\t\t\t\t\t$FK_TransactionTypeID\t\t\t\t\t\t\t\t\t= $row -> FK_TransactionTypeID;\n\t\t\t\t\t$FK_AssetTypeID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_AssetTypeID;\n\t\t\t\t\t$amount\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> amount;\n\t\t\t\t\t$baseToQuoteCurrencySpotPrice\t\t\t\t\t\t\t= $row -> baseToQuoteCurrencySpotPrice;\t\t\t\t\t\t\t\n\t\t\t\t\t$baseToUSDCurrencySpotPrice\t\t\t\t\t\t\t\t= $row -> baseToUSDCurrencySpotPrice;\n\t\t\t\t\t\n\t\t\t\t\t$FK_BaseCurrencyWalletID\t\t\t\t\t\t\t\t= $row -> FK_BaseCurrencyWalletID;\n\t\t\t\t\t$FK_QuoteCurrencyWalletID\t\t\t\t\t\t\t\t= $row -> FK_QuoteCurrencyWalletID;\n\t\t\t\t\t$receivedQuantity\t\t\t\t\t\t\t\t\t\t= $row -> receivedQuantity;\n\t\t\t\t\t$sentQuantity\t\t\t\t\t\t\t\t\t\t\t= $row -> sentQuantity;\n\t\t\t\t\t$FK_TransactionSourceID\t\t\t\t\t\t\t\t\t= $row -> FK_TransactionSourceID;\n\t\t\t\t\t$FK_ExchangeID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_ExchangeID;\n\t\t\t\t\t$FK_ReceivedCurrencyID\t\t\t\t\t\t\t\t\t= $row -> FK_ReceivedCurrencyID;\n\t\t\t\t\t$receivedCurrency\t\t\t\t\t\t\t\t\t\t= $row -> receivedCurrency;\n\t\t\t\t\t$FK_SentCurrencyID\t\t\t\t\t\t\t\t\t\t= $row -> FK_SentCurrencyID;\n\t\t\t\t\t$sentCurrency\t\t\t\t\t\t\t\t\t\t\t= $row -> sentCurrency;\n\t\t\t\t\t$FK_ReceivedWalletID\t\t\t\t\t\t\t\t\t= $row -> FK_ReceivedWalletID;\n\t\t\t\t\t$FK_SentWalletID\t\t\t\t\t\t\t\t\t\t= $row -> FK_SentWalletID;\n\t\t\t\t\t$receivedWalletType\t\t\t\t\t\t\t\t\t\t= $row -> receivedWalletType;\n\t\t\t\t\t$receivedWallet\t\t\t\t\t\t\t\t\t\t\t= $row -> receivedWallet;\n\t\t\t\t\t$sentWalletType\t\t\t\t\t\t\t\t\t\t\t= $row -> sentWalletType;\n\t\t\t\t\t$sentWallet \t\t\t\t\t\t\t\t\t\t\t= $row -> sentWallet;\n\t\t\t\t\t$FK_ReceivedTransactionSourceID\t\t\t\t\t\t\t= $row -> FK_ReceivedTransactionSourceID;\n\t\t\t\t\t$FK_SentTransactionSourceID\t\t\t\t\t\t\t\t= $row -> FK_SentTransactionSourceID;\n\n\t\t\t\t\tif (isset($cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$currentCount\t\t\t\t\t\t\t\t\t\t= $cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID];\n\t\t\t\t\t\t$currentCount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]\t= $currentCount;\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$cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]\t= 1;\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// create asset type status record for this data import event record ID\n\t\t\t\t\tcreateDataImportAssetStatusRecord($accountID, $userEncryptionKey, $dataImportEventRecordID, $FK_AssetTypeID, $quoteCurrencyID, $globalCurrentDate, $sid, $dbh);\n\n\t\t\t\t\t$transactionAmountInUSD\t\t\t\t\t\t\t\t\t= $amount;\n\t\t\t\t\t$transactionAmountMinusFeeInUSD\t\t\t\t\t\t\t= $amount;\n\n\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t\t= 0;\n\n\t\t\t\t\t$nativeTransactionIDValue\t\t\t\t\t\t\t\t= md5(\"$transactionSourceID $transactionTimestamp $FK_TransactionTypeID $FK_ReceivedCurrencyID $FK_SentCurrencyID $receivedWalletType $sentWalletType $amount $sentQuantity $receivedCurrency\".md5(\"$sentQuantity.$transactionTime.$accountID\"));\n\n\t\t\t\t\t$profitStanceTransactionIDValue\t\t\t\t\t\t\t= createProfitStanceTransactionIDValue($accountID, $FK_AssetTypeID, $transactionSourceID, $nativeTransactionIDValue, $globalCurrentDate, $sid);\n\n\t\t\t\t\t$globalTransactionCreationResults\t\t\t\t\t\t= createGlobalTransactionIdentificationRecordWithProfitStanceTransactionIDValue($accountID, $FK_AssetTypeID, $dataImportEventRecordID, $nativeTransactionIDValue, $profitStanceTransactionIDValue, $transactionSourceID, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\t\n\t\t\t\t\tif ($globalTransactionCreationResults['createdGlobalTransactionIdentificationRecord'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t= $globalTransactionCreationResults['globalTransactionIdentificationRecordID'];\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t\t= 0;\n\t\t\t\t\t\n\t\t\t\t\tif ($FK_ReceivedCurrencyID == 1 && $FK_SentCurrencyID == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t= $baseToUSDCurrencySpotPrice;\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$cascadeRetrieveSpotPriceResponseObject\t\t\t\t= getSpotPriceForAssetPairUsingSourceCascade(1, 2, $transactionTime, 14, \"CoinGecko price by date\", $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($cascadeRetrieveSpotPriceResponseObject['foundSpotPrice'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t= $cascadeRetrieveSpotPriceResponseObject['spotPrice'];\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$unspentTransactionTotal\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t\n\t\t\t\t\tif ($isDebit == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$unspentTransactionTotal \t\t\t\t\t\t\t= $amount;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($isDebit == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t= $amount;\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$sourceWallet\t\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t$destinationWallet\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t\n\t\t\t\t\t$sourceWalletResponseObject\t\t\t\t\t\t\t\t= $sourceWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $FK_SentWalletID, $userEncryptionKey, $dbh);\n\t\t\t\n\t\t\t\t\tif ($sourceWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"could not instantiate crypto wallet $accountID, $FK_SentWalletID, $userEncryptionKey\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$destinationWalletResponseObject\t\t\t\t\t\t= $destinationWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $FK_ReceivedWalletID, $userEncryptionKey, $dbh);\n\t\t\t\n\t\t\t\t\tif ($destinationWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"could not instantiate crypto wallet $accountID, $FK_ReceivedWalletID, $userEncryptionKey\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\terrorLog(\"INSERT INTO CoinTrackingLedgerTransaction\n(\n\ttransactionRecordID,\n\tFK_GlobalTransactionRecordID,\n\tFK_AccountID,\n\tFK_ProviderAccountWalletID,\n\ttransactionTime,\n\ttransactionTimestamp,\n\tFK_EffectiveTypeID,\n\tFK_TransactionTypeID,\n\tFK_AssetTypeID,\n\tamount,\n\tisDebit,\n\tbaseToQuoteCurrencySpotPrice,\n\tbaseToUSDCurrencySpotPrice,\n\tbtcSpotPriceAtTimeOfTransaction,\n\tFK_BaseCurrencyWalletID,\n\tFK_QuoteCurrencyWalletID,\n\treceivedQuantity,\n\tsentQuantity,\n\tFK_TransactionSourceID,\n\tFK_ExchangeID,\n\tFK_ReceivedCurrencyID,\n\treceivedCurrencyAbbreviation,\n\tFK_SentCurrencyID,\n\tsentCurrencyAbbreviation,\n\tFK_ReceivedWalletID,\n\tFK_SentWalletID,\n\treceivedWalletType,\n\treceivedWallet,\n\tsentWalletType,\n\tsentWallet\n)\nVALUES\n(\n\t$transactionRecordID,\n\t$globalTransactionIdentificationRecordID,\n\t$accountID,\n\t$FK_ProviderAccountWalletID,\n\t'$transactionTime',\n\t$transactionTimestamp,\n\t$FK_EffectiveTypeID,\n\t$FK_TransactionTypeID,\n\t$FK_AssetTypeID,\n\t$amount,\n\t$isDebit,\n\t$baseToQuoteCurrencySpotPrice,\n\t$baseToUSDCurrencySpotPrice,\n\t$btcSpotPriceAtTimeOfTransaction,\n\t$FK_BaseCurrencyWalletID,\n\t$FK_QuoteCurrencyWalletID,\n\t$receivedQuantity,\n\t$sentQuantity,\n\t$transactionSourceID,\n\t$FK_ExchangeID,\n\t$FK_ReceivedCurrencyID,\n\t'$receivedCurrency',\n\t$FK_SentCurrencyID,\n\t'$sentCurrency',\n\t$FK_ReceivedWalletID,\n\t$FK_SentWalletID,\n\t'$receivedWalletType',\n\t'$receivedWallet',\n\t'$sentWalletType',\n\t'$sentWallet'\n)\");\n\t\t\t\t\t\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionRecordID', $transactionRecordID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_GlobalTransactionRecordID', $globalTransactionIdentificationRecordID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_AccountID', $accountID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ProviderAccountWalletID', $FK_ProviderAccountWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionTime', $transactionTime);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionTimestamp', $transactionTimestamp);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_EffectiveTypeID', $FK_EffectiveTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_TransactionTypeID', $FK_TransactionTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_AssetTypeID', $FK_AssetTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':amount', $amount);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':isDebit', $isDebit);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':baseToQuoteCurrencySpotPrice', $baseToQuoteCurrencySpotPrice);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':baseToUSDCurrencySpotPrice', $baseToUSDCurrencySpotPrice);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':btcSpotPriceAtTimeOfTransaction', $btcSpotPriceAtTimeOfTransaction);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_BaseCurrencyWalletID', $FK_BaseCurrencyWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_QuoteCurrencyWalletID', $FK_QuoteCurrencyWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedQuantity', $receivedQuantity);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentQuantity', $sentQuantity);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_TransactionSourceID', $transactionSourceID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ExchangeID', $FK_ExchangeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ReceivedCurrencyID', $FK_ReceivedCurrencyID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedCurrencyAbbreviation', $receivedCurrency);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_SentCurrencyID', $FK_SentCurrencyID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentCurrencyAbbreviation', $sentCurrency);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ReceivedWalletID', $FK_ReceivedWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_SentWalletID', $FK_SentWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedWalletType', $receivedWalletType);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedWallet', $receivedWallet);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentWalletType', $sentWalletType);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentWallet', $sentWallet);\n\n\t\t\t\t\t\n\n\t\t\t\t\t$nativeRecordID\t\t\t\t\t\t\t\t\t\t\t= 0;\n\n\t\t\t\t\tif ($insertCoinTrackingRecords -> execute())\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"insert coin tracking record worked\", $GLOBALS['debugCoreFunctionality']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nativeRecordID \t\t\t\t\t\t\t\t\t= $dbh -> lastInsertId();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$cryptoTransaction\t\t\t\t\t\t\t\t\t\t= new CryptoTransaction();\n\t\t\t\t\t\n\t\t\t\t\t$cryptoTransaction -> setData(0, $accountID, $authorID, $globalTransactionIdentificationRecordID, $FK_TransactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $FK_AssetTypeID, $receivedCurrency, $quoteCurrencyID, $quoteCurrency, $FK_SentWalletID, $FK_ReceivedWalletID, $transactionTime, $transactionTime, $transactionTimestamp, $nativeRecordID, $nativeRecordID, $receivedQuantity, $amount, $baseToQuoteCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountInUSD, $feeAmountInBaseCurrency, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid);\n\t\t\t\t\t\n\t\t\t\t\t$writeToDatabaseResponse\t\t\t\t\t\t\t\t= $cryptoTransaction -> writeToDatabase($userEncryptionKey, $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\tif ($writeToDatabaseResponse['wroteToDatabase'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$transactionID\t\t\t\t\t\t\t\t\t\t= $cryptoTransaction -> getTransactionID();\n\t\t\t\t\t\n\t\t\t\t\t\terrorLog(\"transaction $transactionID created\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$profitStanceLedgerEntry\t\t\t\t\t\t\t= new ProfitStanceLedgerEntry();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$profitStanceLedgerEntry -> setData($accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $exchangeTileID, $globalTransactionIdentificationRecordID, $transactionTime, $receivedQuantity, $dbh);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$writeProfitStanceLedgerEntryRecordResponseObject\t= $profitStanceLedgerEntry -> writeToDatabase($dbh);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($writeProfitStanceLedgerEntryRecordResponseObject['wroteToDatabase'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"wrote profitStance ledger entry $accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $globalTransactionIdentificationRecordID, $receivedQuantity to the database.\", $GLOBALS['debugCoreFunctionality']);\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\terrorLog(\"could not write profitStance ledger entry $accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $globalTransactionIdentificationRecordID, $receivedQuantity to the database.\", $GLOBALS['criticalErrors']);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= true;\n\t\t}\n\t\tcatch (PDOException $e) \n\t\t{\n\t\t\t$cryptoTransaction \t\t\t\t\t\t\t\t\t\t\t\t= null;\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= false;\n\t\t\t\n\t\t\terrorLog($e -> getMessage());\n\t\t\n\t\t\tdie();\n\t\t}\n\n return $cryptoCurrencyTypesImported;\n }", "public function getStoresOrdertocart() {\n\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $store_id = func_get_arg(1);\n $res = array();\n try {\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(array('atc' => 'addtocart'), array('atc.user_id', 'atc.product_id', 'atc.id AS cart_id', 'atc.Store_id', 'atc.quantity'))\n ->joinLeft(array('p' => 'products'), 'atc.product_id=p.product_id', array('p.name', 'p.imagelink', 'p.cost AS product_cost'))\n ->joinLeft(array('sd' => 'store_details'), 'atc.Store_id=sd.store_id')\n ->where('atc.user_id = ?', $user_id)\n ->where('atc.Store_id = ?', $store_id);\n\n $result = $this->getAdapter()->fetchAll($select);\n\n if ($result) {\n $i = 0;\n foreach ($result as $value) {\n $store_id = $value['store_id'];\n $res['store_name'] = $value['store_name'];\n $res['store_id'] = $value['store_id'];\n $res['Deliverycharge'] = $value['Deliverycharge'];\n $res['products'][$i]['product_id'] = $value['product_id'];\n $res['products'][$i]['imagelink'] = $value['imagelink'];\n $res['products'][$i]['cost'] = $value['product_cost'];\n $res['products'][$i]['sub_cost_product'] = $value['product_cost'] * $value['quantity'];\n $res['products'][$i]['quantity'] = $value['quantity'];\n $res['products'][$i]['cart_id'] = $value['cart_id'];\n $res['products'][$i]['product_name'] = $value['name'];\n if (isset($res['subtotal'])) {\n $res['subtotal']+= $res['products'][$i]['sub_cost_product'];\n } else {\n $res['subtotal'] = 0;\n $res['subtotal']+= $res['products'][$i]['sub_cost_product'];\n }\n $i++;\n }\n\n return $res;\n } else {\n return null;\n }\n } catch (Exception $ex) {\n throw new Exception(\"argument not passed: \" . $ex);\n }\n } else {\n throw new Exception(\"argument not passed\");\n }\n }", "function get_all_produto_solicitacao_baixa_estoque()\n {\n \n $this->db->select('baixa.di,baixa.quantidade, u.nome_usuario,produto.nome as produto');\n $this->db->join('usuario u ','u.id = baixa.usuario_id');\n $this->db->join('produto','produto.id = baixa.produto_id');\n\n return $this->db->get('produto_solicitacao_baixa_estoque baixa')->result_array();\n }", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public function setTransactions($transactions)\r\n {\r\n $this->transactions = $transactions;\r\n return $this;\r\n }", "public function query_in_transactions(){\n\t\t$response = $this->execute($this->query_in_transaction_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in communication\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "public function merge(...$stores) {\n\n\t\t$newStore = $this->data;\n\n\t\tforeach($stores as $store) {\n\n\t\t\tif(is_array($store) === true) {\n\n\t\t\t\t$newStore = $newStore + $store;\n\n\t\t\t} else if($store instanceof Store) {\n\n\t\t\t\t$newStore = $newStore + $store->data;\n\n\t\t\t}\n\n\t\t}\n\n\t\t$this->data = $newStore;\n\n\t}", "public function transactions()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the users transaction\n $transactions = OrdersModel::transactions();\n\n $this->View->Render('dashboard/transactions', ['transactions' => $transactions]);\n }", "public function getPlayerTransactions($player){\n\n $this->db->select('*');\n $this->db->from('transactions t');\n $this->db->where('t.Player', $player);\n $query = $this->db->get();\n $noData = array();\n $noPlayer = [\n \"DateTime\" => \"N/A\",\n \"Player\" => \"N/A\",\n \"Stock\" => \"N/A\",\n \"Trans\" => \"N/A\",\n \"Quantity\" => \"N/A\",\n ];\n array_push($noData, $noPlayer);\n\n if($query->num_rows() != 0)\n {\n $resultset = $query->result_array();\n }else{\n $resultset = $noData;\n }\n\n return $resultset;\n }", "public function fetchAll(BasketRepositoryInterface $baskets)\n {\n $result = new BasketRepository();\n foreach ($baskets as $basket) {\n if ($this->checkCriterias($basket)) {\n $result->addBasket($basket);\n }\n }\n return $result;\n }", "public function index(Request $request)\n {\n $queryBuilder = Transaction::with(['category', 'account'])\n ->leftJoin('categories as category', 'transactions.category_id', '=', 'category.id')\n ->leftJoin('accounts as account', 'transactions.account_id', '=', 'account.id');\n\n if($request->has(\"category_id\")) {\n $category_id = $request->get(\"category_id\");\n\n if($category_id == 0) {\n // If 0 is given as category id, it means a request for all uncategorized transactions\n $queryBuilder->whereNull(\"category_id\");\n } else {\n // Otherwise, we need to return the transactions within the category or any of its descendants\n $categories = Category::descendantsOf($category_id)->pluck('id');\n\n // Include the id of category itself\n $categories[] = $category_id;\n\n // Filter on those categories\n $queryBuilder->whereIn(\"category_id\", $categories);\n }\n }\n\n if($request->has(\"account_id\")) {\n $account_id = $request->get(\"account_id\");\n $queryBuilder->where(\"account_id\", \"=\", $account_id);\n }\n\n if($request->has(\"date_start\")) {\n $queryBuilder->where(\"date\", \">=\", $request->get(\"date_start\"));\n }\n\n if($request->has(\"date_end\")) {\n $queryBuilder->where(\"date\", \"<=\", $request->get(\"date_end\"));\n }\n\n return TransactionResource::collection($this->getPaginatedAndSorted($request, $queryBuilder, ['transactions.*']));\n }", "public function fetchTransactions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchTransactionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchTransactionsRequest', $parameters);\n }", "public function index()\n {\n $transactions = RecurringTransaction::getTransactionsForUser($this->user, $this->with);\n\n $transactions = TransactionMutator::set($this->set, $transactions);\n\n return $transactions->keyBy('id');\n }", "public function getStockOpnames()\n {\n // dd($this->request);\n $cek = $this->request->query('cek');\n \n $where = '';\n if($cek){\n $where = 'category_id = '. $cek .'';\n }\n $this->loadModel('Products');\n $this->loadModel('Stocks');\n\n $InStocks = $this->Stocks->find();\n $OutStocks = $this->Stocks->find();\n $priceStocks = $this->Stocks->find();\n\n if ($this->request->is('ajax')) {\n $data = $this->Products->find('all', [\n 'conditions' => [\n $where\n ],\n 'contain' =>[\n 'SubCategories'\n ]\n ])->select([\n 'id' => 'Products.id',\n 'code' => 'Products.code',\n 'name' => 'Products.name',\n 'product_saldo' => '(IFNULL((' .\n $InStocks->select(\n [\n 'SUM' => $InStocks->func()->sum('qty')\n ]\n )->where([\n 'type = \"IN\"',\n 'product_id = Products.id'\n ])\n . '), 0)) - (IFNULL((' .\n $OutStocks->select(\n [\n 'SUM' => $OutStocks->func()->sum('qty')\n ]\n )->where([\n 'type = \"OUT\"',\n 'product_id = Products.id'\n ])\n . '), 0))',\n 'price' => $priceStocks->select([\n 'price'\n ])->where([\n 'type = \"IN\"',\n 'product_id = Products.id',\n ])->order(['date' => 'DESC'])->limit(1)\n ]);\n\n $results = [];\n $a = 0;\n\n foreach ($data as $key => $val) {\n $results[$a]['id'] = $val->id;\n $results[$a]['name'] = '[' . $val->code . '] ' . $val->name;\n $results[$a]['product_saldo'] = $val->product_saldo;\n $results[$a]['price'] = $val->price;\n $a++;\n }\n\n $this->set(compact('results'));\n $this->set('_serialize', ['results']);\n }\n }" ]
[ "0.6001631", "0.5861026", "0.5839137", "0.5781882", "0.5774805", "0.5534262", "0.5530277", "0.55257946", "0.5508572", "0.5508572", "0.5508572", "0.545079", "0.53889203", "0.5375663", "0.5346794", "0.53124434", "0.5306124", "0.5284743", "0.5282967", "0.5252248", "0.5137545", "0.51337975", "0.511143", "0.5030953", "0.50223285", "0.5021021", "0.50100815", "0.4971602", "0.49331594", "0.49130595", "0.48853093", "0.48817232", "0.48776442", "0.4875097", "0.4867091", "0.48457485", "0.48416838", "0.48163772", "0.48064047", "0.48064047", "0.4800717", "0.4799588", "0.4789422", "0.47840476", "0.4777092", "0.47588158", "0.4735209", "0.4733804", "0.4690118", "0.4648009", "0.46435335", "0.46404848", "0.4640422", "0.4637969", "0.46202362", "0.4613455", "0.46025935", "0.46015328", "0.45898965", "0.45829374", "0.45811096", "0.45779154", "0.457164", "0.45594692", "0.45560774", "0.45560116", "0.4548697", "0.45389956", "0.45355532", "0.45313784", "0.4531023", "0.4528233", "0.4526417", "0.4521794", "0.45131215", "0.4512158", "0.45086414", "0.4503866", "0.45025957", "0.44930574", "0.44813672", "0.4478413", "0.44734994", "0.4471211", "0.44635537", "0.44628453", "0.4461249", "0.44432893", "0.44370154", "0.44305488", "0.4425545", "0.4408662", "0.4408238", "0.4408162", "0.44062322", "0.43998644", "0.43996915", "0.43874955", "0.43780464", "0.43732712" ]
0.53434795
15
Calculates the current holdings of the given Player.
public function getCurrentHoldings($player){ $resultset = null; $results = array(); $stocks = $this->stocks->all(); $this->db->select('Quantity, Trans, Stock, Value'); $this->db->from('transactions t'); $this->db->join('stocks s', 's.Code=t.Stock', 'left'); $this->db->join('players p', 'p.Player=t.Player', 'left'); $this->db->where('t.Player', $player); $query = $this->db->get(); if($query->num_rows() != 0) { $resultset = $query->result_array(); } foreach( $stocks as $item ) { $results[$item->Code] = 0; } if ( count( $resultset ) > 0 ) foreach( $resultset as $result ) { $amount = $result["Quantity"]; $action = $result["Trans"]; $stock = $result["Stock"]; $price = $result["Value"]; $sign = ( $action == "buy" ) ? 1 : -1; $results[$stock] += $sign * $amount * $price; } return array($results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlayerHoldings($player)\n {\n $queryString = \"SELECT transactions.*, stocks.Value AS customValue FROM transactions JOIN stocks ON stocks.Code = transactions.Stock WHERE Player='\" . $player . \"'\";\n $activity = $this->db->query($queryString);\n\n $stockArray = array();\n foreach ($activity->result() as $thisStock) {\n if (!isset($stockArray[$thisStock->Stock])) {\n $stockArray[$thisStock->Stock] = 0;\n }\n if ($thisStock->Trans == 'sell') {\n $stockArray[$thisStock->Stock] -= (int)$thisStock->Quantity;\n } else if ($thisStock->Trans == 'buy') {\n $stockArray[$thisStock->Stock] += (int)$thisStock->Quantity;\n }\n }\n\n $returnArray = array();\n foreach ($stockArray as $key => $value) {\n $returnArray[] = array(\n 'Stock' => $key,\n 'Quantity' => $value\n );\n }\n return $returnArray;\n }", "function playerHit($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll){\n\t$newCard = drawACard($deck);\n\t$player[] = $newCard;\n\t$total = getTotal($player);\n\t//echo out each card and total\n\tforeach ($player as $card) {\n\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n\t//notify when player busts\n\tif (getTotal($player) > 21) {\n\t\tevaluateHands($name, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\t}\n\treturn $player;\n}", "function getTotalHoldings()\n\t{\n\t\t$lastTrade = $this->data->getLastCompletedTrade();\n\t\t$previousTrade = $lastTrade && $lastTrade->getPreviousBotTradeID() ? $this->data->getTradeByID($lastTrade->getPreviousBotTradeID()) : null;\n\n\t\tif ($this->baseAssetIsNative())\n\t\t{\n\t\t\t$sum = $this->getCurrentBaseAssetBudget();\n\t\t\t$otherAssetAmmount = $this->getCurrentCounterAssetBudget();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sum = $this->getCurrentCounterAssetBudget();\n\t\t\t$otherAssetAmmount = $this->getCurrentBaseAssetBudget();\n\t\t}\n\n\t\tif ($lastTrade && $lastTrade->getType() == Trade::TYPE_BUY)\n\t\t{\n\t\t\t$price = $this->data->getAssetValueForTime(Time::now());\n\n\t\t\tif ($price)\n\t\t\t\t$price = 1/$price;\n\n\t\t\t$sum += $otherAssetAmmount * $price;\n\t\t}\n\t\telse if ($lastTrade && $previousTrade && $previousTrade->getType() == Trade::TYPE_BUY)\n\t\t{\n\t\t\t$price = $this->data->getAssetValueForTime(Time::now());\n\t\t\t\n\t\t\tif ($price)\n\t\t\t\t$price = 1/$price;\n\n\t\t\t$sum += $otherAssetAmmount * $price;\n\t\t}\n\n\t\treturn $sum;\n\t}", "function playerStaysInPenaltyBox($currentPlayer) {\n\t}", "public function requestPlayerBet(Player $player);", "public function getRealTimeHoldings()\n {\n return $this->hasILS() ? $this->holdLogic->getHoldings(\n $this->getUniqueID(), $this->getConsortialIDs()\n ) : [];\n }", "public function calculateTotalLunch()\n\t{\n\t\t$result = 0;\n\n\t\t$passengers = $this->getPassengers();\n\n\t\tif( count($passengers) )\n\t\t{\n\t\t\tforeach ($passengers as $passenger)\n\t\t\t{\n\t\t\t\tif( (int)$passenger->status < 3 )\n\t\t\t\t{\n\t\t\t\t\tif($passenger->lunch)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $result;\n\t}", "function playerSentToPenaltyBox($currentPlayer) {\n\t}", "protected function computeAllowed() {\n\t\tif($this->tees) {\n\t\t\t$this->exact_handicap = $this->player->handicap;\n\t\t\t$a = $this->player->allowed($this->tees);\n\t\t\t$this->handicap = array_sum($a); // playing handicap\n\t\t\t$this->save();\n\t\t\tif($this->hasDetails()) {\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($this->getScoreWithHoles()->each() as $score) {\n\t\t\t\t\t$score->allowed = $a[$i++];\n\t\t\t\t\t$score->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public function passGo($player){\n $player->collect($this->go_amount);\n }", "public function calculate_votes()\r\n\t{\r\n\t\t$this->votes_total = $this->votes_up + $this->votes_down;\r\n\t\t$this->votes_balance = $this->votes_up - $this->votes_down;\r\n\r\n\t\t// Note: division by zero must be prevented\r\n\t\t$this->votes_pct_up = ($this->votes_total === 0) ? 0 : $this->votes_up / $this->votes_total * 100;\r\n\t\t$this->votes_pct_down = ($this->votes_total === 0) ? 0 : $this->votes_down / $this->votes_total * 100;\r\n\t}", "function playerCoins($currentPlayer, $playerCoins) {\n\t}", "public function getCollisions($player)\n {\n $collisions = collect();\n $playerSelections = PlayerPick::where('pool_id', $player->pool->id)->get()->groupBy('player_id');\n\n /* If the player doesnt currently have 2 picks then there is no chance of collision */\n if (count($player->houseguests) !== 2) {\n return $collisions;\n }\n\n foreach ($playerSelections as $selections) {\n $houseguests = $player->houseguests()->pluck('houseguest_id');\n\n if ($selections->pluck('houseguest_id')->count() !== 3) {\n continue;\n }\n\n $collisionValues = $selections->pluck('houseguest_id')->values()->diff($houseguests);\n\n /* If the two players selections are off by 1 then remove the remaining houseguest\n from the available list so they dont end up with the same selections */\n (count($collisionValues) === 1) ? $collisions->push($collisionValues) : null;\n }\n\n return $collisions->flatten();\n }", "public function play()\n {\n $this->spin();\n foreach ($this->bets as $bet_type => $wager)\n {\n if (method_exists(Game, $bet_type))\n {\n if ($payoff = $this->$bet_type())\n {\n $this->win = true;\n $money_won = ($wager * $payoff);\n $this->increment_money_won($money_won);\n $this->increment_money($money_won);\n }\n else\n {\n $this->increment_money_lost($wager);\n $this->decrement_money($wager);\n }\n }\n }\n return $this->win;\n }", "function pokerWinner($player1Hand){\n $pairCount = 0;\n $twoPairCount = 0;\n $threeOfAKind = 0;\n $fourOfAKindCount = 0;\n $straightCount = 0;\n $flushCount = 0;\n $fullHouseCount = 0;\n $fourOfAKindCount = 0;\n $straightFlushCount = 0;\n $royalFlushCount = 0;\n $consecutive = 0;\n $value = 10;\n\n $matchingCardCount = pairFinder($player1Hand);\n\n if($matchingCardCount == 3){\n \n $fourOfAKindCount = 1;\n $threeOfAKind = 1;\n $pairCount = 2;\n }\n\n if($matchingCardCount == 2){\n $threeOfAKind = 1;\n $pairCount = 1;\n }\n\n if($matchingCardCount == 1){\n $pairCount = 1;\n\n }\n\n //check for two pairs\n if(twoPairFinder($player1Hand)){\n $pairCount = 2;\n $twoPairCount = 1;\n }\n\n\n\n if(straightFinder($player1Hand)){\n $straightCount = 1;\n\n\n }\n\n //check for flush\n if(flushFinder($player1Hand)){\n $flushCount = 1;\n\n }\n\n //check for straight flush\n if($flushCount == 1 && $straightCount == 1){\n $straightFlushCount = 1;\n }\n\n //check for royal flush\n if($straightFlushCount == 1){\n if(royalFlushFinder($player1Hand)){\n $royalFlushCount = 1;\n }\n }\n\n //Testing area\n\n // echo 'The $pairCount is: ' . $pairCount . \"\\n\" . \"\\n\";\n // echo 'The $twoPairCount is: ' . $twoPairCount . \"\\n\" . \"\\n\";\n // echo 'The $threeOfAKind is: ' . $threeOfAKind . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightCount is: ' . $straightCount . \"\\n\" . \"\\n\";\n // echo 'The $flushCount is: ' . $flushCount . \"\\n\" . \"\\n\";\n // echo 'The $fullHouseCount is: ' . $fullHouseCount . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightFlushCount is: ' . $straightFlushCount . \"\\n\" . \"\\n\";\n // echo 'The $royalFlushCount is: ' . $royalFlushCount . \"\\n\" . \"\\n\";\n\n\n //Give out points\n if($royalFlushCount == 1){\n $value = 10;\n return $value;\n }\n\n if($straightFlushCount == 1){\n $value = 9;\n return $value;\n }\n\n if($fourOfAKindCount == 1){\n $value = 8;\n return $value;\n }\n\n if($fullHouseCount == 1){\n $value = 7;\n return $value;\n }\n\n if($flushCount == 1){\n $value = 6;\n return $value;\n }\n\n if($straightCount == 1){\n $value = 5;\n return $value;\n }\n\n if($threeOfAKind == 1){\n $value = 4;\n return $value;\n }\n\n if($twoPairCount == 1){\n $value = 3;\n return $value;\n }\n\n if($pairCount == 1){\n $value = 2;\n return $value;\n }\n\n else{\n $value = 1;\n return $value;\n }\n\n\n}", "public function addHoldings(Holdings $holdings)\r\n {\r\n array_push($this->holdings, $holdings);\r\n }", "public function rewardWinners(& $wins,& $table){\n\t\t$pots=& $table->game_pots;\n\t\t$leftOvers=$pots[\"left_overs\"]->amount;\n\t\t$x.=print_r($wins,true);\n\t\t$x.=\"\\n\\n\";\n\t\tforeach ($wins as $points=>$winners){// loop through winners by highest points , search for elegible pot then add that pot to the users'amount'\n\t\t\t$pot_on=count($winners); // how many winners for single pot ?\n\t\t\t$x.= \"got $pot_on winners with score of $points\\n\";\n\t\t\tif ($pon_on=='1'){\n\t\t\t\t$table->dealerChat($pot_on.' winner .');\n\t\t\t}elseif($pon_on>'1'){\n\t\t\t\t$table->dealerChat($pot_on.' winners .');\n\t\t\t}\n\t\t\t$winName=$this->getWinName($points);\n\t\t\t//generate win text\n\t\t\t$winText=' With <label class=\"hand_name\">'.$winName->handName.'</label>' ;\n\t\t\tif ($winName->handName=='High Card'){\n\t\t\t\t$winText.=' '.$winName->normalKicker ;\n\t\t\t}else{\n\t\t\t\tif (isset($winName->doubleKicker)){\n\t\t\t\t\t$winText.=' of '.$winName->doubleKicker ;\n\t\t\t\t}\n\t\t\t\tif ((isset($winName->normalKicker) && !isset($winName->doubleKicker)) || isset($winName->normalKicker) && isset($winName->doubleKicker) && $winName->doubleKicker!=$winName->normalKicker){\n\t\t\t\t\t$winText.=' and '.$winName->normalKicker.' kicker' ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($winners as $winnerId){\n\t\t\t\t$x.= \" - checking winner $winnerId :\\n\";\n\t\t\t\t//search for pots who has this player id\n\t\t\t\t$winPlayer=new Player($winnerId);\n\t\t\t\t\t$x.= \" - Winner is $winPlayer->display_name $winPlayer->seat_id has $ $winPlayer->amount :\\n\";\n\t\t\t\t\tforeach ($pots as $id=>$pot){\n\t\t\t\t\t\tif ($pot->amount>0 && $id!=='left_overs'){\n\t\t\t\t\t\t\t$pot->amount+=$leftOvers;\n\t\t\t\t\t\t\t$leftOvers=0;\n\t\t\t\t\t\t\tif (!isset($pot->original_amount)){$pot->original_amount=$pot->amount;}\n\t\t\t\t\t\t\t$winAmount=round($pot->original_amount/$pot_on);\n\t\t\t\t\t\t\tif (in_array($winnerId,$pot->eligible)!==false){\n\t\t\t\t\t\t\t\t$pots[$id]->amount-=$winAmount;\n\t\t\t\t\t\t\t\t$winPlayer->amount+=$winAmount;\n\t\t\t\t\t\t\t\t$table->dealerChat($winPlayer->profile_link.' has won the pot <label class=\"cash_win\">($'.$winAmount.')</label> '.$winText.' .');\n\t\t\t\t\t\t\t\tif ($winAmount>0){$winPlayer->won=5;}else{$winPlayer->won=0;}\n\t\t\t\t\t\t\t\tif (substr($winPlayer->bet_name,0,6)=='<label'){\n\t\t\t\t\t\t\t\t\t$oldAmount=substr($winPlayer->bet_name,26,strpos($winPlayer->bet_name,'</label>')-26);\n\t\t\t\t\t\t\t\t\t$oldAmount+=$winAmount;\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$oldAmount.'</label>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$winPlayer->bet_name='<label class=\"winLabel\">+$'.$winAmount.'</label>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$winPlayer->saveBetData();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}//\n\t\t\t\t\t}//\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t}//\n\t\t\t\n\t\t}//\n\t\tfile_put_contents('wins.txt',$x);\n\t\n\t}", "function statusAfterPlayerGettingOutOfPenaltyBox($currentPlayer, $currentPlace, $currentCategory) {\n\t}", "function getGameProgression()\n { \n // Start or end of game\n $current_state = $this->gamestate->state();\n switch($current_state['name']) {\n case 'gameSetup':\n case 'turn0':\n return 0;\n case 'whoBegins':\n return 1;\n case 'justBeforeGameEnd':\n case 'gameEnd':\n return 100;\n }\n // For other states (all included in player action)\n $players = self::loadPlayersBasicInfos();\n \n // The total progression is a mix of:\n // -the progression of the decreasing number of cards in deck (end of game by score)\n // -the progression of each player in terms of the achievements they get\n \n // Progression in cards\n // Hypothesis: a card of age 9 is drawn three times quicker than a card of age 1. Cards of age 10 are worth six times a card of age 1 because if there are none left it is the end of the game\n $weight = 0;\n $total_weight = 0;\n \n $number_of_cards_in_decks = self::countCardsInLocation(0, 'deck', true);\n for($age=1; $age<=10; $age++) {\n $n = $number_of_cards_in_decks[$age];\n switch($age) {\n case 1:\n $n_max = 14 - 2 * count($players); // number of cards in the deck at the beginning: 14 (15 minus one taken for achievement) minus the cards dealt to the players at the beginning\n $w = 1; // weight for cards of age 1: 1\n break;\n case 10:\n $n++; // one more \"virtual\" card because the game is not over where the tenth age 10 card is drawn (but quite...)\n $n_max = 11; // number of cards in the deck at the beginning: 10, +1 one more \"virtual\" card because the game is not over when the last is drawn\n $w = 6; // weight for cards of age 10: 6\n break;\n default:\n $n_max = 9; // number of cards in the deck at the beginning: 9 (10 minus one taken for achievement)\n $w = ($age-1) / 4 + 1; // weight between 1.25 (for age 2) and 3 (for age 9)\n break;\n };\n $weight += ($n_max - $n) * $w; // What is really important are the cards already drawn\n $total_weight += $n_max * $w;\n }\n $progression_in_cards = $weight/$total_weight;\n \n // Progression of players\n // This is the ratio between the number of achievements the player have got so far and the number of achievements needed to win the game\n $progression_of_players = array();\n $n_max = self::getGameStateValue('number_of_achievements_needed_to_win');\n foreach($players as $player_id=>$player) {\n $n = self::getPlayerNumberOfAchievements($player_id);\n $progression_of_players[] = $n/$n_max;\n }\n \n // If any of the above progression was 100%, the game would be over. So, 100% is a kind of \"absorbing\" element. So,the method is to multiply the complements of the progression.\n // A complement is defined as 100% - progression\n $complement = 1 - $progression_in_cards;\n foreach($progression_of_players as $progression) {\n $complement *= 1 - $progression;\n }\n $final_progression = 1 - $complement;\n \n // Convert the final result in percentage\n $percentage = intval(100 * $final_progression);\n $percentage = min(max(1, $percentage), 99); // Set that progression between 1% and 99%\n return $percentage;\n }", "public function updateScoresAndShots()\n {\n $this->player1score = 0;\n $this->player1shots = 0;\n $this->player2score = 0;\n $this->player2shots = 0;\n\n foreach ($this->getTurns() as $turn) {\n if ($turn->isVoid()) {\n continue;\n }\n\n if ($turn->getPlayer() == $this->getGame()->getPlayer1()) {\n $this->player1score += $turn->getTotalScore();\n $this->player1shots += 3;\n } else {\n $this->player2score += $turn->getTotalScore();\n $this->player2shots += 3;\n }\n }\n }", "public function stateScores () : void {\r\n $highestHand = 0;\r\n\r\n foreach ($this->players() as $player) {\r\n if ( $player->handValue() > $highestHand && ! $player->busted() )\r\n $highestHand = $player->handValue();\r\n\r\n if ( $player->busted() )\r\n echo 'Player ' . $player->getName() . ' busted with ' . $player->handValue();\r\n else\r\n echo 'Player ' . $player->getName() . \"'s hand : \" . $player->handValue();\r\n echo PHP_EOL;\r\n }\r\n\r\n if ( $this->dealer->handValue() > $highestHand && ! $this->dealer->busted() )\r\n $highestHand = $this->dealer->handValue();\r\n\r\n if ( $this->dealer->busted() )\r\n echo 'Dealer busted with ' . $this->dealer->handValue();\r\n else\r\n echo \"Dealer's hand : \" . $this->dealer->handValue();\r\n echo PHP_EOL;\r\n\r\n echo PHP_EOL, PHP_EOL, \"Highest Hands : \";\r\n foreach ($this->players() as $player)\r\n if ( $player->handValue() == $highestHand )\r\n echo $player->getName() . \" \";\r\n if ( $this->dealer->handValue() == $highestHand )\r\n echo 'Dealer';\r\n echo PHP_EOL, PHP_EOL;\r\n }", "public function holdingLeft(){\n\t\treturn $this->_sendPacketToController(self::HOLDING_LEFT);\n\t}", "private function passTime()\n {\n // guys in bathroom lose pee equal to peeSpeed\n // guys at bar gain pee equal to drinkSpeed\n // guys in bathroom with pee == 0 return to bar\n }", "function calculatePoints($Points = array(), $MatchType, $BattingMinimumRuns, $ScoreValue, $BallsFaced = 0, $Overs = 0, $Runs = 0, $MinimumOverEconomyRate = 0, $PlayerRole, $HowOut)\n {\n /* Match Types */\n $MatchTypes = array('ODI' => 'PointsODI', 'List A' => 'PointsODI', 'T20' => 'PointsT20', 'T20I' => 'PointsT20', 'Test' => 'PointsTEST', 'Woman ODI' => 'PointsODI', 'Woman T20' => 'PointsT20');\n $MatchTypeField = $MatchTypes[$MatchType];\n $PlayerPoints = array('PointsTypeGUID' => $Points['PointsTypeGUID'], 'PointsTypeShortDescription' => $Points['PointsTypeShortDescription'], 'DefinedPoints' => strval($Points[$MatchTypeField]), 'ScoreValue' => (!empty($ScoreValue)) ? strval($ScoreValue) : \"0\");\n switch ($Points['PointsTypeGUID']) {\n case 'ThreeWickets':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue == 3) ? strval($Points[$MatchTypeField]) : \"0\";\n $this->defaultBowlingPoints = $PlayerPoints;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBowlingState == 0) {\n $this->IsBowlingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'FourWickets':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue == 4) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBowlingState == 0) {\n $this->IsBowlingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'FiveWickets':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue == 5) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBowlingState == 0) {\n $this->IsBowlingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'SixWickets':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue == 6) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBowlingState == 0) {\n $this->IsBowlingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'SevenWicketsMore':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 7) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBowlingState == 0) {\n $this->IsBowlingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'EightWicketsMore':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 8) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBowlingState == 0) {\n $this->IsBowlingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'RunOUT':\n case 'Stumping':\n case 'Four':\n case 'Six':\n case 'EveryRunScored':\n case 'Catch':\n case 'Wicket':\n case 'Maiden':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue > 0) ? $Points[$MatchTypeField] * $ScoreValue : 0;\n return $PlayerPoints;\n break;\n case 'Duck':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue <= 0 && $PlayerRole != 'Bowler' && $HowOut != \"Not out\") ? (($BallsFaced >= 1) ? $Points[$MatchTypeField] : 0) : 0;\n return $PlayerPoints;\n break;\n case 'StrikeRate0N49.99':\n $PlayerPoints['CalculatedPoints'] = \"0\";\n $this->defaultStrikeRatePoints = $PlayerPoints;\n if ($Runs >= $BattingMinimumRuns) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 0.1 && $ScoreValue <= 49.99) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsStrikeRate == 0) {\n $this->IsStrikeRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'StrikeRate50N74.99':\n if ($Runs >= $BattingMinimumRuns) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 50 && $ScoreValue <= 74.99) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsStrikeRate == 0) {\n $this->IsStrikeRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'StrikeRate75N99.99':\n if ($Runs >= $BattingMinimumRuns) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 75 && $ScoreValue <= 99.99) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsStrikeRate == 0) {\n $this->IsStrikeRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'StrikeRate100N149.99':\n if ($Runs >= $BattingMinimumRuns) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 100 && $ScoreValue <= 149.99) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsStrikeRate == 0) {\n $this->IsStrikeRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'StrikeRate150N199.99':\n if ($Runs >= $BattingMinimumRuns) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 150 && $ScoreValue <= 199.99) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsStrikeRate == 0) {\n $this->IsStrikeRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'StrikeRate200NMore':\n if ($Runs >= $BattingMinimumRuns) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 200) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsStrikeRate == 0) {\n $this->IsStrikeRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'EconomyRate0N5Balls':\n $PlayerPoints['CalculatedPoints'] = \"0\";\n $this->defaultEconomyRatePoints = $PlayerPoints;\n if ($Overs >= $MinimumOverEconomyRate) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 0.1 && $ScoreValue <= 5) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsEconomyRate == 0) {\n $this->IsEconomyRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'EconomyRate5.01N7.00Balls':\n if ($Overs >= $MinimumOverEconomyRate) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 5.01 && $ScoreValue <= 7) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsEconomyRate == 0) {\n $this->IsEconomyRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'EconomyRate5.01N8.00Balls':\n if ($Overs >= $MinimumOverEconomyRate) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 5.01 && $ScoreValue <= 8) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsEconomyRate == 0) {\n $this->IsEconomyRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'EconomyRate7.01N10.00Balls':\n if ($Overs >= $MinimumOverEconomyRate) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 7.01 && $ScoreValue <= 10) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsEconomyRate == 0) {\n $this->IsEconomyRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'EconomyRate8.01N10.00Balls':\n if ($Overs >= $MinimumOverEconomyRate) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 8.01 && $ScoreValue <= 10) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsEconomyRate == 0) {\n $this->IsEconomyRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'EconomyRate10.01N12.00Balls':\n if ($Overs >= $MinimumOverEconomyRate) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 10.01 && $ScoreValue <= 12) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsEconomyRate == 0) {\n $this->IsEconomyRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'EconomyRateAbove12.1Balls':\n if ($Overs >= $MinimumOverEconomyRate) {\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 12.1) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsEconomyRate == 0) {\n $this->IsEconomyRate = 1;\n return $PlayerPoints;\n }\n } else {\n $PlayerPoints['CalculatedPoints'] = 0;\n }\n break;\n case 'For30runs':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 30 && $ScoreValue < 50) ? strval($Points[$MatchTypeField]) : \"0\";\n $this->defaultBattingPoints = $PlayerPoints;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBattingState == 0) {\n $this->IsBattingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'For50runs':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 50 && $ScoreValue < 100) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBattingState == 0) {\n $this->IsBattingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'For100runs':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 100 && $ScoreValue < 150) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBattingState == 0) {\n $this->IsBattingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'For150runs':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 150 && $ScoreValue < 200) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBattingState == 0) {\n $this->IsBattingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'For200runs':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 200 && $ScoreValue < 300) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBattingState == 0) {\n $this->IsBattingState = 1;\n return $PlayerPoints;\n }\n break;\n case 'For300runs':\n $PlayerPoints['CalculatedPoints'] = ($ScoreValue >= 300) ? $Points[$MatchTypeField] : 0;\n if ($PlayerPoints['CalculatedPoints'] != 0 && $this->IsBattingState == 0) {\n $this->IsBattingState = 1;\n return $PlayerPoints;\n }\n break;\n default:\n return false;\n break;\n }\n }", "public function getPlayerAverages() : array\n {\n $average['shooting'] = 0;\n $average['skating'] = 0;\n $average['checking'] = 0;\n foreach ($this->players as $player) {\n $average['shooting'] += $player->shooting;\n $average['skating'] += $player->skating;\n $average['checking'] += $player->checking;\n }\n // Checks if zero players are on a squad to prevent division by zero\n if (count($this->players) !== 0) {\n $average['shooting'] = (int) ($average['shooting'] / count($this->players));\n $average['skating'] = (int) ($average['skating'] / count($this->players));\n $average['checking'] = (int) ($average['checking'] / count($this->players));\n }\n return $average;\n }", "private function calculateProbabilityOfWinning(Player $playerOne, Player $playerTwo): float\n {\n $playerOneTransformedRating = $this->getTransformedRating($playerOne);\n $playerTwoTransformedRating = $this->getTransformedRating($playerTwo);\n\n return $playerOneTransformedRating / ($playerOneTransformedRating + $playerTwoTransformedRating);\n }", "public function updateAvailability(Player $player)\n {\n if ($player->getOpponent()) {\n $game = $player->getGame();\n $game->manipulateAvailable(false);\n $this->em->persist($game);\n $this->em->flush();\n }\n }", "function calcLTV() {\n try {\n $results = $db->query(\"SELECT * FROM borrower_tbl WHERE id='\" . $borrowerId . \"';\" );\n } catch (Exception $e) {\n echo \"Could not connect to database!: \" . $e->getMessage();\n exit;\n }\n $borrower = $results->fetchAll(PDO::FETCH_ASSOC);\n \n }", "public function drainPerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDrain = $this->amount() * $this->drain();\r\n\t\t\treturn ($fullDrain / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "public function totalPeopleUnderControl()\n {\n if (!$this->getStatus()->isFree()) {\n return 0;\n } elseif (0 == $this->peopleUnderControl->length()) {\n return 0;\n } else {\n $peopleUnderControl = $this->peopleUnderControl->length();\n foreach ($this->peopleUnderControl->keys() as $key) {\n $memberActual = $this->peopleUnderControl->getMember($key);\n\n $peopleUnderControl += $memberActual->totalPeopleUnderControl();\n }\n return $peopleUnderControl;\n }\n }", "private function calculateGameResult(array $formData)\n {\n $playerIds = [];\n $winners = [];\n $losers = [];\n $points = $formData['points'];\n\n // double the points if Bock round\n if ($formData['bockRound']) {\n $points *= 2;\n }\n\n // separate the four players into winners and losers\n for ($i = 1; $i <= 4; ++$i) {\n $playerId = (int) $formData['player' . $i];\n if (in_array($playerId, $playerIds, true)) {\n // if one player is selected twice, throw error\n return -3;\n }\n $playerIds[] = $playerId;\n\n if ($formData['player' . $i . 'win']) {\n $winners[] = ['playerId' => $playerId, 'points' => $points];\n } else {\n $losers[] = ['playerId' => $formData['player' . $i], 'points' => $points * -1];\n }\n }\n\n if (count($winners) === 0) {\n // there is no winner selected\n return -1;\n }\n\n if (count($winners) === 1) {\n // there is only one winner, so he/she gets more points\n $winners[0]['points'] *= 3;\n\n return array_merge($winners, $losers);\n }\n\n if (count($winners) === 2) {\n return array_merge($winners, $losers);\n }\n\n if (count($winners) === 3) {\n // there is only one loser, so he/she loses more points\n $losers[0]['points'] *= 3;\n\n return array_merge($winners, $losers);\n }\n\n // all four players can not be winners\n return -2;\n }", "public function bookingAmount() {\n\t\t\t\n\t\t\t$baseAmount = $this->apartment_price_per_night;\n\t\t\tforeach ($this->bookedServices()->get() as $upgrade) {\n\t\t\t\t$baseAmount += $upgrade->price_per_night == 0 ? 0 : $upgrade->price_per_night;\n\t\t\t}\n\t\t\treturn $baseAmount * $this->check_out->diffInDays($this->check_in);\n\t\t}", "function count_votes($i_intAlliance)\n{\n $strSQL = \"SELECT COUNT(id) AS playercount \" .\n \" FROM stats \" .\n \" WHERE kingdom = '$i_intAlliance' \" .\n \" AND vote != 0\";\n\n $result = mysql_query ($strSQL) or die(\"include_vote_text3:\" . mysql_error());\n\n $intPlayerCount = 100; // fail-safe number, if we don't get the no. of the tribes\n\n if (mysql_num_rows($result) == 1)\n {\n $intPlayerCount = mysql_result ($result, 0, \"playercount\");\n }\n\n // this is a such a cool query. in 1 query I find the person with the max\n // votes in an alliance\n $strSQL = \"SELECT vote, COUNT(vote) AS votecount \" .\n \" FROM stats \" .\n \" WHERE kingdom = $i_intAlliance \" .\n \" AND vote > 0 \" .\n \" GROUP BY vote\" .\n \" ORDER BY votecount DESC, id ASC \" .\n \" LIMIT 1\";\n\n $result = mysql_query ($strSQL) or die(\"include_vote_text4:\" . mysql_error());\n\n if (mysql_num_rows($result) == 1)\n {\n $intNewElder = mysql_result ($result, 0, \"vote\");\n $intVoteCount = mysql_result ($result, 0, \"votecount\");\n\n // set the current elder to a player\n $strSQL = \"UPDATE stats \" .\n \" SET type = 'player' \" .\n \" WHERE kingdom = '$i_intAlliance' \" .\n \" AND type = 'elder'\";\n $result = mysql_query ($strSQL) or die(\"include_vote_text5:\" . mysql_error());\n $strSQL = \"UPDATE rankings_personal \" .\n \" SET player_type = 'player' \" .\n \" WHERE alli_id = '$i_intAlliance' \" .\n \" AND player_type = 'elder'\";\n $result = mysql_query ($strSQL) or die(\"include_vote_text_rank:\" . mysql_error());\n\n // set the new elder\n if ($intVoteCount > floor((double) $intPlayerCount * 0.6))\n {\n $strSQL = \"UPDATE stats \" .\n \" SET type = 'elder' \" .\n \" WHERE id = '$intNewElder' \";\n $result = mysql_query ($strSQL) or die(\"include_vote_text6:\" . mysql_error());\n $strSQL = \"UPDATE rankings_personal \" .\n \" SET player_type = 'elder' \" .\n \" WHERE id = '$intNewElder' \";\n $result = mysql_query ($strSQL) or die(\"include_vote_text_ranking:\" . mysql_error());\n }\n }\n else\n {\n // set the current elder to a player\n $strSQL = \"UPDATE stats \" .\n \" SET type = 'player' \" .\n \" WHERE kingdom = '$i_intAlliance' \" .\n \" AND type = 'elder'\";\n $result = mysql_query ($strSQL) or die(\"include_vote_text:\" . mysql_error());\n $strSQL = \"UPDATE rankings_personal \" .\n \" SET player_type = 'player' \" .\n \" WHERE alli_id = '$i_intAlliance' \" .\n \" AND player_type = 'elder'\";\n $result = mysql_query ($strSQL) or die(\"include_vote_text_rank:\" . mysql_error());\n\n // set the current co-elders to players\n unset_coelders($i_intAlliance);\n }\n}", "public function getAwardedBountyAmount();", "function updateScore(Player $player, int $points)\n{\n $score = $player->getScore();\n $player->setScore($score + $points);\n}", "public function calcRating(){\n //opponents winning percentage\n $owp = 0.0;\n //oppponents opponents winning percentage\n $oowp = 0.0;\n //total number of opponents opponents\n $numOfOppOpps = 0;\n \n for($i=0; $i<$this->numOfOpponents; $i++){\n $opp = $this->teamsPlayed[$i];\n $owp += $opp->getWP();\n for($j=0; $j<$opp->numOfOpponents; $j++){\n \t$oppOpp = $opp->getOpponentByIndex($j);\n \t$oowp += $oppOpp->getWP();\n \t$numOfOppOpps++;\n } \n }\n if($owp == 0 || $this->numOfOpponents == 0){\n $owp = 0;\n } else {\n $owp = $owp/$this->numOfOpponents;\n }\n if($oowp == 0 || $numOfOppOpps == 0){\n $oowp == 0;\n } else {\n $oowp = $oowp/$numOfOppOpps;\n }\n $this->rating = ($this->getWP() *0.25) +\n \t\t ($owp * 0.50) +\n \t\t ($oowp *0.25);\n }", "function killpointsFromDueling() {\n\tglobal $target_level,$attacker_level,$starting_target_health,$killpoints,$duel;\n\n\t$levelDifference = ($target_level-$attacker_level);\n\n\tif ($levelDifference > 10) {\n\t\t$levelDifferenceMultiplier = 5;\n\t} else if ($levelDifference > 0) {\n\t\t$levelDifferenceMultiplier = ceil($levelDifference/2); //killpoint return of half the level difference.\n\t} else {\n\t\t$levelDifferenceMultiplier = 0;\n\t}\n\n\t$killpoints = 1+$levelDifferenceMultiplier;\n}", "function chcekTheWinner($dom, $owner){\n $instance = DbConnector::getInstance();\n $playersList = handEvaluator();\n usort($playersList, array(\"Player\", \"cmp\")); \n $i = 0;\n echo \"<div id=\\\"summary\\\"><div>--- Summary ---</div>\";\n echo \"<table border=\\\"1\\\" BORDERCOLOR=RED style=\\\"width:100%\\\"><tr><th>Player</th><th>Score</th><th>Hand</th><th>Cards</th></tr>\";\n foreach($playersList as $player){ \n if($i === 0){\n $sql = \"SELECT `TotalMoneyOnTable`, `Transfer` FROM `TableCreatedBy_\" . $owner . \"` where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n while ($row = mysql_fetch_row($retval)) {\n $value = $row[0];\n $flag = $row[1];\n }\n if($flag == 0){ //transfer money to accunt\n $sql = \"UPDATE `TableCreatedBy_\" . $owner . \"` SET `Money` = `Money` + \".$value.\", `Transfer`=1 where `user`='\" . $player->player . \"';\"; \n $retval = $instance->sendRequest($sql);\n }\n echo \"<td>\" . $player->player . \" won \".$value.\"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }else{\n echo \"<td>\" . $player->player . \"</td><td>\". $player->cardsValue . \"</td><td>\" . $player->handValue . \"</td><td>\" . $player->hand . \"</td></tr>\";\n }\n $i++;\n }\n echo \"</table></div>\";\n}", "public function calculateTotalBreakfast()\n\t{\n\t\t$result = 0;\n\t\t$passengers = $this->getPassengers();\n\n\t\tif( count($passengers) )\n\t\t{\n\t\t\tforeach ($passengers as $passenger)\n\t\t\t{\n\t\t\t\tif( (int)$passenger->status < 3 )\n\t\t\t\t{\n\t\t\t\t\tif($passenger->breakfast)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getPot($game_id)\n {\n return DB::table('players')->where(['game_id' => $game_id])->sum('bid');\n }", "public function getAllInBetSize(): float\n\t{\n\t\t//No more betting\n\t\tif(!$this->streetsLeft)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\t//Get the minimum SPR\n\t\t$minSPR = min(\n\t\t\t$this->getSPRForPlayer(0),\n\t\t\t$this->getSPRForPlayer(1)\n\t\t);\n\n\t\t//Get the number of players\n\t\t$numPlayers = count($this->players);\n\n\t\treturn (pow(($numPlayers * $minSPR + 1), 0.33) - 1) / $numPlayers;\n\t}", "protected function handle_betting($is_archived)\n\t{\n if ($this->old_result == self::NO_RESULT and $this->new_result != self::NO_RESULT)\n {\n $is_archived = 1;\n\n foreach (DB::table('bets')->where('match_id', '=', $this->match_id)->where('bet', '=', $this->new_result)\n ->get(array('user_id', 'used_points', 'id')) as $bet)\n {\n $points = $this->calculate_points($bet->used_points);\n\n DB::table('bets')->where('id', '=', $bet->id)->update(array(\n 'acquired_points' => $points\n ));\n\n DB::table('profiles')->where('user_id', '=', $bet->user_id)->update(array(\n 'bet_points' => DB::raw('bet_points + '.$points)\n ));\n }\n\n DB::table('bets')->where('match_id', '=', $this->match_id)->where('bet', '<>', $this->new_result)->update(array('acquired_points' => 0));\n }\n // Queries: 2 + X where X is number of players which won anything\n elseif ($this->old_result != self::NO_RESULT and $this->new_result == self::NO_RESULT)\n {\n $is_archived = 0;\n\n foreach (DB::table('bets')->where('bets.match_id', '=', $this->match_id)->where('acquired_points', '<>', 0)\n ->join('profiles', 'profiles.user_id', '=', 'bets.user_id')\n ->get(array('bets.user_id', 'bets.acquired_points', 'bets.id', 'profiles.bet_points')) as $bet)\n {\n $p = ($bet->bet_points - $bet->acquired_points);\n if ($p < 0)\n $p = 0;\n\n DB::table('profiles')->where('user_id', '=', $bet->user_id)\n ->update(array('bet_points' => $p));\n }\n\n DB::table('bets')->where('match_id', '=', $this->match_id)->update(array(\n 'acquired_points' => 0\n ));\n }\n // Queries: 2 + X*2 + Y where X is the number of players that are now the winning ones and Y are losing ones which previously were the winners\n elseif (($this->old_result != self::NO_RESULT and $this->new_result != self::NO_RESULT) and $this->old_result != $this->new_result)\n {\n foreach (DB::table('bets')->where('bets.match_id', '=', $this->match_id)\n ->join('profiles', 'profiles.user_id', '=', 'bets.user_id')\n ->get(array('bets.user_id', 'bets.used_points', 'bets.id', 'bets.bet', 'bets.acquired_points', 'profiles.bet_points')) as $bet)\n {\n if ($bet->bet == $this->old_result)\n {\n $p = ($bet->bet_points - $bet->acquired_points);\n if ($p < 0)\n $p = 0;\n\n DB::table('profiles')->where('user_id', '=', $bet->user_id)\n ->update(array('bet_points' => $p));\n }\n elseif ($bet->bet == $this->new_result)\n {\n \t$points = $this->calculate_points($bet->used_points);\n\n DB::table('bets')->where('id', '=', $bet->id)->update(array(\n 'acquired_points' => $points\n ));\n\n DB::table('profiles')->where('user_id', '=', $bet->user_id)->update(array(\n 'bet_points' => DB::raw('bet_points + '.$points)\n ));\n }\n }\n\n DB::table('bets')->where('match_id', '=', $this->match_id)->where('bet', '=', $this->old_result)->update(array(\n 'acquired_points' => 0\n ));\n }\n\n return $is_archived;\n\t}", "public function isHoldable(): bool\n {\n return $this->holdable;\n }", "protected function calculatePeriods()\n {\n foreach ($this->periods as $period) {\n if ($this->isPeriodAssociatedToBooking($period)) {\n // If this period was already associated to the booking, then we will\n // have to use the pricing at the point when the booking was created\n // for the calculation.\n\n $total = $this->getBookingPeriodPricing($period) * $this->quantity;\n }\n else {\n // If it isn't we will use the period's latest pricing.\n\n $total = $period->pivot->unit_price * $this->quantity;\n }\n\n $this->periodsTotal += $total;\n\n $this->addCalculatedPeriod($period, $total);\n }\n }", "public function calculatePlayerForm(){\n ini_set('max_execution_time',300000);\n Service::loadModels('car', 'car');\n Service::loadModels('people', 'people');\n Service::loadModels('user', 'user');\n Service::loadModels('rally', 'rally');\n Service::loadModels('league', 'league');\n $teamService = parent::getService('team','team');\n $peopleService = parent::getService('people','people');\n $rallyService = parent::getService('rally','rally');\n \n // get all player rallies from last 4 weeks\n $playerRallies = $peopleService->getLastMonthPlayersRallies(Doctrine_Core::HYDRATE_ARRAY);\n \n // calculate actual form\n $playerFormCalculatedData = $peopleService->preparePlayerRalliesWeekly($playerRallies);\n \n // get player ids which are already calculated\n // this allows to get all players which has not raced within last month and set their form to 0\n $playerIds = $playerFormCalculatedData['playerIds'];\n \n $teamOrder = array();\n foreach($playerFormCalculatedData['playerList'] as $player_id => $playerRow):\n $newForm = $playerRow['form'];\n $player = $peopleService->getPerson($player_id);\n $player->set('form',$newForm);\n $player->save();\n endforeach;\n \n $noRalliesPlayers = $peopleService->getPlayersNoLastMonthRallies($playerIds);\n foreach($noRalliesPlayers as $player):\n $newForm = 0;\n $player->set('form',$newForm);\n $player->save();\n endforeach;\n echo \"done\";\n exit;\n \n }", "private function getWinningBids()\n {\n //if the number of bids is less than max they're all winners\n if ($this->numBids < $this->maxNumber) {\n return $this->bids;\n } else {\n return array_slice($this->bids,0,$this->maxNumber);\n }\n }", "function echoPlayer(&$player, $name) {\n\t$total = getTotal($player);\n\tforeach ($player as $card) {\n\t\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n}", "function get_hold($game_id)\n {\n $this->db->join('card_types', 'card_types.type_id=cards.type_id');\n $this->db->where('game_id', $game_id);\n $this->db->where('being_played', true);\n $this->db->limit(1);\n return $this->db->get($this->table)->row();\n }", "function healingShop() {\n\tglobal $system;\n\tglobal $player;\n\tglobal $self_link;\n\n\n\t$rankManager = new RankManager($system);\n\t$rankManager->loadRanks();\n\n\t$health[1] = $rankManager->healthForRankAndLevel(1, $rankManager->ranks[1]->max_level);\n\t$health[2] = $rankManager->healthForRankAndLevel(2, $rankManager->ranks[2]->max_level);\n\t$health[3] = $rankManager->healthForRankAndLevel(3, $rankManager->ranks[3]->max_level);\n\t$health[4] = $rankManager->healthForRankAndLevel(4, $rankManager->ranks[4]->max_level);\n\t// $health[5] = $rankManager->healthForRankAndLevel(5, $rankManager->ranks[5]->max_level);\n\n\t$healing['vegetable']['cost'] = $player->rank * 5;\n\t$healing['vegetable']['amount'] = $health[$player->rank] * 0.1;\n\n\t$healing['pork']['cost'] = $player->rank * 20;\n\t$healing['pork']['amount'] = $health[$player->rank] * 0.4;\n\n\t$healing['deluxe']['cost'] = $player->rank * 40;\n\t$healing['deluxe']['amount'] = $health[$player->rank] * 0.8;\n\n\tif(isset($_GET['heal'])) {\n\t\ttry {\n\t\t\t$heal = $system->clean($_GET['heal']);\n\t\t\tif(!isset($healing[$heal])) {\n\t\t\t\tthrow new Exception(\"Invalid choice!\");\n\t\t\t}\n\t\t\tif($player->money < $healing[$heal]['cost']) {\n\t\t\t\tthrow new Exception(\"You do not have enough money!\");\n\t\t\t}\n \tif($player->health >= $player->max_health) {\n\t\t\t\tthrow new Exception(\"Your health is already maxed out!\");\n\t\t\t}\n\t\t\t$player->money -= $healing[$heal]['cost'];\n\t\t\t$player->health += $healing[$heal]['amount'];\n\t\t\tif($player->health > $player->max_health) {\n\t\t\t\t$player->health = $player->max_health;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$system->message($e->getMessage());\n\t\t\t$system->printMessage();\n\t\t}\n\t}\n\techo \"<table class='table'><tr><th>Ichikawa Ramen</th></tr>\n\t<tr><td style='text-align:center;'>\n\tWelcome to Ichikawa Ramen. Our nutritious ramen is just the thing your body needs to recover after a long day of training or fighting.\n\tOur prices are below.<br />\n\t<br />\n\t<label style='width:9em;font-weight:bold;'>Your Money:</label> \n\t\t&yen;{$player->money}<br />\n\t<label style='width:9em;font-weight:bold;'>Health:</label>\" . \n\t\t\tsprintf(\"%.2f\", $player->health) . '/' . sprintf(\"%.2f\", $player->max_health) . \n\t\"</td></tr>\";\n\techo \"<tr><td style='text-align:center;'>\";\n\tforeach($healing as $level=>$heal) {\n\t\techo \"<a href='$self_link&heal={$level}'><span class='button' style='width:10em;'>\" . ucwords($level) . \" ramen</span></a>\n\t\t\t&nbsp;&nbsp;&nbsp;({$heal['amount']} health, -&yen;{$heal['cost']}) <br />\";\n\t}\n\techo \"</td></tr></table>\";\n}", "function awardForCapture($specsOwned, $mugsOwned, $sausageRollsOwned)\n{\n $award = 10 * (($specsOwned * $mugsOwned * $sausageRollsOwned)/2);\n return $award;\n}", "public function update_variables(){\n\n // Calculate this battle's count variables\n $perside_max = 0;\n if (!empty($this->values['players'])){\n foreach ($this->values['players'] AS $id => $player){\n $max = $player['counters']['robots_total'];\n if ($max > $perside_max){ $perside_max = $max; }\n }\n }\n $this->counters['robots_perside_max'] = $perside_max;\n\n // Define whether we're allowed to use experience or not\n $this->flags['allow_experience_points'] = true;\n if (!empty($this->flags['player_battle'])\n || !empty($this->flags['challenge_battle'])){\n $this->flags['allow_experience_points'] = false;\n }\n\n // Return true on success\n return true;\n\n }", "public function on_purchase( &$player )\n\t{\n\t\t$cards_in_booster = range( 1, 18, 1 );\n\t\t\n\t\t// and a random assortment of 12 cards from the remaining 24\n\t\t$remaining_cards = range( 19, 42, 1 );\n\t\t\n\t\tshuffle( $remaining_cards );\n\t\t\n\t\t// pick some random from the ones remaining\n\t\tfor( $i = 0; $i < 12; $i++ )\n\t\t{\n\t\t\t$cards_in_booster[] = array_pop( $remaining_cards );\n\t\t}\n\t\t\n\t\t// add the cards to the player\n\t\t$player->add_cards( $cards_in_booster );\n\t\t\n\t\t// return some JSON containing what the player got\n\t\t// Need to go from the IDs we're using internally to some\n\t\t// JSON the client(s) can use to display the results nicely\n\t\t\n\t\t$card_rows = DB::table(CARDS)\n\t\t\t->where_in( 'id', $cards_in_booster )\n\t\t\t->get();\n\t\t\n\t\t$results = array();\n\t\t\t\n\t\tforeach( $card_rows as $card_row )\n\t\t{\n\t\t\t$results[] = array(\n\t\t\t\t'type' => 'card',\n\t\t\t\t'id' => $card_row->id,\n\t\t\t\t'name' => $card_row->name,\n\t\t\t\t'image' => $card_row->image,\n\t\t\t\t'description' => $card_row->description );\n \t\t}\n\t\t\n \t\t// If the player doesn't have any decks, create them a deck named 'Starter Deck'\n \t\t// and add these cards into it\n \t\t\n \t\t$player_decks = DB::table(DECKS)\n \t\t\t->where( 'player_id', '=', $player->id )\n \t\t\t->get();\n \t\t\t\n \t\tif( empty( $player_decks ) )\n \t\t{\n \t\t\t$deck = new Deck();\n \t\t\t$deck->name = 'Starter Deck';\n \t\t\t$deck->player_id = $player->id;\n \t\t\t$deck->save();\n \t\t\t\n \t\t\tforeach( $cards_in_booster as $card_id )\n \t\t\t{\n \t\t\t\tDB::table(DECKS_X_CARDS)\n \t\t\t\t\t->insert( array( 'deck_id' => $deck->id, 'card_id' => $card_id ) );\n \t\t\t}\n \t\t}\n \t\t\n\t\treturn $results;\n\t}", "function getRemainingMatches($player, $matches) {\n\t$remaining = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($value['Status'] != 'Complete' && $value['MatchType'] == 'League') {\n\t\t\t$remaining++;\n\t\t}\n\t}\n\treturn $remaining;\n}", "private function checkIfPlayerHasWon()\n {\n $totalResult = $this->score + $this->savedScore;\n if ($totalResult >= self::POINTS_AT_WIN) {\n $this->playerMessage = 'GRATTIS, du har VUNNIT. Du har ett hundra poäng eller mer!';\n $this->hasWon = true;\n }\n }", "public function acceptPlayerBet(Player $player, HandBetPair $hand, $amount);", "public function getPotentialOpponents() {\n\t\t\n\t\t$userID = $this->id;\n\t\t$level = $this->level;\n\t\t$agencySize = $this->agency_size;\n\t\t$minHealth = 25;\n\t\t\t\t\n\t\t// get up to 10 people to list on the attack list\n\t\t$attackListSize = 15;\n\t\t\n\t\t$maxAgencySize = $agencySize + 5;\n\t\t$minAgencySize = max(array(1, $agencySize - 5));\n\t\t\n\t\t// temporary solution for level range\n\t\t$minLevel = $level - 5 .'<br />';\n\t\t$maxLevel = $level + 5 .'<br />';\n\t\t\n/*\t\t$query = \"SELECT * FROM users,agencies WHERE (users.level <= ? AND users.level >= ? OR users.agency_size <= ? AND users.agency_size >= ?) AND (users.health > $minHealth AND users.level>3) AND (users.id != agencies.user_one_id AND users.id != agencies.user_two_id AND agencies.accepted =1) AND users.id != ? GROUP BY users.id ORDER BY RAND() LIMIT $attackListSize\";*/\n\n\t\t/*$query = \"SELECT * FROM users,agencies WHERE (users.level <= ? AND users.level >= ? OR users.agency_size <= ? AND users.agency_size >= ?) AND (users.health > $minHealth AND users.level>3) AND (users.id NOT IN (SELECT agencies.user_one_id FROM agencies WHERE agencies.user_two_id = $userID AND agencies.accepted =1)) AND (users.id NOT IN (SELECT agencies.user_two_id FROM agencies WHERE agencies.user_one_id = $userID AND agencies.accepted =1)) AND users.id != $userID GROUP BY users.id ORDER BY users.id LIMIT $attackListSize\";*/\n\t\t\n\t\t\n\t\t $query = \"SELECT * FROM users WHERE (users.level <= ? AND users.level >= ?) AND users.id != $userID GROUP BY users.id ORDER BY users.id LIMIT $attackListSize\";\n\t\t\n\t\t$objAllPotOpps = ConnectionFactory::SelectRowsAsClasses($query, array($maxLevel, $minLevel), __CLASS__);\n\t\t\t\t\n\t\tif (!$objAllPotOpps || count($objAllPotOpps) < $attackListSize) {\n\t\t\t// TODO: execute further queries with higher level or agency size ranges if too few users\n\t\t\t//the next lines is temp solution if there is 1<x<attacklistsize opponents\n\t\t\tif ($objAllPotOpps) return $objAllPotOpps;\n\t\t\telse return array();\n\t\t}\n\n\t\t// get random indices\n\t\t$randomIntegers = getRandomIntegers($attackListSize, count($objAllPotOpps));\n\t\t\n\t\t$opponents = array();\n\t\tforeach ($randomIntegers as $key=>$value) {\n\t\t\tarray_push($opponents, $objAllPotOpps[$key]);\n\t\t}\n\t\treturn $opponents;\n\t}", "public function getPaymentHoldStatus()\n {\n return $this->payment_hold_status;\n }", "function getWinRatio($player, $matches) {\n\t$matchesPlayed = 0;\n\t$matchesWon = 0;\n\tforeach ($matches as $key => $value) {\n\t\tif ($value['ChallengerID'] == $player || $value['DefenderID'] == $player) {\n\t\t\t$matchesPlayed++;\n\t\t\tif ($value['ChallengerID'] == $player && $value['ChallengerScore'] > $value['DefenderScore'] || $value['DefenderID'] == $player && $value['ChallengerScore'] < $value['DefenderScore']) {\n\t\t\t\t$matchesWon++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $matchesWon / $matchesPlayed;\n}", "function SDpoints ( $games, $username, $threshold = NULL ) {\n\t//Output: Points - a score of how suspicious a player is.\n\n\tglobal $SAMPLE_SIZE;\n\tglobal $POINTS_TOTAL, $SD_CONST_MIN_MOVES;\n\n\tif ( $threshold == NULL ) {\n\t\t$threshold = $SD_CONST_MIN_MOVES;\n\t}\n\n\t$gamesWithData = 0;\n\t$unscaledPoints = 0;\n\n\t//For all of the games\n\tforeach( $games as $game ) {\n\n\t\t//Determine if the game has the required data\n\t\tif( isset( $game['players']['white']['userId'] ) && isset( $game['players']['black']['userId'] ) ) {\n\n\t\t\t//-----Determine What side the player is-----\n\t\t\tif( $game['players']['white']['userId'] == $username ) {\n\t\t\t\t//player is white\n\t\t\t\t$moves = $game['players']['white']['moveTimes'];\n\t\t\t} else {\n\t\t\t\t//player is black\n\t\t\t\t$moves = $game['players']['black']['moveTimes'];\n\t\t\t}\n\n\t\t\t//-----Add to unscaled points for move times\n\t\t\tif( count($moves) > $threshold ) {\n\t\t\t\t$gamesWithData++;\n\t\t\t\t$unscaledPoints += SDpointsForGame( $moves );\n\t\t\t}\n\t\t}\n\t}\n\treturn scalePoints( $POINTS_TOTAL['SD'], $gamesWithData, $unscaledPoints );\n}", "public function remainingKnights()\n {\n return array_diff($this->guestList, $this->seated);\n }", "public function percentKnockedOut() : float\n\t{\n\t\treturn $this->percentKnockedOut;\n\t}", "public function beePoints()\n {\n $this->maxPoints = 50;\n $this->hitPoints = 12;\n $this->currentPoints = 50;\n }", "public static function calculateLevelUp(int $points, int $level, ?int &$remaining = null): int {\n\t\t$remaining = $points;\n\t\t$levelled = 0;\n\n\t\twhile($remaining > ($req = self::getRequiredLevelPoints($level + $levelled))) {\n\t\t\t++$levelled;\n\t\t\t$remaining -= $req;\n\t\t}\n\n\t\treturn $levelled;\n\t}", "public function totalPlayerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = true')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }", "function gamePlay($deck, $player, $dealer, $name, $bankroll, $bet) {\n\tif (blackjackCheck($player)) {\n\t\t$bankroll += ($bet * 1.50);\n\t\techo 'Blackjack!! ' . $name . ' wins $' . ($bet * 1.50) . '!' . PHP_EOL;\n\t\techoBankroll($bankroll);\n\t\techo '---------------------------------------------------' . PHP_EOL;\n\t\tplayAgain($name, $bankroll);\n\t} \n\n\t//insurance bet?\n\t$insuranceBet = playerInsurance($name, $dealer, $bet, $bankroll);\n\n\t//split option here\n\tsplitCards($player, $dealer, $name, $insuranceBet, $bankroll, $bet, $deck);\n\n\t//double down option\n\tdoubleDown($name, $deck, $player, $dealer, $insuranceBet, $deck, $bet, $bankroll);\n\n\t//player must select (H)it or (S)tay\n\thitOrStay($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\tplayAgain($name, $bankroll);\n}", "public function withholdTargets()\n\t{\n\t\tif ($this->winnerExists() && !empty($this->winner->getStateData()->withheld_targets))\n\t\t{\n\t\t\tif (empty($this->data->withheld_targets))\n\t\t\t{\n\t\t\t\t$this->data->withheld_targets = array();\n\t\t\t}\n\n\t\t\t$this->data->withheld_targets = array_unique(array_merge($this->data->withheld_targets, $this->winner->getStateData()->withheld_targets));\n\t\t}\n\t}", "protected function getMoneyWorth($dkk = 1)\r\n {\r\n return $dkk / floatval(get_option('fanpoint_options', false)['FP_Worth']);\r\n }", "public function testKeepPlayingLessThanHalfOnDices()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $player -> addPoints(20);\n $this->assertTrue($player -> keepPlaying(17, 100, 6));\n }", "public function releaseRefPointsOnEveryShoping()\n {\n \t//More you pay less you release.\n \t//Get the points for other shops.\n }", "public function get_stats()\n\t{\n\t\tglobal $_game;\n\t\t\n\t\t$expire = time() - 604800; // tell kun spillere som har vært pålogget siste uken\n\t\t$result = \\Kofradia\\DB::get()->query(\"SELECT up_b_id, COUNT(up_id) AS ant, SUM(up_cash) AS money FROM users_players WHERE up_access_level != 0 AND up_access_level < {$_game['access_noplay']} AND up_last_online > $expire GROUP BY up_b_id\");\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (!isset($this->bydeler[$row['up_b_id']])) continue;\n\t\t\t\n\t\t\t$this->bydeler[$row['up_b_id']]['num_players'] = $row['ant'];\n\t\t\t$this->bydeler[$row['up_b_id']]['sum_money'] = $row['money'];\n\t\t}\n\t}", "public function updated(HoldAmount $holdAmount)\n {\n //\n }", "private function updateLooser($parameters)\n\t{\n\n\t\t// for each player\n\t\tforeach ($this->results as $player => $result)\n\t\t{\n\n\t\t\t/*\n\t\t\t * if the looser exists in the list of the winners over the current\n\t\t\t * player\n\t\t\t */\n\t\t\tif (isset($result['winners'][$parameters['looser']]))\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * update the list of the looser in the winners' list of the\n\t\t\t\t * current player with the list of the looser\n\t\t\t\t */\n\t\t\t\t$this->results[$player]['winners'][$parameters['looser']] =\n\t\t\t\t\t\t$this->results[$parameters['looser']];\n\t\t\t\t// update loosers of the player\n\t\t\t\t$this->updateLooser(array(\n\t\t\t\t\t'looser' => $player\n\t\t\t\t));\n\t\t\t}\n\n\t\t}\n\n\t}", "function AddPlayer( $player_id )\r\n\t{\r\n\t\t$cur_locked = $this->locked;\r\n\t\t$cur_waste_locked = $this->waste_locked;\r\n \t$cur_lock_waste_stats = $this->lock_waste_stats;\r\n\t\t$this->Lock( true );\r\n\t\t$this->Load( );\r\n\t\tif ( $this->locked )\r\n\t\t{\r\n\t\t\t$this->locked = 1;\r\n\t\t\t$this->Unlock( );\r\n\t\t}\r\n \t$cur_player = new Player( $player_id );\r\n \t$rec_money = $this->start_money;\r\n \tif ( $cur_player->SpendMoney( $rec_money ) )\r\n \t{\r \t$cur_player->AddToLogPost( 0, -$rec_money, 37 );\r\n \t}\r\n \telse\r\n \t{\r \t\treturn false;\r \t}\r\n\r\n\t\t$this->Lock( true );\r\n\t\t$this->Load( );\r\n\r\n\t\t$result = false;\r\n\r\n\t\t$res = f_MQuery( \"SELECT 1 FROM poker_table_players WHERE player_id = '$player_id'\" );\r\n if ( f_MNum( $res ) )\r\n {\r \t$result = false;\r\n }\r\n else\r\n {\r \t$res = f_MQuery( \"SELECT 1 FROM waste_bets WHERE player1_id = '$player_id'\" );\r\n\t if ( f_MNum( $res ) )\r\n\t {\r\n\t \t$result = false;\r\n\t\t\t}\r\n\t else\r\n\t {\r\n\t\t \t for ( $i = 0; $i < SEAT_COUNT; ++ $i )\r\n\t\t {\r\n\t\t if ( !isset( $this->seats[$i] ) )\r\n\t\t {\r\n\t\t \t//Need to take money\r\n\t $this->seats[$i] = $player_id;\r\n\t f_MQuery( \"INSERT INTO waste_bets ( game_id, player1_id ) VALUES( '4', '$player_id' ); \" );\r\n\t f_MQuery( \"INSERT INTO poker_table_players ( table_id, player_id, seat, money ) VALUES ( '{$this->table_id}', '$player_id', '$i', '{$this->start_money}' );\" );\r\n\t $tm = time( );\r\n\t f_MQuery( \"INSERT INTO poker_join_history ( table_id, player_id, seat, start_draw_id, start_time ) VALUES\r\n\t ( '{$this->table_id}', '$player_id', '$i', '{$this->draw_id}', '$tm');\" );\r\n\t $result = true;\r\n\t break;\r\n\t\t }\r\n\t\t }\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( !$cur_locked )\r\n\t\t{\r\t\t\t$this->Unlock( );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\t\t\t$this->locked = $cur_locked;\r\t\t}\r\n\r\n\t\tif ( !$result )\r\n\t\t{\r\n\t\t\tif ( $this->locked )\r\n\t\t\t{\r\t\t\t\t$this->locked = 1;\r\n\t\t\t\t$this->Unlock( );\r\t\t\t}\r\n\t\t\t$cur_player->AddMoney( $rec_money );\r\n\t\t\t$cur_player->AddToLogPost( 0, $rec_money, 37 );\r\n\t\t\tif ( $cur_locked )\r\n\t\t\t{\r\t\t\t\t$this->Lock( $cur_waste_locked, $cur_lock_waste_stats );\r\n\t\t\t\t$this->locked = $cur_locked;\r\t\t\t}\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function getAllAutoRefreshPlayers()\n {\n return Player::whereHas('dataPoints')->get();\n }", "public function getGoalStatisticsForPlayer(User $player) {\n $qT1 = $this\n ->createQueryBuilder('r')\n ->add('select', 'SUM(r.team1Score) as scored, SUM(r.team2Score) as conceded')\n ->add('from', 'FoosLeaderCoreBundle:Result r')\n ->add('where', '((r.player1 = :user OR r.player3 = :user) AND r.team1Confirmed = true AND r.team2Confirmed = true)')\n ->setParameter('user', $player)\n ->getQuery();\n $qT2 = $this\n ->createQueryBuilder('r')\n ->add('select', 'SUM(r.team2Score) as scored, SUM(r.team1Score) as conceded')\n ->add('from', 'FoosLeaderCoreBundle:Result r')\n ->add('where', '((r.player2 = :user OR r.player4 = :user) AND r.team1Confirmed = true AND r.team2Confirmed = true)')\n ->setParameter('user', $player)\n ->getQuery();\n\n $resultT1 = $qT1->getResult();\n $resultT2 = $qT2->getResult();\n\n if ((is_array($resultT1) && count($resultT1) === 0) || (is_array($resultT2) && count($resultT2) === 0)) {\n return null;\n } else {\n $statistics = new PlayerGoalStatistics(\n $player,\n ($resultT1[0]['scored'] + $resultT2[0]['scored']),\n ($resultT1[0]['conceded'] + $resultT2[0]['conceded'])\n );\n return $statistics;\n }\n }", "function getPlayerEquity($player)\n {\n $queryString = \"SELECT transactions.*, stocks.Value AS customValue FROM transactions JOIN stocks ON stocks.Code = transactions.Stock WHERE Player='\" . $player . \"'\";\n $activity = $this->db->query($queryString);\n\n $stockArray = array();\n foreach ($activity->result() as $thisStock) {\n if (!isset($stockArray[$thisStock->Stock])) {\n $stockArray[$thisStock->Stock] = 0;\n }\n if ($thisStock->Trans == 'sell') {\n $stockArray[$thisStock->Stock] -= $thisStock->Quantity * $thisStock->customValue;\n } else if ($thisStock->Trans == 'buy') {\n $stockArray[$thisStock->Stock] += $thisStock->Quantity * $thisStock->customValue;\n }\n }\n $equity = 0;\n foreach ($stockArray as $thisStock) {\n $equity += $thisStock;\n }\n return $equity;\n }", "public function getWins()\n {\n return $this->wins;\n }", "private function _getHof($action = null, $limit = null) {\n $connection = Phalcon_Db_Pool::getConnection();\n $sql = 'SELECT COUNT(a.id) AS total, p.name AS playerName, a.award '\n . 'FROM awards a '\n . 'INNER JOIN players p ON a.playerId = p.id '\n . 'WHERE a.award = %s ';\n\n if (!empty($action)) {\n $sql .= 'AND a.userId = ' . (int)$action . ' ';\n }\n\n $sql .= 'GROUP BY a.award, a.playerId '\n . 'ORDER BY a.award ASC, total DESC, p.name ';\n\n if (!empty($limit)) {\n $sql .= 'LIMIT ' . (int)$limit;\n }\n\n // Kicks\n $query = sprintf($sql, -1);\n $result = $connection->query($query);\n $result->setFetchMode(Phalcon_Db::DB_ASSOC);\n\n $kicks = array();\n $kicksMax = 0;\n\n while ($item = $result->fetchArray()) {\n $kicksMax = (0 == $kicksMax) ? $item['total'] : $kicksMax;\n $name = $item['playerName'];\n $kicks[] = array(\n 'total' => (int)$item['total'],\n 'name' => $name,\n 'percent' => (int)($item['total'] * 100 / $kicksMax),\n );\n }\n\n // Game balls\n $query = sprintf($sql, 1);\n $result = $connection->query($query);\n $result->setFetchMode(Phalcon_Db::DB_ASSOC);\n\n $gameballs = array();\n $gameballsMax = 0;\n\n while ($item = $result->fetchArray()) {\n $gameballsMax = (0 == $gameballsMax) ?\n $item['total'] :\n $gameballsMax;\n $name = $item['playerName'];\n $gameballs[] = array(\n 'total' => (int)$item['total'],\n 'name' => $name,\n 'percent' => (int)($item['total'] * 100 / $gameballsMax),\n );\n }\n\n $result = array('gameballs' => $gameballs, 'kicks' => $kicks);\n\n return json_encode($result);\n }", "function calcPoints() {\n\tglobal $payback_config;\n $this->shop->basket();\n $amount=$this->shop->basket->amount(); \n $points=intval(($amount/100)*$payback_config->points); \n return $points;\n }", "function getSaddleCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"saddle\"] == \"saddle\") {\n\t$saddleLabor = (($quantity/SADDLEPERHOUR) * HOUR);\n\t$saddleCost = ($quantity * STAPLE);\n\t}\nelse {\n\t$saddleLabor = 0;\n\t$saddleCost = 0;\n\t}\n$labor += $saddleLabor;\n$rawCost += $saddleCost;\n}", "function calcCLTV() {\n try {\n $results = $db->query(\"SELECT * FROM borrower_tbl WHERE id='\" . $borrowerId . \"';\" );\n } catch (Exception $e) {\n echo \"Could not connect to database!: \" . $e->getMessage();\n exit;\n }\n $borrower = $results->fetchAll(PDO::FETCH_ASSOC);\n \n }", "public function runGame()\n {\n $currentGame = $this->find('all')->where([\n 'complete' => false\n ])->contain(['Users'])->first();\n\n //get all the plays counts\n $gamesUsersTable = TableRegistry::get('GamesUsers');\n $currentGameCheckedCount = $gamesUsersTable->find();\n $currentGameCheckedCount = $currentGameCheckedCount->select([\n 'count' => $currentGameCheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->first()->count;\n\n $currentGameUncheckedCount = $gamesUsersTable->find();\n $currentGameUncheckedCount = $currentGameUncheckedCount->select([\n 'count' => $currentGameUncheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->first()->count;\n\n $totalPlays = $currentGameCheckedCount + $currentGameUncheckedCount;\n\n //If not enough players, extend the end time and bail;\n if ($totalPlays < 2) {\n $currentGame->end_time = Time::now()->addHour(1);\n $this->save($currentGame);\n return false;\n }\n\n //update current game fields\n $currentGame->total_checked = $currentGameCheckedCount;\n $currentGame->total_plays = $totalPlays;\n $currentGame->ratio = round((float)$currentGameCheckedCount / (float)$totalPlays, 2);\n\n //save game as 'complete'\n $currentGame->complete = true;\n $this->save($currentGame);\n\n //get all the users that played this round\n $usersTable = TableRegistry::get('Users');\n $usersWhoCheckedThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->toArray();\n $currentGameCheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoCheckedThisGameIdArray) ? $usersWhoCheckedThisGameIdArray : [0])\n ]);\n\n $usersWhoDidntCheckThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->toArray();\n $currentGameUncheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoDidntCheckThisGameIdArray) ? $usersWhoDidntCheckThisGameIdArray : [0])\n ]);\n\n\n //update users scores\n foreach ($currentGameCheckedUsers as $user) {\n if ($currentGame->ratio > 0.5) {\n if ($user->score != 0) {\n $user->score = (int)$user->score - 10;\n }\n } else {\n $user->score = (int)$user->score + 10;\n }\n $usersTable->save($user);\n }\n\n //create next incomplete game & save\n $this->createNewGame();\n\n //send notification emails to everybody that gained/lost points\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => true,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameCheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n\n //send email to everybody who played but didn't check\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => false,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameUncheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n }", "public function getTotalSupply()\n {\n //XXX mutable supply\n return 290888;\n }", "public function playerHasWon() {\n foreach ($this->players as $player) {\n if ($player->score >= $this->game->winningScore) {\n return true;\n }\n }\n return false;\n }", "public function getLostPoints() : int {\n\t\treturn $this->lostPoints;\n\t}", "public function gamestateProvider()\n {\n return [\n [\"turnCounter\", 0],\n [\"turnIsOver\", false],\n [\"hasWon\", null],\n [\"currentPoints\", 0]\n ];\n }", "static public function getPlayerCount() {\n\t\treturn (int)self::$playercount;\n\t}", "function checkStatePoints($level)\n {\n $pontosStatus = 0;\n for($i=2;$i<=$level;$i++)\n {\n if($i <= 70) {\n $pontosStatus = $pontosStatus + 5;\n } else if(($i > 70) and ($i <= 90)) {\n $pontosStatus = $pontosStatus + 7;\n } else {\n $pontosStatus = $pontosStatus + 10;\n }\n\n }\n return $pontosStatus;\n }", "public function length()\r\n {\r\n return count($this->holdings);\r\n }", "function vending_machine()\n {\n $amount = readline(\"Enter the amoutn: \\n\");\n\n $notesarray = array(1000, 500, 100, 50, 10, 5, 2, 1);\n $countarray = array(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\n for ($i = 0; $i <= 8; $i++) {\n if ($amount >= $notesarray[$i]) {\n $countarray[$i] = intval($amount / $notesarray[$i]);\n $amount = $amount - $countarray[$i] * $notesarray[$i];\n }\n }\n\n for ($i = 0; $i < 8; $i++) {\n if ($countarray[$i] != 0) {\n echo ($notesarray[$i] . \" : \" . $countarray[$i] . \"\\n\");\n }\n }\n }", "public function total () {\n return $this->since($this->iniTmstmp);\n }", "function get_players() {\n $query = $this->db->query('SELECT a.Player, a.Peanuts, COUNT(b.Piece) AS Equity FROM `players` a INNER JOIN `collections` b ON a.Player = b.Player GROUP BY a.Player ORDER BY a.Player ASC;');\n return $query->result();\n }", "public function calculate_unbilled() {\n\n // query database for this client's work items\n $query_args = array(\n 'post_type' => 'invoice_item',\n 'meta_query' => array(\n array(\n 'key' => 'client_id',\n 'value' => $this->id\n ),\n array(\n 'key' => 'invoice_item_status',\n 'value' => 'unbilled'\n )\n )\n );\n $query = new WP_Query($query_args);\n\n // initiate total variable and loop through query object\n $total = 0;\n while($query->have_posts()) {\n $query->the_post();\n $invoice_item = new InvoiceItem(get_the_id());\n $total += $invoice_item->value;\n }\n update_post_meta($this->id, 'total_unbilled', $total);\n return $total;\n }", "public function onPlayerReachedBounds(ArenaEvent $event){\n return;\n }", "public function simulateGame(Player $playerOne, Player $playerTwo): array\n {\n $playerOneProbabilityOfWinning = $this->calculateProbabilityOfWinning($playerOne, $playerTwo);\n $potentialRatingChangePlayerOne = self::K * (1 - $playerOneProbabilityOfWinning);\n\n // Calculate the potential point change for player two as well.\n $playerTwoProbabilityOfWinning = $this->calculateProbabilityOfWinning($playerTwo, $playerOne);\n $potentialRatingChangePlayerTwo = self::K * (1 - $playerTwoProbabilityOfWinning);\n\n $playerOneWon = $this->determineIfPlayerWon($playerOneProbabilityOfWinning);\n // In case player one lost, it should lose the points that player two could win.\n $playerOneRatingChange = $playerOneWon ? $potentialRatingChangePlayerOne : -1 * $potentialRatingChangePlayerTwo;\n // Player two should increment by the opposite.\n $playerTwoRatingChange = -1 * $playerOneRatingChange;\n\n // On a set there is no decrease but increasing a positive number with a negative number still works.\n $this->redis->hincrby(self::SET_OF_PLAYERS, $playerOne->getId(), (int) round($playerOneRatingChange));\n $this->redis->hincrby(self::SET_OF_PLAYERS, $playerTwo->getId(), (int) round($playerTwoRatingChange));\n\n return [\n $this->getPlayerPerformanceRating($playerOne),\n $this->getPlayerPerformanceRating($playerTwo)\n ];\n }", "function statusAfterRoll($rolledNumber, $currentPlayer) {\n\t}", "public function getHoldBeforeStatus();", "protected function cost()\n {\n return $this->rounds;\n }", "private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }", "private function calculatePoints()\n {\n $this->points += 100;\n $this->points = $this->points < 0 ? 0 : $this->points;\n }" ]
[ "0.66872907", "0.5962012", "0.5804409", "0.5617306", "0.55641145", "0.51231796", "0.50978607", "0.50844836", "0.5065956", "0.50033957", "0.49990228", "0.49630114", "0.494356", "0.49345016", "0.48787436", "0.4860722", "0.48013806", "0.48003072", "0.4798671", "0.47933862", "0.4786656", "0.47808626", "0.4768028", "0.47238207", "0.47121012", "0.47049358", "0.46991852", "0.46989587", "0.46919695", "0.46665734", "0.46657988", "0.46648645", "0.46482188", "0.4633867", "0.4628257", "0.46085712", "0.4602639", "0.45974556", "0.45932135", "0.45919818", "0.45881557", "0.45841897", "0.4558796", "0.45534116", "0.45445147", "0.45332184", "0.45296124", "0.45023063", "0.45021912", "0.449994", "0.4491055", "0.4485204", "0.44719058", "0.44613904", "0.4452045", "0.44515342", "0.4451371", "0.44499102", "0.44487306", "0.44456753", "0.4431374", "0.44226348", "0.4416406", "0.44160157", "0.44075057", "0.44022626", "0.4389189", "0.43870506", "0.43831402", "0.43759516", "0.43737736", "0.43729758", "0.4372908", "0.43671632", "0.4361228", "0.43499926", "0.43486512", "0.43479818", "0.43468437", "0.4346331", "0.43441713", "0.4343825", "0.43372107", "0.4336886", "0.43332958", "0.4328742", "0.43268707", "0.43267837", "0.43139708", "0.43105745", "0.43094528", "0.43063065", "0.42998216", "0.4297249", "0.42924678", "0.4291415", "0.42909175", "0.42852092", "0.4274103", "0.42693" ]
0.6086163
1
Run the database seeds.
public function run() { // id 37 DB::table('product_images')->insert( [ 'product_id' => '37', 'image' => 'motorola_Moto_E_blue_main_1.jpg', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); //id 38 DB::table('product_images')->insert( [ 'product_id' => '38', 'image' => 'motorola_g8_blue_main_1.jpg', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); //id 39 DB::table('product_images')->insert( [ 'product_id' => '39', 'image' => 'motorola_Moto_G6_blue_main_1.jpg', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); //id 40 DB::table('product_images')->insert( [ 'product_id' => '40', 'image' => 'motorola_Moto_G7_black_main_1.jpg', 'color'=> 'Black', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); //id 41 DB::table('product_images')->insert( [ 'product_id' => '41', 'image' => 'motorola_moto_Z_XT_black_main_1.jpg', 'color'=> 'Black', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 42 DB::table('product_images')->insert( [ 'product_id' => '42', 'image' => 'motorola_one_fusion_blue_main_1.jpg', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 43 DB::table('product_images')->insert( [ 'product_id' => '43', 'image' => 'motorola_razr_black_main_3.jpg', 'color'=> 'Black', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 44 // Color Black DB::table('product_images')->insert( [ 'product_id' => '44', 'image' => 'motorola_one_hyper_black_main_1.jpg', 'color'=> 'Black', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color Blue DB::table('product_images')->insert( [ 'product_id' => '44', 'image' => 'motorola_one_hyper_blue_main_3.jpg', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 45 // Color White DB::table('product_images')->insert( [ 'product_id' => '45', 'image' => 'motorola_g_fast_white_main_1.jpg', 'color'=> 'White', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 46 -> Alcatel // Color White DB::table('product_images')->insert( [ 'product_id' => '46', 'image' => 'Alcatel_Go_Flip_3_black_main_1.jpg', 'color'=> 'Black', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 20 -> Xiaomi -> GOING 20 TO DOWNWARDS // Color Blue DB::table('product_images')->insert( [ 'product_id' => '20', 'image' => 'Xiaomi_Mi10TPro5G_AuroraBlue_main_1.png', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color Black DB::table('product_images')->insert( [ 'product_id' => '20', 'image' => 'Xiaomi_Mi10TPro5G_CosmicBlack_main_1.png', 'color'=> 'Black', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color Silver DB::table('product_images')->insert( [ 'product_id' => '20', 'image' => 'Xiaomi_Mi10TPro5G_LunarSilver_main_1.png', 'color'=> 'Silver', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 19 -> Xiaomi // Color Blue DB::table('product_images')->insert( [ 'product_id' => '19', 'image' => 'Xiaomi_Mi10Lite_AuroraBlue_main_1.png', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color GREY DB::table('product_images')->insert( [ 'product_id' => '19', 'image' => 'Xiaomi_Mi10Lite_CosmicGray_main_1.png', 'color'=> 'Grey', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color White DB::table('product_images')->insert( [ 'product_id' => '19', 'image' => 'Xiaomi_Mi10Lite_DreamWhite_main_1.png', 'color'=> 'White', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 18 -> Xiaomi // Color Grey DB::table('product_images')->insert( [ 'product_id' => '18', 'image' => 'Xiaomi_Redmi9C_MidnightGrey_main_1.png', 'color'=> 'Grey', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color Blue DB::table('product_images')->insert( [ 'product_id' => '18', 'image' => 'Xiaomi_Redmi9C_TwilightBlue_main_1.png', 'color'=> 'Blue', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color Orange DB::table('product_images')->insert( [ 'product_id' => '18', 'image' => 'Xiaomi_Redmi9C_SunriseOrange_main_1.png', 'color'=> 'Orange', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // id 17 -> Xiaomi // Color Grey DB::table('product_images')->insert( [ 'product_id' => '17', 'image' => 'Xiaomi_RedmiNote9Pro_InterstellarGrey_main_1.png', 'color'=> 'Grey', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color White DB::table('product_images')->insert( [ 'product_id' => '17', 'image' => 'Xiaomi_RedmiNote9Pro_GlacierWhite_main_1.png', 'color'=> 'White', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); // Color Green DB::table('product_images')->insert( [ 'product_id' => '17', 'image' => 'Xiaomi_RedmiNote9Pro_TropicalGreen_thumbnail_1.png', 'color'=> 'Green', 'type'=> 'main', 'created_at'=>Carbon::Now()->addSeconds(10) ] ); }
{ "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
/$sql = "SELECT SUM(harga) as total_paramita FROM tb_paramita_check_request WHERE id_app = ?"; $query = $this>db>query($sql, $app_id); $total_paramita = $query>row()>total_paramita; if ($total_paramita == "") $total_paramita = 0; $total_paramita = 1.35; // for patient; add 135% from the normal price; this is the selling price of angsamerah echo $total_paramita;exit;
function get_payment_details($app_id) { $sql = "SELECT x.administration_fee, x.doctor_fee, JUMLAH_HARGA_OBAT_BY_APP(z.appointment_number) as med_fee, x.proc_fee, (x.lab_fee + (x.paramita_fee * 1.35)) as lab_fee, x.amc_package_fee, z.appointment_date, y.salutation, CONCAT(y.first_name, ' ' ,y.middle_name, ' ', y.last_name) as full_name, y.nickname FROM tb_billing as x, tb_patient as y, tb_appointment as z WHERE y.mr_no = z.mr_no AND z.appointment_number = x.id_appointment AND x.id_appointment = ? LIMIT 1"; $query = $this->db->query($sql, $app_id); /*$sql = "SELECT SUM(harga) FROM tb_paramita_check_request WHERE id_app =?"; $query = $this->db->query($sql,$app_id);*/ if($query->num_rows() > 0) return $query->row(); else return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totale_retegas_netto(){\r\nglobal $db;\r\n$qry = \"SELECT\r\nSum(retegas_dettaglio_ordini.qta_arr*retegas_articoli.prezzo)\r\nFROM\r\nretegas_dettaglio_ordini\r\nInner Join retegas_articoli ON retegas_dettaglio_ordini.id_articoli = retegas_articoli.id_articoli\";\r\n \r\n$res = $db->sql_query($qry);\r\n$row = $db->sql_fetchrow($res);\r\n\r\nreturn (int) $row[0]; \r\n \r\n}", "public function redeembp(){\n\t\t$this->db->where('CustomerMail', $this->session->userdata('useremail'));\n\t\t$this->db->select_sum('EarnedPotint');\n\t\t$this->db->from('tbl_bvpoint_data');\n\t\t$query = $this->db->get();\n\t\t$sumvalue=$query->row()->EarnedPotint;\n\t\t//echo $sumvalue;\n\t\tif($sumvalue>100){\n\t\t\t$redeempoint=100;\n\t\t}\n\t\telse{\n\t\t\t$redeempoint=$sumvalue;\n\t\t}\n\t\treturn round($redeempoint*0.25);\n\t}", "public function consultaDevuelta($valorTotal, $efectivo)\n{\n $efectivo=$this->filtroNumerico($this->normalizacionDeCaracteres($efectivo));\n $valorTotal=$this->filtroNumerico($this->normalizacionDeCaracteres($valorTotal));\n\n $devolver=$efectivo-$valorTotal;\n if ($devolver>0) {\n # code...\n return $devolver;\n }\n else\n {\n return 0;\n }\n\n\n}", "function getTotalMeGustas($id) {\n $c = new Conexion();\n $resultado = $c->query(\"SELECT SUM(megusta) FROM valoracion_mg where id_contenido=$id && megusta=1\");\n\n if ($objeto = $resultado->fetch(PDO::FETCH_OBJ)) {\n return $objeto;\n }\n else{\n return 0;\n } \n}", "public function calculateBP(){\n\t\t$this->db->where('CustomerMail', $this->session->userdata('useremail'));\n\t\t$this->db->select_sum('EarnedPotint');\n\t\t$this->db->from('tbl_bvpoint_data');\n\t\t$query = $this->db->get();\n\t\t$sumvalue=$query->row()->EarnedPotint;\n\t\techo $sumvalue;\n\t\t//echo \"<script>alert('\".$sumvalue.\"');</script>\";\n\t}", "function get_qty_awal($tanggal_awal, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal <= \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur < \".$tanggal_awal.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') <\".$tanggal_awal.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_awal.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "function get_qty_akhir($tanggal_akhir, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal < \".$tanggal_akhir;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_akhir >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_akhir.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public function valorCreditosDia($parametro)\n{\n conectar::conexiones();\n $sql=\"SELECT debe, estado, liquidado FROM pedidos WHERE fechaPedido BETWEEN \".fechaActualFija.\" AND \".(fechaActualFija+86400).\" AND liquidado =1 AND estado=2\";\n $query=mysql_query($sql);\n $sum=0;\n while ($rs=mysql_fetch_array($query)) {\n # code...\n $sum=$sum+($rs[\"debe\"]);\n }\n\n return $sum;\n conectar::desconectar();\n}", "function valore_netto_singolo_amico($ordine,$id_user,$amico){\r\n//echo \"--id_ord: \". $ordine;\r\n//echo \"--id_amico: \". $amico;\r\n//echo \"--id user: \". $id_user.\"<br>\"; \r\n \r\n// la nuova query si appoggia sull'id articolo reperito dalla tabella dettaglio ordini\r\n$sql =\"SELECT Sum(retegas_articoli.prezzo * retegas_distribuzione_spesa.qta_arr) as tot_amico\r\nFROM\r\nretegas_distribuzione_spesa\r\nInner Join retegas_dettaglio_ordini ON retegas_distribuzione_spesa.id_riga_dettaglio_ordine = retegas_dettaglio_ordini.id_dettaglio_ordini\r\nInner Join retegas_articoli ON retegas_dettaglio_ordini.id_articoli = retegas_articoli.id_articoli\r\nWHERE retegas_distribuzione_spesa.id_user = '$id_user' \r\nAND retegas_distribuzione_spesa.id_ordine = '$ordine' \r\nAND retegas_distribuzione_spesa.id_amico = '$amico';\";\r\n\r\n\r\n\r\n//echo $sql;\r\n$ret = mysql_query($sql);\r\n$row = mysql_fetch_row($ret);\r\n//echo \"RESULT\".$row[0].\"<br>\";\r\nreturn round($row[0],4);\r\n \r\n}", "function total() {\n\t\t$sql = \"\n\t\t\tSELECT SUM(biaya) as totalbiaya FROM tiket \n\t\t\tWHERE tgl_pemesanan >= '\".date(\"Y-m-d\").\"' AND tgl_pemesanan <= '\".date(\"Y-m-d\").\"'\n\t\t\tORDER BY id_tiket ASC\"; \n\t\t\n\t\t$query = $this->db->query($sql);\n\t\t$row = $query->row();\n\t\treturn $row->totalbiaya;\n\t}", "function total_price(){\n\t$total = 0; // agei instantiate kore dilam j zero\n\tglobal $con;\n\t$ip=getIp();\n\t$sel_price = \"select * from cart where ip_add='$ip'\";\n\t$run_price=mysqli_query($con, $sel_price);\n\twhile($p_price=mysqli_fetch_array($run_price)){\n\t\t$pro_id=$p_price['p_id'];//ip address wise product er id ta dibe, from there we can tell what is the prrice of product\n\t\t$pro_price=\"select * from products where product_id='$pro_id'\"; // cart table theke product id ta niye seta k product table er product ider sathe match kortese\n\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){// product table theke product id wise product price ta niye ashtese\n\t\t\t\t$product_price= array($pp_price['product_price']); //that certain user joto product cart a add korsilo segula sob k akta array te rakhlam\n\t\t\t\t$values= array_sum($product_price); //oi uporer array er sumation kore show korbe akta value..like total value \n\t\t\t\t$total+=$values;\n\t\t\n\t\t}\n\n\t}\n\techo $total;\n}", "static public function mdlSumaTotalVentas($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n //CAMBIAR EL FORMATO DE FECHA A yyyy-mm-dd \n //$fechadehoy = explode('/', $valor); \n\t//$valor = $fechadehoy[2].'-'.$fechadehoy[1].'-'.$fechadehoy[0];\n\t/*\n*/\n if($fechacutvta!=null){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, SUM(IF(h.`es_promo` = 0, h.`cantidad`*h.`precio_venta`,0)) AS sinpromo, \n\t\tSUM(IF(h.`es_promo` = 1, h.`precio_venta`,0)) AS promo, h.cerrado FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item='\".$fechacutvta.\"' and p.totaliza=1 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n }else{\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, SUM(IF(h.`es_promo` = 0, h.`cantidad`*h.`precio_venta`,0)) AS sinpromo, \n\t\tSUM(IF(h.`es_promo` = 1, h.`precio_venta`,0)) AS promo FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item=curdate() and p.totaliza=1 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n }\n //$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n \n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\n\t\t$stmt = null;\n\n}", "function totalMoneybox()\n {\n \n $money = mysql_query(\"select sum(dpv) as dpv from money_box where status='0'\");\n $totmoney = mysql_fetch_assoc($money);\n if (mysql_num_rows($money) > 0 && !empty($totmoney['dpv'])) {\n $toal= ($totmoney['dpv']*(1/100))*1;\n\t\t\t\treturn $toal;\n } else {\n return \"0\";\n }\n }", "public function hpp_total_event() {\n\n $event_id = $this->input->post('id');\n\n $result = $this->db->query(\"SELECT SUM(item_qty*item_price) AS 'total_hpp'\n FROM events_hpp\n WHERE event_id = \" . $event_id);\n\n if ($result->num_rows() > 0) {\n $result = $result->row_array();\n\n echo number_format($result['total_hpp']);\n } else {\n echo 0;\n }\n\n }", "public function sum_nilai_adjust() \n {\n return $get_data = $this->db->query(\"SELECT sum(nilai_adjust) as nilai_adjust FROM temp_adjust_barang where id_karyawan='\".$this->session->userdata('id_karyawan').\"'\");\n }", "static public function mdlSumTotVtasCred($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\n if($fechacutvta!=null){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(IF(h.es_promo = 0, h.cantidad*h.precio_venta,0)) AS sinpromo, \n\t\tSUM(IF(h.es_promo = 1, h.precio_venta,0)) AS promo FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item='\".$fechacutvta.\"' and h.id_caja='\".$valor.\"' and h.cerrado='\".$cerrado.\"' AND h.id_tipomov=3\");\n }else{\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT h.fecha_salida, SUM(IF(h.es_promo = 0, h.cantidad*h.precio_venta,0)) AS sinpromo, \n\t\tSUM(IF(h.es_promo = 1, h.precio_venta,0)) AS promo FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item=curdate() and h.id_caja='\".$valor.\"' and h.cerrado='\".$cerrado.\"' AND h.id_tipomov=3\");\n }\n //$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n \n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\n\t\t$stmt = null;\n\n}", "function po_total($po_id){\n global $connection;\n $total_po = mysqli_query($connection,\"SELECT SUM(total) AS gtotal FROM kp_po_items WHERE po_id='$po_id'\") or die(\"Error\");\n $row = mysqli_fetch_assoc($total_po);\n $total = $row['gtotal'];\n return $total;\n}", "function totalboaralla(){\n\n\t$crud = new CRUD();\n\t$crud->disconnect();\n\n\t$crud -> sql(\"select SUM(native_boar) as totalboaralla from farmers_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['totalboaralla'];\n\t}\n\t$crud->disconnect();\n}", "public function getProfit(){\n\t\tglobal $db;\n\t\t$sql = $db->prepare(\"SELECT SUM(price) FROM project01_report;\");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$profit = $sql->fetch();\n\t\t\treturn $profit;\n\t\t}\n\t}", "public function modelTotalRecordSearchPrice(){\n\t\t\t$fromPrice = isset($_GET[\"fromPrice\"])?$_GET[\"fromPrice\"]:0;\n \t\t$toPrice = isset($_GET[\"toPrice\"])?$_GET[\"toPrice\"]:0;\n\t\t\t//lay bien ket noi\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->prepare(\"select id from products where price >= $fromPrice and price <= $toPrice\");\n\t\t\t//thuc thi truy van. Neu khong co tham so o cau truy van thi ghi array rong\n\t\t\t$query->execute(array());\n\t\t\t//tra ve so luong ban ghi\n\t\t\treturn $query->rowCount() > 0 ? $query->rowCount() : 1;\n\t\t}", "function valore_totale_mio_gas($id_ordine,$id_gas){\r\n\r\n(int)$id_ordine;\r\n(int)$id_gas;\r\n\r\nglobal $db,$class_debug;\r\n \r\n$sql=\"SELECT\r\nSum(retegas_dettaglio_ordini.qta_arr*retegas_articoli.prezzo) AS somma_valore_ordine\r\nFROM\r\nretegas_ordini\r\nInner Join retegas_dettaglio_ordini ON retegas_ordini.id_ordini = retegas_dettaglio_ordini.id_ordine\r\nInner Join retegas_articoli ON retegas_dettaglio_ordini.id_articoli = retegas_articoli.id_articoli\r\nInner Join maaking_users ON retegas_dettaglio_ordini.id_utenti = maaking_users.userid\r\nWHERE\r\nretegas_ordini.id_ordini = '$id_ordine' AND\r\nmaaking_users.id_gas = '$id_gas'\r\nGROUP BY\r\nretegas_ordini.id_ordini,\r\nretegas_ordini.id_listini,\r\nretegas_ordini.descrizione_ordini,\r\nretegas_ordini.costo_trasporto,\r\nretegas_ordini.costo_gestione\r\nLIMIT 1\";\r\n$ret = $db->sql_query($sql);\r\n\r\n$row = mysql_fetch_row($ret);\r\n$class_debug->debug_msg[]=\"FUN : valore_totale_mio_gas id_ordine = $id_ordine, id_gas = $id_gas, Result : \".$row[0];\r\nreturn $row[0];\r\n \r\n}", "function valore_totale_mio_ordine($idu,$usr){\r\n$sql=\"SELECT\r\nSum(retegas_dettaglio_ordini.qta_arr*retegas_articoli.prezzo) AS somma_valore_ordine\r\nFROM\r\nretegas_ordini\r\nInner Join retegas_dettaglio_ordini ON retegas_ordini.id_ordini = retegas_dettaglio_ordini.id_ordine\r\nInner Join retegas_articoli ON retegas_dettaglio_ordini.id_articoli = retegas_articoli.id_articoli\r\nWHERE\r\nretegas_ordini.id_ordini = '$idu' AND\r\nretegas_dettaglio_ordini.id_utenti='$usr'\r\nGROUP BY\r\nretegas_ordini.id_ordini,\r\nretegas_ordini.id_listini,\r\nretegas_ordini.descrizione_ordini,\r\nretegas_ordini.costo_trasporto,\r\nretegas_ordini.costo_gestione\r\nLIMIT 1\";\r\n$ret = mysql_query($sql);\r\n $row = mysql_fetch_row($ret);\r\n return $row[0];\r\n \r\n}", "public function getTotalAnggaran()\n\t{\n\t\t$unitkerja=$this->unitkerja;\n\t\t$kegiatan=$this->kegiatan;\n\n\t\t$sql=\"SELECT IF(SUM(jumlah) IS NULL, 0, SUM(jumlah)) AS val FROM value_anggaran WHERE unit_kerja=$unitkerja AND kegiatan=$kegiatan\";\n\t\t$total=Yii::app()->db->createCommand($sql)->queryScalar();\n\t\t\n\t\treturn floor($total);\n\t}", "public function totcarte()\n {\n $detalle = FacturaDet::join('factura_cab', 'factura_cab.numfac', '=', 'factura_det.numfac')\n ->select(DB::raw('sum(cantserv*valserv) as total'))\n ->where('factura_cab.estfac','<>','0')\n ->where('factura_cab.estfac','<>','1')\n ->first();\n $total=$detalle->total+0;\n $pagos = Pago::select(DB::raw('sum(valpago) as total'))\n ->first();\n if($pagos)\n $pagado = $pagos->total;\n else\n $pagado=0;\n $total = $total - $pagado;\n return $total;\n }", "function valore_totale_ordine_qarr($idu){\r\nglobal $db;\r\nGlobal $class_debug; \r\n\r\n\r\n \r\n$sql=\"SELECT\r\nSum(retegas_dettaglio_ordini.qta_arr*retegas_articoli.prezzo) AS somma_valore_ordine\r\nFROM\r\nretegas_ordini\r\nInner Join retegas_dettaglio_ordini ON retegas_ordini.id_ordini = retegas_dettaglio_ordini.id_ordine\r\nInner Join retegas_articoli ON retegas_dettaglio_ordini.id_articoli = retegas_articoli.id_articoli\r\nWHERE\r\nretegas_ordini.id_ordini = '$idu'\r\nGROUP BY\r\nretegas_ordini.id_ordini,\r\nretegas_ordini.id_listini,\r\nretegas_ordini.descrizione_ordini,\r\nretegas_ordini.costo_trasporto,\r\nretegas_ordini.costo_gestione\r\nLIMIT 1\";\r\n$ret = mysql_query($sql);\r\n $row = mysql_fetch_row($ret);\r\n \r\n $class_debug->debug_msg[]= \"FUN : valore_totale_ordine_qarr id_ordine=$idu result = \".$row[0]; \r\n return $row[0];\r\n \r\n}", "function total_price(){\n\nglobal $db;\n\n$ip_add = getRealUserIp();\n\n$total = 0;\n\n$select_cart = \"select * from cart where ip_add='$ip_add'\";\n\n$run_cart = mysqli_query($db,$select_cart);\n\nwhile($record=mysqli_fetch_array($run_cart)){\n\n$pro_id = $record['p_id'];\n\n$pro_qty = $record['qty'];\n\n\n$sub_total = $record['p_price']*$pro_qty;\n\n$total += $sub_total;\n\n\n\n\n\n\n}\n\necho \"$\" . $total;\n\n\n\n}", "public function totalq1($modalite)\r\n\t{\r\n\t$conge = new Default_Model_Conge();\r\n\t$debut_mois = $this->getAnnee_reference().'-01-01';\r\n\t$fin_mois = $this->getAnnee_reference().'-12-31'; // il faut la remplacer par l'annee de reference\r\n\t\r\n\t\r\n\t$jours_ouvres_de_annee_ref = $conge->joursOuvresDuMois($debut_mois,$fin_mois);\r\n\t$nbr_heurs_ouvrees_annee = ($jours_ouvres_de_annee_ref -14) *7.4;\r\n\t$personne = new Default_Model_Personne();\r\n\t$id_entite =1; // MBA : pourquoi entite 1 pour personne? \r\n\t$personne = $personne->fetchall('id_entite ='.$id_entite. '&&'. 'id ='.$this->getPersonne()->getId());\r\n\t//var_dump($personne);\r\n\tif (null!==$personne)\r\n\t\r\n\t{\r\n\t\tif ($modalite == 4)\r\n\t\t{\r\n\t\t\t$nbr_heurs_ouvrees_annee = ($jours_ouvres_de_annee_ref -14) *7.4;\r\n\t\t\tif($nbr_heurs_ouvrees_annee >1607)\r\n\t\t\t{\r\n\t\t\t\treturn 0.5;\r\n\t\t\t}\r\n\t\t\telseif($nbr_heurs_ouvrees_annee <1607.5)\r\n\t\t\t{\r\n\t\t\t\treturn 1.0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telseif ($modalite == 5 ||$modalite == 6 )\r\n\t\t{\r\n\t\t\t$nbr_jours_ouvrees_annee = $jours_ouvres_de_annee_ref-243;\r\n\t\t\tif($nbr_jours_ouvrees_annee < 10)\r\n\t\t\t{\r\n\t\t\t\treturn 10.0;\r\n\t\t\t}\r\n\t\t\telseif($nbr_jours_ouvrees_annee >10)\r\n\t\t\t{\r\n\t\t\t\treturn $nbr_jours_ouvrees_annee;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telseif ($modalite == 1 ||$modalite == 2 ||$modalite == 3)\r\n\t\t{\r\n\t\t\t\treturn 10.0;\r\n\t\t}\r\n\t\r\n\t}\r\n\t\r\n\telse return 0;\r\n\t\r\n\t}", "function valore_totale_mio_ordine_lordo($idu,$usr){\r\n$mio_o = valore_totale_mio_ordine($idu,$usr);\r\n//echo \"mio=\".$mio_o.\"<br>\";\r\n\r\n$vto = valore_totale_ordine_qarr($idu);\r\n\r\n//echo \"vto=\".$vto.\"<br>\"; \r\nif ($vto>0){ \r\n$perc = (float)($mio_o/$vto)*100;\r\n\r\n$tras = valore_trasporto($idu,$perc);\r\n//echo \"perc=\".$perc.\"<br>\";\r\n//echo \"tras=\".$tras.\"<br>\"; \r\n$gest =valore_gestione($idu,$perc);\r\n//echo \"perc=\".$perc.\"<br>\"; \r\n//echo $perc;\r\nreturn (float)round($mio_o + $tras + $gest,4);\r\n}else{\r\nreturn \"\"; \r\n\t\r\n}\r\n}", "static public function mdlSumTotVtasOtros($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\n if($fechacutvta!=null){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, SUM(IF(h.`es_promo` = 0, h.`cantidad`*h.`precio_venta`,0)) AS sinpromo, \n\t\tSUM(IF(h.`es_promo` = 1, h.`precio_venta`,0)) AS promo, h.cerrado FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item='\".$fechacutvta.\"' and p.totaliza=3 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n }else{\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, SUM(IF(h.`es_promo` = 0, h.`cantidad`*h.`precio_venta`,0)) AS sinpromo, \n\t\tSUM(IF(h.`es_promo` = 1, h.`precio_venta`,0)) AS promo FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item=curdate() and p.totaliza=3 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n }\n\n\t$stmt -> execute();\n\n\treturn $stmt -> fetch();\n\n\n\t$stmt = null;\n}", "function iva($subtotal, $iva = 0.21){ // cuando le ponemos el valor a un parametro nos permite que cada vez que haga la operacion, lo haga con el valor que le pusimos al parametro obviamente, esto es mejor que asignarle un valor desde dentro y no estableciendo el valor fijo\n $porcentaje = $subtotal * $iva;\n\n // pusimos en comentarios esto porque no necesitamos que nos haga una operacion final, solo que nos muestre el dato final\n // $solucion = $subtotal + $porcentaje;\n return $porcentaje;\n }", "function total_price(){\n\t$total=0;\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t$result = $conn->query($sql);\n\twhile($row=$result->fetch_assoc()){\n\t\t$pro_id= $row[\"p_id\"];\n\t\t$pro_price= \"SELECT * FROM products where product_id='$pro_id' AND stock='0'\";\n\t\t$result2 = $conn->query($pro_price);\n\t\twhile($row2=$result2->fetch_assoc()){\n\t\t\t$product_price= array($row2[\"product_price\"]);\n\t\t\t$values = array_sum($product_price);\n\t\t\t$total +=$values;\n\t\t\t}\n\t}\n\techo number_format($total) ;\n}", "public function getTotalRealisasiAnggaran()\n\t{\n\t\t$id=$this->id;\n\t\t$sql=\"SELECT IF(SUM(jumlah) IS NULL, 0, SUM(jumlah)) AS val FROM value_anggaran WHERE kegiatan=$id\";\n\t\treturn Yii::app()->db->createCommand($sql)->queryScalar();\n\t}", "public static function mdlGetTotalMinInt($lote, $db){\n\n \n\n //$db = new mysqli(\"localhost\", \"c1user_psp\", \"Genesis2020\", \"c1bbdd_presupuestos\");\n\n $sql = $db->query(\"SELECT pg,\n\n 'MINISTERIO DEL INTERIOR'AS programa,\n\n '0' AS in_data,\n\n '0' AS pp,\n\n 'Subtotal1' AS concepto,\n\n REPLACE(FORMAT(SUM(credito_vigente),0), ',','.') AS credito_vigente, \n\n REPLACE(FORMAT(SUM(compromiso_consumido),0), ',','.') AS compromiso_consumido, \n\n REPLACE(CONCAT(FORMAT(((SUM(compromiso_consumido)/SUM(credito_vigente)) *100),0),'%'), ',','.') AS porc_comp, \n\n REPLACE(FORMAT(SUM(devengado_consumido),0), ',','.') AS devengado_consumido, \n\n REPLACE(CONCAT(FORMAT(((SUM(devengado_consumido)/SUM(credito_vigente)) *100),0),'%'), ',','.') AS porc_deve, \n\n REPLACE(FORMAT(SUM(disponible_gastar),0), ',','.') AS disponible_gastar \n\n FROM history WHERE lote = '$lote' AND saf=325\");\n\n\n\n return $sql;\n\n\n\n }", "function tongtienmuasam(){\n date_default_timezone_set('Asia/Ho_Chi_Minh');\n $db = mysqli_connect(HOST,USRNM,PSWD,DBNM) or die(\"Không thể kết nối database\");\n // TỔNG TIỀN START \n $check = mysqli_query($db,\"SELECT SUM(giatien) as total FROM cp_reports_shoping\");\n $row = mysqli_fetch_assoc($check);\n echo \"Tổng tiền sửa chữa: \".number_format($row['total']).\" VNĐ\";\n // END\n\n // Sóng Nam START\n $check1 = mysqli_query($db,\"SELECT SUM(giatien) as total1 FROM cp_reports_shoping WHERE nhacungcap='11'\");\n $row1 = mysqli_fetch_assoc($check1);\n echo \"<br><small style='text-decoration: overline;'> Sóng Nam: \".number_format($row1['total1']).\" VNĐ </small>\";\n // END\n\n // Ánh Phương START\n $check2 = mysqli_query($db,\"SELECT SUM(giatien) as total2 FROM cp_reports_shoping WHERE nhacungcap='22'\"); \n $row2 = mysqli_fetch_assoc($check2); \n echo \"|| <small style='text-decoration: overline;'> Ánh Phương: \".number_format($row2['total2']).\" VNĐ </small>\"; \n // END\n\n // Lan Anh START\n $check3 = mysqli_query($db,\"SELECT SUM(giatien) as total3 FROM cp_reports_shoping WHERE nhacungcap='33'\"); \n $row3 = mysqli_fetch_assoc($check3); \n echo \"|| <small style='text-decoration: overline;'> Lan Anh: \".number_format($row3['total3']).\" VNĐ </small>\"; \n // END \n\n // Hoàng Tuấn START\n $check4 = mysqli_query($db,\"SELECT SUM(giatien) as total4 FROM cp_reports_shoping WHERE nhacungcap='44'\"); \n $row4 = mysqli_fetch_assoc($check4);\n echo \"|| <small style='text-decoration: overline;'> Hoàng Tuấn: \".number_format($row4['total4']).\" VNĐ </small>\";\n // END\n\n // Cửa hàng chuyên hàng xách tay Đình Cư START\n $check6 = mysqli_query($db,\"SELECT SUM(giatien) as total6 FROM cp_reports_shoping WHERE nhacungcap='55'\"); \n $row6 = mysqli_fetch_assoc($check6);\n echo \"|| <small style='text-decoration: overline;'> Cửa hàng chuyên hàng xách tay Đình Cư: \".number_format($row6['total6']).\" VNĐ </small>\";\n // END \n\n // Mua bán điện thoại xách tay Thanh Hải START\n $check7 = mysqli_query($db,\"SELECT SUM(giatien) as total7 FROM cp_reports_shoping WHERE nhacungcap='66'\"); \n $row7 = mysqli_fetch_assoc($check7);\n echo \"|| <small style='text-decoration: overline;'> Mua bán điện thoại xách tay Thanh Hải: \".number_format($row7['total7']).\" VNĐ </small>\";\n // END \n \n // Mua bán điện thoại xách tay Thanh Hải START\n $check8 = mysqli_query($db,\"SELECT SUM(giatien) as total8 FROM cp_reports_shoping WHERE nhacungcap='77'\"); \n $row8 = mysqli_fetch_assoc($check7);\n echo \"|| <small style='text-decoration: overline;'> OnePlus Viet.net: \".number_format($row8['total8']).\" VNĐ </small>\";\n // END \n\n // Khác START\n $check5 = mysqli_query($db,\"SELECT SUM(giatien) as total5 FROM cp_reports_shoping WHERE nhacungcap=''\"); \n $row5 = mysqli_fetch_assoc($check5);\n echo \"|| <small style='text-decoration: overline;'> Khác: \".number_format($row5['total5']).\" VNĐ </small>\";\n // END \n}", "function getSum($u_id , $searchDate)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t $myarr['total'] =0;\n\t\t\t $query = \"select SUM(total_price) AS total from check_tb where u_id='\".$u_id.\"' \".$searchDate.\" \"; \n $res=$mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\t\n\t\t\t$myarr=mysqli_fetch_assoc($res);\n\t\t\tif($myarr['total'] == \"\")\n\t\t\t{\n\t\t\t\techo \"0\";\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $myarr['total'];\n\t\t\t}\n\t\t}", "function getTotalProductsAvailable() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantityavailable) AS sqa FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function totalPrice() {\n\n $total = 0;\n\n global $con;\n\n $ip = getIp();\n\n $run_price = mysqli_query($con,\"SELECT * FROM cart WHERE ip_add = '$ip'\");\n\n while($row_pro_price = mysqli_fetch_array($run_price)) {\n\n $pro_id = $row_pro_price['p_id'];\n $pro_qty = $row_pro_price['qty'];\n\n $run_pro_price2 = mysqli_query($con,\"SELECT * FROM products WHERE product_id = '$pro_id'\");\n\n while($row_pro_price2 = mysqli_fetch_array($run_pro_price2)) {\n\n $pro_price = array($row_pro_price2['product_price']);\n\n $pro_price_single = $row_pro_price2['product_price'];\n\n $pro_price_values = array_sum($pro_price);\n\n\n $total += $pro_price_values;\n\n if($pro_qty > 1) {\n $pro_price_single_all = $pro_price_single * $pro_qty;\n $total = $total + $pro_price_single_all - $pro_price_single;\n }\n\n\n }\n\n }\n echo \"$\" . $total;\n }", "function total_price()\n{\n global $db;\n $ip_add = getRealUserIp();\n $total = 0;\n $select_cart = \"select * from cart where ip_add='$ip_add'\";\n $run_cart = mysqli_query($db, $select_cart);\n while ($record = mysqli_fetch_array($run_cart)) {\n $pro_id = $record['p_id'];\n $pro_qty = $record['qty'];\n $sub_total = $record['p_price'] * $pro_qty;\n $total += $sub_total;\n }\n echo \"Rs.\" . $total;\n}", "public function prixtotal(){\r\n\t\t\t\trequire(\"connexiondatabase.php\");\r\n\t\t/*on fait ici une somme des différent object commandé et on reourne*/\r\n\t\t$prixtotal=0;\r\n\t\t//on recupere les id des produis sélectionner pour faire la requette\r\n\t\t$ids = array_keys($_SESSION['panier']);\r\n\t\tif (empty($ids)) {//si les id sont vide, \r\n\t\t\t$produits=array(); // \r\n\t\t}else{\r\n\r\n\t\t$produits = $connexion->prepare('SELECT id, prix FROM produits WHERE id IN ('.implode(',' ,$ids).')');\r\n\t\t$produits->execute();\r\n\t\t}\r\n\r\n\t\twhile ($produit=$produits->fetch(PDO::FETCH_OBJ)){\r\n\t\t\t$prixtotal +=$produit->prix*$_SESSION['panier'][$produit->id];\r\n\t\t}\r\n\t\treturn $prixtotal;\r\n\t}", "function total_price()\r\n{\r\n global $db;\r\n $total=0;\r\n $ip_add=getRealIpAddr();\r\n $sel_price=\"select * from cart where ip_add='$ip_add'\";\r\n $run_price=mysqli_query($db,$sel_price);\r\n while($record=mysqli_fetch_array($run_price))\r\n {\r\n $pro_id=$record['p_id'];\r\n $pro_price=\"select * from products where product_id='$pro_id'\";\r\n $run_pro_price=mysqli_query($db,$pro_price);\r\n while($p_price=mysqli_fetch_array($run_pro_price))\r\n {\r\n $product_price=array($p_price['product_price']);\r\n $values=array_sum($product_price);\r\n $total +=$values;\r\n }\r\n }\r\n echo \"Rs. \" .$total;\r\n \r\n}", "function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}", "function totalMoneyTbcbox()\n {\n \n $tbcmoney = mysql_query(\"select sum(tbpv) as tbpv from money_box where m_status='0'\");\n $tottbcmoney = mysql_fetch_assoc($tbcmoney);\n if (mysql_num_rows($tbcmoney) > 0 && !empty($tottbcmoney['tbpv'])) {\n $tbctoal= ($tottbcmoney['tbpv']*(2/100))*1;\n\t\t\t\treturn $tbctoal;\n } else {\n return \"0\";\n }\n }", "function calc_incentivo($pl, $pma, $pmi, $pj, $pv){\n $pt = $_POST[$pl] + $_POST[$pma] + $_POST[$pmi] + $_POST[$pj] + $_POST[$pv];\n $pp = $pt / 5;\n if($pp >= 100){\n $msg = \"Recibir&aacute; incentivos\";\n }else{\n $msg = \"No recibir&aacute; incentivos\";\n }\n echo $msg;\n }", "function calcImpAprox(){\n\n // update query\n $query = \"UPDATE notaFiscalServicoItem AS nfi, itemVenda AS iv, impostoIBPT AS ia\n SET nfi.valorImpAproxFed = ((nfi.valorTotal * ia.taxaNacional)/100),\n nfi.valorImpAproxEst = ((nfi.valorTotal * ia.taxaEstadual)/100),\n nfi.valorImpAproxMun = ((nfi.valorTotal * ia.taxaMunicipal)/100)\n WHERE (iv.ncm = ia.codigo AND ia.tipoImposto='NBS') AND\n nfi.idItemVenda = iv.idItemVenda AND nfi.idNotaFiscal = :idNotaFiscal\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // sanitize\n $stmt->bindParam(\":idNotaFiscal\", $this->idNotaFiscal);\n\n // execute the query\n if($stmt->execute()){\n\n // update query\n $query = \"SELECT SUM(nfi.valorImpAproxFed) AS vlTotFed, SUM(nfi.valorImpAproxEst) AS vlTotEst, SUM(nfi.valorImpAproxMun) AS vlTotMun \n FROM notaFiscalServicoItem AS nfi WHERE nfi.idNotaFiscal = :idNotaFiscal\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // bind values\n $stmt->bindParam(\":idNotaFiscal\", $this->idNotaFiscal);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if (($row['vlTotFed']>0) || ($row['vlTotEst']>0) || ($row['vlTotMun']>0)) {\n\n $msgIBPT = 'Trib aprox R$: '. number_format($row[\"vlTotFed\"],2,',','.').' Federal';\n if ($row['vlTotEst']>0)\n $msgIBPT .= ' e '.number_format($row[\"vlTotEst\"],2,',','.').' Estadual';\n if ($row['vlTotMun']>0)\n $msgIBPT .= ' e '.number_format($row[\"vlTotMun\"],2,',','.').' Municipal';\n $msgIBPT .= ' - Fonte: IBPT';\n\n $this->obsImpostos = $msgIBPT;\n // update query\n $query = \"UPDATE \" . $this->tableName . \" SET obsImpostos = :msgIBPT\n WHERE idNotaFiscal = :idNotaFiscal\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // bind values\n $stmt->bindParam(\":idNotaFiscal\", $this->idNotaFiscal);\n $stmt->bindParam(\":msgIBPT\", $msgIBPT);\n $stmt->execute();\n }\n }\n \n return false;\n }", "function getProfitYTD(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT SUM(revenue) - SUM(expense) AS 'profit' FROM invoices\");\n \n $results=false;\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "function total_price() {\n\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$total=0;\n\t\t\n\t\t$sel_price = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_price = mysqli_query($db, $sel_price);\n\t\t\n\t\twhile ($record= mysqli_fetch_array($run_price)){\n\t\t\t\n\t\t\t$pro_id = $record['p_id'];\n\t\t\t\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\t\t\t\n\t\t\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\t\t\n\t\t\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\t\t\n\t\t\t\t$product_price = array($p_price['product_price']);\n\t\t\t\t\n\t\t\t\t$values = array_sum($product_price);\n\t\t\t\t\n\t\t\t\t$total += $values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\techo \"Rs\" . $total;\n\t\n}", "function CalculTotal($prix) {\n\n $this->totalHT += $prix;\n $this->totalTTC += $prix * (1 + ($this->TVA / 100));\n\n }", "function total_price(){\n\t\n\t\t$total = 0;\n\t\t\n\t\tglobal $con; \n\t\t\n\t\t$ip = getIp(); \n\t\t\n\t\t\n\t\tif(isloggedin()){\n\t\t $c_id=$_SESSION['cid'];\n\t\t \n\t\t $sel_price = \"select * from cart where customer_id='$c_id'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t \n\t\t }\n\t\t}\n\t\telse{\n \t\t \n \t\t$sel_price = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t\n\t\t }\n\t\t\n\t\t}\n\t\t\n\t\techo \" €\" . $total.\" \";\n\t\t\n\t}", "static public function mdlCantTotalVentas($tabla, $item, $valor){\t\n\n\t$stmt = Conexion::conectar()->prepare(\"SELECT `fecha_salida`, sum(cantidad) as canttotal FROM $tabla WHERE fecha_salida=curdate()\");\n \n\t$stmt -> execute();\n\n\treturn $stmt -> fetch();\n\n\t$stmt = null;\n\n}", "function ObtenerTotales($id_factura) {\n $query=\"SELECT SUM(total) total, SUM(valorseguro) total_seguro\nFROM \".Guia::$table.\" WHERE idfactura=$id_factura\";\n return DBManager::execute($query);\n }", "public function get_adjust() \n {\n return $get_data = $this->db->query(\"SELECT sum(nilai_adjust)as nilai_adjust,kode_supp as kode_supp FROM `temp_adjust_barang` where id_karyawan ='\".$this->session->userdata('id_karyawan').\"'\");\n }", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "static public function mdlSumaTotalIngresos($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(total) as total FROM $tabla WHERE banco = 'MercadoPago'\" );\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public function income_total_event() {\n\n $event_id = $this->input->post('id');\n\n $result = $this->db->query(\"SELECT SUM(nominal) AS 'total_pendapatan'\n FROM events_income\n WHERE event_id = \" . $event_id);\n\n if ($result->num_rows() > 0) {\n $result = $result->row_array();\n\n echo number_format($result['total_pendapatan']);\n } else {\n echo 0;\n }\n\n }", "function days_total($table,$column,$filter){\n\tglobal $connection; \n $total= mysqli_query($connection,\"SELECT SUM($column) AS total FROM $table WHERE $filter\") or die(\"Error\".mysqli_error($connection));\n $row = mysqli_fetch_assoc($total);\n if (is_null($row['total'])) {\n \t$total =0;\n }else{\n \t$total = $row['total'];\n }\n return $total;\n}", "function reffer_amount(){\n\t$user_id=$_REQUEST['user_id'];\n\tif(!empty($user_id)){\n\t $reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue_sum('refferal_records', 'refferal_frnd_id', $user_id,'refferal_amount');\n\t\t$user_reffer_amount = $records[0]['total'];\n\t\tif(!empty($user_reffer_amount)){\n\t\t\t$user_reffer_amount=$user_reffer_amount;\n\t\t}else{\n\t\t\t$user_reffer_amount='0';\n\t\t}\n\t\t\t$post = array(\"status\" => \"true\",'reffer_amount'=>$refferal_amount,'user_total_reffer_amount'=>$user_reffer_amount,'user_id'=>$user_id);\n\t\t\n\t\t}else{\n\t\t\t$post = array(\"status\" => \"false\",'message'=>'missing parameter','user_id'=>$user_id);\n\t\t}\n\t\t\techo $this -> json($post);\n}", "function calcPPP($codigo,$id_compra){ \n require_once(\"Y_DB_MySQL.class.php\");\n $db = new My();\n \n \n \n // Datos del Stock Actual\n $db->Query(\"SELECT SUM(cantidad) AS stock_actual,a.costo_prom AS ppp, SUM(cantidad) * a.costo_prom AS valor_stock_actual FROM articulos a, stock s WHERE a.codigo = s.codigo AND s.codigo = '$codigo' AND tipo_ent = 'EM' AND nro_identif <> $id_compra AND s.estado_venta NOT IN( 'FP', 'Bloqueado') GROUP BY s.codigo\");\n $stock_actual = 0;\n $precio_promedio_actual = 0;\n $valor_stock_actual = 0;\n \n if($db->NumRows()>0){\n $db->NextRecord();\n $stock_actual = $db->Get(\"stock_actual\");\n $precio_promedio_actual = $db->Get(\"ppp\");\n $valor_stock_actual = $db->Get(\"valor_stock_actual\");\n } \n \n // Datos de la compra actual + Gastos de la compra actual\n $db->Query(\"SELECT SUM(cant_calc) AS cant_compra, SUM(cant_calc * precio_real) AS valor_stock_comprado,cotiz, sum(d.sobre_costo) as total_gastos ,e.origen, precio_real FROM articulos a, entrada_merc e, entrada_det d \n WHERE e.id_ent = d.id_ent AND a.codigo = d.codigo AND d.codigo = '$codigo' AND e.id_ent = $id_compra and e.estado = 'Cerrada' GROUP BY d.codigo \");\n $cant_compra = 0;\n $valor_stock_comprado = 0;\n $total_gastos = 0;\n $precio_cif = 0;\n $origen = \"Internacional\"; \n if($db->NumRows()>0){\n $db->NextRecord();\n $cant_compra = $db->Get(\"cant_compra\");\n $valor_stock_comprado = $db->Get(\"valor_stock_comprado\"); \n $total_gastos = $db->Get(\"total_gastos\");\n $origen = $db->Get(\"origen\");\n $precio_cif = $db->Get(\"precio_real\");\n } \n \n \n $valor_stock_comprado += $total_gastos;\n \n $nuevo_ppp = ($valor_stock_actual + $valor_stock_comprado) / ($stock_actual + $cant_compra);\n \n $this->makeLog(\"Sistema\", \"Costo PPP\", \"Codigo: $codigo, Stock_Sctual:$stock_actual, Costo PPP Actual:$precio_promedio_actual, Valor Stock Actual: $valor_stock_actual, Cant.Compra Actual: $cant_compra, Valor Compra Actual: $valor_stock_comprado, Ref.: $id_compra\");\n \n return array(\"PPP\" =>$nuevo_ppp,\"PrecioCIF\"=>$precio_cif);\n }", "static public function mdlSumTotVtasServ($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\n\tif($fechacutvta!=null){\n\t $stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, sum(h.cantidad*h.precio_venta) as total FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id WHERE h.$item='\".$fechacutvta.\"' and p.totaliza=2 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n\t}else{\n\t $stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, sum(h.cantidad*h.precio_venta) as total FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id WHERE h.$item=curdate() and p.totaliza=2 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n\t}\n\n\t$stmt -> execute();\n\n\treturn $stmt -> fetch();\n\n\t$stmt = null;\n\n}", "public function dinero(){\n $query = $this->db->query(\"SELECT SUM(price) AS total FROM property_unity WHERE property_id=1 AND status=1\");\n return $query->row();\n }", "static public function mdlTotalingresoegreso($item, $valor, $cerrado, $id_fecha){\n\n\tif($id_fecha!=null){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT ing.monto_ingreso, egr.monto_egreso FROM \n\t\t(SELECT SUM(importe_ingreso) AS monto_ingreso FROM ingresos WHERE fecha_ingreso='\".$id_fecha.\"' AND $item = :$item AND id_corte=:id_corte) ing \n\t\tCROSS JOIN \n\t\t(SELECT SUM(importe_egreso) AS monto_egreso FROM egresos WHERE fecha_egreso='\".$id_fecha.\"' AND $item = :$item AND id_corte=:id_corte) egr\"); \n\n\t\t$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_INT);\n\t\t$stmt -> bindParam(\":id_corte\", $cerrado, PDO::PARAM_INT);\n\t\t$stmt -> execute();\n\t\t\n\t\t\treturn $stmt -> fetch();\n\n\n\t\t$stmt = null;\n\t}else{\n\t\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT ing.monto_ingreso, egr.monto_egreso FROM \n\t\t(SELECT SUM(importe_ingreso) AS monto_ingreso FROM ingresos WHERE fecha_ingreso=curdate() AND $item = :$item AND id_corte=:id_corte) ing \n\t\tCROSS JOIN \n\t\t(SELECT SUM(importe_egreso) AS monto_egreso FROM egresos WHERE fecha_egreso=curdate() AND $item = :$item AND id_corte=:id_corte) egr\"); \n\n\t\t$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_INT);\n\t\t$stmt -> bindParam(\":id_corte\", $cerrado, PDO::PARAM_INT);\n\t\t$stmt -> execute();\n\t\t\n\t\t\treturn $stmt -> fetch();\n\n\n\t\t$stmt = null;\n\t}\n}", "function valorDoBtcComEncargosSaque($param_valor)\n{\n\n//pega o btc e soma valor final do btc com todos encargos\n\n\t$percentual = 0.70 / 100.0; // 15%\n\t$valor_final = $param_valor - ($percentual * $param_valor);\n\t//comissoes 1,99 + 2,90\n\t$percentual2 = 2.0 / 100.0;\n\t$valorTotal = $percentual2 * $param_valor;\n\t\n\t\n\t\n\t$finalTodos = $valor_final - $valorTotal - 3;\n\n\t\treturn $finalTodos;\n}", "public function getDataJeux3($num) {\r\n\t\t$this->load->database('default');\r\n\t\t$sql=\"select sum(quantiteJeu) from concerner,reservation,festival where aRenvoyer=1 and concerner.numReservation=reservation.numReservation and reservation.numFestival=festival.numFestival and festival.numFestival=?\" ;\r\n\t\t$res=$this->db->query($sql,$num);\r\n\t\t$row = $res->row_array();\r\n\t\treturn $row;\r\n}", "function get_user_total_send_diamond($fb_id) \n { //remain task\n\t \tinclude(\"config.php\");\n \t\t$total_send_diamond=\"0\";\n \t\t//ubh_fb_id!=1 and\n \t\t$qrry_get='SELECT sum(ubh_gift_total_diamond) as total_send_diamond FROM `user_baggage_history` WHERE ubh_sender_fb_id='.$fb_id;\n \t\t$Data= mysqli_fetch_assoc(mysqli_query($conn,$qrry_get));\n \t\tif($Data['total_send_diamond']){\n \t\t$total_send_diamond=$Data['total_send_diamond']; \n\t\t}\n\t return $total_send_diamond;\n\t}", "function total_price(){\n $ip_add=getRealIpAddr();\n $total=0;\n global $db;\n $sel_price=\"select * from cart where ip_add='$ip_add'\";\n $run_price =mysqli_query($db,$sel_price);\n while($record=mysqli_fetch_array($run_price)){\n \n $prod_id=$record['p_id'];\n $prod_price=\"select * from products where product_id='$prod_id'\";\n $run_pro_price=mysqli_query($db,$prod_price);\n while($p_price=mysqli_fetch_array($run_pro_price)){\n $product_price=array($p_price['product_price']);\n $values=array_sum($product_price);\n $total = $total + $values;\n }\n }\n\n echo \"INR \" . $total;\n}", "function price(){\n\n\t\t$total = 0; //initialize to 0 lest error\n\n\t\tglobal $con;\n\n\t\t$ip=getIP();\n\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\"; //get price from what is in the cart for whoevers ip address\n\n\t\t$run_price = mysqli_query($con, $sel_price);\n\n\t\twhile ($p_price = mysqli_fetch_array($run_price)){\n\n\t\t\t$pro_id = $p_price['p_id'];\n\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\n\t\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\n\t\t\t//link to the products table to get prices\n\t\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){\n\n\t\t\t\t$product_price = array($pp_price['product_price']);\n\t\t\t\t//array to get all the prices in one\n\n\t\t\t\t$values = array_sum($product_price);\n\n\t\t\t\t$total +=$values; //sum\n\n\t\t\t}\n\t\t}\n\n\t\techo \"Ksh\" . $total;\n\n\t}", "function producto_stock($codigo_producto, $idcolor, $idtalle,$cantidad)\n\t{\n\t\t$query=\"SELECT SUM(cantidad) AS cantidad_total FROM productos AS P inner join productos_stock as PS ON PS.idProducto = P.codigo WHERE codigo = '\".$codigo_producto. \"' and idcolor = '\".$idcolor. \"' and idtalle = '\".$idtalle. \"' group by codigo\";\n\t\t$result = mysql_query($query);\t\n\t\t\n\t\tif($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif($row[\"cantidad_total\"] > $cantidad)\n\t\t\t\t{\n\t\t\t\treturn(\"ok\");\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\treturn($row[\"cantidad_total\"]);\n\t\t\t\t}\n\t\t}\n\n\t}", "function hitung_kgb()\n {\n $query = $this->db->query(\"SELECT\n COUNT(id_pegawai) as jumlah_pejabat\n FROM data_kgb_notif\n WHERE selisih <= 60 \");\n return $query->result();\n }", "public function cesta_con_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta_iva>0?$elArticulo->oferta_iva:$elArticulo->precio_iva;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "function ventas_totales(){\n\t\tglobal $link;\n\t\n\t\t$sql =\"SELECT SUM(importe) FROM consumos\";\n\t\t$query = mysqli_query($link,$sql);\n\t\t$total = mysqli_fetch_assoc($query);\n\t\t\n\t\treturn $total[\"SUM(importe)\"];\n}", "public function sumUnpaidWorkers() \r\n\t{\r\n\t\t$query = \"SELECT sum(plata) as Ukupno FROM \" . $this->table . \" \r\n\t\tWHERE id_plata = 2\";\r\n\r\n\t\t$stmt = $this->conn->prepare($query);\r\n\t\t$stmt->execute();\r\n\r\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t$ukupno = $row['Ukupno'];\r\n\t\t\r\n\t\treturn $ukupno;\r\n\t}", "function total_price2(){\n\tglobal $conn;\n\t$ip = getIp();\n\t$total=0;\n\t$get_cart =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip'\");\n\twhile ( $row_cart=mysqli_fetch_array($get_cart)) {\n\t\t# code...\n\n\t\t$quantity= $row_cart[\"qty\"];\n\t\t$product_id=$row_cart['p_id'];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\twhile ( $row_price = mysqli_fetch_array($get_price)) {\n\t\n\t\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\t$total +=$sub_total;\n\t}\n\t\n\t}\n\t\n\n\treturn $total;\n\n\t\n}", "function totalAmount_necessity() {\r\n global $date;\r\n $query = \"SELECT \r\n (\r\n SELECT SUM(amount)\r\n FROM record\r\n WHERE transaction_type = 'ex'\r\n AND necessity = 0\r\n AND date LIKE '{$date}'\r\n ) AS unneccessary,\r\n (\r\n SELECT SUM(amount)\r\n FROM record\r\n WHERE transaction_type = 'ex'\r\n AND necessity = 1\r\n AND date LIKE '{$date}'\r\n ) AS necessary;\";\r\n //echo $query;\r\n return fetch($query, MYSQLI_ASSOC);\r\n }", "function total_price(){\r\n\t\t$total = 0;\r\n\t\tglobal $con;\r\n\t\t$ip=getIp();\r\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\";\r\n\t\t$run_price = mysqli_query($con,$sel_price);\r\n\t\twhile($p_price=mysqli_fetch_array($run_price)){\r\n\t\t\t\r\n\t\t\t$painting_id = $p_price['painting_id'];\r\n\t\t\t$painting_price = \"select * from painting where painting_id='$painting_id'\";\r\n\t\t\t$run_painting_price = mysqli_query($con,$painting_price);\r\n\t\t\twhile($pp_price = mysqli_fetch_array($run_painting_price)){\r\n\t\t\t\t\r\n\t\t\t\t$painting_price = array($pp_price['painting_price']);\r\n\t\t\t\t$values = array_sum($painting_price);\r\n\t\t\t\t\r\n\t\t\t$total += $values;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\techo \"$\".$total;\r\n\t\t\r\n\t}", "function check_dealformap_price($menuid,$brandid=0,$catid=0)\r\n\t{\r\n\t\t$brandid = 0;\r\n\t\treturn $this->db->query(\"select count(*) as t from m_brand_config_map_price where (menuid = ? and brandid = ? and catid = ? ) and is_active = 1 \",array($menuid,$brandid,$catid))->row()->t; \r\n\t}", "function total_price(){\n\t\t//total price starts from 0\n\t\t$total=0;\n\tglobal $connection;\n\t\t$ip=getIp();\n\t\t//taken data from cart table using the customers ip address\n\t\t$select_price = \"select * from cart where ip_address='$ip'\";\n\t\t$run_price = mysqli_query($connection,$select_price);\n\t\t//this while loop takes data from product table according to the product id \n\t\twhile($product_price=mysqli_fetch_array($run_price)){\n\t\t\t$product_id=$product_price['product_id'];\n\t\t\t$product_price=\"select * from products where product_id='$product_id'\";\n\t\t\t$run_product_price=mysqli_query($connection, $product_price);\n\t\t\t//used an array to get all data into a single variable \n\t\t\twhile($pp_price=mysqli_fetch_array($run_product_price)){\n\t\t\t\t//product prices set in the array to add up\n\t\t\t\t$product_price=array($pp_price['product_price']);\n\t\t\t\t$values=array_sum($product_price);\n\t\t\t\t//total price \n\t\t\t\t$total +=$values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo \"LKR. \" . $total;\n\t}", "public function cesta_sin_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta>0?$elArticulo->oferta:$elArticulo->precio;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "public function getTotalTargetAnggaran()\n\t{\n\t\t$id=$this->id;\n\t\t$sql=\"SELECT IF(SUM(target_anggaran) IS NULL, 0, SUM(target_anggaran)) AS val FROM participant WHERE kegiatan=$id\";\n\t\treturn Yii::app()->db->createCommand($sql)->queryScalar();\n\t}", "public function totalStokBarang()\n\t{\n\t\t$this->db->select_sum('stok');\n\t\t$query = $this->db->get('barang');\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->row()->stok;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "function jumlah_powerdall(){\n\t\t// return $this->db->query($query)->result();\n\t\tdate_default_timezone_set(\"Asia/Makassar\");\n\t\t$kondisi=date(\"m\");\n\t\t$query = \"SELECT SUM(power) as powerm FROM power_s3d WHERE m=$kondisi\";\n\t\treturn $this->db->query($query)->result();\n\t}", "static public function mdlSumTotVtasEnv($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\n if($fechacutvta!=null){\n $stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, sum(h.cantidad*h.precio_venta) as total FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id WHERE h.$item='\".$fechacutvta.\"' and p.totaliza=0 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n }else{\n $stmt = Conexion::conectar()->prepare(\"SELECT h.`fecha_salida`, sum(h.cantidad*h.precio_venta) as total FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id WHERE h.$item=curdate() and p.totaliza=0 and h.id_caja=$valor and h.cerrado=$cerrado AND h.id_tipomov=1\");\n }\n \n //$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n \n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt = null;\n\n}", "public function getTotalPrice();", "public function getTotalPrice();", "public function total();", "public function total();", "public function total();", "function f_total($sql)\n\t{\n return $sql->num_rows;\n }", "function montantTotal()\n{\n $total = 0;\n for ($i = 0; $i < count($_SESSION['panier']['id_produit']); $i++) {\n $total += $_SESSION['panier']['quantite'][$i] * $_SESSION['panier']['prix'][$i];\n }\n return round($total, 2);\n}", "function persenalokasi ($anggaran,$total) {\r\n $persen = ($anggaran / $total) * 100;\r\n return $persen;\r\n }", "function appliquerTVA($prixHT, $TVA) {\n $prixTTC = $prixHT + ($prixHT * $TVA / 100);\n echo \"Le prix TTC est de \";\n return $prixTTC . \"€\";\n}", "function total_bobot_kriteria()\n {\n return $this->db->query(\"\n SELECT sum(bobot_kriteria) as total_bobot_kriteria\n FROM tbl_kriteria z\n \")->result();\n }", "public function total(){\n\t\t$cantidad= mysqli_num_rows($this->sql);\n\t\treturn $cantidad;\n\t}", "function get_commission($conn,$p_id)\n {\n $sql=\"select price,branch_commision,com_type from products where id=$p_id\";\n $res=$conn->query($sql);\n $row = $res->fetch_assoc();\n if($row['com_type']=='Percentage')\n {\n $commision=$row['price']*$row['branch_commision']/100;\n }\n else\n {\n $commision=$row['branch_commision'];\n }\n return $commision;\n }", "public function score($mine,$data){\n\t\t$tahun=$data['tahun'];\n\t\t$hasil = $this->db->query(\"SELECT SUM(rata) as jumlah_nilai FROM `assessment` where target='$mine' AND tahun=$tahun\");\n\t\tif($hasil->num_rows() > 0){\n\t\t\treturn $hasil->result();\n\t\t} else{\n\t\t\treturn 0;\n\t\t}\n\t}", "function inscTotal($inscTotal)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM inscriptions WHERE id_insc = %s\",\n\t\t GetSQLValueString($inscTotal, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"total\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function calcularValorLlamada();", "public function getItemNo_total($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT cashUnpaid from patientCharges where itemNo = '$itemNo' \");\n\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['cashUnpaid'];\n }\n\n}", "public function getSelisihAnggaran()\n\t{\n\t\t$unitkerja=$this->unitkerja;\n\t\t$kegiatan=$this->kegiatan;\n\n\t\t$sql=\"SELECT IF(SUM(jumlah) IS NULL, 0, SUM(jumlah)) AS val FROM value_anggaran WHERE unit_kerja=$unitkerja AND kegiatan=$kegiatan\";\n\t\t$total=Yii::app()->db->createCommand($sql)->queryScalar();\n\t\t\n\t\treturn floor($this->target_anggaran - $total);\n\t}", "function total_pagado($ven_id) {\n// sum(ind_capital_desc) as descuento, sum(ind_capital_inc) as incremento ,\n// sum(ind_costo_pagado) as costo\n// from interno_deuda where ind_tabla='venta' and ind_tabla_id=$ven_id \n// \";\n// $pagado = FUNCIONES::objeto_bd_sql($sql_pag);\n $pagado = FUNCIONES::total_pagado($ven_id);\n return $pagado;\n }", "function get_nilai_awal($tanggal_awal, $bulan_sebelum, $tahun, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_nilai_saldo_awal + produk_nilai_saldo_awal2 + produk_nilai_saldo_awal3 + produk_nilai_saldo_awal4) as produk_nilai_saldo_awal,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal = \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\t\t\t\r\n\t\t\treturn $row_saldo_awal->produk_nilai_saldo_awal;\r\n\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\t(hpp_nilai_awal + hpp_nilai_masuk - hpp_nilai_keluar) as nilai_awal\r\n\t\t\t\t\tFROM hpp_bulan\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thpp_bulan = '$bulan_sebelum' AND hpp_tahun = '$tahun'\";\r\n\t\t\t\r\n\t\t\t$rs_sql \t= $this->db->query($sql);\r\n\t\t\t$row_sql\t= $rs_sql->row();\r\n\t\t\t\r\n\t\t\tif($rs_sql->num_rows()>0){\r\n\t\t\t\treturn $row_sql->nilai_awal;\r\n\t\t\t}\r\n\t\t\telse return 0;\r\n\t\t}\r\n\t}", "function totalSale()\r\n {\r\n //$strSQLQuery = \"SELECT SUM(TotalPrice) as OrderTotal FROM e_orders WHERE PaymentStatus=1 AND OrderStatus='Completed'\";\r\n $strSQLQuery = \"SELECT SUM((CASE when Currency='USD' then TotalPrice \r\n \t\telse TotalPrice/CurrencyValue\r\n\tEND )) as OrderTotal FROM e_orders WHERE (PaymentStatus='1' OR OrderType in('Amazon','Ebay')) AND OrderStatus in ('Completed', 'Shipped','Unshipped') \";\r\n $arrayRow = $this->query($strSQLQuery, 1);\r\n return $arrayRow[0]['OrderTotal'];\r\n }", "function MontantGlobal()\n{\n\t\n\t \nif (isset($_SESSION['panier']))\n\t {\n $total=0;\n for($i = 0; $i < count($_SESSION['panier']['id_produit']); $i++)\n {\n $total += $_SESSION['panier']['qte_produit'][$i] * $_SESSION['panier']['prix_produit'][$i];\n }\n return $total;\n\t }\n\t else\n\t\t return 0;\n}" ]
[ "0.68512666", "0.67468387", "0.6699342", "0.66670656", "0.6634979", "0.66282785", "0.659969", "0.6598023", "0.6595599", "0.6591762", "0.65856314", "0.65799415", "0.6552726", "0.65522057", "0.65497166", "0.6532607", "0.6530876", "0.6518448", "0.6511645", "0.6481683", "0.64686966", "0.6446901", "0.6435402", "0.64352405", "0.641882", "0.63885796", "0.6373247", "0.6359071", "0.6358087", "0.63567054", "0.6352956", "0.63468325", "0.6339277", "0.6326287", "0.6292932", "0.6292538", "0.6286256", "0.6284387", "0.6282296", "0.628228", "0.62771356", "0.6274113", "0.6266013", "0.624224", "0.6233895", "0.62331516", "0.62241465", "0.6218305", "0.62179744", "0.62072927", "0.61926335", "0.61895293", "0.6177226", "0.6162757", "0.61533463", "0.6151759", "0.61503685", "0.614963", "0.6146778", "0.6141712", "0.61376315", "0.6135308", "0.6129971", "0.6121573", "0.61126107", "0.6111692", "0.6102638", "0.609983", "0.60928994", "0.6087533", "0.6083728", "0.6077286", "0.6073613", "0.6069517", "0.60686797", "0.6051562", "0.60507315", "0.6042954", "0.6032689", "0.6025834", "0.6022778", "0.6022778", "0.601767", "0.601767", "0.601767", "0.60095644", "0.5993703", "0.5993482", "0.59918106", "0.59916955", "0.59913415", "0.59882206", "0.59829605", "0.59704846", "0.5965801", "0.5961463", "0.5958414", "0.59581697", "0.5954955", "0.5954491", "0.5952445" ]
0.0
-1
first, check whether the variable $count
private function trailing_zero($count, $length=5) { // is numeric or not if (is_numeric($count)) { $num_string = ""; $length -= strlen($count); for ($i = 0; $i < $length; ++$i) { $num_string .= "0"; } $num_string .= $count; return $num_string; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasCount(){\n return $this->_has(2);\n }", "public function hasCount(){\n return $this->_has(13);\n }", "public function hasCount(){\n return $this->_has(3);\n }", "public function hasCount() {\n return $this->_has(2);\n }", "public function hasCount() {\n return $this->_has(4);\n }", "public function hasCount() {\n return $this->_has(3);\n }", "public function hasCount() {\n return $this->_has(1);\n }", "public function hasCounts(){\n return $this->_has(6);\n }", "public function _count();", "public function hasLimit()\n {\n //check is little different than other stuff\n return ($this->_count > 0 || $this->_offset > 0);\n }", "function count(){}", "function checkArrayCount (array $array, int $count) {\n if (count($array) != $count) {\n return 'Invalid array passed';\n }\n}", "public function hasMaxcount(){\n return $this->_has(10);\n }", "private function process_length($value, $count) {\n if (is_array($value)) {\n if (count($value) != $count) {\n return false;\n } else {\n return true;\n }\n } else {\n if (strlen($value) != $count) {\n return false;\n } else {\n return true;\n }\n }\n }", "public function hasTotalCount() {\n return $this->_has(3);\n }", "public function hasTotalCount() {\n return $this->_has(3);\n }", "public function hasLastCounts(){\n return $this->_has(8);\n }", "protected function check_param_num($count)\n {\n if(count($this->buffer) != $count)\n {\n fwrite(STDERR, \"Error, wrong number of parameters! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n }\n }", "private function validateCountApplication()\n {\n return is_numeric($this->count_applications) && (int)$this->count_applications >= 0;\n }", "abstract public function count();", "abstract public function count();", "abstract public function count();", "abstract public function count();", "public static function count();", "function count() ;", "public function has_items() {\n\t\tif ( $this->{$this->loop_vars['item_count']} ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isCount(): bool\n {\n return $this->isCount;\n }", "function count()\n {\n }", "public abstract function count();", "public abstract function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public function count() {}", "public static function validateCreatedMaxCount(TagInput $control, $count)\n\t{\n\t\treturn count($control->getNewTags()) <= $count;\n\t}", "private function LexemCountChecker($instruction, $count){\n if($instruction->LexemCount != $count){\n echo $instruction->LexemCount;\n $this->Error(ERROR_LEX_SYN_ERR, \"Wrong lexem count for instruction \".$instruction->Opcode);\n }\n }", "protected function _isCount ($fields=array()) {\r\n\t\t\r\n\t\tif (!empty($fields) && is_string($fields) && $fields == 'count') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t\t\r\n\t}", "public function hasUserCount()\n {\n return $this->user_count !== null;\n }", "public function getCount ( ) {\r\n\t\t // Requete SQL\r\n\t\t $req = \"SELECT COUNT(*) AS count FROM \" .$this->table; \r\n\t\t $query = $this->db->prepare($req);\r\n\t\t $query->execute();\r\n\t\t $count = $query->fetch(PDO::FETCH_ASSOC);\r\n\t\t \r\n\t\t // Vérification\r\n\t\t if (count($count) <= 0) {\r\n\t\t return false;\r\n\t\t }\r\n\r\n\t\t return $count['count'];\r\n\t\t}", "public function hasInputsCount()\n {\n return $this->inputs_count !== null;\n }", "function count();", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function hasLimit() {\n return $this->_has(3);\n }", "public function getCount()\n {\n if (isset($this->count)) {\n return $this->count;\n } else {\n return false;\n }\n }", "function hasMore()\n {\n return ($this->bufferSize > 0);\n }", "public /*int*/ function count()\n\t{\n\t\treturn 0;\n\t}", "function count()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $ret = false;\r\n\r\n $db->query_single( $result, \"SELECT COUNT(ID) as Count FROM eZQuiz_Alternative\" );\r\n $ret = $result[$db->fieldName( \"Count\" )];\r\n return $ret;\r\n }", "public function isEmpty()\n {\n if ($this->count == intval(0)) {\n return true;\n } else if ($this->count > intval(0)) {\n return false;\n }\n }", "public function valid()\n {\n return $this->_key + 1 <= $this->_limit;\n }", "public function valid()\n {\n if(is_null($this->paginationVar))\n return true;\n return $this->curIndex < count($this->res);\n }", "public function hasNumRowsLimit(){\n return $this->_has(7);\n }", "public function testCount()\n\t{\n\t\t$this->assertEquals(3, count($this->instance));\n\t}", "public function valid(): bool\n {\n return $this->_index < $this->_count;\n }", "public function check(): bool\n {\n if (0 == $this->limit) {\n return false;\n }\n\n $key = $this->parseKey();\n\n if ($this->limit > $this->count($key, $this->time)) {\n $this->hit($key, $this->time);\n\n return false;\n }\n\n return true;\n }", "public static function validateCreatedMinCount(TagInput $control, $count)\n\t{\n\t\treturn count($control->getNewTags()) >= $count;\n\t}", "public function valid(){\n return $this->index < count($this->ids);\n }", "public function count() { }", "public function valid()\n\t{\n\t\treturn $this->key() < $this->_totalItemCount;\n\t}", "public static function hasItems() {\n\t\treturn self::itemCount() > 0;\n\t}", "public function hasResults() {\n\t\treturn $this->count() >= 1;\n\t}", "public function count(): int;", "public function count(): int;", "public function count(): int;", "public function count(): int;", "public function count(): int;", "public function count(): int;", "public function count(): int;" ]
[ "0.70913804", "0.7075427", "0.7035054", "0.69297856", "0.68942684", "0.6864093", "0.684082", "0.6762836", "0.6630116", "0.66145325", "0.65898955", "0.6577253", "0.6572112", "0.65165854", "0.6493356", "0.6493356", "0.6482539", "0.6454647", "0.6439775", "0.6388984", "0.6388984", "0.6388984", "0.6388984", "0.6374672", "0.6329848", "0.6289014", "0.62713134", "0.6269389", "0.6226039", "0.6226039", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.62250054", "0.621424", "0.621424", "0.621424", "0.621424", "0.621424", "0.621424", "0.621424", "0.621424", "0.621424", "0.621424", "0.621424", "0.6212555", "0.6212555", "0.6208246", "0.620014", "0.615971", "0.61336905", "0.6108728", "0.61084396", "0.6100808", "0.6100313", "0.6100313", "0.6100313", "0.6100313", "0.6100313", "0.60948646", "0.60734135", "0.606964", "0.60670894", "0.6057955", "0.6056446", "0.60543114", "0.6053191", "0.60029083", "0.5994392", "0.5987415", "0.59863424", "0.5977671", "0.5965024", "0.5959088", "0.5957461", "0.59567267", "0.5945695", "0.5945695", "0.5945695", "0.5945695", "0.5945695", "0.5945695", "0.5945695" ]
0.0
-1
$type = 'D' > DAILY ; 'M' > MONTHLY
function fetch_payment($type, $param1, $param2='') { // $param1; for D -> DATE, for M -> MONTH // $param2, for D -> null, for M -> YEAR // UPDATE FOR MARCH 3, 2011 paramita_fee * 1.35 $sql = "SELECT x.appointment_id, x.receipt_no, t.method as payment_method, x.date, y.doctor_fee, y.administration_fee, y.lab_fee, (1.35 * y.paramita_fee) as paramita_fee, y.proc_fee, JUMLAH_HARGA_OBAT_BY_APP(x.appointment_id) as med_fee, y.amc_package_fee, w.appointment_date as app_date, z.nickname, w.patient_type as status, w.service_procedure, v.name as nurse_name, w.other_doctor_name, u.name as doctor_name, x.disc_amount, x.disc_percentage FROM tb_payment_method as t, tb_doctor as u, tb_nurse as v, tb_appointment as w, tb_payment as x, tb_billing as y, tb_patient as z WHERE x.appointment_id = y.id_appointment AND x.appointment_id = w.appointment_number AND w.nurse_id = v.id AND u.id = w.doctor_id AND x.payment_method = t.id AND w.mr_no = z.mr_no"; if ($type == 'D'){ $sql .= " AND x.date = ?"; $query = $this->db->query($sql, $param1); } else { $sql .= " AND MONTH(x.date) = ? AND YEAR(x.date) = ?"; $query = $this->db->query($sql, array($param1,$param2)); } if ($query->num_rows() > 0) return $query->result(); else return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function period_fun($type){\n\t\tif($type == 'D'){\n\t\t\t$st = 'Daily';\n\t\t}else if($type == 'M'){\t\n\t \t\t$st = 'Monthly';\n\t\t}else if($type == 'H'){\n\t\t\t$st = 'Half yearly';\n\t\t}\n\t\treturn $st;\n\t}", "function date_diasemana($date,$type='') {\n\n if (!empty($date)) {\n\n #pega informações da data\n $date = en2timestamp($date);\n $wday = getdate($date);\n $wday = $wday['wday']; #usa apenas o dia da semana em números de 0 a 6\n\n switch($wday) {\n case 0: $s_min = 'dom'; $s_nor = 'domingo';\n break;\n case 1: $s_min = 'seg'; $s_nor = 'segunda';\n break;\n case 2: $s_min = 'ter'; $s_nor = 'terça';\n break;\n case 3: $s_min = 'qua'; $s_nor = 'quarta';\n break;\n case 4: $s_min = 'qui'; $s_nor = 'quinta';\n break;\n case 5: $s_min = 'sex'; $s_nor = 'sexta';\n break;\n case 6: $s_min = 'sab'; $s_nor = 'sábado';\n break;\n }\n\n $return = empty($type)?$s_nor:$s_min;\n\n return $return;\n\n }\n\n }", "function isDateType($type)\n{\n return($type == \"date\" or $type == \"year\" or isTimeType($type));\n}", "function get_mnt_strt_day($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return format \"0\" (Sunday) to \"6\" (Saturday)\n return date(\"w\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n elseif ($type=='2'){\n // Return Fri format \n return date(\"D\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n elseif ($type=='3'){\n // Return Friday format\n return date(\"l\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n }", "function getDateforStdFilterBytype($type)\n\t{\n\t\t//$thisyear = date(\"Y\");\n\t\t$maxdate = \"2099-12-31\";\n\t\t$mindate = \"1900-01-01\";\n\t\t$datevalue = array();\n\n\t\tif($type == \"today\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"yesterday\" )\n\t\t{\n\t\t\t$yesterday = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-1, date(\"Y\")));\n\t\t\t$datevalue[0] = $yesterday;\n\t\t\t$datevalue[1] = $yesterday;\n\t\t}\n\t\telseif($type == \"tomorrow\" )\n\t\t{\n\t\t\t$tomorrow = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\")));\n\t\t\t$datevalue[0] = $tomorrow;\n\t\t\t$datevalue[1] = $tomorrow;\n\t\t}\n\t\telseif($type == \"thisweek\" )\n\t\t{\n\t\t\t$thisweek0 = date(\"Y-m-d\",strtotime(\"-1 week Sunday\"));\n\t\t\t$thisweek1 = date(\"Y-m-d\",strtotime(\"this Saturday\"));\n\t\t\t$datevalue[0] = $thisweek0;\n\t\t\t$datevalue[1] = $thisweek1;\n\t\t}\n\t\telseif($type == \"lastweek\" )\n\t\t{\n\t\t\t$lastweek0 = date(\"Y-m-d\",strtotime(\"-2 week Sunday\"));\n\t\t\t$lastweek1 = date(\"Y-m-d\",strtotime(\"-1 week Saturday\"));\n\t\t\t$datevalue[0] = $lastweek0;\n\t\t\t$datevalue[1] = $lastweek1;\n\t\t}\n\t\telseif($type == \"nextweek\" )\n\t\t{\n\t\t\t$nextweek0 = date(\"Y-m-d\",strtotime(\"this Sunday\"));\n\t\t $nextweek1 = date(\"Y-m-d\",strtotime(\"+1 week Saturday\"));\n\t\t\t$datevalue[0] = $nextweek0;\n\t\t\t$datevalue[1] = $nextweek1;\n\t\t}\n\t\telseif($type == \"thismonth\" )\n\t\t{\n\t\t\t$currentmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\"), \"01\", date(\"Y\")));\n\t\t\t$currentmonth1 = date(\"Y-m-t\");\n\t\t\t$datevalue[0] =$currentmonth0;\n\t\t\t$datevalue[1] = $currentmonth1;\n\t\t}\n\n\t\telseif($type == \"lastmonth\" )\n\t\t{\n\t\t\t$lastmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\")-1, \"01\", date(\"Y\")));\n\t\t\t$lastmonth1 = date(\"Y-m-t\", mktime(0, 0, 0, date(\"m\")-1, \"01\", date(\"Y\")));\n\t\t\t$datevalue[0] = $lastmonth0;\n\t\t\t$datevalue[1] = $lastmonth1;\n\t\t}\n\t\telseif($type == \"nextmonth\" )\n\t\t{\n\t\t\t$nextmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\")+1, \"01\", date(\"Y\")));\n\t\t $nextmonth1 = date(\"Y-m-t\", mktime(0, 0, 0, date(\"m\")+1, \"01\", date(\"Y\")));\n\t\t\t$datevalue[0] = $nextmonth0;\n\t\t\t$datevalue[1] = $nextmonth1;\n\t\t}\n\t\telseif($type == \"next3days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+2, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next7days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+6, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next15days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+14, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+29, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$today;\n\t\t\t$datevalue[1] =$next30days;\n\t\t}\n\t\telseif($type == \"next60days\" )\n\t\t{\n\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+59, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next60days;\n\t\t}\n\t\telseif($type == \"next90days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next90days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+89, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next90days;\n\t\t}\n\t\telseif($type == \"next180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+179, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next180days;\n\t\t}\n\t\telseif($type == \"before3days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-3, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before7days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-7, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before15days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-15, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before30days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-30, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$mindate;\n\t\t\t$datevalue[1] =$before30days;\n\t\t}\n\t\telseif($type == \"before60days\" )\n\t\t{\n\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-60, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before60days;\n\t\t}\n\t\telseif($type == \"before100days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before100days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-100, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before100days;\n\t\t}\n\t\telseif($type == \"before180days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-180, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before180days;\n\t\t}\n\t\telseif($type == \"after3days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+2, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after7days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+6, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after15days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+14, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+29, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$after30days;\n\t\t\t$datevalue[1] =$maxdate;\n\t\t}\n\t\telseif($type == \"after60days\" )\n\t\t{\n\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+59, date(\"Y\")));\n\t\t\t$datevalue[0] = $after60days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after100days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after100days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+99, date(\"Y\")));\n\t\t\t$datevalue[0] = $after100days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+179, date(\"Y\")));\n\t\t\t$datevalue[0] = $after180days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"last3days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-2, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last7days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-6, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last15days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-14, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-29, date(\"Y\")));\n\t\t\t$datevalue[0] = $last30days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last60days\" )\n\t\t{\n\t\t\t$last60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-59, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $last60days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telse if($type == \"last90days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last90days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-89, date(\"Y\")));\n\t\t\t$datevalue[0] = $last90days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-179, date(\"Y\")));\n\t\t\t$datevalue[0] = $last180days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"thisfy\" )\n\t\t{\n\t\t\t$currentFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")));\n\t\t\t$currentFY1 = date(\"Y-m-t\",mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $currentFY0;\n\t\t\t$datevalue[1] = $currentFY1;\n\t\t}\n\t\telseif($type == \"prevfy\" )\n\t\t{\n\t\t\t$lastFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")-1));\n\t\t\t$lastFY1 = date(\"Y-m-t\", mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")-1));\n\t\t\t$datevalue[0] = $lastFY0;\n\t\t\t$datevalue[1] = $lastFY1;\n\t\t}\n\t\telseif($type == \"nextfy\" )\n\t\t{\n\t\t\t$nextFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")+1));\n\t\t\t$nextFY1 = date(\"Y-m-t\", mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")+1));\n\t\t\t$datevalue[0] = $nextFY0;\n\t\t\t$datevalue[1] = $nextFY1;\n\t\t}\n\t\telseif($type == \"nextfq\" )\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n \t\t}else if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")+1));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")+1));\n \t\t}\n\t\t\t$datevalue[0] = $nFq;\n\t\t\t$datevalue[1] = $nFq1;\n\t\t}\n\t\telseif($type == \"prevfq\" )\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")-1));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")-1));\n \t\t}\n\t\t\telse if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n \t\t}\n\t\t\t$datevalue[0] = $pFq;\n\t\t\t$datevalue[1] = $pFq1;\n\t\t}\n\t\telseif($type == \"thisfq\")\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")));\n \t\t}\n\t\t\t$datevalue[0] = $cFq;\n\t\t\t$datevalue[1] = $cFq1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$datevalue[0] = \"\";\n\t\t\t$datevalue[1] = \"\";\n\t\t}\n\n\t\treturn $datevalue;\n\t}", "function get_month($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return January format\n return $this->translate_month($this->cal_lang,date(\"F\",mktime(0,0,0,$date_split[1],$date_split[0],$date_split[2])));}\n elseif ($type=='2'){\n // Return Jan format\n return date(\"M\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='3'){\n // Return 01 format\n return date(\"m\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='4'){\n // Return 1 format\n return date(\"n\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n }", "protected function frequency()\n {\n return 'monthly';\n }", "protected function getDateTypes()\n {\n return [\n 'MICROSECOND',\n 'SECOND',\n 'MINUTE',\n 'HOUR',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'QUARTER',\n 'YEAR',\n 'SECOND_MICROSECOND',\n 'MINUTE_MICROSECOND',\n 'MINUTE_SECOND',\n 'HOUR_MICROSECOND',\n 'HOUR_SECOND',\n 'HOUR_MINUTE',\n 'DAY_MICROSECOND',\n 'DAY_SECOND',\n 'DAY_MINUTE',\n 'DAY_HOUR',\n 'YEAR_MONTH',\n ];\n }", "public function getDataWithTypeDate() {}", "public function getDateFormat($type = \\IntlDateFormatter::SHORT);", "function getDateFormat($type)\n{\n switch ($type) {\n case 'date':\n return '%Y-%m-%d';\n case 'datetime':\n return '%Y-%m-%d %I:%M:%S';\n case 'time':\n case 'timestamp':\n return '%I:%M:%S';\n case 'year':\n return '%Y';\n default: return '';\n }\n}", "function wcs_get_subscription_date_types() {\n\n\t$dates = array(\n\t\t'start' => _x( 'Start Date', 'table heading', 'woocommerce-subscriptions' ),\n\t\t'trial_end' => _x( 'Trial End', 'table heading', 'woocommerce-subscriptions' ),\n\t\t'next_payment' => _x( 'Next Payment', 'table heading', 'woocommerce-subscriptions' ),\n\t\t'last_payment' => _x( 'Last Order Date', 'table heading', 'woocommerce-subscriptions' ),\n\t\t'cancelled' => _x( 'Cancelled Date', 'table heading', 'woocommerce-subscriptions' ),\n\t\t'end' => _x( 'End Date', 'table heading', 'woocommerce-subscriptions' ),\n\t);\n\n\treturn apply_filters( 'woocommerce_subscription_dates', $dates );\n}", "function wcs_display_date_type( $date_type, $subscription ) {\n\n\tif ( 'last_payment' === $date_type ) {\n\t\t$display_date_type = false;\n\t} elseif ( 'cancelled' === $date_type && 0 == $subscription->get_date( $date_type ) ) {\n\t\t$display_date_type = false;\n\t} else {\n\t\t$display_date_type = true;\n\t}\n\n\treturn apply_filters( 'wcs_display_date_type', $display_date_type, $date_type, $subscription );\n}", "public static function parseDate ($type, $year, $month)\n {\n $date = new Carbon();\n $currYear = $date->year;\n\n if ($type === \"year\") {\n $getMonth = [\n 'Jan' => 0,\n 'Feb' => 1,\n 'Mar' => 2,\n 'Apr' => 3,\n 'May' => 4,\n 'Jun' => 5,\n 'Jul' => 6,\n 'Aug' => 7,\n 'Sep' => 8,\n 'Oct' => 9,\n 'Nov' => 10,\n 'Dec' => 11\n ];\n\n return $getMonth;\n }\n else {\n $currMonth = $date->formatLocalized('%b');\n $currDay = $date->day;\n\n # Sets up the expected dataformat\n $monthData = [\n 'Jan' => [\n 'int' => 1,\n 'days' => 31\n ],\n 'Feb' => [\n 'int' => 2,\n 'days' => LogitFunctions::is_leap_year($year)\n ],\n 'Mar' => [\n 'int' => 3,\n 'days' => 31\n ],\n 'Apr' => [\n 'int' => 4,\n 'days' => 30\n ],\n 'May' => [\n 'int' => 5,\n 'days' => 31\n ],\n 'Jun' => [\n 'int' => 6,\n 'days' => 30\n ],\n 'Jul' => [\n 'int' => 7,\n 'days' => 31\n ],\n 'Aug' => [\n 'int' => 8,\n 'days' => 31\n ],\n 'Sep' => [\n 'int' => 9,\n 'days' => 30\n ],\n 'Oct' => [\n 'int' => 10,\n 'days' => 31\n ],\n 'Nov' => [\n 'int' => 11,\n 'days' => 30\n ],\n 'Dec' => [\n 'int' => 12,\n 'days' => 31\n ]\n ];\n\n\n if ($year == $currYear) {\n $monthData[$currMonth]['days'] = $currDay;\n\n $foundMonth = false;\n\n // Loops through all months. When we arrive at current month, remove all after\n foreach ($monthData as $key => $md) {\n if ($key == $currMonth) {\n $foundMonth = true;\n continue;\n }\n\n if ($foundMonth) {\n unset($monthData[$key]);\n }\n }\n }\n return $monthData;\n }\n }", "function diasemana($data){\r\n\t$data = value_date($data);\r\n\tif(!is_null($data)){\r\n\t\t$arr_data = explode(\"-\", $data);\r\n\t\t$i_semana = date(\"w\", mktime(0, 0, 0, $arr_data[1], $arr_data[2], $arr_data[0]));\r\n\t\tswitch($i_semana){\r\n\t\t\tcase \"0\": return \"domingo\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"1\": return \"segunda-feira\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"2\": return \"terça-feira\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"3\": return \"quarta-feira\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"4\": return \"quinta-feira\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"5\": return \"sexta-feira\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"6\": return \"sabado\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault : return NULL;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n}", "protected function getPeriodicidad() {\n\t\treturn 'mensual';\n\t}", "function affdate_archive($date, $type = 'mois') {\n\t\treturn affdate_base($date, 'annee').'-'.affdate_base($date, 'mois').(($type == 'jour')?'-'.affdate($date, 'd'):'');\n\t}", "public function get_term() {\n $m = date('M');\n \n //if it is jan. - april, we're in the spring\n if ($m < 5)\n return '01';\n \n //if it's May - August, we're in the summer\n else if ($m < 9) {\n return '02';\n } \n \n //otherwise, it's fall\n else return '03';\n }", "public function get_day_types(int $y,int $m){\n\t\t$domingos=0;\n\t\t$feriados=0;\n\t\t$laborables=0;\n\t\t$laborados=0;\n\t\t$permisos=0;\n\t\t$inasistencias=0;\n\t\t$total_days=cal_days_in_month(0,$m,$y);\n\t\tif($y==date('Y') && $m==date('m')){\n\t\t\t$days=date('d');\n\t\t}\n\t\telse{\n\t\t\t$days=cal_days_in_month(0,$m,$y);\n\t\t}\n\t\tfor($d=1;$d<=$days;$d++){\n\t\t\tif(Timemanager::is_holiday($y,$m,$d)){\n\t\t\t\t$feriados++;\n\t\t\t}\n\t\t\telseif(!Timemanager::is_laborable($y,$m,$d)){\n\t\t\t\t$domingos++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$laborables++;\n\t\t\t}\n\t\t\tif(Timemanager::is_laborable($y,$m,$d) && !Timemanager::is_holiday($y,$m,$d)){\n\t\t\t\ttry {\n\t\t\t\t\tif(!$this->asistio($y,$m,$d)){\n\t\t\t\t\t\tif(Baja::count([\n\t\t\t\t\t\t\t'conditions'=>[\n\t\t\t\t\t\t\t\t'employee_id = ? and start => ? AND end <= ?',\n\t\t\t\t\t\t\t\t$this->id,\n\t\t\t\t\t\t\t\t$y.'-'.$m.'-'.$d,\n\t\t\t\t\t\t\t\t$y.'-'.$m.'-'.$d\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t])>0){\n\t\t\t\t\t\t\t$permisos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$inasistencias++;\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\t$laborados++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tBaja::table()->last_sql;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn['transcurridos'=>$days,'total_days'=>$total_days,'domingos'=>$domingos,'feriados'=>$feriados,'laborados'=>$laborados,'laborables'=>$laborables,'permisos'=>$permisos,'inasistencias'=>$inasistencias];\n\n\t}", "public function getDateFormat($type = null);", "private function isDateType(array $type): bool\n {\n foreach ($type as $def) {\n if (strpos($def, 'Date') !== false) {\n return true;\n }\n }\n\n return false;\n }", "public function get_recurring_period_type(){\n\t\treturn $this->payment['recurring_period_type'];\n\t}", "function turnitintooltwo_generate_part_dates($renewdates, $datetype, $part, $i) {\n if ($renewdates) {\n switch ($datetype) {\n case 'start':\n return gmdate(\"Y-m-d\\TH:i:s\\Z\", time());\n case 'due':\n case 'post':\n return gmdate(\"Y-m-d\\TH:i:s\\Z\", strtotime(\"+1 week\"));\n default:\n return NULL;\n }\n } else {\n $attribute = \"dt\".$datetype.$i;\n return gmdate(\"Y-m-d\\TH:i:s\\Z\", $part->$attribute);\n }\n}", "function find_cadets_get_vals($which){\n\nswitch($which) {\n case \"months\":\n $retval = array('','January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\n break;\n case \"monthAbbrev\":\n $retval = array('','January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\n break;\n case \"days\":\n $retval = array('', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');\n break;\n default:\n $retval = \"\";\n}\n\nreturn($retval);\n}", "public function getDay($date=null,$type=null){\n\t\tif(!empty($type)){\n\t\t\treturn $this->getDayLang(date('l', strtotime($date)));\n\t\t}else{\n\t\t\treturn $this->getDayLang(date('D', strtotime($date)));\n\t\t}\n\t}", "public function showDate($type)\n {\n $gett = getdate();\n $annee=$gett['year'];\n $mois=$gett['mon']; \n $jour=$gett['mday']; \n $heure=$gett['hours'];\n $minutes=$gett['minutes'];\n $second=$gett['seconds'];\n\n if($type=='date')\n $currentDate=$annee.'-'.$mois.'-'.$jour;\n else if($type=='datetime')\n $currentDate=$annee.'-'.$mois.'-'.$jour.' '.$heure.':'.$minutes.':'.$second;\n\n return $currentDate;\n }", "public static function getDateFilterTypes()\n\t{\n\t\t$dateFilters = Array('custom' => array('label' => 'LBL_CUSTOM'),\n\t\t\t'prevfy' => array('label' => 'LBL_PREVIOUS_FY'),\n\t\t\t'thisfy' => array('label' => 'LBL_CURRENT_FY'),\n\t\t\t'nextfy' => array('label' => 'LBL_NEXT_FY'),\n\t\t\t'prevfq' => array('label' => 'LBL_PREVIOUS_FQ'),\n\t\t\t'thisfq' => array('label' => 'LBL_CURRENT_FQ'),\n\t\t\t'nextfq' => array('label' => 'LBL_NEXT_FQ'),\n\t\t\t'yesterday' => array('label' => 'LBL_YESTERDAY'),\n\t\t\t'today' => array('label' => 'LBL_TODAY'),\n\t\t\t'tomorrow' => array('label' => 'LBL_TOMORROW'),\n\t\t\t'lastweek' => array('label' => 'LBL_LAST_WEEK'),\n\t\t\t'thisweek' => array('label' => 'LBL_CURRENT_WEEK'),\n\t\t\t'nextweek' => array('label' => 'LBL_NEXT_WEEK'),\n\t\t\t'lastmonth' => array('label' => 'LBL_LAST_MONTH'),\n\t\t\t'thismonth' => array('label' => 'LBL_CURRENT_MONTH'),\n\t\t\t'nextmonth' => array('label' => 'LBL_NEXT_MONTH'),\n\t\t\t'last7days' => array('label' => 'LBL_LAST_7_DAYS'),\n\t\t\t'last15days' => array('label' => 'LBL_LAST_15_DAYS'),\n\t\t\t'last30days' => array('label' => 'LBL_LAST_30_DAYS'),\n\t\t\t'last60days' => array('label' => 'LBL_LAST_60_DAYS'),\n\t\t\t'last90days' => array('label' => 'LBL_LAST_90_DAYS'),\n\t\t\t'last120days' => array('label' => 'LBL_LAST_120_DAYS'),\n\t\t\t'next15days' => array('label' => 'LBL_NEXT_15_DAYS'),\n\t\t\t'next30days' => array('label' => 'LBL_NEXT_30_DAYS'),\n\t\t\t'next60days' => array('label' => 'LBL_NEXT_60_DAYS'),\n\t\t\t'next90days' => array('label' => 'LBL_NEXT_90_DAYS'),\n\t\t\t'next120days' => array('label' => 'LBL_NEXT_120_DAYS')\n\t\t);\n\t\tforeach ($dateFilters as $filterType => $filterDetails) {\n\t\t\t$dateValues = \\DateTimeRange::getDateRangeByType($filterType);\n\t\t\t$dateFilters[$filterType]['startdate'] = $dateValues[0];\n\t\t\t$dateFilters[$filterType]['enddate'] = $dateValues[1];\n\t\t}\n\t\treturn $dateFilters;\n\t}", "function convert_period_string($period) {\n\tswitch($period)\n\t{\n\t\tcase \"1\":\n\t\t\t$period = '1st';\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\t$period = '2nd';\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\t$period = '3rd';\n\t\t\tbreak;\n\t\tcase \"OT\":\n\t\t\t$period = 'Overtime';\n\t\t\tbreak;\n\t\tcase \"complete\":\n\t\t\t$period = 'Final';\n\t\t\tbreak;\n\t}\n\treturn $period;\n}", "public function getTimeFormat($type = null);", "public function getTimeFormat($type = null);", "function wcs_get_date_meta_key( $date_type ) {\n\tif ( ! is_string( $date_type ) ) {\n\t\treturn new WP_Error( 'woocommerce_subscription_wrong_date_type_format', __( 'Date type is not a string.', 'woocommerce-subscriptions' ) );\n\t} elseif ( empty( $date_type ) ) {\n\t\treturn new WP_Error( 'woocommerce_subscription_wrong_date_type_format', __( 'Date type can not be an empty string.', 'woocommerce-subscriptions' ) );\n\t}\n\treturn apply_filters( 'woocommerce_subscription_date_meta_key_prefix', sprintf( '_schedule_%s', $date_type ), $date_type );\n}", "function getEndDate($startDate, $duration, $type)\n\t{\n\t\t$year \t= (int)substr($startDate,0,4);\n\t\t$month \t= (int)substr($startDate,5,2);\n\t\t$day \t= (int)substr($startDate,8,2);\n\t\t$endDate = '';\n\t\t//echo $startDate.\" \".$month;exit;\n\t\tif($type == 'Month')\n\t\t{\n\t\t\t$endDate = mktime(0,0,0,$month + $duration, $day, $year);\n\t\t\t$endDate = date(\"Y-m-d\", $endDate);\n\t\t}\n\t\telse if($type == 'Week')\n\t\t{\n\t\t\t$duration = $duration * 7;\n\t\t\t$endDate = mktime(0,0,0,$month , $day + $duration, $year);\n\t\t\t$endDate = date(\"Y-m-d\", $endDate);\n\t\t}\n\t\telse if($type == 'Day')\n\t\t{\n\t\t\t$endDate = mktime(0,0,0,$month , $day + $duration, $year);\n\t\t\t$endDate = date(\"Y-m-d\", $endDate);\n\t\t}\n\t\telse if($type == 'Year')\n\t\t{\n\t\t\t$endDate = mktime(0,0,0,$month , $day, $year + $duration);\n\t\t\t$endDate = date(\"Y-m-d\", $endDate);\n\t\t}\n\t\t//echo $month.\" = \".$month + $duration.$type.$duration;exit;\n\t\treturn $endDate;\n\t}", "function get_type($material_type){\n switch ($material_type) {\n case \"ARTIGO DE JORNAL\":\n return \"article-newspaper\";\n break;\n case \"ARTIGO DE PERIODICO\":\n return \"article-journal\";\n break;\n case \"PARTE DE MONOGRAFIA/LIVRO\":\n return \"chapter\";\n break;\n case \"APRESENTACAO SONORA/CENICA/ENTREVISTA\":\n return \"interview\";\n break;\n case \"TRABALHO DE EVENTO-RESUMO\":\n return \"paper-conference\";\n break;\n case \"TRABALHO DE EVENTO\":\n return \"paper-conference\";\n break; \n case \"TESE\":\n return \"thesis\";\n break; \n case \"TEXTO NA WEB\":\n return \"post-weblog\";\n break;\n }\n}", "function isTimeType($type)\n{\n return($type == \"datetime\" or $type == \"time\" or $type == \"timestamp\");\n}", "static function get_mois($num) {\r\n if ($num < 1 || $num > 12)\r\n return false;\r\n $langserver = $_SERVER[\"HTTP_ACCEPT_LANGUAGE\"];\r\n switch ($num) {\r\n case 1: {\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Janvier\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"January\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Janvier\";\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case 2: {\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Février\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"February\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Février\";\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case 3: {\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Mars\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"March\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Mars\";\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case 4:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Avril\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"April\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Avril\";\r\n break;\r\n }\r\n }\r\n break;\r\n case 5:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Mai\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"May\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Mai\";\r\n break;\r\n }\r\n }\r\n break;\r\n case 6:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Juin\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"June\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Juin\";\r\n break;\r\n }\r\n }\r\n break;\r\n case 7:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Juillet\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"July\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Juillet\";\r\n break;\r\n }\r\n }\r\n break;\r\n case 8:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Août\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"August\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Août\";\r\n break;\r\n }\r\n }\r\n break;\r\n case 9:\r\n $mois = \"Septembre\";\r\n break;\r\n case 10:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Octobre\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"October\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Octobre\";\r\n break;\r\n }\r\n }\r\n break;\r\n case 11:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Novembre\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"November\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Novembre\";\r\n break;\r\n }\r\n }\r\n break;\r\n case 12:\r\n switch (strtolower(substr($langserver, 0, 2))) {\r\n case \"fr\": {// cas de navigateur français\r\n $mois = \"Décembre\";\r\n break;\r\n }\r\n case \"en\": {// cas de navigateur anglais\r\n $mois = \"December\";\r\n break;\r\n }\r\n default: {\r\n $mois = \"Décembre\";\r\n break;\r\n }\r\n }\r\n break;\r\n default : {\r\n return \"Mois\";\r\n }\r\n }\r\n return $mois;\r\n }", "public function getMonth4String($date=null, $type=null){\n\t\tif(!empty($type)){\n\t\t\treturn $this->getMonthLang(date_format($this->createDate($date),\"F\"));\n\t\t}else{\n\t\t\treturn $this->getMonthLang(date_format($this->createDate($date),\"M\"));\n\t\t}\n\t}", "function get_bulan($bln) \n{\nswitch ($bln){\n case 1;\n\t\t return \"Jan\";\n\t\t break;\n case 2;\n\t\t return \"Feb\";\n\t\t break;\n\t\tcase 3;\n\t\t return \"Mar\";\n\t\t break;\n\t\tcase 4;\n\t\t return \"Apr\";\n\t\t break;\n\t\tcase 5;\n\t\t return \"Mei\";\n\t\t break;\n\t\tcase 6;\n\t\t return \"Jun\";\n\t\t break;\n\t\tcase 7;\n\t\t return \"Jul\";\n\t\t break;\n\t\tcase 8;\n\t\t return \"Agu\";\n\t\t break;\n\t\tcase 9;\n\t\t return \"Sept\";\n\t\t break;\n\t\tcase 10;\n\t\t return \"Okt\";\n\t\t break;\n\t\tcase 11;\n\t\t return \"Nov\";\n\t\t break;\n\t\tcase 12;\n\t\t return \"Des\";\n\t\t break;\n\n}\n\n}", "private function getNewExpiresDateString($type = 'short')\n\t{\n\t\t$modifier = $this->config[$type]['period'];\n\t\treturn with(new Date('now'))->modify('+' . $modifier . ' MINUTES')->toSql();\n\t}", "protected function months_dropdown($post_type)\n {\n }", "public function get_available_days($type){\n $sql = \"SELECT DISTINCT `day` FROM wp_dcms_reservation_config\n WHERE `type`='{$type}' and qty > 0\";\n $result = $this->wpdb->get_results( $sql );\n\n error_log(print_r($result,true));\n\n $res = [];\n foreach ($result as $item){\n $res[] = $item->day;\n }\n\n return $res;\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 types()\n {\n return [\n self::TYPE_PERSONAL => Yii::t('app', 'Personal'),\n self::TYPE_BUSINESS => Yii::t('app', 'Business'),\n self::TYPE_CUSTOM => Yii::t('app', Yii::$app->holidaySettings->customHolidayName)\n ];\n }", "public function type($type);", "function GetSalaryMonthList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n //得到登陆员工的计薪期间代码 add by Jack\n $period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n $_where = is_null($type) ? \" and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \"\";\n\n $sql_string = <<<_LeaveYearList_\n select distinct mm as mm1,\n mm as mm2\n from hr_period_detail\n where seg_segment_no = '$companyid'\n $_where\n order by mm asc\n_LeaveYearList_;\n return $this->DBConn->GetArray($sql_string);\n }", "function timestampformat($type) {\r\r\n\t\tif (!isset($_SESSION['timestampformat'])) {\r\r\n\t\t\t$prefix=$GLOBALS['core']->tbl_prefix;\r\r\n\t\t\t$q = $GLOBALS['core']->query(\"SELECT timestamp FROM ${prefix}mod_visitors_hit LIMIT 0, 1\", false);\r\r\n\t\t\t$q = $q->fetchRow();\r\r\n\t\t\tif (!$q) return array(0, 0);\r\r\n\t\t\tif (eregi(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}\", $q['timestamp']))\r\r\n\t\t\t\t$_SESSION['timestampformat'] = array('year'=>array(4, 6), 'month'=>array(7, 9), 'day'=>array(10, 12));\r\r\n\t\t\telse \r\r\n\t\t\t\t$_SESSION['timestampformat'] = array('year'=>array(4, 5), 'month'=>array(6, 7), 'day'=>array(8, 9));\r\r\n\t\t}\r\r\n\t\treturn $_SESSION['timestampformat'][$type];\r\r\n\t}", "function thematic_date_classes( $t, &$c, $p = '' ) {\n\t$t = $t + ( get_option('gmt_offset') * 3600 );\n\t$c[] = $p . 'y' . gmdate( 'Y', $t ); // Year\n\t$c[] = $p . 'm' . gmdate( 'm', $t ); // Month\n\t$c[] = $p . 'd' . gmdate( 'd', $t ); // Day\n\t$c[] = $p . 'h' . gmdate( 'H', $t ); // Hour\n}", "function month($mes)\n{\n\tif ($mes == 1) return \"Jan\";\n\tif ($mes == 2) return \"Feb\";\n\tif ($mes == 3) return \"Mar\";\n\tif ($mes == 4) return \"Apr\";\n\tif ($mes == 5) return \"May\";\n\tif ($mes == 6) return \"Jun\";\n\tif ($mes == 7) return \"Jul\";\n\tif ($mes == 8) return \"Aug\";\n\tif ($mes == 9) return \"Sept\";\n\tif ($mes == 10) return \"Oct\";\n\tif ($mes == 11) return \"Nob\";\n\tif ($mes == 12) return \"Dec\";\n}", "public function getPeriodTypeAllowableValues()\r\n {\r\n return [\r\n self::PERIOD_TYPE_MONTH,\r\n self::PERIOD_TYPE_YEAR,\r\n ];\r\n }", "function getDateFormat($elementValidationType, $fieldName, $type) {\n $returnString = \"\";\n switch ($elementValidationType) {\n case \"date_mdy\":\n if ($type == \"php\") {\n $returnString = \"m-d-Y\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"addZ($fieldName.getUTCMonth()+1)+'-'+addZ($fieldName.getUTCDate())+'-'+$fieldName.getUTCFullYear()\";\n }\n break;\n case \"date_dmy\":\n if ($type == \"php\") {\n $returnString = \"d-m-Y\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"addZ($fieldName.getUTCDate())+'-'+addZ($fieldName.getUTCMonth()+1)+'-'+$fieldName.getUTCFullYear()\";\n }\n break;\n case \"date_ymd\":\n if ($type == \"php\") {\n $returnString = \"Y-m-d\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"$fieldName.getUTCFullYear()+'-'+addZ($fieldName.getUTCMonth()+1)+'-'+addZ($fieldName.getUTCDate())\";\n }\n break;\n case \"datetime_mdy\":\n if ($type == \"php\") {\n $returnString = \"m-d-Y H:i\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"addZ($fieldName.getUTCMonth()+1)+'-'+addZ($fieldName.getUTCDate())+'-'+$fieldName.getUTCFullYear()+' '+addZ($fieldName.getUTCHours())+':'+addZ($fieldName.getUTCMinutes())\";\n }\n break;\n case \"datetime_dmy\":\n if ($type == \"php\") {\n $returnString = \"d-m-Y H:i\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"addZ($fieldName.getUTCDate())+'-'+addZ($fieldName.getUTCMonth()+1)+'-'+$fieldName.getUTCFullYear()+' '+addZ($fieldName.getUTCHours())+':'+addZ($fieldName.getUTCMinutes())\";\n }\n break;\n case \"datetime_ymd\":\n if ($type == \"php\") {\n $returnString = \"Y-m-d H:i\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"$fieldName.getUTCFullYear()+'-'+addZ($fieldName.getUTCMonth()+1)+'-'+addZ($fieldName.getUTCDate())+' '+addZ($fieldName.getUTCHours())+':'+addZ($fieldName.getUTCMinutes())\";\n }\n break;\n case \"datetime_seconds_mdy\":\n if ($type == \"php\") {\n $returnString = \"m-d-Y H:i:s\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"addZ($fieldName.getUTCMonth()+1)+'-'+addZ($fieldName.getUTCDate())+'-'+$fieldName.getUTCFullYear()+' '+addZ($fieldName.getUTCHours())+':'+addZ($fieldName.getUTCMinutes())+':'+addZ($fieldName.getUTCSeconds())\";\n }\n break;\n case \"datetime_seconds_dmy\":\n if ($type == \"php\") {\n $returnString = \"d-m-Y H:i:s\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"addZ($fieldName.getUTCDate())+'-'+addZ($fieldName.getUTCMonth()+1)+'-'+$fieldName.getUTCFullYear()+' '+addZ($fieldName.getUTCHours())+':'+addZ($fieldName.getUTCMinutes())+':'+addZ($fieldName.getUTCSeconds())\";\n }\n break;\n case \"datetime_seconds_ymd\":\n if ($type == \"php\") {\n $returnString = \"Y-m-d H:i:s\";\n }\n elseif ($type == \"javascript\") {\n $returnString = \"$fieldName.getUTCFullYear()+'-'+addZ($fieldName.getUTCMonth()+1)+'-'+addZ($fieldName.getUTCDate())+' '+addZ($fieldName.getUTCHours())+':'+addZ($fieldName.getUTCMinutes())+':'+addZ($fieldName.getUTCSeconds())\";\n }\n break;\n default:\n $returnString = '';\n }\n return $returnString;\n }", "private function getDMYFormat($showBy, $type = 'php')\n {\n\n // TODO: find a good way to put date format to view like this 10-oct-2016.\n if ($type === 'js') {\n if ($showBy === self::DAY) {\n return self::DAY_FORMAT_JS;\n }\n\n if ($showBy === self::MONTH) {\n return self::MONTH_FORMAT_JS;\n }\n\n if ($showBy === self::YEAR) {\n return self::YEAR_FORMAT_JS;\n }\n }\n\n if ($showBy === self::DAY) {\n return self::DAY_FORMAT;\n }\n\n if ($showBy === self::MONTH) {\n return self::MONTH_FORMAT;\n }\n\n if ($showBy === self::YEAR) {\n return self::YEAR_FORMAT;\n }\n }", "public static function monthly() {return new ScheduleViewMode(4);}", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "function sysHumanDate($date) { # $date = date in format '2000-01-01'\r\n\tswitch ($date) {\r\n\tcase date(\"Y-m-d\"):\r\n\t\t$date = \"Idag\";\r\n\t\tbreak;\r\n\tcase date(\"Y-m-d\", strtotime(\"-1 day\")):\r\n\t\t$date = \"Igår\";\r\n\t\tbreak;\r\n\t}\r\n\treturn $date;\r\n}", "function get_str_gesmonth( $mes )\r\n{\r\n if( $mes == 5 ) { $cmonth = \"Ene\"; }\r\n elseif( $mes == 6 ) { $cmonth = \"Feb\"; }\r\n elseif( $mes == 7 ) { $cmonth = \"Mar\"; }\r\n elseif( $mes == 8 ) { $cmonth = \"Abr\"; }\r\n elseif( $mes == 9 ) { $cmonth = \"May\"; }\r\n elseif( $mes == 10 ) { $cmonth = \"Jun\"; }\r\n elseif( $mes == 11 ) { $cmonth = \"Jul\"; }\r\n elseif( $mes == 12 ) { $cmonth = \"Ago\"; }\r\n elseif( $mes == 1 ) { $cmonth = \"Sep\"; }\r\n elseif( $mes == 2 ) { $cmonth = \"Oct\"; }\r\n elseif( $mes == 3 ) { $cmonth = \"Nov\"; }\r\n elseif( $mes == 4 ) { $cmonth = \"Dic\"; }\r\n\r\n return $cmonth;\r\n}", "public static function getDateforStdFilterBytype($type)\n\t{\n\t\treturn \\DateTimeRange::getDateRangeByType($type);\n\t}", "public function getDateTimeFormat($type);", "public function getDateTimeFormat($type);", "public function takePostBaseOnMonth();", "public function is_month()\n {\n }", "public static function periods()\n {\n return [ \n static::HOURLY => __(Str::title(static::HOURLY)),\n static::DAILY => __(Str::title(static::DAILY)),\n static::WEEKLY => __(Str::title(static::WEEKLY)),\n static::MONTHLY => __(Str::title(static::MONTHLY)),\n static::YEARLY => __(Str::title(static::YEARLY)),\n ];\n }", "public static function getReturnTypes()\n\t{\n\t\t\n\t\treturn [\n\t\t\tself::RETURN_TYPE_MONTHLY\t =>\t\"Monthly\",\n\t\t\tself::RETURN_TYPE_YEARLY\t =>\t\"Yearly\",\n\t\t];\n\t\t\n\t}", "function export_date_options($post_type = 'post')\n {\n }", "function diasemana($data) {\n\t$ano = substr(\"$data\", 0, 4);\n\t$mes = substr(\"$data\", 5, -3);\n\t$dia = substr(\"$data\", 8, 9);\n\n\t$diasemana = date(\"w\", mktime(0,0,0,$mes,$dia,$ano) );\n\n\tswitch($diasemana) {\n\t\tcase\"0\": $diasemana = \"Domingo\"; break;\n\t\tcase\"1\": $diasemana = \"Segunda-Feira\"; break;\n\t\tcase\"2\": $diasemana = \"Terça-Feira\"; break;\n\t\tcase\"3\": $diasemana = \"Quarta-Feira\"; break;\n\t\tcase\"4\": $diasemana = \"Quinta-Feira\"; break;\n\t\tcase\"5\": $diasemana = \"Sexta-Feira\"; break;\n\t\tcase\"6\": $diasemana = \"Sábado\"; break;\n\t}\n\n\treturn \"$diasemana\";\n}", "function dia($dnumero){\r\n\tswitch($dnumero){\r\n\t\tcase 1:\r\n\t\t$dia = \"Domingo\";\r\n\t\tbreak;\r\n\t\tcase 2:\r\n\t\t$dia = \"Segunda-feira\";\r\n\t\tbreak;\r\n\t\tcase 3:\r\n\t\t$dia = \"Terça-feira\";\r\n\t\tbreak;\r\n\t\tcase 4:\r\n\t\t$dia = \"Quarta-feira\";\r\n\t\tbreak;\r\n\t\tcase 5:\r\n\t\t$dia = \"Quinta-feira\";\r\n\t\tbreak;\r\n\t\tcase 6:\r\n\t\t$dia = \"Sexta-feira\";\r\n\t\tbreak;\r\n\t\tcase 7:\r\n\t\t$dia = \"Sabado\";\r\n\t\tbreak;\r\n\t}\r\n\treturn $dia;\r\n}", "function happys_get_ja_day($arg) {\n \tswitch ($arg) {\n case 'Mon':\n $arg_ja = '月';\n break;\n case 'Tue':\n $arg_ja = '火';\n break;\n case 'Wed':\n $arg_ja = '水';\n break;\n \t\tcase 'Thu':\n $arg_ja = '木';\n break;\n case 'Fri':\n $arg_ja = '金';\n break;\n case 'Sat':\n $arg_ja = '土';\n break;\n \t\tcase 'Sun':\n $arg_ja = '日';\n break;\n \t}\n \treturn $arg_ja;\n }", "public function IsMoonPhase() {\n switch($this->GetYear() . \"-\" . $this->GetMOnth() . \"-\" . $this->GetDay()) {\n case \"2015-01-20\":\n case \"2015-02-19\":\n case \"2015-03-20\":\n case \"2015-04-18\":\n case \"2015-05-18\":\n case \"2015-06-16\":\n case \"2015-07-16\":\n case \"2015-08-14\":\n case \"2015-09-13\":\n case \"2015-10-13\":\n case \"2015-11-11\":\n case \"2015-12-11\":\n return array(1, \"Nymåne\"); // new moon\n case \"2015-01-27\":\n case \"2015-02-25\":\n case \"2015-03-27\":\n case \"2015-04-26\":\n case \"2015-05-25\":\n case \"2015-06-24\":\n case \"2015-07-24\":\n case \"2015-08-22\":\n case \"2015-09-21\":\n case \"2015-10-20\":\n case \"2015-11-19\":\n case \"2015-12-18\":\n return array(3, \"Växande halvmåne\"); // first quarter moon\n case \"2015-01-05\":\n case \"2015-02-04\":\n case \"2015-03-05\":\n case \"2015-04-04\":\n case \"2015-05-04\":\n case \"2015-06-02\":\n case \"2015-07-02\":\n case \"2015-07-31\":\n case \"2015-08-29\":\n case \"2015-09-28\":\n case \"2015-10-27\":\n case \"2015-11-25\":\n case \"2015-12-25\":\n return array(5, \"Fullmåne\"); // full moon\n case \"2015-01-13\":\n case \"2015-02-12\":\n case \"2015-03-13\":\n case \"2015-04-12\":\n case \"2015-05-11\":\n case \"2015-06-09\":\n case \"2015-07-08\":\n case \"2015-08-07\":\n case \"2015-09-05\":\n case \"2015-10-04\":\n case \"2015-11-03\":\n case \"2015-12-03\":\n return array(7, \"Avtagande halvmåne\"); // third quarter moon\n default:\n return array(null, null);\n }\n }", "function prim_options_month() {\n $month = array(\n 'jan' => t('jan'),\n 'feb' => t('feb'),\n 'mar' => t('mar'),\n 'apr' => t('apr'),\n 'may' => t('maj'),\n 'jun' => t('jun'),\n 'jul' => t('jul'),\n 'aug' => t('aug'),\n 'sep' => t('sep'),\n 'oct' => t('okt'),\n 'nov' => t('nov'),\n 'dec' => t('dec'),\n );\n\n return $month;\n}", "function sandbox_date_classes( $t, &$c, $p = '' ) {\n\t$t = $t + ( get_option('gmt_offset') * 3600 );\n\t$c[] = $p . 'y' . gmdate( 'Y', $t ); // Year\n\t$c[] = $p . 'm' . gmdate( 'm', $t ); // Month\n\t$c[] = $p . 'd' . gmdate( 'd', $t ); // Day\n\t$c[] = $p . 'h' . gmdate( 'H', $t ); // Hour\n}", "function checkRenewalMonth($renewal_month)\n{\n //this is the full text version of the months as dictated by PHP functions\n if ($renewal_month !== date(\"F\"))\n {\n return \"Welcome!\";\n } else {\n return \"Time to renew\";\n }\n}", "public function calcularRangoFechas($date, $type)\n\t{\n\t\t$desde = \"\";\n\t\t// Validamos Fechas dependiento el tipo de pago(semanal, quincenal o mensual)\n\t\tif($type == \"S\"){\n\t\t\t$dias = 7;\n\t\t\t$desde = date(\"Y-m-d\", strtotime(\"$date - $dias day\"));\n\t\t}else if($type == \"Q\"){\n\t\t\t$dias = 15;\n\t\t\t$desde = date(\"Y-m-d\", strtotime(\"$date - $dias day\"));\n\t\t}else if($type == \"M\"){\n\t\t\t$dias = 30;\n\t\t\t$desde = date(\"Y-m-d\", strtotime(\"$date - $dias day\"));\n\t\t}\n\t\t\n\t\t// FECHA ACTUAL MENOS UN DIA (HASTA)\n\t\t$hasta = date(\"Y-m-d\", strtotime(\"$date - 1 day\"));\n\t\t$data = array(\"desde\" => $desde, \"hasta\" => $hasta);\n\t\t\n\t\treturn $data;\n\t}", "function oos_time_based_greeting()\n{\n global $aLang;\n\n if(date('G') >= 12 && date('G') <= 18) {\n $time_based_greeting = $aLang['good_afternoon'];\n } elseif (date('a') == 'am') {\n $time_based_greeting = $aLang['good_morning'];\n } else {\n $time_based_greeting = $aLang['good_evening'];\n }\n return $time_based_greeting;\n}", "function getSuffix($someDate) \n{\n #getting the last letter\n $num = substr($someDate, -1);\n\n switch($num){\n\n case 1 : return \"st\";\n break;\n case 2: return \"nd\";\n break;\n case 3: return \"rd\";\n break;\n default: return \"th\";\n break; } \n}", "public function user_type_fun($type){\n\t\tif($type == 'R'){\n\t\t\t$st = 'Recruiter';\n\t\t}else if($type == 'AH'){\t\n\t \t\t$st = 'Account Holder';\n\t\t}else if($type == 'Recruiter'){\t\n\t \t\t$st = 'R';\n\t\t}else if($type == 'Account Holder'){\t\n\t \t\t$st = 'AH';\n\t\t}\n\t\treturn $st;\n\t}", "public function melyikFelev()\n {\n $datum = date(\"m\");\n if ((($datum >= 9) and ($datum <= 12)) || ($datum == 1)) {\n return 1;\n } elseif (($datum >= 2) and ($datum < 9)) {\n return 2;\n }\n }", "function examTypes() {\n return array('General', 'IIT', 'NEET', 'Eamcet', 'NTSE');\n}", "function format($date, $type, $format){\r\n\tif($type&DATE){\r\n\t\t$y=substr($date,0,4);\r\n\t\t$M=substr($date,4,2);\r\n\t\t$d=substr($date,6,2);\r\n\t\tif($type & TIME){\r\n\t\t\t$h=substr($date,8,2);\r\n\t\t\t$m=substr($date,10,2);\r\n\t\t\t$s=substr($date,12,2);\r\n\t\t}\r\n\t}else{\r\n\t\t$h=substr($date,0,2);\r\n\t\t$m=substr($date,2,2);\r\n\t\t$s=substr($date,4,2);\r\n\t}\r\n\t\r\n\treturn $date==''?'':str_replace('s',$s,\r\n\t\t\t\t\t\tstr_replace('m',$m,\r\n\t\t\t\t\t\tstr_replace('H',$h,\r\n\t\t\t\t\t\tstr_replace('D',$d,\r\n\t\t\t\t\t\tstr_replace('M',$M,\r\n\t\t\t\t\t\tstr_replace('Y',$y,$format))))));\r\n}", "protected function getMois()\n{\nreturn substr($this->getDateSysteme(), 5, 2);\n}", "function zodiac($month, $day, $zodiac) {\n\n\t if ( ( $month == 03 AND $day > 20 ) OR ( $month == 04 AND $day < 20 ) ) { $zodiac = \"Aries\"; }\n\t elseif ( ( $month == 04 AND $day > 19 ) OR ( $month == 05 AND $day < 21 ) ) { $zodiac = \"Taurus\"; }\n\t elseif ( ( $month == 05 AND $day > 20 ) OR ( $month == 06 AND $day < 21 ) ) { $zodiac = \"Gemini\"; }\n\t elseif ( ( $month == 06 AND $day > 20 ) OR ( $month == 07 AND $day < 23 ) ) { $zodiac = \"Cancer\"; }\n\t elseif ( ( $month == 07 AND $day > 22 ) OR ( $month == 08 AND $day < 23 ) ) { $zodiac = \"Leo\"; }\n\t elseif ( ( $month == 08 AND $day > 22 ) OR ( $month == 09 AND $day < 23 ) ) { $zodiac = \"Virgo\"; }\n\t elseif ( ( $month == 09 AND $day > 22 ) OR ( $month == 10 AND $day < 23 ) ) { $zodiac = \"Libra\"; }\n\t elseif ( ( $month == 10 AND $day > 22 ) OR ( $month == 11 AND $day < 22 ) ) { $zodiac = \"Scorpio\"; }\n\t elseif ( ( $month == 11 AND $day > 21 ) OR ( $month == 12 AND $day < 22 ) ) { $zodiac = \"Sagittarius\"; }\n\t elseif ( ( $month == 12 AND $day > 21 ) OR ( $month == 01 AND $day < 20 ) ) { $zodiac = \"Capricorn\"; }\n\t elseif ( ( $month == 01 AND $day > 19 ) OR ( $month == 02 AND $day < 19 ) ) { $zodiac = \"Aquarius\"; }\n\t elseif ( ( $month == 02 AND $day > 18 ) OR ( $month == 03 AND $day < 21 ) ) { $zodiac = \"Pisces\"; }\n\n return $zodiac;\n\t}", "function setGoodDate ($time){\n $time = strtotime ($time);\n $days = date (\"D\",$time);\n switch ($days){\n \n case \"Sun\";\n $day = \"Ahad\";\n break;\n case \"Mon\";\n $day = \"Senin\";\n break;\n case \"Tue\";\n $day = \"Selasa\";\n break;\n case \"Wed\";\n $day = \"Rabu\";\n break;\n case \"Thu\";\n $day = \"Kamis\";\n break;\n case \"Fri\";\n $day = \"Jumat\";\n break;\n case \"Sat\";\n $day = \"Sabtu\";\n break;\n }\n $result = $day.\", \".date (\"d-M-Y\",$time);\n return $result;\n}", "function GetLeaveMonthList($type = NULL) {\n $companyid = $this->companyID;\n //$emp_seqno = $this->empSeqNo;\n $emp_seqno = $_SESSION [\"user\"] [\"emp_seq_no\"];\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_LeaveYearList_\n select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) as month1,\n substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) as month2\n from ehr_absence_v\n where company_id = '$companyid'\n $_where\n order by substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) asc\n_LeaveYearList_;\n //print $sql_string;\n return $this->DBConn->GetArray($sql_string);\n }", "public function day_to_condition($date){\r\n\r\n }", "public function dataAtual($tipo) {\n switch ($tipo) {\n case 1: $rst = date(\"Y-m-d\");\n break;\n case 2: $rst = date(\"Y-m-d H:i:s\");\n break;\n case 3: $rst = date(\"d/m/Y\");\n break;\n }\n return $rst;\n }", "function mesExtenso($mes, $type='min')\n{\n\n if (!empty($mes)) {\n\n switch ($mes) {\n case 1:\n case 01:\n $mesMin = 'Jan';\n $mesFull = 'Janeiro';\n break;\n case 2:\n case 02:\n $mesMin = 'Fev';\n $mesFull = 'Fevereiro';\n break;\n case 3:\n case 03:\n $mesMin = 'Mar';\n $mesFull = 'Março';\n break;\n case 4:\n case 04:\n $mesMin = 'Abr';\n $mesFull = 'Abril';\n break;\n case 5:\n case 05:\n $mesMin = 'Mai';\n $mesFull = 'Maio';\n break;\n case 6:\n case 06:\n $mesMin = 'Jun';\n $mesFull = 'Junho';\n break;\n case 7:\n case 07:\n $mesMin = 'Jul';\n $mesFull = 'Julho';\n break;\n case 8:\n case 08:\n $mesMin = 'Ago';\n $mesFull = 'Agosto';\n break;\n case 9:\n case 09:\n $mesMin = 'Set';\n $mesFull = 'Setembro';\n break;\n case 10:\n $mesMin = 'Out';\n $mesFull = 'Outubro';\n break;\n case 11:\n $mesMin = 'Nov';\n $mesFull = 'Novembro';\n break;\n case 12:\n $mesMin = 'Dez';\n $mesFull = 'Dezembro';\n break;\n }\n\n if ($type=='min')\n return $mesMin;\n else\n return $mesFull;\n\n }\n\n}", "function scorm_get_updatefreq_array(){\n return array(0 => get_string('never'),\n 1 => get_string('everyday','scorm'),\n 2 => get_string('everytime','scorm'));\n}", "function first_quarter_month($t) {\n $mon = $t['tm_mon'];\n if ($mon <= 3) \n {\n return 1;\n }\n elseif ($mon <= 6) \n {\n return 4;\n }\n elseif ($mon <= 9) \n {\n return 7;\n }\n elseif ($mon <= 12) \n {\n return 10;\n }\n // ?\n return 99;\n}", "function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }", "function string_dia_semana ($mes) {\n\t\n\tswitch ($mes) {\n case \"Sunday\":\n return \"Domingo\";\n break;\n case \"Monday\":\n return \"Segunda-feira\";\n break;\n case \"Tuesday\":\n return \"Terça-feira\";\n break;\n case \"Wednesday\":\n return \"Quarta-feira\";\n break;\n case \"Thursday\":\n return \"Quinta-feira\";\n break;\n case \"Friday\":\n return \"Sexta-feira\";\n break;\n case \"Saturday\":\n return \"Sábado\";\n break;\n\t} //End IF switch\n}", "function get_timing_type() {\n\t\t$when = Clean::string( $this->get_option( 'when_to_run' ) );\n\t\tif ( ! $when ) $when = 'immediately';\n\t\treturn $when;\n\t}", "function getDateSQLstmnt(string $coloum, array $arr, string $compare_name, string $type = NULL)\n {\n $compare = $arr[$compare_name];\n $start = (isset($arr['start'])) ? $arr['start'] : \"\";\n $end = (isset($arr['to'])) ? $arr['to'] : \"\";\n\n switch ($compare) {\n case 'Exact': \n return (is_numeric($start)) ? \"$coloum = $start\" : \"$coloum = '$start'\"; \n break;\n case 'LessThan': \n return (is_numeric($start)) ? \"$coloum < $start\" : \"$coloum < '$start'\"; \n break;\n case 'LessEqualThan': \n return (is_numeric($start)) ? \"$coloum <= $start\" : \"$coloum <= '$start'\"; \n break;\n case 'MoreThan': \n return (is_numeric($start)) ? \"$coloum > $start\" : \"$coloum > '$start'\"; \n break;\n case 'MoreEqualThan': \n return (is_numeric($start)) ? \"$coloum >= $start\" : \"$coloum >= '$start'\"; \n break;\n case 'None': \n return \"\"; \n break;\n case 'Between': \n switch($type){\n case 'Number': return \"$coloum between $start and $end\"; break;\n case 'Date': return \"Date($coloum) between '$start' and '$end'\"; break;\n }\n break;\n case 'coloumn_notequal_month':\n return \"MONTH($start) != MONTH($end)\"; \n break;\n }\n }", "function date_month($month) {\n\tswitch ($month) {\n\t\tcase 1:\n\t\t\techo \"Януари\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\techo \"Февруари\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\techo \"Март\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\techo \"Април\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\techo \"Май\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\techo \"Юни\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\techo \"Юли\";\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\techo \"Август\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\techo \"Септември\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\techo \"Октомври\";\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\techo \"Ноември\";\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\techo \"Декември\";\n\t\t\tbreak;\n\t}\n}", "public function getFieldType()\r\n {\r\n return self::TYPE_DATE;\r\n }", "public function getMonthlyInstalment();", "public static function unit($str){\n\t\t$str = str_replace(\"_mo\", \" month(s)\", $str);\n\t\t$str = str_replace(\"_yr\", \" year(s)\", $str);\n\t\treturn $str;\n\t}", "public function date_format($date, $type = 0) {\n\t\tif ($date == '' || $date == \"0000-00-00\") {\n\t\t\treturn \"\";\n\t\t}\n\t\t$st = Yii::$app->getTable;\n\n\t\t$df = $st->settings('local', 'date_format');\n\t\tsetlocale(LC_TIME, 'en_US');\n\t\tif ($type == 1) {\n\t\t\t$result = date(\"$df\", $date); // date($df,strtotime($date));\n\t\t} else {\n\t\t\t$result = date(\"$df\", strtotime($date)); // date($df,strtotime($date));\n\n\t\t}\n\n\t\treturn $result;\n\t}", "public function get_day_names($day_type = '')\n {\n if($day_type != '')\n $this->day_type = $day_type;\n\n if($this->day_type == 'long')\n {\n $day_names = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');\n }\n elseif($this->day_type == 'short')\n {\n $day_names = array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat');\n }\n else\n {\n $day_names = array('su', 'mo', 'tu', 'we', 'th', 'fr', 'sa');\n }\n\n $days = array();\n foreach($day_names as $val)\n {\n $days[] = ucfirst($val);\n }\n\n return $days;\n }", "function vacant_name($type)\n\t{\n\t\t$item = rtrim($type, 's');\n\t\tif($items = $this->find($type)) {\n\t\t\trsort($items);\n\t\t\tif($id = preg_array_shift($items, '`^' . $item . '_(\\d+)$`')) {\n\t\t\t\t$id = intval($id) + 1;\n\t\t\t\tif($id < 10) $id = '0'.$id;\n\t\t\t} else $id = '01';\n\t\t\treturn $item . '_' . $id;\n\t\t}\n\t\treturn false;\n\t}", "public function get_month_choices()\n {\n }", "function day($day= 1)\n{\n return $day * 24 * 60 *60;\n}", "public function getDateType() {\n\n if ($this->dateType)\n return $this->dateType;\n\n if (!$this->value) {\n $this->dateTimes = null;\n $this->dateType = null;\n return null;\n }\n\n $dts = array();\n foreach(explode(',',$this->value) as $val) {\n list(\n $type,\n $dt\n ) = DateTime::parseData($val, $this);\n $dts[] = $dt;\n $this->dateType = $type;\n }\n $this->dateTimes = $dts;\n return $this->dateType;\n\n }", "protected function dateBasedWhere($type, Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value;\n }", "public function getXsiTypeName() {\n return \"ReportDefinition.DateRangeType\";\n }" ]
[ "0.76756984", "0.63500625", "0.6216083", "0.6188362", "0.6065711", "0.5903646", "0.57028687", "0.5637585", "0.5620865", "0.5612674", "0.55892307", "0.55172044", "0.55148125", "0.5513895", "0.5485087", "0.54635763", "0.54447764", "0.5430182", "0.5424191", "0.53867877", "0.53736776", "0.53409374", "0.53118724", "0.52854395", "0.5274456", "0.5246255", "0.5205108", "0.5198087", "0.51916134", "0.51916134", "0.51877344", "0.5177818", "0.5174836", "0.5170576", "0.5158943", "0.51581895", "0.51458263", "0.5127815", "0.5124096", "0.5094524", "0.50667655", "0.5062154", "0.50430036", "0.504293", "0.5040295", "0.5038311", "0.5031893", "0.5030163", "0.50227445", "0.50179523", "0.5004312", "0.50031376", "0.49728817", "0.49702597", "0.49681908", "0.4962362", "0.4962362", "0.4958727", "0.49539328", "0.49461767", "0.49461147", "0.49351397", "0.4932319", "0.49291232", "0.49278003", "0.4920922", "0.49164546", "0.49159387", "0.49149773", "0.4906973", "0.49002138", "0.4897021", "0.48950782", "0.487928", "0.48764688", "0.48731595", "0.48719734", "0.4861065", "0.48502645", "0.48480123", "0.48462546", "0.4842899", "0.48348445", "0.48313847", "0.4830038", "0.48254398", "0.4825265", "0.48245767", "0.48239067", "0.4821934", "0.48203114", "0.48195785", "0.4817944", "0.48174083", "0.48136345", "0.48088762", "0.48086232", "0.48045847", "0.48022425", "0.4801339", "0.47915086" ]
0.0
-1
/ <input type="button" name="button" value="Pay now!" style="backgroundrepeat:norepeat;borderwidth:0px;backgroundcolor:transparent;height:25px;width:90px;cursor:hand;fontweight:bold;fontsize:11px;fontfamily:Arial;color:FFFF33;backgroundimage:url('ROvlRed.gif');" onClick="window.location.href('
function get_tindakan() { $sql = "SELECT * FROM tb_tindakan"; $query = $this->db->query($sql); if ($query->num_rows() > 0) return $query->result(); else return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reply_button() {\n\t\t\n\t\treturn \" <input type=image name=submit src=\\\"images/reply.jpg\\\" \n\t\twidth=45 height=23 border=0 align=middle>\";\n}", "function form_button_link($value, $url, $blank='', $prevent_double = false, $js = '') {\n\n\tif ($blank) {\n\t\t$action = \"openWindow2('$url');\";\n\t} else {\n\t\t$action = \"window.location='$url';\";\n\t}\n\n\tif ($prevent_double) {\n\t\t$action .= \"this.disabled=true;\";\n\t}\n\n\tif ($js) {\n\t\t$action = \"var cancelproceed = false; $js if (!cancelproceed) { $action }\";\n\t}\n\n\treturn \"<input type=\\\"button\\\" name=\\\"$value\\\" value=\\\"$value\\\" onclick=\\\"$action\\\" />\";\n\n}", "function go_back_button()\n{\n\techo'<p style=\"float: left; width:300px; font-size: 10px; line-height: 25px;\"><a class=\"button\" style=\"font-size: 10px; margin-bottom: 10px;\" href=\"http://drnonprofit.com/coaching/\">Continue Shopping</a>\n\t<br />\n\tOnly one subscription needs to be purchased at a time, additional purchases may be made after this one is completed</p>';\n}", "function refreshPageButton(){\n $self = htmlentities($_SERVER['PHP_SELF']);\n $output='\n <div class=\"button1\"><a href=\"'.$self.'\">Add User</a><img src=\"images/arrow.svg\" alt=\"arrow\" class=\"arrow\"></div>';\n return $output;\n}", "function getPayPalBtn($total) {\n $paypal_email = '[email protected]';\n $desc = 'Your order description'; // could be based on order, or static\n $return_url = 'http://www.your_url.com/orders/thankyou.html'; // thank you page\n $cancel_url = 'http://www.your_url.com'; // if user cancels rather than paying\n // could build string of order details (product abbr, qty)\n $custom = ''; // up to 256 chars\n \n $str = <<<EOS\n<form action=\"http://localhost/BadWolf/thanks.php\" method=\"post\">\n <input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />\n <input type=\"hidden\" name=\"business\" value=\"$paypal_email\" />\n <input type=\"hidden\" name=\"amount\" value=\"$total\" />\n <input type=\"hidden\" name=\"currency_code\" value=\"USD\">\n <input type=\"hidden\" name=\"item_name\" value=\"$desc\" />\n <input type=\"hidden\" name=\"custom\" value=\"$custom\" />\n <input type=\"hidden\" name=\"return\" value=\"$return_url\" />\n <input type=\"hidden\" name=\"cancel_return\" value=\"$cancel_url\" />\n <input type=\"image\" name=\"submit \"border=\"0\" \n src=\"http://www.privatepracticepreparedness.com/sites/all/images/BuyButton.png\"\n alt=\"Purchase\" /> \n</form>\nEOS;\n return $str;\n}", "function uni_continue_shopping_button() {\n\t$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );\n\techo '<div class=\"continue_shopping\"><a href=\"'. $shop_page_url .'\" class=\"button\">'. __('Continue Shopping','shtheme') .' →</a></div>';\n}", "function btnGoToResult( string $href ) : string\n {\n $button = '<p style=\"text-align: right;\">'\n . '<span class=\"badge badge-success\">'\n . '<a href=\"' . $href . '\">GO</a>'\n . '</span>'\n . '</p>';\n \n return $button;\n }", "function protocol_button($element) {\n if (isset($element['#attributes']['class'])) {\n $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class'];\n }\n else {\n $element['#attributes']['class'] = 'form-' . $element['#button_type'];\n }\n\n return '<div class=\"button-wrapper-outer\"><div class=\"button-wrapper\"><input type=\"submit\" ' . (empty($element['#name']) ? '' : 'name=\"' . $element['#name'] . '\" ') . 'id=\"' . $element['#id'] . '\" value=\"' . check_plain($element['#value']) . '\" ' . drupal_attributes($element['#attributes']) . \" /></div></div>\\n\";\n}", "function atkButton($text, $url=\"\", $sessionstatus=SESSION_DEFAULT, $embedded=true, $cssclass=\"\")\n{\n\t$page = &atkPage::getInstance();\n\t$page->register_script(atkconfig(\"atkroot\").\"atk/javascript/formsubmit.js\");\n\tstatic $cnt=0;\n\n\tif ($cssclass == \"\")\n\t$cssclass = \"btn\";\n\n\t$cssclass = ' class=\"'.$cssclass.'\"';\n\t$script = 'atkSubmit(\"'.atkurlencode(session_url($url,$sessionstatus)).'\")';\n\t$button = '<input type=\"button\" name=\"atkbtn'.(++$cnt).'\" value=\"'.$text.'\" onClick=\\''.$script.'\\''.$cssclass.'>';\n\n\tif (!$embedded)\n\t{\n\t\t$res = '<form name=\"entryform\">';\n\t\t$res.= session_form();\n\t\t$res.= $button.'</form>';\n\t\treturn $res;\n\t}\n\telse\n\t{\n\t\treturn $button;\n\t}\n}", "function nav_buttons()\n\t{\n\t\t?>\n\t\t<input type=\"button\" value=\"Create New Preorder &gt;\" onclick=\"document.location='/admin/utilities/preorder.php?act=new'\" class=\"btn\">\n\t\t<p />\n\t\t<?php\n\t}", "function add_shippify_order_actions_button_css() {\n \n //echo '<style>.view.cancel::after { content: \"\\f174\" !important; }</style>';\n echo '<style>.view.shippify::after { content: \"\" ;background: url(https://admin.shippify.co/panel_img/logo_big_login.png); background-size: 16px 17.5px; background-repeat: no-repeat; background-position: center; }</style>';\n }", "function pacz_woocommerce_button_proceed_to_checkout() {\n\t\t$checkout_url = wc_get_checkout_url();\n\n\t\t?>\n\t\t<div class=\"button-icon-holder alt checkout-button-holder\"><a href=\"<?php echo esc_url($checkout_url); ?>\" class=\"checkout-button\"><i class=\"pacz-icon-shopping-cart\"></i><?php esc_html_e( 'Proceed to Checkout', 'classiadspro' ); ?></a></div>\n\t\t<?php\n\t}", "function form_button($value, $js='', $name = '') {\n\n\tif (!$name) {\n\t\t$name = $value;\n\t}\n\n\t$override = NULL;\n\t$value = html_form_escape($value, $override);\n\n\treturn \"<input type=\\\"button\\\" name=\\\"$name\\\" value=\\\"$value\\\" $js />\";\n\n}", "function display_button($target, $image, $alt){\n\n ?>\n <a href=\"<?= \"/myPHP/ShoppingCart/model/\".$target ?>\"><img src=\"/myPHP/ShoppingCart/images/<?=$image ?>.gif\" alt=\"<?=$alt?>\"\n border=0\n height=50\n width=135></a>\n <?\n}", "function atwork_rate_button($variables) {\n $text = $variables['text'];\n $href = $variables['href'];\n $class = $variables['class'];\n static $id = 0;\n $id++;\n\n $classes = 'rate-button';\n if ($class) {\n $classes .= ' ' . $class;\n }\n if (empty($href)) {\n // Widget is disabled or closed.\n return '<span class=\"' . $classes . '\" id=\"rate-button-' . $id . '\">' .\n '<i class=\"icon-thumbs-up\"></i></span>';\n }\n else {\n return '<a class=\"' . $classes . '\" id=\"rate-button-' . $id . '\" rel=\"nofollow\" href=\"' . htmlentities($href) . '\" title=\"' . check_plain($text) . '\">' .\n '<i class=\"icon-thumbs-up\"></i></a>';\n }\n}", "function image_button ($src, $language, $is_button = false) {\n\t// $is_button=true will cancel the check in function \"image\".\n\t\t\n\t\t$this->is_button = $is_button;\n\t\t// Check only if STS is enabled.\n if (MODULE_STS_DEFAULT_STATUS==\"true\") {\n\t\t $check_file = STS_TEMPLATE_DIR . 'images/'. $language . '/' .$this->buttons_folder . '/' .$src;\n if (file_exists($check_file)) return $check_file;\n }\n\t\treturn '';\n\n\t}", "function zenCssButton($image = '', $text, $type, $sec_class = '', $parameters = '') {\n global $css_button_text, $css_button_opts, $template, $current_page_base, $language;\n\n $button_name = basename($image, '.gif');\n\n // if no secondary class is set use the image name for the sec_class\n if (empty($sec_class)) $sec_class = $button_name;\n if(!empty($sec_class)) $sec_class = ' ' . $sec_class;\n if(!empty($parameters))$parameters = ' ' . $parameters;\n $mouse_out_class = 'cssButton ' . (($type == 'submit') ? 'submit_button ' : 'normal_button ') . $sec_class;\n $mouse_over_class = 'cssButtonHover ' . (($type == 'button') ? 'normal_button ' : '') . $sec_class . $sec_class . 'Hover';\n // javascript to set different classes on mouseover and mouseout: enables hover effect on the buttons\n // (pure css hovers on non link elements do work work in every browser)\n $css_button_js .= 'onmouseover=\"this.className=\\''. $mouse_over_class . '\\'\" onmouseout=\"this.className=\\'' . $mouse_out_class . '\\'\"';\n\n if (CSS_BUTTON_POPUPS_IS_ARRAY == 'true') {\n $popuptext = (!empty($css_button_text[$button_name])) ? $css_button_text[$button_name] : ($button_name . CSSBUTTONS_CATALOG_POPUPS_SHOW_BUTTON_NAMES_TEXT);\n $tooltip = ' title=\"' . $popuptext . '\"';\n } else {\n $tooltip = '';\n }\n $css_button = '';\n\n if ($type == 'submit'){\n // form input button\n if ($parameters != '') {\n // If the input parameters include a \"name\" attribute, need to emulate an <input type=\"image\" /> return value by adding a _x to the name parameter (creds to paulm)\n if (preg_match('/name=\"([a-zA-Z0-9\\-_]+)\"/', $parameters, $matches)) {\n $parameters = str_replace('name=\"' . $matches[1], 'name=\"' . $matches[1] . '_x', $parameters);\n }\n // If the input parameters include a \"value\" attribute, remove it since that attribute will be set to the input text string.\n if (preg_match('/(value=\"[a-zA-Z0=9\\-_]+\")/', $parameters, $matches)) {\n $parameters = str_replace($matches[1], '', $parameters);\n }\n }\n\n $css_button = '<input class=\"' . $mouse_out_class . '\" ' . $css_button_js . ' type=\"submit\" value=\"' . $text . '\"' . $tooltip . $parameters . ' />';\n }\n\n if ($type=='button'){\n // link button\n $css_button = '<span class=\"' . $mouse_out_class . '\" ' . $css_button_js . $tooltip . $parameters . '>' . $text . '</span>';\n }\n return $css_button;\n }", "function _field_button($fval)\n {\n $res = \"\";\n if (isset($this->attribs['disable_self_onclick'])) {\n $this->extra_attribs .= 'onclick=\"this.disabled=true; this.value=\\'please wait...\\'\"';\n }\n\n $res .= sprintf(\"<input type=\\\"button\\\" name=\\\"%s\\\" id=\\\"%s\\\" value=\\\"%s\\\" class=\\\"%s\\\" %s />\\n\",\n $this->fname,\n $this->fname,\n $this->_htmlentities($this->descrip),\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n return $res;\n }", "function addButton($type,$image = NULL)\n {\n switch($type)\n {\n /* Buy now */\n case 1:\n $this->button = '<input type=\"image\" height=\"21\" style=\"width:86;border:0px;\"';\n $this->button .= 'src=\"https://www.paypal.com/en_US/i/btn/btn_paynow_SM.gif\" border=\"0\" name=\"submit\" ';\n $this->button .= 'alt=\"PayPal - The safer, easier way to pay online!\">';\n break;\n /* Add to cart */\n case 2:\n $this->button = '<input type=\"image\" height=\"26\" style=\"width:120;border:0px;\"';\n $this->button .= 'src=\"https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif\" border=\"0\" name=\"submit\"';\n $this->button .= 'alt=\"PayPal - The safer, easier way to pay online!\">';\n break;\n /* Donate */\n case 3:\n $this->button = '<input type=\"image\" height=\"47\" style=\"width:122;border:0px;\"';\n $this->button .= 'src=\"https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\"';\n $this->button .= 'alt=\"PayPal - The safer, easier way to pay online!\">';\n break;\n /* Gift Certificate */\n case 4:\n $this->button = '<input type=\"image\" height=\"47\" style=\"width:179;border:0px;\"';\n $this->button .= 'src=\"https://www.paypal.com/en_US/i/btn/btn_giftCC_LG.gif\" border=\"0\" name=\"submit\"';\n $this->button .= 'alt=\"PayPal - The safer, easier way to pay online!\">';\n break;\n /* Subscribe */\n case 5:\n $this->button = '<input type=\"image\" height=\"47\" style=\"width:122;border:0px;\"';\n $this->button .= 'src=\"https://www.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif\" border=\"0\" name=\"submit\"';\n $this->button .= 'alt=\"PayPal - The safer, easier way to pay online!\">';\n break;\n /* Custom Button */\n default:\n $this->button = '<input type=\"image\" src=\"'.$image.'\" border=\"0\" name=\"submit\"';\n $this->button .= 'alt=\"PayPal - The safer, easier way to pay online!\">';\n }\n $this->button .= \"\\n\";\n }", "function editButton() {\n echo <<<EOB\nstyle=\"cursor:pointer;padding-bottom:8px;\" src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAg\nMTAwIj4gPHJlY3QgaGVpZ2h0PSIxMDAiIHdpZHRoPSIxMDAiIGZpbGw9Im5vbmUiLz4gPHBhdGgg\nZmlsbD0iIzFENzA3QSIgc3Ryb2tlPSJub25lIiBkPSJNMTAgOTAgdiAtMTUgbCA1MCAtNTAgbCAx\nNSAxNSBsIC01MCA1MHoiLz4gPHBhdGggZmlsbD0iIzFENzA3QSIgc3Ryb2tlPSJub25lIiBkPSJN\nNjUgMjAgbCAxMCAtMTAgYSAyIDIgLTkwIDAgMSAyIDAgbCAxMyAxMyBhIDIgMiA5MCAwIDEgMCAy\nIGwgLTEwIDEweiIvPiA8L3N2Zz4=\"\nEOB;\n}", "function returnbutton()\n\t\t\t{\n\t\t\t\techo \"<body>\";\n\t\t\t\techo \"<form method='post' action='searchstatusform.php'>\";\n\t\t\t\techo \"<br />\";\n\t\t\t\techo \"<center><input type='submit' value='return' /></center>\";\n\t\t\t\techo \"</form>\";\n\t\t\t\techo \"</body>\"; \n\t\t\t}", "function drawButtonPlan() {?>\r\n <button id=\"planButton\" dojoType=\"dijit.form.Button\" showlabel=\"false\"\r\n title=\"<?php echo i18n('buttonPlan');?>\" class=\"buttonIconNewGui detailButton\"\r\n iconClass=\"dijitIcon iconPlanStopped\" >\r\n <script type=\"dojo/connect\" event=\"onClick\" args=\"evt\">\r\n showPlanParam();\r\n return false;\r\n </script>\r\n </button>\r\n<?php \r\n}", "function easy_reader_button($color = 'green', $size = 'normal', $class = '', $return = false){\n\tif(!file_exists(dirname(__FILE__).'/images/buttons/'.$size.'-'.$color.'.png')) return;\n\tif($return) ob_start();\n\t\n\t?>\n\t\t<div class=\"easy-reader-button-holder <?php print $class?>\">\n\t\t\t<a href=\"<?php print WP_PLUGIN_URL ?>/easy-reader/post.php?post_id=<?php the_ID() ?>\" onClick=\"easyReaderClick(this); return false;\" rel=\"nofollow\" class=\"easy-reader-link\">\n\t\t\t\t<img src=\"<?php print WP_PLUGIN_URL ?>/easy-reader/images/buttons/<?php print $size ?>-<?php print $color?>.png\" alt=\"easy reader\" />\n\t\t\t</a>\n\t\t</div>\n\t<?php\n\t\n\tif($return) return ob_get_clean();\n}", "function rt_ui_button($label, $target, $icon, $options = array())\n{\n $options['class'] = 'new ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary';\n $content = sprintf('<span class=\"ui-button-icon-primary ui-icon ui-icon-%s\"></span><span class=\"ui-button-text\">%s</span>', $icon, $label);\n return link_to($content, $target, $options);\n}", "function updateButton() {\r\n\t \t\r\n\t \techo \"<a href='update.php' class='btn btn-success'></a><br />\"; \r\n\t }", "function cfc_edd_purchase_form_before_submit() { ?>\n\t<p><?php _e('Click on the button below to make your donation', 'cfctranslation'); ?>\t</p>\n<?php }", "function make_cancel_button($purchase_id)\n\t{\n\t\treturn do_template('ECOM_CANCEL_BUTTON_VIA_PAYPAL',array('PURCHASE_ID'=>$purchase_id));\n\t}", "public static function continue_button($url, $buttontext) {\n global $OUTPUT;\n if (!($url instanceof \\moodle_url)) {\n $url = new \\moodle_url($url);\n }\n $button = new \\single_button($url, $buttontext, 'get');\n $button->class = 'continuebutton';\n\n return $OUTPUT->render($button);\n }", "function generate_sys_button($btn_params=array())\n{\n\t$btn_str = \"\";\n\t\n\tif(!empty($btn_params['btnaction']) && empty($btn_params['noloading']))\n\t{\n\t\t$btn_str .= \"<div class='bluronclick'><div style='display:inline-block;'>\";\n\t}\n\telse if(empty($btn_params['btnaction']))\n\t{\n\t\t$btn_params['btnaction'] = '';\n\t}\n\t\n\t$btn_str .= \"<table border='0' cellspacing='0' cellpadding='0' class='btn' onclick=\\\"\".$btn_params['btnaction'].\"\\\">\n <tr>\n <td class='btnleft'><img src='\".base_url().\"images/spacer.gif' width='5' height='5'/></td>\n <td class='btnmiddle' nowrap='nowrap'>\".$btn_params['btntext'].\"</td>\n <td class='btnright'><img src='\".base_url().\"images/spacer.gif' width='5' height='5'/></td>\n </tr>\n </table>\";\n\t\n\tif(!empty($btn_params['btnaction']) && empty($btn_params['noloading']))\n\t{\n\t\t$btn_str .= \"</div></div>\";\n\t}\n\t\t\n\tif(!empty($btn_params['btnid']))\n\t{\t\n \t$btn_value = (!empty($btn_params['btnvalue']))? $btn_params['btnvalue']: 'Submit';\n\t\t$btn_str .= \"<div style='display:none;'>\n <input name='\".$btn_params['btnid'].\"' type='submit' id='\".$btn_params['btnid'].\"' value='\".$btn_value.\"' />\n </div>\";\n\t}\n\t\n\t\n\treturn $btn_str;\n}", "function save_button()\n\t\t{\n\t\t\t$output = '<span class=\"ace_style_wrap\"><a href=\"#\" class=\"ace_button ace_button_inactive ace_submit\">Save all changes</a></span>';\n\t\t\treturn $output;\n\t\t}", "function eddwp_button( $atts, $content = null ) {\n\textract( shortcode_atts( array(\n\t\t\t'link' \t => '',\n\t\t\t'color' => 'blue',\n\t\t\t'target' => '_blank',\n\t\t\t'icon' => '',\n\t\t),\n\t\t$atts, 'eddwp_button' )\n\t);\n\n\tswitch ( $color ) :\n\t\tcase 'blue' :\n\t\t\t$color = 'blue';\n\t\t\tbreak;\n\t\tcase 'darkblue' :\n\t\t\t$color = 'darkblue';\n\t\t\tbreak;\n\t\tcase 'gray' :\n\t\t\t$color = 'gray';\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$color = 'blue';\n\tendswitch;\n\t\n\tif ( ! empty( $icon ) ) :\n\t\t$fontawesome = '<i class=\"fa fa-' . $icon . '\" aria-hidden=\"true\"></i>';\n\telse :\n\t\t$fontawesome = '';\n\tendif;\n\n\treturn '<p><a href=\"' . esc_url( $link ) . '\" target=\"' . esc_attr( $target ) . '\" class=\"edd-submit button ' . esc_attr( $color ) . '\">' . $fontawesome . $content . '</a></p>';\n}", "function button( $attr, $content = null ) {\n // if have anchor inside, add button class\n if(preg_match( '/<a (.+?)>/', $content, $match ) ) {\n $content = substr_replace( $content, ' class=\"button\" ', 3, 0 );\n }\n // else, make it into do-nothing button\n else { $content = '<a class=\"button\">' . $content . '</a>'; }\n\n return wpautop( $content );\n }", "function BuyBoxSetNow() {\n\treturn\n'\n<a class=\"button radius primary medium\" title=\"Earlyarts Box Set\" href=\"/store/products/nurturing-young-childrens-learning-box-set/\" >Save a whopping 40% and buy this pack in a box-set!</a>\n';\n\t\n}", "function krnEmit_button_editSubmit($caption, $value) {\n // used twice in set security\n // submit for editing - so all are consistent - (design choices:Edit button - caption - caption button that looks like link)\n //?????????? if report should not be coded as button ??????????????????????\n //$cellClass = empty($cellClass) ? '' : ' class=\"'.$class.'\"';\n return '<button type=\"submit\" class=\"kcmKrn-button-editLink\" name=\"submit\" value=\"'.$value.'\">' . $caption . '</button>';\n}", "public function generate_buttons_HTML( ) {\n\t\t$follow_count_HTML = $this->get_count_html( $shape );\n\t\treturn\n<<<BUTTON\n<a target=\"_blank\" href=\"{$this->href}\">\n\t<div class=\"swfw-follow-button swfw_buttons_button swp-$this->key\">\n\t\t<div class='swfw-network-icon'>\n\t\t\t{$this->icon}\n\t\t</div>\n\n\t\t<div class=\"swfw-text\">\n\t\t\t<span class='swfw-cta'>$this->cta</span>\n\t\t\t{$follow_count_HTML}\n\t\t</div>\n\t</div>\n</a>\nBUTTON;\n\t}", "function get_submit_button($text = '', $type = 'primary large', $name = 'submit', $wrap = \\true, $other_attributes = '')\n {\n }", "function tac_form_submit_button( $button, $form ) {\n\treturn \"<button id='gform_submit_button_{$form['id']}'>Submit form</button>\";\n}", "public function render_button() {\n\n\t\t$total = WC()->cart->total;\n\n\t\t?>\n\n\t\t<div id=\"wc_braintree_paypal_container\"></div>\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_amount\" value=\"<?php echo esc_attr( WC_Braintree_Framework\\SV_WC_Helper::number_format( $total, 2 ) ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_currency\" value=\"<?php echo esc_attr( get_woocommerce_currency() ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_locale\" value=\"<?php echo esc_attr( $this->get_gateway()->get_safe_locale() ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_single_use\" value=\"<?php echo (int) $this->is_single_use(); ?>\" />\n\n\t\t<?php\n\t}", "function instructor_buttons(){\r\n$disabled=\"\";\r\n$myform=\"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\";\r\n\t$myform .= \"\\n\";\r\nif(!ipal_check_active_question()){$disabled= \"disabled=\\\"disabled\\\"\";}\r\n\r\n$myform .= \"<input type=\\\"submit\\\" value=\\\"Stop Polling\\\" name=\\\"clearQuestion\\\" \".$disabled.\"/>\\n</form>\\n\";\r\n\t\r\nreturn($myform);\r\n\t\r\n}", "function submitBack($backbutton = FALSE){\n\t\t$backButtonLabel = is_string($backbutton) ? $backbutton : $this->pi_getLL('backButtonLabel');\n\n\t\t$out .= '<div class=\"tx_td_backbutton\"><a href=\"javascript:history.back()\">'.$backButtonLabel.'</a></div>';\n\t\treturn $out;\n\t}", "private function show_connect_button() {\n\t\t?>\n\t\t<div class=\"text-center wp-core-ui rank-math-ui\" style=\"margin-top: 30px;\">\n\t\t\t<button type=\"submit\" class=\"button button-primary button-animated\" name=\"rank_math_activate\"><?php echo esc_attr__( 'Connect Your Account', 'rank-math' ); ?></button>\n\t\t</div>\n\t\t<?php\n\t}", "function createEmptyCartButton(){\n return '<h2 class = \"ui horizontal divider\"><a class = \"ui red button\" href =\"shopping-cart.php?removeAllCart=1\"> Empty Cart</a></h2><br>';\n}", "function default_success() {\n?>\n <br />\n <br />\n <center>\n <h2 class=\"newtext5\"><br />\n Teslimat bilgileriniz bize ulaştı.<br />\n Güvenli Ödemenizi yapmak için aşağıdaki butona tıklayınız.<br />\n Firmamız şahıs firması olduğundan dolayı Ödeme Bülent Şeker adına çekilecektir.</h2>\n <br />\n <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\">\n<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\n<input type=\"hidden\" name=\"hosted_button_id\" value=\"4S6Q6SY9B6AVE\">\n<input type=\"image\" src=\"https://www.paypalobjects.com/tr_TR/TR/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - Online ödeme yapmanın daha güvenli ve kolay yolu!\">\n<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/tr_TR/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n</form>\n</p>\n <p>&nbsp;</p>\n <p class=\"newtext5\"><br />\n </p>\n </center></td>\n <td width=\"2%\">&nbsp;</td>\n </tr>\n </table></td>\n </tr>\n <tr>\n <td align=\"center\"><img src=\"http://www.webaynet.com/tr/images/incebar.jpg\" width=\"962\" height=\"17\" /></td>\n </tr>\n <tr>\n <td align=\"center\"><img src=\"http://www.webaynet.com/tr/images/bigtable_alt.jpg\" width=\"962\" height=\"29\" /></td>\n </tr>\n</table>\n<span class=\"newtext5\">\n<?php\n\nexit;\n}", "public function getButtons() {\n $ret = \"\";\n $curURL = current_url();\n\n $ret .= <<<EOF\n <a href=\"{$curURL}?game_action=roll\">Kasta</a>\n <a href=\"{$curURL}?game_action=save\">Spara</a>\n <a href=\"{$curURL}?game_action=clear\">Starta om</a>\nEOF;\n\n return $ret;\n }", "function give_display_checkout_button( $form_id, $args ) {\n\n\t$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )\n\t\t? $args['display_style']\n\t\t: give_get_meta( $form_id, '_give_payment_display', true );\n\n\tif ( 'button' === $display_option ) {\n\t\tadd_action( 'give_post_form', 'give_add_button_open_form', 10, 2 );\n\t\treturn '';\n\t}\n\n\tif ( $display_option === 'onpage' ) {\n\t\treturn '';\n\t}\n\n\t$display_label_field = give_get_meta( $form_id, '_give_reveal_label', true );\n\t$display_label = ! empty( $args['continue_button_title'] ) ? $args['continue_button_title'] : ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );\n\n\t$output = '<button type=\"button\" class=\"give-btn give-btn-' . $display_option . '\">' . $display_label . '</button>';\n\n\t/**\n\t * filter the button html\n\t *\n\t * @param string $output Button HTML.\n\t * @param int $form_id Form ID.\n\t * @param array $args Shortcode argument\n\t */\n\techo apply_filters( 'give_display_checkout_button', $output, $form_id, $args );\n}", "function createAccountButton(){\n\t\techo '<form name=\"accounts\" method=\"post\" action=\"CheckBook.php/:Add\">';\n\t\techo '<button type=\"submit\">Add an Account</button>';\n\t\techo '</form>';\n\t}", "function print_button($url, $text) {\n\techo '<a href=\"'.$url.'\" class=\"btn btn-primary\">'.$text.'</a>';\t\n}", "function give_get_donation_form_submit_button( $form_id, $args = array() ) {\n\n\t$display_label_field = give_get_meta( $form_id, '_give_checkout_label', true );\n $display_label_field = apply_filters( 'give_donation_form_submit_button_text', $display_label_field, $form_id, $args );\n\t$display_label = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );\n\tob_start();\n\t?>\n\t<div class=\"give-submit-button-wrap give-clearfix\">\n\t\t<input type=\"submit\" class=\"give-submit give-btn\" id=\"give-purchase-button\" name=\"give-purchase\"\n\t\t value=\"<?php echo $display_label; ?>\" data-before-validation-label=\"<?php echo $display_label; ?>\"/>\n\t\t<span class=\"give-loading-animation\"></span>\n\t</div>\n\t<?php\n\treturn apply_filters( 'give_donation_form_submit_button', ob_get_clean(), $form_id, $args );\n}", "function backend_button($caption, $attributes = array(), $ajaxHandler=null, $ajaxParams = null, $formElement = null)\n\t{\n\t\treturn Backend_Html::button($caption, $attributes, $ajaxHandler, $ajaxParams, $formElement);\n\t}", "function email_print_preview_button($courseid) {\n // Action is handled weird, put in a dummy hidden element\n // and then change its name to action when our button has\n // been clicked\n /*echo '<span id=\"print_preview\" class=\"print_preview\">\n <input type=\"submit\" value=\"'.get_string('printemails', 'block_email_list').'\" name=\"action\" onclick=\"return print_multiple_emails(document.sendmail.mail);\" />\n <input type=\"hidden\" value=\"print\" name=\"disabled\" id=\"printactionid\" />\n </span>';\n*/\n\techo '<span id=\"print_preview\" class=\"print_preview\">';\n email_print_to_popup_window ('button', '/blocks/email_list/email/print.php?courseid='.$courseid.'&amp;mailids=', get_string('printemails', 'block_email_list'),\n get_string('printemails', 'block_email_list'));\n echo '</span>';\n}", "function backend_ctr_button($caption, $button_class, $attributes = array(), $ajaxHandler=null, $ajaxParams = null, $formElement = null)\n\t{\n\t\treturn Backend_Html::ctr_button($caption, $button_class, $attributes, $ajaxHandler, $ajaxParams, $formElement);\n\t}", "public function print_button() {\n\t\tglobal $product;\n\n\t\tswitch ( get_locale() ) {\n\t\t\tcase 'pt_BR':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Número de parcelas',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'es_ES':\n\t\t\tcase 'es_CO':\n\t\t\tcase 'es_CL':\n\t\t\tcase 'es_PE':\n\t\t\tcase 'es_MX':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Meses sin intereses'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Number of installments',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$max_instalments = $this->gateway->fetch_acquirer_max_installments_for_price($product->price);\n\n\t\t$args = apply_filters( 'ebanx_template_args', array(\n\t\t\t\t'cards' => $this->cards,\n\t\t\t\t'cart_total' => $product->price,\n\t\t\t\t'max_installment' => min($this->gateway->configs->settings['credit_card_instalments'], $max_instalments),\n\t\t\t\t'installment_taxes' => $this->instalment_rates,\n\t\t\t\t'label' => __( 'Pay with one click', 'woocommerce-gateway-ebanx' ),\n\t\t\t\t'instalments' => $messages['instalments']\n\t\t\t) );\n\n\t\twc_get_template( 'one-click.php', $args, '', WC_EBANX::get_templates_path() . 'one-click/' );\n\t}", "function dapper_button($variables) {\n $element = $variables['element'];\n\n $element['#attributes']['type'] = 'submit';\n if ($element['#type'] == \"button\") {\n element_set_attributes($element, array('id', 'name', 'title'));\n return '<button' . drupal_attributes($element['#attributes']) . '>' . $element['#value'] . '</button>';\n\n } else {\n element_set_attributes($element, array('id', 'name', 'value'));\n\n $element['#attributes']['class'][] = 'form-' . $element['#button_type'];\n if (!empty($element['#attributes']['disabled'])) {\n $element['#attributes']['class'][] = 'form-button-disabled';\n }\n\n return '<input' . drupal_attributes($element['#attributes']) . ' />';\n\n }\n}", "public function getButtonHtml()\n {\n $button = $this->getLayout()->createBlock(\n 'Magento\\Backend\\Block\\Widget\\Button'\n )->setData(\n [\n 'id' => 'download_button',\n 'label' => __('Download Log'),\n 'onclick' => 'setLocation(\\''.$this->getUrl('pslogin/index/download').'\\')',\n ]\n );\n return $button->toHtml();\n }", "function the_wpc_button( $args ) {\n\n if ( empty( $args['data'] ) || ( 'link' === $args['data']['link_type'] && empty( $args['data'][ $args['data']['link_type'] . '_link' ] ) ) ) {\n return;\n }\n\n $defaults = array(\n 'data' => null,\n 'classes' => [ 'btn' ]\n );\n\n $args = wp_parse_args( $args, $defaults );\n\n $href = get_the_wpc_button_link( $args['data'] );\n $label = get_the_wpc_button_label( $args['data'] );\n $classes = get_the_wpc_button_classes( $args['data'], $args['classes'] );\n $target = get_the_wpc_button_target( $args['data'] );\n ?>\n\n <a class=\"<?= implode( ' ', $classes ); ?>\"\n href=\"<?= $href; ?>\"\n title=\"<?= $label; ?>\"\n <?php if ( 'file' === $args['data']['link_type'] ) : ?>download<?php endif; ?>\n <?php if ( '_blank' === $target ) : ?>target=\"_blank\" rel=\"nofollow\"<?php endif; ?>>\n\n <?php if ( ! empty( $args['data']['icon'] ) ) : ?>\n <i class=\"<?= $args['data']['icon']; ?> mr-1\"></i>\n <?php endif; ?>\n\n <?= $label; ?>\n </a>\n <?php\n}", "function form_button($data = '', $content = '', $extra = '')\n {\n $ci =& get_instance();\n $ci->load->library('user_agent');\n\n $defaults = array('name' => ((! is_array($data)) ? $data : ''), 'type' => 'submit');\n\n if (is_array($data) and isset($data['content'])) {\n $content = $data['content'];\n $data['value'] = $data['content'];\n unset($data['content']); // content is not an attribute\n }\n\n /*\n * if a user has IE 7, we need to show them an input tag instead of a button tag\n * because of the way IE 7 handles submitting multiple buttons (it send the\n * innerHTML instead of the value in the key=>value pair)\n */\n if ($ci->agent->browser() == 'Internet Explorer' && $ci->agent->version() < 8) {\n return \"<input \"._parse_form_attributes($data, $defaults).$extra.\" />\";\n } else {\n return \"<button \"._parse_form_attributes($data, $defaults).$extra.\"><span>\".$content.\"</span></button>\\n\";\n }\n }", "function load_button($fileid, $permType, $btnCaption, $cssStyle) { // 1, \"DELETE\", load_lang(\"DELETE\"), \"fancy-button-blue\"\n global $dbf;\n global $lang;\n \n if(empty($fileid)) { exit(\"Please insert the file id @ button.\"); }\n if(empty($permType)){ exit(\"Please insert the permission type value for the button.\"); }\n if(empty($btnCaption)) { $btnCaption=\"DEFAULT_BUTTON\"; }\n if(empty($cssStyle)) { $cssStyle=\"\"; }\n \n $sqlPerm = \"SELECT * FROM base_user_permission WHERE user_id='\".$_SESSION['user_id'].\"' \n AND file_id ='\".$fileid.\"' AND permission='\".$permType.\"'\";\n $dbf->query($sqlPerm);\n $dbf->next_record();\n \n $rows = $dbf->rowdata();\n if($permType != $rows['permission']) {\n //exit(\"Invalid permission type!\");\n return;\n } else {\n \n $theButton = \"<input type=\\\"submit\\\" name=\".$permType.\" value=\\\"$btnCaption\\\" class=\\\"$cssStyle\\\" />\";\n \n return $theButton;\n }\n }", "function format_button_confirm($p_text, $p_action, $p_args, $p_msg, $p_msg_class = '', $p_icon = ''){\n\t$t_r = '';\n\n\t$t_args['confirm_btn'] = $p_text;\n\t$t_args['confirm_redirect'] = $p_action;\n\t$t_args['confirm_arg_keys'] = implode('|', array_keys($p_args));\n\t$t_args['confirm_arg_values'] = implode('|', array_values($p_args));\n\t$t_args['confirm_msg'] = $p_msg;\n\t$t_args['confirm_msg_class'] = $p_msg_class;\n\n\tif($p_icon != '')\n\t\t$t_r .= format_link($p_icon, helper_mantis_url('confirm.php'), $t_args, 'inline-page-link');\n\telse\n\t\t$t_r .= format_button_link($p_text, helper_mantis_url('confirm.php'), $t_args, 'inline-page-link');\n\n\treturn $t_r;\n}", "function clipboard_html_button($text, $invisible=True, $label=\"copy\"){\n // a javascript script has to go in the <head> for it to work\n /*\n <script>\n function copyToClipboard(elementId) {\n var input = document.createElement(\"input\");\n document.body.appendChild(input);\n input.value=document.getElementById(elementId).innerText;\n input.select();\n document.execCommand(\"copy\");\n document.body.removeChild(input);\n }\n </script>\n */\n $uniqueID=random_string(10);\n $style=\"\";\n if ($invisible) {$style=\"display: none;\";}\n $html = \"<span style=\\\"$style\\\" id=\\\"$uniqueID\\\">$text</span> \";\n $html .= \"<button class='button_copy' \";\n $html .= \"onclick=\\\"copyToClipboard('$uniqueID')\\\">$label</button>\";\n return $html;\n}", "public function back_to_cart_button_on_checkout() {\n\t\t\tif ( is_checkout() && ! is_wc_endpoint_url( 'order-received' ) && astra_get_option( 'checkout-back-to-cart-button' ) ) {\n\n\t\t\t\t$back_to_cart_text = astra_get_option( 'checkout-back-to-cart-button-text' );\n\n\t\t\t\tob_start();\n\t\t\t\t?>\n\t\t\t\t\t<div class=\"ast-back-to-cart\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( wc_get_cart_url() ); ?>\" ><?php echo esc_html( $back_to_cart_text ); ?></a>\n\t\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t\techo wp_kses_post( ob_get_clean() );\n\t\t\t}\n\t\t}", "function __tinypass_save_buttons( TPPaySettings $ps, $edit = false ) {\n\t?>\n\n\t<p>\n\t\t<input type=\"submit\" name=\"_Submit\" value=\"Save Changes\" tabindex=\"4\" class=\"button-primary\" />\n\t</p>\n\n<?php }", "function format_button($p_text, $p_id, $p_type = 'button', $p_action = '', $p_class = '', $p_class_overwrite = false, $p_prop = '', $p_force_input = false){\n\t$t_btn = '';\n\n\t$t_class = 'btn btn-primary btn-white btn-xs btn-round ' . $p_class;\n\n\tif($p_type == '')\n\t\t$p_type = 'button';\n\n\tif($p_class_overwrite)\n\t\t$t_class = $p_class;\n\n\tif($p_action != '')\n\t\t$p_type = 'submit';\n\n\tif($p_force_input == true)\n\t\t$t_btn .= '<input ';\n\telse\n\t\t$t_btn .= '<button ';\n\n\t$t_btn .= 'name=\"' . $p_id . '\" id=\"' . $p_id . '\" class=\"' . $t_class . '\" type=\"' . $p_type . '\" ' . $p_prop . ' ';\n\n\tif($p_action != '')\n\t\t$t_btn .= 'formaction=\"' . $p_action . '\" ';\n\t\n\tif($p_force_input == true)\n\t\t$t_btn .= ' value=\"' . $p_text . '\"/>';\n\telse\n\t\t$t_btn .= '>' . $p_text . '</button>';\n\n\t$t_btn .= format_hspace('2px');\n\n\treturn $t_btn;\n}", "public function print_button() {\n\t\t\techo do_shortcode( \"[yith_wcwl_add_to_wishlist]\" );\n\t\t}", "function ground_shortcode_button( $atts, $content = null ) {\n\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'link' => '',\n\t\t\t'target' => '_self',\n\t\t\t'class' => 'button',\n\t\t),\n\t\t$atts,\n\t\t'button'\n\t);\n\n\treturn '<a href=\"' . esc_html( $atts['link'] ) . '\" class=\"' . esc_html( $atts['class'] ) . '\" target=\"' . esc_html( $atts['target'] ) . '\">' . esc_html( $content ) . '</a>';\n\n}", "function zen_image_button($image, $alt = '', $parameters = '', $sec_class = '') {\n global $template, $current_page_base, $zco_notifier;\n\n // inject rollover class if one is defined. NOTE: This could end up with 2 \"class\" elements if $parameters contains \"class\" already.\n if (defined('IMAGE_ROLLOVER_CLASS') && IMAGE_ROLLOVER_CLASS != '') {\n $parameters .= (zen_not_null($parameters) ? ' ' : '') . 'class=\"rollover\"';\n }\n\n $zco_notifier->notify('PAGE_OUTPUT_IMAGE_BUTTON');\n if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') return zenCssButton($image, $alt, 'button', $sec_class, $parameters);\n return zen_image($template->get_template_dir($image, DIR_WS_TEMPLATE, $current_page_base, 'buttons/' . $_SESSION['language'] . '/') . $image, $alt, '', '', $parameters);\n }", "function cancel_comment_reply_button($html, $link, $text) {\n $style = isset($_GET['replytocom']) ? '' : ' style=\"display:none;\"';\n $button = '<button id=\"cancel-comment-reply-link\" class=\"btn-tertiary caps\" ' . $style . '>';\n return $button . $text . '</button>';\n}", "function standard_button( $atts, $content = null ) {\n\textract( shortcode_atts(\n\t\tarray(\n\t\t\t'url' => '',\n\t\t), $atts )\n\t);\n\n\treturn '<div><a class=\"page-btn \" href=\"' . $url . '\" target=\"_blank\">' . $content . '</a></div>';\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 link_with_disabled_back_button($url, $linktext){\n print \"<a href=\\\"$url\\\"\";\n print \"ONCLICK=\\\"location.replace(this.href);return false;\\\">\";\n print $linktext . \"</a>\";\n}", "function input_submit_account($value) {\n //create submit button of class 'submit_button_holder'\n echo \"<div class=\\\"submit_button_holder\\\">\";\n echo \"<input name=\\\"$value\\\" type=\\\"submit\\\" class=\\\"submit_account\\\" value=\\\"$value\\\">\";\n echo '</div>';\n}", "function back_link($width)\n\t{\n\t\tif(empty($_POST))\n\t\t\t$_SESSION['back_page'] = $_SERVER['HTTP_REFERER'];\n\t\t\t\n\t\t\techo '<table width=\"'.$width.'\" border=\"0\" align=\"center\"><tr><td align=\"right\" valign=\"middle\"><a href=\"'.$_SESSION['back_page'].'\" title=\"'.BACK_ICON_ALT.'\"><img border=\"0\" align=\"absmiddle\" src=\"'.BACK_ICON.'\" title=\"'.BACK_ICON_ALT.'\" alt=\"'.BACK_ICON_ALT.'\">Back</a></td></tr></table>';\n\t}", "function jabHtmlButton($caption, $id, $class=\"\", $name=\"\")\n{\n\tif ($name==\"\")\n\t\t$name=$id;\n\tif ($class!=\"\")\n\t\t$class=\" class=\\\"\".$class.\"\\\"\";\n\techo \"<input type=\\\"button\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$caption\\\"/>\\n\";\n}", "function submit_button($text = \\null, $type = 'primary', $name = 'submit', $wrap = \\true, $other_attributes = \\null)\n {\n }", "function sexy_button_to( $name, $internal_uri, $options = array())\n{\n $css_to_include = sfConfig::get( 'app_sfSexyButtonPlugin_stylesheet', '/sfSexyButtonPlugin/css/sexy_button' );\n $def_div_class = sfConfig::get( 'app_sfSexyButtonPlugin_div_class', 'sexy-button-clear' );\n $def_button_class = sfConfig::get( 'app_sfSexyButtonPlugin_button_class', 'sexy-button');\n sfContext::getInstance()->getResponse()->addStylesheet( $css_to_include );\n $html_options = _convert_options($options);\n // div class\n $div_class = _get_option($html_options, 'div_class', $def_div_class);\n // button class\n $button_class = _get_option($html_options, 'button_class', $def_button_class );\n $html_options['class'] = $button_class;\n // output div ?\n $nodiv = _get_option($html_options, 'nodiv', false);\n \n // One extra measure for IE\n $html_options['onclick'] = 'this.blur(); ponerLoading(this); '.\n ((isset($html_options['onclick']) ) ?\n $html_options['onclick'] : '');\n $html_options['id'] = \"sexyid\";\n // generate html\n $html = link_to( content_tag( 'span', $name), $internal_uri, $html_options );\n return ($nodiv) ? $html : content_tag( 'div', $html, \"class=$div_class\" );\n}", "function lbcb_print_option_buttons(){\n?>\n\t<input class=\"button-primary\" type=\"submit\" name=\"lbcb_options[save]\" id=\"lbcb_options[save]\" value=\"<?php _e( 'Save Options', 'lbcb_textdomain' ); ?>\"/>\n\t<input class=\"button-secondary\" type=\"submit\" name=\"lbcb_options[reset]\" id=\"lbcb_options[reset]\" value=\"<?php _e( 'Reset To Defaults', 'lbcb_textdomain' ); ?>\"/>\n\n<?php\n}", "public function getButtonUrl()\n {\n return 'https://documentation.bloomreach.com/developers/search-and-merchandising/pixel-deployment/getting-started.html';\n }", "function promptForIP() {\n // Prompt for IP of alternative device and reload page\n\n $thisurl = $_SERVER[\"SCRIPT_NAME\"];\n // reload page script:\n echo \"<script>\n function buttonClick() {\n var address = document.getElementById('address').value; \n window.location ='$thisurl?ip='+address;\n } \n </script>\";\n\n echo \"<h1>Try Alternate Source?</h1>\n <p>Enter IP address or DNS of payload device</p>\n <p><b>Tip:</b> You can find the IP address of an payload device in the admin page of Payload.</p>\n <p>Address of Payload Device:</p>\n <p><input id='address' type='text' name='address' required></p>\n <p><button type='button' onclick='buttonClick();'>Go!</button></p>\n \";\n\n exit(\"<hr>\");\n\n }", "public function &draw_movedown_button($in_tag, $in_value = false)\n {\n $text = \"\";\n //$text .= '<TD class=\"reportico-maintain-up-down-button-cell\">';\n $text .= '<input class=\"reportico-maintain-move-down-button reportico-submit\" type=\"submit\" name=\"submit_' . $in_tag . '_MOVEDOWN\" value=\"\">';\n //$text .= '</TD>';\n return $text;\n }", "function deleteButton() {\r\n\t \t\r\n\t \techo \"<a href='delete.php' class='btn btn-success'></a><br />\"; \r\n\t }", "public function getPaymentSubmitButtonText()\n\t{\n\t\treturn \"Proceed to 2checkout.com to pay\";\n\t}", "function redirectPayment($baseUri, $amount_iUSD, $amount, $currencySymbol, $api_key, $redirect_url) {\n error_log(\"Entered into auto submit-form\");\n error_log(\"Url \".$baseUri . \"?api_key=\" . $api_key);\n // Using Auto-submit form to redirect user\n return \"<form id='form' method='post' action='\". $baseUri . \"?api_key=\" . $api_key.\"'>\".\n \"<input type='hidden' autocomplete='off' name='amount' value='\".$amount.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='amount_iUSD' value='\".$amount_iUSD.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='callBackUrl' value='\".$redirect_url.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='api_key' value='\".$api_key.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='cur' value='\".$currencySymbol.\"'/>\".\n \"</form>\".\n \"<script type='text/javascript'>\".\n \"document.getElementById('form').submit();\".\n \"</script>\";\n}", "public static function my_account_links_newButton()\n {\n //let other method do all the checks and stuff\n return self::geoCart_cartDisplay_newButton(true);\n }", "function succulents_qodef_get_button_html( $params ) {\n\t\t$button_html = succulents_qodef_execute_shortcode( 'qodef_button', $params );\n\t\t$button_html = str_replace( \"\\n\", '', $button_html );\n\t\t\n\t\treturn $button_html;\n\t}", "function form_button($buttons = \"\") {\n\t\tif ($this->block == true)\n\t\t\t$buttons = \"fehler\";\n\n\t\t$btn['submit'] = \"<input accesskey='8' value=\\\"OK, Speichern\\\" class=\\\"submitbutton buttons\\\" type=\\\"submit\\\" />\";\n\t\t$btn['reset'] = \"<input accesskey='9' value=\\\"Eingaben l&ouml;schen\\\" class=\\\"resetbutton buttons\\\" type=\\\"reset\\\" />\";\n\t\t$btn['ex'] = \"<input accesskey='7' value=\\\"Beispiel..\\\" type=\\\"button\\\" class=\\\"examplebutton buttons\\\" onClick=\\\"set_examples();\\\" />\";\n\n\t\tswitch ($buttons) {\n\t\t\tdefault :\n\t\t\tcase 'ok_reset' :\n\t\t\t\t$r = \"<td colspan=\\\"3\\\" align=\\\"right\\\">\".$btn['submit'].\"&nbsp;\".$btn['reset'].\"</td>\";\n\t\t\t\tbreak;\n\t\t\tcase 'ex__ok_reset' :\n\t\t\t\t$r = \"<td>\".$btn['ex'].\"</td><td colspan=\\\"2\\\" align=\\\"right\\\">\".$btn['submit'].\"&nbsp;\".$btn['reset'].\"</td>\";\n\t\t\t\t$this->add_hidden_field(\"hiddenexample\", 0); // for examplebutton\n\t\t\t\t$this->special_form = \"onChange=\\\"document.myform.hiddenexample.value=0\\\"\";\n\t\t\t\tbreak;\n\t\t\tcase 'fehler' :\n\t\t\t\t$r = \"<td colspan=\\\"3\\\" align=\\\"center\\\" class=\\\"error\\\">Ich konnte notwendige Daten f&uuml;r dieses Formular nicht laden. <br />L&ouml;sung: \".$this->block.\"</td>\";\n\t\t\t\tbreak;\n\t\t}\n\t\treturn \"<tr>\".$r.\"</tr>\";\n\t}", "public function getButtonHtml()\n {\n $button = $this->getLayout()->createBlock(Button::class);\n $button->setData('id', $this->getButtonId())\n ->setData('label', __('Verify keys and connect webhooks'));\n\n return $button->toHtml();\n }", "public function button($atts)\n {\n // attritbute setup\n $atts = shortcode_atts(array(\n 'label' => 'geef een label op!',\n 'link' => '#',\n 'target' => '_self',\n 'class' => '',\n ), $atts);\n $atts['link'] = str_replace('http://', '//', $atts['link']);\n $atts['link'] = str_replace('https://', '//', $atts['link']);\n\n return '<a class=\"btn btn-cta '.$atts['class'].'\" href=\"'.$atts['link'].'\" target=\"'.$atts['target'].'\">'.$atts['label'].'</a>';\n }", "public function addButton(\\SetaPDF_FormFiller_Field_Button $button) {}", "function vals_soc_fix_submit_button($markup, $element) {\n $markup = str_replace('type=\"submit', 'type=\"button', $markup);\n return $markup;\n}", "function add_record_button($action_title, $file_name, $button_text)\n{\n ?>\n <p style=\"font-size:21px\"><?= ucwords($action_title) ?></p>\n <p>\n <a href=\"<?= $_SERVER['SCRIPT_NAME'] ?>?p=<?= $file_name ?>\" class=\"btn btn-primary\" role=\"button\">\n <span class=\"glyphicon glyphicon-plus-sign\"></span> Add <?= ucwords($button_text) ?></a>\n </p>\n <?php\n}", "function zen_image_submit($image, $alt = '', $parameters = '', $sec_class = '') {\n global $template, $current_page_base, $zco_notifier;\n if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class, $parameters);\n $zco_notifier->notify('PAGE_OUTPUT_IMAGE_SUBMIT');\n\n $image_submit = '<input type=\"image\" src=\"' . zen_output_string($template->get_template_dir($image, DIR_WS_TEMPLATE, $current_page_base, 'buttons/' . $_SESSION['language'] . '/') . $image) . '\" alt=\"' . zen_output_string($alt) . '\"';\n\n if (zen_not_null($alt)) $image_submit .= ' title=\" ' . zen_output_string($alt) . ' \"';\n\n if (zen_not_null($parameters)) $image_submit .= ' ' . $parameters;\n\n $image_submit .= ' />';\n\n return $image_submit;\n }", "function deals_button( $args = array() ){\n global $post;\n\n /* Set up the default arguments for the button. */\n $defaults = array(\n 'container_open' => '<div id=\"price-block-'.$post->ID.'\" class=\"price-block\">',\n 'container_close' => '</div>',\n 'expired_open' => '<span class=\"expired-button\">',\n 'expired_close' => '</span>',\n 'free_open' => null,\n 'free_close' => null,\n 'buy_open' => null,\n 'buy_close' => null,\n 'link_free_class' => 'buy-button',\n 'link_buy_class' => 'buy-button',\n 'text_buy' => 'Buy now',\n 'text_free' => 'Free Download',\n 'text_expired' => 'Deal expired',\n 'show_text_buy' => true\n );\n\n /* Parse the arguments and extract them for easy variable naming. */\n $args = wp_parse_args( $args, $defaults );\n $args = apply_filters( 'deals_button_args', $args );\n $args = (object) $args;\n\n $output = '';\n\n if($args->container_open)\n $output = $args->container_open;\n\n if (deals_is_expired() == 1) :\n\n $output .= $args->expired_open;\n $output .= '<span class=\"buy-label\">'.$args->text_expired.'</span>';\n $output .= $args->expired_close;\n\n else: \n\n if ( deals_is_free() ) :\n\n $link = (is_deal())? '#subscribe_deals':get_permalink($post->ID);\n $free_class = (is_deal())? $args->link_free_class.' free':$args->link_free_class;\n\n $output .= $args->free_open;\n $output .= '<a href=\"'.$link.'\" class=\"'.$free_class.'\"><span>'.$args->text_free.'</span></a>';\n $output .= $args->free_close;\n\n else: \n\n $link = (is_deal())? wp_nonce_url(deals_get_buy_url($post->ID), 'buy-button'):get_permalink($post->ID);\n\n $output .= $args->buy_open;\n $output .= '<a href=\"'.$link.'\" class=\"'.$args->link_buy_class.'\">';\n\n if($args->show_text_buy)\n $output .= '<span class=\"buy-label\">'.$args->text_buy.'</span> ';\n\n $output .= '<span class=\"price-label\">'.deals_discount().'</span>';\n $output .= '</a>';\n $output .= $args->buy_close;\n\n endif; \n\n endif;\n\n if($args->container_close)\n $output .= $args->container_close;\n\n echo $output;\n\n}", "function rt_button_edit($target)\n{\n return rt_ui_button('edit', $target, 'pencil');\n}", "function rt_button_delete($target)\n{\n return rt_ui_button('delete', $target, 'trash', array('method' => 'post', 'confirm' => 'Are you sure?'));\n}", "public function makeFullyRenderedButton() {}", "function tia_button($a) {\n\textract(shortcode_atts(array(\n\t\t'label' \t=> 'Button Text',\n\t\t'url'\t=> '',\n\t\t'id' \t=> '1',\t\t\n\t\t'target' => '',\t\t\n\t\t'size'\t=> ''\n\t), $a));\n\t\n\t$link = $url ? $url : get_permalink($id);\t\n\t\n\treturn '<a href=\"'.$link.'\"target=\"'.$target.'\" class=\"button '.$size.'\">'.$label.'</a>';\n\t\n}", "public function ov_button($content){\n $args = func_get_args(); array_shift($args);\n $args[] = array('content' => $content);\n return $this->generate_input('button', '', null, false, $args);\n }", "function voyage_mikado_comment_form_submit_button() {\n\n $comment_form_button = voyage_mikado_get_button_html(array(\n 'html_type' => 'input',\n 'type' => 'solid',\n 'text' => esc_html__('Submit', 'voyage'),\n 'input_name' => 'submit'\n ));\n\n return $comment_form_button;\n\n }", "private function button2() {\n\t\tif ( $this->button_array['button2']['text'] ) {\n\t\t\t?>\n\t\t\tlastOpenedPointer.find( '#pointer-close' ).after('<a id=\"pointer-primary\" class=\"button-primary\">' +\n\t\t\t\t'<?php echo esc_attr( $this->button_array['button2']['text'] ); ?>' + '</a>');\n\t\t\tlastOpenedPointer.find('#pointer-primary').click(function () {\n\t\t\t<?php echo $this->button_array['button2']['function']; ?>\n\t\t\t});\n\t\t<?php\n\t\t}\n\t}", "function admin_add_so_export_button($which)\n{\n global $typenow;\n if ('shop_order' === $typenow && 'top' === $which) {\n?>\n <input type=\"submit\" name=\"export_all_so\" class=\"button button-primary\" value=\"<?php _e('Export All'); ?>\" />\n<?php\n }\n}", "function render_submit_button( $form, $args ) {\n $button_attributes = array();\n\n $button_attributes['class'] = 'acf-button af-submit-button';\n\n $button_attributes = apply_filters( 'af/form/button_attributes', $button_attributes, $form, $args );\n $button_attributes = apply_filters( 'af/form/button_attributes/id=' . $form['post_id'], $button_attributes, $form, $args );\n $button_attributes = apply_filters( 'af/form/button_attributes/key=' . $form['key'], $button_attributes, $form, $args );\n\n echo '<div class=\"af-submit acf-form-submit\">';\n echo sprintf( '<button type=\"submit\" %s>%s</button>', acf_esc_atts( $button_attributes ), $args['submit_text'] );\n echo '<span class=\"acf-spinner af-spinner\"></span>';\n echo '</div>';\n }", "function backend_ctr_ajax_button($caption, $button_class, $ajaxHandler, $attributes = array(), $ajaxParams = null)\n\t{\n\t\treturn Backend_Html::ctr_ajaxButton($caption, $button_class, $ajaxHandler, $attributes, $ajaxParams);\n\t}" ]
[ "0.6562559", "0.6394668", "0.6351961", "0.6001892", "0.5968078", "0.5906994", "0.58635294", "0.583199", "0.58164155", "0.57817554", "0.5751098", "0.57226586", "0.57205504", "0.5715564", "0.57050365", "0.5689385", "0.5626933", "0.5616005", "0.5609918", "0.55776376", "0.55590916", "0.55481017", "0.55343187", "0.5527991", "0.5506453", "0.5504584", "0.5504259", "0.5502911", "0.5492499", "0.54828584", "0.5477791", "0.54736024", "0.54652953", "0.5456757", "0.5451129", "0.54257953", "0.53751534", "0.53579754", "0.5346854", "0.5343743", "0.53367877", "0.5334083", "0.5331525", "0.5330716", "0.5313314", "0.5310044", "0.5300447", "0.5292719", "0.52557355", "0.5254147", "0.52520674", "0.5251887", "0.5236861", "0.5236313", "0.52354485", "0.5230122", "0.5226976", "0.5223688", "0.5219872", "0.5203682", "0.52023894", "0.5191038", "0.51877236", "0.51872104", "0.518449", "0.5184256", "0.51735985", "0.51614934", "0.51592386", "0.5137272", "0.513577", "0.5124027", "0.51195353", "0.51168364", "0.51130104", "0.5111034", "0.50953317", "0.50925225", "0.50906485", "0.50840414", "0.5080574", "0.50783074", "0.50743103", "0.5070003", "0.5057899", "0.5052055", "0.5051923", "0.5051142", "0.5050126", "0.50492513", "0.5044583", "0.50440776", "0.5044036", "0.5041078", "0.50381166", "0.50380546", "0.5033116", "0.5022631", "0.5022447", "0.50068116", "0.50055856" ]
0.0
-1
/ RETURN TRUE if the paid == Y
function check_paid_status($app_id) { $this->db->select("paid"); $query = $this->db->get_where("tb_appointment",array('appointment_number' => $app_id)); if( $query->num_rows() > 0 ) { if ( $query->row(1)->paid == "Y" ) return TRUE; } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPaid(){\n return $this->status == \"SUCCESS\";\n }", "public function isPaid()\n {\n return $this->status === self::STATUS_APPROVED;\n }", "public function isPaid() {\n return $this->state === self::STATUS_PAID;\n }", "public function isPaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_PAID;\n }", "public function isPaid() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->payDate) ? false: true;\r\n\t}", "abstract function is_paying();", "public function paid() : bool\n {\n if (!Di::getDefault()->get('app')->subscriptionBased()) {\n return true;\n }\n\n return (bool) $this->paid;\n }", "public function isPaid()\n {\n return $this->markedAs($this->getPaidValue());\n }", "public function isPaid()\n {\n return Invoice\\InvoiceStatus::PAID == $this->status;\n }", "public function isPaid()\n\t{\n\t\t$externalDump = ExternalDump::where('lab_no', '=', $this->external_id)->get()->first();\n\n\t\t//Not from the external system\n\t\tif(is_null($externalDump)) {\n\t\t\treturn true;\n\t\t}\n\t\telseif( $this->visit->patient->getAge('Y') >= 6\n\t\t\t&& $externalDump->order_stage == \"op\" \n\t\t\t&& $externalDump->receipt_number == \"\" \n\t\t\t&& $externalDump->receipt_type == \"\" )\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}", "public function isPaid() {\n return $this->isPaid;\n }", "public function shouldPay()\n {\n $paidMoney = $this -> countPaidMoney();\n $consumedMoney = $this -> countConsumedMoney();\n \n return $consumedMoney > $paidMoney;\n }", "public function paidInFull()\n {\n $payment = $this->getPayment(1);\n\n return $payment && $payment->total == $this->getTotal();\n }", "private function isPaidCreditNote()\n {\n return ($this->getPaymentsTotal() >= $this->object->amount);\n }", "abstract function has_paid_plan();", "function is_paying_or_trial() {\n\t\t\treturn ( $this->is_paying() || $this->is_trial() );\n\t\t}", "public function unpaid(): bool\n {\n return in_array($this->status, [self::PENDING]);\n }", "public function isPaying()\n {\n if($this->paying && $this->paid_until > \\Carbon\\Carbon::now())\n {\n return true;\n }\n return false;\n }", "public function isRentPaidInAdvance()\n {\n return $this->isRentPaidInAdvance;\n }", "public function approved()\n\t{\n\t\treturn $this->response[0] === self::APPROVED;\n\t}", "function is_renew_order_paid($original_order_id) {\n\t$sql = \"SELECT * from orders WHERE original_order_id='$original_order_id' AND status='renew_paid' \";\n\t$result = mysql_query ($sql) or die(mysql_error());\n\tif (mysql_num_rows($result)>0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "public function isStatusNotPaid()\n {\n return $this->status == self::_ORDER_STATUS_NEW || $this->status == self::_ORDER_STATUS_REJECTED;\n }", "public static function runPayrollStatus(){\n if(TaxPerson::first()){\n return true;\n }\n else{\n return false;\n }\n }", "private function isOnepay(){\r\n return $this->getPaymentMethod() == 5;\r\n }", "private function isPaidInFlow($status){\r\n return $status == 2;\r\n }", "public function calculateProfit(): bool\n {\n return true;\n }", "public function processPayment(){\r\n return true;\r\n }", "public function hasY(){\n return $this->_has(2);\n }", "public function hasPriceIsPayWhatYouWant()\n {\n return $this->price_is_pay_what_you_want !== null;\n }", "public function canPayment()\n {\n return true;\n }", "public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "public function isUnpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNPAID;\n }", "public function return_verify() {\n\t\treturn true;\n if($_POST['payer_status'] == 'verified')\n {\n // check the payment_status is Completed\n if ($_POST['payment_status'] != 'Completed' && $_POST['payment_status'] != 'Pending')\n {\n return false;\n }\n\n // check that receiver_email is your Primary PayPal email\n if ($_POST['receiver_email'] != $this->payment['paypal_account'])\n {\n return false;\n }\n\n if ($this->order['api_pay_amount'] != $_POST['mc_gross'])\n {\n return false;\n }\n if ($this->payment['paypal_currency'] != $_POST['mc_currency'])\n {\n return false;\n }\n return true;\n }\n else\n {\n // log for manual investigation\n return false;\n }\n }", "public function isUnderpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNDERPAID;\n }", "private function isPaidInStore($orderStatus){\r\n return $orderStatus == 'completed';\r\n }", "public function hasPaidPlans()\n {\n return count($this->paid()) > 0;\n }", "function isApproved() {\n return $this->getStatus() == UserpointsTransaction::STATUS_APPROVED;\n }", "public function validatePaidContest() {\n /* To Check Wallet Amount, If Contest Is Paid */\n if ($this->Post['Privacy'] == 'Yes') {\n $this->load->model('Users_model');\n $UserData = $this->Users_model->getUsers('TotalCash,WalletAmount,WinningAmount,CashBonus', array('UserID' => $this->SessionUserID));\n $this->Post['WalletAmount'] = $UserData['WalletAmount'];\n $this->Post['WinningAmount'] = $UserData['WinningAmount'];\n $TotalWalletAmount = $UserData['WalletAmount'] + $UserData['WinningAmount'];\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"PrivateContestFee\" LIMIT 1');\n $PrivateContestFee = $PrivateContestFee->row()->ConfigTypeValue;\n $TotalContestFee = round($PrivateContestFee * $this->Post['ContestSize'], 2);\n $this->Post['TotalContestFee'] = $TotalContestFee;\n if ($TotalWalletAmount < $TotalContestFee) {\n $this->form_validation->set_message('validatePaidContest', 'Insufficient wallet amount.');\n return FALSE;\n } else {\n return TRUE;\n }\n } else {\n return TRUE;\n }\n }", "static function activePayment()\n\t{\n global $configClass;\n if($configClass['active_payment'] == 1 || $configClass['integrate_membership'] == 1)\n\t\t{\n return true;\n }\n\t\telse\n\t\t{\n return false;\n }\n }", "public function isValid() : bool\n {\n return $this->yesNo === self::YES || $this->yesNo === self::NO;\n }", "protected function isRelatedAppPaid(): bool\n {\n if (!$app = $this->account->getApp()):\n return $this->accountNotLinkedToAnyApp();\n endif;\n\n if (!$app->getPaid()):\n return $this->appBeingFree();\n endif;\n\n return true;\n }", "public function isFullyPaid()\n\t{\n\t\tif (!$this->_getBalanceInstance()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_getBalanceInstance()->isFullAmountCovered($this->_getOrderCreateModel()->getQuote());\n\t}", "function is_monthspaid_uptodate($months_paid, $return = 'boolean', $language = 'en_EN') {\r\n $current_month = date('n');\r\n\r\n if ($return == 'boolean') {\r\n if ($months_paid >= $current_month - 1) {\r\n return true;\r\n }\r\n return false;\r\n } elseif ($return == 'text') {\r\n if ($months_paid >= $current_month - 1) {\r\n switch (substr($language, 0, 2)) {\r\n case 'fr': return 'à jour';\r\n case 'en': return 'up to date';\r\n case 'de': return 'okay';\r\n case 'it': return 'aggiornati';\r\n }\r\n }\r\n switch (substr($language, 0, 2)) {\r\n case 'fr': return 'paiements en attente : ' . (($current_month - 1 - $months_paid)) . ' mois';\r\n case 'en': return '<span style=\"color:#c9302c;\">overdue payments : ' . (($current_month - 1 - $months_paid)) . ' month(s)</span>';\r\n case 'de': return 'offene Zahlungen : ' . (($current_month - 1 - $months_paid)) . ' Monaten';\r\n case 'it': return 'pagamenti pendenti : ' . (($current_month - 1 - $months_paid)) . ' mese';\r\n }\r\n }\r\n return false;\r\n}", "public function getIsTaxesPaid(): ?bool\n {\n return $this->isTaxesPaid;\n }", "public function status($price, $paid) {\n if(($price - $paid) > 0){\n return 'PEN';\n }else{\n return 'CLO';\n }\n }", "public function isDue(): bool;", "public function has_achieved_goal() {\r\n\t\treturn $this->get_donated_amount() >= $this->get_goal();\r\n\t}", "public static function pay($db, $id) {\n // Prepares query\n $query = \"UPDATE \" . Bill::$table_name . \" SET paid=true WHERE id =:id\";\n $stmt = $db->prepare($query);\n\n // Sets the variables in the query to the corresponding attribute values of the user object\n $stmt->bindParam(':id', $id);\n\n // Execute the query and return true if the execution was successful\n if($stmt->execute()) {\n return true;\n } else {\n return false;\n }\n }", "public function hasPrice()\n {\n return $this->amount_month || $this->amount_year;\n }", "public static function getPaymentStatus(Users $user) : bool\n {\n //if its not subscription based return true to ignore any payment status\n if (!Di::getDefault()->get('app')->subscriptionBased()) {\n return true;\n }\n\n if (!self::getByDefaultCompany($user)->paid()) {\n return false;\n }\n\n return true;\n }", "public function processPayment() {\n\t\t\tif ($this->order->authorizeTransaction()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function mark_verified() {\n\t\treturn $this->get_product_meta( 'listing_mark_verified' ) === 'yes';\n\t}", "function _exp_checkout_payment_success() {\n return true;\n }", "function is_paying__fs__() {\n\t\t\treturn $this->is_paying__premium_only();\n\t\t}", "public function asPaid()\n {\n return $this->markAs($this->getPaidValue());\n }", "function is_paying__premium_only() {\n\t\t\treturn ( $this->is__premium_only() && $this->is_paying() );\n\t\t}", "function is_not_paying() {\n\t\t\treturn ( $this->is_trial() || $this->is_free_plan() );\n\t\t}", "function checkLicence() {\n\n $isValid = true;\n \n return $isValid;\n}", "public function isApproved()\n {\n if ($this->approved == 'YES') {\n return true;\n }\n \n return false;\n }", "public function __mlmPaid($state = true);", "function is_paying_or_trial__premium_only() {\n\t\t\treturn $this->is_premium() && $this->is_paying_or_trial();\n\t\t}", "public function needs_payment() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_payment', 0 < $this->get_total( 'edit' ), $this );\n\t}", "public function isApproved(): bool;", "protected function isCompleteCaptured()\n {\n $payment = $this->getPayment();\n return $payment->getAmountPaid() == $payment->getAmountAuthorized();\n }", "public function allowAccountSettlement() \n {\n $blReturn = (\n $this->oxorder__oxpaymenttype->value == 'fcpopayadvance' ||\n fcPayOnePayment::fcIsPayOneOnlinePaymentType($this->oxorder__oxpaymenttype->value)\n );\n\n return $blReturn;\n }", "protected function shouldAddPayment(): bool\r\n {\r\n return DocumentTypes::hasPayments($this->documentType);\r\n }", "abstract function is_payments_sandbox();", "public function markAsActivate() : bool\n {\n $this->is_active = 1;\n $this->paid = 1;\n //$this->grace_period_ends = new RawValue('NULL');\n $this->ends_at = null; //new rawValue('NULL');\n $this->next_due_payment = $this->ends_at;\n $this->is_cancelled = 0;\n return $this->update();\n }", "private static function verifyEnabled() {\n try {\n\n $customerId = session()->get('id');\n\n $final = self::executeSweetApi(\n 'GET',\n '/api/social-class/v1/frontend/final?where[customers_id]='.$customerId,\n []\n );\n\n // Log::debug(get_object_vars($final));\n\n /**\n * Se já tiver atualizado as informações pessoais.\n */\n if (strlen(session()->get('updated_personal_info_at')) < 1) {\n return false;\n } \n\n /**\n * Se não possuir registro em final_social_class.\n */\n if(false === isset($final->data[0]->id)){\n return true;\n }\n\n /**\n * Se a classe social ainda for nula.\n */\n if(isset($final->data[0]->id) && (null == $final->data[0]->final_class_by_questions)){\n return true;\n }\n\n /**\n * Se já ganhou a pontuação.\n */\n if(isset($final->data[0]->id) && (60 == $final->data[0]->earned_points)){\n return false;\n }\n\n return false;\n\n } catch (RequestException $exception) {\n Log::debug($exception->getMessage());\n } catch (ConnectException $exception) {\n Log::debug($exception->getMessage());\n } catch (ClientException $exception) {\n Log::debug($exception->getMessage());\n } catch (BadResponseException $exception) {\n Log::debug($exception->getMessage());\n } \n }", "public function setPaid()\n {\n return $this->setMarkedAs($this->getPaidValue());\n }", "public function markAsPaid() {\n $this->status = parent::STATUS_PAID;\n $this->admin_id = Yii::app()->user->getId();\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function canBuy()\n {\n //改成上半场内都能投注\n $match = $this->getMatch();\n if (!is_null($match) && ($match->isBeforeHalf())){\n return true;\n } else {\n return false;\n }\n }", "function checkAccount($person){\r\n\r\n\t\t$pay_plan = $this->accounts_model->checkAccountPlan($person['id']);\r\n\r\n\t\tif(!empty($pay_plan) && count($pay_plan) > 0 ){\r\n\r\n\t\t\t$hrs = abs(strtotime( date('Y-m-d h:i:s') ) - strtotime($pay_plan['last_paid_date']))/(60*60);\r\n\t\t\t$hrs = (int)$hrs;\r\n\r\n\t\t\tif(strpos($person['role'], 'pro_')){\r\n\r\n\t\t\t\tif($person['pay_plan']==\"annually\"){\r\n\r\n\t\t\t\t\tif($hrs < 365*24)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse{//monthly\r\n\r\n\t\t\t\t\tif($hrs < 31*24)\r\n\t\t\t\t\t\treturn true;\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tredirect('payplan/'.$person['id']);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\r\n\t\t\t$hrs = abs(strtotime(date('Y-m-d h:i:s')) - strtotime($person['regdate']))/(60*60);\r\n\t\t\t$hrs = (int)$hrs;\r\n\r\n\t\t\tif(strpos($person['role'], 'pro_')){\r\n\t\t\t\t\r\n\t\t\t\tif($hrs < 14*24){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tredirect('payplan/'.$person['id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//common users\r\n\t\treturn true;\r\n\t}", "function valid_payment($student, $month, $year)\n {\n $this->ci->db->where('student_id', $student);\n $this->ci->db->where('financial_year', $year);\n $val = $this->ci->db->get($this->table)->row();\n\n if ($val->$month){ return FALSE; } else{ return TRUE; }\n }", "function sd_action_y() {\r\n\t\tsd_action_y_or_n('YES');\r\n\t}", "function mark_as_paid() {\n if (!$this->active_invoice->isLoaded()) {\n $this->response->notFound();\n } // if\n\n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n try{\n if($this->request->isAsyncCall()) {\n $this->active_invoice->setStatus(INVOICE_STATUS_PAID);\n $this->active_invoice->save();\n $this->response->respondWithData($this->active_invoice, array(\n 'as' => 'invoice',\n 'detailed' => true,\n ));\n } else {\n $this->response->badRequest();\n } //if\n } catch (Exception $e) {\n $this->response->exception($e);\n } //try\n }", "public function isValid()\n {\n return $this->getStatus() != 'unlicensed';\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "function checkUserPaymentStatus($uid)\n {\n \t\t$return_val = 0;\n\t\tif(isset($uid))\n\t\t{\n\t\t\t$sql = \"SELECT user_id, payment_status FROM \".WPMLM_TABLE_USER.\" WHERE user_id = '\".$uid.\"' \";\n\t\t\t$rs = @mysql_query($sql);\n\t\t\t\n\t\t\tif($rs && @mysql_num_rows($rs)>0) \n\t\t\t{\n\t\t\t\t$row = @mysql_fetch_array($rs);\n\t\t\t\t$payment_status = $row['payment_status']; \n\t\t\t\tif($payment_status==2){\n\t\t\t\t\t$return_val = \"TRUE\";\n\t\t\t\t}else{\n\t\t\t\t\t$return_val = \"FALSE\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t@mysql_free_result($rs);\n\t\t\t\n\t\t}\n\t\treturn $return_val; \t\n }", "abstract function is_premium();", "public function allowDebit() {\n $blIsAuthorization =\n ($this->oxorder__fcpoauthmode->value == 'authorization');\n\n if ($blIsAuthorization) return true;\n\n $sQuery = \"\n SELECT \n COUNT(*) \n FROM \n fcpotransactionstatus \n WHERE \n fcpo_txid = '{$this->oxorder__fcpotxid->value}' AND \n fcpo_txaction = 'appointed'\n \";\n\n $iCount = (int) $this->_oFcpoDb->GetOne($sQuery);\n\n $blReturn = ($iCount === 1);\n\n return $blReturn;\n }", "private function successFrom($response)\n {\n return $response['ResponseCode'] == self::APPROVED;\n }", "function verifiedUser($num, $pid, $td_user)\n{\n\t$db_obj = Db::getInstance()->ExecuteS('SELECT * FROM '.pSQL(_DB_PREFIX_.'sociallogin').' as c WHERE c.id_customer='.\" '$num'\".'\n\tAND c.provider_id='.\" '$pid'\".' LIMIT 0,1');\n\t$verified = $db_obj['0']['verified'];\n\tif ($verified == 1 || $td_user == 'yes')\n\t\treturn true;\n\treturn false;\n}", "public function hasPrice(){\n return $this->_has(12);\n }", "private function isServipag(){\r\n return $this->getPaymentMethod() == 2;\r\n }", "function it_returns_one_percent_for_one_payment_one_year_after_the_advance()\n {\n $this->addPayment(101, 365);\n\n $this->calculate()->shouldReturn(1.0);\n }", "public function getApproved() {\n\t\treturn $this->approved == 1;\n\t}", "public function punyaBimbingan()\n {\n return ($this->bimbingan(RequestStatus::APPROVED)\n ->count() > 0);\n }", "public function canBeFree()\n {\n return count($this->getCurrentStudentCareerSchoolYear()) > 0;\n\n }", "public function issetPaymentAmount(): bool\n {\n return isset($this->paymentAmount);\n }", "function store_order_paid(Order $order)\n {\n if ($order->order_owing < 0) {\n return '<span class=\"store_order_paid_over\">'.lang('store.overpaid').'</span>';\n } elseif ($order->order_owing == 0) {\n return '<span class=\"store_order_paid_yes\">'.lang('yes').'</span>';\n } elseif ($order->order_paid > 0) {\n return store_currency($order->order_paid);\n } else {\n return lang('no');\n }\n }", "function is_payment_completed($cart_id){\r\n\t\t\r\n\t\t$query = \"select order_status from risk_score where cart_id=$cart_id\";\r\n\t\t$result = mysql_query($query);\r\n\t\tif(mysql_error()==\"\"){\r\n\t\t\tif(mysql_num_rows($result)==0){\r\n\t\t\t\treturn true;//No record in risk score exists - risk score record is being created only for WP payments to start with\r\n\t\t\t}\r\n\t\t\t$row=mysql_fetch_assoc($result);\r\n\t\t\tif(intval($row[\"order_status\"])==1){\r\n\t\t\t\treturn true;//Order completed or captured\r\n\t\t\t}else{\r\n\t\t\t\treturn false;//Order is not completed or not captured\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn \"Error: An error occurred while getting risk_orders.order_status of cart_id $cart_id.<br><br>\".mysql_error().\"<br><br>Query is: $query\";\r\n\t\t}\r\n\t\t\r\n\t}", "function checkorderstatus($ordid){\n $Ord=M('Balance');\n $isverified=$Ord->where('balanceno='.$ordid)->getField('isverified');\n if($isverified==1){\n return true;\n }else{\n return false;\n }\n}", "function check_payout($parameters) \n\t{ \n\t\tif($this->has_type($parameters, 'payout_principal')\n\t\t || $this->has_type($parameters, 'card_payout_principal')\n\t\t)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}", "public function hasProof(){\n return $this->_has(1);\n }", "public function checkIfSubscriptionIsPaid($subscription_id){\n\t\t$subscription = Braintree_Subscription::find($subscription_id);\n\t\tif(!empty($subscription)){\n\t\t\tif($subscription->status === Braintree_Subscription::ACTIVE || $subscription->status === Braintree_Subscription::PENDING){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }", "public function payment_status_completed()\n {\n if ($this->order->has_status(OrderStatuses::ORDER_STATUS_COMPLETED)) {\n $this->logger->error('IPN Error. Payment already completed.');\n return true;\n }\n\n if (!$this->validator->is_valid_payment()) {\n $lastError = $this->validator->get_last_error();\n $this->order->update_status(OrderStatuses::ORDER_STATUS_ON_HOLD, $lastError);\n $this->logger->error(\"IPN Error. Payment validation failed: {$lastError}\");\n return false;\n }\n\n $this->save_paypal_meta_data();\n\n $paymentStatus = $this->request->get(Request::KEY_PAYMENT_STATUS, FILTER_SANITIZE_STRING);\n $isOrderStatusCompleted = $this->orderStatuses->orderStatusIs(\n $paymentStatus,\n OrderStatuses::ORDER_STATUS_COMPLETED\n );\n\n if ($isOrderStatusCompleted) {\n $transaction_id = $this->request->get(\n Request::KEY_TXN_ID,\n FILTER_SANITIZE_STRING\n );\n $note = __('IPN payment completed', 'woo-paypalplus');\n $fee = $this->request->get(Request::KEY_MC_FEE, FILTER_SANITIZE_STRING);\n\n $this->payment_complete($transaction_id, $note);\n\n if (!empty($fee)) {\n update_post_meta($this->order->get_id(), 'PayPal Transaction Fee', $fee);\n }\n\n $this->logger->info('Payment completed successfully');\n return true;\n }\n\n $this->payment_on_hold(\n sprintf(\n __('Payment pending: %s', 'woo-paypalplus'),\n $this->request->get(Request::KEY_PENDING_REASON, FILTER_SANITIZE_STRING)\n )\n );\n\n $this->logger->info('Payment put on hold');\n return true;\n }", "public function fcIsPayPalOrder() \n {\n $blReturn = false;\n if ($this->oxorder__oxpaymenttype->value == 'fcpopaypal' || $this->oxorder__oxpaymenttype->value == 'fcpopaypal_express') {\n $blReturn = true;\n }\n return $blReturn;\n }" ]
[ "0.7703299", "0.7536802", "0.7182981", "0.71536565", "0.7146331", "0.70471346", "0.70316917", "0.70305955", "0.70226896", "0.69500095", "0.683269", "0.6674601", "0.66002864", "0.658255", "0.64907944", "0.64663315", "0.6444057", "0.6344298", "0.628721", "0.62827206", "0.6253773", "0.6237438", "0.6219027", "0.61878777", "0.6169727", "0.6159088", "0.61307496", "0.61268795", "0.61230963", "0.61038977", "0.6096123", "0.6087527", "0.60724926", "0.59924865", "0.5988651", "0.59568775", "0.5925728", "0.5922886", "0.5912734", "0.5912198", "0.58980286", "0.5853342", "0.58432", "0.5820972", "0.58117276", "0.5810034", "0.57846606", "0.5783984", "0.577633", "0.577273", "0.5767858", "0.5764663", "0.57619834", "0.5751844", "0.57480377", "0.5747477", "0.5744626", "0.57414496", "0.57398176", "0.57392347", "0.5721364", "0.57008743", "0.5700457", "0.56924057", "0.5688713", "0.5687841", "0.5682912", "0.56713647", "0.5670036", "0.56433505", "0.56387174", "0.5638368", "0.56195235", "0.56194043", "0.56088865", "0.56082636", "0.5602053", "0.5579021", "0.5577234", "0.5566294", "0.55635905", "0.5559149", "0.5558901", "0.555884", "0.554873", "0.5525717", "0.5520331", "0.5519417", "0.5513529", "0.5508352", "0.5504675", "0.54967153", "0.5496225", "0.54927593", "0.5488557", "0.5486423", "0.5480132", "0.5476488", "0.54754674", "0.5475316" ]
0.6978425
9
Specify Model class name
public function model() { return ArquivosProject::class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getModelName()\n {\n if (isset($this->options[\"type\"])) {\n $type = ucfirst($this->options[\"type\"]);\n $class = \"\\\\app\\\\models\\\\feeds\\\\\" . $type;\n if (class_exists($class)) {\n return $class;\n }\n }\n \n return \"\\\\app\\\\models\\\\\" . $this->objectName;\n }", "public function getModelNameBasedOnClassName(): string\n {\n $fqn = explode(\"\\\\\", get_class($this));\n\n return strtolower(end($fqn));\n }", "public static function model($className=__CLASS__)\r\n\t{\r\n return parent::className();\r\n\t}", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n \treturn parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model ($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n\treturn parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) \n\t{\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public function getModelClass(): string\n {\n return static::${'modelClass'};\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model ($className = __CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public function getModelClass();", "public function getModelClass();", "public function getModelClass();", "public static function model($className = __CLASS__) {\n return parent::model( $className );\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }" ]
[ "0.768929", "0.76618075", "0.7585344", "0.7583571", "0.7583571", "0.7542252", "0.75075734", "0.74778146", "0.74702877", "0.74578375", "0.74578375", "0.7453601", "0.7453601", "0.7447208", "0.7444998", "0.7435527", "0.74304074", "0.7416409", "0.74128395", "0.74125767", "0.74125767", "0.74125767", "0.741222", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.740793", "0.74018055", "0.7400949", "0.739494", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.7390499", "0.7390499", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7383603", "0.7379902", "0.7379902", "0.73766464", "0.73766464", "0.73766464", "0.73750174", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766" ]
0.0
-1
Boot up the repository, pushing criteria
public function boot() { $this->pushCriteria(app(RequestCriteria::class)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initRepository(): void;", "public function init_repo() {\n\n\t\t\t// include the repository configuration\n\t\t\t$repos = include_once(CONFIGPATH . 'repositories.php' );\n\n\t\t\t// the $_GET['deploy'] parameter from request\n\t\t\t$requested_deploy = filter_input( \\INPUT_GET, 'deploy', \\FILTER_SANITIZE_STRING );\n\n\t\t\t// assume that no repository is selected for deployment\n\t\t\t$selected = false;\n\n\t\t\t// if no deploy param was found, maybe pick up the first (and often, only) repository config\n\t\t\tif ( empty( $requested_deploy ) ) {\n\n\t\t\t\t$selected = $this->maybe_select_deploy( $repos[ 0 ], $requested_deploy );\n\n\t\t\t// otherwise, loop through repositories to select the requested one\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tforeach ( $repos as $deploy_config ) {\n\n\t\t\t\t\t$selected = $this->maybe_select_deploy( $deploy_config, $requested_deploy );\n\n\t\t\t\t\t// if we found one, break the loop\n\t\t\t\t\tif ( $selected === true ) {\n\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\t// we didn't find any, throw an error\n\t\t\tif ( $selected === false ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Configuration not found for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }", "public function prepare(): void\n {\n $this->processRunner->runAndReport(\n sprintf(\n 'git clone %s --depth 1 --single-branch --branch %s project/sylius',\n $this->getGitRepository(),\n $this->getVersion()\n )\n );\n $this->processRunner->runAndReport('composer install --working-dir project/sylius --no-dev --no-interaction');\n }", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "public function deploy(){\n\t\t\t// load all configuration, payload, etc\n\t\t\t$this->load();\n\n\t\t\t// setup directories\n\t\t\t$this->setup_dirs();\n\n\t\t\t// initialise local git repositories\n\t\t\t$this->init_repo();\n\n\t\t\t// run the deployment\n\t\t\t$this->_deploy();\n\t\t}", "public function run()\n {\n $repo1 = Repo::create([\n 'name' => 'johnbolton/exercitationem',\n 'url' => 'https://github.com/johnbolton/exercitationem',\n 'event_id' => 1,\n ]);\n\n $repo2 = Repo::create([\n 'name' => 'pestrada/voluptatem',\n 'url' => 'https://github.com/pestrada/voluptatem',\n 'event_id' => 2,\n ]);\n }", "protected function prepareDatabase()\n {\n $this->stateSaver->setConnection($this->input->getOption('database'));\n\n if (!$this->stateSaver->repositoryExists()) {\n $options = ['--database' => $this->input->getOption('database')];\n $this->call('migrate:install', $options);\n }\n }", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function setUp() {\n\n $connection = new \\Redis();\n $connection->connect('127.0.0.1', 6379);\n $connection->select(11);\n $adapter = new Rstore\\ConnectionAdapter\\Phpredis($connection);\n\n $this->connection = $connection;\n $this->repo = new Repository(\n $adapter,\n yaml_parse_file(__DIR__.'/../../config/models.yaml')\n );\n }", "public function setUp()\n {\n $this->config = new Repository();\n }", "public function main() {\n $this->retrieveUsers();\n\n // Adds genome configurations to user\n // Adds genome uploads and genome updates to genome configurations\n foreach($this->users as &$user) {\n $this->retrieveUserConfigs($user);\n foreach($user['configs'] as &$config) {\n $this->retrieveConfigUploads($config);\n $this->retrieveConfigUpdates($config);\n }\n }\n\n // Removes not used databases\n $this->dropUnusedDatabases();\n }", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "public function __construct()\n {\n $testConfig = array(\n 'database' => array(\n 'in_memory' => true,\n 'driver' => 'pdo_sqlite',\n )\n );\n\n $this->application = new BacklogApplication();\n $this->application->registerPlugin($plugin = DoctrinePlugin::bootstrap($testConfig, 'test'));\n $this->application->setAutoExit(false);\n $this->repositoryManager = $plugin->getRepositoryManager();\n $this->persons = $this->repositoryManager->getPersonRepository();\n }", "protected function initial()\n {\n $adapter = new Local('/', LOCK_SH, Local::SKIP_LINKS);\n $local = new Filesystem($adapter);\n foreach ($this->config->returnActions() as $key => $elem) {\n $ctype = (strtolower($elem['typebackup']) !== 'mysql' ? ucfirst(strtolower($elem['type'])) : 'Time').ucfirst(strtolower($elem['typebackup']));\n $dst = $this->distination($this->config->returnConfig($elem['dst']), $key, $elem['dst']);\n $class = '\\backup\\Actions\\\\'.$ctype;\n $this->run[] = new $class($elem, $dst, $local, $this->config->returnMysqlConfig($elem['mysqlconfig']));\n MyLog::info('Initialization backup process - '.$ctype.' with config', $elem, 'main');\n $this->initial = $this->initial === false ? true : true;\n }\n }", "public function run()\n {\n if (!Repository::find(6)) {\n Repository::create([\n 'id' => 6,\n 'type' => 'model',\n 'name' => '2020 A3 Sedan'\n ]);\n }\n\n if (!Repository::find(7)) {\n Repository::create([\n 'id' => 7,\n 'type' => 'model',\n 'name' => 'BMW Wagon'\n ]);\n }\n\n if (!Repository::find(8)) {\n Repository::create([\n 'id' => 8,\n 'type' => 'model',\n 'name' => 'Ford EcoSport'\n ]);\n }\n\n if (!Repository::find(9)) {\n Repository::create([\n 'id' => 9,\n 'type' => 'model',\n 'name' => 'Honda Amaze'\n ]);\n }\n\n if (!Repository::find(10)) {\n Repository::create([\n 'id' => 10,\n 'type' => 'model',\n 'name' => 'NX 300 F SPORT'\n ]);\n }\n }", "protected function prepareDatabase()\n {\n if (!$this->repositoryExists()) {\n $this->components->info('Preparing database.');\n\n $this->components->task('Creating package migration table', function () {\n return $this->callSilent('package:migrate:install', array_filter([\n '--database' => $this->option('database'),\n ])) == 0;\n });\n\n $this->newLine();\n }\n\n }", "public function collect() {\n // register installed projects\n foreach ($this->drush->getExtensions() as $extension) {\n if ($extension->type == 'theme') {\n continue;\n }\n\n $projectName = $this->projectFactory->getProjectName($extension);\n if ($this->projectRegistry->hasProject($projectName)) {\n $project = $this->projectRegistry->getProject($projectName);\n }\n else {\n $project = $this->projectFactory->createProjectFromExtension($extension);\n $this->projectRegistry->addProject($project);\n }\n\n $module = $this->projectFactory->createModuleFromExtension($extension);\n $module->setProject($project);\n $project->addModule($module);\n\n $this->projectRegistry->addModule($module);\n }\n\n // populate module dependencies\n foreach ($this->drush->getExtensions() as $extension) {\n if ($extension->type == 'theme') {\n continue;\n }\n\n $module = $this->projectRegistry->getModule($extension->name);\n foreach (array_keys($extension->requires) as $name) {\n if ($this->projectRegistry->hasModule($name)) {\n $module->addDependency($this->projectRegistry->getModule($name));\n }\n }\n foreach (array_keys($extension->required_by) as $name) {\n if ($this->projectRegistry->hasModule($name)) {\n $module->addRequiredByModule($this->projectRegistry->getModule($name));\n }\n }\n }\n }", "public function __construct()\n {\n $this->kitchenRecipeRepository = app(KitchenRecipeRepository::class);\n $this->kitchenIngredientRepository = app(KitchenIngredientRepository::class);\n $this->kitchenIngredientKitchenRecipeRepository = app(KitchenIngredientKitchenRecipeRepository::class);\n }", "public function init()\n {\n\n // initialize the prepared statements\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERIES));\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERY));\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERIES_BY_SKU));\n }", "private function registerRepository(){\n $this->dataSources = array(\n 1=>new DataSourceIRC61647(),\n );\n }", "function boot()\n {\n parent::boot();\n $this->pushCriteria(app(RequestCriteria::class));\n if ($_FILES) {\n config(['repository.cache.enabled' => false]);\n }\n }", "public function __construct(UserRepository $repository)\n {\n parent::__construct();\n $this->repository = $repository;\n\t $this->repository->pushCriteria(new HasReadyStartupsCriteria());\n }", "function repositoryCustom()\n {\n }", "public final function prep(){\n\n //disable apache from append session ids to requests\n ini_set('session.use_trans_sid',0);\n //only allow sessions to be used with cookies\n ini_set('session.use_only_cookies',1);\n\n //base directory of application\n //$this->path = dirname($_SERVER['DOCUMENT_ROOT']);\n $this->path = dirname(dirname(dirname(dirname(dirname(__DIR__)))));\n \n //load the appropriate application production configuration \n //and override with any dev config.\n if(is_file($this->path.'/.config.php')){\n $this->config = require($this->path.'/.config.php');\n if($this->config['APP_MODE']!='PROD' && is_file($this->path.'/.dev.config.php')){\n $this->config = array_merge($this->config,require($this->path.'/.dev.config.php'));\n }//if\n }//if\n \n //if the COMPOSER PATH isn't set then resort to the default installer path \"vendor/\"\n if(!isset($this->config['COMPOSER_PATH'])){\n $this->config['COMPOSER_PATH'] = 'vendor';\n }//if\n\n }", "public function run()\n {\n return $this->repoClass->init();\n }", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", "public function __construct()\n {\n $this->bigStatisticsRepo = new BigStatisticsRepository();\n }", "function plugin_initconfig_repository()\n{\n global $_CONF;\n\n $c = config::get_instance();\n if (!$c->group_exists('repository')) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'repository');\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'repository');\n $c->add('repository_moderated', 1,\n 'select', 0, 0, 0, 10, true, 'repository');\n $c->add('max_pluginpatch_upload', 2000000, \n 'text', 0, 0, 0, 60, true, 'repository'); // 2 MB\n }\n\n return true;\n}", "public function run()\n {\n passthru('cd ' . realpath($this->basedir) . ' && git pull origin master && curl -sS https://getcomposer.org/installer | php && php composer.phar install && git remote update && cd -');\n }", "function install(){}", "public function __construct()\n {\n $this->postRepository = new PostRepository();\n $this->userRepository = new UserRepository();\n $this->commentRepository = new CommentRepository();\n $this->replyRepository = new ReplyRepository();\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "protected function init()\n {\n if (in_array('users', Mongez::getStored('modules'))) {\n $this->isUserModuleExits = true;\n }\n\n $this->info('Preparing data...');\n $this->initController();\n $this->initModel();\n $this->initResource();\n $this->initRepository();\n $this->initData();\n }", "public function setup (){\n\t\techo \"\\n\";\n\t\techo \"Setting up: `\".$this->installedComponents[0]->name.\"`\\n\";\n\t\techo \"version: `\".$this->installedComponents[0]->version.\"`\\n\";\n\t\t//$installed[0]->version_normalized;\n\t\t\n\t\t\n\t\t#var_dump(\"xyz\");\n\t\techo \"-----------------------------------------\\n\";\n\t\t\n\t\t$searchDir = realpath($this->vendorDir . '/../..');\n\t\tif( file_exists($searchDir.\"/configuration.ini\") ){\n\t\t\techo \"found a previous `configuration.ini` ( \".$searchDir.\"/configuration.ini\".\" ) \\n\";\t\n\t\t\t\n\t\t\t$app = $this->readConfiguration($searchDir.\"/configuration.ini\" );\n\t\t\t$coreComponent = $this->getComponentVersion($this->installedComponents);\n\t\t\t\n\t\t\techo \"\\nsettings\\n\";\n\t\t\t//print_r($app->settings['conn']);\n\t\t\t\n\t\t\t//print_r();\n\t\t\t\n\t\t\t/* create the $this->pdo instance */\n\t\t\t$this->createPDO($app->configuration->role->conn);\n\t\t\t\n\t\t\t\n\t\t\t#echo \"\\npaths\\n\";\n\t\t\t#print_r($app->paths);\n\t\t\t#echo \"\\ncoreComponent\\n\";\n\t\t\t#print_r($coreComponent);\n\t\t\t\n\t\t\t#echo \"need to add config-parse code here..\\n\";\n\t\t\t////////////////////////////////////////////////////\n\t\t\t$this->createdb($this->pdo);\n\t\t\t\n\t\t\t//echo \"\\n\\nFINISHED!!\\n\\n\";\n\t\t\t\n\t\t}else{\n\t\t\techo \"\\n No configuration found, starting setup.\\n\";\n\t\t\t$public_html = $this->public_html();\n\t\t\t$tempFolder = $this->tempFolder();\n\t\t\t\n\t\t\t/* create the $this->pdo instance from requested credentials */\n\t\t\t$dbCredentials = $this->dbCredentials();\n\t\t\t\n\t\t\t////////////////////////////////////////////////////\n\t\t\t$this->pdo;\n\t\t\techo \"\\n\\nUNFINISHED!!\\n\\n\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\techo \"\\n\";\n\t}", "abstract protected function bootstrap();", "public function init() {\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitUsers.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroups.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroupsDifferentOU.php');\n\t\tparent::init();\n\t}", "private function initProjects()\n\t{\n\t\t$this->priorities = Dao::readAll(Priority::class, [Dao::key('redmine_id')]);\n\t\t$this->projects = Dao::readAll(Project::class, [Dao::key('redmine_id')]);\n\t\t$this->statuses = Dao::readAll(Status::class, [Dao::key('redmine_id')]);\n\t}", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "public function __construct()\n {\n $this->typeRepo = new TypesRepository();\n }", "public function install(){\r\n\t\t\r\n\t}", "public function sync()\n {\n $sql = null;\n $module = new \\ZPM\\Core\\Setup\\Schema();\n $modData = new \\ZPM\\Core\\Setup\\Info();\n\n $module->install();\n }", "public function run()\n {\n user_type_repository()->create([\n 'code' => 'admin',\n 'caption' => 'Admin',\n 'is_staff' => true,\n 'is_admin' => true,\n 'is_designer' => false,\n 'is_support' => true,\n 'is_director' => true,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => true,\n ]);\n user_type_repository()->create([\n 'code' => 'product_manager',\n 'caption' => 'Product Manager',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'product_qa',\n 'caption' => 'Product QA',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'support',\n 'caption' => 'Support',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => true,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => true,\n ]);\n user_type_repository()->create([\n 'code' => 'art_director',\n 'caption' => 'Art Director ',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => true,\n 'is_support' => false,\n 'is_director' => true,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => true,\n ]);\n user_type_repository()->create([\n 'code' => 'designer',\n 'caption' => 'Designer',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => true,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => true,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'junior_designer',\n 'caption' => 'Junior Designer',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => true,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => true,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'decorator',\n 'caption' => 'Decorator',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => true,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'sales_rep',\n 'caption' => 'Campus Ambassador',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'account_manager',\n 'caption' => 'Campus Manager',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'customer',\n 'caption' => 'Customer',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'placeholder',\n 'caption' => 'Placeholder',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n }", "public function prepare_db_for_extensions()\n\t{\n\t\t/**\n\t\t * @todo remove when my pull request gets accepted\n\t\t */\n\t\tob_start();\n\n\t\t// Resolves core tasks.\n\t\trequire_once path('sys').'cli/dependencies'.EXT;\n\n\t\t// Check for the migrations table\n\t\ttry\n\t\t{\n\t\t\tDB::table('laravel_migrations')->count();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tCommand::run(array('migrate:install'));\n\t\t}\n\n\t\t// Check for the extensions table. The reason\n\t\t// this isn't in a migration is simply\n\t\ttry\n\t\t{\n\t\t\tDB::table('extensions')->count();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tSchema::create('extensions', function($table)\n\t\t\t{\n\t\t\t\t$table->increments('id')->unsigned();\n\t\t\t\t$table->string('slug', 50)->unique();\n\t\t\t\t$table->text('version', 25);\n\t\t\t\t$table->boolean('enabled');\n\t\t\t});\n\t\t}\n\n\t\t// Just incase the install process got interrupted, start\n\t\t// extensions\n\t\t$this->start_extensions();\n\n\t\t/**\n\t\t * @todo remove when my pull request gets accepted\n\t\t */\n\t\tob_end_clean();\n\t}", "public function install(){\n // Create plugin tables\n Project::createTable();\n\n Repo::createTable();\n\n CommitCache::createTable();\n\n MergeRequest::createTable();\n\n MergeRequestComment::createTable();\n\n $htracker = PLugin::get('h-tracker');\n if($htracker && !$htracker->isInstalled()) {\n $htracker->install();\n }\n\n // Create permissions\n Permission::add($this->_plugin . '.access-plugin', 1, 0);\n Permission::add($this->_plugin . '.create-projects', 0, 0);\n }", "public function run() {\n $this->base_data();\n $this->minimal_data();\n $project = Project::first();\n\n // Create a bunch more stuff, just for testin'.\n for ($i = 0; $i < 5; $i++) Factory::project($project->id);\n for ($i = 0; $i < 15; $i++) Factory::bid();\n for ($i = 0; $i < 15; $i++) Factory::question();\n for ($i = 0; $i < 10; $i++) Factory::vendor();\n for ($i = 0; $i < 40; $i++) Factory::section();\n\n for ($i = 0; $i < 20; $i++) Factory::project($project->id);\n for ($i = 0; $i < 40; $i++) Factory::bid(array(), $project->id);\n\n }", "function startup() {\n\t\t$this->_welcome();\n\t\tif (isset($this->params['datasource'])) {\n\t\t\t$this->dataSource = $this->params['datasource'];\n\t\t}\n\n\t\tif ($this->command && !in_array($this->command, array('help'))) {\n\t\t\tif (!config('database')) {\n\t\t\t\t$this->out(__('Your database configuration was not found. Take a moment to create one.', true), true);\n\t\t\t\treturn $this->DbConfig->execute();\n\t\t\t}\n\t\t}\n\t}", "public function setup() {\n // get files content\n $this->getFileContent();\n\n $this->filterMatches();\n \n // insert the document in db\n $this->insert();\n\n // init terms list\n $this->termsList = new TermsList();\n\n // save terms and relations\n $this->manageMatches();\n }", "public static function install(){\n\t}", "function run()\n\t{\n\t\t//-----------------------------------------\n\t\t// Any \"extra\" configs required for this driver?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( is_array( $this->install->saved_data ) and count( $this->install->saved_data ) )\n\t\t{\n\t\t\tforeach( $this->install->saved_data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#^__sql__#\", $k ) )\n\t\t\t\t{\n\t\t\t\t\t$k = str_replace( \"__sql__\", \"\", $k );\n\t\t\t\t\n\t\t\t\t\t$this->install->ipsclass->vars[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Switch */\n\t\tswitch( $this->install->ipsclass->input['sub'] )\n\t\t{\n\t\t\tcase 'sql':\n\t\t\t\t$this->install_sql();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'settings':\n\t\t\t\t$this->install_settings();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'acpperms':\n\t\t\t\t$this->install_acpperms();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'templates':\n\t\t\t\t$this->install_templates();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'other':\n\t\t\t\t$this->install_other();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'caches':\n\t\t\t\t$this->install_caches();\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t/* Output */\n\t\t\t\t$this->install->template->append( $this->install->template->install_page() );\t\t\n\t\t\t\t$this->install->template->next_action = '?p=install&sub=sql';\n\t\t\t\t$this->install->template->hide_next = 1;\n\t\t\tbreak;\t\n\t\t}\n\t}", "function pf_setup($argv) {\n if (!has_bin('git')) {\n failure(\"You need to install git before continuing!\");\n failure(\"After installing git run this setup in a new terminal window.\");\n\n return true;\n }\n\n # Check if ssh-kegen is installed\n if (!has_bin('ssh-keygen')) {\n failure(\"You need to install ssh before continuing!\");\n\n return true;\n }\n\n # Test Connection to PHPFog API\n $phpfog = new PHPFog();\n try {\n $has_api = $phpfog->login();\n } catch (PestJSON_Unauthorized $e) {\n failure(\"Invalid username or password. Please try again.\");\n exit(1);\n } catch (Exception $e) {\n failure(\"Error: {$e->getMessage()}\");\n exit(1);\n }\n if (!isset($has_api) || !$has_api) {\n die(failure('Failed to log in.'));\n }\n\n $ssh_identifier = preg_replace(\"/[^A-Za-z0-9-]/\", '-', $phpfog->username());\n\n # Create an ssh key\n $ssh_real_path = HOME.\"/.ssh/\".$ssh_identifier;\n if (!file_exists($ssh_real_path)) {\n $exit_code = execute(\"ssh-keygen -q -t rsa -b 2048 -f \".$ssh_real_path);\n if (0 != $exit_code) {\n die(failure('Failed to generate ssh key'));\n }\n }\n\n # Add ssh to config\n $ssh_config_path = HOME.\"/.ssh/config\";\n $config_host_line = \"Host \".$ssh_identifier;\n if (strpos(@file_get_contents($ssh_config_path), $config_host_line) === false) {\n $fh = @fopen($ssh_config_path, 'a') or die(failure(\"Can't open file: \".$ssh_config_path));\n fwrite($fh, PHP_EOL.wrap($config_host_line));\n fwrite($fh, wrap(\" HostName git01.phpfog.com\"));\n fwrite($fh, wrap(\" User git\"));\n fwrite($fh, wrap(\" IdentityFile \".HOME.\"/.ssh/\".$ssh_identifier).PHP_EOL);\n fclose($fh);\n } else {\n info(\"Config is already set up.\");\n }\n\n $pubkey = file_get_contents($ssh_real_path.\".pub\");\n\n try {\n $phpfog->new_sshkey('', $pubkey);\n success(\"Successfully installed ssh key.\");\n } catch (PestJSON_ClientError $e) {\n $resp = $phpfog->last_response();\n $body = json_decode($resp['body']);\n $message = $body->message;\n failure(\"Error: \".$message);\n }\n\n ewrap(bwhite(\"To clone an app use the following steps:\"));\n ewrap(\"1. List your apps: \".bwhite(\"pf list apps\"));\n ewrap(\"2. To fetch your application code: \".bwhite(\"pf clone <app_id>\"));\n ewrap(\"3. Make your changes\");\n ewrap(\"4. Stage changes in your local repo: \".bwhite(\"git add -A\"));\n ewrap(\"5. Commit changes: \".bwhite(\"git commit -m 'My first commit'\"));\n ewrap(\"6. Deploy to PHP Fog: \".bwhite(\"pf push\"));\n ewrap(\"For more information visit: \".bwhite(\"http://dev.appfog.com/features/article/pf_command_line_tool\"));\n\n return true;\n}", "public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}", "public function setUp() {\n static::$kernel = static::createKernel();\n static::$kernel->boot();\n $this->em = static::$kernel->getContainer()\n ->get('doctrine')\n ->getManager();\n\n /** @var EntityManager $em */\n $em = $this->em;\n\n $this->blogEntryRepository = $em->getRepository('AnticomShowcaseBundle:BlogEntry');\n }", "function install() {}", "public function setUp() {\n\t\t$this->setUpDatabase();\n\t\t$this->match = new Match;\n\t}", "function __construct()\n\t{\n\t\t// Check repo for any new revisions\n\t\t$this->updateApp();\t\t\n\n\t\t// Create a new amazon connection\t\t\n\t\t$this->amazon();\n\t\t\n\t\t// Configure this server\n\t\t$this->bootstrap();\t\t\n\t}", "protected static function boot() {\n parent::boot();\n static::addGlobalScope(new ActiveProjectScope);\n }", "public function initialized(){\n if( $this->get_git() ){\n // Add query vars\n add_filter('query_vars', function($vars){\n $vars[] = 'giploy';\n return $vars;\n });\n // Add rewrite rule\n add_action('generate_rewrite_rules', array($this, 'generate_rewrite_rules'));\n // Flush rules if rewrite does not exits\n add_action('admin_init', array($this, 'flush_rules'));\n // Get hook\n add_action('pre_get_posts', array($this, 'pre_get_posts'));\n }\n }", "public function install() {\n\n\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function __construct()\n {\n $this->metadatas = app(MetadataRepository::class);\n $this->fileRepository = app(FileRepository::class);\n if(method_exists($this, 'init')){\n $this->init();\n }\n }", "protected function setUp() {\n $this->basePath = $basePath = realpath(__DIR__ . '/../../../../../');\n $appPath = $basePath . '/app';\n $this->confPath = $confPath = $appPath . '/boxdata/conf';\n $this->etcPath = $etcPath = $appPath . '/boxdata/etc/local';\n $this->object = new BoxRepository($confPath,null);\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new StockResource($container);\n \n }", "function _drush_build() {\n drush_invoke('updatedb');\n drush_invoke('features-revert-all', array('force' => TRUE));\n drush_invoke('cc', array('type' => 'all'));\n drush_log(dt('Built!'), 'success');\n}", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "public function prepareDeployment() {\n\t\t$bean = $this->unbox();\n\t\tif ($bean->id === 0) {\n\t\t\tR::store($this);\n\t\t}\n\t\t$config = Zend_Registry::get('config');\n\t\t$workdir = $config->directories->deployment;\n\t\t$oldumask = umask(0); \n\t\tif (!is_dir($workdir)) {\n\t\t\tmkdir($workdir, 0777, true);\n\t\t}\n\t\t$this->deploymentDir = $workdir . $this->id;\n\t\tif ($bean->type === 'rollback') {\n\t\t\t$this->queueTarget('RollbackPilot');\n\t\t\t$this->queueTarget('Rollback');\n\n\t\t\t$bean->rollback = false;\n\t\t} elseif ($bean->type === 'upgrade') {\n\t\t\t$this->queueTarget('UpgradePilot');\n\t\t\t$this->queueTarget('Upgrade');\n\n\t\t\t$bean->rollback = true;\n\t\t} else {\n\t\t\t$this->queueTarget('Deploy');\n\n\t\t\t$bean->rollback = true;\n\t\t}\n\t\t\n\t\tif (!is_dir($workdir . $bean->id)) {\n\t\t\tmkdir($workdir . $bean->id, 0777, true);\n\t\t}\n\t\tumask($oldumask);\n\t\t$this->writePropertiesFile($workdir . $bean->id . '/build.properties');\n\t\tR::store($this);\n\t}", "private function initAsyncRepositories(): void {\n $this->messagesRepository = new MessagesRepository();\n }", "private function init() {\n\t\t$GLOBALS[\"mlauto_db_version\"] = 1.0;\n\n\t\t//If SQL Table isn't initiated, initiate it\n\t\tClassificationModel::intializeTable();\n\t\tTermModel::intializeTable();\n\n\t\t$this->buildConfig();\n\n\t\tupdate_option(\"MLAuto_version\", $GLOBALS[\"mlauto_db_version\"]);\n\t}", "protected function setUp() {\n\t\t$this->object = new QueryAggregateCondition();\n\t}", "protected static function booted()\n {\n static::saved(function (RepositoryTag $repositoryTag) {\n Cache::tags(['repositories', 'tags'])->flush();\n });\n }", "private function setCustomRepositories()\n {\n $em = $this->getDoctrine()->getManager();\n $this->frontRepository = new FrontRepository($em);\n }", "public function run()\n {\n $branches = [\n [\n 'name' => 'Mbeya Branch',\n 'email' => '[email protected]',\n 'address' => 'Ikuti, Mbeya (M), Mbeya',\n 'phone' => '+255 755 456 529',\n 'type' => 1,\n ]\n ];\n\n foreach ($branches as $branch) {\n Branch::firstOrCreate([\n 'name' => $branch['name'],\n 'email' => $branch['email'],\n 'address' => $branch['address'],\n 'phone' => $branch['phone'],\n 'type' => $branch['type']\n ]);\n }\n }", "public function install() {\n //Check if the bot is already installed\n if ($this->checkInstalled()) {\n echo 'It seems like the request bot is already installed. If this\n is not the case then you have tables in the database you\n specified that have the same name as the tables that the\n Pull Request Bot is going to use in its installation. Please\n either delete them or choose different table names in the\n config.inc.php file. Thank you.';\n } else {\n $install_queries = $this->installQueries();\n \n //bool variable to check whether or not to commit the transaction.\n $commit = true;\n\n try {\n //start transactional query\n $this->db->beginTransaction();\n\n //execute queries one by one\n foreach ($install_queries as $key=>$install_query) {\n if ($install_query->execute()) {\n echo $key.': executed successfully.<br />';\n } else {\n $commit = false;\n echo $key.': failed.<br />';\n echo '<pre>';\n print_r($install_query->errorInfo());\n echo '</pre>';\n break;\n }\n }\n\n //Check to see that we can connect to external URLs\n if (WebPage::checkWorks()) {\n echo 'Check to connect to external websites passed.<br />';\n } else {\n //Don't commit.\n $commit = false;\n echo 'Check to connect to external websites failed.<br />';\n }\n\n if (function_exists('json_decode')) {\n echo 'JSON support enabled.<br />';\n } else {\n $commit = false;\n echo 'No JSON support.<br />';\n }\n\n //commit the transaction and display success message.\n if($commit == true) {\n $this->db->commit();\n echo 'Pull Request Bot has been successfully installed.\n Please use the run.php on a Cron job to use it.';\n } else {\n $this->db->rollBack();\n echo 'Install failed. Please see above messages for details.';\n }\n }\n catch (PDOException $e) {\n $this->db->rollBack();\n echo $e->getMessage();\n }\n }\n }", "public function setup()\n {\n $this->createCategories();\n $this->createProducts();\n }", "public function setUp() {\n $app = require __DIR__.'/../../bootstrap/app.php';\n $app->make('Illuminate\\Contracts\\Console\\Kernel')->bootstrap();\n\n $this->consumables=new Consumables();\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new ScoringResource($container);\n \n }", "public function writeAndPush()\n {\n $this->gitConfig();\n $this->writeFullConfFile();\n $this->writeUsers();\n if($this->commitConfig()) $this->pushConfig();\n }", "public function run()\n {\n $provinces = $this->getProvincesFromFile();\n\n foreach ($provinces as $provinceName => $cities) {\n $province = $this->provincesRepository->create([\n 'name' => $provinceName\n ]);\n\n foreach ($cities as $cityName) {\n $this->citiesRepository->create([\n 'name' => $cityName,\n 'province_id' => $province->id\n ]);\n }\n }\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "abstract public function repository();", "public function install() {\n\t\t\\GO\\Projects2\\Projects2Module::createDefaultIncomeContractNotificationCron();\n\t\t\n//\t\tif(!GO::modules()->isInstalled('projects')){\n\t\tGO::getDbConnection()->query(\"SET sql_mode=''\");\n\t\t\n\t\tif(!Utils::tableExists(\"pm_projects\")){\n\t\t\tparent::install();\n\t\t\t\n\t\t\t$defaultType = new Type();\n\t\t\t$defaultType->name = GO::t(\"Default\");\n\t\t\t$defaultType->save();\n\n\t\t\t$defaultStatus = new Status();\n\t\t\t$defaultStatus->name = GO::t(\"Ongoing\", \"projects2\");\n\t\t\t$defaultStatus->show_in_tree=true;\n\t\t\t$defaultStatus->save();\n\t\t\t\n\t\t\t$noneStatus = new Status();\n\t\t\t$noneStatus->name = GO::t(\"None\", \"projects2\");\n\t\t\t$noneStatus->show_in_tree=true;\n\t\t\t$noneStatus->filterable=true;\n\t\t\t$noneStatus->save();\n\n\t\t\t$status = new Status();\n\t\t\t$status->name = GO::t(\"Complete\", \"projects2\");\n\t\t\t$status->complete=true;\n\t\t\t$status->show_in_tree=false;\n\t\t\t$status->save();\n\t\t\t\n\t\t\t\n\t\t\t$folder = new \\GO\\Base\\Fs\\Folder(GO::config()->file_storage_path.'projects2/template-icons');\n\t\t\t$folder->create();\t\t\t\n\t\t\t\n\t\t\tif(!$folder->child('folder.png')){\n\t\t\t\t$file = new \\GO\\Base\\Fs\\File(GO::modules()->projects2->path . 'install/images/folder.png');\n\t\t\t\t$file->copy($folder);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(!$folder->child('project.png')){\n\t\t\t\t$file = new \\GO\\Base\\Fs\\File(GO::modules()->projects2->path . 'install/images/project.png');\n\t\t\t\t$file->copy($folder);\t\t\t\n\t\t\t}\n\n\t\t\t$template = new Template();\n\t\t\t$template->name = GO::t(\"Projects folder\", \"projects2\");\n\t\t\t$template->default_status_id = $noneStatus->id;\n\t\t\t$template->default_type_id = $defaultType->id;\n\t\t\t$template->icon=$folder->stripFileStoragePath().'/folder.png';\n\t\t\t$template->project_type=Template::PROJECT_TYPE_CONTAINER;\n\t\t\t$template->save();\n\t\t\t\n\t\t\t$template->acl->addGroup(GO::config()->group_everyone);\n\n\n\t\t\t$template = new Template();\n\t\t\t$template->name = GO::t(\"Standard project\", \"projects2\");\n\t\t\t$template->default_status_id = $defaultStatus->id;\n\t\t\t$template->default_type_id = $defaultType->id;\n\t\t\t$template->project_type=Template::PROJECT_TYPE_PROJECT;\n\t\t\t$template->fields = 'responsible_user_id,status_date,customer,budget_fees,contact,expenses';\n\t\t\t$template->icon=$folder->stripFileStoragePath().'/project.png';\n\t\t\t$template->save();\n\t\t\t\n\t\t\t$template->acl->addGroup(GO::config()->group_everyone);\n\t\t\t\n\t\t}else\n\t\t{\n\t\t\tGO::setMaxExecutionTime(0);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$oldModelTypeId = \\GO\\Base\\Model\\ModelType::model()->findByModelName(\"GO\\Projects\\Model\\Project\");\n\t\t\t$modelTypeId = \\GO\\Base\\Model\\ModelType::model()->findByModelName(\"GO\\Projects2\\Model\\Project\");\n\t\t\t\n\t\t\t//copy old projects module tables\n\t\t\t$stmt = GO::getDbConnection()->query('SHOW TABLES');\n\t\t\twhile ($r = $stmt->fetch()) {\n\t\t\t\t$tableName = $r[0];\n\n\n\t\t\t\tif (substr($tableName, 0, 9) == 'go_links_' && !is_numeric(substr($tableName, 9, 1))) {\t\t\t\n\t\t\t\t\ttry{\n\t\t\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD `ctime` INT NOT NULL DEFAULT '0';\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e){}\n\t\t\t\t\t\n\t\t\t\t\t$sql = \"DELETE FROM `$tableName` WHERE model_type_id=\".intval($modelTypeId);\n\t\t\t\t\tGO::debug($sql);\n\t\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\t\t$sql = \"INSERT IGNORE INTO `$tableName` SELECT id,folder_id, model_id,'$modelTypeId', description, ctime FROM `$tableName` WHERE model_type_id=$oldModelTypeId\";\n\t\t\t\t\tGO::debug($sql);\n\t\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (strpos($tableName, 'pm_') !== false) {\n\t\t\t\t\t\n\t\t\t\t\t//some GLOBAL2000 tables we do not want to copy\n\t\t\t\t\tif(!in_array($tableName,array('pm_employees','pm_resources','pm_employment_agreements'))){\n\t\t\t\t\t\n\t\t\t\t\t\t$newTable = str_replace('pm_', \"pr2_\", $tableName);\n\n\t\t\t\t\t\t$sql = \"DROP TABLE IF EXISTS `$newTable`\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\t\t\t$sql = \"CREATE TABLE `$newTable` LIKE `$tableName`\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\t\t\t$sql = \"INSERT INTO `$newTable` SELECT * FROM `$tableName`\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql = \"update pr2_projects set name = replace(name, '/','-')\";\n\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\n//\t\t\t$sql = \"update pr2_projects set files_folder_id=0\";\n//\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t$sql = \"select version from go_modules where id='projects'\";\t\t\t\n\t\t\t$stmt = GO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t$record = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t\tGO::modules()->projects2->version = $record['version'];\n\t\t\tGO::modules()->projects2->save();\t\t\t\n//\t\t\tGO::modules()->projects->acl->copyPermissions(GO::modules()->projects2->acl);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//start files\n//\t\t\t$sql = \"UPDATE pr2_projects SET files_folder_id=(SELECT files_folder_id FROM pm_projects WHERE pm_projects.id=pr2_projects.id);\";\n//\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t$fsFolder = new GO\\Base\\Fs\\Folder(GO::config()->file_storage_path.'projects2');\n\t\t\tif($fsFolder->exists()){\n\t\t\t\t$fsFolder->rename('projects2-'.date('c'));\n\t\t\t}\n\n\t\t\t$folder = \\GO\\Files\\Model\\Folder::model()->findByPath('projects');\n\t\t\t$folder->name='projects2';\n\t\t\t$folder->acl_id=GO::modules()->projects2->acl_id;\n\t\t\t$folder->save();\n\n\n//\t\t\t$sql = \"UPDATE pm_projects SET files_folder_id=0;\";\n//\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t$sql = \"update `pr2_templates` set icon = replace(icon, 'projects/', 'projects2/');\";\n\t\t\tGO::getDbConnection()->query($sql);\t\t\t\n\t\t\t\n\t\t\t//end files\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t//upgrade database\n\t\t\tob_start();\n\t\t\t$mc = new \\GO\\Core\\Controller\\MaintenanceController();\n\t\t\t$mc->run(\"upgrade\", array(), false);\n\t\t\tob_end_clean();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//create new acl's\n\t\t\t\n//\t\t\t$types = \\GO\\Projects\\Model\\Type::model()->find();\t\t\t\n//\t\t\tforeach($types as $type){\t\t\t\t\n//\t\t\t\t$type2 = Model\\Type::model()->findByPk($type->id);\t\t\t\t\n//\t\t\t\t$type2->setNewAcl($type->user_id);\t\t\t\t\n//\t\t\t\t$type->acl->copyPermissions($type2->acl);\t\t\t\n//\t\t\t\t$type2->save();\n//\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$sql=\"ALTER TABLE `pr2_hours` CHANGE `income_id` `old_income_id` INT( 11 ) NULL DEFAULT NULL ;\";\n\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t$sql=\"ALTER TABLE `pr2_hours` ADD `income_id` INT( 11 ) NULL AFTER `old_income_id` ;\";\n\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t$sql=\"UPDATE `pr2_hours` SET old_income_id=-1*old_income_id;\";\n\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t\n\t\t\tif(\\GO\\Base\\Db\\Utils::tableExists(\"pm_employment_agreements\")){\n\t\t\t\t\n\t\t\t\t//GLOBAL 2000 version\n\t\t\t\t\n\t\t\t\t$sql = \"replace into pr2_employees (user_id, external_fee, internal_fee) select employee_id, max(external_fee),max(internal_fee) from pm_employment_agreements group by employee_id\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\n\n\t\t\t\t$sql = \"replace into pr2_resources (user_id,project_id, external_fee, internal_fee) select user_id,project_id, external_fee, internal_fee from pm_resources\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\n//\t\t\tNo longer necessary because of $updates['201310041023'] in updates.inc.php :\t\n//\t\t\t\t//untested\n//\t\t\t\t$sql = \"ALTER TABLE `pr2_hours` CHANGE `external_value` `external_fee` DOUBLE NOT NULL DEFAULT '0'\";\n//\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$sql = \"insert ignore into pr2_employees (user_id, external_fee, internal_fee) select user_id, max(ext_fee_value), max(int_fee_value) from pm_hours group by user_id\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\n\n\t\t\t\t$sql = \"insert ignore into pr2_resources (user_id,project_id, external_fee, internal_fee) select user_id,project_id, max(ext_fee_value), max(int_fee_value) from pm_hours group by user_id, project_id\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$sql = \"update pr2_templates set project_type=1\";\n\t\t\tGO::getDbConnection()->query($sql);\n\n\n\t\t\tif (GO::modules()->customfields) {\n\t\t\t\t\n//\t\t\t\trequire(dirname(__FILE__).'/install/migrate/models.php');\n\t\t\t\t\n//\t\t\t\t\\GO\\Customfields\\CustomfieldsModule::replaceRecords(\"GO\\Projects\\Model\\Project\", \"GO\\Projects2\\Model\\Project\");\n\t\t\t\t\n//\t\t\t\t\\GO\\Customfields\\CustomfieldsModule::replaceRecords(\"GO\\Projects\\Model\\Hour\", \"GO\\Projects2\\Model\\TimeEntry\");\n\t\t\t\t\n\t\t\t\t//$sql = \"RENAME TABLE `cf_pm_projects` TO `cf_pr2_projects` \";\n\t\t\t\t//GO::getDbConnection()->query($sql);\n\t\t\t\t\n\t\t\t\t//$sql = \"RENAME TABLE `cf_pm_hours` TO `cf_pr2_hours` \";\n\t\t\t\t//GO::getDbConnection()->query($sql);\n\t\t\t\t\n\t\t\t\t$sql = \"update `cf_categories` set extends_model = 'GO\\\\\\\\Projects2\\\\\\\\Model\\\\\\\\Project' where extends_model = 'GO\\\\\\\\Projects\\\\\\\\Model\\\\\\\\Project';\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\n\t\t\t\t$sql = \"update `cf_categories` set extends_model = 'GO\\\\\\\\Projects2\\\\\\\\Model\\\\\\\\Hour' where extends_model = 'GO\\\\\\\\Projects\\\\\\\\Model\\\\\\\\Hour';\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tGO::getDbConnection()->query(\"UPDATE go_search_cache set model_type_id=$modelTypeId where model_type_id=$oldModelTypeId\");\n\t\t\t\n\t\t\n\t\t\t\n\n\t\t\t// Now, let's make sure that all the projects have a template.\n\t\t\t\n\t\t\t$folder = new Folder(GO::config()->file_storage_path.'projects2/template-icons');\n\t\t\t$folder->create();\t\t\t\n\t\t\t\n\t\t\tif(!$folder->child('folder.png')){\n\t\t\t\t$file = new File(GO::modules()->projects2->path . 'install/images/folder.png');\n\t\t\t\t$file->copy($folder);\n\t\t\t}\n\t\t\t\n\t\t\tif(!$folder->child('project.png')){\n\t\t\t\t$file = new File(GO::modules()->projects2->path . 'install/images/project.png');\n\t\t\t\t$file->copy($folder);\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (\\GO::modules()->files) {\n\t\n\t\t\t\t$fileFolder = \\GO\\Files\\Model\\Folder::model()->findByPath('projects2/template-icons',true);\n\t\t\t\tif(!$fileFolder->acl_id!=\\GO::modules()->projects2->acl_id){\n\t\t\t\t\t$oldIgnore = \\GO::$ignoreAclPermissions;\n\t\t\t\t\t\\GO::$ignoreAclPermissions=true;\n\t\t\t\t\t$fileFolder->acl_id=\\GO::modules()->projects2->acl_id;\n\t\t\t\t\t$fileFolder->save();\t\t\n\t\t\t\t\t\\GO::$ignoreAclPermissions=$oldIgnore;\n\t\t\t\t}\n\t\t\t\t//for icons added after install\n\t\t\t\t$fileFolder->syncFilesystem();\n\t\t\t}\n\t\t\t\n\t\t\t$normalTemplate = new Template();\n\t\t\t$normalTemplate->name = GO::t(\"Normal project\", \"projects2\");\n\t\t\t$normalTemplate->project_type=Template::PROJECT_TYPE_PROJECT;\n\t\t\t$normalTemplate->fields = 'responsible_user_id,status_date,customer,budget_fees,contact,expenses';\n\t\t\t$normalTemplate->icon=$folder->stripFileStoragePath().'/project.png';\n\t\t\t$normalTemplate->save();\n\t\t\t\n\t\t\tGO\\Base\\Db\\Columns::$forceLoad = true;\n\t\t\t\n\t\t\t$noTemplateProjectsStmt = Project::model()->find(\n\t\t\t\tFindParams::newInstance()\n\t\t\t\t\t->criteria(\n\t\t\t\t\t\tFindCriteria::newInstance()\n\t\t\t\t\t\t\t->addCondition('template_id',0)\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tGO\\Base\\Db\\Columns::$forceLoad = false;\n\t\t\t\n\t\t\tforeach ($noTemplateProjectsStmt as $noTemplateProjectModel) {\n\t\t\t\t$noTemplateProjectModel->template_id = $normalTemplate->id;\n\t\t\t\t$noTemplateProjectModel->save();\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t// Upgrade closed weeks\n\t\t\tob_start();\n\t\t\t$pc = new \\GO\\Projects2\\Controller\\ProjectController();\n\t\t\t$pc->run(\"v1toV2Upgrade\", array(), false);\n\t\t\tob_end_clean();\n\t\t\t\n\t\t}\n\n\t\t\n\t}", "protected function createPreCommit() :void\n {\n $this->preCommitConfig();\n $this->preCommitSetup();\n }", "public function install() {\r\n \r\n }", "protected static function booted()\n {\n static::addGlobalScope(new NotArchivedScope);\n }", "protected static function boot()\n {\n parent::boot();\n static::addGlobalScope(new ProjectScope);\n }", "public function install()\n {\n }", "public function install()\n {\n }", "private function startup()\n\t{\n\t\t$this->registerSigHandlers();\n\t\t$this->pruneDeadWorkers();\n\t\tEvent::trigger('beforeFirstFork', $this);\n\t\t$this->registerWorker();\n\t}", "protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}", "protected function setUp(){\n $this->poneys = new Poneys;\n $this->poneys->setCount(8);\n }", "public function booted()\n {\n Spark::useStripe()->noCardUpFront()->trialDays(10000);\n\n Spark::freePlan()\n ->features([\n 'First', 'Second', 'Third'\n ]);\n\n // Spark::identifyTeamsByPath();\n }", "public function setup() {}", "protected static function boot()\n {\n parent::boot();\n\n //add the scope wen querying db for students\n static::addGlobalScope(new StudentScope);\n }" ]
[ "0.61224544", "0.5905924", "0.5761781", "0.5701169", "0.57005686", "0.56457853", "0.56457853", "0.5574852", "0.55629724", "0.5430853", "0.54228395", "0.540288", "0.5380799", "0.5370204", "0.5348949", "0.53383166", "0.5311854", "0.5275926", "0.5239091", "0.52223855", "0.5185288", "0.51807433", "0.51576674", "0.514938", "0.5148135", "0.51472914", "0.5133674", "0.5131403", "0.51152325", "0.510483", "0.5084611", "0.5084313", "0.5083773", "0.5066808", "0.5058986", "0.50565857", "0.50564253", "0.5054081", "0.5047338", "0.5043152", "0.5016671", "0.5007955", "0.50007266", "0.50007266", "0.50007266", "0.50007266", "0.49998838", "0.4996186", "0.498772", "0.49785757", "0.49647725", "0.49632764", "0.49599844", "0.49590653", "0.4956322", "0.49531427", "0.4952464", "0.49405283", "0.49395344", "0.4919298", "0.49153656", "0.49136814", "0.4911468", "0.4908808", "0.49055284", "0.49051678", "0.49048573", "0.48931164", "0.48926085", "0.4885999", "0.48851305", "0.48824877", "0.48796085", "0.48735604", "0.48657423", "0.48649004", "0.48564833", "0.4852316", "0.4852315", "0.48501968", "0.4840051", "0.48397908", "0.4837006", "0.48356342", "0.48344082", "0.4833204", "0.4828305", "0.48259103", "0.48201632", "0.48198786", "0.48164803", "0.48160356", "0.48124284", "0.48116693", "0.48116693", "0.48067948", "0.48046392", "0.48005423", "0.47986093", "0.47980568", "0.47958446" ]
0.0
-1
Configure bootstrap by default (assign path to create config file)
protected function configure() { /** @noinspection PhpUndefinedClassConstantInspection */ $this->setName(static::NAME) ->setDescription($this->getDescription()); if(method_exists($this,'getOptions')) { $this->setDefinition( new InputDefinition($this->getOptions()) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initialiseConfig()\n {\n $this->mergeConfigFrom(__DIR__ . '/..' . Settings::LARAVEL_REAL_CONFIG, Settings::LARAVEL_CONFIG_NAME);\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }", "public static function boot(): void\n {\n if (defined('CONFIG_DIR') && file_exists(CONFIG_DIR . '/beanstalk.php')) {\n self::$beanstalk_config = require CONFIG_DIR . '/beanstalk.php';\n }\n }", "public function _initBootstrap(){\n $this->_config = $this->getOptions();\n }", "protected function setConfigurations()\n {\n if ($files = $this->getFiles('config'))\n {\n foreach ($files as $key => $filename)\n {\n $this->config->set(basename($filename, '.php'), require path('config').DIRECTORY_SEPARATOR.($filename));\n }\n }\n }", "protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/dashkit.php', 'dashkit'\n );\n }", "private function configure(): void\n {\n if (!$this->app->configurationIsCached()) {\n $this->mergeConfigFrom(__DIR__ . '/../config/paket.php', 'paket');\n }\n }", "public static function init(): void\n {\n $dotenvDest = ROOT_DIRECTORY . self::DEST_APP_ETC_DOTENV_FILE;\n if (is_file($dotenvDest)) {\n require_once $dotenvDest;\n return;\n } else {\n $dotenvSrc = ROOT_DIRECTORY . self::SRC_APP_ETC_DOTENV_FILE;\n copy($dotenvSrc, $dotenvDest);\n }\n\n $magentoBootstrapFile = ROOT_DIRECTORY . self::MAGENTO_BOOTSTRAP_FILE;\n if (!is_file($magentoBootstrapFile)) {\n return;\n }\n\n require_once $dotenvDest;\n }", "public function __construct()\n\t{\n\t\t$this->defaultPath = __DIR__.'/config';\n\t}", "private function bootConfig(): void\n {\n $baseDir = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;\n $configDir = $baseDir . 'config' . DIRECTORY_SEPARATOR;\n\n $this->publishes([\n $configDir . 'laravel-database-emails.php' => config_path('laravel-database-emails.php'),\n ], 'laravel-database-emails-config');\n }", "function __loadBootstrap() {\r\n\t\t$_this =& Configure::getInstance();\r\n\t\t$modelPaths = null;\r\n\t\t$viewPaths = null;\r\n\t\t$controllerPaths = null;\r\n\t\t$helperPaths = null;\r\n\t\t$componentPaths = null;\r\n\t\trequire APP_PATH . 'config' . DS . 'bootstrap.php';\r\n\t\t$_this->__buildModelPaths($modelPaths);\r\n\t\t$_this->__buildViewPaths($viewPaths);\r\n\t\t$_this->__buildControllerPaths($controllerPaths);\r\n\t\t$_this->__buildHelperPaths($helperPaths);\r\n\t\t$_this->__buildComponentPaths($componentPaths);\r\n\t}", "protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../../config/knet.php', 'knet'\n );\n }", "public function boot()\n {\n $this->publishConfig(self::BASE_CONFIG_PATH);\n }", "protected function setup_config() {\n\t\t\t// TODO: Implement setup_config() method.\n\t\t}", "protected function configure()\n {\n $this\n ->setName('config:open')\n ->setDescription('Opens the config')\n ->configureGlobal();\n }", "protected function defineConfig()\n {\n // Get config paths\n $configs = $this->config->getDirectly(__DIR__ . '/../Config/path.php')['default_config'] ?? [];\n\n // Add all of them to config collector if $configs is an array\n if (is_array($configs)) {\n foreach ($configs as $alias => $path) {\n $this->config->set($alias, $path);\n }\n }\n }", "private function setupConfig()\n {\n $this->publishes([\n __DIR__ . '/config' => config_path(),\n ], 'config');\n\n $this->mergeConfigFrom(__DIR__ . '/../config/package-blueprint.php', 'package-blueprint');\n }", "public function cfg_setup()\n\t{\n\t\t$this->cfg = AppConfig::get()[\"app\"];\n\t\t$this->cfg[\"app_name\"] = $this->cfg[\"name\"];\n\n\t}", "public function configurePaths()\n {\n $configurer = new Configurer($this, [\n 'models_path' => [\n 'question' => 'Where do you wish to save the models?',\n 'default' => config('starter.model.path'),\n 'config' => 'starter.model.path'\n ],\n 'controllers_path' => [\n 'question' => 'Where do you wish to save the controllers?',\n 'default' => config('starter.controller.path'),\n 'config' => 'starter.controller.path'\n ],\n 'repositories_path' => [\n 'question' => 'Where do you wish to save the repositories?',\n 'default' => config('starter.repository.path'),\n 'config' => 'starter.repository.path'\n ],\n 'transformers_path' => [\n 'question' => 'Where do you wish to save the transformers?',\n 'default' => config('starter.transformer.path'),\n 'config' => 'starter.transformer.path'\n ]\n ]);\n $configurer->run();\n $configurer->save();\n }", "protected function setPackageConfigurationFile()\n {\n $config = __DIR__ . '/Config/recaptcha.php';\n $path = config_path('recaptcha.php');\n \n $this->publishes([$config => $path], 'config'); \n $this->mergeConfigFrom( $config, 'recaptcha');\n }", "protected function initBootstrap()\n {\n \\Steel\\Bootstrap::init();\n }", "protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }", "protected function configure(): void\n {\n $this->mergeConfigFrom(\n __DIR__ . '/config/permissions_makr.php', 'permissions_makr'\n );\n }", "protected static function updateBootstrapping()\n {\n copy(__DIR__.'/bootstrap-stubs/app.js', resource_path('assets/js/app.js'));\n\n copy(__DIR__.'/bootstrap-stubs/bootstrap.js', resource_path('assets/js/bootstrap.js'));\n }", "protected function configure()\n {\n $this\n // the name of the command (the part after \"bin/console\")\n ->setName('torrent:wget_file')\n ->setDescription('Récupère les fichiers sur le serveur');\n }", "public function boot(){\n\n\t\t$this->bootConfig();\n\n\t}", "protected function configure()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/laratrust.php', 'laratrust');\n }", "public function bootstrap();", "public function bootstrap();", "protected function loadConfigManually()\n {\n $basePath = config('swoole-tcp.laravel_base_path') ?: base_path();\n if ($this->isLumen && file_exists($basePath . '/config/swoole-tcp.php')) {\n $this->getLaravel()->configure('swoole-tcp');\n }\n }", "protected function configure()\n {\n $this->setName('appconfig')\n ->setDescription('Create appserver.io Config')\n ->addArgument('application-name', InputOption::VALUE_REQUIRED, 'config application name')\n ->addArgument('namespace', InputOption::VALUE_REQUIRED, 'namespace for the project')\n ->addArgument('directory', InputOption::VALUE_REQUIRED, 'webapps root directory')\n ->addOption('routlt-version', 'rl', InputOption::VALUE_OPTIONAL, 'the routlt version to use', '~2.0');\n }", "protected function configure()\n {\n $this->ignoreValidationErrors();\n\n $this->setName('make')\n ->setDescription('Make Lumen skeleton into the current project.')\n ->addOption('force', null, InputOption::VALUE_NONE, 'Overwrite any existing files.');\n }", "protected function bootstrap()\n {\n }", "protected function configure()\n {\n // load config\n $config = new \\Phalcon\\Config(array(\n 'base_url' => '/',\n 'static_base_url' => '/',\n ));\n\n if (file_exists(APPPATH.'config/static.php')) {\n $static = include APPPATH.'config/static.php';\n $config->merge($static);\n }\n\n if (file_exists(APPPATH.'config/setup.php')) {\n $setup = include APPPATH.'config/setup.php';\n $config->merge($setup);\n }\n\n return $config;\n }", "protected function bootstrapConfig()\n {\n if (is_array($this->config) || $this->configInBootstrap) {\n return;\n }\n $this->configInBootstrap = true;\n $id = $this->getConfigClassId();\n if (!array_key_exists($id, self::$configCache['config'])) {\n $this->initConfig();\n $lazy = [];\n foreach ($this->config as $name => $value) {\n if ($value === null) {\n $lazy[$name] = true;\n }\n }\n self::$configCache['config'][$id] = $this->config;\n self::$configCache['lazy_init'][$id] = $lazy;\n }\n $this->config = self::$configCache['config'][$id];\n $this->configPendingLazyInit = self::$configCache['lazy_init'][$id];\n $this->configInBootstrap = false;\n }", "private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n $this->_config = $configLoader;\n\t}", "public function setUp()\n\t{\n\t\t$this->config = include __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'src' .\n\t\t DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';\n\t}", "public function bootstrap(Application $app)\n {\n if ($app->configurationIsCached()) {\n return;\n }\n\n $this->checkForSpecificEnvironmentFile($app);\n\n try {\n $beryl_config = $app->get('beryl_config');\n $env_file = $beryl_config['env_file'] ?? $app->environmentFile();\n $env_path = getcwd();\n\n if (!empty($beryl_config['env_file_path'])) {\n $env_path .= rtrim($beryl_config['env_file_path'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n } else {\n $env_path .= $app->environmentFilePath();\n }\n\n (new Dotenv($env_path, $env_file))->load();\n } catch (InvalidPathException $e) {\n //\n } catch (InvalidFileException $e) {\n echo 'The environment file is invalid: '.$e->getMessage();\n die(1);\n }\n }", "static function set_config() {\n\t\tif ( file_exists( self::childpath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::childpath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'wpgrade-config' . EXT;\n\t\t}\n\t}", "protected function _setConfig()\n {\n if ($this->_system) {\n $config = $this->_system . DIRECTORY_SEPARATOR . 'config.php';\n } else {\n $config = false;\n }\n\n // manually look for a --config argument that overrides the default\n $found = false;\n foreach ($this->_argv as $val) {\n if ($val == '--config') {\n // found the argument\n $found = true;\n // reset the default in preparation for the next argument\n $config = false;\n continue;\n }\n \n if ($found && substr($val, 0, 1) != '-') {\n $config = $val;\n break;\n }\n \n if (substr($val, 0, 9) == '--config=') {\n $found = true;\n $config = substr($val, 9);\n break;\n }\n }\n \n // if there was a --config but no param, that's a failure\n if ($found && ! $config) {\n echo \"Please specify a config file path after the --config option.\" . PHP_EOL;\n exit(1);\n }\n \n // was there a config file at all?\n if ($config) {\n $realpath = realpath($config);\n if ($realpath) {\n $this->_config = $realpath;\n $text = \"Using config file '$realpath'.\" . PHP_EOL;\n } else {\n echo \"Could not resolve real path to config file '$config'.\" . PHP_EOL;\n exit(1);\n }\n } else {\n $text = \"Not using a config file.\" . PHP_EOL;\n }\n \n if ($this->_verbose) {\n echo $text;\n }\n }", "public function bootstrap()\n {\n }", "protected function configure()\n {\n $this\n ->setName('init')\n ->setDescription('Initializes an objective-wp application')\n ->addArgument('type', InputArgument::REQUIRED, 'Options: plugin, enfold')\n ->addArgument('name', InputArgument::OPTIONAL, 'The name of the project (the directory)')\n ->addOption('dev', null, InputOption::VALUE_NONE, 'Installs the latest \"development\" release')\n ->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists');\n }", "protected function _initBootstrap()\n {\n }", "private function setConfigurations(): void\n {\n if (file_exists($this->projectRootPath->getPath() . '/composer.json')) {\n $content = file_get_contents($this->projectRootPath->getPath() . '/composer.json');\n $content = json_decode($content, true);\n if (!empty($content[\"autoload\"][\"psr-4\"])) {\n foreach ($content[\"autoload\"][\"psr-4\"] as $namespace => $src) {\n $this->nameSpacesBase[] = $namespace . \"\\\\\";\n }\n }\n }\n }", "public static function config();", "public function getBootstrapFile();", "function __construct()\r\n\t{\r\n\t\trequire './configs/configs.php';\r\n\t}", "public function setUp()\n {\n $this->setApplicationConfig(\n Bootstrap::getConfig()\n );\n\n parent::setUp();\n }", "public function getBootstrapFile()\n {\n }", "public function loadConfiguration()\n {\n // Get bundles paths\n $bundles = $this->kernel->getBundles();\n $paths = array();\n $pathInBundles = 'Resources' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'nekland_admin.yml';\n\n foreach ($bundles as $bundle) {\n $paths[] = $bundle->getPath() . DIRECTORY_SEPARATOR . $pathInBundles;\n }\n $this->configuration->setPaths($paths);\n $this->configuration->loadConfigFiles();\n }", "protected static function updateBootstrapping(): void\n {\n copy(__DIR__.'/ttall-stubs/tailwind.config.js', base_path('tailwind.config.js'));\n\n copy(__DIR__.'/ttall-stubs/webpack.mix.js', base_path('webpack.mix.js'));\n\n copy(__DIR__.'/ttall-stubs/resources/js/app.js', resource_path('js/app.js'));\n copy(__DIR__.'/ttall-stubs/resources/js/bootstrap.js', resource_path('js/bootstrap.js'));\n copy(__DIR__.'/ttall-stubs/resources/js/turbolinks.js', resource_path('js/turbolinks.js'));\n\n copy(__DIR__.'/ttall-stubs/.eslintignore', base_path('.eslintignore'));\n copy(__DIR__.'/ttall-stubs/.eslintrc.json', base_path('.eslintrc.json'));\n copy(__DIR__.'/ttall-stubs/.php_cs', base_path('.php_cs'));\n copy(__DIR__.'/ttall-stubs/.prettierrc', base_path('.prettierrc'));\n copy(__DIR__.'/ttall-stubs/phpstan.neon', base_path('phpstan.neon'));\n }", "protected function configure()\n {\n $this->addOption(\n 'v|version', '-s',\n 'The version of the template that is to be installed; optional if '\n .'project is installed with PEAR'\n );\n }", "protected function configure()\n {\n $this->setName('configure')\n ->setDescription('Configure application and add necessary configs')\n ->addOption('cache_dir', 'd', InputOption::VALUE_OPTIONAL, 'Path to cache directory')\n\n ->addOption('chronos_url', 'u', InputOption::VALUE_OPTIONAL, 'The chronos url (inclusive port)', '')\n ->addOption('chronos_http_username', 'un', InputOption::VALUE_OPTIONAL, 'The chronos username (HTTP credentials)', '')\n ->addOption('chronos_http_password', 'p', InputOption::VALUE_OPTIONAL, 'The chronos password (HTTP credentials)', '')\n ->addOption('repository_dir', 'r', InputOption::VALUE_OPTIONAL, 'Root path to your job files', '')\n\n ->addOption('marathon_url', 'mu', InputOption::VALUE_OPTIONAL, 'The marathon url (inclusive port)', '')\n ->addOption('marathon_http_username', 'mun', InputOption::VALUE_OPTIONAL, 'The marathon username (HTTP credentials)', '')\n ->addOption('marathon_http_password', 'mp', InputOption::VALUE_OPTIONAL, 'The marathon password (HTTP credentials)', '')\n ->addOption('repository_dir_marathon', 'mr', InputOption::VALUE_OPTIONAL, 'Root path to the app files', '')\n ;\n }", "protected static function updateBootstrapping()\n {\n copy(__DIR__ . '/angular-stubs/main.ts', resource_path('assets/js/main.ts'));\n copy(__DIR__ . '/angular-stubs/app.module.ts', resource_path('assets/js/app.module.ts'));\n copy(__DIR__ . '/angular-stubs/environment.ts', resource_path('assets/js/environment.ts'));\n copy(__DIR__ . '/angular-stubs/tsconfig.json', resource_path('assets/js/tsconfig.json'));\n }", "function configure() {\n // * You can add a layout, a layout is just a .phtml file that represents\n // the site template.\n Yasc_App::config()->setLayoutScript(dirname(__FILE__) . \"/layouts/default.phtml\");\n \n // * If you want to use a stream wrapper to convert markup of mostly-PHP \n // templates into PHP prior to include(), seems like is a little bit slow,\n // so by default is off.\n // ->setViewStream(true);\n // \n // * You can add more than one folder to store views, each view script\n // is a .phtml file.\n // ->addViewsPath(dirname(__FILE__) . \"/extra_views\");\n // \n // * You can add more than one path of view helpers and set a\n // class prefix for the path added.\n // ->addViewHelpersPath(dirname(__FILE__) . \"/../library/My/View/Helper\", \"My_View_Helper\");\n // \n // or if you don't want a class prefix just leave it blank.\n // ->addViewHelpersPath(dirname(__FILE__) . \"/extra_views/helpers\");\n //\n // * Function helpers, second argument is a prefix class.\n // ->addFunctionHelpersPath(dirname(__FILE__) . \"/extra_function_helpers\");\n // \n // * Add models folder, second argument is a prefix class.\n // ->addModelsPath(dirname(__FILE__) . \"/models\");\n // ->addModelsPath(dirname(__FILE__) . \"/extra_models/My/Model\", \"My_Model\");\n // \n // * Add extra options to the configuration object, like some $mysql connection \n // resource or a global flag, etc.\n // ->addOption(\"db\", $mysql);\n}", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "protected function addConfiguration()\n {\n $this['config'] = $this->share(\n function () {\n $user_config_file = (file_exists('phpdoc.xml'))\n ? 'phpdoc.xml'\n : 'phpdoc.dist.xml';\n\n return \\Zend\\Config\\Factory::fromFiles(\n array(\n __DIR__.'/../../data/phpdoc.tpl.xml',\n $user_config_file\n ), true\n );\n }\n );\n }", "public function boot()\n {\n $this->publishes([\n __DIR__ . '/../config/swoole.php' => base_path('config/swoole.php')\n ], 'config');\n }", "public function configure()\n {\n $this->container = require __DIR__ . '/../../config/configure-services.php';\n $this->scratchSpace = vfsStream::setup('scratch')->url();\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "private function init_config() {\n set_config('siteadmins', '');\n set_config('siteguest', '');\n set_config('defaultuserroleid', '');\n set_config('defaultfrontpageroleid', '');\n }", "protected function configure()\n {\n $this\n ->addDefaults()\n ->setName('maintenance')\n ->setDescription('Run maintenance on all Skylab projects')\n ->setHelp(<<<EOT\nThe <info>maintenance</info> command will run the maintenance commands of all skeletons on a project. Most notably, it\nwill create the apache config files and make sure the the databases are available.\n\n<info>php skylab.phar maintenance</info>\n\nEOT\n );\n }", "protected function configure() : void\n {\n $defaultBuildFolder = __DIR__ . self::DEFAULT_BUILD_FOLDER;\n $defaultResourceFolder = __DIR__ . self::DEFAULT_RESOURCES_FOLDER;\n\n $this\n ->setName('build')\n ->setDescription('The JSON source files and builds the INI files')\n ->addArgument('version', InputArgument::REQUIRED, 'Version number to apply')\n ->addOption('output', null, InputOption::VALUE_REQUIRED, 'Where to output the build files to', $defaultBuildFolder)\n ->addOption('resources', null, InputOption::VALUE_REQUIRED, 'Where the resource files are located', $defaultResourceFolder)\n ->addOption('coverage', null, InputOption::VALUE_NONE, 'Collect and build with pattern ids useful for coverage');\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function setUp ( )\n {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV, ROOT_PATH . '/etc/application.ini'\n );\n\n parent::setUp();\n }", "public function setUp ( )\n {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV, ROOT_PATH . '/etc/application.ini'\n );\n\n parent::setUp();\n }", "public function boot()\n {\n $this->loadConfig();\n\n parent::boot();\n }", "function cli_factory(Contracts\\BaseConfigInterface $config): void\n {\n (new Bootstrap($config))->run();\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 configure($name)\n {\n if (isset($this->loadedConfigs[$name])) {\n return;\n }\n\n $this->loadedConfigs[$name] = true;\n\n if ($path = $this->getConfigPath($name)) {\n $this->make('config')->set($name, require $path);\n }\n }", "protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/documentation.php',\n 'documentation'\n );\n }", "protected function initResources()\n {\n $chain = $this->_config->configChain();\n // Remove default config\n $default = array_pop($chain);\n $default = $default['directories'];\n $namespaces = array_keys($chain);\n Utils_ResourceLocator::setResourcesConfig($default, $namespaces);\n }", "public function initializeConfiguration(){\n //initial Configured autoload\n if(count($GLOBALS['config']['autoload']))\n self::autoload($GLOBALS['config']['autoload']);\n\n\n }", "public function loadConfiguration(): void\n\t{\n\t\tif ($this->cliMode !== true) {\n\t\t\treturn;\n\t\t}\n\n\t\t$builder = $this->getContainerBuilder();\n\n\t\t$builder->addDefinition($this->prefix('password'))\n\t\t\t->setFactory(SecurityPasswordCommand::class);\n\t}", "protected function configure()\n {\n $this\n ->setName('homestead')\n ->setDescription('Reads sites/domains from homestead.yaml file and updates hosts file.')\n ->addArgument(\n 'folders',\n InputArgument::IS_ARRAY,\n 'Folders with valid homestead files');\n\n $this->sudo = true;\n $this->validate = false;\n }", "protected function configure()\n {\n // with options '-c', '-p' (alias '--password'), '-h' (alias '--help')\n // looks like:\n // $ php index.php demons\n // $ php index.php demons -h\n $this->setName('demo')\n ->setDescription('Demo command shows example.')\n ->disableOptions();\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function configure($name)\n {\n if (isset($this->loadedConfigurations[$name])) {\n return;\n }\n\n $this->loadedConfigurations[$name] = true;\n\n $paths = $this->getConfigurationPaths($name);\n\n $config = $this->make('config');\n\n foreach ($paths as $path) {\n $config->set(Arr::dot([\n $name => require $path,\n ]));\n }\n }", "public function boot()\n {\n $this->setupConfig();\n }", "public function boot()\n {\n $this->setupConfig();\n }", "public function boot()\n {\n $this->setupConfig();\n }", "public function boot()\n {\n $this->setupConfig();\n }", "public function boot()\n {\n $this->setupConfig();\n }", "public function boot()\n {\n $this->setupConfig();\n }", "public function boot()\n {\n $this->setupConfig();\n }", "public function boot()\n {\n $this->setupConfig();\n }", "function config()\n\t{\n\t\t// Bootstrap (CDN) v3.3.6.\n\t\t$libraries['cdn.bootstrap'] = array(\n\t\t\t'name' => 'Bootstrap (CDN)',\n\t\t\t'vendor_url' => 'http://getbootstrap.com/',\n\t\t\t'download_url' => 'https://github.com/twbs/bootstrap/releases/download/v3.3.6/bootstrap-3.3.6-dist.zip',\n\t\t\t'version_arguments' => array(\n\t\t\t\t'file' => 'js/bootstrap.min.js',\n\t\t\t\t// Bootstrap v3.3.6\n\t\t\t\t'pattern' => '/Bootstrap\\s+v(3\\.\\d\\.\\d+)/',\n\t\t\t\t'lines' => 5,\n\t\t\t),\n\t\t\t// Override library path to CDN.\n\t\t\t'library_path' => 'https://cdn.jsdelivr.net/bootstrap/3.3.6/',\n\t\t\t'files' => array(\n\t\t\t\t'js' => array(\n\t\t\t\t\t'js/bootstrap.min.js' => array(\n\t\t\t\t\t\t'zone' => 2,\n\t\t\t\t\t\t'type' => 'url',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'css' => array(\n\t\t\t\t\t'css/bootstrap.min.css' => array(\n\t\t\t\t\t\t'zone' => 2,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Font-Awesome (CDN) v4.6.3.\n\t\t$libraries['cdn.fontawesome'] = array(\n\t\t\t'name' => 'Font-Awesome (CDN)',\n\t\t\t'vendor_url' => 'http://fontawesome.io/',\n\t\t\t'download_url' => 'http://fontawesome.io/',\n\t\t\t'version_arguments' => array(\n\t\t\t\t'file' => 'css/font-awesome.min.css',\n\t\t\t\t// Font Awesome 4.6.3 by\n\t\t\t\t'pattern' => '/(\\d\\.\\d\\.\\d+)/',\n\t\t\t\t'lines' => 10,\n\t\t\t),\n\t\t\t// Override library path to CDN.\n\t\t\t'library_path' => 'https://cdn.jsdelivr.net/fontawesome/4.7.0/',\n\t\t\t'files' => array(\n\t\t\t\t'css' => array(\n\t\t\t\t\t'css/font-awesome.min.css' => array(\n\t\t\t\t\t\t'zone' => 2,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $libraries;\n\t}", "protected function configure()\n {\n $this\n ->setName('laravel')\n ->setDescription('Quickstart a new Laravel application')\n ->addArgument('name', InputArgument::REQUIRED)\n ->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists');\n }", "protected function configure()\n {\n $this->publishes([\n __DIR__ . '/../config/laravel-calendar.php' => config_path('laravel-calendar.php'),\n ], 'config');\n\n $this->mergeConfigFrom(\n __DIR__ . '/../config/laravel-calendar.php',\n 'laravel-calender'\n );\n }", "protected function configure()\n {\n $this->setName('swissup:theme:create')\n ->setDescription('Create Local Swissup theme')\n ->addArgument('name', InputArgument::REQUIRED, 'Put the theme name you want to create (Local/argento-stripes)')\n ->addArgument('parent', InputArgument::REQUIRED, 'Put the parent short theme name (stripes)');\n\n $this->addOption(\n 'css',\n null,\n InputOption::VALUE_OPTIONAL,\n 'Should I create custom css?',\n false\n );\n\n parent::configure();\n }", "function __construct() {\n parent::__construct();\n array_push($this->_config_paths, APPPATH.'custom/');\n }", "public function loadBootstrap()\n {\n if (null !== ($file = $this->getBootstrapFile())) {\n if (false === file_exists($file)) {\n throw new InvalidArgumentException(\n sprintf(\n 'The bootstrap path \"%s\" is not a file or does not exist.',\n $file\n )\n );\n }\n\n /** @noinspection PhpIncludeInspection */\n include $file;\n }\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "public function config_path();", "protected function bootstrapContainer()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n $this->instance(self::class, $this);\n\n $this->instance('path', $this->path());\n $this->instance('path.base', $this->basePath());\n $this->instance('path.config', $this->basePath('config'));\n $this->instance('path.database', $this->databasePath());\n $this->instance('path.storage', $this->storagePath());\n $this->instance('path.resources', $this->resourcePath());\n $this->instance('path.bootstrap', $this->bootstrapPath());\n\n $this->instance('env', $this->environment());\n\n $this->registerContainerAliases();\n\n $this->configure('app');\n $this->configure('view');\n }", "public function getDefaultConfigurationFileLocation() {}", "protected function initialize() {\n $this->enable();\n\n if (empty($this->getExecutable())) {\n $this->disable();\n return;\n }\n\n if (($rootPath = $this->jorge->getPath()) === NULL) {\n $this->disable();\n return;\n }\n\n # Fail silently if the current project doesn’t use Lando.\n $this->config = $this->jorge->loadConfigFile('.lando.yml', NULL);\n if (empty($this->config)) {\n $this->disable();\n }\n }", "protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/twilio-verify.php', 'twilio-verify'\n );\n }", "public function defaultBootstrap()\n {\n return $this\n ->defaultPaths()\n ->defaultDebugging()\n ->defaultErrorHandler()\n ->defaultDatabases()\n ->trigger('config')\n ->defaultTimezone('Asia/Manila')\n ->trigger('init')\n ->defaultSession()\n ->trigger('session')\n ->defaultRouting()\n ->trigger('request')\n ->defaultResponse()\n ->trigger('response')\n ->render()\n ->trigger('render')\n ->trigger('shutdown');\n }", "protected function Init() \n {\n // Load the APP config.php and add the defined vars\n $this->load($this->files['app']['file_path'], 'app');\n \n // Load the core.config.php and add the defined vars\n $this->load($this->files['core']['file_path'], 'core', 'config');\n \n // Load the database.config.php and add the defined vars\n $this->load($this->files['db']['file_path'], 'db', 'DB_configs');\n }" ]
[ "0.6839265", "0.68127424", "0.67830926", "0.6761764", "0.6507984", "0.64723635", "0.64466316", "0.6370096", "0.63112354", "0.6306098", "0.62864363", "0.6276209", "0.62053305", "0.6142328", "0.61408615", "0.61394507", "0.6116997", "0.61101216", "0.60965604", "0.6058372", "0.6039212", "0.6038989", "0.6012879", "0.6009255", "0.5983635", "0.5982127", "0.5981464", "0.5979507", "0.59585035", "0.59585035", "0.59563494", "0.59560007", "0.59311587", "0.5924201", "0.59053785", "0.5894923", "0.58933204", "0.5887991", "0.58654475", "0.58584166", "0.5854653", "0.58522666", "0.58455205", "0.5842519", "0.58322114", "0.5829094", "0.58243155", "0.5817686", "0.5801695", "0.5797673", "0.5791183", "0.57810193", "0.5777424", "0.57669073", "0.5764943", "0.57634723", "0.5738942", "0.5735147", "0.5711775", "0.57102156", "0.57088256", "0.5706017", "0.5703613", "0.5703581", "0.56992686", "0.56990945", "0.56990945", "0.569798", "0.5691775", "0.5685552", "0.568099", "0.5671636", "0.5668333", "0.5664569", "0.56627375", "0.5659477", "0.5658075", "0.5654805", "0.565212", "0.56514734", "0.56514734", "0.56514734", "0.56514734", "0.56514734", "0.56514734", "0.56514734", "0.56514734", "0.5649107", "0.56460965", "0.56354547", "0.56323445", "0.5619892", "0.5617908", "0.5616766", "0.5615254", "0.5608223", "0.5596549", "0.5596164", "0.55939704", "0.5590918", "0.5589096" ]
0.0
-1
Get user command prompt
protected function getPrompt($string, InputInterface $input, OutputInterface $output, $validator = null, $skipEmpty = false) { $helper = $this->getHelper('question'); $question = new Question($string); if($skipEmpty === false) { $question->setValidator(function ($answer) { if(empty($answer) === true) { throw new \RuntimeException( 'Please, fill out the entry!' ); } return $answer; }); } if(is_null($validator) === false) { $question->setValidator($validator); } return $helper->ask($input, $output, $question); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrompt();", "function set_prompt() {\n return $_SESSION['astcmd']['host'] . \"*CLI> \";\n}", "public static function promptSilent(string $prompt = 'Enter Password:'): string\n {\n $prompt = $prompt ? addslashes($prompt) : 'Enter:';\n\n // $checkCmd = \"/usr/bin/env bash -c 'echo OK'\";\n // $shell = 'echo $0';\n\n // linux, unix, git-bash\n if (Sys::shIsAvailable()) {\n // COMMAND: sh -c 'read -p \"Enter Password:\" -s user_input && echo $user_input'\n $command = sprintf('sh -c \"read -p \\'%s\\' -s user_input && echo $user_input\"', $prompt);\n $password = Sys::execute($command,false);\n\n echo \"\\n\";\n return $password;\n }\n\n // at windows cmd.\n if (Sys::isWindows()) {\n $vbScript = Sys::getTempDir() . '/hidden_prompt_input.vbs';\n\n file_put_contents($vbScript, 'wscript.echo(InputBox(\"' . $prompt . '\", \"\", \"password here\"))');\n\n $command = 'cscript //nologo ' . escapeshellarg($vbScript);\n $password = rtrim(shell_exec($command));\n unlink($vbScript);\n\n return $password;\n }\n\n throw new \\RuntimeException('Can not invoke bash shell env');\n }", "function prompt_silent($prompt = \"Enter Password:\")\r\n{\r\n if ('\\\\' === DIRECTORY_SEPARATOR) {\r\n fprintf(STDERR, $prompt);\r\n $exe = __DIR__ . '/resources/hiddeninput.exe';\r\n\r\n // handle code running from a phar\r\n if ('phar:' === substr(__FILE__, 0, 5)) {\r\n $tmpExe = sys_get_temp_dir() . '/hiddeninput.exe';\r\n copy($exe, $tmpExe);\r\n $exe = $tmpExe;\r\n }\r\n\r\n $value = rtrim(shell_exec($exe));\r\n\r\n if (isset($tmpExe)) {\r\n unlink($tmpExe);\r\n }\r\n\r\n fprintf(STDERR, \"\\n\");\r\n return $value;\r\n } else {\r\n $command = \"/usr/bin/env bash -c 'echo OK'\";\r\n if (rtrim(shell_exec($command)) !== 'OK') {\r\n trigger_error(\"Can't invoke bash\");\r\n return null;\r\n }\r\n\r\n $command = \"/usr/bin/env bash -c 'read -s -p \\\"\"\r\n . addslashes($prompt)\r\n . \"\\\" mypassword && echo \\$mypassword'\";\r\n $password = rtrim(shell_exec($command));\r\n echo \"\\n\";\r\n return $password;\r\n }\r\n}", "protected function readline($prompt)\n {\n // Read the line from the keyboard\n echo trim($prompt) . \" \";\n return trim(fgets(STDIN));\n }", "private function get_current_command() {\n\t\t$runner = new RunnerInstance();\n\n\t\treturn implode( ' ', (array) $runner()->arguments );\n\t}", "public static function getLine (\n\t)\t\t\t\t\t\t// RETURNS <str> the text entered into the command line.\n\t\n\t// $input = CLI_Input::getLine();\n\t{\n\t\treadline_callback_handler_remove();\n\t\treturn readline();\n\t}", "function _getInputCLI()\r\n{\r\n $opt = _read();\r\n $opt = strtoupper (trim($opt));\r\n return $opt;\r\n}", "function readline($prompt) {}", "public function getCmd()\n {\n if (! isset($this->params['args']['cmd'])) {\n return false;\n }\n\n return $this->params['args']['cmd'];\n }", "public function promptInput()\n {\n while ($this->run) {\n $this->valid = true;\n $input = readline('Enter a command : ');\n $this->handleInput($input);\n }\n }", "public function waitPrompt() {\n return $this->readTo($this->prompt);\n }", "function prompt( $question, $default = false, $marker = ': ', $hide = false ) {\n\treturn Streams::prompt( $question, $default, $marker, $hide );\n}", "function input($prompt, $color = '')\n{\n ech($prompt, $color);\n if (PHP_OS == 'WINNT') {\n $line = stream_get_line(STDIN, 1024, PHP_EOL);\n } else {\n $line = readline('');\n }\n return $line;\n}", "private function getDefaultShowCmd() {\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n return 'explorer.exe $s';\n }\n\n switch(PHP_OS) {\n case 'Darwin':\n return 'open %s';\n case 'Linux':\n case 'FreeBSD':\n return 'xdg-open %s';\n }\n\n return null;\n }", "private function getDefaultShowCmd() {\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n return 'explorer.exe $s';\n }\n\n switch(PHP_OS) {\n case 'Darwin':\n return 'open %s';\n case 'Linux':\n case 'FreeBSD':\n return 'xdg-open %s';\n }\n\n return null;\n }", "function _readline($prompt)\n{\n\techo $prompt . ': ' . PHP_EOL;\n\treturn rtrim( fread(STDIN, 512) );\n}", "public function readLine($prompt);", "private function waitPrompt(){\r\n\t\treturn $this->readTo($this->prompt);\r\n\t}", "public function consolePrompt($question,$cannotBeBlank = false){\n\n @ob_flush();\n\n exec(\"read -p '{$question} ' answer; echo \\$answer;\",$answer);\n\n if(!$answer[0] && $cannotBeBlank === true){\n echo PHP_EOL . 'Answer cannot be blank! Try again...' . PHP_EOL . PHP_EOL; \n return self::consolePrompt($question,$cannotBeBlank);\n }//if\n\n return $answer[0];\n\n }", "function getCli_nome() {\n return $this->cli_nome;\n }", "public function command()\n {\n return $this->parseCommand()[0];\n }", "public function std_in_secret($prompt)\n\t{\n\t\t$former = shell_exec('stty -g');\n\n\t\techo $prompt;\n\n\t\t// Suppress typed characters\n\t\tshell_exec('stty -echo');\n\n\t\t$secret = rtrim(fgets(STDIN), \"\\n\");\n\n\t\t// Reset old style and write blank line for look & feel\n\t\tshell_exec(\"stty $former\");\n\t\techo \"\\n\";\n\n\t\treturn $secret;\n\t}", "function readline_c( $prompt = '' )\n{\n echo $prompt;\n return rtrim( fgets( STDIN ), \"\\n\" );\n}", "final public function get_pty()\n {\n return $this->pty;\n }", "public static function getCharacter (\n\t)\t\t\t\t\t\t// RETURNS <str> a single character from the command line.\n\t\n\t// $characterPressed = CLI_Input::getCharacter();\n\t{\n\t\t// Prepare Required Functions\n\t\treadline_callback_handler_install('', function() { });\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\t$r = array(STDIN);\n\t\t\t$w = NULL;\n\t\t\t$e = NULL;\n\t\t\t$n = stream_select($r, $w, $e, 0);\n\t\t\t\n\t\t\tif($n && in_array(STDIN, $r))\n\t\t\t{\n\t\t\t\t$c = stream_get_contents(STDIN, 1);\n\t\t\t\t\n\t\t\t\treturn $c;\n\t\t\t}\n\t\t}\n\t}", "public function getCommandLine()\n {\n if (array_key_exists(\"commandLine\", $this->_propDict)) {\n return $this->_propDict[\"commandLine\"];\n } else {\n return null;\n }\n }", "public static function getConsoleCommand()\n {\n return self::$consoleCommand;\n }", "public static function getCliName();", "protected function userInput() {\n return trim(fgets($this->_stdin));\n }", "public function getCommandText();", "public function readPassword($prompt);", "public function getTerminalPass();", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getCommand(): string\n {\n return $this->command;\n }", "public function prompt()\n {\n return 'Do you want to create MySQL database?';\n }", "protected function prompt($continue = false) {\n\t\tif($continue)\n\t\t\treturn '... ';\n\t\treturn 'echo$ ';\n\t}", "public static function askHiddenInput(string $prompt = 'Enter Password:'): string\n {\n return self::promptSilent($prompt);\n }", "public function getUserInput()\n {\n // TODO: Implement getUserInput() method.\n }", "public function getUserInput()\n {\n // TODO: Implement getUserInput() method.\n }", "public function getCurrentUser(): string\n {\n $this->executor->execute('whoami', [], __DIR__, []);\n\n return trim($this->output->getBuffer());\n }", "public function getCommand() {\n return $this->getValue(self::FIELD_COMMAND);\n }", "private function _getFullCommand()\n {\n $parts = preg_split('/\\s+/', $this->job);\n reset($parts);\n $first = current($parts);\n unset($parts[key($parts)]);\n ob_start();\n passthru(\"which $first\", $ret);\n $fullcommand = trim(ob_get_clean());\n if ($ret == 0 && substr($fullcommand, 0, 1) == '/') {\n return trim($fullcommand . ' ' . join(' ', $parts));\n } else {\n $root = $this->_root;\n if ($this->_root) {\n $root = rtrim($this->_root, DIRECTORY_SEPARATOR);\n $root .= DIRECTORY_SEPARATOR;\n }\n return trim($root . $this->job);\n }\n }", "public function getCommand()\n {\n if (is_null($this->pipe)) {\n return \"{$this->pythonExecutable} {$this->script}\";\n }\n\n return \"{$this->pipe} | {$this->pythonExecutable} {$this->script}\";\n }", "public function getCurrentCommand()\n {\n return $this->currentCommand;\n }", "function get_String()\n {\n // takes the user input.\n $name = readline(\"Enter the name: \");\n return $name;\n }", "public function getCommand()\n {\n return $this->getPath() . \" -\" . $this->getFlags();\n }", "public function getTaskCmd()\n {\n return $this->get(self::TASK_CMD);\n }", "public function get_string($prompt, $color) {\n echo $this->colors->getColoredString($prompt, $color);\n \n return trim(fgets(STDIN));\n }", "public function getCommand(): string\n {\n return $this->attributes->get('command', '');\n }", "public static function help($subtool=null) {\n\t\treturn \n'user - Identify user\n<b>Usage:</b> user\nReturn the currently logged-in user.\n<b>Options:</b> None.\n';\n\t}", "public function getToolCommand(): string;", "public static function prompt($message,$keepAsking=false)\n {\n $keepAsking = !! $keepAsking;\n if ( func_num_args() > 2 ) {\n $defaultAnswer = (string)func_get_arg(2);\n }\n do {\n $badAnswer = false;\n echo $message;\n $answer = fgets(STDIN);\n $answer = str_replace(PHP_EOL,'',$answer);\n if ( empty($answer) && isset($defaultAnswer) ) {\n return $defaultAnswer;\n }\n if (empty($answer) ) {\n $badAnswer = true;\n }\n } while ($keepAsking && $badAnswer);\n return $answer;\n }", "public function testPrompt(){\n $message = null;\n $input = 'hello';\n $go = new Getopt(null, function($msg)use(&$message){ $message = $msg;}, function(){}, function()use(&$input){return $input;});\n //test default\n $testOpt = array(\n 'arg'=>'test1',\n 'prompt'=>true,\n\n 'promptMsg'=>'please enter'\n );\n\n $go->setOption($testOpt);\n $go->parse();\n $this->assertEquals($testOpt['promptMsg'], $message);\n $this->assertEquals($input, $go->test1);\n\n $input = 'ok';\n $go->parse();\n $this->assertEquals($input, $go->test1);\n\n $input = ''; //empty input\n $go->parse();\n $this->assertNull($go->test1);\n\n\n }", "public static function isCli()\n {\n return defined('STDIN');\n }", "public static function isCli()\n {\n return defined('STDIN');\n }", "public static function askPassword(string $prompt = 'Enter Password:'): string\n {\n return self::promptSilent($prompt);\n }", "public function getConsole();", "public function getConsole();", "protected function extractCommand() {\n\t\t$queryPath = $this->getQueryPath();\n\t#\tif( count( $queryPath ) >= 2 )\n\t\t\treturn array_pop( $queryPath );\n\t#\treturn current( $queryPath );\n\t}", "public function bash()\n {\n\n }", "public function command()\n {\n return $this->command;\n }", "public function get_help(){\n $tmp=self::_pipeExec('\"'.$this->cmd.'\" --extended-help');\n return $tmp['stdout'];\n }", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function command()\n\t{\n\t\treturn $this->command;\n\t}", "public function readPassword()\n {\n $result = Exec::viaPipe('bash -c \\'read -s password && echo $password\\'');\n\n return trim($result['stdOut']);\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n return $this->command;\n }", "private function _getFullPathToCommand() {\n\t\treturn realpath($this->getCommandPath() . DIRECTORY_SEPARATOR . $this->getCommand());\n\t}", "function getline() {\n return trim(fgets(STDIN));\n}", "public function getCommands()\n {\n $str = '';\n if (isset($_SERVER['argv'])) {\n $str = \"$ \" . implode(\" \", $_SERVER['argv']);\n }\n\n return $str;\n }", "public function getCommand() {\n return $this->command;\n }", "public function getCommand() {\n\t\treturn $this->command;\n\t}", "public function checkSTDIN()\n\t{\n if(defined('STDIN') ){\n\n //echo(\"Running from CLI Console\");\n $this->consoleCheckResult = \"Console\";\n\n }else{\n\n //echo(\"Not Running from CLI\");\n $this->consoleCheckResult = \"Web\";\n\n }\n\n return $this->consoleCheckResult;\n\t}", "static public function GetCommand() {\n if (isset(self::$command))\n return self::$command;\n else\n return false;\n }", "function getInput()\n {\n $input = '';\n $fr = fopen(\"php://stdin\", \"r\");\n while (!feof ($fr))\n {\n $input .= fgets($fr);\n }\n fclose($fr);\n return $input;\n }", "function printHelp(){\n\techo PHP_EOL;\n\techo \"Usage: \".PHP_EOL;\n\techo \"php hashCLI.php hash [password]: To hash the password. \".PHP_EOL;\n\techo \"php hashCLI.php check [password] [hash]: To check if the hash corresponds to the password. \".PHP_EOL;\n\techo \"php hashCLI.php help: For help. \".PHP_EOL;\n}", "function printHelp(){\n\techo PHP_EOL;\n\techo \"Usage: \".PHP_EOL;\n\techo \"php hashCLI.php hash [password]: To hash the password. \".PHP_EOL;\n\techo \"php hashCLI.php check [password] [hash]: To check if the hash corresponds to the password. \".PHP_EOL;\n\techo \"php hashCLI.php help: For help. \".PHP_EOL;\n}", "public function checkCLIuser() {}", "public function getCommand()\n {\n return $this->_command;\n }", "function isCLI() {\n return (php_sapi_name() === 'cli' OR defined('STDIN'));\n }", "public function getCommand()\n {\n return sprintf('use %s', $this->_tube);\n }", "public function command(): string;", "public function getCommand()\n {\n return \"{$this->pipe} | {$this->nodeExecutable} \" . $this->script;\n }", "public function getCommand() {}", "function enterName() {\n\tfwrite(STDOUT, \"Enter name: \") . PHP_EOL;\n\t$name = ucfirst(trim(fgets(STDIN)));\n\treturn $name;\n}", "public static function readLine()\n {\n $line = trim(fgets(STDIN));\n return $line;\n }", "public function get()\n\t\t{\n\t\t\treturn $this->command;\n\t\t}", "public function getCommand() {\n\t\treturn $this->_command;\n\t}", "public function readline(): string;", "private function readStdInput(): string\n {\n $file = file('php://stdin');\n if (empty($file)) {\n return '';\n }\n return join(\"\\n\", array_filter(array_map('trim', $file)));\n }", "function printInput(){\n\t\treturn $this->_stdin;\n\t}", "public function getInput(): string\n {\n return $this->input;\n }", "function cli_get_process_title()\n{\n}", "function getCommand($text)\r\n{\r\n\t$cmd = strtolower(substr($text, 0, 4));\r\n\tswitch ($cmd)\r\n\t{\r\n\t\tcase '/me ':\r\n\t\tcase '\\me ':\r\n\t\t\t$command = 'action';\r\n\t\t\tbreak;\r\n\t\tcase 'http':\r\n\t\tcase 'www.':\r\n\t\t\t$command = 'link';\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t$command = false;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn $command;\r\n}", "public function getCommand();", "public function getCommand(string $command);", "function getInput()\n {\n $handle = fopen(\"php://stdin\", \"r\");\n $input = trim(fgets($handle));\n fclose($handle);\n return $input;\n }", "public function latestCommand()\n {\n return $this->request('get', '/api/latest-command')['command'];\n }" ]
[ "0.7436443", "0.7219046", "0.64303684", "0.641264", "0.63950497", "0.6265971", "0.6143947", "0.60764533", "0.6072769", "0.604359", "0.60395056", "0.6035405", "0.60349464", "0.6019904", "0.6011409", "0.6011409", "0.5983577", "0.5950354", "0.5933304", "0.5901145", "0.5782519", "0.5741093", "0.5687308", "0.56724745", "0.56623834", "0.56516683", "0.5644951", "0.56440026", "0.5638539", "0.56070143", "0.560607", "0.5602419", "0.55938697", "0.55772984", "0.55772984", "0.555287", "0.55504155", "0.55262595", "0.5489", "0.5489", "0.5472964", "0.5463381", "0.5438683", "0.5437224", "0.54165196", "0.5410336", "0.5408304", "0.53931063", "0.5381034", "0.5374755", "0.5372947", "0.5344882", "0.53354967", "0.5326213", "0.5319909", "0.5319909", "0.52815217", "0.5280746", "0.5280746", "0.52684015", "0.5267474", "0.5259676", "0.52577895", "0.52400553", "0.52400553", "0.5225199", "0.52164423", "0.52164423", "0.52164423", "0.52164423", "0.52012545", "0.5195717", "0.51731265", "0.51693046", "0.51645404", "0.5164512", "0.51630074", "0.515462", "0.5151503", "0.5151503", "0.5148598", "0.5143101", "0.5125293", "0.5123002", "0.51163435", "0.5108961", "0.510522", "0.50892496", "0.50763106", "0.5073776", "0.5073118", "0.5072071", "0.5069429", "0.5063386", "0.50427943", "0.504031", "0.503986", "0.5038038", "0.5028838", "0.5025086", "0.50169814" ]
0.0
-1
server search all matching servers
function bigpatch_ftp_upload($if, $server) { $dir = __DIR__ . "\\servers"; $valid_servers = []; if(strpos($server, '*')===false) $valid_servers[] = "$dir\\$server.server.json"; else{ $scan = array_diff(scandir($dir), $GLOBALS['exclude_servers']); $search = str_replace('*', '', $server); foreach($scan as $server_file){ if(strpos($server_file, $search)!==false) $valid_servers[] = "$dir\\$server_file"; } } print_r($valid_servers); if(prompt("Continue with these? [y,n] ")!='y'){ echo "Aborting multi server upload\n"; return false; } $q_errors = 0; $q_tot_files = 0; foreach($valid_servers as $server_file){ echo "Using $server_file\n"; if (!file_exists($server_file)) { echo "Fatal error: $server not found\n"; return false; } $server_ = json_decode(file_get_contents($server_file), true); $ftp = new FtpServer($server_['hostname']); $ftpSession = $ftp->login($server_['username'], $server_['password']); if (!$ftpSession) { echo "Failed to connect."; return false; } $errorList = $ftp->send_recursive_directory($if, $server_['remote_folder']); $with_errors = 0; $tot_files = 0; /* if($with_errors == 0) echo "[$tot_files] OK\n"; else echo "[$tot_files] $with_errors errors!\n"; */ $ftp->disconnect(); } if($q_errors == 0) echo "[$q_tot_files] ALL OK\n"; else echo "[$q_tot_files] $q_errors total errors!\n"; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n {\n $mode = Input::get('mode') ?: 'mine';\n\n switch ($mode) {\n case 'mine':\n $servers = Server::allUserServers(Auth::user()->id);\n break;\n default:\n return response()->json(['errors' => array()])->setStatusCode(400, 'Invalid search mode!');\n break;\n }\n\n $responseArray = $this->transformer->transform($servers);\n return response()->json($responseArray, 200);\n }", "public function getServers();", "public function getServers($filter=\"\"){\n\t\t$servers = DB::table('servers')\n\t\t\t\t\t\t\t->where('name', 'LIKE', '%' . $filter . '%' )\n\t\t\t\t\t\t\t->orWhere('servers.description', 'LIKE', '%' . $filter . '%' )\n ->orWhere('categories.description', 'LIKE', '%' . $filter . '%' )\n ->join('categories', 'servers.category_id', '=', 'categories.id')\n ->select('servers.*', \n 'categories.description as category_description', \n 'categories.color as category_color')\n ->orderBy('name')\n\t\t\t\t\t\t\t->get();\n\n\t\tforeach($servers as $server){\n\t\t\t$this->getServerLastMetrics( $server );\n\t\t\t$this->getServerThresholdValue($server, 'ip');\n\t\t\t$this->getServerThresholdValue($server, 'connections');\n\t\t}\n return $servers;\n }", "public function selectServers() {\n \n $query = $this->conection->query(\"SELECT nameserver FROM Servidor\");\n $result = array();\n while ($rst = $this->conection->result($query)) {\n\n $name = $rst[\"nameserver\"]; \n array_push($result, $name);\n }\n\n $this->conection->free($query);\n //$this->conection->closeConection();\n return $result;\n }", "public function getServerList() {}", "public function getServers() {}", "function os2forms_server_communication_get_servers() {\n $query = db_select('os2forms_server_communication_servers_list', 's');\n $query->fields('s', array('id', 'server_name', 'url', 'username', 'psw'));\n $servers = $query->execute()\n ->fetchAllAssoc('id');\n\n return $servers;\n}", "public function get_server_search($headers) {\n $server = '';\n $search = '';\n foreach ($headers as $header) {\n\n if ($pos = strpos($header, ':')) {\n $name = trim(substr($header, 0, $pos));\n $value = trim(substr($header, $pos+1));\n\n if ($name=='Server') {\n switch (true) {\n\n case (substr($value, 0, 6)=='Apache'):\n $server = self::SERVER_APACHE;\n $search = '/<td[^>]*><a href=\"[^\"]*\">(.*?)<\\/a><\\/td><td[^>]*>(.*?)<\\/td><td[^>]*>(.*?)<\\/td>/i';\n break;\n\n case (substr($value, 0, 13)=='Microsoft-IIS'):\n $server = self::SERVER_IIS;\n $search = '/ +([^ ]+) +([^ ]+) +([^ ]+) +<a href=\"[^\"]*\">(.*?)<\\/a>/i';\n break;\n\n case (substr($value, 0, 5)=='nginx'):\n $server = self::SERVER_NGINX;\n $search = '/<a href=\"[^\"]*\">(.*?)<\\/a> +([^ ]+) +([^ ]+) +([^ ]+)/i';\n break;\n\n default;\n throw new moodle_exception('Unknown server type: '. $value);\n }\n }\n }\n }\n return array($server, $search);\n }", "public function getAll() {\n\n $servers = Hash::extract($this->find('all', array(\n 'fields' => array(\n 'server_id', 'name', 'short_name', 'parent_id'\n )\n )), '{n}.Server');\n\n foreach ($servers as &$server) {\n\n $parent_id = $server['parent_id'];\n\n if (empty($parent_id)) {\n $server['sort_index'] = $server['server_id'] * 2;\n } else {\n $server['sort_index'] = $parent_id * 2 + 1;\n }\n }\n\n $servers = Hash::sort($servers, '{n}.sort_index');\n\n return $servers;\n }", "public static function getservers() {\n\t\t$product_id = OnAppCDN::getValue( 'id' );\n\n\t\t$sql = \"SELECT\n\t\t\t\t\ttblservers.*,\n\t\t\t\t\ttblservergroupsrel.groupid,\n\t\t\t\t\ttblproducts.servergroup\n\t\t\t\tFROM\n\t\t\t\t\ttblservers\n\t\t\t\t\tLEFT JOIN tblservergroupsrel ON\n\t\t\t\t\t\ttblservers.id = tblservergroupsrel.serverid\n\t\t\t\t\tLEFT JOIN tblproducts ON\n\t\t\t\t\t\ttblproducts.id = $product_id\n\t\t\t\tWHERE\n\t\t\t\t\ttblservers.type = 'onappcdn'\";\n\n\t\t$sql_servers_result = full_query( $sql );\n\n\t\t$servers = array();\n\t\twhile( $server = mysql_fetch_assoc( $sql_servers_result ) ) {\n\t\t\tif( is_null( $server[ 'groupid' ] ) ) {\n\t\t\t\t$server[ 'groupid' ] = 0;\n\t\t\t}\n\t\t\t$server[ 'password' ] = decrypt( $server[ 'password' ] );\n\t\t\t$servers[ $server[ 'id' ] ] = $server;\n\t\t\t$servers[ $server[ 'id' ] ][ 'address' ] = $server[ 'ipaddress' ] != '' ? $server[ 'ipaddress' ] : $server[ 'hostname' ];\n\n\t\t\tif( $server[ 'secure' ] == 'on' ) {\n\t\t\t\t$servers[ $server[ 'id' ] ][ 'address' ] = 'https://' . $servers[ $server[ 'id' ] ][ 'address' ];\n\t\t\t}\n\t\t}\n\n\t\treturn $servers;\n\t}", "public function getServerList(): array\n {\n $replace = array(\n \"\\xFF\\xFF\\xFF\\xFFgetserversResponse\\n\",\n \"\\\\EOF\",\n \"\\\\EOT\"\n );\n\n $servers = array();\n\n $this->write(\"\\xFF\\xFF\\xFF\\xFFgetservers \".$this->protocol.\" full empty\");\n $data = $this->read_master();\n\n foreach ($data as $row) {\n $row = str_replace($replace, \"\", $row);\n $row = explode(\"\\x5c\", $row);\n foreach ($row as $server) {\n if (strlen($server) == 6) {\n $serverInfo = unpack(\"Nip/nport\", $server);\n $servers[] = new Server(long2ip($serverInfo[\"ip\"]), $serverInfo[\"port\"]);\n }\n }\n }\n\n return $servers;\n }", "public function getServers() {\n\t\treturn $this->dbHandler->getAllServer();\n\t}", "public function findHosts(): array;", "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 }", "function search() {}", "public function search();", "public function search();", "public function get_servers($request) {\r\n\t\t$this->servers = $request['server'];\r\n\t\treturn $request['server'];\r\n\t}", "public function checkInServerList()\n {\n $serverList = preg_split('/\\r\\n|[\\r\\n]/', ConfPPM::getConf('server_list'));\n $myIP = array();\n $myIP[] = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';\n $myIP[] = isset($_SERVER['GEOIP_ADDR']) ? $_SERVER['GEOIP_ADDR'] : '127.0.0.1';\n if (empty(array_intersect($serverList, $myIP))) {\n return false;\n } else {\n return true;\n }\n }", "public function listServers ( $q = '', $user_id ) { }", "public function testListServer()\n {\n }", "public function getMultiHostServers() {\n $publicKey = md5(microtime());\n\n $hosts = array('http://imbo0', 'http://imbo1/prefix', 'http://imbo2:81', 'http://imbo3:81/prefix', 'http://imbo4:80');\n\n return array(\n array($hosts, $publicKey, 'd1afdbe2950dc1e9fa134d8c91cd1a8b', 'http://imbo4'),\n array($hosts, $publicKey, '5fda26a928c9b0b90ef7b2db0031bfcf', 'http://imbo0'),\n array($hosts, $publicKey, '5d028794b32c2b127875a336b1220dab', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, 'f7dc62518f2967dacbc4c0eead5fabe5', 'http://imbo2:81'),\n array($hosts, $publicKey, '7a4cac9e82c06010293cd6d23708e147', 'http://imbo2:81'),\n array($hosts, $publicKey, '609c8d8350d3b6b294a628835b8e9b59', 'http://imbo1/prefix'),\n array($hosts, $publicKey, '1e68c888fbe0a27276141a1e6fb576f4', 'http://imbo0'),\n array($hosts, $publicKey, '67e45db3a472a90a26bda000c0818bfc', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, '3ad35117949c5a17b9df82c343b4f763', 'http://imbo3:81/prefix'),\n );\n }", "function getServers() {\n\t\treturn $this->servers;\n\t}", "public function search(){}", "private function get_server()\n {\n }", "private function _getServer(){\n\t\textract($this->configs);\n\t\t$orderServer = array();\n\t\tif(is_string($servers))\t{\n\t\t\t$servers = array($servers);\n\t\t}\n\t\t\n\t\tif ( $masterServer !== false && is_string($masterServer)){\n\t\t\t$orderServer[] = $servers[$masterServer];\n\t\t\tunset($servers[$masterServer]);\n\t\t}\n\t\t$orderServer = array_merge($orderServer,$servers); \n\t\t\n\t\tforeach($orderServer as $url ) {\n\t\t\tif($this->_checkServerIsOnline($url)){\n\t\t\t\treturn $url;\n\t\t\t}\n\t\t}\n\t\n\t\t\t\t\n\t\treturn false ;\n\t}", "function get_server_list($username) {\n\t$servers = array();\n\n\ttry {\n\t\t# Query for the requested user\n\t\t$dbh = get_dbh();\n\t\t$stmt = $dbh->prepare('SELECT name FROM servers WHERE username = ?');\n\t\t$stmt->execute(array($username));\n\n\t\t$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\tforeach ($rs as $row) {\n\t\t\t$servers[] = $row['name'];\n\t\t}\n\t} catch (PDOException $e) {\n\t\terror(0, 'DB error in get_server_list: ' . $e->getMessage());\n\t}\n\n\treturn $servers;\n}", "function get_dns_servers() {\n\treturn get_dns_nameservers(false, true);\n}", "public function exchange_servers($attributes = array('cn','distinguishedname','serialnumber')) {\n if (!$this->_bind){ return (false); }\n \n $configurationNamingContext = $this->get_root_dse(array('configurationnamingcontext'));\n $sr = @ldap_search($this->_conn,$configurationNamingContext[0]['configurationnamingcontext'][0],'(&(objectCategory=msExchExchangeServer))',$attributes);\n $entries = @ldap_get_entries($this->_conn, $sr);\n return $entries;\n }", "function setServers()\n\t{\t\n\t\tglobal $db;\n\t\t\t\n\t\t$data_city \t\t= ((in_array(strtolower($this->params['data_city']), $this->dataservers)) ? strtolower($this->params['data_city']) : 'remote');\n\t\t\n\t\t$this->dbConIro \t\t= $db[$data_city]['iro']['master'];\n\t\t$this->dbConDjds \t\t= $db[$data_city]['d_jds']['master'];\n\t\t$this->dbConDjds_slave\t= $db[$data_city]['d_jds']['master'];\n\t\t$this->dbContme\t\t\t= $db[$data_city]['tme_jds']['master'];\n\t\t//$this->dbConIro_slave\t= $db[$data_city]['iro']['slave'];\n\t\t$this->dbConIdc \t\t= $db[$data_city]['idc']['master'];\t\t\n\t\t$this->dbConbudget \t= $db[$data_city]['db_budgeting']['master'];\n\t\tif((in_array($this->ucode, json_decode(MONGOUSER)) || ALLUSER == 1)){\n\t\t\t$this->mongo_flag = 1;\n\t\t}\n\t\tif((in_array($this->ucode, json_decode(TME_MONGOUSER)) || TME_ALLUSER_MONGO == 1) && in_array(strtolower($data_city), json_decode(MONGOCITY))){\t\n\t\t\t$this->mongo_tme = 1;\n\t\t}\n\t}", "abstract public function msaSearch($domains, array $opts = array());", "function getServerList($company)\n {\n $link = mssql_connect('10.20.2.12\\MSSQLSERVER', 'compinventory', '@ttg@dm!n$');\n \n if (!$link || !mssql_select_db('compinventoryDB', $link)) {\n die('Unable to connect or select database!');\n return NULL;\n }\n \n $server = mssql_query(\"select * from [dbo].[IPMAC_SERVER] where Server_Site ='\". $company. \"';\");\n $row = mssql_fetch_array($server);\n \n // Clean up\n mssql_free_result($server);\n return $row;\n }", "public function handle()\n {\n $tmp = $this->client->servers();\n\n /** @var \\Illuminate\\Support\\Collection|\\App\\Models\\Game[] $games */\n /** @var \\Illuminate\\Support\\Collection|\\App\\Models\\Server[] $servers_db */\n /** @var \\Illuminate\\Support\\Collection|\\TruckersMP\\Types\\Server[] $servers_actual */\n $games = Game::all();\n $servers_db = Server::all();\n\n// $new = json_decode('{\"id\":16,\"game\":\"ETS2\",\"ip\":\"43.251.158.210\",\"port\":42860,\"name\":\"Convoy\",\"shortname\":\"Convoy\",\"online\":true,\"players\":4,\"queue\":0,\"maxplayers\":500,\"speedlimiter\":false,\"collisions\":true,\"carsforplayers\":true,\"policecarsforplayers\":false,\"afkenabled\":true,\"syncdelay\":100}',\n// true);\n// $tmp->servers[] = new \\TruckersMP\\Types\\Server($new);\n $servers_actual = collect($tmp);\n\n $existed_servers = [];\n foreach ($servers_actual as $actual) {\n /** @var \\Illuminate\\Support\\Collection|\\App\\Models\\Server[] $db */\n /** @var \\TruckersMP\\Types\\Server $actual */\n $db = $servers_db->where('actual_id', $actual->id)\n ->where('name', $actual->name)\n ->where('shortname', $actual->shortName)\n ->sortByDesc('created_at');\n\n if ($db->isEmpty()) {\n /** @var \\App\\Models\\Server $s */\n $s = Server::create([\n 'actual_id' => $actual->id,\n 'game_id' => $games->where('shortname', $actual->game)->first()->id,\n 'name' => $actual->name,\n 'shortname' => $actual->shortName,\n 'online' => $actual->online,\n ]);\n\n $this->info('New server - ' . $actual->name);\n $existed_servers[] = $s->id;\n continue;\n }\n\n /** @var \\App\\Models\\Server $main */\n if ($db->count() > 1) {\n $main = $db->shift();\n $db->each(function ($server) {\n /** @var \\App\\Models\\Server $server */\n $server->online = false;\n $server->update();\n $server->delete();\n });\n } else {\n $main = $db->first();\n }\n\n if ($main->online !== $actual->online) {\n $actual_online = $actual->online ? 'online' : 'offline';\n $main->online = $actual->online;\n\n $this->comment(\"{$main->shortname} went {$actual_online}\");\n }\n\n $existed_servers[] = $main->id;\n };\n\n $servers_db->each->update();\n Server::whereNotIn('id', $existed_servers)->delete();\n }", "function check_servers ($serv_params){\r\n\r\n global $lingo,$divstyle_white,$divstyle_blue,$divstyle_orange,$divstyle_grey,$strings,$crm_api_user, $crm_api_pass, $crm_wsdl_url,$funky_gear,$sess_account_id,$sess_contact_id;\r\n\r\n #$lingoname = \"name_ja\";\r\n $lingoname = \"name_\".$lingo;\r\n\r\n $server_id = $serv_params[0];\r\n $server_name = $serv_params[1];\r\n $server_type = $serv_params[2];\r\n\r\n ##########################################\r\n # Get server-related switches\r\n\r\n $subicondivwidth = \"26\";\r\n $subiconheight = \"3\";\r\n $subrowdivwidth = \"80%\";\r\n\r\n $serverbit_object_type = \"ConfigurationItems\";\r\n $serverbit_action = \"select\";\r\n // parent CI will be the registered server (also a CI) - not the filter as we may use this filter for other purposes\r\n // The type is Live Status 1/0\r\n $serverbit_type_id = '423752fe-a632-9b4d-8c3b-52ccc968fe59';\r\n $serverbit_params[0] = \" sclm_configurationitems_id_c='\".$server_id.\"' && sclm_configurationitemtypes_id_c='\".$serverbit_type_id.\"' \";\r\n $serverbit_params[1] = \"id,contact_id_c,account_id_c,name,sclm_configurationitems_id_c,sclm_configurationitemtypes_id_c,$lingoname\"; // select array\r\n $serverbit_params[2] = \"\"; // group;\r\n $serverbit_params[3] = \"\"; // order;\r\n $serverbit_params[4] = \"\"; // limit\r\n \r\n $serverbits = api_sugar ($crm_api_user, $crm_api_pass, $crm_wsdl_url, $serverbit_object_type, $serverbit_action, $serverbit_params);\r\n\r\n $label = $strings[\"CI_ServerStatus\"];\r\n\r\n $addserver = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=add&value=\".$serverbit_type_id.\"&valuetype=ConfigurationItemTypes&clonevaluetype=ConfigurationItems&clonevalue=\".$filter_id.\"&sendiv=INFRA&parent_ci=\".$server_id.\"');return false\\\"><img src=images/blank.gif width=5 height=5><img src=images/icons/plus.gif width=16> <font color=#151B54><B>\".$server_name.\": \".$strings[\"action_addnew\"].\"</B></font></a>\";\r\n\r\n if (is_array($serverbits)){\r\n\r\n for ($srvbitcnt=0;$srvbitcnt < count($serverbits);$srvbitcnt++){\r\n \r\n $server_status_id = $serverbits[$srvbitcnt]['id'];\r\n $record_contact_id_c = $serverbits[$srvbitcnt]['contact_id_c'];\r\n $record_account_id_c = $serverbits[$srvbitcnt]['account_id_c'];\r\n $server_status = $serverbits[$srvbitcnt]['name']; // 1/0\r\n \r\n $edit = \"\";\r\n $show_id = \"\";\r\n\r\n if ($auth == 3 || ($sess_account_id != NULL && $sess_account_id==$record_account_id_c)){\r\n $edit = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=edit&value=\".$server_status_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=red><B>[\".$strings[\"action_edit\"].\"]</B></font></a> \";\r\n }\r\n\r\n if ($auth == 3){\r\n $show_id = \" | ID: \".$server_status_id;\r\n } else {\r\n $show_id = \"\";\r\n }\r\n\r\n switch ($server_status){\r\n\r\n case '':\r\n $server_status_show = \"NA\";\r\n $thisdivstyle_orange = $divstyle_white;\r\n break;\r\n case '1':\r\n $server_status_show = $strings[\"CI_ServerStatusOnline\"];\r\n $addserver = \"\";\r\n $thisdivstyle_orange = $divstyle_blue;\r\n break;\r\n case '0':\r\n $server_status_show = $strings[\"CI_ServerStatusOffline\"];\r\n $addserver = \"\";\r\n $thisdivstyle_orange = $divstyle_orange;\r\n break;\r\n\r\n } // switch\r\n\r\n $filterimage_returner = $funky_gear->object_returner (\"ConfigurationItemTypes\", $serverbit_type_id);\r\n $image_url = $filterimage_returner[7];\r\n\r\n $servers .= \"<div style=\\\"\".$thisdivstyle_orange.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$subiconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$subrowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$server_status_show.\"<BR>\".$edit.\" <a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=view&value=\".$server_status_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=black><B>[\".$strings[\"action_view\"].\"]</B></font></a>\".$show_id.\" \".$addserver.\"</div></div>\";\r\n\r\n } // for serverbits\r\n\r\n } else {// if array\r\n\r\n $server_status_show = \"NA\";\r\n $servers .= \"<div style=\\\"\".$divstyle_white.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$iconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$rowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$server_status_show.\"<BR> \".$addserver.\"</div></div>\";\r\n\r\n } // else array\r\n\r\n # End get server-related switches\r\n ##########################################\r\n # Get server-related switches\r\n\r\n $subicondivwidth = \"26\";\r\n $subiconheight = \"3\";\r\n $subrowdivwidth = \"80%\";\r\n\r\n $serverbit_object_type = \"ConfigurationItems\";\r\n $serverbit_action = \"select\";\r\n // parent CI will be the registered server (also a CI) - not the filter as we may use this filter for other purposes\r\n // The type is Live Status 1/0\r\n $serverbit_type_id = '2864a518-19f4-ddfa-366e-52ccd012c28b';\r\n $serverbit_params[0] = \" sclm_configurationitems_id_c='\".$server_id.\"' && sclm_configurationitemtypes_id_c='\".$serverbit_type_id.\"' \";\r\n $serverbit_params[1] = \"id,contact_id_c,account_id_c,name,sclm_configurationitems_id_c,sclm_configurationitemtypes_id_c,$lingoname\"; // select array\r\n $serverbit_params[2] = \"\"; // group;\r\n $serverbit_params[3] = \"\"; // order;\r\n $serverbit_params[4] = \"\"; // limit\r\n \r\n $serverbits = api_sugar ($crm_api_user, $crm_api_pass, $crm_wsdl_url, $serverbit_object_type, $serverbit_action, $serverbit_params);\r\n\r\n $label = $strings[\"CI_ServerStatusMaintenance\"];\r\n\r\n $addservermaintenance = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=add&value=\".$serverbit_type_id.\"&valuetype=ConfigurationItemTypes&clonevaluetype=ConfigurationItems&clonevalue=\".$filter_id.\"&sendiv=INFRA&parent_ci=\".$server_id.\"');return false\\\"><img src=images/blank.gif width=5 height=5><img src=images/icons/plus.gif width=16> <font color=#151B54><B>\".$strings[\"action_addnew\"].\"</B></font></a>\";\r\n\r\n if (is_array($serverbits)){\r\n\r\n for ($srvbitcnt=0;$srvbitcnt < count($serverbits);$srvbitcnt++){\r\n \r\n $server_maintenance_status_id = $serverbits[$srvbitcnt]['id'];\r\n $record_account_id_c = $serverbits[$srvbitcnt]['account_id_c'];\r\n $server_maintenance_status = $serverbits[$srvbitcnt]['name']; // 1/0\r\n \r\n $edit = \"\";\r\n $show_id = \"\";\r\n\r\n if ($auth == 3 || ($sess_account_id != NULL && $sess_account_id==$record_account_id_c)){\r\n $edit = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=edit&value=\".$server_maintenance_status_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=red><B>[\".$strings[\"action_edit\"].\"]</B></font></a> \";\r\n }\r\n\r\n if ($auth == 3){\r\n $show_id = \" | ID: \".$server_maintenance_status_id;\r\n } else {\r\n $show_id = \"\";\r\n }\r\n\r\n switch ($server_maintenance_status){\r\n\r\n case '':\r\n $server_status_show = \"NA\";\r\n $thisdivstyle_orange = $divstyle_white;\r\n break;\r\n case '1':\r\n $server_status_show = \"ON\";\r\n $addservermaintenance = \"\";\r\n $thisdivstyle_orange = $divstyle_orange;\r\n $view = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=view&value=\".$server_maintenance_status_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=black><B>[\".$strings[\"action_view\"].\"]</B></font></a>\".$show_id;\r\n break;\r\n case '0':\r\n $server_status_show = \"OFF\";\r\n $addservermaintenance = \"\";\r\n $thisdivstyle_orange = $divstyle_blue;\r\n $view = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=view&value=\".$server_maintenance_status_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=black><B>[\".$strings[\"action_view\"].\"]</B></font></a>\".$show_id;\r\n break;\r\n\r\n } // switch\r\n\r\n $filterimage_returner = $funky_gear->object_returner (\"ConfigurationItemTypes\", $serverbit_type_id);\r\n $image_url = $filterimage_returner[7];\r\n\r\n $servers .= \"<div style=\\\"\".$thisdivstyle_orange.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$subiconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$subrowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$server_status_show.\"<BR>\".$edit.$view.$addservermaintenance.\"</div></div>\";\r\n\r\n } // for serverbits\r\n\r\n } else {// if array\r\n\r\n $server_status_show = \"NA\";\r\n $servers .= \"<div style=\\\"\".$divstyle_white.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$iconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$rowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$server_status_show.\"<BR> \".$addservermaintenance.\"</div></div>\";\r\n\r\n } // else array\r\n\r\n # Maintenance Window DateTime Start\r\n $serverbit_type_id = '787ab970-8f2a-efed-3aca-52ecd566b16b';\r\n $serverbit_params[0] = \" sclm_configurationitems_id_c='\".$server_id.\"' && sclm_configurationitemtypes_id_c='\".$serverbit_type_id.\"' \";\r\n $serverbit_params[1] = \"id,contact_id_c,account_id_c,name,sclm_configurationitems_id_c,sclm_configurationitemtypes_id_c,$lingoname\"; // select array\r\n $serverbit_params[2] = \"\"; // group;\r\n $serverbit_params[3] = \"\"; // order;\r\n $serverbit_params[4] = \"\"; // limit\r\n\r\n $serverbits = \"\";\r\n $serverbits = api_sugar ($crm_api_user, $crm_api_pass, $crm_wsdl_url, $serverbit_object_type, $serverbit_action, $serverbit_params);\r\n\r\n $label = \"Maintenance Window Start DateTime\"; //$strings[\"CI_ServerStatusMaintenance\"];\r\n\r\n $addservermaintenance = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=add&value=\".$serverbit_type_id.\"&valuetype=ConfigurationItemTypes&clonevaluetype=ConfigurationItems&clonevalue=\".$filter_id.\"&sendiv=INFRA&parent_ci=\".$server_id.\"');return false\\\"><img src=images/blank.gif width=5 height=5><img src=images/icons/plus.gif width=16> <font color=#151B54><B>\".$strings[\"action_addnew\"].\"</B></font></a>\";\r\n\r\n if (is_array($serverbits)){\r\n\r\n for ($srvbitcnt=0;$srvbitcnt < count($serverbits);$srvbitcnt++){\r\n \r\n $server_maintenance_start_datetime_id = $serverbits[$srvbitcnt]['id'];\r\n $record_account_id_c = $serverbits[$srvbitcnt]['account_id_c'];\r\n $record_contact_id_c = $serverbits[$srvbitcnt]['contact_id_c'];\r\n $server_maintenance_start_datetime = $serverbits[$srvbitcnt]['name']; // 1/0\r\n \r\n $edit = \"\";\r\n $show_id = \"\";\r\n\r\n if ($auth == 3 || ($sess_account_id != NULL && $sess_account_id==$record_account_id_c)){\r\n $edit = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=edit&value=\".$server_maintenance_start_datetime_id.\"&valuetype=\".$valtype.\"&sendiv=INFRA');return false\\\"><font size=2 color=red><B>[\".$strings[\"action_edit\"].\"]</B></font></a> \";\r\n }\r\n\r\n if ($auth == 3){\r\n $show_id = \" | ID: \".$server_maintenance_start_datetime_id;\r\n } else {\r\n $show_id = \"\";\r\n }\r\n\r\n if ($server_maintenance_start_datetime){\r\n $start_datetime_show = $server_maintenance_start_datetime;\r\n $thisdivstyle = $divstyle_orange;\r\n $addservermaintenance = \"\";\r\n } else {\r\n $start_datetime_show = \"NA\";\r\n $thisdivstyle = $divstyle_white;\r\n } \r\n\r\n $filterimage_returner = $funky_gear->object_returner (\"ConfigurationItemTypes\", $serverbit_type_id);\r\n $image_url = $filterimage_returner[7];\r\n\r\n $servers .= \"<div style=\\\"\".$thisdivstyle.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$subiconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$subrowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$start_datetime_show.\"<BR>\".$edit.\" <a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=view&value=\".$server_maintenance_start_datetime_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=black><B>[\".$strings[\"action_view\"].\"]</B></font></a>\".$show_id.\" \".$addservermaintenance.\"</div></div>\";\r\n\r\n } // for serverbits\r\n\r\n } else {// if array\r\n\r\n $servers .= \"<div style=\\\"\".$divstyle_white.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$iconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$rowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B>NA<BR> \".$addservermaintenance.\"</div></div>\";\r\n\r\n } // else array\r\n\r\n # Maintenance Window DateTime End\r\n $serverbit_type_id = 'b38181b6-eb59-0bc3-bad3-52ecd65163f5';\r\n $serverbit_params[0] = \" sclm_configurationitems_id_c='\".$server_id.\"' && sclm_configurationitemtypes_id_c='\".$serverbit_type_id.\"' \";\r\n $serverbit_params[1] = \"id,contact_id_c,account_id_c,name,sclm_configurationitems_id_c,sclm_configurationitemtypes_id_c,$lingoname\"; // select array\r\n $serverbit_params[2] = \"\"; // group;\r\n $serverbit_params[3] = \"\"; // order;\r\n $serverbit_params[4] = \"\"; // limit\r\n\r\n $serverbits = \"\";\r\n $serverbits = api_sugar ($crm_api_user, $crm_api_pass, $crm_wsdl_url, $serverbit_object_type, $serverbit_action, $serverbit_params);\r\n\r\n $label = \"Maintenance Window End DateTime\"; //$strings[\"CI_ServerStatusMaintenance\"];\r\n\r\n $addservermaintenance = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=add&value=\".$serverbit_type_id.\"&valuetype=ConfigurationItemTypes&clonevaluetype=ConfigurationItems&clonevalue=\".$filter_id.\"&sendiv=INFRA&parent_ci=\".$server_id.\"');return false\\\"><img src=images/blank.gif width=5 height=5><img src=images/icons/plus.gif width=16> <font color=#151B54><B>\".$strings[\"action_addnew\"].\"</B></font></a>\";\r\n\r\n if (is_array($serverbits)){\r\n\r\n for ($srvbitcnt=0;$srvbitcnt < count($serverbits);$srvbitcnt++){\r\n \r\n $server_maintenance_end_datetime_id = $serverbits[$srvbitcnt]['id'];\r\n $record_account_id_c = $serverbits[$srvbitcnt]['account_id_c'];\r\n $record_contact_id_c = $serverbits[$srvbitcnt]['contact_id_c'];\r\n $server_maintenance_end_datetime = $serverbits[$srvbitcnt]['name']; // 1/0\r\n \r\n $edit = \"\";\r\n $show_id = \"\";\r\n\r\n if ($auth == 3 || ($sess_account_id != NULL && $sess_account_id==$record_account_id_c)){\r\n $edit = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=edit&value=\".$server_maintenance_end_datetime_id.\"&valuetype=\".$valtype.\"&sendiv=INFRA');return false\\\"><font size=2 color=red><B>[\".$strings[\"action_edit\"].\"]</B></font></a> \";\r\n }\r\n\r\n if ($auth == 3){\r\n $show_id = \" | ID: \".$server_maintenance_end_datetime_id;\r\n } else {\r\n $show_id = \"\";\r\n }\r\n\r\n if ($server_maintenance_end_datetime){\r\n $end_datetime_show = $server_maintenance_end_datetime;\r\n $thisdivstyle = $divstyle_orange;\r\n $addservermaintenance = \"\";\r\n } else {\r\n $end_datetime_show = \"NA\";\r\n $thisdivstyle = $divstyle_white;\r\n } \r\n\r\n $filterimage_returner = $funky_gear->object_returner (\"ConfigurationItemTypes\", $serverbit_type_id);\r\n $image_url = $filterimage_returner[7];\r\n\r\n $servers .= \"<div style=\\\"\".$thisdivstyle.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$subiconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$subrowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$end_datetime_show.\"<BR>\".$edit.\" <a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=view&value=\".$server_maintenance_end_datetime_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=black><B>[\".$strings[\"action_view\"].\"]</B></font></a>\".$show_id.\" \".$addservermaintenance.\"</div></div>\";\r\n\r\n } // for serverbits\r\n\r\n } else {// if array\r\n\r\n $servers .= \"<div style=\\\"\".$divstyle_white.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$iconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$rowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B>NA<BR> \".$addservermaintenance.\"</div></div>\";\r\n\r\n } // else array\r\n\r\n\r\n # End get server-related switches\r\n ##########################################\r\n # Get server-related back-up details\r\n # Back-up Day: 67a6bcaf-4e45-42d6-79da-52d4df16784c\r\n # Back-up End Time: 913315fd-34d5-036e-0c52-52d4d91550d9\r\n # Back-up Job Name: 8802ae00-1abe-9819-558f-52d4d74b6ca2\r\n # Back-up Start Time: 4d440215-68e1-efe3-158e-52d4d808e6b1\r\n # Back-up Status: 530ae095-b3e7-c9fe-61fb-52d5aee0a272\r\n # Back-up Status Keyword(s): 56291976-233c-912a-b10e-52d4dfc8357c\r\n # Execution Server: 91694cfa-3f33-6505-d894-52d4d84722c0\r\n # Target Server: 734f02a8-5821-86f1-3229-52d4d80696ac\r\n\r\n $subicondivwidth = \"26\";\r\n $subiconheight = \"3\";\r\n $subrowdivwidth = \"80%\";\r\n\r\n $serverbit_object_type = \"ConfigurationItems\";\r\n $serverbit_action = \"select\";\r\n # parent CI will be the registered server (also a CI) - not the filter as we may use this filter for other purposes\r\n # The type is Maintenance 1/0\r\n $serverbit_type_id = '530ae095-b3e7-c9fe-61fb-52d5aee0a272';\r\n $serverbit_params[0] = \" sclm_configurationitems_id_c='\".$server_id.\"' && sclm_configurationitemtypes_id_c='\".$serverbit_type_id.\"' \";\r\n $serverbit_params[1] = \"id,contact_id_c,account_id_c,name,sclm_configurationitems_id_c,sclm_configurationitemtypes_id_c,$lingoname\"; // select array\r\n $serverbit_params[2] = \"\"; // group;\r\n $serverbit_params[3] = \"\"; // order;\r\n $serverbit_params[4] = \"\"; // limit\r\n \r\n $serverbits = api_sugar ($crm_api_user, $crm_api_pass, $crm_wsdl_url, $serverbit_object_type, $serverbit_action, $serverbit_params);\r\n\r\n $label = $strings[\"CI_ServerStatusBackup\"];\r\n\r\n $addserverbackup = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=add&value=\".$serverbit_type_id.\"&valuetype=ConfigurationItemTypes&clonevaluetype=ConfigurationItems&clonevalue=\".$filter_id.\"&sendiv=INFRA&parent_ci=\".$server_id.\"&partype=dbcb0dbb-c3b8-8edb-1bd6-52b8e31ff812');return false\\\"><img src=images/blank.gif width=5 height=5><img src=images/icons/plus.gif width=16> <font color=#151B54><B>\".$strings[\"action_addnew\"].\"</B></font></a>\";\r\n\r\n if (is_array($serverbits)){\r\n\r\n for ($srvbitcnt=0;$srvbitcnt < count($serverbits);$srvbitcnt++){\r\n \r\n $server_backup_status_id = $serverbits[$srvbitcnt]['id'];\r\n $record_contact_id_c = $serverbits[$srvbitcnt]['contact_id_c'];\r\n $record_account_id_c = $serverbits[$srvbitcnt]['account_id_c'];\r\n $server_backup_status = $serverbits[$srvbitcnt]['name']; // 1/0\r\n \r\n $edit = \"\";\r\n $show_id = \"\";\r\n\r\n if ($auth == 3 || ($sess_account_id != NULL && $sess_account_id==$record_account_id_c)){\r\n $edit = \"<a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=edit&value=\".$server_backup_status_id.\"&valuetype=\".$valtype.\"&sendiv=INFRA');return false\\\"><font size=2 color=red><B>[\".$strings[\"action_edit\"].\"]</B></font></a> \";\r\n }\r\n\r\n if ($auth == 3){\r\n $show_id = \" | ID: \".$server_backup_status_id;\r\n } else {\r\n $show_id = \"\";\r\n }\r\n\r\n switch ($server_backup_status){\r\n\r\n case '':\r\n $server_status_show = \"NA\";\r\n $thisdivstyle_orange = $divstyle_grey;\r\n break;\r\n case '1':\r\n $server_status_show = \"OK\";\r\n $addserverbackup = \"\";\r\n $thisdivstyle_orange = $divstyle_blue;\r\n break;\r\n case '0':\r\n $server_status_show = \"NG\";\r\n $addserverbackup = \"\";\r\n $thisdivstyle_orange = $divstyle_orange;\r\n break;\r\n\r\n } // switch\r\n\r\n $filterimage_returner = $funky_gear->object_returner (\"ConfigurationItemTypes\", $serverbit_type_id);\r\n $image_url = $filterimage_returner[7];\r\n\r\n $servers .= \"<div style=\\\"\".$thisdivstyle_orange.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$subiconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$subrowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$server_status_show.\"<BR>\".$edit.\" <a href=\\\"#\\\" onClick=\\\"loader('INFRA');doBPOSTRequest('INFRA','Body.php', 'pc=\".$portalcode.\"&do=ConfigurationItems&action=view&value=\".$server_backup_status_id.\"&valuetype=ConfigurationItems&sendiv=INFRA');return false\\\"><font size=2 color=black><B>[\".$strings[\"action_view\"].\"]</B></font></a>\".$show_id.\" \".$addserverbackup.\"</div></div>\";\r\n\r\n } // for serverbits\r\n\r\n } else {// if array\r\n\r\n $server_status_show = \"NA\";\r\n $servers .= \"<div style=\\\"\".$divstyle_white.\"\\\"><div style=\\\"width:\".$subiconwidth.\";float:left;padding-top:\".$iconheight.\";\\\"><img src=\".$image_url.\" width=16></div><div style=\\\"width:\".$rowdivwidth.\";float:left;padding-top:2;margin-left:8;padding-left:2;\\\"><B>\".$label.\":</B> \".$server_status_show.\"<BR> \".$addserverbackup.\"</div></div>\";\r\n\r\n } // else array\r\n\r\n # End get server-related switches\r\n ##########################################\r\n\r\n return $servers;\r\n\r\n }", "function setServers()\n\t{\t\n\t\tglobal $db;\n\t\t\t\t\t\n\t\tif(DEBUG_MODE)\n\t\t{\n\t\t\techo '<pre>db array :: ';\n\t\t\tprint_r($db);\n\t\t}\n\t\t\n\t\t$data_city \t\t\t\t= ((in_array(strtolower($this->params['data_city']), $this->dataservers)) ? strtolower($this->params['data_city']) : 'remote');\n\t\t$this->idc_con\t\t\t= $db[strtolower($data_city)]['idc']['master'];\n\t\t$this->local_tme_conn\t= $db[strtolower($data_city)]['tme_jds']['master'];\n\t\t$this->local_d_jds\t\t= $db[strtolower($data_city)]['d_jds']['master'];\n\t\t$this->local_iro_conn\t= $db[strtolower($data_city)]['db_iro']['master'];\n\t\t$this->fin_con\t\t\t= $db[strtolower($data_city)]['fin']['master'];\n\t\t\n\t}", "abstract protected function setupServers();", "private function getInstances($opt)\n\t{\t\t\n\t\t$success = false;\n\n\t\t// Loop until the server's id is known (loop is a failsafe)\n\t\twhile(!$success)\n\t\t{\n\t\t\t// Get info on all worker instances\n\t\t\t$this->response = $this->ec2->describe_instances($opt);\t\t\n\n\t\t\t// If request was successful\n\t\t\tif($this->response->isOK())\n\t\t\t{\n\t\t\t\t// Break the while loop\n\t\t\t\t$success = true;\n\t\t\t}\t\n\t\t\t// Request failed\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"instance description problem. sleeping...\";\n\n\t\t\t\t// Wait 10 seconds before trying again.\n\t\t\t\tsleep(10);\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\t\n\n\t\t// Return instance objects\n\t\treturn $this->response->body->reservationSet;\n\t}", "function search()\n\t{}", "function search()\n\t{}", "public function fetchServers()\n {\n $servers = $this->pdo->query(\"SELECT * FROM `server` ORDER BY id ASC\")->fetchAll();\n if (empty($servers))\n return [];\n\n // Select counts of snapshots received by each server\n $counts = [];\n $query = \"SELECT `serverid`, COUNT(*) AS `count` FROM `round_history` GROUP BY `serverid`\";\n $res = $this->pdo->query($query)->fetchAll();\n foreach ($res as $row)\n {\n $key = (int)$row['serverid'];\n $counts[$key] = (int)$row['count'];\n }\n\n for ($i = 0; $i < count($servers); $i++)\n {\n $key = (int)$servers[$i]['id'];\n $servers[$i]['snapshots'] = (!isset($counts[$key])) ? 0 : $counts[$key];\n }\n\n return $servers;\n }", "static public function getServers() {\n\t\tself::loadSettings();\n\t\treturn self::$servers;\n\t}", "protected function ping_search_engines() {\n\n\t\t\\WPSEO_Sitemaps::ping_search_engines();\n\n\t}", "public function servers()\n\t{\n\t\treturn $this->hasMany('Dodona\\Server');\n\t}", "public function actionSearch($info){\n $cl = new SphinxClient();\n $cl->SetServer ( '127.0.0.1', 9312);\n//$cl->SetServer ( '10.6.0.6', 9312);\n//$cl->SetServer ( '10.6.0.22', 9312);\n//$cl->SetServer ( '10.8.8.2', 9312);\n $cl->SetConnectTimeout ( 10 );\n $cl->SetArrayResult ( true );\n// $cl->SetMatchMode ( SPH_MATCH_ANY);\n $cl->SetMatchMode ( SPH_MATCH_EXTENDED2);\n $cl->SetLimits(0, 1000);\n// $info = '戴尔';\n $res = $cl->Query($info, 'goods');//shopstore_search\n//print_r($cl);\n// print_r($res);\n// var_dump($res);exit;\n if (isset($res)){\n $ids=[];\n foreach ($res['matches'] as $r){\n $ids[] = $r['id'];\n }\n $pager = new Pagination();\n $pager->totalCount = Goods::find()->where(['in','id',$ids])->count();\n $pager->defaultPageSize = 4;\n $goods = Goods::find()->where(['in','id',$ids])->andWhere(['status'=>1])->offset($pager->offset)->limit($pager->limit)->all();\n //实例化表单模型\n// var_dump($ids);exit;\n// $goods = Goods::find()->where(['goods_category_id'=>$parent_id])->andWhere(['status'=>1])->all();\n// var_dump($pager);exit;\n return $this->render('/list/index',['goods'=>$goods,'pager'=>$pager]);\n\n\n }else{\n\n }\n }", "function searchByInfo($array){\n\t\t$sql = \"SELECT * FROM Client WHERE\";\n\t\t$keys = array_keys($array);\n\t\tfor ($i = 0; $i< count($keys); $i++){\n\t\t\tif ($i==0){\n\t\t\t\t$sql = $sql.\" \".$keys[$i].\" LIKE '\".$array[$keys[$i]].\"'\";\n\t\t\t} else {\n\t\t\t\t$sql = $sql.\" AND \".$keys[$i].\" LIKE '\".$array[$keys[$i]].\"'\";\n\t\t\t}\n\t\t}\n\t\t$result = mysql_query($sql) or die(mysql_error());\n\t\t$i = 0;\n\t\twhile ($info = mysql_fetch_array($result,MYSQL_ASSOC)){//While more results\n\t\t\t$toReturn[$i] = $info;\n\t\t\t$i++;\n\t\t}\n\t\treturn $toReturn;\n\t}", "public function testListServers()\n {\n }", "function setServers()\n\t{\t\n\t\tglobal $db;\n\t\t\t\n\t\t$conn_city \t\t= ((in_array(strtolower($this->data_city), $this->dataservers)) ? strtolower($this->data_city) : 'remote');\n\t\t\n\t\t$this->conn_iro \t\t= $db[$conn_city]['iro']['master'];\n\t\t$this->conn_local \t\t= $db[$conn_city]['d_jds']['master'];\n\t\t$this->conn_tme \t\t= $db[$conn_city]['tme_jds']['master'];\n\t\t$this->conn_idc \t\t= $db[$conn_city]['idc']['master'];\n\t\t\n\t\tif(($this->module =='DE') || ($this->module =='CS'))\n\t\t{\n\t\t\t$this->conn_temp\t \t= $this->conn_local;\n\t\t\t$this->conn_catmaster \t= $this->conn_local;\n\t\t}\n\t\telseif($this->module =='TME')\n\t\t{\n\t\t\t$this->conn_temp\t\t= $this->conn_tme;\n\t\t\t$this->conn_catmaster \t= $this->conn_local;\n\t\t\tif((in_array($this->ucode, json_decode(TME_MONGOUSER)) || TME_ALLUSER_MONGO == 1) && in_array(strtolower($conn_city), json_decode(MONGOCITY))){\n\t\t\t\t$this->mongo_tme = 1;\n\t\t\t}\n\n\t\t}\n\t\telseif($this->module =='ME')\n\t\t{\n\t\t\t$this->conn_temp\t\t= $this->conn_idc;\n\t\t\t$this->conn_catmaster \t= $this->conn_local;\n\t\t\tif((in_array($this->ucode, json_decode(MONGOUSER)) || ALLUSER == 1)){\n\t\t\t\t$this->mongo_flag = 1;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = \"Invalid Module.\";\n\t\t\techo json_encode($this->send_die_message($message));\n\t\t\tdie();\n\t\t}\t\t\n\t}", "public function getServerExtList()\n {\n }", "function loadServersFromMasterservers($versions = self::DEFAULT_VERSION) {\n\t\t\n\t\t/* if given, select all versions */\n\t\tif ($versions === self::ALL_VERSIONS) {\n\t\t\t$versions = $this->versions;\n\t\t}\n\t\t\n\t\t/* check versions */\n\t\t$versions = (array)$versions;\n\t\tforeach ($versions as $k => $version) {\n\t\t\tif (!in_array($version, $this->versions)) {\n\t\t\t\tunset($versions[$k]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* if none version, set to default */\n\t\tif (!count($versions)) {\n\t\t\t$versions = array(self::DEFAULT_VERSION);\n\t\t}\n\t\t\n\t\t/* plan connections */\n\t\t$connectionStack = array();\n\t\tforeach ($this->masterservers as &$masterserver) {\n\t\t\tforeach ((array)$versions as $version) {\n\t\t\t\t$connectionStack[] = array(&$masterserver, $version);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* define variables */\n\t\t$connections = array(); // to store the active connections\n\t\t$numConnections = 0; // number of connections (number of elements in $connections)\n\t\t$curConn = 0; // next position in the connection stack to handle\n\t\t\n\t\t/* additionally request the count of servers, to prevent the connection to wait for more servers than necessary */\n\t\t$connectionsSrvCount = array(); // to store the active connections for the server count request\n\t\t$numConnectionsSrvCount = 0; // number of connections for the server count request (number of elements in $this->masterservers)\n\t\t$curConnSrvCount = 0; // next position in the connection stack for the server count request to handle\n\t\t\n\t\t/* loop as long as there are master servers to wait for */\n\t\twhile ($numConnections > 0 || isset($connectionStack[$curConn])) {\n\t\t\t\n\t\t\t/* count request */\n\t\t\t\n\t\t\t/* build up connections until limit is reached */\n\t\t\tfor (; isset($this->masterservers[$curConnSrvCount]) && ($numConnections + $numConnectionsSrvCount) < self::MAX_CONNECTIONS_MASTER; $curConnSrvCount++) {\n\t\t\t\t\n\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffcou2\";\n\t\t\t\t\n\t\t\t\t$authority = $this->masterservers[$curConnSrvCount][0].':'.$this->masterservers[$curConnSrvCount][1];\n\t\t\t\t$connection = self::establishConnection($authority, $data);\n\t\t\t\t\n\t\t\t\t/* add to connection if not failed */\n\t\t\t\tif ($connection) {\n\t\t\t\t\t$connectionsSrvCount[$curConnSrvCount] = array($connection, &$this->masterservers[$curConnSrvCount], self::getTimeInMs());\n\t\t\t\t\t$numConnectionsSrvCount++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* save memory */\n\t\t\t\tunset($authority, $connection);\n\t\t\t}\n\t\t\t\n\t\t\t/* check for responses */\n\t\t\tforeach ($connectionsSrvCount as $n => $connection) {\n\t\t\t\t\n\t\t\t\t/* read data */\n\t\t\t\t$data = fread($connection[0], 16); // size = header_size + 2 = 16\n\t\t\t\t\n\t\t\t\t/* packet length */\n\t\t\t\t$datalen = strlen($data);\n\t\t\t\t\n\t\t\t\t/* check if data is usable, otherwise skip */\n\t\t\t\tif ($data === false || $datalen < 14 || substr($data, 0, 14) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffsiz2\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* analyse data */\n\t\t\t\t$connection[1]['num_servers'] = (ord($data[14]) << 8) | ord($data[15]);\n\t\t\t\t\t\t\n\t\t\t\t/* only one packet expected, so drop after one packet */\n\t\t\t\tunset($connectionsSrvCount[$n]);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/* drop connections that have timed out */\n\t\t\tforeach ($connectionsSrvCount as $n => $connection) {\n\t\t\t\tif ((self::getTimeInMs() - $connection[2]) >= self::TIMEOUT_MASTER) {\n\t\t\t\t\tunset($connectionsSrvCount[$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* renew connection counter */\n\t\t\t$numConnectionsSrvCount = count($connectionsSrvCount);\n\t\t\t\n\t\t\t/* server list request */\n\t\t\t\n\t\t\t/* build up connections until limit is reached */\n\t\t\tfor (; isset($connectionStack[$curConn]) && ($numConnections + $numConnectionsSrvCount) < self::MAX_CONNECTIONS_MASTER; $curConn++) {\n\t\t\t\t\n\t\t\t\tswitch ($connectionStack[$curConn][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffreqt\"; break;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffreq2\"; break;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$authority = $connectionStack[$curConn][0][0].':'.$connectionStack[$curConn][0][1];\n\t\t\t\t$connection = self::establishConnection($authority, $data);\n\t\t\t\t\n\t\t\t\t/* set loaded server counter */\n\t\t\t\tif (!isset($connectionStack[$curConn][0]['num_servers_loaded'])) {\n\t\t\t\t\t$connectionStack[$curConn][0]['num_servers_loaded'] = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* add to connection if not failed */\n\t\t\t\tif ($connection) {\n\t\t\t\t\t$connections[$curConn] = array($connection, &$connectionStack[$curConn], self::getTimeInMs());\n\t\t\t\t\t$numConnections++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* save memory */\n\t\t\t\tunset($authority, $connection);\n\t\t\t}\n\t\t\t\n\t\t\t/* check for responses */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\t\n\t\t\t\t/* read data */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t$data = fread($connection[0], 464); // size = header_size + max_servers_per_packet * server_size = 14 + 75 * 6 = 464\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t$data = fread($connection[0], 1364); // size = header_size + max_servers_per_packet * server_size = 14 + 75 * 18 = 1364\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* packet length */\n\t\t\t\t$datalen = strlen($data);\n\t\t\t\t\n\t\t\t\t/* check if data is usable, otherwise skip */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\tif ($data === false || $datalen < 14 || substr($data, 0, 14) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfflist\") {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\tif ($data === false || $datalen < 14 || substr($data, 0, 14) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfflis2\") {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* analyse data */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\t\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ($i = 14; ($i + 6) <= $datalen; $i += 6) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* IP */\n\t\t\t\t\t\t\t$ip = inet_ntop(substr($data, $i, 4));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* port (actually an array. the port is in $port[1]) */\n\t\t\t\t\t\t\t$port = unpack(\"v\", substr($data, $i + 4, 2));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->addServer($ip, $port[1], self::VERSION_05);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* increment server loaded counter */\n\t\t\t\t\t\t\t$connection[1][0]['num_servers_loaded']++;\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\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ($i = 14; ($i + 18) <= $datalen; $i += 18) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* switch between IPv4 and IPv6 */\n\t\t\t\t\t\t\tif (substr($data, $i, 12) === \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\") {\n\t\t\t\t\t\t\t\t$ip = inet_ntop(substr($data, $i + 12, 4)); // IPv4\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$ip = \"[\".inet_ntop(substr($data, $i, 16)).\"]\"; // IPv6\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* port (actually an array. the port is in $port[1]) */\n\t\t\t\t\t\t\t$port = unpack(\"n\", substr($data, $i + 16, 2));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->addServer($ip, $port[1], self::VERSION_06);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* increment server loaded counter */\n\t\t\t\t\t\t\t$connection[1][0]['num_servers_loaded']++;\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\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* if connection is finished drop it */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\tif ($datalen < 494) {\n\t\t\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\tif ($datalen < 1364) {\n\t\t\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/* drop connections that have timed out */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\tif ((self::getTimeInMs() - $connection[2]) >= self::TIMEOUT_MASTER) {\n\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* drop connections that have gathered enough servers */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\tif (!empty($connection[1][0]['num_servers']) && !empty($connection[1][0]['num_servers_loaded']) && $connection[1][0]['num_servers_loaded'] >= $connection[1][0]['num_servers']) {\n\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* renew connection counter */\n\t\t\t$numConnections = count($connections);\n\t\t\t\n\t\t\t/* sleep a bit */\n\t\t\tusleep(self::REQUEST_SLEEP * 1000);\n\t\t}\n\t\t\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function searchForPlayList();", "function check_server_name ($server,$dbh)\n{\n$check = $dbh->prepare('SELECT * FROM `servers` WHERE `server_name` = :server_name');\n$check->bindParam(':server_name', $server);\n$check->execute();\n$count = $check->rowCount();\nif ($count != \"0\")\n{\n\t$result = $check->fetch(PDO::FETCH_ASSOC);\n\treturn $result;\n} \n}", "function wp_smpro_servers() {\r\n\t$server_list = array(\r\n\t\t'https://smush1.wpmudev.com/',\r\n\t\t'https://smush2.wpmudev.com/',\r\n\t\t'https://smush3.wpmudev.com/',\r\n\t\t'https://smush4.wpmudev.com/',\r\n\t\t'https://smush5.wpmudev.com/',\r\n\t\t'https://smush6.wpmudev.com/',\r\n\t\t'https://smush7.wpmudev.com/',\r\n\t\t'https://smush8.wpmudev.com/',\r\n\t\t'https://smush9.wpmudev.com/',\r\n\t\t'https://smush10.wpmudev.com/'\r\n\t);\r\n\r\n\treturn $server_list;\r\n}", "public function findServicesByHost(Host $host): array;", "function emptyServers() {\n\t\t$this->servers = array();\n\t}", "public static function all($params = [], $options = []) {\n if (@$params['cursor'] && !is_string(@$params['cursor'])) {\n throw new \\Files\\InvalidParameterException('$cursor must be of type string; received ' . gettype(@$params['cursor']));\n }\n\n if (@$params['per_page'] && !is_int(@$params['per_page'])) {\n throw new \\Files\\InvalidParameterException('$per_page must be of type int; received ' . gettype(@$params['per_page']));\n }\n\n $response = Api::sendRequest('/remote_servers', 'GET', $params, $options);\n\n $return_array = [];\n\n foreach ($response->data as $obj) {\n $return_array[] = new RemoteServer((array)$obj, $options);\n }\n\n return $return_array;\n }", "function VM_getAllVMHosts($VM_software)\n{\n\tCHECK_FW(CC_vmsoftware, $VM_software);\n\t$res = db_query(\"SELECT `client` FROM `clients` WHERE (`vmSoftware` & $VM_software ) = $VM_software AND (`vmRole` & \".VM_ROLE_HOST.\") = \".VM_ROLE_HOST); //FW ok\n\n\twhile ($row = mysql_fetch_row($res))\n\t\t$out[$row[0]] = $row[0];\n\n\treturn($out);\n}", "protected function _serverInstances($serverId)\n {\n return static::findServerInstances($serverId);\n }", "public function seachMatchAll(){\n\t\t $query = $this->getDbTable()->select()\n\t\t ->from(array('b' => 'tbteam'),array('home'=>'b.team'))\n ->joinInner(array('a' => 'tbmatch'),'a.idHomeTeam=b.id',array('a.id','a.goalHomeTeam','a.goalVisitorTeam','a.date','a.round'))\n ->joinInner(array('c' => 'tbteam'),'c.id=a.idVisitorTeam',array('visitor'=>'c.team'))\n ->order('a.round')\n ->setIntegrityCheck(false);\n return $this->getDbTable()->fetchAll($query);\n\t}", "private function lookupInstances()\n {\n\n /** Sample output (truncated):\n * {\n * \"Reservations\": [\n * {\n * \"Groups\": [],\n * \"Instances\": [\n * {\n * \"AmiLaunchIndex\": 0,\n * \"ImageId\": \"ImageId\",\n * \"InstanceId\": \"InstanceId\",\n * \"InstanceType\": \"t3.xlarge\",\n * \"KeyName\": \"KeyName\",\n * ...\n * \"PrivateIpAddress\": \"999.999.999.999\",\n * ...\n * \"Tags\": [\n * {\n * \"Key\": \"Key\",\n * \"Value\": \"owned\"\n * },\n * {\n * \"Key\": \"Name\",\n * \"Value\": \"Value\"\n * }\n * ],\n * ...\n * }\n * ],\n * \"OwnerId\": \"OwnerId\",\n * \"ReservationId\": \"ReservationId\"\n * }\n * ]\n * }\n */\n $response = shell_exec(\n vsprintf(\n '%s %s %s --region %s --instance-ids %s',\n [\n $this->aws,\n 'ec2',\n 'describe-instances',\n $this->region,\n implode(' ', array_keys($this->instance_ids)),\n ]\n )\n );\n $response = json_decode($response);\n\n $server_ips = [];\n foreach ($response->Reservations as $instance) {\n $server_name = '';\n foreach ($instance->Instances[0]->Tags as $tag) {\n if ($tag->Key == 'Name') {\n $server_name = $tag->Value;\n }\n }\n $server_ips[$server_name] = $instance->Instances[0]->PrivateIpAddress;\n }\n ksort($server_ips);\n\n $this->message('Looked up the Instance IP\\'s:', [], 1);\n foreach ($server_ips as $name => $ip) {\n $this->message('%s = %s', [$ip, $name], 2);\n }\n }", "function find_MODEL($list) {\n while($server = $list->Next()) {\n if ($server->name == 'MODEL')\n return $server;\n }\n die(\"Can't find the MODEL server\\n\");\n}", "function loadServerInfo() {\n\t\t\n\t\t/* define variables */\n\t\t$connections = array(); // to store the active connections\n\t\t$numConnections = 0; // number of connections (number of elements in $connections)\n\t\t$curServer = 0; // next position in the server array to handle\n\t\t\n\t\t/* loop as long as there are master servers to wait for */\n\t\twhile ($numConnections > 0 || isset($this->servers[$curServer])) {\n\t\t\t\n\t\t\t/* build up connections until limit is reached */\n\t\t\tfor (; isset($this->servers[$curServer]) && $numConnections < self::MAX_CONNECTIONS_SERVER; $curServer++) {\n\t\t\t\t\n\t\t\t\tswitch ($this->servers[$curServer][2]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffgief\"; break;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffgie3\\x05\"; break;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$authority = $this->servers[$curServer][0].':'.$this->servers[$curServer][1];\n\t\t\t\t$connection = self::establishConnection($authority, $data);\n\t\t\t\t\n\t\t\t\t/* add to connection if not failed */\n\t\t\t\tif ($connection) {\n\t\t\t\t\t$connections[$curServer] = array($connection, &$this->servers[$curServer], self::getTimeInMs());\n\t\t\t\t\t$numConnections++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* save memory */\n\t\t\t\tunset($authority, $connection);\n\t\t\t}\n\t\t\t\n\t\t\t/* check for responses */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\t\n\t\t\t\t/* read data */\n\t\t\t\tswitch ($connection[1][2]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t$data = fread($connection[0], 2048); // TODO: find out how great it really can be\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t$data = fread($connection[0], 2048); // by my calc the max size is 850, but trying to read more doesn't harm\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* packet length */\n\t\t\t\t$datalen = strlen($data);\n\t\t\t\t// var_dump($datalen);\n\t\t\t\t\n\t\t\t\t/* check if data is usable, otherwise skip */\n\t\t\t\tswitch ($connection[1][2]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\tif ($data === false || $datalen < 14 || substr($data, 0, 14) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffinfo\") {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\tif ($data === false || $datalen < 15 || substr($data, 0, 15) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffinf35\") {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* analyse data */\n\t\t\t\tswitch ($connection[1][2]) {\n\t\t\t\t\t\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data = explode(\"\\x00\", $data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$connection[1]['version'] = substr((string)$data[0], 14);\n\t\t\t\t\t\t$connection[1]['name'] = (string)$data[1];\n\t\t\t\t\t\t$connection[1]['map'] = (string)$data[2];\n\t\t\t\t\t\t$connection[1]['gametype'] = (string)$data[3];\n\t\t\t\t\t\t$flags = (int)$data[4];\n\t\t\t\t\t\t$connection[1]['password'] = (($flags & self::SERVER_FLAG_PASSWORD) === self::SERVER_FLAG_PASSWORD);\n\t\t\t\t\t\t$connection[1]['progression'] = (int)$data[5];\n\t\t\t\t\t\t$connection[1]['num_players'] = (int)$data[6];\n\t\t\t\t\t\t$connection[1]['max_players'] = (int)$data[7];\n\t\t\t\t\t\t$connection[1]['ping'] = (int)(self::getTimeInMs() - $connection[2]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$connection[1]['players'] = array();\n\t\t\t\t\t\tfor ($i = 8; isset($data[$i+2]); $i += 2) {\n\t\t\t\t\t\t\t$player = array();\n\t\t\t\t\t\t\t$player['name'] = (string)$data[$i];\n\t\t\t\t\t\t\t$player['score'] = (int)$data[$i+1];\n\t\t\t\t\t\t\t$connection[1]['players'][] = $player;\n\t\t\t\t\t\t}\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\tcase self::VERSION_06:\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data = explode(\"\\x00\", $data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$connection[1]['version'] = (string)$data[1];\n\t\t\t\t\t\t$connection[1]['name'] = (string)$data[2];\n\t\t\t\t\t\t$connection[1]['map'] = (string)$data[3];\n\t\t\t\t\t\t$connection[1]['gametype'] = (string)$data[4];\n\t\t\t\t\t\t$flags = (int)$data[5];\n\t\t\t\t\t\t$connection[1]['password'] = (($flags & self::SERVER_FLAG_PASSWORD) === self::SERVER_FLAG_PASSWORD);\n\t\t\t\t\t\t$connection[1]['num_players'] = (int)$data[8];\n\t\t\t\t\t\t$connection[1]['max_players'] = (int)$data[9];\n\t\t\t\t\t\t$connection[1]['num_players_ingame'] = (int)$data[6];\n\t\t\t\t\t\t$connection[1]['max_players_ingame'] = (int)$data[7];\n\t\t\t\t\t\t$connection[1]['ping'] = (int)(self::getTimeInMs() - $connection[2]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$connection[1]['players'] = array();\n\t\t\t\t\t\tfor ($i = 10; isset($data[$i+4]); $i += 5) {\n\t\t\t\t\t\t\t$player = array();\n\t\t\t\t\t\t\t$player['name'] = (string)$data[$i];\n\t\t\t\t\t\t\t$player['clan'] = (string)$data[$i+1];\n\t\t\t\t\t\t\t$player['country'] = (int)$data[$i+2];\n\t\t\t\t\t\t\t// $player['countrydata'] = self::getCountry($player['country']);\n\t\t\t\t\t\t\t$player['score'] = (int)$data[$i+3];\n\t\t\t\t\t\t\t$player['ingame'] = (bool)$data[$i+4];\n\t\t\t\t\t\t\t$connection[1]['players'][] = $player;\n\t\t\t\t\t\t}\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\t\n\t\t\t\t/* drop it, because there comes only one packet to analyse */\n\t\t\t\tunset($connections[$n]);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/* drop connections that have timed out */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\tif ((self::getTimeInMs() - $connection[2]) >= self::TIMEOUT_SERVER) {\n\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* renew connection counter */\n\t\t\t$numConnections = count($connections);\n\t\t\t\n\t\t\t/* sleep a bit */\n\t\t\tusleep(self::REQUEST_SLEEP * 1000);\n\t\t}\n\t\t\n\t}", "public function getServers(){\n\t\t\n\t\ttry{\n\t\t\t$result = $this->showTableAssoc('Server');\n\t\t\t$cols = $this->getColumns('Server');\n\t\t\t\n\t\t\tif($result){\n\n\t\t\t\techo \"<table id='server-table'>\";\n\n\t\t\t\t\techo \"<tr id='server-headers'>\";\n\t\t\t\t\t\techo \"<th>Server Name</th>\";\n\t\t\t\t\t\techo \"<th>Location</th>\";\n\t\t\t\t\t\techo \"<th>Players</th>\";\n\t\t\t\t\t\techo \"<th>Current Status</th>\";\n\t\t\t\t\t\techo \"<th>Select</th>\";\n\t\t\t\t\techo \"</tr>\";\n\n\t\t\t\t\t//Prints a table row for every server\n\t\t\t\t\tforeach ($result as $row) {\n\n\t\t\t\t\t\t//Gets the number of players currently in each server\n\t\t\t\t\t\t$numPlayers = $this->serverPlayers($row['ServerId']);\n\t\t\t\t\t\t//If there are players in the server, assign that number to numPlayers\n\t\t\t\t\t\tif($numPlayers){\n\t\t\t\t\t\t\t$numPlayers = $this->serverPlayers($row['ServerId']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$numPlayers = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\t\techo \"<form id='server-form' method='POST' action='game.php'>\";\n\t\t\t\t\t\t\t\techo \"<td>\".$row['ServerName'].\"</td>\";\n\t\t\t\t\t\t\t\techo \"<td>\".$row['Location'].\"</td>\";\n\t\t\t\t\t\t\t\techo \"<td>\".$numPlayers.\"/5</td>\";\n\t\t\t\t\t\t\t\techo \"<td>\".$row['CurrentStatus'].\"</td>\";\n\t\t\t\t\t\t\t\techo \"<input type='hidden' name='serverAddress' value='\".$row['ServerAddress'].\"'>\";\n\t\t\t\t\t\t\t\techo \"<input type='hidden' name='serverPort' value='\".$row['ServerPort'].\"'>\";\n\n\t\t\t\t\t\t\t\t//If the server is offline or in game, the join button will not be displayed\n\t\t\t\t\t\t\t\tif (strtolower($row['CurrentStatus']) == \"offline\" || strtolower($row['CurrentStatus']) == \"in game\") {\n\t\t\t\t\t\t\t\t\techo \"<td>Unavailable</td>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\techo \"<td><input type='submit' class='server-submit' name='server-submit' value=''></td>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo \"</form>\";\n\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t}\n\n\t\t\t\techo \"</table>\";\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"There are no Servers to show\";\n\t\t\t}\n\t\t}\n\t\tcatch(PDOException $exception){\n\t\t\techo \"Error: \". $exception->getMessage();\n\t\t}\n\t}", "public function searchAll($input)\n {\n \n }", "public static function provideServerURLs () : iterable {\n yield [[], \"http://localhost\"];\n yield [[\"UNRELATED\" => \"ANYTHING\"], \"http://localhost\"];\n\n yield [\n [\n \"SERVER_PORT\" => \"80\",\n \"SERVER_NAME\" => \"acme.tld\",\n ],\n \"http://acme.tld\"\n ];\n\n yield [\n [\n \"SERVER_PORT\" => \"443\",\n \"SERVER_NAME\" => \"acme.tld\",\n ],\n \"https://acme.tld\"\n ];\n\n yield [\n [\n \"SERVER_PORT\" => \"80\",\n \"SERVER_NAME\" => \"acme.tld\",\n \"HTTP_X_FORWARDED_PROTO\" => \"https\",\n ],\n \"https://acme.tld\"\n ];\n\n yield [\n [\n \"SERVER_PORT\" => \"80\",\n \"SERVER_NAME\" => \"acme.tld\",\n \"HTTP_FORWARDED\" => \"for=192.0.2.43, for=\\\"[2001:db8:cafe::17]\\\", proto=https, by=203.0.113.43\",\n ],\n \"https://acme.tld\"\n ];\n\n yield [\n [\n \"SERVER_PORT\" => \"8443\",\n \"SERVER_NAME\" => \"acme.tld\",\n \"HTTPS\" => \"on\",\n ],\n \"https://acme.tld:8443\"\n ];\n\n\n }", "function post_search(){\n global $cfg, $db, $libhtml;\n\n $html = '';\n $tables_already_searched = array();\n foreach($_SESSION[\"apps\"] as $my_apps){\n if (!empty($my_apps->path) && (!in_array(str_replace(\"/\", \"\", $my_apps->path), $this->exclude_apps))) {\n\n foreach(glob($cfg[\"source_root\"] . $my_apps->path . \"classes/*.php\") as $object) {\n\n $where = array(\"\", array(), array()); // used for query\n $where_in = array();\n $object_name = str_replace(array($cfg[\"source_root\"] . $my_apps->path . \"classes/\", \".php\"), array(\"\", \"\"), $object);\n\n if (!in_array($object_name, $this->exclude_objects)) {\n $object = new $object_name;\n\n if (!empty($object->table) && !in_array($object->table, $tables_already_searched)) {\n $tables_already_searched[] = $object->table;\n\n // get all varchar & text fields in these searchable tables\n $columns = $db->get_table_column_metadata($object->table);\n foreach($columns as $column){\n //error_log(print_r($column, true));\n if ($column->DATA_TYPE == \"text\" || $column->DATA_TYPE == \"varchar\"){\n //$where_in[0] .= \"t.\".$column->COLUMN_NAME.\" LIKE '%\".my_request(\"keyword\").\"%'\";\n $where_in[] = \" t.\".$column->COLUMN_NAME.\" LIKE ?\";\n $where[1][$column->COLUMN_NAME] = \"%\" . my_request(\"keyword\") . \"%\";\n $where[2][] = 'varchar';\n }\n }\n $where[0] = \"WHERE \" . implode(\" OR \", $where_in);\n\n // dump_var($object->table);\n // dump_var(print_r($where_in, true));\n\n // if there are varchar / text fields do ...\n if (!empty($where_in)) {\n // list object\n $tmphtml = $object->_list(array(\n //'where'=>\" AND ( \" . implode(\" OR \", $where_in) . \" )\"\n 'where' => $where,\n 'width'=>\"100%\",\n 'quick_search'=>true,\n 'app_path'=> $my_apps->path, // needed for _list edit action\n 'view'=>true,\n 'xml_export'=>false,\n 'pdf_export'=>false,\n 'csv_export'=>false,\n 'email_alert'=>false,\n 'dynamic_append'=>false,\n 'pagination'=>false,\n 'edit'=>false,\n 'delete'=>false,\n ));\n\n // do not show empty messages\n //if (strpos($tmphtml, \"No items found\") === false) {\n if ($object->list_total>0) {\n\n $res = ($object->list_total>1) ? \"results\" : \"result\";\n $truncate = ($object->list_total>500) ? \", truncated to first 500\" : '';\n\n $html .= section(array(\n \"title\"=>$my_apps->name . \" - \". ucwords(str_replace(\"_\", \" \", $object_name)). \" (\".$object->list_total.\" \".$res.$truncate.\")\",\n \"collapsible\"=>true,\n \"state\"=>\"collapsed\",\n \"to_top\"=>true\n ));\n\n $html .= $tmphtml;\n }\n }\n\n }\n }\n }\n }\n }\n\n // do not show empty results\n if (empty($html)) return '<div class=\"success\">Search returned no results.</div>';\n else return $html;\n\n }", "public function match(ServerRequestInterface $request);", "protected function listClients() {\n\n\t\ttry {\n\n\t\t\t$clients = ConnectContentClient::where('station_id', '=', \\Auth::User()->station->id);\n\n\t\t\t$search_manager_user_id = Request::input('search_manager_user_id');\n\t\t\t$search_agency_id = Request::input('search_agency_id');\n\t\t\t$search_content_client = Request::input('search_content_client');\n\t\t\t$search_content_product = Request::input('search_content_product');\n\n\t\t\t//For searching client trading name & company name by ad who\n\t\t\t$search_content_ad_who = Request::input('search_content_ad_who');\n\n\t\t\tif (!empty($search_manager_user_id)) {\n\t\t\t\t$clients = $clients->where('content_manager_user_id', '=', $search_manager_user_id);\n\t\t\t}\n\n\t\t\tif (!empty($search_agency_id)) {\n\t\t\t\t$clients = $clients->where('content_agency_id', '=', $search_agency_id);\n\t\t\t}\n\n\t\t\tif (!empty($search_content_client)) {\n\t\t\t\t$clients = $clients->where('client_name', 'LIKE', \"%$search_content_client%\");\n\t\t\t}\n\n\t\t\tif (!empty($search_content_ad_who)) {\n\t\t\t\t$client_words = explode(' ', $search_content_ad_who);\n\n\t\t\t\t//I am doing this query first so that the exact matches come before the fuzzy matches in the results list\n\t\t\t\t$clients_exact_match = \\DB::table('airshr_connect_content_clients')\n\t\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t\t->where(function($query) use ($search_content_ad_who) {\n\t\t\t\t\t\t$query->where('client_name', 'LIKE', \"%$search_content_ad_who%\")\n\t\t\t\t\t\t\t->orWhere('who', 'LIKE', \"%$search_content_ad_who%\");\n\t\t\t\t\t})->get();\n\n\t\t\t\t$clients_fuzzy_matches = [];\n\n\t\t\t\t$word_count = 0;\n\t\t\t\tforeach($client_words as $word) {\n\t\t\t\t\t$word_lower = strtolower($word);\n\t\t\t\t\t//If the\n\t\t\t\t\tif(in_array($word_lower, array('the', 'and', 'pty', 'ltd', 'p/l', 'of', 'a', 'in' ))) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$clients_fuzzy_raw = \\DB::table('airshr_connect_content_clients')\n\t\t\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t\t\t->where(function ($query) use ($word) {\n\t\t\t\t\t\t\t$query->where('who', 'LIKE', \"% $word\")\n\t\t\t\t\t\t\t\t->orWhere('who', 'LIKE', \"$word %\")\n\t\t\t\t\t\t\t\t->orWhere('who', 'LIKE', \"% $word %\")\n\t\t\t\t\t\t\t\t->orWhere('who', '=', $word)\n\t\t\t\t\t\t\t\t->orWhere('client_name', 'LIKE', \"% $word\")\n\t\t\t\t\t\t\t\t->orWhere('client_name', 'LIKE', \"$word %\")\n\t\t\t\t\t\t\t\t->orWhere('client_name', 'LIKE', \"% $word %\")\n\t\t\t\t\t\t\t\t->orWhere('client_name', '=', $word);\n\t\t\t\t\t\t})->get();\n\n\t\t\t\t\tforeach($clients_fuzzy_raw as $client) {\n\t\t\t\t\t\t$clients_fuzzy_matches[] = $client;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$results = [];\n\t\t\t\t$clientsArray = array_unique(array_merge($clients_exact_match,$clients_fuzzy_matches), SORT_REGULAR);\n\n\t\t\t\tforeach($clientsArray as $client) {\n\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t'id'\t\t\t\t\t=> $client->id,\n\t\t\t\t\t\t'client_name'\t\t\t=> $client->client_name,\n\t\t\t\t\t\t'trading_name'\t\t\t=> $client->who\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn response()->json(array('data' => $results));\n\t\t\t}\n\n\t\t\tif (!empty($search_content_product)) {\n\t\t\t\t$clients = $clients->whereHas('clientProduct', function($q){\n\t\t\t\t\t$q->where('product_name', '=', Request::input('search_content_product'));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t$clients = $clients->with('clientProduct')->get();\n\n\t\t\treturn response()->json(array('data' => ConnectContentClient::getArrayListForClientsTable($clients)));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('data' => array()));\n\t\t}\n\n\t}", "public function __construct($server, $channel, $keywords) {\n\t\t$keywords = preg_replace(\"/( )+/\", \" \", $keywords);\n\t\t$keywords = preg_replace(\"/ $/\", \"\", $keywords);\n\t\t$keywords = preg_replace(\"/^ /\", \"\", $keywords);\n\t\t\t\t\t\t\n\t\t$baseLogDir = $GLOBALS['irc-logviewer-config']['irc-logviewer']['irc_log_dir'];\n\n\t\t// This will throw an exception if the $server or $channel names are not valid\n\t\tPathValidator::validateChannelLogDir($baseLogDir, $server, $channel);\n\n\t\t// Loop through each file in the log diretory and look for matches using searchInFile()\n\t\t// If a match is found a SearchResult object will be pushed into $this->searchResults\n\t\t$logDir = $baseLogDir.\"/\".addslashes($server).\"/\".addslashes($channel);\t\n\t\t$dirHandle = opendir($logDir);\n\t\t$i = 0;\n\t\twhile(($filename = readdir($dirHandle)) !== false) {\n\t\t\tif(substr($filename, 0, 1) != \".\") { // Don't include hidden directories (i.e. beginning with a \".\")\n\t\t\t\tif (is_file($logDir.\"/\".$filename)) { // Only open files\t\n\t\t\t\t\t$searchResult = $this->searchInFile($logDir, $filename, $keywords);\n\n\t\t\t\t\t// Push search result into search results if any keywords match\n\t\t\t\t\tif (count($searchResult->keywords) > 0)\n\t\t\t\t\t\tarray_push($this->searchResults, $searchResult);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\tclosedir($dirHandle);\t\t\n\t\n\t\t// Sort all conversations by score (those with the highest score first)\n\t\t// TODO: Support additional sort methods and formward/reverse sorting.\n\t\tfunction sortByScore($a, $b) {\n\t\t\tif ($a->keywordScore == $b->keywordScore)\n\t\t\t\treturn 0;\t\n\t\t\t\t\n\t\t\treturn ($a->keywordScore < $b->keywordScore) ? -1 : 1;\n\t\t}\t\n\t\tusort($this->searchResults, \"sortByScore\");\t\t\t\t\n\t\t$this->searchResults = array_reverse($this->searchResults);\n\n\t\treturn $this->searchResults;\n\t}", "public function virtualServers()\n {\n return $this->hasMany(VirtualServer::class)->get();\n }", "public function findServices(): array;", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function index(Request $request)\n {\n $searchParams = $request->all();\n $userQuery = ServerTypes::query();\n $limit = Arr::get($searchParams, 'limit', static::ITEM_PER_PAGE);\n $keyword = Arr::get($searchParams, 'keyword', '');\n\n if (!empty($keyword)) {\n $userQuery->where('name', 'LIKE', '%' . $keyword . '%');\n $userQuery->orWhere('description', 'LIKE', '%' . $keyword . '%');\n $userQuery->orWhere('permission', 'LIKE', '%' . $keyword . '%');\n }\n\n return ServerResource::collection($userQuery->paginate($limit));\n }", "public static function getServersList()\n {\n return CHtml::listData(self::model()->findAll(), 'host', 'host');\n }", "public function qrAllClients(string $needle): array{\n $this->checkNotConnected();\n $qr_all = $this->connection->query(\"SELECT * FROM tb_clients WHERE cd_client LIKE \\\"%$needle%\\\";\");\n $results = [];\n while($row = $qr_all->fetch_array()) $results[] = $row;\n return $results;\n }", "function sbn_search($ccl_query) {\n global $_SBN;\n // let YAZ parse the query and check for error\n $result = yaz_ccl_parse($this->conn, $ccl_query, $ccl_result);\n if (!$result) {\n throw new sbn_exception(\"La query non puo' essere processata\");\n } else {\n // fetch RPN result from the parser\n $rpn = $ccl_result[\"rpn\"];\n // do the actual query\n yaz_search($this->conn, \"rpn\", $rpn);\n // wait blocks until the query is done\n yaz_wait();\n if (yaz_error($this->conn) != \"\") {\n throw new sbn_exception(\"Error: \" . yaz_error($this->conn).\"<br>\");\n }\n // yaz_hits returns the amount of found records\n /*\n $hits = yaz_hits($this->conn);\n if ($hits > 0) {\n //echo \"Found \".$hits .\" hits:<br>\";\n // yaz_record fetches a record from the current result set,\n // so far I've only seen server supporting string format\n //$result = yaz_record($this->conn, 1, \"string\");\n //print($result);\n //echo \"<br><br>\";\n // the parsing functions will be introduced later\n /*\n if ($_SBN['syntax'] == \"mab\") {\n $parsedResult = parse_mab_string($result);\n } else {\n $parsedResult = parse_usmarc_string($result);\n }\n print_r($parsedResult);\n } else {\n echo \"No records found.\";\n }\n */\n }\n }", "public function servers(bool $returnRaw = false, bool $forceRefresh = false) : array {\n $servers = $this->sendGetXmlRequest($this->resolvePlexResource('servers.xml', 'pms'), function(array $response) : array {\n $servers = [];\n if (array_key_exists('@attributes', $response['Server'])) {\n (new Servers)->extractServerInformation($servers, $response['Server']['@attributes']);\n } else {\n foreach ($response['Server'] as $server) {\n (new Servers)->extractServerInformation($servers, $server['@attributes']);\n }\n }\n return $servers;\n });\n\n if ($returnRaw) {\n return $servers['data'];\n }\n return $servers;\n }" ]
[ "0.6328891", "0.6159175", "0.6031785", "0.60252464", "0.60035414", "0.59891087", "0.5899998", "0.58577555", "0.5857028", "0.5781194", "0.5718508", "0.5655461", "0.56203425", "0.56083226", "0.55688906", "0.5433788", "0.5433788", "0.54337287", "0.54129434", "0.53911537", "0.53537834", "0.5340163", "0.53370625", "0.5336306", "0.53339833", "0.5254599", "0.52525425", "0.5245387", "0.5233498", "0.52255946", "0.52081007", "0.5200372", "0.51932496", "0.518785", "0.5173259", "0.5117769", "0.5113062", "0.5098025", "0.5098025", "0.5068934", "0.5067236", "0.50638723", "0.50538516", "0.5042846", "0.50337946", "0.5009681", "0.5006271", "0.49859214", "0.49715754", "0.4970781", "0.49678952", "0.49579072", "0.4952122", "0.49460304", "0.49390855", "0.4937546", "0.4923583", "0.49222225", "0.4920181", "0.49122086", "0.49108487", "0.48865974", "0.48836648", "0.48778751", "0.4869071", "0.48565364", "0.48519593", "0.48428097", "0.48411563", "0.4840966", "0.48350492", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.4832634", "0.48325267", "0.48324916", "0.48312774", "0.4825856", "0.4824552" ]
0.0
-1
Generate a column type for a CREATE TABLE or ALTER TABLE
public function columnType($name, $type) { $sqlType = 'TEXT'; switch ($type) { case 'primaryKey': $sqlType = 'SERIAL PRIMARY KEY'; break; case 'boolean': $sqlType = 'BOOLEAN'; break; case 'integer': $sqlType = 'INTEGER'; break; case 'decimal': case 'numeric': $sqlType = 'DECIMAL(10,2)'; break; case 'float': $sqlType = 'REAL'; break; case 'binary': $sqlType = 'BYTEA'; break; case 'string': $sqlType = 'VARCHAR(255)'; break; case 'date': $sqlType = 'DATE'; break; case 'datetime': $sqlType = 'TIMESTAMP'; break; case 'time': $sqlType = 'TIME'; break; } return sprintf('%s %s', $this->escapeIdentifier($name), $sqlType ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeColumn(): string\n {\n if (! isset($this->typeColumn)) {\n return 'type';\n }\n\n return $this->typeColumn;\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 columnTypes(): array\n {\n return [\n 'id' => '{{ name }} INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE',\n 'varchar' => '{{ name }} TEXT {{ null }} {{ default }} {{ unique }}',\n 'text' => '{{ name }} TEXT {{ null }} {{ default }} {{ unique }}',\n 'int' => '{{ name }} INTEGER {{ null }} {{ default }} {{ unique }}',\n 'timestamp' => '{{ name }} INTEGER {{ null }} {{ default }} {{ unique }}'\n ];\n }", "public function getSQLDefinition()\n {\n // Index columns are always of the same type\n if ($this->columnName == IESDataColumnType::INDEX_COLUMN_NAME) {\n return \"{$this->columnName} INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY\";\n }\n\n $type = \"\";\n $nullSuffix = $this->nullable ? \"NULL\" : \"NOT NULL\";\n\n if ($this->dataType == IESDataColumnType::STRING) {\n $type = \"VARCHAR({$this->getColumnLength()})\";\n } else if ($this->dataType == IESDataColumnType::BOOLEAN) {\n $type = \"BIT\";\n } else if ($this->dataType == IESDataColumnType::FLOAT) {\n $type = \"DECIMAL(13,4)\";\n } else if ($this->dataType == IESDataColumnType::INTEGER) {\n $subType = $this->getIntegerSubType();\n\n if ($subType == IESDataColumnIntegerTypes::SIGNED_BYTE)\n $type = \"TINYINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_SHORT)\n $type = \"SMALLINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_INTEGER)\n $type = \"INTEGER SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_LONG)\n $type = \"BIGINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_BYTE)\n $type = \"TINYINT UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_SHORT)\n $type = \"SMALLINT UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_INTEGER)\n $type = \"INTEGER UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_LONG)\n $type = \"BIGINT UNSIGNED\";\n }\n\n return \"`{$this->columnName}` {$type} {$nullSuffix}\";\n }", "public function getColumnTypes();", "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 registerColumnTypes();", "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 static function ddl_column($name = NULL, $type = NULL)\n\t{\n\t\treturn new Database_SQLite_DDL_Column($name, $type);\n\t}", "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}", "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 }", "public static function getColumnTypes()\n {\n return array(\n 'bookId' => 'int',\n 'languageId' => 'int'\n );\n }", "public function getColumnType($name);", "public function getColumnType($name);", "public static function getColumnTypes() {\n\t\tstatic $types = array(\n\t\t\t'char' => 'CHAR',\n\t\t\t'string' => 'VARCHAR',\n\t\t\t'text' => 'TEXT',\n\t\t\t'mediumText' => 'MEDIUMTEXT',\n\t\t\t'longText' => 'LONGTEXT',\n\t\t\t'enum' => 'ENUM',\n\t\t\t'tinyBlob' => 'TINYBLOB',\n\t\t\t'blob' => 'BLOB',\n\t\t\t'mediumBlob' => 'MEDIUMBLOB',\n\t\t\t'longBlob' => 'LONGBLOB',\n\t\t\t'binary' => 'BINARY',\n\t\t\t'varbinary' => 'VARBINARY',\n\t\t\t'json' => 'JSON',\n\t\t\t'integer' => 'INT',\n\t\t\t'tinyInteger' => 'TINYINT',\n\t\t\t'smallInteger' => 'SMALLINT',\n\t\t\t'mediumInteger' => 'MEDIUMINT',\n\t\t\t'bigInteger' => 'BIGINT',\n\t\t\t'float' => 'FLOAT',\n\t\t\t'double' => 'DOUBLE',\n\t\t\t'decimal' => 'DECIMAL',\n\t\t\t'boolean' => 'BOOLEAN',\n\t\t\t'date' => 'DATE',\n\t\t\t'dateTime' => 'DATETIME',\n\t\t\t'time' => 'TIME',\n\t\t\t'timestamp' => 'TIMESTAMP',\n\t\t\t'year' => 'YEAR'\n\t\t);\n\n\t\treturn $types;\n\t}", "function addColumn($table, $name, $type);", "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 }", "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 }", "private static function get_column_type($table, $column)\n\t{\n\t\t$EE =& get_instance();\n\n\t\t$table = $EE->db->dbprefix($table);\n\n\t\t$column = $EE->db->escape($column);\n\n\t\t$query = $EE->db->query(\"SHOW COLUMNS FROM `$table` WHERE Field = $column\");\n\n\t\t$column_type = $query->row('Type') ? $query->row('Type') : 'TEXT';\n\n\t\tif ($query->row('Null') === 'NO')\n\t\t{\n\t\t\t$column_type .= ' NOT NULL';\n\t\t}\n\n\t\tif ($query->row('Default') !== NULL && $query->row('Default') !== 'NULL')\n\t\t{\n\t\t\t$column_type .= ' DEFAULT '.$EE->db->escape($query->row('Default'));\n\t\t}\n\n\t\tif ($query->row('Extra') === 'auto_increment')\n\t\t{\n\t\t\t$column_type .= ' AUTO_INCREMENT';\n\t\t}\n\n\t\t$query->free_result();\n\n\t\treturn $column_type;\n\t}", "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 createColumn(\n $table,\n $column,\n $datatype,\n $length = null,\n $default = null,\n $notnull = false,\n $primary = false\n )\n {\n\n $fullField = '';\n $column = $this->getDbAdapter()->quoteIdentifier($column);\n // switch statement for $datatype\n switch ($datatype) {\n case Core_Migration_Abstract::TYPE_VARCHAR:\n $length = $length ? $length : 255;\n $fullField .= \" VARCHAR($length)\";\n break;\n case Core_Migration_Abstract::TYPE_FLOAT:\n $length = $length ? $length : '0,0';\n $fullField .= \" FLOAT($length)\";\n break;\n //TODO ENUM!!!\n case Core_Migration_Abstract::TYPE_ENUM:\n if (is_array($length)) {\n $length = join(\",\", $length);\n }\n $fullField .= \" ENUM '\" . $length . \"'\";\n break;\n default:\n $fullField .= $datatype;\n break;\n }\n if (!is_null($default)) {\n // switch statement for $datatype\n switch ($datatype) {\n case (Core_Migration_Abstract::TYPE_TIMESTAMP) && ($default === 'CURRENT_TIMESTAMP'):\n $fullField .= \" DEFAULT CURRENT_TIMESTAMP\";\n break;\n default:\n $fullField .= ' DEFAULT '\n . $this->getDbAdapter()->quote($default);\n break;\n }\n }\n\n if ($notnull) {\n $fullField .= \" NOT NULL\";\n } else {\n $fullField .= \" NULL\";\n }\n\n //if column is a primary key or NOT NULL & Default is not set or not constant\n //in this case we must recreate table with new column\n if ($primary || ($notnull && (is_null($default) || $default === 'CURRENT_TIMESTAMP'))) {\n $fields = $this->getDbAdapter()->describeTable($table);\n $allCols = array();\n $collNames = array();\n foreach ($fields as $field => $options) {\n $collNames[] = $options['COLUMN_NAME'];\n\n $allCols[$field] = $this->getDbAdapter()->quoteIdentifier($options['COLUMN_NAME'])\n . ' ' . $options['DATA_TYPE'];\n\n if ($options['LENGTH']) {\n $allCols[$field] .= '(' . $options['LENGTH'] . ')';\n }\n if (!$options['NULLABLE']) {\n $allCols[$field] .= ' NOT NULL ';\n }\n if ($options['DEFAULT']) {\n $allCols[$field] .= \" DEFAULT \"\n . $this->getDbAdapter()->quote($options['DEFAULT']);\n }\n }\n\n //Full info about columns exept names\n $colls = join(',', $allCols);\n //Names of columns\n $collNames = $this->_quoteIdentifierArray($collNames);\n $table = $this->getDbAdapter()->quoteIdentifier($table);\n\n $newQuery = 'CREATE TEMPORARY TABLE t1_backup(' . $colls . ')';\n $this->query($newQuery);\n $newQuery = 'INSERT INTO t1_backup SELECT ' . $collNames\n . ' FROM ' . $table;\n $this->query($newQuery);\n $newQuery = 'DROP TABLE ' . $table;\n $this->query($newQuery);\n $newQuery = 'Create TABLE ' . $table .\n ' (' . $colls . ',' . $column . '\n ' . $fullField . ', PRIMARY KEY(id))';\n $this->query($newQuery);\n $newQuery = 'INSERT INTO ' . $table .\n ' (' . $collNames . ') SELECT ' . $collNames . ' FROM t1_backup';\n $this->query($newQuery);\n $newQuery = 'DROP TABLE t1_backup';\n $this->query($newQuery);\n\n /*@TODO: Get all indexes -> remove indexes -> create index\n * with a new column\n\n //indexes must have id\n if(sizeof($indexes) !== 1){\n $this->dropUniqueIndexes($table, $indexes);\n }\n array_push($indexes, $column);\n $this->createUniqueIndexes($table, $indexes);\n */\n } else {\n //just add a new column\n $table = $this->getDbAdapter()->quoteIdentifier($table);\n $query = 'ALTER TABLE ' . $table\n . ' ADD COLUMN ' . $column . $fullField;\n $this->query($query);\n }\n\n return $this;\n }", "public static function ddl_column($name = NULL, $type = NULL)\n\t{\n\t\treturn new Database_MySQL_DDL_Column($name, $type);\n\t}", "public static function getSchemaType($column)\n {\n // primary key\n if ($column->isPrimaryKey && $column->autoIncrement) {\n if ('bigint' === $column->type) {\n return 'bigInteger()';\n } elseif('smallint' === $column->type) {\n return 'smallInteger()';\n }\n return 'integer()';\n }\n\n // boolean\n if ('tinyint(1)' === $column->dbType) {\n return 'boolean()';\n }\n\n // smallint\n if ('smallint' === $column->type) {\n if (null === $column->size) {\n return 'smallInteger()';\n }\n return 'smallInteger';\n }\n\n // bigint\n if ('bigint' === $column->type) {\n if (null === $column->size) {\n return 'bigInteger()';\n }\n return 'bigInteger';\n }\n\n // enum\n if (null !== $column->enumValues) {\n // https://github.com/yiisoft/yii2/issues/9797\n $enumValues = array_map('addslashes', $column->enumValues);\n return \"enum(['\".implode('\\', \\'', $enumValues).\"'])\";\n }\n\n // others\n if (null === $column->size && 0 >= $column->scale) {\n return $column->type.'()';\n }\n\n return $column->type;\n }", "protected function defineColumn($field,$type=Type::TXT, $size=null, $isNullable = true, $isPK = false, $isAutoIncr =false)\r\n {\r\n //create new column object and add it to the cols array property\r\n $this->cols[$field] = new Column($field,$type, $size, $isNullable, $isPK, $isAutoIncr);\r\n }", "function generate_datatype($schema, $datatype, $epsg = 25832) {\n\t\t$sql = \"\n-- Create datatype {$datatype['type_name']}\nINSERT INTO datatypes (\n\t`name`,\n\t`schema`,\n\t`dbname`,\n\t`host`,\n\t`port`,\n)\nVALUES (\n\t'{$datatype['type']}',\n\t'{$schema}', -- schema\n\t'xplan_gml'\n\t'localhost',\n\t'5432'\n);\nSET @last_datatype_id_{$datatype['attribute_type_oid']} = LAST_INSERT_ID();\n\";\n\t\treturn $sql;\n\t}", "private static function add_column_pgsql($tablename, $sql_field_name, $type, $last_id)\n\t{\n\t\t// On construit le debut de la requete ALTER\n\t\t$sql_alter = 'ALTER TABLE ' . $tablename;\n\t\t\n\t\t// On recupere le nom du champ a creer, a partir de la derniere ID cree\n\t\t$sql_alter .= ' ADD ' . Fsb::$db->escape($sql_field_name . $last_id);\n\t\t\n\t\t// On cree le type du champ dans la requete\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase self::TEXT :\n\t\t\t\t$sql_alter .= ' VARCHAR(255)';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase self::TEXTAREA :\n\t\t\t\t$sql_alter .= ' TEXT';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase self::RADIO :\n\t\t\tcase self::SELECT :\n\t\t\t\t$sql_alter .= ' INT2';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase self::MULTIPLE :\n\t\t\t\t$sql_alter .= ' VARCHAR(255)';\n\t\t\tbreak;\n\t\t}\n\n\t\t// On lance la requete ALTER\n\t\tFsb::$db->query($sql_alter);\n\t}", "public function getCreate() {\n\t\tswitch ( $this->columnSchema[ self::COLUMN_DEFINITION_TYPE ] ) {\n\t\t\tcase self::COLUMN_TYPE_BIGINT:\n\t\t\tcase self::COLUMN_TYPE_INT:\n\t\t\tcase self::COLUMN_TYPE_MEDIUMINT:\n\t\t\tcase self::COLUMN_TYPE_SMALLINT:\n\t\t\tcase self::COLUMN_TYPE_TINYINT:\n\t\t\t\t$result = $this->createNumeric();\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_CHAR:\n\t\t\tcase self::COLUMN_TYPE_VARCHAR:\n\t\t\tcase self::COLUMN_TYPE_TEXT:\n\t\t\tcase self::COLUMN_TYPE_MEDIUMTEXT:\n\t\t\tcase self::COLUMN_TYPE_LONGTEXT:\n\t\t\t\t$result = $this->createString();\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_TIME:\n\t\t\tcase self::COLUMN_TYPE_DATETIME:\n\t\t\tcase self::COLUMN_TYPE_DATE:\n\t\t\t\t$result = $this->createDate();\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_BOOLEAN:\n\t\t\t\t$result = $this->createBoolean();\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_ENUM:\n\t\t\t\t$result = $this->createEnum();\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_SET:\n\t\t\t\t$result = $this->createSet();\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_FLOAT:\n\t\t\t\t$result = $this->createFloat();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//TODO\n\t\t\t\t$result = NULL;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $result;\n\t}", "function mscaffolding_get_type($type)\n\t{\n\t\tswitch($type)\n\t\t{\n\t\t\tcase \"string\":\n\t\t\t\treturn \" VARCHAR (255) CHARACTER SET utf8 COLLATE utf8_slovenian_ci NOT NULL,\";\n\t\t\tcase \"text\":\n\t\t\t\treturn \" TEXT CHARACTER SET utf8 COLLATE utf8_slovenian_ci NOT NULL,\";\n\t\t\tcase \"boolean\":\n\t\t\t\treturn \" TINYINT NOT NULL,\";\n\t\t\tcase \"integer\":\n\t\t\t\treturn \" INT NOT NULL,\";\n\t\t\tdefault:\n\t\t\t\treturn \" INT NOT NULL,\";\n\t\t}\n\t}", "public function make(array $columns, $type);", "abstract protected function makeColumn(string $table, DoctrineDBALColumn $column): Column;", "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 function loadColumnType($name);", "public function getTableDatatype()\r\n\t{\r\n\t\treturn $this->Table_Column->Table_Datatype;\r\n\t}", "public function getExtendedColumnTypes();", "function oci_field_type($statement, $field)\n{\n}", "public static function getDBColumnType($userField)\n\t{\n\t\tglobal $DB;\n\t\tswitch($DB->type)\n\t\t{\n\t\t\tcase \"MYSQL\":\n\t\t\t\treturn \"int(11)\";\n\t\t\tcase \"ORACLE\":\n\t\t\t\treturn \"number(18)\";\n\t\t\tcase \"MSSQL\":\n\t\t\t\treturn \"int\";\n\t\t}\n\t}", "function get_column_type ($table_name, $column_name) { \n\n\t$column_row_arr = NULL;\n\t\n\t// Get the array of meta data for the table\n\tlist($errArr, $columns_arr) = show_columns($table_name);\n if ( count($columns_arr) > 0) {\n \t// Loop through metadata\n \tforeach ($columns_arr as $columns_row)\n \t{\n \t\tif ($columns_row[DFT_FIELD] == $column_name) {\n \t\t\t$column_row_arr = $columns_row;\n \t\t\tbreak; // column name is found in meta data \n \t\t}\n \t}\n }\n\treturn $column_row_arr;\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 getDataType(): string\n {\n return $this->col->getAttribute('data-type');\n }", "protected function key(Table $table, Magic $command, $type)\n {\n return 'ALTER TABLE ' . $this->wrap($table) . ' ADD ' . $type . ' '\n . $command->name . '(' . $this->columnize($command->columns) . ')';\n }", "protected static function oci_getType($col)\n {\n throw new RuntimeException(\"no yet implemented\");\n /** @var array $exclusion type of columns that don't use size */\n $exclusion = ['int', 'long', 'tinyint', 'year', 'bigint', 'bit', 'smallint', 'float', 'money'];\n if (in_array($col['DATA_TYPE'], $exclusion) !== false) {\n return $col['DATA_TYPE'];\n }\n if ($col['NUMERIC_SCALE']) {\n $result = \"{$col['DATA_TYPE']}({$col['NUMERIC_PRECISION']},{$col['NUMERIC_SCALE']})\";\n } elseif ($col['NUMERIC_PRECISION'] || $col['CHARACTER_MAXIMUM_LENGTH']) {\n $result = \"{$col['DATA_TYPE']}(\" . ($col['CHARACTER_MAXIMUM_LENGTH'] + $col['NUMERIC_PRECISION']) . ')';\n } else {\n $result = $col['DATA_TYPE'];\n }\n\n return $result;\n }", "public function getBigIntTypeDeclarationSQL(array $columnDef) {\n // TODO: Implement getBigIntTypeDeclarationSQL() method.\n }", "public function AddColumn($name, $field, $type, $size, $isnull) {\n echo $type . \"\\n\";\n if (strcasecmp($type, 'VARCHAR') == 0) $q = \"ALTER TABLE $name ADD $field $type($size) CHARACTER SET utf8 COLLATE utf8_unicode_ci $isnull\";\n elseif (strcasecmp($type, 'TEXT') == 0) $q = \"ALTER TABLE $name ADD $field $type CHARACTER SET utf8 COLLATE utf8_unicode_ci $isnull\";\n elseif (strcasecmp($type, 'DATETIME') == 0) $q = \"ALTER TABLE $name ADD $field $type $isnull\";\n else $q = \"ALTER TABLE $name ADD $field $type($size) $isnull\";\n //echo $q;\n self::$db->alter($q);\n }", "abstract protected function makeCustomColumn(string $table, DoctrineDBALColumn $column): CustomColumn;", "public function alterColumn($table, $column, $type)\n {\n $sql='ALTER TABLE ' . $this->quoteTableName($table) . ' ALTER COLUMN '\n . $this->quoteColumnName($column) . ' '\n . $this->getColumnType($type);\n return $sql;\n }", "public function delegateGetDbalColumnType(&$dbal_type, array $drupal_field_specs);", "protected function createNumeric() {\n\t\t$string =\n\t\t\t\t$this->columnSchema[ self::COLUMN_DEFINITION_TYPE ]\n\t\t\t\t. ( $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] !== NULL ? ' DEFAULT \"' . $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] . '\"' : '' )\n\t\t\t\t. ( strtolower( $this->columnSchema[ self::COLUMN_DEFINITION_IS_NULLABLE ] ) == 'no' ? ' NOT NULL' : '' )\n\t\t\t\t. ( !empty( $this->columnSchema[ self::COLUMN_DEFINITION_EXTRA ] ) ? ' auto_increment' : '' );\n\n\t\treturn $string;\n\t}", "public function createSchemaTable();", "protected function generateTable(){\n\t\t$columns = $this->getConfig()->getColumns();\n\t\t$columns['magento_entity_id'] = array('type' => 'int');\n\n\t\t$sql = 'CREATE TABLE ' . $this->_table . '(';\n\n\t\tforeach ($columns as $name => $params) {\n\t\t\t$type = $this->getConfig()->getTypeForDatabase($params['type'], $name);\n\t\t\t$value = isset($params['default']) ? $params['default'] : 'NULL';\n\t\t\tif ($value != 'NULL') {\n\t\t\t\t$value = 'DEFAULT ' . $value;\n\t\t\t}\n\t\t\t$primary = isset($params['primary']) && $params['primary'] ? ' PRIMARY KEY' : '';\n\n\t\t\t$sql .= \"\\n\" . $name . \" \" . $type . \" \" . $value . $primary . \",\";\n\t\t}\n\t\t$sql = substr($sql, 0, -1) . ') ENGINE=InnoDB DEFAULT CHARSET=utf8;' . \"\\n\";\n\n\t\treturn $sql;\n\t}", "public function set_column_type($column_type) {\n\t\t$this->_expat['columnTypes'] = $column_type;\n\t}", "public function getDbFieldType()\n {\n }", "protected function typeEnum(Fluent $column)\n {\n return 'varchar';\n }", "function raw_db_list_table_fields_def($tablename, $type = false)\r\n{\r\n $result = db_query(\"SELECT sql FROM sqlite_master WHERE (tbl_name = '\" . $tablename . \"');\");\r\n if ($result === false) return false;\r\n\r\n $all = db_fetch_array($result);\r\n $origsql = trim(preg_replace(\"/[\\s]+/\", \" \", str_replace(\",\", \", \", preg_replace(\"/[\\(]/\", \"( \", $all[0], 1))));\r\n $origsql = substr($origsql, 0, strlen($origsql)-1);\r\n $oldcols = preg_split(\"/[,]+/\", substr(trim($origsql), strpos(trim($origsql), '(') + 1), -1, PREG_SPLIT_NO_EMPTY);\r\n\r\n $colnames = array();\r\n $coltype = array();\r\n for($i = 0;$i < sizeof($oldcols);$i++) {\r\n $colparts = preg_split(\"/[\\s]+/\", $oldcols[$i], -1, PREG_SPLIT_NO_EMPTY);\r\n $colnames[] = $colparts[0];\r\n $coltype[] = implode(\" \", array_slice($colparts, 1));\r\n }\r\n\r\n return ($type ? $coltype : $colnames);\r\n}", "function maybe_add_column($table_name, $column_name, $create_ddl)\n {\n }", "private static function addColumn(\\Illuminate\\Database\\Schema\\Blueprint &$table, string $key, string $type)\n {\n switch (self::TYPE_MAP[$type]) {\n case 'bigint_required':\n $table->unsignedBigInteger($key)\n ->comment($type);\n break;\n case 'bigint':\n $table->bigInteger($key)->nullable()\n ->comment($type);\n break;\n case 'date':\n $table->date($key)->nullable()\n ->comment($type);\n break;\n case 'text':\n $table->text($key)->nullable()\n ->comment($type);\n break;\n case 'json':\n $table->json($key)->nullable()\n ->comment($type);\n break;\n case 'string_short':\n $table->string($key, 20)->nullable()\n ->comment($type);\n break;\n case 'string':\n $table->string($key, 100)->nullable()\n ->comment($type);\n break;\n default:\n dump(['error', $val]);\n exit;\n }\n }", "public function addColumn( $type, $column, $field ) {\n\t\t$table = $type;\n\t\t$type = $field;\n\t\t$table = $this->safeTable($table);\n\t\t$column = $this->safeColumn($column);\n\t\t$type = array_key_exists($type, $this->typeno_sqltype) ? $this->typeno_sqltype[$type] : '';\n\t\t$sql = \"ALTER TABLE $table ADD COLUMN $column $type \";\n\t\t$this->adapter->exec( $sql );\n\t}", "public function data_type($type) {\n\t\tstatic $types = array(\n\t\t\t'BIT' => array('type' => 'Binary', 'max_length' => 1, 'nullable' => FALSE),\n\t\t\t'DATETIME' => array('type' => 'Integer'),\n\t\t\t'IMAGE' => array('type' => 'Blob', 'max_length' => 2147483647),\n\t\t\t'MONEY' => array('type' => 'Decimal', 'precision' => 18, 'scale' => 4),\n\t\t\t'NTEXT' => array('type' => 'Text', 'max_length' => '1073741823'),\n\t\t\t'SMALLDATETIME' => array('type' => 'Integer'),\n\t\t\t'SMALLMONEY' => array('type' => 'Decimal', 'precision' => 10, 'scale' => 4),\n\t\t\t'SQL_VARIANT' => array('type' => 'Blob', 'varying' => TRUE),\n\t\t\t//'TABLE' => array('type' => 'Table'),\n\t\t\t'TINYINT' => array('type' => 'Integer', 'range' => array(0, 255)),\n\t\t\t'UNIQUEIDENTIFIER' => array('type' => 'String', 'max_length' => 38),\n\t\t);\n\n\t\t$type = strtoupper($type);\n\n\t\tif (isset($types[$type])) {\n\t\t\treturn $types[$type];\n\t\t}\n\n\t\treturn parent::data_type($type);\n\t}", "public function getColumnDDL(Column $col);", "public static function typeDef(string $type) {\n // Check for the unsigned signifier.\n $unsigned = null;\n if ($type[0] === 'u') {\n $unsigned = true;\n $type = substr($type, 1);\n } elseif (preg_match('`(.+)\\s+unsigned`i', $type, $m)) {\n $unsigned = true;\n $type = $m[1];\n }\n\n // Remove brackets from the type.\n $brackets = null;\n if (preg_match('`^(.*)\\((.*)\\)$`', $type, $m)) {\n $brackets = $m[2];\n $type = $m[1];\n }\n\n // Look for the type.\n $type = strtolower($type);\n if (isset(self::$types[$type])) {\n $row = self::$types[$type];\n $dbtype = $type;\n\n // Resolve an alias.\n if (is_string($row)) {\n $dbtype = $row;\n $row = self::$types[$row];\n }\n } else {\n return null;\n }\n\n // Now that we have a type row we can build a schema for it.\n $schema = [\n 'type' => $row['type'],\n 'dbtype' => $dbtype\n ];\n\n if (!empty($row['schema'])) {\n $schema += $row['schema'];\n }\n\n if ($row['type'] === 'integer' && $unsigned) {\n $schema['unsigned'] = true;\n\n if (!empty($schema['maximum'])) {\n $schema['maximum'] = $schema['maximum'] * 2 + 1;\n $schema['minimum'] = 0;\n }\n }\n\n if (!empty($row['length'])) {\n $schema['maxLength'] = (int)$brackets ?: 255;\n }\n\n if (!empty($row['precision'])) {\n $parts = array_map('trim', explode(',', $brackets));\n $schema['precision'] = (int)$parts[0];\n if (isset($parts[1])) {\n $schema['scale'] = (int)$parts[1];\n }\n }\n\n if (!empty($row['enum'])) {\n $enum = explode(',', $brackets);\n $schema['enum'] = array_map(function ($str) {\n return trim($str, \"'\\\" \\t\\n\\r\\0\\x0B\");\n }, $enum);\n }\n\n return $schema;\n }", "public function getColumnDefinition($column){ }", "public function withDataType(DataTypeInterface $type): ColumnInterface;", "protected function typeInteger(Magic $column)\n {\n return 'INTEGER';\n }", "protected function type_integer(Magic $column)\n {\n return 'INTEGER';\n }", "public function getCreatorColumnName() {}", "protected function _getDataTypes(){\n\t\treturn ActiveRecordMetaData::getDataTypes($this->_source, $this->_schema);\n\t}", "public function columnTypes()\n {\n return \\array_merge(\\array_filter(parent::columnTypes(), function($elem) {\n if ($elem[0] === Schema::TYPE_JSON) {\n return false;\n }\n return true;\n }), [\n [\n Schema::TYPE_JSON,\n $this->json(),\n \"json\",\n \"json CHECK ([[{name}]] is null or json_valid([[{name}]]))\"\n ]\n ]);\n }", "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}", "private function generateColumn($param) {\n\t$class = ucfirst(trim($param[\"type\"])) . \"Generator\";\n\tif (class_exists($class)) {\n\t $generator = new $class();\n\t $return = $generator->generateMySQL($param);\n\t return $return;\n\t} else {\n\t echo \"\\n\\t!!! Wrong type of column\";\n\t return \"\";\n\t}\n }", "public static function getColumnType($type) {\n\t\tforeach (static::getColumnTypes() as $blueprintType => $sqlType) {\n\t\t\tif ($blueprintType === $type) {\n\t\t\t\treturn $sqlType;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public static function generateSchemaForTypeNumeric( array $fieldConf ) {\n\n\t\t$schema = array();\n\n\t\tstatic $bitWidths = array(\n\t\t\t'8' => self::COLUMN_TYPE_TINYINT,\n\t\t\t'16' => self::COLUMN_TYPE_SMALLINT,\n\t\t\t'24' => self::COLUMN_TYPE_MEDIUMINT,\n\t\t\t'32' => self::COLUMN_TYPE_INT,\n\t\t\t'64' => self::COLUMN_TYPE_BIGINT\n\t\t);\n\n\t\tforeach ( $bitWidths as $bits => $columnType ) {\n\t\t\tif ( $fieldConf[ 'bitWidth' ] <= $bits ) {\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_TYPE ] = $columnType;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$schema[ self::COLUMN_DEFINITION_DATATYPE ] = $fieldConf[ 'dataType' ]; // save datatype so we can use is_a later for update check\n\n\t\t$schema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ] = NULL; // only applicable for string types\n\n\t\t//set default\n\t\t$schema[ self::COLUMN_DEFINITION_DEFAULT ] = ( !empty( $fieldConf[ 'autoInc' ] ) ? NULL : $fieldConf[ 'default' ] ); // auto_increment columns can't have a default value\n\n\t\t//set nullable\n\t\t$schema[ self::COLUMN_DEFINITION_IS_NULLABLE ] = ( !empty( $fieldConf[ 'nullable' ] ) ? 'YES' : 'NO' );\n\n\t\t//set character set\n\t\t$schema[ self::COLUMN_DEFINITION_CHARSET ] = ( !empty( $fieldConf[ 'charset' ] ) ? $fieldConf[ 'charset' ] : NULL ); //TODO: probably should always set to NULL\n\n\t\t//set collation\n\t\t$schema[ self::COLUMN_DEFINITION_COLLATION ] = NULL; // only applicable for string types\n\n\t\t//set auto increment\n\t\t$schema[ self::COLUMN_DEFINITION_EXTRA ] = ( !empty( $fieldConf[ 'autoInc' ] ) ? 'auto_increment' : NULL );\n\n\t\t//set scale\n\t\t$schema[ self::COLUMN_DEFINITION_SCALE ] = 0; // not used as float/double is a different datatype\n\n\t\treturn $schema;\n\t}", "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}", "public function getRecordTypeColumnName() {}", "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 }", "function generateColumn( $column, $defaultTable=null )\r\n\t{\r\n\t\tif (!is_object($column)) {\r\n\t\t\treturn SQLName::getNameFull( $defaultTable, $column, $this );\r\n\t\t}\r\n\t\telse switch( get_class( $column ) ) {\r\n\t\tcase FALSE:\r\n\t\t\treturn SQLName::getNameFull( $defaultTable, $column, $this );\r\n\r\n\t\tcase CLASS_SQLName: \r\n\t\t\treturn $column->generate();\r\n\r\n\t\tcase CLASS_DBColumnDefinition:\r\n\t\t\treturn SQLName::getNameFull( $column->getTableAlias(), $column->getName(), $this );\r\n\r\n\t\tcase CLASS_SQLFunction:\r\n\t\t\treturn $column->generate($this);\r\n\t\t\t\r\n\t\tdefault:\r\n\t\t\treturn $column->generate($this);\r\n\t\t}\r\n\t\treturn( \"\" );\r\n\t}", "protected function type_integer(Magic $column)\n {\n return 'INT';\n }", "private static function add_column_sqlite($tablename, $sql_field_name, $type, $last_id)\n\t{\n\t\tFsb::$db->alter($tablename, 'ADD', $sql_field_name . $last_id);\n\t}", "abstract public static function get_column_name(): string;", "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 __toString(): string\n {\n $nullConstraint = ($this->isNull) ? 'NULL' : 'NOT NULL';\n $type = $this->type === 'INT(11)' ? 'INT' : $this->type;\n $column = \"`{$this->name}` {$type} {$nullConstraint}\";\n\n if ($this->default === null && $this->isNull) {\n $column .= ' DEFAULT NULL';\n } elseif ($this->default !== null) {\n $defaultValue = is_numeric($this->default) === false ? \"'{$this->default}'\" : $this->default;\n $column .= \" DEFAULT {$defaultValue}\";\n }\n\n if ($this->isAutoIncrement) {\n $column .= ' AUTO_INCREMENT';\n }\n\n return $column;\n }", "protected function type_string(Magic $column)\n {\n return 'VARCHAR(' . $column->length . ')';\n }", "protected function typeBigInteger(Fluent $column)\n {\n return 'integer';\n }", "private static function normalizeColumnType($col)\n {\n if (preg_match('/\\((.+)\\)/', $col['type'], $matches)) {\n $col['precision'] = $matches[1];\n $col['type'] = preg_replace('/\\(.*/', '', $col['type']);\n }\n $col['type'] = strtolower($col['type']);\n switch ($col['type']) {\n case 'bool':\n case 'tinyint':\n $col['type'] = 'boolean';\n break;\n case 'int':\n $col['type'] = 'integer';\n break;\n case 'nvarchar':\n $col['type'] = 'varchar';\n break;\n case 'float':\n case 'double':\n case 'decimal':\n $col['type'] = 'numeric';\n break;\n case 'timestamp':\n $col['type'] = 'datetime';\n break;\n case 'enum':\n $col['precision'] = array_map(function($e) { return trim($e, \"'\"); }, explode(',', $col['precision']));\n }\n return $col;\n }", "public function dbFieldType()\n {\n return 'string';\n }", "protected function type_string(Magic $column)\n {\n return 'VARCHAR';\n }", "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 changeColumn($table, $oldCol, $newCol, $type=false);", "public static function factory($table, $datatype, $name)\r\n\t{\r\n\t\t// Get the normalised datatype\r\n\t\t$schema = $table->database->datatype($datatype);\r\n\t\t$schema['data_type'] = $datatype;\r\n\t\t\r\n\t\t// Get the appropriate type\r\n\t\t$class = 'Database_Column_'.ucfirst($schema['type']);\r\n\t\t\r\n\t\t// If the class exists return it.\r\n\t\tif(class_exists($class))\r\n\t\t{\r\n\t\t\t// Create the new object\r\n\t\t\t$col = new $class($table, $schema);\r\n\t\t\t\r\n\t\t\t// Set its name\r\n\t\t\t$col->name = $name;\r\n\t\t\t\r\n\t\t\t// Return the column\r\n\t\t\treturn $col;\r\n\t\t}\r\n\t\t\r\n\t\t// Otherwise throw an error, we don't support the column type.\r\n\t\tthrow new Kohana_Exception('Unsupported database column driver dvr', array(\r\n\t\t\t'dvr' => $class\r\n\t\t));\r\n\t}", "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}", "public function setAlterColumnFormat()\n {\n $this->format = '{type}{length}{notnull}{append}';\n }", "private function createTableDefinition()\n {\n $id = $this->getServiceId('table_type');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('table'));\n $definition\n ->setArguments([$this->options['entity']])\n ->addTag('table.type', [\n 'alias' => sprintf('%s_%s', $this->prefix, $this->resourceName)]\n )\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function hasColumnType($name);", "public function hasColumnType($name);", "abstract public function tableColumns();", "protected function getColumnType(\n array $definition,\n string $columnType,\n $columnSize,\n $columnPrecision,\n $columnScale\n ): array {\n if (false !== strpos($columnType, 'NUMBER')) {\n $definition['type'] = Column::TYPE_DECIMAL;\n $definition['isNumeric'] = true;\n $definition['size'] = $columnPrecision;\n $definition['scale'] = $columnScale;\n $definition['bindType'] = 32;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'INTEGER')) {\n $definition['type'] = Column::TYPE_INTEGER;\n $definition['isNumeric'] = true;\n $definition['size'] = $columnPrecision;\n $definition['bindType'] = 1;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'VARCHAR2')) {\n $definition['type'] = Column::TYPE_VARCHAR;\n $definition['size'] = $columnSize;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'FLOAT')) {\n $definition['type'] = Column::TYPE_FLOAT;\n $definition['isNumeric'] = true;\n $definition['size'] = $columnSize;\n $definition['scale'] = $columnScale;\n $definition['bindType'] = 32;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'TIMESTAMP')) {\n $definition['type'] = Column::TYPE_TIMESTAMP;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'DATE')) {\n $definition['type'] = Column::TYPE_DATE;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'RAW')) {\n $definition['type'] = Column::TYPE_TEXT;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'BLOB')) {\n $definition['type'] = Column::TYPE_TEXT;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'CLOB')) {\n $definition['type'] = Column::TYPE_TEXT;\n\n return $definition;\n }\n\n if (false !== strpos($columnType, 'CHAR')) {\n $definition['type'] = Column::TYPE_CHAR;\n $definition['size'] = $columnSize;\n\n return $definition;\n }\n\n $definition['type'] = Column::TYPE_TEXT;\n\n return $definition;\n }", "function makeFieldTypeFunction( $field_type, $table = 'auto' )\n{\n\tswitch ( $field_type )\n\t{\n\t\tcase 'date':\n\n\t\t\treturn 'ProperDate';\n\n\t\tcase 'numeric':\n\n\t\t\treturn 'removeDot00';\n\n\t\tcase 'codeds':\n\t\tcase 'exports':\n\n\t\t\tif ( $table === 'STAFF' )\n\t\t\t{\n\t\t\t\treturn 'StaffDecodeds';\n\t\t\t}\n\n\t\t\treturn 'DeCodeds';\n\n\t\tcase 'radio':\n\n\t\t\treturn 'makeCheckbox';\n\n\t\tcase 'textarea':\n\n\t\t\treturn 'makeTextarea';\n\n\t\tcase 'multiple':\n\n\t\t\treturn 'makeMultiple';\n\t}\n\n\treturn '';\n}", "public function setTableDefinition() {\n\t\t$this -> hasColumn('Transaction_Type', 'varchar', 10);\n\t\t$this -> hasColumn('User', 'varchar', 10);\n\t\t$this -> hasColumn('Timestamp', 'varchar', 32);\n\t\t$this -> hasColumn('Status', 'varchar', 5);\n\t\t$this -> hasColumn('Validated_By', 'varchar', 10);\n\t}", "public function getSqlType($type, $limit = null);", "public function getContentColumnType(): string {\n return Schema::TYPE_TEXT;\n }", "private function addColumn($field, $type = \"migration\", $meta = \"\")\n {\n\n\n if ($type == 'migration') {\n\n $syntax = sprintf(\"\\$table->%s('%s')\", $field['type'], $field['name']);\n\n // If there are arguments for the schema type, like decimal('amount', 5, 2)\n // then we have to remember to work those in.\n if ($field['arguments']) {\n $syntax = substr($syntax, 0, -1) . ', ';\n\n $syntax .= implode(', ', $field['arguments']) . ')';\n }\n\n foreach ($field['options'] as $method => $value) {\n $syntax .= sprintf(\"->%s(%s)\", $method, $value === true ? '' : $value);\n }\n\n $syntax .= ';';\n\n\n } elseif ($type == 'view-index-header') {\n\n // Fields to index view\n $syntax = sprintf(\"<th>%s\", strtoupper($field['name']));\n $syntax .= '</th>';\n\n } elseif ($type == 'view-index-content') {\n\n // Fields to index view\n $syntax = sprintf(\"<td>{{\\$%s->%s\", $meta['var_name'], strtolower($field['name']));\n $syntax .= '}}</td>';\n\n } elseif ($type == 'view-show-content') {\n\n // Fields to show view\n $syntax = sprintf(\"<div class=\\\"form-group\\\">\\n\" .\n str_repeat(' ', 21) . \"<label for=\\\"%s\\\">%s</label>\\n\" .\n str_repeat(' ', 21) . \"<p class=\\\"form-control-static\\\">{{\\$%s->%s}}</p>\\n\" .\n str_repeat(' ', 16) . \"</div>\", strtolower($field['name']), strtoupper($field['name']), $meta['var_name'], strtolower($field['name']));\n\n\n } elseif ($type == 'view-edit-content') {\n $syntax = $this->buildField($field, $type, $meta['var_name']);\n } elseif ($type == 'view-create-content') {\n $syntax = $this->buildField($field, $type, $meta['var_name'], false);\n } else {\n // Fields to controller\n $syntax = sprintf(\"\\$%s->%s = \\$request->input(\\\"%s\", $meta['var_name'], $field['name'], $field['name']);\n $syntax .= '\");';\n }\n\n\n return $syntax;\n }", "public function modules__ddl_column_type_translation ( $df_data , $we_need_this_for_master_table = false )\n\t{\n\t\tif ( $we_need_this_for_master_table === true and ( isset( $df_data['connector_enabled'] ) and $df_data['connector_enabled'] == '1' ) )\n\t\t{\n\t\t\t$_col_info = array(\n\t\t\t\t\t'type' => \"MEDIUMTEXT\",\n\t\t\t\t\t'length' => null,\n\t\t\t\t\t'default' => \"\",\n\t\t\t\t\t'extra' => null,\n\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t'is_null' => false\n\t\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( $df_data['type'] == 'alphanumeric' )\n\t\t\t{\n\t\t\t\t//---------------------------\n\t\t\t\t// Alphanumeric : Mixed data\n\t\t\t\t//---------------------------\n\n\t\t\t\tif ( $df_data['subtype'] == 'string' )\n\t\t\t\t{\n\t\t\t\t\t# Default value\n\t\t\t\t\tif ( ! isset( $df_data['default_value'] ) or is_null( $df_data['default_value'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $df_data['is_required'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_default_value = \"\";\n\t\t\t\t\t\t\t$_is_null = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! $df_data['is_required'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_default_value = null;\n\t\t\t\t\t\t\t$_is_null = true;\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\t$_default_value = $df_data['default_value'];\n\t\t\t\t\t\t$_is_null = false;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t# Continue...\n\t\t\t\t\tif ( $df_data['maxlength'] <= 255 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t\t\t'type' => \"VARCHAR\",\n\t\t\t\t\t\t\t\t'length' => $df_data['maxlength'],\n\t\t\t\t\t\t\t\t'default' => $_default_value,\n\t\t\t\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t\t\t\t'is_null' => $_is_null,\n\t\t\t\t\t\t\t\t'indexes' => $df_data['is_unique'] ? array( 'UNIQUE' => true ) : array()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telseif ( $df_data['maxlength'] <= 65535 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t\t\t'type' => \"TEXT\",\n\t\t\t\t\t\t\t\t'length' => null,\n\t\t\t\t\t\t\t\t'default' => $_default_value,\n\t\t\t\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t\t\t\t'is_null' => $_is_null\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telseif ( $df_data['maxlength'] <= 16777215 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t\t\t'type' => \"MEDIUMTEXT\",\n\t\t\t\t\t\t\t\t'length' => null,\n\t\t\t\t\t\t\t\t'default' => $_default_value,\n\t\t\t\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t\t\t\t'is_null' => $_is_null\n\t\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\t# Anything larger than 16 megabytes is not accepted through a regular input-form-fields\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t//--------------------------\n\t\t\t\t// Alphanumeric : Integer\n\t\t\t\t//--------------------------\n\n\t\t\t\telseif ( preg_match( '#^integer_(?P<attrib>(?:un)?signed)_(?P<bit_length>\\d{1,2})$#', $df_data['subtype'], $_dft_subtype ) )\n\t\t\t\t{\n\t\t\t\t\t# Default value\n\t\t\t\t\tif ( ! isset( $df_data['default_value'] ) or is_null( $df_data['default_value'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $df_data['is_required'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_default_value = 0;\n\t\t\t\t\t\t\t$_is_null = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! $df_data['is_required'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_default_value = null;\n\t\t\t\t\t\t\t$_is_null = true;\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\t$_default_value = intval( $df_data['default_value'] );\n\t\t\t\t\t\t$_is_null = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t\t'length' => $df_data['maxlength'],\n\t\t\t\t\t\t\t'default' => $_default_value,\n\t\t\t\t\t\t\t'attribs' => ( $_dft_subtype['attrib'] == 'unsigned' ) ? \"UNSIGNED\" : \"SIGNED\",\n\t\t\t\t\t\t\t'is_null' => $_is_null\n\t\t\t\t\t\t);\n\n\t\t\t\t\t# The rest...\n\t\t\t\t\tswitch ( $_dft_subtype['bit_length'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\t$_col_info['type'] = \"TINYINT\";\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 16:\n\t\t\t\t\t\t\t$_col_info['type'] = \"SMALLINT\";\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 24:\n\t\t\t\t\t\t\t$_col_info['type'] = \"MEDIUMINT\";\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\t$_col_info['type'] = \"INT\";\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 64:\n\t\t\t\t\t\t\t$_col_info['type'] = \"BIGINT\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t//--------------------------\n\t\t\t\t// Alphanumeric : Decimal\n\t\t\t\t//--------------------------\n\n\t\t\t\telseif ( $df_data['subtype'] == 'decimal_signed' or $df_data['subtype'] == 'decimal_unsigned' )\n\t\t\t\t{\n\t\t\t\t\t# Default value\n\t\t\t\t\tif ( ! isset( $df_data['default_value'] ) or is_null( $df_data['default_value'] ) or ! is_numeric( $df_data['default_value'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $df_data['is_required'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_default_value = 0.00;\n\t\t\t\t\t\t\t$_is_null = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! $df_data['is_required'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_default_value = null;\n\t\t\t\t\t\t\t$_is_null = true;\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\t$_default_value = floatval( $df_data['default_value'] );\n\t\t\t\t\t\t$_is_null = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t# The rest...\n\t\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t\t'type' => \"DECIMAL\",\n\t\t\t\t\t\t\t'length' => $df_data['maxlength'],\n\t\t\t\t\t\t\t'default' => $_default_value,\n\t\t\t\t\t\t\t'attribs' => ( $df_data['subtype'] == 'decimal_unsigned' ) ? \"UNSIGNED\" : \"SIGNED\",\n\t\t\t\t\t\t\t'is_null' => $_is_null,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telseif ( in_array( $df_data['subtype'], array( \"dropdown\" , \"multiple\" ) ) )\n\t\t\t\t{\n\t\t\t\t\t# Default value\n\t\t\t\t\tif ( ! isset( $df_data['default_value'] ) or is_null( $df_data['default_value'] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_default_value = null;\n\t\t\t\t\t\t$_is_null = true;\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$_default_value = $df_data['default_value'];\n\t\t\t\t\t\t$_is_null = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t# The rest...\n\t\t\t\t\tswitch ( $df_data['subtype'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'dropdown':\n\t\t\t\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t\t\t\t'type' => \"ENUM\",\n\t\t\t\t\t\t\t\t\t'length' => $df_data['maxlength'],\n\t\t\t\t\t\t\t\t\t'default' => $_default_value,\n\t\t\t\t\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t\t\t\t\t'is_null' => $_is_null\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'multiple':\n\t\t\t\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t\t\t\t'type' => \"SET\",\n\t\t\t\t\t\t\t\t\t'length' => $df_data['maxlength'],\n\t\t\t\t\t\t\t\t\t'default' => $_default_value,\n\t\t\t\t\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t\t\t\t\t'is_null' => $_is_null\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $df_data['type'] == 'file' )\n\t\t\t{\n\t\t\t\t//--------\n\t\t\t\t// File\n\t\t\t\t//--------\n\n\t\t\t\t# Files are represented with their 32-char-long MD5 checksum hashes\n\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t'type' => \"VARCHAR\",\n\t\t\t\t\t\t'length' => 32,\n\t\t\t\t\t\t'default' => null,\n\t\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t\t'is_null' => true\n\t\t\t\t\t);\n\t\t\t}\n\t\t\telseif ( $df_data['type'] == 'link' )\n\t\t\t{\n\t\t\t\t//--------\n\t\t\t\t// Link\n\t\t\t\t//--------\n\n\t\t\t\t# All Links are references to 'id' column of module master tables\n\t\t\t\t$_col_info = array(\n\t\t\t\t\t\t'type' => \"INT\",\n\t\t\t\t\t\t'length' => 10,\n\t\t\t\t\t\t'default' => null,\n\t\t\t\t\t\t'attribs' => null,\n\t\t\t\t\t\t'is_null' => true\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t$_col_info['extra'] = null;\n\n\t\t$_col_info['name'] = $df_data['name'];\n\n\t\t$_col_info['comment'] = $df_data['label'];\n\t\t$_col_info['comment'] = html_entity_decode( $_col_info['comment'], ENT_QUOTES, \"UTF-8\" ); // Decoding characters\n\t\t$_col_info['comment'] = preg_replace( \"/'{2,}/\" , \"'\" , $_col_info['comment'] ); // Excessive single-quotes\n\t\tif ( mb_strlen( $_col_info['comment'] ) > 255 ) // Truncate here, as you might get trailing single-quotes later on, for comments with strlen() close to 255.\n\t\t{\n\t\t\t$_col_info['comment'] = mb_substr( $_col_info['comment'], 0, 255 );\n\t\t}\n\t\t$_col_info['comment'] = str_replace( \"'\", \"''\", $_col_info['comment'] ); // Single quotes are doubled in number. This is MySQL syntax!\n\n\t\treturn $_col_info;\n\t}" ]
[ "0.69713956", "0.6905502", "0.6743046", "0.67342424", "0.66350687", "0.66143197", "0.6605163", "0.6599898", "0.6582964", "0.6545098", "0.65350807", "0.6523356", "0.6515783", "0.6515783", "0.64270145", "0.64215255", "0.63744473", "0.62947315", "0.6257662", "0.624557", "0.6212645", "0.61191154", "0.61027473", "0.6093156", "0.60844314", "0.6079161", "0.6056669", "0.6050908", "0.6036443", "0.6003883", "0.6001934", "0.5996407", "0.59901386", "0.5984123", "0.5966579", "0.5962572", "0.59541017", "0.5899884", "0.58941054", "0.58856684", "0.58730865", "0.5866356", "0.58552235", "0.5852007", "0.58510214", "0.58460605", "0.5829517", "0.5826759", "0.58246493", "0.5821653", "0.5801438", "0.5793568", "0.57758397", "0.57649875", "0.5762584", "0.5762479", "0.57546705", "0.5748129", "0.5747169", "0.57243425", "0.5713914", "0.57129896", "0.56977713", "0.5684733", "0.566827", "0.5659901", "0.56546104", "0.56457704", "0.5620944", "0.5620828", "0.55900174", "0.5586788", "0.55821645", "0.5576611", "0.5574297", "0.5566625", "0.55663633", "0.5543564", "0.55430627", "0.55425954", "0.5538543", "0.5533908", "0.5533821", "0.55331117", "0.5513281", "0.55111414", "0.55084985", "0.54995036", "0.54939497", "0.5491373", "0.5489338", "0.5489338", "0.54821515", "0.54816127", "0.54772395", "0.54705083", "0.54685056", "0.5460144", "0.545361", "0.5451115" ]
0.664952
4
include and lunch class autoloader
protected function autoLoader() { $bool = file_exists(MAIN_PATH . '/bin/autoload.php'); if ($bool) { $this->loader = require_once MAIN_PATH . '/bin/autoload.php'; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function class_autoloader($class_name) {\n include 'classes/' .$class_name . '.php';\n}", "function my_autoloader($class_name) \n\t{\n \tinclude '../classes/' . $class_name . '.class.php';\n\t}", "static public function autoload() {\n spl_autoload_register(array(__CLASS__, 'loader'));\n }", "function my_autoloader($class)\n{\n $filename = BASE_PATH . '/'. str_replace('\\\\', '/', $class) . '.php';\n include($filename);\n}", "function my_autoloader($class) {\r\n\t require_once ($class.'.php');\r\n\t}", "function my_autoloader($class) {\n require_once './../../classes/' . $class . '.php';\n}", "function autoloader()\n {\n spl_autoload_register(function ($className) {\n\n # DIRECTORY SEPARATORS varies in various platforms\n $ds = DIRECTORY_SEPARATOR;\n\n # Current Working Directory\n $dir = __DIR__;\n\n # replace namespace separator with directory separator (prolly not required)\n $className = str_replace('\\\\', $ds, $className);\n\n # get full name of file containing the required class\n $file = \"{$dir}{$ds}{$className}.php\";\n\n # get file if it is readable\n if (is_readable($file)) {\n require_once $file;\n }\n });\n }", "function my_autoloader($class) {\r\n require 'libs/' . $class . '.php';\r\n}", "function glu_class_autoloader($c) {\n include dirname(__FILE__). DIRECTORY_SEPARATOR . strtolower($c) . '.php';\n}", "function my_custom_autoloader($class_name) {\n $file = __DIR__ . \"/includes/\" . $class_name . \".php\";\n\n if (file_exists($file)) {\n require_once $file;\n }\n}", "function class_autoloader($class) {\r\n require make_url(\"class/$class.php\");\r\n}", "private function setAutoLoader() {\n \n spl_autoload_register(array('self', 'autoLoader'));\n \n }", "protected function loadAutoloader()\n {\n new Autoloader();\n }", "public static function register_autoloader()\n {\n }", "function my_autoloader($class) {\n if ( $class != \"ACF\" )\n include 'classes/' . $class . '.class.php';\n }", "function helper_autoloader($class)\n {\n\n }", "public static function autoload()\n {\n spl_autoload_register(array(__CLASS__,'load'));\n }", "function class_autoloader($class)\n{\n $filename = dirname(__FILE__) . DS . '..' . DS . 'includes' . DS . 'class-' . strtolower($class) . '.php';\n\n if (file_exists($filename)) {\n require $filename;\n }\n}", "function __autoload($class_name) {include $class_name . '.php';}", "function my_class_loader ($class) {\n include 'classes' . DIRECTORY_SEPARATOR . $class . '.class.php';\n}", "public function autoload($class) {\n if (isset(static::$map[$class])){\n $pathInfo = static::$map[$class];\n Yaf_Loader::import(sprintf('%s%s',$pathInfo[0], $pathInfo[1]));\n } else if (strpos($class, 'Builder') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/views/builder/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Pagelet') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/pagelets/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Halo') === 0){\n Yaf_Loader::import(sprintf('%s/halo/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Util') == strlen($class) - 4 || strpos($class, 'Utils') == strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/utils/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Model') === strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/application/models/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'Service') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/service/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'HTMLPurifier') !== false){\n Yaf_Loader::import(sprintf('%s/htmlpurifier/HTMLPurifier.safe-includes.php',LIB_PATH));\n }else if (strpos($class, 'Api') === strlen($class) - 3){\n Yaf_Loader::import(sprintf('%s/application/Api/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'Object') === strlen($class) - 6){\n Yaf_Loader::import(sprintf('%s/application/objects/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'MemCache') === 0){\n// var_dump('================');\n// /Users/worker/php/wk/wcontact_cache/lib/wcontact/MemCacheBase.php\n Yaf_Loader::import(sprintf('%s/wzhaopin/%s.php',LIB_PATH, $class));\n }\n }", "abstract protected static function autoload($class);", "function myAutoLoader($class) {\n\t$path = TRITON_INSTALL_PATH . \"/src/{$class}/{$class}.php\";\n\tif(is_file($path)) {\n\t\tinclude($path);\n\t} else {\n\t\tthrow new Exception(\"Classfile '{$class} does not exist.\");\n\t}\n}", "function myAutoLoader($class) {\n\t$path = TRITON_INSTALL_PATH . \"/src/{$class}/{$class}.php\";\n\tif(is_file($path)) {\n\t\tinclude($path);\n\t} else {\n\t\tthrow new Exception(\"Classfile '{$class} does not exist.\");\n\t}\n}", "public static function LOADER(){\n spl_autoload_register(array(__CLASS__, \"requireClass\"));\n }", "function autoloader($class_name) {\n\n $array_paths = [\n '/models/',\n '/components/',\n '/controllers/',\n ];\n\n foreach ($array_paths as $path) {\n\n $path = ROOT . $path . $class_name . '.php';\n\n if (is_file($path)) {\n include_once $path;\n }\n }\n}", "public static function init_autoload() {\n spl_autoload_register(function ($class) {\n self::autoload_path($class);\n });\n }", "public static function AutoLoad(){\n spl_autoload_register(function ($file_name){\n $name = preg_replace('~(.*[\\\\\\\\]([A-Z]\\w+))~im', '$2', $file_name);\n MyAutoload::loadControllers($name);//'HomeController'\n MyAutoload::loadModules($name);//'Controller'\n MyAutoload::loadModules($name);//'Model'\n MyAutoload::loadModules($name);//'Config'\n MyAutoload::loadModels($name);//'Tasks'\n MyAutoload::loadRoutes();//'Tasks'\n });\n }", "function rum_class_loader() {\n $loader = new UniversalClassLoader();\n $loader->registerNamespace('Rum', __DIR__ . '/lib');\n $loader->register();\n}", "function yap_autoloader($class) {\n $directories = array(LIB_DIR, MODEL_DIR);\n\n foreach($directories as $directory) {\n if(!@include(\"$directory/$class.php\"))\n @include($directory.strtolower($class).\".php\");\n }\n}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "public function loadClasses(){\n spl_autoload_register(function($className){\n require_once preg_replace(\"/\\\\\\\\/\", \"/\", $className).\".php\";\n });\n }", "function __autoload($class_name) {\r\n include '../class/' . $class_name . '.php';\r\n}", "public static function registerAutoloader(){\n\t\tspl_autoload_register(__NAMESPACE__ . \"\\\\Jolt::autoload\");\n\t}", "public static function autoloader($class)\n {\n }", "static function _shfw_autoloader()\n {\n\t\tinclude_once(BASEPATH.'config'.DIRECTORY_SEPARATOR.'autoload.php');\n\n\t\tif ( ! isset($autoload))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Autoload helpers.\n\t\tforeach ($autoload['helper'] as $type)\n\t\t{\t\t\t\n\t\t\tself::loadHelper($type);\n\t\t}\n\n\t\t// Autoload core components.\n\t\tforeach ($autoload['core'] as $type)\n\t\t{\t\t\t\n\t\t\tself::initCoreComponent($type);\n\t\t}\n\n\t\t/*\n\t\tif(SHIN_Core::$_benchmark){\n\t\t\tSHIN_Core::$_benchmark->mark('code_start');\n\t\t}\n\t\t*/\n\t\t\n\t\t// Autoload libraries.\n\t\tforeach ($autoload['libraries'] as $type)\n\t\t{\n\t\t\tself::loadLibrary($type, TRUE);\n\t\t}\n\n\t\t// Autoload models.\n\t\tforeach ($autoload['models'] as $type)\n\t\t{\n\t\t\tself::loadModel($type, TRUE);\n\t\t}\n\t}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "function autoloader($class_name)\r\n{\r\n\t//array of directories\r\n\t$directories\t\t\t\t\t\t= array(\r\n\t\t'classes/',\r\n\t\t'../classes/',\r\n\t\t'../../classes/',\r\n\t\t'lib/',\r\n\t\t'../lib/',\r\n\t\t'../../lib/',\r\n\t);\r\n\r\n\t\r\n\t//array of filename formats\r\n\t$file_name_formats\t\t\t\t\t= array(\r\n\t\t'%s.php'\r\n\t);\r\n\t\r\n\t// Iterate through directories\r\n\tforeach($directories as $directory)\r\n\t{\r\n\t\tforeach($file_name_formats as $file_name_format)\r\n\t\t{\r\n\t\t\t$file_path\t\t\t\t\t= $directory.sprintf($file_name_format,$class_name);\r\n\t\t\t//echo $file_path.\"<br>\";\r\n\t\t\tif(file_exists($file_path))\r\n\t\t\t{\r\n\t\t\t\t//echo '<br><br>this there => '.$file_path;\r\n\t\t\t\trequire_once $file_path;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n}", "public function registerAutoloaders()\n {\n }", "function autoload($class)\n{\n require dirname($_SERVER['SCRIPT_FILENAME']) . '//..//..//' . str_replace('\\\\', '/', $class) . '.php';\n}", "function loader($class){\n $class_file = DIR. DS . $class . '.php';\n\n if(file_exists($class_file)){\n require_once($class_file);\n }else{\n foreach (AUTOLOAD_CLASSES as $path){\n $class_file = $path . DS . $class . '.php';\n if(file_exists($class_file)) require_once($class_file);\n }\n }\n}", "function medialib_autoloader($class_name)\n{\n $class_name = str_replace('\\\\', '/', $class_name) . '.php';\n require_once $class_name;\n}", "private static function libAutoload(): void\n {\n \\spl_autoload_register('self::autoload');\n }", "private function registerAutoloader() {\n\t\t\t// register autoloader\n\t\t\tspl_autoload_extensions(EXT);\n\t\t\tspl_autoload_register(array($this, 'autoload'));\n\t\t}", "function classAutoload($class_name) {\n if (file_exists( __DIR__ . '/includes/classes/' . $class_name . '.php')) {\n require_once __DIR__ . '/includes/classes/' . $class_name . '.php';\n }\n}", "static function autoload()\r\n\t{\r\n\t\t\r\n\t}", "function __autoload($class_name) {\n if (strpos($class_name, '\\\\') !== FALSE) {\n $pieces = explode('\\\\', $class_name);\n $class_name = $pieces[count($pieces) - 1];\n }\n include dirname(__FILE__) . '/' . $class_name . '.php';\n}", "public static function autoload($class) {\n include $class . '.php';\n}", "public static function registerClassLoadingInformation() {}", "function classes_autoloader($class) {\n\t\n\t$subforder = '';\n\t\n\tif (substr($class, -9) === 'Converter') {\n\t\t$subforder = 'converters/';\n\t} else if (substr($class, -4) === 'Skin') {\n\t\t$subforder = 'skins/';\n\t} else if (substr($class, -5) === 'Model') {\n\t\t$subforder = 'models/';\n\t} else if (substr($class, -9) === 'Validator') {\n\t\t$subforder = 'validators/';\n\t} else if (substr($class, -10) === 'Controller') {\n\t\t$subforder = 'actions/';\n\t} else if (substr($class, -7) === 'Service') {\n\t\t$subforder = 'services/';\n\t} else if (substr($class, -3) === 'Job') {\n\t\t$subforder = 'jobs/';\n\t} else if (substr($class, -11) === 'LoginMethod') {\n\t\t$subforder = 'loginmethods/';\n\t} else if (substr($class, -5) === 'Event') {\n\t\t$subforder = 'events/';\n\t} else if (substr($class, -6) === 'Plugin') {\n\t\t$subforder = 'plugins/';\n\t}\n\t\n\t@include(BASE_FOLDER . '/classes/' . $subforder . $class . '.class.php');\n}", "function spl_autoload_call(string $class): void {}", "function class_loader($class) {\n require('classes/' . $class . '.php');\n}", "private static function autoLoader($namespace)\n {\n $filePath = explode('\\\\', $namespace);\n\n /**\n * To remove the Class name (Not class file name) from the end of the namespace.\n */\n array_pop($filePath);\n /**\n * to remove the root key from the beginning the namespace.\n */\n array_shift($filePath);\n \n /**\n * After taking and removing those stuffs, then we are converting namespace from array to an string .\n * using the directory separator that it can work perfectly in every OS (like: windows, linux, ...) .\n */\n $filePath = implode(DIRECTORY_SEPARATOR, $filePath);\n\n /**\n * Now we have just removed that root key from the beginning of the namespace that was extra and also\n * took the Class name (not its file name) from the namespace.\n * And now we have got the address to the class file from the root of the Framework.\n * \n * It means that with combining the (FILE_PATH) constant that gives us the absolute path to the Framework's root and having the address of the class name in the\n * Framework (that we it is) and adding the file extension to these things we can have the full path to that class that was called!\n */\n $filePath = FILE_PATH . $filePath . '.php';\n \n /*\n * We are checking to see whether that class exists or not,\n * If it exists then we are calling that class with using the (require_once) function.\n */\n if (is_readable($filePath))\n {\n require_once $filePath;\n self::registryInjection($namespace);\n\n return;\n }else\n {\n self::$registry->error->reportError(\"The Called Class File Does Not Exists! ({$filePath})\", __LINE__, __METHOD__, false);\n return;\n }\n return;\n }", "function __autoload($pClassName) {\r\n if (file_exists($pClassName.'.php')) {\r\n require_once($pClassName.'.php');\r\n return true;\r\n } else if (file_exists('wrapper/'.$pClassName.'.php')) {\r\n require_once('wrapper/'.$pClassName.'.php');\r\n return true;\r\n }\r\n return false; \r\n}", "public function autoLoad($name){\n\t\t$path = NULL;\n\t\t$namespaceParts = explode('\\\\', $name);\n\t\t$pathTail = implode(DIRECTORY_SEPARATOR, $namespaceParts) . '.php';\n\t\t\n\t\t$tryPath = $this->rootPath . '/' . $pathTail;\n\t\t\n\t\tif(is_readable($tryPath)){\n\t\t\t$path = $tryPath;\n\t\t}\n\t\t\n\t\t// this must not throw an exception or do any kind of error as if it does\n\t\t// then when you use class_exists it will error instead of returning false\n\t\tif ($path) {\n\t\t\trequire_once($path); \n\t\t}\n\t}", "function __autoload($class_name) {\n include 'classes/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function autoloader_perso($className)\n{\n //var_dump($className);\n require_once($className . '.php');\n //die('Test autoloader');\n}", "function __autoload($class) {\n include './libs/class_'.$class.'.php';\n}", "function __autoload($cls){\n SUPER::include_file_with_class($cls);\n}", "public function setupAutoload()\n {\n static::$autoload or spl_autoload_register(\n $this->psr4LoaderFor(__NAMESPACE__, __DIR__),\n true,\n true\n );\n\n static::$autoload = true;\n }", "public static function autoload() {\n spl_autoload_register(function($class) {\n $prefix = __CLASS__ . '\\\\';\n if (strpos($class, $prefix) === 0) {\n // Remove vendor from name.\n $class = substr($class, strlen(__NAMESPACE__) + 1);\n // Convert namespace separator to directory ones.\n $class = str_replace('\\\\', DIRECTORY_SEPARATOR, $class);\n // Prefix with this file's directory.\n $class = __DIR__ . DIRECTORY_SEPARATOR . $class;\n\n require \"$class.php\";\n\n return true;\n }\n\n return false;\n });\n }", "public function registerAutoLoad() {\n spl_autoload_register(array($this, \"load\"), true, true);\n }", "function autoloader($classname){\n $lastSlash = strpos($classname, '\\\\') + 1;\n $classname = substr($classname, $lastSlash);\n $directory = str_replace('\\\\' , '/' , $classname);\n $filename = __DIR__ . '/' . $directory . '.php';\n\n require_once $filename;\n }", "public function auto_load() {\n\n spl_autoload_register(function ($class) {\n\n // Getting the file path for checking if it exists.\n\n require_once ROOT . '/app/controllers/' . $class . '.php';\n\n });\n }", "function __autoload($class_name) {\n include \"classes/\" . $class_name . \".class.php\";\n}", "function __autoload($class_name) {\n require_once '../../include/' . $class_name . '.php';\n}", "public function registerAutoloader()\n {\n spl_autoload_register(array($this,'loadClass'),true, false);\n }", "function __autoload($class) {\n require ($class . '.php');\n}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n }", "function __autoload($class_name) {\n require_once '/' . $class_name . '.php';\n}", "public static function __autoload()\n\t{\n\t\tself::$FPATH = dirname(__DIR__);\n\t\tself::$APATH = self::detect_project();\n\n\t\tspl_autoload_register(array(__CLASS__, 'load'));\n\n\t\tself::cache_files();\n\t\tself::import_initializers();\n\t}", "function __autoload($class_name){\n require_once \"../cls/\".$class_name.'.php';\n}", "private function autoloader( $class ) {\r\n\r\n\t\t\t//BackWPup classes auto load\r\n\t\t\tif ( strstr( strtolower( $class ), 'backwpup_' ) ) {\r\n\t\t\t\t$dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR;\r\n\t\t\t\t$class_file_name = 'class-' . str_replace( array( 'backwpup_', '_' ), array( '', '-' ), strtolower( $class ) ) . '.php';\r\n\t\t\t\tif ( strstr( strtolower( $class ), 'backwpup_pro' ) ) {\r\n\t\t\t\t\t$dir .= 'pro' . DIRECTORY_SEPARATOR;\r\n\t\t\t\t\t$class_file_name = str_replace( 'pro-','', $class_file_name );\r\n\t\t\t\t}\r\n\t\t\t\tif ( file_exists( $dir . $class_file_name ) )\r\n\t\t\t\t\trequire $dir . $class_file_name;\r\n\t\t\t}\r\n\r\n\t\t\t// namespaced PSR-0\r\n\t\t\tif ( ! empty( self::$autoload ) ) {\r\n\t\t\t\t$pos = strrpos( $class, '\\\\' );\r\n\t\t\t\tif ( $pos !== FALSE ) {\r\n\t\t\t\t\t$class_path = str_replace( '\\\\', DIRECTORY_SEPARATOR, substr( $class, 0, $pos ) ) . DIRECTORY_SEPARATOR . str_replace( '_', DIRECTORY_SEPARATOR, substr( $class, $pos + 1 ) ) . '.php';\r\n\t\t\t\t\tforeach ( self::$autoload as $prefix => $dir ) {\r\n\t\t\t\t\t\tif ( $class === strstr( $class, $prefix ) ) {\r\n\t\t\t\t\t\t\tif ( file_exists( $dir . DIRECTORY_SEPARATOR . $class_path ) )\r\n\t\t\t\t\t\t\t\trequire $dir . DIRECTORY_SEPARATOR . $class_path;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} // Single class file\r\n\t\t\t\telseif ( ! empty( self::$autoload[ $class ] ) && is_file( self::$autoload[ $class ] ) ) {\r\n\t\t\t\t\trequire self::$autoload[ $class ];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Google SDK Auto loading\r\n\t\t\t$classPath = explode( '_', $class );\r\n\t\t\tif ( $classPath[0] == 'Google' ) {\r\n\t\t\t\tif ( count( $classPath ) > 3 ) {\r\n\t\t\t\t\t$classPath = array_slice( $classPath, 0, 3 );\r\n\t\t\t\t}\r\n\t\t\t\t$filePath = self::get_plugin_data( 'plugindir' ) . '/vendor/' . implode( '/', $classPath ) . '.php';\r\n\t\t\t\tif ( file_exists( $filePath ) ) {\r\n\t\t\t\t\trequire $filePath;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}", "public static function autoload() {\n // autoload\n include('cache/classes.yml.php');\n foreach($return as $class) {\n require_once($class);\n }\n }", "function my_autoloader($classname)\n{\n\tchdir('challenge/are_you_serial');\n\trequire_once './'.str_replace('.', '', $classname).'.php';\n\tchdir('../../');\n}", "function __autoload($name){\n require_once './class/' . $name . \".class.php\";\n}", "function autoloader($className)\n{\n include_once str_replace(\"\\\\\",\"/\",$className).'.php';\n}", "function __autoload($class){\n require_once($class.'.inc');\n}", "function __autoload ( $class_name )\n {\n include '../' . $class_name . '.php';\n }", "function __autoload($class)\n{\n $fileName = __DIR__ . '/' . str_replace('\\\\', '/', $class) . '.php';\n include ($fileName);\n}", "function __mashineAutoload($class_name)\n{\n if (preg_match(\"/([a-zA-Z0-9]*)ApiController$/\", $class_name, $matches)) {\n $api_path = preg_replace(\"/plugins.*/\", \"controllers\".DS.\"api\", __FILE__);\n\n $file = $api_path.DS.strtolower($matches[1]).\".php\";\n if (is_file($file)) {\n include $file;\n }\n }\n}", "function __autoload($class_name) {\n\t$inc = ['sys/core/', 'sys/libs/'];\n\tforeach ($inc as $in) {\n\t\t$path = APP_DIR . $in . $class_name . '.php';\n\t\tif (file_exists($path)) {\n\t\t\tinclude $path;\n\t\t}\n\t}\n}", "function Syllable_autoloader($class) {\n\t\tif (!class_exists($class) && is_file(dirname(__FILE__). '/' . $class . '.php')) {\n\t\t\trequire dirname(__FILE__). '/' . $class . '.php';\n\t\t}\n\t}", "function __autoload($class){\n require \"classes/\".$class.\".php\";\n }", "function __autoload($className) {\n include \"src/\" . $className . '.php';\n}", "function autoloader( $class ) {\n $elements = \\explode( '\\\\', $class );\n $classLocalName = $elements[ \\count( $elements) - 1 ];\n $localPath = __DIR__ . \\DIRECTORY_SEPARATOR . $classLocalName . '.php';\n if ( is_readable( $localPath ) ) {\n require_once( $localPath );\n }\n}", "public static function registerAutoloaders()\n {\n $modules = self::getModsTable();\n unset($modules[0]);\n foreach ($modules as $module) {\n $base = ($module['type'] == self::TYPE_MODULE) ? 'modules' : 'system';\n $path = \"$base/$module[directory]/lib\";\n ZLoader::addAutoloader($module['directory'], $path);\n }\n }", "private function autoLoader($className) {\n \n $directories = array(\n \n self::QUANTUM_ROOT.'system/controllers/',\n self::QUANTUM_ROOT.'system/controllers/quantum/',\n self::QUANTUM_ROOT.'system/lib/activerecord/',\n self::QUANTUM_ROOT.'system/lib/smarty/',\n self::QUANTUM_ROOT.'system/lib/quantum/controllers/',\n );\n \n \n $fileNameFormats = array(\n '%s.php',\n \n );\n \n $path = str_ireplace('_', '/', $className);\n \n $className = str_replace(\"Quantum\\\\\" , '', $className);\n \n if(@include $path.'.php'){\n return;\n }\n \n foreach($directories as $directory){\n foreach($fileNameFormats as $fileNameFormat){\n $path = $directory.sprintf($fileNameFormat, $className);\n \n if(file_exists($path)){\n include $path;\n return;\n }\n }\n }\n \n \n }", "function ntp_loader($class_name) {\n include(str_replace('\\\\', DIRECTORY_SEPARATOR, $class_name) . '.php');\n}", "protected function registerAutoload()\n {\n spl_autoload_register(function($class)\n {\n foreach ($this->foldersToAutoload as $folder)\n {\n if (file_exists(getcwd() . \"/$folder/$class.php\"))\n {\n /** @noinspection PhpIncludeInspection */\n require_once getcwd() . \"/$folder/$class.php\";\n }\n }\n });\n }", "public static function registerAutoloader() {\n spl_autoload_register(__NAMESPACE__ . \"\\\\Framework::autoload\");\n }", "function spl_autoload_register($class_name)\n{\n try {\n include $class_name . '.php';\n include $class_name . '_db.php';\n include 'model/classes/' . $class_name . '.php';\n include 'model/' . $class_name . '.php';\n include 'model/' . $class_name . '_db.php';\n } catch (Exception $e) {\n if ($debug = true) {\n print_r($e);\n }\n }\n}", "function __autoload($class)\n{\n require(str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php');\n}", "public static function load() {\n self::initialLoad();\n self::vendor();\n self::loadLibs();\n //registra o SLP AUTO LOAD\n spl_autoload_register(array('\\wow\\Loader','autLoad'));\n }", "function __autoload($className)\n{\n require_once \"webcore.reflection.php\";\n \n ClassLoader::loadClass($className);\n}", "function supernova_autoloader($className){\r\n\t\t$root_path = ROOT . DS;\r\n\t\t$app_path=$root_path.'application' . DS;\r\n\t\t$library_path=$root_path.'library' . DS . 'extensions' . DS;\r\n\t\t$str = $className;\r\n\t\t$str[0] = strtolower($str[0]);\r\n\t\t$func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\r\n\t\t$strName = preg_replace_callback('/([A-Z])/', $func, $str);\r\n\t\t$name = strtolower($strName);\r\n\t\t$file = $library_path.$name.'.class.php';\r\n\t\t$controllerFile = $app_path. 'controllers' . DS . $name . '.php';\r\n\t\t$modelFile = $app_path. 'models' . DS . $name . '.php';\r\n\t\t$appFile = $app_path.'app'.'.controller.php';\r\n\t\tif (file_exists($file)){\r\n\t\t\trequire_once($file);\r\n\t\t}else if (file_exists($controllerFile)){\r\n\t\t\trequire_once($controllerFile);\r\n\t\t}else if (file_exists($modelFile)){\r\n\t\t\trequire_once($modelFile);\r\n\t\t}else if (file_exists($appFile)){\r\n\t\t \trequire_once($appFile);\r\n\t\t}\r\n\t}", "function autoload($class_name)\n{\n $parts = str_replace('\\\\', '/', $class_name);\n \n $dir = dirname(__FILE__). '/';\n \n if (is_file($dir . $parts . '.php')) {\n include_once $dir . $parts . '.php';\n }\n}" ]
[ "0.7694974", "0.76704043", "0.76604503", "0.7650719", "0.7594739", "0.7586685", "0.7577871", "0.75610137", "0.7529457", "0.74852055", "0.7482149", "0.7449892", "0.74065274", "0.7406493", "0.7400522", "0.7399183", "0.7383681", "0.7307432", "0.7279947", "0.72700226", "0.7260923", "0.7236498", "0.7207759", "0.7207759", "0.71998566", "0.71924734", "0.7185634", "0.71707946", "0.71576476", "0.71488464", "0.7145565", "0.7145565", "0.7139736", "0.7126501", "0.70962536", "0.7073762", "0.70731306", "0.70729613", "0.7072043", "0.7056319", "0.7053088", "0.7033516", "0.702961", "0.701727", "0.7005961", "0.7002328", "0.70017874", "0.7001514", "0.6993969", "0.6990897", "0.6982688", "0.698069", "0.697975", "0.6978781", "0.6974308", "0.69713193", "0.6970567", "0.69665766", "0.69665766", "0.69665766", "0.69540894", "0.6953861", "0.69500273", "0.69350797", "0.69341993", "0.6932879", "0.6930281", "0.6930221", "0.69299877", "0.692308", "0.6910888", "0.6897119", "0.6891713", "0.6887599", "0.68871623", "0.68857384", "0.687406", "0.6872879", "0.6871806", "0.6868077", "0.6866176", "0.686337", "0.68621856", "0.68616617", "0.68544465", "0.68492085", "0.68445855", "0.68393", "0.68275577", "0.682648", "0.6824067", "0.6824036", "0.6819183", "0.6818003", "0.6814125", "0.68082744", "0.6797585", "0.6780774", "0.67769915", "0.6775576", "0.6773352" ]
0.0
-1
set some base paths as constant
protected function setPath() { $main = dirname(__DIR__); define('MAIN_PATH', $main); define('MEDIA_PATH', $main . '/media'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setBasePath()\n {\n $this->container->instance('path.base', $this->basePath);\n }", "function wpdev_make_constants() {\n \n define(\"BASE_PATH\",__DIR__);\n define(\"URL_SCHEME\",$_SERVER['REQUEST_SCHEME']);\n define(\"BASE_URL\",URL_SCHEME.'://'.$_SERVER['SERVER_NAME'].'/'.basename(BASE_PATH));\n define(\"ADMIN_URL\",BASE_URL.\"/admin\");\n define(\"ADMIN_PATH\",BASE_PATH.\"/admin\");\n \n }", "public function __initPath()\n\t{\n\t\tdefine('IMG_PATH', STATIC_PATH . '/img');\n define('UPLOAD_PATH', STATIC_PATH . '/upload');\n define('CSS_PATH', STATIC_PATH . '/css');\n define('JS_PATH', STATIC_PATH . '/js');\n define('UPLOAD_THUMBAIL_PATH', UPLOAD_PATH . '/thumbnails');\n // Define url to image directory\n define('IMG_URL', STATIC_URL . '/img');\n define('UPLOAD_URL', STATIC_URL . '/upload');\n define('CSS_URL', STATIC_URL . '/css');\n define('JS_URL', STATIC_URL . '/js');\n define('UPLOAD_THUMBAIL_URL', UPLOAD_URL . '/thumbnails');\n\t}", "protected function getAbsoluteBasePath() {}", "function base_path($path = '')\n {\n return str_replace('//' ,'/',str_ireplace('/' . SYSTEMPATHS['core'], '/', __DIR__) . '/' . $path);\n }", "protected function defineConstants()\n {\n define('PATH_ROOT', dirname(__DIR__));\n }", "public function set_base_path( $path ) {\n\t\t$this->base_path = $path;\n\t}", "private static function _initViewScriptsFullPathBase () {\n\t\t$app = & \\MvcCore\\Application::GetInstance();\n\t\tself::$_viewScriptsFullPathBase = implode('/', [\n\t\t\t$app->GetRequest()->GetAppRoot(),\n\t\t\t$app->GetAppDir(),\n\t\t\t$app->GetViewsDir()\n\t\t]);\n\t}", "public function setBasePath($path);", "private function somebody_set_us_up_the_base()\n\t{\n\t\tdefine('BASE', SELF.'?S='.ee()->session->session_id().'&amp;D=cp'); // cp url\n\t}", "public function setBasePath(string $basePath);", "public function base_path($path = null);", "protected static function defineBaseConstants() {}", "function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }", "function set_base_dir($dir) {\n if($dir[strlen($dir)-1] != '/') {\n $dir .= '/'; \n }\n \n $this->base_dir = $dir;\n }", "function set_base($val) {\n\t\t$this->base = $val;\n\t}", "protected function _initPaths()\n {\n defined('PROJECT_PATH') || define('PROJECT_PATH', $this->_getProjectPath());\n defined('APPLICATION_PATH') || define('APPLICATION_PATH', $this->_getApplicationPath());\n defined('LIBRARY_PATH') || define('LIBRARY_PATH', $this->_getLibraryPath());\n defined('DOCUMENT_ROOT') || define('DOCUMENT_ROOT', $this->_getDocumentRoot());\n }", "public function setBasePath($value)\n\t{\n\t\t$this->basePath = rtrim($value, DIRECTORY_SEPARATOR);\n\t}", "protected function defineSitePath() {}", "public static function definePathConstants() {\n if ( !defined('EFC_ROOT_PATH') ) {\n if (strpos(__FILE__, 'webapp/_lib' ) !== false) { // root is up 3 directories\n define('EFC_ROOT_PATH', str_replace(\"\\\\\",'/', dirname(dirname(dirname(__FILE__)))) .'/');\n } else { // root is up 2 directories\n define('EFC_ROOT_PATH', str_replace(\"\\\\\",'/', dirname(dirname(__FILE__))) .'/');\n }\n }\n if (!defined('EFC_WEBAPP_PATH') ) {\n if (file_exists(EFC_ROOT_PATH . 'webapp')) {\n define('EFC_WEBAPP_PATH', EFC_ROOT_PATH . 'webapp/');\n } else {\n define('EFC_WEBAPP_PATH', EFC_ROOT_PATH);\n }\n }\n }", "public function basePath();", "public function basePath();", "public function getBasePath(): string;", "public function getBasePath(): string;", "public function set_path() {\n\t\t\t\n\t\t\t// pick up the path types\n\t\t\t$path_types = include_once(CONFIGPATH . 'path-types.php' );\n\n\t\t\t// get the base path for the deploy type\n\t\t\t$base_path = $path_types[ $this->repo[ 'type' ] ];\n\n\t\t\t// check if it is a valid path\n\t\t\t$this->is_path_valid( $base_path );\n\n\t\t\t// append the repositories name to get the final deploy path\n\t\t\t$this->repo[ 'path' ] = $base_path . '/' . $this->repo[ 'name' ];\n\t\t}", "public function getBasePath();", "public function getBasePath();", "public function getBasePath();", "public function getBasePath();", "function base_path($path = '')\n {\n return phanda()->basePath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "public static function setBaseUrl(): void\n\t{\n\t\tstatic::$scriptDirectory = str_replace('\\\\', '/', dirname(Server::get('SCRIPT_NAME')));\n\t\t$protocol = Server::get('REQUEST_SCHEME') . '://';\n\t\t$hostname = Server::get('HTTP_HOST');\n\t\tstatic::$baseUrl = $protocol . $hostname . static::$scriptDirectory;\n\t}", "protected function defineOriginalRootPath() {}", "private static function getPath() : string {\n return getBasePath() . '/miaus';\n }", "function base_path($path)\n{\n return __DIR__.'/../'.$path;\n}", "public function getPublicBasePath();", "function set_base_url($url) {\n if($url[strlen($url)-1] != '/') {\n $url .= '/'; \n }\n \n $this->base_url = $url;\n }", "public function getBasePath() { return self::$basePath; }", "public function setConstants($paths)\n {\n define ('HOME', $paths['home']);\n define ('PROJ_PATH',$paths['proj']);\n\n define ('REPO_PATH',$paths['repo']);\n define ('REPO', $this->repo);\n\n define ('SITE_PATH', REPO_PATH . \"/public\");\n\n define ('SITE', $this->site);\n define ('SITE_URL', 'http://' . $this->site);\n define ('PLATFORM',$this->platform);\n define ('DB_INI',$paths['db_ini']);\n\n }", "protected function setInitialRelativePath() {}", "public static function setBasePath($path){\n\t\tself::$basePath = $path;\n\t}", "public function testBaseUrl()\n\t{\n \t$this->assertEquals(Util::base('foo'), 'http://localhost/www/foo');\n \t$this->assertEquals(Util::css('foo.css'), 'http://localhost/www/public/css/foo.css');\n \t$this->assertEquals(Util::js('foo.js'), 'http://localhost/www/public/js/foo.js');\n \t$this->assertEquals(Util::img('foo.png'), 'http://localhost/www/public/images/foo.png');\n // Test cached\n $this->assertEquals(Util::base('foo'), 'http://localhost/www/foo');\n\t}", "function basePath() {\n\t$commonPath = __FILE__;\n\t$requestPath = $_SERVER['SCRIPT_FILENAME'];\n\t\n\t//count the number of slashes\n\t// number of .. needed for include level is numslashes(request) - numslashes(common)\n\t// then add one more to get to base\n\t$commonSlashes = substr_count($commonPath, '/');\n\t$requestSlashes = substr_count($requestPath, '/');\n\t$numParent = $requestSlashes - $commonSlashes + 1;\n\t\n\t$basePath = \".\";\n\tfor($i = 0; $i < $numParent; $i++) {\n\t\t$basePath .= \"/..\";\n\t}\n\t\n\treturn $basePath;\n}", "private function set_base_url()\n\t{\n\t\t// We completely kill the site URL value. It's now blank.\n\t\t// This enables us to use only the \"index.php\" part of the URL.\n\t\t// Since we do not know where the CP access file is being loaded from\n\t\t// we need to use only the relative URL\n\t\t$this->config->set_item('site_url', '');\n\n\t\t// We set the index page to the SELF value.\n\t\t// but it might have been renamed by the user\n\t\t$this->config->set_item('index_page', SELF);\n\t\t$this->config->set_item('site_index', SELF); // Same with the CI site_index\n\t}", "private static function base_url($path=NULL)\n {\n\t\tglobal $url;\n $fullurl=$url.$path;\n return $fullurl;\n\t}", "function base_path() {\n return (new Server)->get('DOCUMENT_ROOT');\n }", "public function base($path = null)\n\t{\n\t\treturn ($this->baseUrl ? rtrim($this->baseUrl, '/' ).'/' : '/').($path ? trim($path, '/') : '');\n\t}", "function getBaseUrls()\n{\n // reliable document_root (https://gist.github.com/jpsirois/424055)\n $root_path = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME']);\n $conf_path = rtrim(dirname(dirname(__FILE__)), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n\n // reliable document_root with symlinks resolved\n $info = new \\SplFileInfo($root_path);\n $real_root_path = $info->getRealPath();\n\n // defined root_relative url used in admin routing\n // ie: /my-dir/\n $root_relative_url = '/' . ltrim(\n str_replace(array($real_root_path, DIRECTORY_SEPARATOR), array('', '/'), $conf_path),\n '/'\n );\n // sanitize directory separator\n $base_url = (((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $root_relative_url;\n\n return array(\n 'root_relative_url' => $root_relative_url,\n 'base_url' => $base_url\n );\n}", "function base_path($uri = '', $protocol = NULL)\n\t{\n\t\treturn get_instance()->config->base_path($uri, $protocol);\n\t}", "private function setBaseUrl()\n {\n if (config(\"redx.sandbox\") == true) {\n $this->baseUrl = \"https://sandbox.redx.com.bd\";\n } else {\n $this->baseUrl = \"https://openapi.redx.com.bd\";\n }\n }", "private static function calculatePaths()\n\t{\n\n\t\t//get the raw URI path depth and create relative path to root\n\t\tself::$baseRelativePath = \"\";\n\t\tfor( $x=0; $x<self::$URIRawDepth; $x++ )\n\t\t\tself::$baseRelativePath .= \"../\";\n\n\t\t//create base URL\n//TODO - need to validate HTTP_HOST, can be spoofed by client\n//TODO - need to correctly handle $_SERVER['SERVER_PORT'] VARIANTS http !== 80 || https !== 443, put port\n//TODO - check for multiple consecutive slashes in path (should be fixed for end of path)??\n\t\t$protocol = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' ) ? \"https\" : \"http\";\n\t\t$path = parse_url( $_SERVER['SCRIPT_NAME'], PHP_URL_PATH );\n\t\t$path = substr( $path, 0, strrpos( $path, \"/\" )+1 );\n\t\tself::$baseURL = \"{$protocol}://{$_SERVER['HTTP_HOST']}{$path}\";\n\t}", "protected function setInitialRootPath() {}", "private function setBasePath(string $basePath)\n {\n $this->basePath = rtrim($basePath, '\\/');\n }", "function base_path() {\n\treturn str_replace('index.php','',$_SERVER['SCRIPT_NAME']);\n}", "public function domainLink($base = null) \n\t{\n $config = Zend_Registry::get ( 'app_config' );\n\t\tif ($base == null)\n\t\t{\n\t\t\t$configModule = Zend_Registry::get ( 'config' );\n\t\t\tif (self::$_httpPath === null) {\n\t\t\t\tself::$_httpPath = $config['baseHttpPath'] \n\t\t\t\t\t. $configModule['httpPath'];\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$_httpPath;\n\t\t}\n\t\telse if ($base == 1)\n\t\t{\n\t\t\tif (self::$_baseHttpPath === null) {\n\t\t\t\tself::$_baseHttpPath = $config['baseHttpPath'];\n\t\t\t}\n\t\t\treturn self::$_baseHttpPath;\n\t\t}\n else if ($base == 2)\n {\n return $config['baseHttpPath'] . $config['textEditorPrefix'];\n }\n else if ($base == 3)\n {\n return $config['baseHttpPath'] . $config['tableFridPrefix'];\n }\n\t}", "public function constants(){\n\t\tdefine( 'WPTT_ICS_FEED_FOLDER', dirname( __FILE__ ) );\n\t}", "private static function base_relative($path = null)\n\t{\n\t\t$test\t= self::getProtocol().$_SERVER['HTTP_HOST'].\"/\".apps::getGlobal(\"router\")->getBasePath();\n\t\treturn concat_path($test,$path);\n\t}", "public function get_strBasePath()\n {\n return $this->strBasePath;\n }", "private function loadPath() {\n $this->_system_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'System'.DIRECTORY_SEPARATOR;\n $this->_application_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Application'.DIRECTORY_SEPARATOR;\n $this->_configuration_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR;\n $this->_libraries_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Libraries'.DIRECTORY_SEPARATOR;\n $this->_logs_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR;\n }", "function setPath() {\n\n // Wp installation path\n $wp_install_path = str_replace( 'http://' . $_SERVER['HTTP_HOST'], '', site_url());\n\n // Set the instance starting path\n $this->path = $wp_install_path . App::getOption('path');\n\n // Grab the server-passed \"REQUEST_URI\"\n $this->current_uri = $this->request->server()->get('REQUEST_URI');\n\n // Remove the starting URI from the equation\n // ex. /wp/cocoon/mypage -> /mypage\n $this->request->server()->set(\n 'REQUEST_URI', substr($this->current_uri, strlen($this->path))\n );\n\n }", "function path($path='') {\n return $this->base_dir . $path;\n }", "function wpf_initial_constants() {\t\n\t// Sets the File path to the current parent theme's directory.\n\tdefine( 'PARENT_THEME_DIR', TEMPLATEPATH );\n\n\t// Sets the URI path to the current parent theme's directory.\n\tdefine( 'PARENT_THEME_URI', get_template_directory_uri() );\n\n\t// Sets the File path to the current parent theme's directory.\n\tdefine( 'CHILD_THEME_DIR', STYLESHEETPATH );\n\n\t// Sets the URI path to the current child theme's directory.\n\tdefine( 'CHILD_THEME_URI', get_stylesheet_directory_uri() );\n\n\t// Sets the file path to WP Framework\n\tdefine( 'WPF_DIR', PARENT_THEME_DIR . '/framework' );\n\n\t// Sets the URI path to WP Framework\n\tdefine( 'WPF_URI', PARENT_THEME_URI . '/framework' );\n\n\t// Sets the file path to extensions\n\tdefine( 'WPF_EXT_DIR', WPF_DIR . '/extensions' );\n\n\t// Sets the URI path to extensions\n\tdefine( 'WPF_EXT_URI', WPF_URI . '/extensions' );\n}", "public function setInitialPaths() {}", "public function setPaths()\n\t{\n\t\t$this->componentURL = Request::base() . 'publications/';\n\t\t$this->resourceURL = $this->componentURL . $this->id;\n\n\t\t$database = \\App::get('db');\n\t\t$pub = new \\Components\\Publications\\Tables\\Publication($database);\n\t\t$publication = $pub->getPublication($this->id);\n\t\t$this->resourceSite = \\Components\\Publications\\Helpers\\Html::buildPubPath($this->id, $publication->version_id, '', $publication->secret, 1);\n\t}", "function base_path()\n {\n return dirname(__DIR__);\n }", "function get_base()\n\t{\n\t\t$site_url = get_site_option('siteurl');\n\t\t$base = trim(preg_replace('#https?://[^/]+#ui', '', $site_url), '/');\n\n\t\t// @since 1.3.0 - guess min dir to check for any dir that we have to\n\t\t// remove from the base\n\t\t$this->_guess_min_dir();\n\n\t\t$this->base = !empty($this->remove_from_base)\n\t\t\t? preg_replace('#^' . $this->remove_from_base . '/?#ui', '', $base, 1)\n\t\t\t: $base;\n\t}", "private function detectBaseUrl() {\n $this->baseurl = empty($this->subdir) ? '/' : \"/{$this->subdir}/\";\n }", "private function setBaseUrl()\n {\n $this->baseUrl = config('gladepay.endpoint');\n }", "private function baseName(){\n \n if ($this->baseName===null) {\n $this->baseName= implode('/', array_slice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/';\n }\n return $this->baseName;\n\n }", "function basePath()\n{\n $path= dirname(__FILE__) . '/../';\n if (function_exists('realpath')) {\n $path = realpath($path) . '/';\n }\n\n return $path;\n}", "public function setBase( $base ) {\n\n $this->base = $base;\n }", "function base_url(){\n return BASE_URL;\n }", "protected function determineBaseUrl() {}", "function base_url(){\n $url = BASE_URL;\n return $url;\n }", "public function setBase($baseUrl) {\n\t\t\n\t\t\t$this->_base = $baseUrl;\n\t\t\n\t\t}", "public function testBaseUrlWithBasePath(): void\n {\n Configure::write('App.base', '/cakephp');\n Router::fullBaseUrl('http://example.com');\n Router::setRequest(ServerRequestFactory::fromGlobals());\n\n $this->assertSame('http://example.com/cakephp/tasks', Router::url('/tasks', true));\n }", "protected function _getBase ()\n {\n global $config;\n return $config->current['BASE'];\n }", "public function setBaseUrl($value)\n\t{\n\t\t$this->baseUrl = rtrim($value, '/');\n\t}", "public static function getBasePath() {\n\t \tif(!isset(self::$basePath)) {\n\t \t\t$script = self::getScriptName();\n\t \t\tself::$basePath = substr (\n\t \t\t\t\t$script,\n\t \t\t\t\t0,\n\t \t\t\t\tstrrpos($script, '/' ));\n\t \t}\n\t \treturn self::$basePath;\n\t }", "function getBaseUrl()\n{\n $doc_root_folders = utf8_explode(\"/\", $_SERVER['DOCUMENT_ROOT']);\n $cwd__folders = utf8_explode(\"/\", getcwd());\n //the difference between those is the path from doc root to the folder where\n //all files for this URI reside\n $path_from_doc_root = implode(\"/\", array_diff($cwd__folders, $doc_root_folders));\n return $_SERVER['HTTP_HOST'].'/'.$path_from_doc_root;\n}", "private function basePath(): string\n\t{\n\t\treturn rtrim((new RequestFactory)\n\t\t\t->fromGlobals()->url->basePath, '/');\n\t}", "static public function register($base, $path)\n {\n if (($path = realpath($path)) !== FALSE)\n {\n self::$paths[$base] = $path;\n }\n return $path;\n }", "protected function getBasePath()\n {\n // Note that the actual filesystem base is the 'assets' subdirectory within this\n return ASSETS_PATH . '/SecureAssetsMigrationHelperTest';\n }", "abstract protected function paths();", "public function setBasePath(string $basePath): void\n {\n $this->basePath = $basePath;\n }", "private function setBaseUrl($baseUrl) {\n foreach ($this->activeContexts as $context) {\n $context->setMinkParameter('base_url', $baseUrl);\n }\n }", "private static function setUristr() {\n $uri_request = HttpHelper::getUri();\n if(WEB_DIR != \"/\") {\n self::$uri = str_replace(WEB_DIR, \"\", $uri_request);\n } else {\n self::$uri = substr($uri_request, 1);\n }\n }", "function set_acl_base($base)\n {\n $this->acl_base = $base;\n foreach ($this->plugins as $name => $obj) {\n $this->plugins[$name]->set_acl_base($base);\n }\n }", "protected function getBasePath()\n\t{\n\t\tif ($this->_basePath !== null)\n\t\t\treturn $this->_basePath;\n\t\telse\n\t\t\treturn $this->_basePath = realpath(Yii::app()->basePath.'/../').'/';\n\t}", "public function getBasePath() : string{\n return $this->basePath;\n }", "function setClassMappingsPath($value) {\n\t\t//$path = realpath($value . '/') . '/';\n\t\t$GLOBALS['amfphp']['customMappingsPath'] = $value;\n\t}", "public static function getBasePath()\n {\n\n $baseUrl = trim(_PS_BASE_URL_, '/') . '/';\n\n $baseUri = trim(__PS_BASE_URI__, '/');\n\n // Do some check on subfolder.\n if(!empty($baseUri)) {\n\n $baseUri = $baseUri . '/';\n\n }\n\n return $baseUrl . $baseUri;\n }", "protected static function generate_base_url()\n\t{\n\t\t$base_url = parent::generate_base_url();\n\t\treturn str_replace('htdocs/novius-os/', '', $base_url);\n\t}", "protected static function baseurl($path=NULL)\n {\n\t\t$res=self::base_url($path);\n\t\treturn $res;\n }", "function conf_path($require_settings = TRUE, $reset = FALSE) \r\n{\r\n\tstatic $conf = '';//静态变量\r\n\r\n\tif ($conf && !$reset) {//若静态变量有值,并且 $reset 为默认\r\n\t\treturn $conf;//返回匹配的目录\r\n\t}\r\n\r\n\t$confdir = 'sites';//配置目录\r\n\t$uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);//当前脚本的路径\r\n\t$server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));//将主机名分离为数组\r\n\tfor ($i = count($uri) - 1; $i > 0; $i--) {//遍历\r\n\t\tfor ($j = count($server); $j > 0; $j--) {\r\n\t\t\t$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));\r\n\t\t\tif (file_exists(\"$confdir/$dir/config.php\") || (!$require_settings && file_exists(\"$confdir/$dir\"))) {//若匹配文件找到或者,探测一个匹配的目录并且有指定的目录存在\r\n\t\t\t\t$conf = \"$confdir/$dir\";\r\n\t\t\t\treturn $conf;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t$conf = \"$confdir/default\";\r\n\treturn $conf;\r\n}", "public function setupDefaultContextVariables(): void\n {\n $this->sharedState()->basePath = '/';\n }", "static function basePath($path)\n {\n return base_path($path);\n }", "public function testSetBaseAllowsSettingOfBase()\n {\n $request = new Request($this->config, []);\n $base = uniqid('', true);\n $request->setBase($base);\n $this->assertEquals($base, $request->getBase());\n $this->assertEquals($base, $request->base);\n }", "function asset_base_path(string $path = '') {\n\t\t$path = trim($path, DIRECTORY_SEPARATOR);\n\t\treturn dirname(__DIR__) . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n\t}", "public function getFilesBase();", "public function init()\n {\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\n }", "public function init()\n {\n \tdefined('BASE_URL')\t|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());\n }" ]
[ "0.70817924", "0.69941884", "0.6972934", "0.6912129", "0.6904003", "0.6899061", "0.6824471", "0.68206584", "0.68074673", "0.6799978", "0.6771881", "0.6746874", "0.67183536", "0.6703454", "0.67034185", "0.66788733", "0.66743094", "0.6611539", "0.65948856", "0.6576263", "0.65702176", "0.65702176", "0.65668094", "0.65668094", "0.65637344", "0.65629464", "0.65629464", "0.65629464", "0.65629464", "0.65158653", "0.6476264", "0.6440567", "0.6405735", "0.6388937", "0.6386013", "0.637926", "0.6376308", "0.63678133", "0.636087", "0.6345011", "0.6309034", "0.62958163", "0.62663686", "0.6249434", "0.6248012", "0.6230487", "0.6220209", "0.6214536", "0.62019444", "0.6196392", "0.61908597", "0.61778283", "0.61715835", "0.61623734", "0.615652", "0.6154075", "0.6146377", "0.61444277", "0.6135902", "0.613539", "0.61280507", "0.6118909", "0.60925066", "0.6089056", "0.6088828", "0.608262", "0.60583895", "0.6054854", "0.6045179", "0.60202336", "0.60182637", "0.6016375", "0.6015562", "0.59998655", "0.599832", "0.59869", "0.598451", "0.5978306", "0.5977477", "0.597007", "0.5967304", "0.5955318", "0.59534276", "0.59513223", "0.5942602", "0.5938527", "0.59293896", "0.59113926", "0.591113", "0.59067017", "0.5905529", "0.59028465", "0.589989", "0.58859426", "0.58825874", "0.5856159", "0.5846438", "0.58441395", "0.5841573", "0.5836932", "0.5836932" ]
0.0
-1
initialize some framework components
protected function initFramework() { self::$request = Request::createFromGlobals(); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initialiseComponentsAndServices()\n {\n $this->imager;\n $this->imageOptimize;\n $this->staticCache;\n $this->csrfInjection;\n $this->assetsPlatform;\n $this->cpAlerts;\n $this->redisDebug;\n $this->localDev;\n $this->feedMe;\n $this->blitz;\n }", "public function initialize() {\r\n\t\tparent::initialize();\r\n\t\t\r\n\t\t// load mediawiki api component\r\n\t\t$this->loadComponent( 'MediawikiAPI' );\r\n\t\t$this->loadComponent( 'PasswordGenerator' );\r\n\t\t$this->loadComponent( 'EmailSending' );\r\n\t}", "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 init() {\n\t\t// you may place code here to customize the module or the application\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'common.components.*',\n\t\t));\n\t}", "public function init() {\n\t\tglobal $local_domain;\n#DEV\n\t\t$this->local_domain = isset($_GET[\"testing\"]) ? \"Test\" : $local_domain;\n#END\n#PROD\n#\t\t$this->local_domain = $local_domain;\n#END\n\t\t$this->current_domain = $this->local_domain;\n#DEV\n\t\t$components_names = array();\n\t\t$dir = @opendir(\"component\");\n\t\twhile (($filename = readdir($dir)) <> null) {\n\t\t\tif (substr($filename, 0, 1) == \".\") continue;\n\t\t\tif (is_dir(\"component/\".$filename)) array_push($components_names, $filename);\n\t\t}\n\t\tclosedir($dir);\n\t\tforeach ($components_names as $name) $this->createComponent($name);\n\t\t$done = array();\n\t\tforeach ($this->components as $c) $this->initComponent($c, $done);\n#END\n#PROD\n# ##CREATE_COMPONENTS##\n#foreach (self::getOrderedComponentsNames() as $c) $this->components[$c]->init();\n#END\n#SELECTION_TRAVEL\n#global $installing_selection_travel;\n#$installing_selection_travel = @$installing_selection_travel;\n#if (!$installing_selection_travel) $this->components[\"user_management\"]->login(\"\",\"\",\"\");\n#END\n\t\t$this->initRequest();\n\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()\n\t{\n\t\t$this->resolvePackagePath();\n\t\t$this->registerCoreScripts();\n\t\tparent::init();\n\t}", "public function init() {\n\n // Set required classes for import.\n $this->setImport(array(\n $this->id . '.components.*',\n $this->id . '.components.behaviors.*',\n $this->id . '.components.dataproviders.*',\n $this->id . '.controllers.*',\n $this->id . '.models.*',\n ));\n\n // Set the required components.\n $this->setComponents(array(\n 'authorizer' => array(\n 'class' => 'RAuthorizer',\n 'superuserName' => $this->superuserName,\n ),\n 'generator' => array(\n 'class' => 'RGenerator',\n ),\n ));\n }", "private function initDependencies()\n {\n // == HTML ==========================================================\n $this->di->mapService('core.html.factory', '\\Core\\Html\\HtmlFactory');\n\n // == AJAX ==========================================================\n $this->di->mapService('core.ajax', '\\Core\\Ajax\\Ajax');\n }", "protected abstract function init();", "public function _init() {}", "public static function init()\n {\n self::$browsers = new Browser_Manager();\n self::$users = new User_Manager();\n self::$routes = new Routing_Manager();\n self::$pages = new Page_Manager();\n self::$themes = new Theme_Manager();\n self::$debug = new Debug_Manager();\n\n // disable debugging if we are unit testing\n if (defined('UNIT_TEST') && UNIT_TEST)\n {\n self::$debug->setEnabled(false);\n }\n\n\t\t// with the general environment loaded, we can now load\n\t\t// the modules that are app-specific\n self::$request = new App_Request();\n self::$response = new App_Response();\n self::$conditions = new App_Conditions();\n }", "public function _init(){}", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n //$this->loadComponent('Security');\n //$this->loadComponent('Csrf');\n }", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\n }", "function init()\r\n {\r\n //Copy components to comps, so you can alter components properties\r\n //on init() methods\r\n $comps=$this->components->items;\r\n //Calls children's init recursively\r\n reset($comps);\r\n while (list($k,$v)=each($comps))\r\n {\r\n $v->init();\r\n }\r\n }", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Auth', ['authenticate' =>\n ['ADmad/JwtAuth.Jwt' => [\n 'parameter' => 'token',\n 'userModel' => 'Sessions',\n 'fields' => [\n 'username' => 'username'\n ],\n 'scope' => ['Sessions.status' => 1],\n 'queryDatasource' => true\n ]\n ],'storage' => 'Memory',\n 'checkAuthIn' => 'Controller.initialize',\n 'loginAction' => false,\n 'unauthorizedRedirect' => false]);\n $this->loadComponent('Paginator');\n $this->loadComponent('BryanCrowe/ApiPagination.ApiPagination',[\n 'visible' => [\n 'page',\n 'current',\n 'count',\n 'perPage',\n 'prevPage',\n 'nextPage'\n ]\n ]);\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'forum.models.*',\n\t\t\t'forum.components.*',\n 'forum.controllers.*',\n\t\t));\n\t}", "abstract public function init();", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'clinics.models.*',\n\t\t\t'clinics.components.*',\n\t\t));\n\t}", "abstract function init();", "public function init()\n {\n $this->loadThemeComponent();\n $this->loadConfig();\n }", "public function init(){}", "public function init(){}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'admin.models.*',\n\t\t\t'admin.components.*',\n\t\t));\n\n\t\t$this->_initBootstrap();\n\t\t$this->_initJsCss();\n\t}", "public function init() {\n // you may place code here to customize the module or the application\n // import the module-level models and components\n $this->setImport(array(\n 'sys.models.*',\n 'product.models.*',\n 'sys.components.*',\n 'hr.models.*',\n ));\n }", "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 init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "static function initComponents()\n {\n foreach(self::$components as $component) {\n if ($component['simple'])\n continue;\n\n $file_model = \"components/{$component['component']}/{$component['component']}.model.php\";\n $file_init = \"components/{$component['component']}/{$component['component']}.init.php\";\n if (file_exists($file_init)) {\n require_once ($file_init);\n } else {\n trigger_error(\"File of Init not exists\", E_USER_ERROR);\n }\n if (file_exists($file_model)) {\n require_once ($file_model);\n }\n\n if(method_exists(\"Init{$component['component']}\",$component['view']))\n call_user_func(array(\"Init{$component['component']}\", $component['view']));\n }\n }", "public function init()\n {\n\n $this->addWPConfigs();\n $this->addSPLConfigs();\n $this->addControllerConfigs();\n $this->addFieldGroupConfigs();\n $this->addFieldConfigs();\n $this->addImageSizeConfigs();\n $this->addLayoutConfigs();\n $this->addModelConfigs();\n $this->addPostTypeConfigs();\n $this->addTaxonomyConfigs();\n $this->addTemplateFunctionConfigs();\n $this->addHookableConfigs();\n $this->addSearchConfigs();\n $this->addBaseThemeConfigs();\n\n }", "function init() {}", "public function initialize();", "public function initialize();", "public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }", "abstract protected function _init();", "abstract protected function _init();", "public function init(): void\n {\n }", "public function init()\n {\n // Nothing needs to be done initially, huzzah!\n }", "public function __construct(){\r\n $this->init_hooks();\r\n $this->includes_and_requires();\r\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t\t'admin.models.*',\n\t\t\t\t'admin.components.*',\n\t\t));\n\n\t}", "public function initialize()\n {\n $autoloader = $this->registerAutoloader();\n $this->registerPlugins($autoloader);\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n \n\t\t$this->setImport(array('my.models.*',));\n\t}", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'music.models.*',\n\t\t\t'music.components.*',\n\t\t));\n\t}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}" ]
[ "0.79304284", "0.7621783", "0.7368248", "0.7309059", "0.723855", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7231666", "0.7226824", "0.72201693", "0.72145337", "0.72134876", "0.72074205", "0.71961844", "0.7176952", "0.7166276", "0.7155181", "0.7147238", "0.7135366", "0.7135366", "0.7135366", "0.7135366", "0.7135366", "0.7135366", "0.7135242", "0.7123217", "0.7117717", "0.70962656", "0.70948535", "0.7088072", "0.70742965", "0.70742965", "0.70740724", "0.707104", "0.70672864", "0.70672864", "0.70672864", "0.70672864", "0.70672864", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661753", "0.70661724", "0.70661724", "0.70661724", "0.70661724", "0.70656943", "0.70656943", "0.70656943", "0.70656943", "0.70656943", "0.70656943", "0.7064928", "0.7064928", "0.70645666", "0.7053605", "0.704594", "0.70423704", "0.70423704", "0.70342416", "0.70335764", "0.70335764", "0.7027024", "0.7026514", "0.70172566", "0.70169383", "0.7016283", "0.701299", "0.6986461", "0.697915", "0.6978624", "0.6978624", "0.6978206", "0.6978206", "0.6978206", "0.6978206", "0.6978206", "0.6977205", "0.6977205" ]
0.0
-1
lunch routers from defined map
protected function routeMap() { $this->routCollection = new RouteCollection(); foreach ($this->routers as $rout) { $this->routCollection->add( $rout['name'], new Route( $rout['route'], ['controller' => $rout['controller']] ) ); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build_route_map($routes) {}", "public function map()\n {\n //panel\n $this->mapPanelRoutes();\n //auth\n $this->mapAuthRoutes();\n //almacen\n $this->mapInventoryRoutes();\n //contabilidad\n $this->mapAccountingRoutes();\n //Recursos Humanos\n $this->mapHumanResourceRoutes();\n //ventas\n $this->mapSaleRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "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 function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapUserRoutes();\n $this->mapTrainingRoutes();\n $this->mapTrainingModeRoutes();\n $this->mapTrainingSystemRoutes();\n $this->mapTrainingBrandRoutes();\n $this->mapTrainingTypeRoutes();\n $this->mapTrainingAudienceRoutes();\n $this->mapTrainingTargetRoutes();\n $this->mapTrainingUserRoutes();\n $this->mapTrainingHistoryRoutes();\n $this->mapReportsRoutes();\n $this->mapTopPerformanceRoutes();\n }", "public function populate_router() {\n if (Cache::has(APP_NAME.\"_Marmalade\\Router\\Routes\")) {\n $this->routes = Cache::get(APP_NAME.\"_Marmalade\\Router\\Routes\");\n } else {\n $this->build_route_map(Routes::load_routes());\n if (ENABLE_CACHE) {\n Cache::set(APP_NAME.\"_Marmalade\\Router\\Routes\", $this->routes);\n }\n }\n }", "protected function loadRoutes()\n {\n $this->app->call([$this, 'map']);\n }", "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 map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapProcessEngineRoutes();\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function bootRouters() : void\n {\n // Here we just need to instantiate each router as\n // they handle the mapping themselves\n foreach ($this->getRouters() as $router) {\n app($router);\n }\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n $this->mapAdminRoutes();\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapMobileRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapCustomerRoutes();\n\n $this->mapInternalRoutes();\n\n $this->mapVendorRoutes();\n\n $this->mapWhiteGloveRoutes();\n\n $this->mapLocalRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapFrontWebRoutes();\n $this->mapBackWebRoutes();\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 }", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // only for test\n // sometime js file has map file but not found in server\n if (ENVIRONMENT === 'development') {\n log_message('error', json_encode($uri));\n }\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using HTTP verbs\n if (is_array($val))\n {\n $val = array_change_key_case($val, CASE_LOWER);\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "abstract public function map(Router $router);", "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\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->mapRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapWebRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "public function getSystemRoutes();", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "protected function init() {\n\t\t$routes = $this->routePluginManager;\n\t\tforeach ( array (\n\t\t\t\t'hostname' => __NAMESPACE__ . '\\Hostname',\n\t\t\t\t'literal' => __NAMESPACE__ . '\\Literal',\n\t\t\t\t'part' => __NAMESPACE__ . '\\Part',\n\t\t\t\t'regex' => __NAMESPACE__ . '\\Regex',\n\t\t\t\t'scheme' => __NAMESPACE__ . '\\Scheme',\n\t\t\t\t'segment' => __NAMESPACE__ . '\\Segment',\n\t\t\t\t'wildcard' => __NAMESPACE__ . '\\Wildcard',\n\t\t\t\t'query' => __NAMESPACE__ . '\\Query',\n\t\t\t\t'method' => __NAMESPACE__ . '\\Method' \n\t\t) as $name => $class ) {\n\t\t\t$routes->setInvokableClass ( $name, $class );\n\t\t}\n\t\t;\n\t}", "public function map()\n {\n $this->mapServiceRoutes();\n }", "public function get_router();", "public function map()\n {\n $this->adminGroup(function () {\n $this->mapAdminRoutes();\n });\n }", "public static function map() {\n if (count($argv) > 1) { \n $args = self::getArguments();\n $options = self::convertArgsToOptions($args);\n $class_map = self::routeUsingOpts($options);\n }\n else {\n $class_map = self::checkBaseDir();\n $options = self::convertArgsToOptions();\n } \n \n $ser_array = self::serializeClassMap($class_map, $options['type']);\n self::writeSerialized($ser_array);\n print_r($class_map);\n \n }", "public function map()\n {\n $this->mapWebRoutes();\n }", "public function registerRouters () {\n\t\tif ( !current_user_can( 'manage_options' ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->classes as $class ) {\n\t\t\t\\Maven\\Core\\HookManager::instance()->addFilter( 'json_endpoints', array( $class, 'registerRoutes' ) );\n\t\t}\n\t}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n }", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/base.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n // $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/auth.php');\n }", "public function __construct($path_routes_map = array())\r\n {\r\n self::$map = $path_routes_map;\r\n }", "protected function _initLoadRouter(){\r\n\t}", "public function map()\n {\n $this->mapV1Routes();\n }", "private function renderMapRoute()\n {\n $arrReturn = array\n (\n 'error' => false,\n 'prompt' => null\n );\n\n // RETURN : Map +Routes is disabled\n if ( $this->enabled != 'Map +Routes' )\n {\n // DRS\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Map +Routes is disabled.';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n } // DRS\n return $arrReturn;\n } // RETURN : Map +Routes is disabled\n\n $mode = $this->confMap[ 'compatibility.' ][ 'mode' ];\n\n // RETURN : leaflet is enabled\n switch ( $mode )\n {\n case('leaflet (default)'):\n // DRS\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Map +Routes is disabled, because map mode is ' . $mode;\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n } // DRS\n return $arrReturn;\n case('oxMap (deprecated)'):\n // follow the workflow\n break;\n default:\n $header = 'FATAL ERROR!';\n $text = 'Unexpeted value. navigation.map.compatibility.mode is \"' . $mode . '\"';\n $this->pObj->drs_die( $header, $text );\n break;\n } // RETURN : leaflet is enabled\n // Init\n $this->renderMapRouteInit();\n\n // Get paths\n // #i0020, 130718, dwildt\n $arrResult = $this->renderMapRoutePaths();\n $rowsPathWiCat = $arrResult[ 'rowsPathWiCat' ];\n $jsonData = $arrResult[ 'jsonData' ];\n\n\n // Get marker\n $marker = $this->renderMapRouteMarker( $rowsPathWiCat );\n\n $arrReturn[ 'marker' ] = $marker;\n $arrReturn[ 'jsonRoutes' ] = $jsonData;\n // #i0020, 130718, dwildt, 1+\n $arrReturn[ 'rows' ] = $rowsPathWiCat;\n//$this->pObj->dev_var_dump( $arrReturn );\n\n return $arrReturn;\n }", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "public function & GetRouter ();", "function defineRoutes(&$router) {\n /*\n * example routers\n * \n * \n */\n //$router->map('modulename', 'modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('dashboard_modulename', 'dashboard/modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('modulename_view_project', 'modulename/:project_id/view', array('controller' => 'modulename', 'action' => 'view'), array('project_id' => '\\d+'));\n }", "private function initRouter()\n {\n $this->di->mapService('core.router', '\\Core\\Router\\Router');\n\n $this->router = $this->di->get('core.router');\n $this->router->setBaseUrl(BASEURL);\n $this->router->setParametersToTarget([\n 'app',\n 'controller',\n 'action'\n ]);\n $this->router->addMatchTypes([\n 'mvc' => '[A-Za-z0-9_]++'\n ]);\n\n // Generic routes\n $routes = [\n 'index' => [\n 'route' => '/[mvc:app]/[mvc:controller]',\n 'target' => [\n 'action' => 'index'\n ]\n ],\n 'action' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[mvc:action]'\n ],\n 'id' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]'\n ],\n 'child' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]/of/[i:id_parent]'\n ]\n ];\n\n foreach ($routes as $name => $route) {\n $this->router->map($route['method'] ?? 'GET|POST', $route['route'], $route['target'] ?? [], 'generic.' . $name);\n }\n }", "public function mapRoutes()\n {\n Router::loadRouteFiles(\"web.php\");\n Router::loadRouteFiles('patients.php');\n }", "public function call( &$env )\n\t{\n\t\t$env_server_name = @$env[ 'SERVER_NAME' ];\n\t\t$env_server_port = @$env[ 'SERVER_PORT' ];\n\t\t$env_path = @$env[ 'PATH_INFO' ];\n\t\t$env_script_name = @$env[ 'SCRIPT_NAME' ];\n\t\t$env_http_host = @$env[ 'HTTP_HOST' ];\n\t\t\n\t\ttry\n\t\t{\n\t\t\tforeach ( $this->mapping as $mapping )\n\t\t\t{\n\t\t\t\tlist( $mapping_host, $mapping_location, $mapping_matcher, $mapping_middleware_app ) = $mapping;\n\t\t\t\t\n\t\t\t\t// All the conditions for which we'd consider the request host as a 'match':\n\t\t\t\t$host_viable = $mapping_host == $env_http_host ||\n\t\t\t\t $env_server_name == $env_http_host ||\n\t\t\t\t ( is_null( $mapping_host ) &&\n\t\t\t\t ( $env_http_host == $env_server_name ||\n\t\t\t\t $env_http_host == $env_server_name.':'.$env_server_port ) );\n\t\t\t\t\n\t\t\t\t// Skip the current entry if none of these strategies evaluate to true:\n\t\t\t\tif ( !$host_viable )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// Each entry has a regex pattern to match against. Check if the request URI matches:\n\t\t\t\tif ( !( preg_match_all( $mapping_matcher, $env_path, $matches ) > 0 ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// If the request URI matches, the remainder (i.e. $match[ 1 ]) should start with a '/':\n\t\t\t\tif ( !( empty( $matches[ 1 ][ 0 ] ) || substr( $matches[ 1 ][ 0 ], 0, 1 ) == '/' ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// If we got here, we found a matching route. Given:\n\t\t\t\t// a) we're matching against '/admin/panel'\n\t\t\t\t// b) the request URI (minus host) is '/admin/panel/foo'\n\t\t\t\t// This next line will change the environment properties thusly:\n\t\t\t\t// SCRIPT_NAME => '/admin/panel'\n\t\t\t\t// PATH_INFO => '/foo'\n\t\t\t\t// Note that any query string won't make it into PATH_INFO because the web server will put it in QUERY_STRING.\n\t\t\t\t$env = array_merge( $env, array( 'SCRIPT_NAME' => $env_script_name.$mapping_location, 'PATH_INFO' => $matches[ 1 ][ 0 ] ) );\n\t\t\t\t\n\t\t\t\t// Call the middleware the entry refers to, providing it the newly modified environment.\n\t\t\t\t$return = $mapping_middleware_app->call( $env );\n\t\t\t\t\n\t\t\t\t$env = array_merge( $env, array( 'PATH_INFO' => $env_path, 'SCRIPT_NAME' => $env_script_name ) );\n\t\t\t\t\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\t\n\t\t\tarray_merge( $env, array( 'PATH_INFO' => $env_path, 'SCRIPT_NAME' => $env_script_name ) );\n\t\t\t\n\t\t\treturn array( 404, array( 'Content-Type' => 'text/html', 'X-Cascade' => 'pass' ), array( \"Not Found: {$env_path}\" ) );\n\t\t}\n\t\tcatch ( Exception $e )\n\t\t{\n\t\t\t$env = array_merge( $env, array( 'PATH_INFO' => $env_path, 'SCRIPT_NAME' => $env_script_name ) );\n\t\t\tthrow $e; // Not sure if this is what we want.\n\t\t}\n\t}", "public function bootstrap()\n {\n $this->mapRoutes();\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 defineRoutes(&$router) {\n \n // Main\n $router->map('mobile_access', 'm', array('controller' => 'mobile_access', 'action' => 'index'));\n \n $router->map('mobile_access_login', 'm/login', array('controller' => 'mobile_access_auth', 'action' => 'login'));\n $router->map('mobile_access_logout', 'm/logout', array('controller' => 'mobile_access_auth', 'action' => 'logout'));\n $router->map('mobile_access_forgot_password', 'm/forgot-password', array('controller' => 'mobile_access_auth', 'action' => 'forgot_password'));\n \n // Quick Add\n $router->map('mobile_access_quick_add', 'm/starred', array('controller' => 'mobile_access', 'action' => 'quick_add'));\n \n // Assignments\n $router->map('mobile_access_assignments', 'm/assignments', array('controller' => 'mobile_access', 'action' => 'assignments'));\n \n // Starred\n $router->map('mobile_access_starred', 'm/starred', array('controller' => 'mobile_access', 'action' => 'starred'));\n \n // People\n $router->map('mobile_access_people', 'm/people', array('controller' => 'mobile_access_people', 'action' => 'index'));\n $router->map('mobile_access_view_company', 'm/people/:object_id', array('controller' => 'mobile_access_people', 'action' => 'company'), array('object_id' => '\\d+'));\n $router->map('mobile_access_view_user', 'm/people/users/:object_id', array('controller' => 'mobile_access_people', 'action' => 'user'), array('object_id' => '\\d+'));\n \n \n // Projects\n $router->map('mobile_access_projects', 'm/projects', array('controller' => 'mobile_access_projects', 'action' => 'index'));\n \n // Project\n $router->map('mobile_access_view_project', 'm/project/:project_id', array('controller' => 'mobile_access_project', 'action' => 'index'), array('project_id' => '\\d+'));\n \n // Project discusions\n $router->map('mobile_access_view_discussions', 'm/project/:project_id/discussions', array('controller' => 'mobile_access_project_discussions', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_discussion', 'm/project/:project_id/discussions/:object_id', array('controller' => 'mobile_access_project_discussions', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project milestones\n $router->map('mobile_access_view_milestones', 'm/project/:project_id/milestones', array('controller' => 'mobile_access_project_milestones', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_milestone', 'm/project/:project_id/milestones/:object_id', array('controller' => 'mobile_access_project_milestones', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project files\n $router->map('mobile_access_view_files', 'm/project/:project_id/files', array('controller' => 'mobile_access_project_files', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_file', 'm/project/:project_id/files/:object_id', array('controller' => 'mobile_access_project_files', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project checklists\n $router->map('mobile_access_view_checklists', 'm/project/:project_id/checklists', array('controller' => 'mobile_access_project_checklists', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_checklist', 'm/project/:project_id/checklists/:object_id', array('controller' => 'mobile_access_project_checklists', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project pages\n $router->map('mobile_access_view_pages', 'm/project/:project_id/pages', array('controller' => 'mobile_access_project_pages', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_page', 'm/project/:project_id/pages/:object_id', array('controller' => 'mobile_access_project_pages', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_page_version', 'm/project/:project_id/pages/:object_id/version/:version', array('controller' => 'mobile_access_project_pages', 'action' => 'version'), array('project_id' => '\\d+', 'object_id' => '\\d+', 'version' => '\\d+'));\n \n // Project tickets\n $router->map('mobile_access_view_tickets', 'm/project/:project_id/tickets', array('controller' => 'mobile_access_project_tickets', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_ticket', 'm/project/:project_id/tickets/:object_id', array('controller' => 'mobile_access_project_tickets', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project timerecords\n $router->map('mobile_access_view_timerecords', 'm/project/:project_id/timerecords', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_timerecord', 'm/project/:project_id/timerecords/:object_id', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project subobjects\n $router->map('mobile_access_view_task', 'm/project/:project_id/task/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_comment', 'm/project/:project_id/comment/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_add_comment', 'm/project/:project_id/comment/add', array('controller' => 'mobile_access_project', 'action' => 'add_comment'));\n \n // Common\n $router->map('mobile_access_view_category', 'm/category/:object_id', array('controller' => 'mobile_access', 'action' => 'view_category', array('object_id' => '\\d+')));\n $router->map('mobile_access_toggle_object_completed_status', 'm/project/:project_id/toggle-completed/:object_id', array('controller' => 'mobile_access', 'action' => 'toggle_completed', array('project_id' => '\\d+', 'object_id' => '\\d+')));\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 }", "private function register_routes() {\n\t\t$routes = $this->get_routes();\n\t\tforeach ( $routes as $route ) {\n\t\t\t$route->register();\n\t\t}\n\t}", "public function make(array $routes);", "public static function preRouter(){\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(array $params)\n {\n $sortByHandler = array_key_exists('h', $params);\n $host = $params['host'] ?? null;\n\n // Set HTTP_HOST\n if ($host) {\n $request = Services::request();\n $_SERVER = $request->getServer();\n $_SERVER['HTTP_HOST'] = $host;\n $request->setGlobal('server', $_SERVER);\n }\n\n $collection = Services::routes()->loadRoutes();\n\n // Reset HTTP_HOST\n if ($host) {\n unset($_SERVER['HTTP_HOST']);\n }\n\n $methods = [\n 'get',\n 'head',\n 'post',\n 'patch',\n 'put',\n 'delete',\n 'options',\n 'trace',\n 'connect',\n 'cli',\n ];\n\n $tbody = [];\n $uriGenerator = new SampleURIGenerator();\n $filterCollector = new FilterCollector();\n\n $definedRouteCollector = new DefinedRouteCollector($collection);\n\n foreach ($definedRouteCollector->collect() as $route) {\n $sampleUri = $uriGenerator->get($route['route']);\n $filters = $filterCollector->get($route['method'], $sampleUri);\n\n $routeName = ($route['route'] === $route['name']) ? '»' : $route['name'];\n\n $tbody[] = [\n strtoupper($route['method']),\n $route['route'],\n $routeName,\n $route['handler'],\n implode(' ', array_map('class_basename', $filters['before'])),\n implode(' ', array_map('class_basename', $filters['after'])),\n ];\n }\n\n if ($collection->shouldAutoRoute()) {\n $autoRoutesImproved = config(Feature::class)->autoRoutesImproved ?? false;\n\n if ($autoRoutesImproved) {\n $autoRouteCollector = new AutoRouteCollectorImproved(\n $collection->getDefaultNamespace(),\n $collection->getDefaultController(),\n $collection->getDefaultMethod(),\n $methods,\n $collection->getRegisteredControllers('*')\n );\n\n $autoRoutes = $autoRouteCollector->get();\n\n // Check for Module Routes.\n if ($routingConfig = config(Routing::class)) {\n foreach ($routingConfig->moduleRoutes as $uri => $namespace) {\n $autoRouteCollector = new AutoRouteCollectorImproved(\n $namespace,\n $collection->getDefaultController(),\n $collection->getDefaultMethod(),\n $methods,\n $collection->getRegisteredControllers('*'),\n $uri\n );\n\n $autoRoutes = [...$autoRoutes, ...$autoRouteCollector->get()];\n }\n }\n } else {\n $autoRouteCollector = new AutoRouteCollector(\n $collection->getDefaultNamespace(),\n $collection->getDefaultController(),\n $collection->getDefaultMethod()\n );\n\n $autoRoutes = $autoRouteCollector->get();\n\n foreach ($autoRoutes as &$routes) {\n // There is no `auto` method, but it is intentional not to get route filters.\n $filters = $filterCollector->get('auto', $uriGenerator->get($routes[1]));\n\n $routes[] = implode(' ', array_map('class_basename', $filters['before']));\n $routes[] = implode(' ', array_map('class_basename', $filters['after']));\n }\n }\n\n $tbody = [...$tbody, ...$autoRoutes];\n }\n\n $thead = [\n 'Method',\n 'Route',\n 'Name',\n $sortByHandler ? 'Handler ↓' : 'Handler',\n 'Before Filters',\n 'After Filters',\n ];\n\n // Sort by Handler.\n if ($sortByHandler) {\n usort($tbody, static fn ($handler1, $handler2) => strcmp($handler1[3], $handler2[3]));\n }\n\n if ($host) {\n CLI::write('Host: ' . $host);\n }\n\n CLI::table($tbody, $thead);\n }", "public function loadRoutes(\\Nette\\Application\\IRouter $router, $args)\r\n {\r\n }", "public function run()\n {\n $routes = new Routes($this->router);\n $routes->start();\n $this->router->start();\n }", "public function getRoutes() {}", "public function getRouter();", "public function process_cmdmap() {}", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n }", "protected function mapBotManCommands()\n {\n require base_path('routes/botman.php');\n }", "public function loadRoutes()\r\n {\r\n $serverPHPSelf = filter_input(INPUT_SERVER, 'PHP_SELF');\r\n $serverPHPRequest = filter_input(INPUT_SERVER, 'REQUEST_URI');\r\n $selfPart = substr($serverPHPSelf, 0, strrpos($serverPHPSelf, '/') + 1);\r\n $requestUri = str_replace($selfPart, '', $serverPHPRequest);\r\n $queryPos = strpos($requestUri, '?');\r\n $request = $queryPos !== false ? substr($requestUri, 0, strpos($requestUri, '?')) : $requestUri;\r\n $this->request = (substr($request, -1) === '/') ?\r\n substr($request, 0, -1) : $request;\r\n if ($request === 'routes/update') {\r\n $this->updateRoutes();\r\n exit;\r\n } else if (file_exists(self::ROUTES_PATH)) {\r\n $this->routes = json_decode(file_get_contents(self::ROUTES_PATH));\r\n $this->patterns = array_keys(get_object_vars($this->routes));\r\n return $this;\r\n } else {\r\n throw new \\Exception('Routes file do not exists. Please, run routes/update.');\r\n }\r\n }", "function routes_poputi(){\n\n\n $routes[] = array(\n '_uri' => '/^poputi\\/v([0-9]+).html$/i',\n 'do' => 'read_v',\n 1 => 'id'\n );\n\t\t\t\t\t\t \n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/published([0-9]+).html$/i',\n 'do' => 'published',\n 1 => 'id'\n );\n\t\t\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/status([0-9]+)-([0-9]+).html$/i',\n 'do' => 'status',\n 1 => 'id',\n 2 => 'st'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/depub([0-9]+).html$/i',\n 'do' => 'depublished',\n 1 => 'id'\n );\n\t\t\n $routes[] = array(\n '_uri' => '/^poputi\\/p([0-9]+).html$/i',\n 'do' => 'read_p',\n 1 => 'id'\n );\n\t\t\t\t\t\t \n $routes[] = array(\n '_uri' => '/^poputi\\/del([0-9]+).html$/i',\n 'do' => 'delprof',\n 1 => 'id'\n );\n\n $routes[] = array(\n '_uri' => '/^poputi\\/add.html$/i',\n 'do' => 'add'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/edit([0-9]+).html$/i',\n 'do' => 'edit',\n\t\t\t\t\t\t\t1\t\t=> 'id'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/search$/i',\n 'do' => 'search'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/drivers\\/([0-9]+)$/i',\n 'do' => 'drivers',\n\t\t\t\t\t\t\t1\t\t=> 'page'\n );\n\t\t\t\t\t\t \n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/passenger\\/([0-9]+)$/i',\n 'do' => 'passenger',\n\t\t\t\t\t\t\t1\t\t=> 'page'\n );\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/drivers$/i',\n 'do' => 'drivers'\n );\n\t\t\t\t\t\t \n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/passenger$/i',\n 'do' => 'passenger'\n );\n\n return $routes;\n\n }", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public function setRouting()\n {\n // Are query strings enabled in the config file? Normally CI doesn't utilize query strings\n // since URI segments are more search-engine friendly, but they can optionally be used.\n // If this feature is enabled, we will gather the directory/class/method a little differently\n $segments = array();\n $enableQueryStrings = Fly::getConfig('enableQueryStrings');\n $ct = Fly::getConfig('aliasController');\n $dt = Fly::getConfig('aliasModule');\n $ft = Fly::getConfig('aliasAction');\n\n if ($enableQueryStrings === true && isset($_GET[$ct])) {\n\n if (isset($_GET[$dt])) {\n $this->setModule(trim($this->uri->filterUri($_GET[$dt])));\n $segments[] = $this->fetchModule();\n }\n\n if (isset($_GET[$ct])) {\n $this->setClass(trim($this->uri->filterUri($_GET[$ct])));\n $segments[] = $this->fetchClass();\n }\n\n if (isset($_GET[$ft])) {\n $this->setMethod(trim($this->uri->filterUri($_GET[$ft])));\n $segments[] = $this->fetchMethod();\n }\n }\n\n // Load the routes.php file.\n Fly::app()->loadConfig('config.routes', true, true);\n $route = Fly::app()->getConfig('routes');\n $this->routes = (!isset($route) || !is_array($route)) ? array() : $route;\n unset($route);\n\n // Set the default controller so we can display it in the event\n // the URI doesn't correlated to a valid controller.\n $this->default_controller = (!isset($this->routes['defaultController']) || $this->routes['defaultController'] == '') ? false : $this->routes['defaultController'];\n\n // Were there any query string segments? If so, we'll validate them and bail out since we're done.\n if (count($segments) > 0) {\n $r = $this->validateRequest($segments);\n if ($r === null) {\n return array();\n }\n if (isset($r['segments'])) {\n return $r['segments'];\n }\n return array();\n }\n\n // Fetch the complete URI string\n $this->uri->fetchUriString();\n\n // Is there a URI string? If not, the default controller specified in the \"routes\" file will be shown.\n if ($this->uri->getUriString() == '') {\n return $this->setDefaultController();\n }\n\n // Do we need to remove the URL suffix?\n $this->uri->removeUrlSuffix();\n\n // Compile the segments into an array\n $this->uri->explodeSegments();\n\n // Parse any custom routing that may exist\n $this->parseRoutes();\n\n // Re-index the segment array so that it starts with 1 rather than 0\n $this->uri->reindexSegments();\n }", "public static function routes(): void\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}", "public function registerRoutes(Map $map)\n {\n $map->attach('legacy.', '/', function (Map $map) {\n\n // Admin\n //$map->get('admin.index', 'admin/', $this->controller(AdminController::class, 'index'))->allows(['POST']);\n $map->get('admin.assets', 'admin/assets/{asset}', $this->controller(AdminController::class, 'assets'))\n ->tokens(['asset' => '.+']);\n $map->get('admin.page', 'admin/', $this->controller(AdminController::class, 'index'))->allows(['POST'])\n ->wildcard('page');\n\n // Index\n $map->get('index', '', $this->controller(PagesController::class, 'index'))->allows(['POST']);\n\n // Named article\n $map->get('article', '{name}.html', $this->controller(PagesController::class, 'articles'))\n ->tokens(['name' => '[^/.]+'])\n ->allows(['POST']);\n\n // Pages\n $map->get('affiliates', 'affiliates/', $this->page('affiliates'))->allows(['POST']);\n $map->get('articles', 'articles/', $this->page('articles'))->allows(['POST']);\n $map->get('captcha', 'captcha/', $this->page('captcha'))->allows(['POST']);\n $map->get('comments', 'comments/', $this->page('comments'))->allows(['POST']);\n $map->get('confirm', 'confirm/', $this->page('confirm'))->allows(['POST']);\n $map->get('dlfile', 'dlfile/', $this->page('dlfile'))->allows(['POST']);\n $map->get('download', 'download/', $this->page('download'))->allows(['POST']);\n $map->get('feed', 'feed/', $this->page('feed'))->allows(['POST']);\n $map->get('gallery', 'gallery/', $this->page('gallery'))->allows(['POST']);\n $map->get('login', 'login/', $this->page('login'))->allows(['POST']);\n $map->get('logout', 'logout/', $this->page('logout'))->allows(['POST']);\n $map->get('news', 'news/', $this->page('news'))->allows(['POST']);\n $map->get('news_search', 'news_search/', $this->page('news_search'))->allows(['POST']);\n $map->get('press', 'press/', $this->page('press'))->allows(['POST']);\n $map->get('register', 'register/', $this->page('register'))->allows(['POST']);\n $map->get('search', 'search/', $this->page('search'))->allows(['POST']);\n $map->get('shop', 'shop/', $this->page('shop'))->allows(['POST']);\n $map->get('style_selection/', 'style_selection/', $this->page('style_selection'))->allows(['POST']);\n $map->get('user', 'user/', $this->page('user'))->allows(['POST']);\n $map->get('user_edit', 'user_edit/', $this->page('user_edit'))->allows(['POST']);\n $map->get('user_list', 'user_list/', $this->page('user_list'))->allows(['POST']);\n $map->get('viewer', 'viewer/', $this->page('viewer'))->allows(['POST']);\n });\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 static function getRoutes();", "public static function getRoutes();", "function add_listing_routes()\n {\n $this->add_route('GET', '/routes', function(){\n print \"<h1>Routes</h1>\";\n foreach($this->routes as $method => $routes) {\n print \"<h3>\".$method.\"</h3>\";\n print \"<ul>\";\n foreach ($routes as $route) {\n print \"<li>\".$route->path.\"</li>\";\n }\n print \"</ul>\";\n }\n });\n }", "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}", "abstract protected function createRouter(array $data = []);", "protected function loadRoutes()\n\t{\n\t\tglobal $app;\n\t\t$app = $this->app;\n\t\n\t\t$routesPaths = $this->container->locator->findResources('routes://', true, true);\n\n\t\tforeach ($routesPaths as $key => $path) {\n\t\t\t$routeFiles = glob($path . '/*.php');\n\t\t\n\t\t\tforeach ($routeFiles as $file) {\n\t\t\t\trequire_once $file;\n\t\t\t}\n\t\t}\n\t}", "private function initialize_routes() {\n // capture request method, url string, and break url string into parts (around '/')\n $this->request_method = $_SERVER['REQUEST_METHOD'];\n $this->url_parts_string = (isset($_GET['p'])) ? rtrim(strtolower($_GET['p']), '/'): '';\n $this->url_parts = explode('/', $this->url_parts_string);\n \n // capture request payload\n $this->payload = array();\n if ($this->request_method == 'POST') { \n // POST data if avaiable\n if (!empty($_POST)) {\n $this->payload = $_POST;\n \n // raw JSON if aviaible\n } else {\n $fp = fopen('php://input', 'r');\n $raw_data = stream_get_contents($fp);\n $posted_json = (array)json_decode($raw_data);\n \n if (!empty($posted_json)) {\n $this->payload = $posted_json;\n }\n }\n }\n \n // type cast all dynamic url parts as INT or FLOAT else leave as STRING\n $preg_pattern = '/[a-zA-Z]/';\n foreach ($this->url_parts as $key=>$value) {\n preg_match($preg_pattern, $value, $matches);\n if (empty($matches)) {\n if ((int)$value != null) $this->url_parts[$key] = (int)$value;\n else if ((float)$value != null) $this->url_parts[$key] = (float)$value; \n }\n }\n \n return true;\n }", "public function map()\n {\n $this->prefix('stats')->name('stats.')->group(function () {\n $this->get('/', 'DashboardController@index')\n ->name('index'); // admin::tracker.stats.index\n });\n\n $this->prefix('visitors')->name('visitors.')->group(function () {\n $this->get('/', 'VisitorsController@index')\n ->name('index'); // admin::tracker.visitors.index\n });\n\n $this->prefix('settings')->name('settings.')->group(function () {\n $this->get('/', 'SettingsController@index')\n ->name('index'); // admin::tracker.settings.index\n });\n }", "protected function loadRoutesForBoot(): void\n {\n $this->configureRateLimiting();\n $apiRoutes = $this->getApiRoutesFromContainers();\n $webRoutes = $this->getWebRoutesFromContainers();\n\n $this->routes(function () use ($apiRoutes, $webRoutes) {\n foreach ($apiRoutes as $route){\n Route::middleware('api')\n ->prefix('api')\n ->group($route);\n }\n\n foreach ($webRoutes as $route){\n Route::middleware('web')\n ->group($route);\n }\n });\n }", "public function getRoutes();", "public function getRoutes();", "function run_iip_map() {\n \t$plugin = new IIP_Map();\n \t$plugin->run();\n}", "protected function loadRoutes()\n {\n // Route definitions\n $params = [\n 'id' => time(),\n 'slug' => 'china-love-day',\n 'category' => 'summer',\n 'time' => time(),\n 'module' => $this->getModule(),\n 'controller' => 'route',\n ];\n $id = $this->params('id');\n $slug = $this->params('slug');\n $category = $this->params('category');\n $time = $this->params('time');\n $module = $this->getModule();\n $module = $this->params('module');\n $controller = $this->params('controller');\n\n $routeDefs = [\n 'demo-id' => [\n 'label' => __('Default with ID'),\n 'route' => 'demo-slug',\n 'params' => [\n 'action' => 'id',\n 'id' => $params['id'],\n ],\n ],\n 'demo-slug' => [\n 'route' => 'demo-slug',\n 'label' => __('Slug'),\n 'params' => [\n 'action' => 'slug',\n 'slug' => $params['slug'],\n ],\n ],\n 'demo-slug-id' => [\n 'label' => __('Slug & ID'),\n 'route' => 'demo-slug',\n 'params' => [\n 'action' => 'slug',\n 'id' => $params['id'],\n 'slug' => $params['slug'],\n ],\n ],\n 'demo-category' => [\n 'label' => __('Category'),\n 'route' => 'demo-category',\n 'params' => [\n 'action' => 'category',\n 'id' => $params['id'],\n 'slug' => $params['slug'],\n 'category' => $params['category'],\n ],\n ],\n 'demo-time' => [\n 'label' => __('Time'),\n 'route' => 'demo-time',\n 'params' => [\n 'action' => 'time',\n 'id' => $params['id'],\n 'slug' => $params['slug'],\n 'time' => $params['time'],\n ],\n ],\n 'demo-compound' => [\n 'label' => __('Time and category'),\n 'route' => 'demo-compound',\n 'params' => [\n 'action' => 'compound',\n 'id' => $params['id'],\n 'slug' => $params['slug'],\n 'time' => $params['time'],\n 'category' => $params['category'],\n ],\n ],\n ];\n\n $rowset = Pi::model('route')->select([\n 'module' => $this->getModule(),\n 'custom' => 1,\n 'active' => 1,\n ]);\n $routeList = [];\n foreach ($rowset as $row) {\n $routeList[$row->name] = $row->data;\n }\n\n // Build route list\n $routes = [];\n $routes['list'] = [\n 'label' => __('List'),\n 'url' => $this->url('default', [\n 'module' => $this->getModule(),\n 'controller' => 'route',\n 'action' => 'index',\n ]),\n ];\n\n foreach ($routeDefs as $key => $def) {\n if (!isset($routeList[$def['route']])) {\n continue;\n }\n $routes[$key] = [\n 'label' => $def['label'],\n 'url' => $this->url($def['route'], $def['params']),\n ];\n }\n\n $this->view()->assign('routes', $routes);\n\n return $this;\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n\n /**\n * Porteiro; Routes\n */\n $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');\n }", "private static function loadRoutes()\n {\n $route_found = false;\n foreach (\n sf_conf('routes') as $path => $route_data\n ) {\n $route_found = true;\n self::$routes[$path] = Route::buildRoute($path, $route_data);\n }\n\n if (! $route_found) {\n trigger_error(\n 'No routes have been configured. Check routes.yaml.',\n E_USER_ERROR\n );\n\n exit;\n }\n }", "function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }", "private static function loadRoutes() {\n\t\t\t$appRoutesJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/routes.json\");\n\t\t\ttry {\n\t\t\t\t$appRoutes = JsonUtils::decode($appRoutesJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app routes: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// Each json object in the array represents a route, so we should build them up\n\t\t\t// from the data.\n\t\t\tforeach ($appRoutes as $rawRoute) {\n\t\t\t\tself::$routes[] = Route::buildFromJson($rawRoute);\n\t\t\t}\n\t\t}", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "protected function loadScannedRoutes()\n {\n $this->app->booted(function () {\n $router = $this->app['Illuminate\\Contracts\\Routing\\Registrar'];\n\n require $this->finder->getScannedRoutesPath();\n });\n }", "private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }", "public function routes(Map $map)\n {\n\n $map->get('home', '/', function () {\n return new HtmlResponse(\"Welcome on the Sherpa skeleton !\");\n });\n //\n //$map->get('hello', '/hello/{name}', function($name){\n // return new HtmlResponse(\"Hello, $name !\");\n //});\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 routerProvider()\n {\n return [\n 'aura-minimal' => [3, 1, 'minimal-files', 404, [], Router\\AuraRouter::class],\n 'aura-full' => [3, 1, 'copy-files', 200, $this->expectedRoutes, Router\\AuraRouter::class],\n 'fastroute-minimal' => [3, 2, 'minimal-files', 404, [], Router\\FastRouteRouter::class],\n 'fastroute-full' => [3, 2, 'copy-files', 200, $this->expectedRoutes, Router\\FastRouteRouter::class],\n 'zend-router-minimal' => [3, 3, 'minimal-files', 404, [], Router\\ZendRouter::class],\n 'zend-router-full' => [3, 3, 'copy-files', 200, $this->expectedRoutes, Router\\ZendRouter::class],\n ];\n }", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "private function loadRoutes() {\n $routesJson = file_get_contents('config/routing.json');\n $routesArray = json_decode($routesJson, true);\n\n foreach ($routesArray as $routeElement) {\n $route = new Route($routeElement['route'], array(\n 'controller' => $routeElement['controller'],\n 'action' => $routeElement['action']\n ));\n $this->routeCollection->add($routeElement['name'], $route);\n }\n }" ]
[ "0.636167", "0.63498574", "0.6344058", "0.6247326", "0.61384535", "0.6079256", "0.60683805", "0.60502017", "0.5978435", "0.59386605", "0.5931241", "0.5921373", "0.5894043", "0.5886049", "0.5855384", "0.58321476", "0.5790795", "0.5788131", "0.5787451", "0.57713383", "0.57713383", "0.57713383", "0.57713383", "0.57713383", "0.57713383", "0.57713383", "0.57713383", "0.577016", "0.57673955", "0.57342464", "0.5707811", "0.5707811", "0.5701148", "0.56943667", "0.56849575", "0.5657327", "0.56569165", "0.55991197", "0.5595524", "0.55763227", "0.5575833", "0.5569552", "0.55589586", "0.5532547", "0.5524633", "0.5503187", "0.5455329", "0.54422426", "0.5434099", "0.5429961", "0.5428613", "0.5406882", "0.5388495", "0.53529835", "0.5351201", "0.53489625", "0.5337843", "0.53310305", "0.5304931", "0.53029156", "0.52958083", "0.5295082", "0.52906436", "0.52829254", "0.5263779", "0.5246913", "0.52398986", "0.5239049", "0.52366483", "0.5234761", "0.52345437", "0.52295125", "0.5229116", "0.52167237", "0.5208155", "0.5190849", "0.5190849", "0.51831263", "0.5179869", "0.51785994", "0.51775175", "0.51758254", "0.51671976", "0.5165762", "0.51615167", "0.51615167", "0.5159928", "0.5156483", "0.5150912", "0.51484317", "0.51478446", "0.51470506", "0.5145061", "0.5129951", "0.51250035", "0.5122251", "0.512222", "0.5120633", "0.5114104", "0.51123595" ]
0.53813994
53
lunch controller and send response to browser
protected function initRequest() { $context = new RequestContext(); $context->fromRequest(self::$request); $matcher = new UrlMatcher($this->routCollection, $context); try { $attributes = $matcher->match(self::$request->getPathInfo()); $response = $this->callController($attributes); } catch (ResourceNotFoundException $e) { $response = new Response('Not Found', 404); } catch (Exception $e) { $response = new Response('An error occurred', 500); } $response->send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function runController()\n {\n $msg = new MoovicoRequestMessage(self::$route);\n self::$response = self::doRunController($msg);\n }", "public function run()\n { \n $output = (string) $this->get('router')->dispatch();\n $response = $this->get('response');\n $response->setBody($output);\n $response->send();\n\n }", "public function run()\n\t{\n\n\t\t//excute request routing\n\t\t$this->request = new Request($this);\n\n\t\t$module = $this->load_module();\n\n\t\tif ($module !== false) {\n\n\t\t\t$className = $this->load_controller($module);\n\n\t\t\tif ($className !== false) {\n\n\t\t\t\t$controller = new $className();\n\t\t\t\t$response = $this->call_function($controller);\n\t\t\t\tif (is_array($response)) {\n\t\t\t\t\tResponse::show($response);\n\t\t\t\t} else {\n\t\t\t\t\tResponse::show(array(\n\t\t\t\t\t\t\t$response\n\t\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tResponse::show(array(\n\t\t\t\t\t\t'status'\t=> false,\n\t\t\t\t\t\t'message'\t=> 'Application controller required.'\n\t\t\t\t\t), 404);\n\t\t\t}\n\n\t\t} else {\n\t\t\tResponse::show(array(\n\t\t\t\t\t'status'\t=> false,\n\t\t\t\t\t'message'\t=> 'Application module required.'\n\t\t\t\t), 404);\n\t\t}\n\n\t}", "public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }", "private function launcher() {\n \n $controller = $this->controller;\n $task = $this->task;\n \n if (!isset($controller)) {\n $controller = 'IndexController';\n }\n else {\n $controller = ucfirst($controller).'Controller';\n }\n \n if (!isset($task)) {\n $task = 'index';\n }\n \n $c = new $controller();\n \n call_user_func(array($c, $task));\n \n Quantum\\Output::setMainView($this->controller, $task);\n \n\n }", "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 function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "public function perform()\n\t{\n\t\tprint_r($_SERVER);\n\n\t\texit();\n\t\treturn $this->show();\n\t}", "public function response(){\r\n\t\t// register event on_shutdown\r\n\t\tregister_shutdown_function(function(){\r\n\t\t\t// on_shutdown\r\n\t\t\t\\M::get('event')->trigger('system.on_shutdown');\r\n\r\n\t\t\t// debug\r\n\t\t\t\\M::get('debug')->exception_fatal();\r\n\t\t});\r\n\r\n\t\tob_start();\r\n\t\t\t// load default config & controller core\r\n\t\t\trequire_once APP_PATH . 'config.php';\r\n\t\t\trequire_once SYSTEM_PATH . 'controller.php';\r\n\r\n\t\t\t// on load\r\n\t\t\t\\M::get('event')->trigger('system.on_load', DOMAIN);\r\n\r\n\t\t\t// parser url\r\n\t\t\t$this->parser_url();\r\n\t\t\t// load module\r\n\t\t\t$this->load_module(input('module', 'str', 'get'));\r\n\t\t\t// load extend module\r\n\t\t\t$this->load_extend(input('extend_module', 'str', 'get'));\r\n\t\t\t// load group controller & controller\r\n\t\t\tlist($lib, $instance) = $this->load_controller(input('group_controller', 'str', 'get'), input('controller', 'str', 'get'));\r\n\t\t\t// load action\r\n\t\t\t$this->load_action($lib, $instance);\r\n\t\t$html = ob_get_clean();\r\n\r\n\t\t// on response\r\n\t\tob_start();\r\n\t\t\\M::get('event')->change('system.on_response', $html);\r\n\r\n\t\t// display html & end all script\r\n\t\tdie($html);\r\n\t}", "public function dispatch()\n {\n try {\n $this->get('Horde_Controller_ResponseWriter')->writeResponse(\n $this->get('Horde_Controller_Runner')->execute(\n $this->_injector,\n $this->get('Horde_Controller_Request'),\n $this->get('Horde_Kolab_FreeBusy_Controller_RequestConfiguration')\n )\n );\n } catch (Exception $e) {\n $this->_injector->bindFactory(\n 'Horde_Controller_ResponseWriter',\n 'Horde_Kolab_FreeBusy_Factory_Base',\n 'createResponseWriter'\n );\n $response = $this->_injector->createInstance('Horde_Controller_Response');\n $response->setHeaders(array('Status' => '404 Not Found', 'HTTP/1.0' => '404 Not Found'));\n $response->setBody($e->getMessage());\n $this->get('Horde_Controller_ResponseWriter')->writeResponse(\n $response\n );\n }\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 {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }", "public function run()\n {\n $routeInfo = $this->foundRoute();\n\n if (isset($routeInfo['middleware'])) {\n $middleware = $this->gatherMiddlewareClassNames($routeInfo['middleware']);\n $this->runMiddleware($middleware);\n }\n $response = $this->callControllerAction($routeInfo);\n\n $this->sendRequest($this->response ?: $response);\n\n }", "public function run() {\n\n if(method_exists($this, $this->action)) {\n $output = call_user_func_array(array($this, $this->action), (array)$this->arguments);\n } else {\n raise('invalid controller action: ' . $this->action);\n }\n\n // if the controller has a valid layout\n // render that instead of the output generated by the action\n if(!$output and $layout = $this->layout) {\n $output = $layout->render($this->format); \n } \n\n if(is_a($output, 'Kirby\\\\Toolkit\\\\Response')) {\n return $output;\n } else {\n return new Response($output, $this->format);\n }\n\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 launch() {\n\t\t$controller = ucfirst($this->getController());\n\t\t$method = $this->getMethod();\n\t\t\n\t\tif (file_exists(APPPATH . 'modules/' . $controller . '.php') === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\tinclude_once(APPPATH . 'modules/' . $controller . '.php');\n\t\t\n\t\tif (class_exists($controller) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\n\t\t$app = new $controller();\n\t\t\n\t\tif (method_exists($app, $method) === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);\n\t\t\n\t\t\n\t\t$app->$method();\n\t}", "public function launch() {\n $this->run();\n return $this->_response;\n }", "public function exec()\n {\n try {\n $http_response = $this->front_controller->exec();\n return $this->http_transport->sendResponse($http_response);\n } catch (Exception $e) {\n $this->echoException($e);\n exit(1);\n }\n }", "public function run()\n\t{\n\t\t$_controller = $this->getController();\n\t\t\n\t\tif ( ! ( $_controller instanceof IXLRest ) )\n\t\t{\n\t\t\t$_controller->missingAction( $this->getId() );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tCall the controllers dispatch method...\n\t\t$_controller->dispatchRequest( $this );\n\t}", "public function execute() {\n\t\t\t$response = Response::factory($this);\n\t\t\t\n\t\t\t$controller = $this->route->controller();\n\t\t\tif($controller !== null) {\n\t\t\t\t$this->controller = Controller::factory($controller, $response);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t$response->data($this->controller->execute());\n\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t$response->data('<div class=\"Frawst-Debug\">'.\n\t\t\t\t\t\t'<h1>A Controller Problem Occurred!</h1>'.\n\t\t\t\t\t\t'<pre>'.$e.'</pre></div>');\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$this->controller = null;\n\t\t\t} else {\n\t\t\t\tif($this->route->template() === null) {\n\t\t\t\t\t$response->notFound();\n\t\t\t\t}\n\t\t\t\t$response->data(null);\n\t\t\t}\n\t\t\t\n\t\t\treturn $response;\n\t\t}", "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 final function run()\n\t{\n\t\t$controllerClass = ucfirst(App::request()->getControllerName());\n\t\t$actionName = App::request()->getActionName().Request::ACTION_SUFFIX;\n\n\t\t$this->_execute($controllerClass, $actionName);\n\t}", "public function run()\n\t{\n\t\t$response = $this->dispatch($this['request']);\n\n\t\t$response->send();\n\n\t\t$this->callFinishMiddleware($response);\n\t}", "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}", "public function execute() {\n\n $this->parseRequestHeaders();\n\n $uri = $this->loadUrl(); // Loads the called URL\n String::arrayTrimNumericIndexed($uri); // Trim the URL array indexes\n\n /**\n * When server is running as a RESTful server\n */\n if (RESTFUL == '1') {\n RestServer::runRestMethod($uri);\n $this->terminate();\n }\n\n /**\n * When the request is not running over ajax,\n * then call the home for full page rendering\n * before calling the requested method\n */\n if (!$this->isAjax()) {\n\n $this->controller = $this->requireHome();\n $this->controller->itStarts($uri);\n $this->terminate();\n }\n\n /**\n * Normal Ajax Request, call the method only\n */\n $this->runMethod($uri);\n $this->terminate();\n }", "public function run()\n {\n if (isset($_SERVER[\"PATH_INFO\"]))\n {\n $requestPath = $_SERVER[\"PATH_INFO\"];\n }\n else\n {\n $requestPath =\"/\";\n }\n\n $router = Router::getInstance();\n $requestRoute = $router->getRoute($requestPath);\n\n $controllerName=$requestRoute[\"controller\"].\"Controller\";\n $controller = new $controllerName();\n $methodName=$requestRoute[\"method\"].\"Action\";\n\n if (method_exists($controller, $methodName))\n {\n $this->viewData = array_merge($this->viewData, (array)$controller->$methodName());\n $this->renderResponse();\n }\n else\n {\n throw new ErrorException(\"methode \\\" $methodName\\\" inconnue dans \\\" $controllerName\\\"\") ;\n }\n\n\n }", "public static function run()\n {\n $self = self::getInstance();\n \n // Register autoloader\n $autoloader = new Autoloader(null, $self->basePath);\n $autoloader->register();\n \n $controller = $self->getControllerToRun();\n $method = $self->getMethodToRun($controller);\n \n // First run optional functions\n if (method_exists($controller, 'beforeRun'))\n $controller->beforeRun();\n \n if (method_exists($controller, 'beforeMethodRun'))\n $controller->beforeMethodRun();\n \n // If response was set in \"before\" functions, output it instead of method return value\n if (! $controller->getResponse()->isEmpty()) {\n return $self->outputContent($controller->getResponse());\n }\n \n $self->normalizeMethodArguments($controller, $method);\n // Get content\n $content = call_user_func_array(array($controller,$method), $self->methodArguments);\n \n // After running optional functions\n if (method_exists($controller, 'afterRun'))\n $controller->afterRun();\n \n $self->outputContent($content);\n }", "public function dispatch()\n {\n $this->response = $this->frontController->execute();\n }", "public function launch()\r\n\t{\r\n\t\t// Corrige le nom du controller.\r\n\t\t// ajoute le namespace et met la 1er lettre en majuscule\r\n\t\t$controller = \"\\\\application\\\\controllers\\\\\";\r\n\t\t$controller .= ucfirst($this->controller);\r\n\r\n\t\t// si la classe existe\r\n\t\tif(class_exists($controller))\r\n\t\t\t$controller = new $controller;\r\n\r\n\t\t// Si la class $controller n'existe pas\r\n\t\telse\r\n\t\t{\r\n\t\t\t// transformation en page d'erreur\r\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\r\n\r\n\t\t\t// alors le controller d'erreur est instancé\r\n\t\t\t$controller = new \\application\\controllers\\Error;\r\n\r\n\t\t\t// appel la method index du controller d'erreur\r\n\t\t\treturn $controller->index();\r\n\t\t}\r\n\r\n\t\t// Si la variable restfull est fause\r\n\t\tif(!$controller->restful)\r\n\t\t\t$method = \"action_\".$this->method;\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\t// alors peu être appelé par le type de request\r\n\t\t\t// ex: get_index(), post_index(), put_index() or delete_index()\r\n\t\t\t$method = strtolower($_SERVER['REQUEST_METHOD']).\"_\" .$this->method;\r\n\t\t}\r\n\r\n\t\t// Vérifie que la method existe dans le controller\r\n\t\tif(method_exists($controller, $method))\r\n\t\t\t// Appel la method du controller en lui passant des parametres\r\n\t\t\treturn call_user_func_array(array($controller, $method), array($this->args));\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\t// transformation en page d'erreur\r\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\r\n\r\n\t\t\t// alors le controller d'erreur est instancé\r\n\t\t\t$controller = new \\application\\controllers\\Error;\r\n\r\n\t\t\t// appel la method index du controller d'erreur\r\n\t\t\treturn $controller->index();\r\n\t\t}\r\n\t}", "public function mainAction()\n {\n return $this->setResponse();\n }", "public function run()\n\t{\n\t\t// Proxy requests, write headers, and then render response\n\t\treturn $this\n\t\t\t->request()\n\t\t\t->response()\n\t\t;\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 run()\n \t{\n \t\t$controller = $this->factoryController();\n\n \t\t$action = $this->_currentAction;\n\n \t\t$controller->$action();\n \t}", "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 }", "abstract public function launch(Request $request, Response $response);", "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 function respond()\n\t{\n\t\t$this->setTemplate();\n\t\t$this->template->setGuid( $this->request['guid'] );\n\t\t$this->template->setContent( $this->view->getContent() );\n\t\n\t\techo $this->template->request();\t\n\t}", "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 }", "private function __send_response(){\n http_response_code($this->response_code);\n if($this->_redirect) header(\"Location: \".Config::WEB_DIRECTORY.\"{$this->_redirect_location}\");\n elseif($this->_JSON){\n header('Content-Type: application/json; charset=UTF-8');\n print json_encode($this->_JSON_contents, JSON_PRETTY_PRINT);\n }elseif($this->_HTML){\n if($this->_HTML_load_view) $this->_template->render();\n } /** @noinspection PhpStatementHasEmptyBodyInspection */ else{\n // Do nothing\n }\n }", "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 run() \n\t{\n\t\tcall_user_func_array(array(new $this->controller, $this->action), $this->params);\t\t\n\t}", "public function run()\n {\n $this['events']->applyHook('before');\n\n if ($this['env'] !== 'console') {\n ob_start('mb_output_handler');\n }\n\n $this->boot();\n\n // Invoke middleware and application stack\n try {\n $this['middleware'][0]->call();\n } catch (\\Exception $e) {\n $this['response']->write($this['exception']->handleException($e), true);\n }\n\n // Finalize and send response\n $this->finalize();\n\n $this['events']->applyHook('after');\n }", "public function run(){\t\t\n\t\t/* this startup function for any controller */\n\t\t\n\t\t//$data = $this->db->DB_Fetch_Grid(\"users\");\n\t\t//return $this->json($data);\n\n\t\treturn $this->json([\"test\"=>\"done\",\"response\"=>2244234,\"route\"=>\"users\"]);\n\t\n\t}", "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}", "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 function send()\n {\n http_response_code( $this->getResultCode() );\n echo $this->getBody();\n }", "public function callController()\n {\n Artisan::call('lucy:controller', $this->builder->getAttribute('controller'));\n }", "public function run()\n {\n $route = $this->route->mapRoute();\n\n $className = $this->controllerNamespace.$route[0];\n\n $action = $route[1];\n\n $controller = call_user_func([$className, 'getInstance']);\n\n $controller->$action();\n }", "public function run()\n {\n $this->browser->open($_ENV['app_frontend_url'] . $this->product->getUrlKey() . '.html');\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->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 }", "protected function dispatch() {\n\t\t/* @var $bootstrap \\TYPO3\\CMS\\Extbase\\Core\\Bootstrap */\n\t\t$bootstrap = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Core\\\\Bootstrap');\n\t\t$configuration['vendorName'] = $this->vendorName;\n\t\t$configuration['extensionName'] = $this->extensionName;\n\t\t$configuration['pluginName'] = $this->pluginName;\n\t\t$bootstrap->initialize($configuration);\n\t\t$request = $this->buildRequest();\n\t\t/* @var $response \\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response */\n\t\t$response = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Response');\n\t\t/* @var $dispatcher \\TYPO3\\CMS\\Extbase\\Mvc\\Dispatcher */\n\t\t$dispatcher = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Dispatcher');\n\t\t$dispatcher->dispatch($request, $response);\n\t\tif ($GLOBALS ['TSFE']->fe_user) {\n\t\t\t$GLOBALS ['TSFE']->fe_user->storeSessionData();\n\t\t}\n\t\treturn $response->getContent();\n\t}", "function startup_view()\n\t{\n\t\t$data['error_msg'] = $this->error_msg;\n\t\t$response_body = $this->template_html($this->html_template_path,$data);\n\t\t$this->return_response($response_body);\n\t}", "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 run(): void\n {\n\n Router::processAllRoutes();\n\n (new ControlResponseCode(ObjectInitializer::$response))->trackResponseStatus();\n\n $this->toolbarInit(ObjectInitializer::$frameworkConfiguration);\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 run()\n {\n call_user_func_array(array(new $this->controller, $this->action), $this->params);\n }", "public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}", "public function run()\n {\n $this->requestId = uniqid();\n $this->startTime = microtime();\n\n try {\n // Generate a Request object from the data available in the\n // current running environment.\n try {\n $requestFactory = new Requests\\Factories\\Http;\n $request = $requestFactory->get($this);\n // Set the application locale from the request.\n // TODO: Move into the Request constructor?\n $this->setLocale($request->getLocale());\n // Run the process of responding to the request.\n $this->issueResponse($request);\n } catch (\\Throwable $throwable) {\n // There was an error somewhere during the request\n // creation, or somewhere during the response building\n // process.\n $errorRequest = new Requests\\Http\\Error;\n $errorRequest->setThrowable($throwable);\n $this->issueResponse($errorRequest, $throwable);\n }\n } catch (\\Exception $exception) {\n // There was an error while trying to fail gracefully.\n // Little else can be done now.\n $this->fail($exception);\n }\n\n Logger::get()->info($this->getStats());\n\n // Since the application is being run in an HTTP context, and\n // PHP is the scripting language it is, the application cycle\n // just finishes after the response is done with its tasks.\n }", "public function run(): Response\n {\n return $this->triggerAction($this->pendingAction);\n }", "public static function client_responce()\n {\n // Find out Request Type\n $req_type = self::client_request_type();\n\n // Fire Responce\n self::{$req_type}();\n\n // End..\n die();\n }", "protected function doExecute()\n\t{\n\t\t$controller = $this->getController();\n\n\t\t$controller = new $controller($this->input, $this);\n\n\t\t$this->setBody($controller->execute());\n\t}", "public function main()\n {\n try {\n $routes = require_once 'routes.php';\n\n //Initialize Altorouter\n $router = new AltoRouter();\n\n $router->setBasePath('');\n\n //Register routes from routes.php file and map them on Alto Router\n $this->registerRoutes($router, $routes);\n\n //Match coming request with mapped routes using Alto Router\n $match = $router->match();\n if ($match) {\n\n $request = new Request();\n $request->populate();\n $request->appendQueryParams($match['params']);\n //Get method name from route name/key\n $methodName = $this->getMethodNameFromRouteName($match['name']);\n\n //Set action method name in request object\n $request->setControllerActionMethod($methodName);\n\n //Apply pre Middlewares\n $this->callMiddlewares($request, $match['name'], $routes, MiddlewareType::PRE);\n\n //Require controller\n $this->requireControllerAndCheckMethod($match['target'], $methodName);\n $controllerName = '\\App\\Controllers\\\\' . $match['target'] . controllerSuffix();\n $controllerObj = new $controllerName();\n list($status, $body) = $controllerObj->{$methodName}($request);\n //Apply post Middlewares\n $this->callMiddlewares($request, $match['name'], $routes, MiddlewareType::POST);\n } else {//404 not found\n $status = ResponseCodes::HTTP_NOT_FOUND;\n $body = getViewHtml('404');\n }\n // Set HTTP header\n $statusHeader = 'HTTP/1.1 ' . $status . ' ' . getStatusCodeMessage($status);\n header($statusHeader, true, intval($status));\n\n // Encode json\n echo $body;\n } catch (Exception $exception) {\n throw $exception;\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 function run()\n {\n $resArr = $this->userPswdUpdateStepTwo();\n\n // Get new csrf token\n $resArr['csrf']['tokenName'] = $this->csrf->getTokenName();\n $resArr['csrf']['token'] = $this->csrf->getToken();\n\n // Set JSON header\n $response = new Response();\n $response->setContentType('json');\n\n // Print out response as JSON\n echo json_encode($resArr);\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 run() {\n\t\t$url = URL::getCurrentUrl();\n\n\t\tif (!$this->isServerURL($url)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$path = Str::subString($url->getPath(), Str::length($this->config->getBase())); //Remove the base from the\n\n\t\t/** @var HttpController $controller */\n\t\t$controller = null;\n\t\t$configController = null;\n\n\t\t$rawCaptures = array();\n\t\tforeach ($this->config->getMappings() as $match => $controllerName) {\n\t\t\tif (preg_match_all(\"/^\" . $match . \"\\\\/$/\", $path, $rawCaptures) > 0) {\n\t\t\t\t$configController = $this->config->getController($controllerName);\n\t\t\t\t$c = $configController->getClass();\n\t\t\t\t$controller = new $c();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tarray_shift($rawCaptures); //Remove the first, as this is just the entire string.\n\n\t\t/*\n\t\t * Create an associative array with the names specified in the config json file \n\t\t */\n\t\t$captures = array();\n\t\t$rawCapturesLength = count($rawCaptures);\n\t\tfor ($i = 0; $i < $rawCapturesLength; $i++) {\n\t\t\t$c = $rawCaptures[$i];\n\t\t\t$captures[$configController->getCaptures()[$i]] = $c[0];\n\t\t}\n\t\t\n\t\t\n\t\tif ($controller === null) {\n\t\t\t$controller = $this->config->get404Controller();\n\t\t\tif ($controller === null) {\n\t\t\t\techo \"404\";\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\t$request = new RestRequest();\n\t\t$response= new RestResponse(true);\n\t\t\n\t\t$request->setParameter(\"@captures\", $captures);\n\n\t\t$response->header()->setStatus(200);\n\t\t$response->setStatus(new OkStatus());\n\t\t\n\t\t$controller->doCurrent($request, $response);\n\n\t\t$response->header()->setContentType(\"application/json\"); //Always json :)\n\t\t\n\t\treturn $response;\n\t}", "public function run()\n {\n $controller = $this->getController();\n\n $view = $controller->view;\n $viewRenderer = $controller->getHelper('viewRenderer');\n $layout = $controller->getHelper('layout');\n $request = $controller->getRequest();\n $isAjax = $request->isXmlHttpRequest();\n\n $form = $this->getForm();\n if ($request->isPost()) {\n if ($form->isValid($request->getPost())) {\n try {\n $redir = $this->onSubmit();\n if (!$redir) {\n // reload page\n $params = $request->getUserParams();\n $redir = array($params['controller'], $params['action']);\n unset($params['controller'], $params['action']);\n if ($params['module'] == 'default') unset($params['module']);\n foreach ($params as $key => $value) {\n $redir[] = $key;\n $redir[] = $value;\n }\n $redir = '/' . implode('/', $redir);\n }\n\n $layout->disableLayout();\n $viewRenderer->setNoRender();\n\n // AFTER SUCCESSFUL SUBMIT\n if ($isAjax) {\n // helper->json sends header with proper MIME-type\n //$this->_helper->json(array('code'=>'200', 'message'=>'Success'));\n $redirect = $request->getBaseUrl() . $redir;\n $response = array('code'=>'200', 'message'=>'Success', 'redirect'=>$redirect);\n $this->buildXmlResponse($response);\n echo Zend_Json::encode($response);\n } else {\n $this->redirect($redir);\n }\n return;\n } catch (Zefram_Exception_Ignore $e) {\n // ignore exception - used to silently pop-out of onSubmit chain\n // useful when handling multiple-submit form\n } catch (Zefram_Controller_Form_Exception $e) {\n foreach ($e->getMessages() as $field => $errors) {\n if (!count($errors)) continue;\n $where = $form->getElement($field);\n $msg = '';\n if (!$where) { \n $where = $form; \n $msg .= \"$field: \"; \n }\n $msg .= \"Constraint validation failed (\" . implode(', ', $errors) . \")\";\n $where->addError($msg);\n }\n } catch (Exception $e) {\n $form->addError($e->getMessage());\n }\n }\n\n // mark erroneous fields\n foreach ($form as $field) {\n if ($field instanceof Zend_Form) {\n // FIXME przechwytywac bledy\n continue;\n }\n\n if ($field->hasErrors()) {\n $tag = $field->getDecorator('HtmlTag');\n if (!$tag) continue;\n $tag->setOption('class', trim($tag->getOption('class') . ' error'));\n }\n }\n\n\n // isValid populates form with sent data, so there is no need to call\n // form->populate\n // INVALID DATA\n if ($isAjax) {\n $layout->disableLayout();\n $viewRenderer->setNoRender();\n $view->doctype('XHTML1_STRICT');\n // return json with form\n $response = array('code'=>'400', 'message'=>'Validation error: '.@$error_m, 'xml'=>'<xml>' . $form->__toString() . '</xml>');\n $this->buildXmlResponse($response);\n echo Zend_Json::encode($response);\n return;\n }\n } else {\n // form was not submitted, load default values\n $this->populateForm();\n }\n\n if ($isAjax) {\n $view->doctype('XHTML1_STRICT');\n $layout->disableLayout();\n }\n\n $template = $view->getScriptPath($controller->getViewScript());\n if ((false === $template) || !file_exists($template)) {\n // show form even if template does not exist\n $form->setView($view); // use XHTML elements when needed\n $content = $form->__toString();\n } else {\n // render form using view template\n $view->form = $form;\n $content = $controller->render();\n }\n\n // NO INPUT\n if ($isAjax) {\n $response = array('code'=>'200', 'message'=>'OK', 'xml'=>'<xml>' . $content . '</xml>');\n $this->buildXmlResponse($response);\n echo Zend_Json::encode($response);\n } else {\n echo $content;\n }\n\n // no more rendering here\n $viewRenderer->setNoRender();\n }", "public function run()\n {\n // dispatch all routes [between events]\n $this->trigger('horus.dispatch.before');\n if(($o = $this->router->exec()) !== false) echo $o;\n else $this->e404();\n $this->trigger('horus.dispatch.after');\n\n // get the output\n // prepare then only send if the request is not head\n $this->output .= ob_get_clean();\n $this->trigger('horus.output.before', array($this));\n $this->output = $this->trigger('horus.output.filter', $this->output, $this->output);\n (strtoupper($_SERVER['REQUEST_METHOD']) == 'HEAD') or print $this->output;\n $this->trigger('horus.output.after', array($this));\n\n // end\n ob_get_level() < 1 or ob_end_flush(); exit;\n }", "public function action_hello()\r\n\t{\r\n\t\treturn Response::forge(Presenter::forge('welcome/hello'));\r\n\t}", "public function requestRun()\n {\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}", "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 action_hello()\n\t{\n\t\treturn Response::forge(Presenter::forge('welcome/hello'));\n\t}", "public function launch()\r\n {\r\n // Extract data to be usable inside the view file\r\n extract($this->data);\r\n\r\n // Expected view file format is\r\n // viewfolder.viewfile\r\n $view_file = str_replace(\".\", \"/\", $this->view_file);\r\n\r\n // Require view\r\n require path('app').'/views/'.$view_file.'.php';\r\n }", "public function run($url = null)\n {\n\n $params = RouterHelper::segmentizeUrl($url);\n\n /*\n * Database check\n */\n if (!App::hasDatabase()) {\n return Config::get('app.debug', false)\n ? Response::make(View::make('backend::no_database'), 200)\n : App::make('Cms\\Classes\\Controller')->run($url);\n }\n\n /*\n * Look for a Files\n */\n if (Str::startsWith($url, 'backend/files/')) {\n array_shift($params);\n array_shift($params);\n $action = $params[0];\n array_shift($params);\n $controllerObj = App::make('Backend\\Controllers\\Files');\n return $controllerObj->run($action, $params);\n }\n\n /*\n * global ajax fixing\n * data-handler=\"ajaxResponder::onLoginPopup<-Login\"\n * ajaxResponder::[onAction]<-[Controller]\n */\n if (Request::ajax() && $handler = Request::header('X_OCTOBER_REQUEST_HANDLER')) {\n\n if(Str::startsWith($handler, 'ajaxResponder::')) {\n $handlerParams = explode('::', $handler);\n $handlerParams = explode('<-', $handlerParams[1]);\n $newHandler = $handlerParams[0];\n $newController = $handlerParams[1];\n Request::instance()->headers->set('X_OCTOBER_REQUEST_HANDLER', $newHandler);\n $params[0] = $newController;\n }\n }\n\n /*\n * Look for a Main controllers\n */\n $innerControllerFound = false;\n $paramClone = $params;\n if (count($paramClone) > 1) {\n $counterClassEmel = count($paramClone) - 1;\n array_walk($paramClone, function (&$value, $index) {\n $value = Str::studly($value);\n });\n for ($i = $counterClassEmel; $i >= 0; $i--) {\n $predicatedClass = '\\\\HS\\\\Controllers\\\\' . Str::studly(implode('\\\\', $paramClone));\n\n $predicatedPath = implode('/', $paramClone);\n $predicatedPath = base_path() . '/controllers/' . $predicatedPath;\n\n // @to solve url issues with camlisation\n if ($controllerFile = File::existsInsensitive($predicatedPath . '.php')) {\n include_once($controllerFile);\n }\n\n if (class_exists($predicatedClass)) {\n $predicatedControllerParams = array_slice($params, $i + 1);\n $backUpParams = $predicatedControllerParams;\n $predicatedAction = array_shift($predicatedControllerParams);\n if (empty($predicatedAction)) {\n $predicatedAction = 'index';\n }\n $controllerObj = App::make($predicatedClass);\n // if action not found then set index action and pass as params\n if(!$controllerObj->actionExists($predicatedAction)) {\n // restore params and set default action to index\n $predicatedAction = 'index';\n $predicatedControllerParams = $backUpParams;\n }\n $innerControllerFound = true;\n break;\n }\n\n unset($paramClone[$i]);\n }\n }\n\n\n $controllerClassPath = base_path().'/controllers';\n if ($innerControllerFound) {\n $controller = $predicatedClass;\n self::$action = $action = $predicatedAction;\n self::$params = $controllerParams = $predicatedControllerParams;\n $controllerClass = $controller;\n $controllerClassPath = $predicatedPath;\n } else {\n $controller = isset($params[0]) ? $params[0] : '';\n self::$action = $action = isset($params[1]) ? $this->parseAction($params[1]) : 'index';\n self::$params = $controllerParams = array_slice($params, 2);\n $controllerClass = '\\\\HS\\\\Controllers\\\\'. Str::studly($controller);\n }\n\n if ($controllerObj = $this->findController(\n $controllerClass,\n $action,\n $controllerClassPath\n )) {\n return $controllerObj->run($action, $controllerParams);\n }\n\n\n /*\n * Look for a Plugin controller\n * @forme\n */\n if (count($params) >= 2) {\n list($author, $plugin) = $params;\n $controller = isset($params[2]) ? $params[2] : 'index';\n self::$action = $action = isset($params[3]) ? $this->parseAction($params[3]) : 'index';\n self::$params = $controllerParams = array_slice($params, 4);\n $controllerClass = '\\\\'.$author.'\\\\'.$plugin.'\\Controllers\\\\'.$controller;\n if ($controllerObj = $this->findController(\n $controllerClass,\n $action,\n plugins_path()\n )) {\n return $controllerObj->run($action, $controllerParams);\n }\n }\n\n /*\n * Fall back to Default index controller\n */\n $controller = 'Index';\n self::$action = $action = 'index';\n self::$params = $controllerParams = [];\n $controllerClass = '\\\\HS\\\\Controllers\\\\'. Str::studly($controller);\n if ($controllerObj = $this->findController (\n $controllerClass,\n $action,\n base_path().'/controllers'\n )) {\n return $controllerObj->run($action, $controllerParams);\n }\n\n\n\n throw new Exception(\"No Default(Index) Controller Found.\", 1);\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\t\t{\n\t\t\tswitch ($_GET['act']) {\n\t\t\t\tcase 'create':\n\t\t\t\t\t//Crear\n\t\t\t\t\tif(BaseCtrl::isAdmin())\n\t\t\t\t\t\t$this->create();\n\t\t\t\t\telse{\n\t\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\t\techo $this->json_encode(array('error'=>NO_PERMITIDO,'data'=>NULL,'mensaje'=>'No tienes permisos suficientes'));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//CARGAR VISTA DE NO PERMITIDO\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'lists':\n\t\t\t\t\t//Listar \n\t\t\t\t\t$this->lists();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'listsDetails':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->listsDetails();\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'get':\n\t\t\t\t\t//Obtener una Recepcion\n\t\t\t\t\t$this->getRecepcion();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'getFolio':\n\t\t\t\t\t$this->getFolio();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\techo $this->json_encode(array('error'=>SERVICIO_INEXISTENTE,'data'=>NULL,'mensaje'=>'Este recepcion no está disponible'));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//CARGAR VISTA DE SERVICIO INEXISTENTE\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function run()\n {\n $this->welcome();\n }", "static public function run() {\n\n $session = Application::getInstance(\"session\");\n\n /**\n * Check if this is an API Call\n */\n $request = explode('/', trim(array_key_exists(\"PATH_INFO\",$_SERVER) ? $_SERVER[\"PATH_INFO\"] : \"\",'/'));\n $isAPICall = ($request[0] == \"api\");\n $basicAuth = false;\n\n if ($isAPICall) {\n\n if ($session->isAuth || isset($_SERVER['PHP_AUTH_USER'])) {\n\n if (isset($_SERVER['PHP_AUTH_USER'])) {\n\n $basicAuth = true;\n\n $email = $_SERVER['PHP_AUTH_USER'];\n $password = $_SERVER['PHP_AUTH_PW'];\n\n if (!$session->auth($email, $password)) {\n http_response_code(401);\n return;\n }\n\n }\n\n $api = Application::getInstance(__NAMESPACE__ . \"\\\\API\");\n $api->call();\n\n if ($basicAuth) {\n $session->closeMySession();\n }\n } else {\n http_response_code(403);\n return;\n }\n\n } else {\n $page = Application::getInstance(\"page\");\n\n $page->init();\n $page->work();\n $page->render();\n\n }\n\n\n }", "public function execute()\n {\n $response = $this->umcFactory->create();\n $response->setGlue(self::ERROR_GLUE);\n try {\n /** @var \\Zend\\Stdlib\\Parameters $data */\n $data = $this->getRequest()->getPost();\n $module = $this->moduleFactory->create();\n $module->initFromData($data->toArray());\n $errors = $module->validate();\n if (count($errors) == 0) {\n $xml = $module->toXml([], $module->getEntityCode(), true, true);\n $this->writer->setPath($module->getSettings()->getXmlRootPath());\n $this->writer->write($module->getExtensionName().'.xml', $xml);\n $this->builder->setModule($module)->build();\n $response->setError(false);\n $response->setMessage(__('Done!!! Check you var folder'));\n } else {\n if (isset($errors[''])) {\n $response->setMessage(implode(self::ERROR_GLUE, $errors['']));\n unset($errors['']);\n }\n $response->setError(true);\n $response->setAttributes($errors);\n }\n } catch (\\Exception $e) {\n $response->setError(true);\n $response->setMessage($e->getMessage());\n }\n $this->getResponse()->setBody($response->toJson());\n }", "public function run()\n {\n if ($this->match()) {\n $path = 'AlDente\\controllers\\\\' . ucfirst($this->params['controller']) . 'Controller';\n if (class_exists($path)) {\n $action = $this->params['action'] . 'Action';\n if (method_exists($path, $action)) {\n $controller = new $path($this->params);\n $controller->$action();\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n }", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function execute()\n\t{\n\t\t// Create the class prefix\n\t\t$prefix = 'controller_';\n\n\t\tif ( ! empty($this->directory))\n\t\t{\n\t\t\t// Add the directory name to the class prefix\n\t\t\t$prefix .= str_replace(array('\\\\', '/'), '_', trim($this->directory, '/')).'_';\n\t\t}\n\n\t\tif (Kohana::$profiling === TRUE)\n\t\t{\n\t\t\t// Start benchmarking\n\t\t\t$benchmark = Profiler::start('Requests', $this->uri);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t// Load the controller using reflection\n\t\t\t$class = new ReflectionClass($prefix.$this->controller);\n\n\t\t\tif ($class->isAbstract())\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Cannot create instances of abstract :controller',\n\t\t\t\t\tarray(':controller' => $prefix.$this->controller));\n\t\t\t}\n\n\t\t\t// Create a new instance of the controller\n\t\t\t$controller = $class->newInstance($this);\n\n\t\t\t// Execute the \"before action\" method\n\t\t\t$class->getMethod('before')->invoke($controller);\n\n\t\t\t// Determine the action to use\n\t\t\t$action = empty($this->action) ? Route::$default_action : $this->action;\n\t\t\t\n\t\t\t// Ensure the action exists, and use __call() if it doesn't\n\t\t\tif ($class->hasMethod('action_'.$action))\n\t\t\t{\n\t\t\t\t// Execute the main action with the parameters\n\t\t\t\t$class->getMethod('action_'.$action)->invokeArgs($controller, $this->_params);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$class->getMethod('__call')->invokeArgs($controller,array($action,$this->_params));\n\t\t\t}\n\n\t\t\t// Execute the \"after action\" method\n\t\t\t$class->getMethod('after')->invoke($controller);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tif (isset($benchmark))\n\t\t\t{\n\t\t\t\t// Delete the benchmark, it is invalid\n\t\t\t\tProfiler::delete($benchmark);\n\t\t\t}\n\n\t\t\tif ($e instanceof ReflectionException)\n\t\t\t{\n\t\t\t\t// Reflection will throw exceptions for missing classes or actions\n\t\t\t\t$this->status = 404;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// All other exceptions are PHP/server errors\n\t\t\t\t$this->status = 500;\n\t\t\t}\n\n\t\t\t// Re-throw the exception\n\t\t\tthrow $e;\n\t\t}\n\n\t\tif (isset($benchmark))\n\t\t{\n\t\t\t// Stop the benchmark\n\t\t\tProfiler::stop($benchmark);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function perform()\n {\n // template var with charset used for the html pages\n $this->viewVar['charset'] = $this->config->getModuleVar('common', 'charset');\n $this->viewVar['cssFolder'] = JAPA_PUBLIC_DIR . 'styles/'.$this->config->getModuleVar('common', 'styles_folder');\n $this->viewVar['urlBase'] = $this->router->getBase(); \n $this->viewVar['loggedUserRole'] = $this->controllerVar['loggedUserRole'];\n $this->viewVar['isUserLogged'] = $this->controllerVar['isUserLogged'];\n $this->viewVar['adminWebController'] = $this->config->getVar('default_module_application_controller'); \n \n $this->viewVar['text'] = array();\n\n // get text for the front page\n $this->model->action('misc','getText', \n array('id_text' => 1,\n 'result' => & $this->viewVar['text'],\n 'fields' => array('body'))); \n \n // get result of the header and footer controller\n // \n $this->viewVar['header'] = $this->controllerLoader->header(); \n $this->viewVar['footer'] = $this->controllerLoader->footer(); \n $this->viewVar['rightBorder'] = $this->controllerLoader->rightBorder(); \n }", "function executeController()\r\n{\r\n\t// Uri and figure out the path to the controller.\r\n\t$request = trim($_GET['request'], \"/ \");\r\n\t\r\n\tif ($request != '') {\r\n\t // Using the URL segments, construct the name of the class.\r\n\t // Note: The class name is mapped to the directory structure.\r\n\t $reqSegments = explode(\"/\", $request);\r\n\t}\r\n\t\r\n\t$controllerName = 'App_Pages_';\r\n\t$controllerName .= ($reqSegments[0])?$reqSegments[0]:'Index';\r\n\t$controllerName .= '_Controller';\r\n\t\r\n\t$actionName = ($reqSegments[1])?$reqSegments[1]:'index';\r\n\r\n\tif (class_exists($controllerName)) {\r\n\t\tif (method_exists($controllerName, $actionName)) {\r\n\t\t\t$controller = new $controllerName();\r\n\t\t\t$controller->$actionName();\r\n\t\t} else {\r\n\t\t\tdie('Page not found');\r\n\t\t}\r\n\t} else {\r\n\t\tdie('Page not found');\r\n\t}\r\n}", "public function run()\n {\n $cur_path = get_include_path();\n\n set_include_path($cur_path . ':' . APPPATH . 'helpers');\n\n // Yii::import was causing problems for some odd reason\n require_once('Zend/XmlRpc/Server.php');\n require_once('Zend/XmlRpc/Server/Exception.php');\n require_once('Zend/XmlRpc/Value/Exception.php');\n\n $this->xmlrpc = new Zend_XmlRpc_Server();\n $this->xmlrpc->sendArgumentsToAllMethods(false);\n $this->xmlrpc->setClass('remotecontrol_handle', '', $this->controller);\n echo $this->xmlrpc->handle();\n exit;\n }", "public function run(){\n\n\t\ttry{\n\n\t\t\t# On récupère la route correspondant a la requete\n\t\t\t$route = $this->router->dispatch(\n\t\t\t\t$this->request,\n\t\t\t\t$this->root\n\t\t\t);\n\n\t\t\t# Si il n'y a pas de route on lance une exception\n\t\t\tif(!$route){\n\n\t\t\t\tthrow new Exception('Pas de route trouvée pour cette adresse.');\n\n\t\t\t}\n\n\t\t\t# On execute la route et on récupère la valeur retournée\n\t\t\t$retour = $route->execute(\n\t\t\t\t$this->request,\n\t\t\t\t$this->response\n\t\t\t);\n\n\t\t\t# Si la valeur de retour n'est pas vide\n\t\t\tif($retour){\n\n\t\t\t\t# Si c'est une vue qui a été retournée, on la\n\t\t\t\t# rend\n\t\t\t\tif($retour instanceOf View){\n\n\t\t\t\t\t$retour = $retour->render();\n\n\t\t\t\t}\n\n\t\t\t\t# On attribue la valeur de retour au corps de\n\t\t\t\t# la réponse\n\t\t\t\t$this->response->setBody($retour);\n\n\t\t\t}\n\n\t\t\t# Si la réponse n'a pas été envoyée, on l'envoit\n\t\t\tif(!$this->response->isSent()){\n\n\t\t\t\t$this->response->send();\n\n\t\t\t}\n\n\t\t}catch(Exception $e){\n\n\t\t\techo $e->getMessage();\n\n\t\t}\n\n\t}", "public function serve_request()\n {\n }", "public function handle()\n {\n $url = asset('/static/subject/player');\n SubjectController::execUrl($url);\n }", "public function run()\n {\n $this->runAction();\n\n $this->view->setTemplate($this->request->getRequestedResource() . DIRECTORY_SEPARATOR . $this->getTemplateName() . '.twig');\n }", "public function indexAction()\n {\n if (!$this->getRequest() instanceof ConsoleRequest) {\n BackgroundExec::start();\n }\n\n $this->cron->run();\n\n $response = $this->getResponse();\n if (!$response instanceof ConsoleResponse) {\n $response->setStatusCode(200);\n\n return $response;\n }\n }", "public function run()\n {\n // dispatch all routes [between events]\n $this->trigger('horus.dispatch.before');\n\n // execute/disptach all routes relates to current request\n if ( isset($this->router) && $this->router instanceof Horus_Router )\n {\n if($this->router->state == false)\n $this->e404();\n else\n $this->output .= $this->router->output;\n }\n\n // trigger after router exec events\n $this->trigger('horus.dispatch.after');\n\n // get the output\n // prepare then only send if the request is not head\n $this->output .= ob_get_clean();\n\n // trigger before output events\n $this->trigger('horus.output.before', array($this));\n\n // trigger output filters\n $this->output = $this->trigger('horus.output.filter', $this->output, $this->output);\n\n // only send output if not HEAD request\n (strtoupper($_SERVER['REQUEST_METHOD']) == 'HEAD') || (print $this->output);\n\n // trigger after output events\n $this->trigger('horus.output.after', array($this));\n\n // end\n @ob_end_flush(); exit;\n }", "public function consoleProcessAction()\n {\n $response = new ConsoleResponse();\n $request = $this->getRequest();\n $application = $this->getApplication();\n\n /*\n * Check if we are suppressing output of the response.\n * This is most often used in unit tests.\n */\n if ($request->getParam(\"suppressoutput\")) {\n $response->suppressOutput(true);\n }\n\n // Get application level service locator\n $serviceManager = $application->getServiceManager();\n\n // Get the worker service\n $workerService = $serviceManager->get(\"Netric/WorkerMan/WorkerService\");\n\n // Process the jobs for an hour\n $timeStart = time();\n if ($request->getParam(\"runtime\") && is_numeric($request->getParam(\"runtime\"))) {\n $timeExit = time() + (int) $request->getParam(\"runtime\");\n } else {\n $timeExit = time() + (60 * 60); // 1 hour\n }\n $numProcessed = 0;\n\n // Process each job, one at a time\n while ($workerService->processJobQueue()) {\n\n // Increment the number of jobs processed\n $numProcessed++;\n\n // We break once per hour to restart the script (PHP was not meant to run forever)\n if (($timeStart + time()) >= $timeExit) {\n break;\n }\n\n // Check to see if the request has been sent a stop signal\n if ($request->isStopping()) {\n $response->writeLine(\"Exiting job processor\");\n break;\n }\n\n // Be nice to the CPU\n sleep(1);\n }\n\n if (!$request->getParam(\"daemon\")) {\n $response->writeLine(\"Processed $numProcessed jobs\");\n } else {\n $application->getLog()->info(\"Processed $numProcessed jobs\");\n }\n\n return $response;\n }", "public function indexAction(){\n\t\techo \"Welcome malt api controller\";\n\t\texit;\n\t}", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "function go() {\r\n $this->basic_handler();\r\n\r\n }", "private function executeHandle() {\n // call hook function\n is_callable(config('hooks.onExecute')) && call_user_func(config('hooks.onExecute'), $this);\n // execute controller\n $this->router->executeController();\n }", "public function send(){\n\t\t\n\t\texit($this->page->generate());\n\t}", "public function send()\n {\n http_response_code($this->statusCode);\n $this->sendContent();\n }" ]
[ "0.74865115", "0.72614956", "0.71270806", "0.69681424", "0.6871867", "0.68080574", "0.67978424", "0.67379975", "0.6736269", "0.6708775", "0.6676464", "0.6642575", "0.6641322", "0.66269356", "0.6612887", "0.661093", "0.6607749", "0.6605245", "0.66022706", "0.6573332", "0.6570091", "0.65663445", "0.6488387", "0.6461197", "0.64533174", "0.64495754", "0.64464426", "0.6441343", "0.64332944", "0.6423452", "0.6381401", "0.636891", "0.6330966", "0.62845767", "0.6277919", "0.62625504", "0.625479", "0.6249306", "0.62361157", "0.6230684", "0.622808", "0.6207299", "0.6186928", "0.6186192", "0.61819434", "0.61762613", "0.6165114", "0.61641634", "0.6162932", "0.61253244", "0.61237276", "0.61227715", "0.6109617", "0.61054647", "0.6095529", "0.6095442", "0.60669094", "0.6056816", "0.60493326", "0.60444385", "0.6039197", "0.6029272", "0.6019355", "0.6011457", "0.60059506", "0.60013163", "0.59919894", "0.5990548", "0.5981684", "0.5960532", "0.59505963", "0.5938833", "0.59241676", "0.5913356", "0.5908795", "0.5901985", "0.5898536", "0.5890058", "0.5887895", "0.5887759", "0.5887178", "0.5885683", "0.58846223", "0.5882115", "0.5873634", "0.58725864", "0.5871838", "0.5868739", "0.58611584", "0.58576006", "0.585328", "0.5851491", "0.5843038", "0.5838399", "0.5830808", "0.5830533", "0.5821436", "0.5804704", "0.58007926", "0.5799205", "0.5798034" ]
0.0
-1
call controller an specified action
protected function callController(array $attributes) { $action = 'indexAction'; if (isset($attributes['action'])) { $action = $attributes['action'] . 'Action'; } $name = 'lib\\' . $attributes['controller'] . 'Controller'; /** @var Controller $controller */ $controller = new $name; return $controller->$action(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callControllerAction() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n\n $route = $this->getMatchingRoute($santitizedUrl);\n if ($route != null) {\n $actionValues = explode('/', ltrim(str_replace($route->getUrl(), '', $santitizedUrl), '/'));\n $controllerName = $route->getControllerName();\n $controllerName = $controllerName . 'Controller'; \n $controller = new $controllerName;\n $action = $route->getActionName();\n $controller->$action($actionValues);\n } else {\n // If we've entered this else section, we've effectively been unable to match\n // the specified url to a registered route. Normally we would throw a 404\n // error and return a user friendly message stating so, however, I'm leaving\n // that as an exersize for the reader\n }\n \n }", "private function executeAction($controller, $action) {\t\tif(!method_exists($controller, $action))\n\t\t\t$action = 'index';\n\t\t// Finally call controller method\n\t\t$controller->$action();\n\t}", "public function call()\n {\n $controllerClass = self::toClass( $this->controller );\n $actionMethod = self::toMethod( $this->action );\n \n $controllerClass::$actionMethod( $this, $this->params );\n }", "public function invoke($action);", "public function doAction($actionName);", "abstract public function getControllerAction();", "protected function callActionMethod() {}", "protected function run($action) {\n\t\tif (method_exists($this, $action)) {\n\n\t\t\t$this->action = $action;\n\n\t\t\t$this->createView();\n\n\t\t\t$this->$action();\n\t\t} else {\n\n\t\t\tApp::do404('Action ' . $action . ' not found in ' . $this->name);\n\t\t}\n\t}", "public function run() {\r\n\t\tif (isset($_GET['action'])) {\r\n\t\t\t$action = strtolower($_GET['action']);\r\n\t\t} else {\r\n\t\t\t$action = 'index';\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->checkAccess($action)) {\r\n\t\t\t$action = \"action\" . ucwords($action);\r\n\t\t} else {\r\n\t\t\t$action = \"actionNotAllowed\";\r\n\t\t}\r\n\t\t\r\n\t\tif (method_exists($this, $action)) {\r\n\t\t\t$this->$action();\r\n\t\t} else {\r\n\t\t\t$this->invalidAction($action);\r\n\t\t}\r\n\t}", "public function action(Action $action);", "public function run()\n {\n $route = $this->route->mapRoute();\n\n $className = $this->controllerNamespace.$route[0];\n\n $action = $route[1];\n\n $controller = call_user_func([$className, 'getInstance']);\n\n $controller->$action();\n }", "public final function run()\n\t{\n\t\t$controllerClass = ucfirst(App::request()->getControllerName());\n\t\t$actionName = App::request()->getActionName().Request::ACTION_SUFFIX;\n\n\t\t$this->_execute($controllerClass, $actionName);\n\t}", "public function action($action, $controller, $params=array()){\n\t\treturn mvc_service_Front::getInstance()->dispatchAction($action, $controller, $params);\n\t}", "public function run()\n \t{\n \t\t$controller = $this->factoryController();\n\n \t\t$action = $this->_currentAction;\n\n \t\t$controller->$action();\n \t}", "function call($controller, $action)\n{\n $tmp_controller = \"\";\n $tmp_action = \"\";\n\n if (isset($controller)) {\n if (file_exists('app/controllers/' . $controller . '_controller.php')) {\n\n $tmp_controller = $controller;\n\n //REQUIRE THE CONTROLLER\n require_once('controllers/' . $controller . '_controller.php');\n\n }else{\n $tmp_controller = $controller = 'main';\n\n //REQUIRE THE CONTROLLER\n require_once('controllers/' . $controller . '_controller.php');\n }\n }else {\n //If Controller is not set\n $tmp_controller = 'main';\n }\n\n //Create an object with the controller\n $controller_obj = ucfirst($controller) . 'Controller';\n\n $controller = new $controller_obj;\n\n //CHECK IF METHOD EXISTS IN THE CONTROLLER\n if(isset($action))\n {\n if(method_exists($controller, $action))\n {\n $tmp_action = $action;\n }else{\n $tmp_action = 'home';\n }\n }\n\n $controller->{ $tmp_action }();\n}", "public function action(){\n\t\t\t$this->__switchboard('action');\n\t\t}", "public function getControllerAction() {}", "public function run() \n\t{\n\t\tcall_user_func_array(array(new $this->controller, $this->action), $this->params);\t\t\n\t}", "public function callAction($url){\n\t\tif($url == \"\"){\n\t\t\tthrow new \\Exception(\"The action called not is defined\");\n\t\t}\n\t\tif(strpos($url,\"/\") !== false){ //Se intenta llamar una accion de otro controlador\n\t\t\t\n\t\t\t\n\t\t\tif(strpos($url,\"/\") !== false){\n\t\t\t\t//Contiene slashes la url\n\t\t\t\t$Action = explode(\"/\",$url);\n\t\t\t\t$Controller = $Action[0];\t\t\t\t\t\t\t\t//Controlador\n\t\t\t\t$Method = $Action[1] != '' ? $Action[1] : \"Index\";\t\t//Metodo\n\t\t\t\t$Params = [];\t\t\t\t\t\t\t\t\t\t\t//Parametros de la funcion\n\t\t\t\tif(count($Action)>2){\n\t\t\t\t\tfor($key=2; $key<count($Action); $key++){\n\t\t\t\t\t\tif($Action[$key]!=''){\n\t\t\t\t\t\t\t$Params[] = $Action[$key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//No tiene ningun slash, solo nombre del controller tal vez\n\t\t\t\t$Controller = $url;\t\t//Controlador\n\t\t\t\t$Method = \"Index\";\t\t//Metodo\n\t\t\t\t$Params = [];\t\t\t//Parametros de la funcion\n\t\t\t}\n\t\t\t\n\t\t\t//Se valida que el controlador exista\n\t\t\tif(!file_exists(APP_PATH.\"modules/\".$Controller.\"/controllers/\".$Controller.\".php\")){\n\t\t\t\tthrow new \\Exception(\"The controller \".$Controller.\" is not found in the application\");\n\t\t\t}\n\t\t\t//Se valida que el metodo exista\n\t\t\t\n\t\t\t$routeClass = APP_PATH.\"modules/\".$Controller.\"/controllers/\".$Controller.\".php\";\n\t\t\trequire_once($routeClass);\n\t\t\t$objectClassCalled = new $Controller;\n\t\t\t\n\t\t\tif(!method_exists($objectClassCalled,$Method)){\n\t\t\t\tthrow new \\Exception(\"The method \".$Method.\" is not found in the controller\");\n\t\t\t}\n\t\t\t//Se dispara la accion\n\t\t\tif(count($Params)==0){\n\t\t\t\tcall_user_method($Method,$objectClassCalled);\n\t\t\t}else{\n\t\t\t\tcall_user_method_array($Method,$objectClassCalled,$Params);\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\tthrow new \\Exception(\"The action requires a controller and action separes with slashes\");\n\t\t}\n\t}", "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}", "private function callMethod( $controller, $action ) {\r\n\t\t$refController \t\t= new ReflectionObject( $controller );\r\n\t\t$refMethode \t\t\t= $refController->getMethod( $action );\r\n\t\t$aufrufParameter \t= $this->setParameter( $refMethode );\r\n\t\treturn $refMethode->invokeArgs( $controller, $aufrufParameter ); \r\n\t}", "function call($action, $method)\r\n{\r\n // require the file that matches the controller name\r\n require_once ('controller/' . $action . 'Controller.php');\r\n \r\n // create a new instance of the called controller\r\n switch ($action) {\r\n case 'Default':\r\n $controller = new DefaultController();\r\n break;\r\n case 'ChangePassword':\r\n $controller = new ChangePasswordController();\r\n break;\r\n case 'UserHome':\r\n $controller = new UserHomeController();\r\n break;\r\n case 'Account':\r\n $controller = new AccountController();\r\n break;\r\n case 'Tranz':\r\n $controller = new TranzController();\r\n break;\r\n case 'Payment':\r\n $controller = new PaymentController();\r\n break;\r\n case 'Transfer':\r\n $controller = new TransferController();\r\n break;\r\n case 'ATM':\r\n $controller = new ATMController();\r\n break;\r\n case 'Filter':\r\n $controller = new FilterController();\r\n break;\r\n case 'LogIn':\r\n $controller = new LogInController();\r\n break;\r\n case 'Join':\r\n $controller = new JoinController();\r\n break;\r\n }\r\n \r\n // call the method\r\n $controller->{ $method }();\r\n}", "public function run($action) {\n\t\t$methodName = $this->getActionPrefix() . $action;\n\t\tif (!method_exists($this, $methodName)) {\n\t\t\tthrow new ControllerException('Action ' . $methodName . ' does not exist in ' . get_class($this),\n\t\t\t\tControllerException::ERR_ACTION_NOT_FOUND);\n\t\t}\n\t\tif (Config::getInstance()->get('system.performStrictControllerActionNameValidation', false)) {\n\t\t\t$reflection = new \\ReflectionClass($this);\n\t\t\t$method = $reflection->getMethod($methodName);\n\t\t\tif ($method->name != $methodName) {\n\t\t\t\tthrow new ControllerException('Invalid case when running action ' . $methodName . ' in '\n\t\t\t\t\t. get_class($this) . '. The valid case is: ' . $method->name,\n\t\t\t\t\tControllerException::ERR_ACTION_NOT_FOUND);\n\t\t\t}\n\t\t}\n\t\t$this->before();\n\t\t$result = $this->runAction($methodName);\n\t\tif (!empty($result) && !is_string($result) && !($result instanceof ViewAbstract)) {\n\t\t\tthrow new ControllerException('Result of the action (' . get_class($this) . '/' . $action\n\t\t\t\t\t. ') is not an instance of ViewAbstract or string',\n\t\t\t\tControllerException::ERR_INVALID_ACTION_RESULT);\n\t\t}\n\n\t\t// We called the run method, but we did not rendered the output yet\n\t\t$this->runBeforeRender();\n\n\t\t$this->runBeforeResponseSet($result);\n\n\t\tif (!empty($result)) {\n\t\t\tif (is_string($result)) {\n\t\t\t\t$this->response->setRenderedBody($result);\n\t\t\t} else {\n\t\t\t\t$this->response->setBody($result);\n\t\t\t}\n\t\t}\n\t\t$this->after();\n\t}", "public function runController($controllerClass, $action, Request $request, Route $route=null);", "private static function dispatchAction($controller, $action = null) {\n\t\t//$_GET = self::filterGET();\n\t\t// Is er een action meegegeven, anders standaard actie gebruiken\n\t\tif ($action === null) {\n\t\t\t$action = self::getAction($controller);\n\t\t}\n\t\t\n\t\t// Als de action niet bestaat een ActionDoesNotExistException throwen\n\t\tif (!method_exists($controller, $action)) {\n\t\t\tthrow new ActionDoesNotExistException();\n\t\t\t//sreturn false;\n\t\t}\n\t\t\n\t\t// Call the before filter method\n\t\t$controller->beforeFilter();\n\t\t\n\t\t// Checken welke parameters de methode heeft, en welke vereist zijn en welke niet.\n\t\t$ref = new ReflectionMethod($controller, $action);\n\t\t$params = $ref->getParameters();\n\t\t$required = 0;\n\t\t\n\t\t// Als er parameters vereist zijn\n\t\tif (count($params) > 0) {\n\t\t\tforeach($params as $param) {\n\t\t\t\tif (!$param->isOptional()) {\n\t\t\t\t\t$required++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t$params = self::getParams($_GET, $controller);\n\t\t\t\n\t\t\t// Als het aantal gegeven parameters kleiner is dan het aantal vereiste parameters, dan zijn er parameters te kort.\n\t\t\tif (count($params) < $required) {\n\t\t\t\tthrow new MissingArgumentsException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tswitch(count($params)) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$controller->{$action}($params[0]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t$controller->{$action}($params[0], $params[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t$controller->{$action}($params[0], $params[1], $params[2]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\t$controller->{$action}($params[0], $params[1], $params[2], $params[3]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcall_user_func_array(array($controller, $action), $params);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Voer een action uit zonder parameters\n\t\t\t$controller->{$action}();\n\t\t}\n\t\t\n\t\t// Call the afterFilter method\n\t\t$controller->afterFilter();\n\t}", "public function run()\n {\n call_user_func_array(array(new $this->controller, $this->action), $this->params);\n }", "public function doAction() {\n $action = $this->action;\n\n if ($this->beforeDoAction() == false) return;\n\n if (empty($action) || method_exists($this, $action) == false) {\n $this->defaultAction();\n return;\n }\n\n //2. do the method in action\n $this->$action();\n $this->afterDoAction();\n }", "protected function action()\n {\n switch($this->action)\n {\n case 'load':\n $this->load();\n break;\n }\n }", "function do_action( $name ) {\n\n\t\t$args = func_get_args();\n\t\tarray_unshift( $args, 'action' );\n\n\t\tcall_user_func_array( array( $this, 'api'), $args );\n\n\t}", "function call($controller,$action)\n{\n //include the controller file that matches the controller needed\n require_once ('controllers/'.$controller.'_controller.php');\n //create an instance of the needed controller\n switch ($controller){\n case 'pages':\n $controller = new pagesController();\n break;\n case 'posts':\n require_once ('model/dataMappers/article/class.article.php');\n require_once ('model/dataMappers/article/class.rates.php');\n $controller = new Postscontroller();\n break;\n case 'signup':\n require_once('model/dataMappers/register/class.register.php');\n $controller = new Signupcontroller();\n break;\n case 'login':\n $controller = new Login();\n break;\n }\n //call the needed action\n //say home action is called, call will be $controller->home();\n $controller->{ $action }();\n}", "public function _doAction();", "function call($controller, $action) {\n require_once('controller/'. $controller .'_controller.php');\n\n\n // create a new instance of the needed controller\n switch($controller) {\n case 'admin':\n $controller = new AdminController();\n break;\n case 'movie':\n // we need the model to query the database later in the controller\n require_once('model/movie.php');\n $controller = new MovieController();\n break;\n case 'layout':\n // we need the model to query the database later in the controller\n require_once('model/layout.php');\n $controller = new LayoutController();\n break;\n case 'cinema':\n // we need the model to query the database later in the controller\n require_once('model/cinema.php');\n $controller = new CinemaController();\n break;\n case 'schedule':\n // we need the model to query the database later in the controller\n require_once('model/schedule.php');\n require_once('model/cinema.php');\n require_once('model/layout.php');\n require_once('model/movie.php');\n $controller = new ScheduleController();\n break;\n case 'user':\n require_once('model/schedule.php');\n require_once('model/cinema.php');\n require_once('model/layout.php');\n require_once('model/movie.php');\n require_once('model/ticket.php');\n $controller = new UserController();\n break;\n\n }\n\n // call the action\n $controller->{ $action }();\n }", "public function run()\n {\n if ($this->match()) {\n $path = 'AlDente\\controllers\\\\' . ucfirst($this->params['controller']) . 'Controller';\n if (class_exists($path)) {\n $action = $this->params['action'] . 'Action';\n if (method_exists($path, $action)) {\n $controller = new $path($this->params);\n $controller->$action();\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n } else {\n View::errorCode(404);\n }\n }", "public function action();", "public function action()\n {\n foreach ($this->actions as $action) {\n $action->run();\n }\n }", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "public function dispatch()\n {\n $data = $this->router->getData();;\n $c = $data->controller;\n $ref = new $c($data->params);\n $a = $data->action;\n if (!is_null($a) && !empty($a)) call_user_func(array($ref, $a));\n return;\n }", "protected function executeAction() {}", "private function invoke($action)\n {\n if (!method_exists($this, $action)) {\n Exception::toss('The action \"%s\" is not defined in the controller \"%s\".', $action, get_class($this));\n }\n\n $class = new ClassReflector($this);\n $method = $class->getMethod($action);\n $params = $this->request->getParams();\n\n if ($this->filter) {\n $this->applyClassFilters($class, $method);\n $this->applyActionFilters($class, $method);\n }\n \n return $method->invokeArgs($this, $this->request->getParams());\n }", "public function dispatch()\n\t{\n\t\t$this->{$this->_action}();\n\t}", "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 call($controller, $action)\n{\n require_once('controllers/' . $controller . '_controller.php');\n\n // create a new instance of the needed controller\n switch ($controller) {\n //for non-data-driven pages use the PagesController class\n case 'body_parts':\n $controller = new BodyPartsController();\n break;\n case 'pages':\n $controller = new PagesController();\n break;\n case'difficulty':\n $controller = new DifficultyController();\n break; \n case'filter':\n $controller = new HomePageController();\n break;\n case 'users':\n $controller = new UsersController();\n break;\n case 'posts':\n $controller = new PostsController();\n break;\n case 'login':\n $controller = new LoginController();\n break;\n case 'comments':\n $controller = new CommentsController();\n break;\n case 'images':\n $controller = new ImagesController();\n break;\n\n //we will need to add a separate case for each controller\n default:\n //for all data-driven pages use a specific Controller class\n //we need the model to query the database later in the process\n require_once(\"models/{$controller}.php\");\n $controllerClassName = $controller . 'Controller';\n $controller = new $controllerClassName();\n break;\n }\n // call the requested action\n $controller->{$action}();\n}", "public function invokeAction(Trace $trace, $action, Context $context);", "public function executeAction() {\r\n\t\t\r\n\t}", "public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }", "public function getControllerAction()\n\t{\n\t\tif (file_exists('Controller/' . $this->class_Name . 'Controller.php')) {\n\t\t\tinclude_once 'Controller/' . $this->class_Name . 'Controller.php';\n\t\t\t$executeClass = new $this->class_Name;\n\t\t\t$executeAction = $this->action_Name;\n\t\t} else {\n\t\t\t$this->pageDontExist();\n\t\t}\n\t\tif (method_exists($executeClass, $executeAction)) {\n\t\t\t$executeClass->$executeAction();\n\t\t\t}\n\t}", "public function GetControllerAction ();", "protected function _run_action($action)\n {\n $this->$action();\n }", "public function call($data, $action)\n {\n }", "function performAction($action)\n{\n\trequire_once(SITE_DIR.'_classes/_factory/_ActionFactory.php');\n\t$action = ActionFactory::createAction($action);\n\t$result = $action->execute();\n}", "function request($controller,$action){\n\t\t$data = ucfirst($controller);\n\t\t$file = '\\\\app\\\\module\\\\'. $data . DS . $data .'Controller';\n\t\trequire_once ROOT.$file.'.php';\n\t\t$c = new $file();\n\t\treturn $c->$action(); \n\t}", "function _action($action)\n\t{\n\t // Lay input\n\t $ids = $this->uri->rsegment(3);\n\t $ids = (!$ids) ? $this->input->post('id') : $ids;\n\t $ids = (!is_array($ids)) ? array($ids) : $ids;\n\t\n\t // Thuc hien action\n\t foreach ($ids as $id)\n\t {\n\t // Xu ly id\n\t $id = (!is_numeric($id)) ? 0 : $id;\n\t \t\n\t // Kiem tra id\n\t $info = model('user_bank')->get_info($id);\n\t if (!$info) continue;\n\t \n\t // Chuyen den ham duoc yeu cau\n\t $this->{'_'.$action}($info);\n\t }\n\t}", "public function dispatch($url){\n\n /*\n Before checking for a match we must get only the first GET Param,\n if others were added to the URL (?key=value), we must remove them\n */\n if($url != ''){\n $parts = explode('&', $url, 2);\n if( strpos($parts[0], '=') === false ){\n //if no '=' was not found, no extra GET params passed in, url is valid\n $url = $parts[0];\n }else {\n //only get vars were passed in, empty URL to send to Home Page\n $url = '';\n }\n }\n\n // Handle a match\n if( $this->match($url) ){\n // Filter Controller\n //route params are now inside object instance $this->params\n $controller = $this->params['controller'];\n //convert to StudlyCaps as this is how the actual Controller class should be defined\n $controller = $this->convertToStudlyCaps($controller);\n //Check if a namespace has been specified for the conroller in the route's params\n $controller = $this->getNamespace() . $controller;\n\n // Make sure that the controller class exists before we instantiate it\n if( !class_exists($controller) ){\n throw new \\Exception(\"Controller class: $controller not found\");\n }\n //class exists...create the object\n $controllerObj = new $controller($this->params);\n\n // Filter Action...default to index\n $action = (isset($this->params['action'])) ? $this->params['action'] : 'index';\n\n //convert action string to camelCase, as this is how the class method should be defined\n $action = $this->convertToCamelCase($action);\n //the actual method will have 'Action' appended to the end,\n //this is done to force execution of the __call function, this can be bypassed however,\n //if the user inputted URL has 'Action' explicitly appended to\n //...check that the action does not have action appeded to it\n if( preg_match( '/action$/i', $action) ){\n throw new \\Exception(\"Method $action in controller $controller cannot be called directly - remove the Action suffix to call this method\");\n }\n //Finally, call Action on controller\n //THE CONTROLLER METHOD WILL NOT EXIST, THIS WILL FORCE THE EXECUTION OF THE\n // __call METHOD THAT SHOULD BE DEFINED IN THE CONTAINING CLASS\n $controllerObj->$action();\n }else {\n //No route matched\n throw new \\Exception(\"No route matched for $url\", 404);\n }\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}", "private function _callControllerMethod()\n {\n $length = count($this->_url);\n\n // Make sure the method we are calling exists\n if ($length > 1) {\n if (!method_exists($this->_controller, $this->_url[1])) {\n //! error\n }\n }\n //var_dump($this->_controller);\n // Determine what to load\n switch ($length) {\n /*case 3:\n //Controller->Method(Param1, Param2)\n $this->_controller->{$this->_url[1]}($this->_url[2]);\n break;\n*/\n case 2:\n //Controller->Method(Param1, Param2)\n //$this->_controller->{$this->_url[1]}();\n $this->_controller->index($this->_url[1]);\n break;\n\n default:\n $this->_controller->index();\n break;\n }\n }", "private function callControllerMethod() {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (isset($this->url[1])) {\r\n\t\t\t\tif (method_exists($this->controller, $this->url[1])) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$parameters = array();\r\n\t\t\t\t\tfor ($i = 2; $i < count($this->url); $i++)\r\n\t\t\t\t\t\tarray_push($parameters, $this->url[$i]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t$countParam = count($parameters);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($countParam == 0)\r\n\t\t\t\t\t\t$this->controller->{$this->url[1]}();\r\n\t\t\t\t\telse if ($countParam == 1)\r\n\t\t\t\t\t\t$this->controller->{$this->url[1]}($parameters[0]);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$this->controller->{$this->url[1]}($parameters);\r\n\t\t\t\t\t\t\r\n\t\t\t\t} else { //Method not found.\r\n\t\t\t\t\t$this->error();\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} else { //No method is specified.\r\n\t\t\t\t$this->controller->index(); \r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t} catch (QueryException $e) {\r\n\t\t\t$this->error($e->getMessage() . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t\t\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$msg = $e->getMessage();\r\n\t\t\tif ($msg == \"\")\r\n\t\t\t\t$msg = \"An error occuring during execution\";\r\n\t\t\t\r\n\t\t\t$this->error($msg . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t}\r\n\t}", "public function dispatch($action, array $params = null);", "function call_method($controller, $action, $segments, $slice)\n {\n $obj = new $controller;\n die(call_user_func_array(array($obj, $action), array_slice($segments, $slice)));\n }", "function callMethod($action) {\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\t\t$protocol = \"http\";\n\t\tif (isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '') {\n\t\t\t$protocol = \"https\";\n\t\t}\n\t\t//if ($this->config->getValue('FW', 'https') == true) {\n\t\t//\t$protocol = \"https\";\n\t\t//}\n\t\theader(\"Location: $protocol://$host$uri/$action\");\n\t\texit;\n\t}", "public function callAction($method, $parameters);", "protected function callAction($controller, $action) {\r\n\r\n $controller = \"App\\\\Controllers\\\\{$controller}\";\r\n\r\n $controller = new $controller;\r\n\r\n if (! method_exists($controller, $action)) {\r\n throw new Exception(\r\n \"{$controller} does not respond to the {$action} action.\"\r\n );\r\n }\r\n\r\n return $controller->$action();\r\n }", "private function _callControllerMethod()\r\n {\r\n \r\n \r\n $length = count($this->_url);\r\n if($length > 1)\r\n {\r\n if(!method_exists($this->_controller, $this->_url[1]))\r\n {\r\n $this->_error();\r\n }\r\n }\r\n switch ($length) {\r\n case 5:\r\n //controller->method(param1,param2,param3)\r\n $this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4]);\r\n break;\r\n case 4:\r\n //controller->method(param1,param2)\r\n $this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3]);\r\n\r\n break;\r\n case 3:\r\n //controller->method(param1)\r\n $this->_controller->{$this->_url[1]}($this->_url[2]);\r\n\r\n break;\r\n case 2:\r\n\r\n //controller->method(param1,param2,param3)\r\n $this->_controller->{$this->_url[1]}();\r\n break;\r\n \r\n default:\r\n $this->_controller->index();\r\n break;\r\n }\r\n\r\n }", "public function action($controller, $method, $arguments)\n {\n $object = $this->controller($controller);\n return call_user_func([$object, $method], $arguments);\n }", "public function handle($action) {\n $callback = $this->resolve_controller_callback($action);\n $response = $this->generate_response($callback);\n $this->send_response($response);\n }", "function action($action=null) {\n switch ($action) {\n\t\tcase 'payreturn' : echo GetGlobal('controller')->calldpc_method(\"stutasks.invoice_viewer use \".$this->transaction.\"+1\");\n\t\t die();\n\t\t break;\n\t\tcase 'paycancel' : echo GetGlobal('controller')->calldpc_method(\"stutasks.invoice_viewer use \".$this->transaction);\n\t\t die();\n\t\t break;\n\t\tcase 'payipn' : $ret = null;//'Key:' . GetReq('key');//null;\n\t\t break; \n\t\tcase 'stutpay' :\t\t\t\t \n\t case 'process' : //$ret = $this->error;//null;//must not have action, if error goto frontpage'Please wait processing...'; \n\t default : $ret = seturl('t=',localize('_HOME',getlocal()));\n\t\t $ret .= $this->set_message('error');\n\n\t } \n\t \n\t return ($ret);\n }", "public function controller()\r\n {\r\n $collector = $this->getControllerCollector();\r\n \r\n foreach (func_get_args() as $controller) {\r\n call_user_func([$collector, 'controller'], $controller);\r\n }\r\n }", "protected function ExecAction() {\r\n if (self::$sAction == \"new\")\r\n //self::$sAction = \"edit\";\r\n self::$sAction = \"add\";\r\n\r\n // Ищем контроллер\r\n $sControllerPath = \"/var/www/ad/app/controllers/\".self::$sController.\"_controller.php\";\r\n if (file_exists($sControllerPath)) {\r\n require_once($sControllerPath);\r\n\r\n $aClassPathComponents = explode(\"/\",self::$sController);\r\n $sClass = $aClassPathComponents[count($aClassPathComponents)-1];\r\n $sClass = ucfirst($sClass);\r\n $sClass = preg_replace_callback('/_([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $sClass);\r\n $sControllerClass = $sClass.\"Controller\";\r\n\r\n $this->oController = new $sControllerClass(self::$sController,self::$sAction);\r\n $this->oController->parameters = self::$aParameters;\r\n\r\n foreach(self::$aObjects as $oObject) {\r\n $sName = strtolower(get_class($oObject));\r\n $this->oController->$sName = $oObject;\r\n }\r\n call_user_func_array(array($this->oController,self::$sAction),self::$aObjects);\r\n\r\n return true;\r\n }\r\n }", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "static function perform_controller_action($class_path,$action,$objects,$parameters) {\r\n\t\t\r\n\t\t//We treat 'new' the same as 'edit', since they generally contain a lot of the same code\r\n\t\tif ($action == \"new\") {\r\n\t\t\t$action = \"edit\";\r\n\t\t}\r\n\t\t\r\n\t\t//Let's look for a controller\r\n\t\t$controller_path = SITE_PATH.\"/controllers/\".$class_path.\"_controller.php\";\r\n\r\n\r\n\t\tif (file_exists($controller_path)) {\r\n\t\t\trequire_once($controller_path);\r\n\t\t\t\r\n\t\t\t$class_path_components = explode(\"/\",$class_path);\r\n\t\t\t$class = $class_path_components[count($class_path_components)-1];\r\n\t\t\t$controller_class = $class.\"_controller\";\r\n\t\t\tif (!method_exists($controller_class,$action)) {\r\n\t\t\t\tif (router::render_view($class_path,$action)) {\r\n\t\t\t\t\texit;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfatal_error(\"$controller_class does not respond to $action\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$controller = new $controller_class();\r\n\t\t\t$controller->parameters = $parameters;\r\n\t\t\tcall_user_func_array(array($controller,$action),$objects);\r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t//If no controller was found, we'll look for a view\r\n\t\tif (router::render_view($class_path,$action)) {\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "public function run()\n\t{\n\t\t$_controller = $this->getController();\n\t\t\n\t\tif ( ! ( $_controller instanceof IXLRest ) )\n\t\t{\n\t\t\t$_controller->missingAction( $this->getId() );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tCall the controllers dispatch method...\n\t\t$_controller->dispatchRequest( $this );\n\t}", "public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}", "abstract public function doAction($argv);", "private function runActionMethod($controllerObj, $actionMethod, $actionParameters)\n {\n call_user_func_array([$controllerObj, $actionMethod], $actionParameters);\n }", "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 function proxyAction()\n {\n $action = $this->getParam('call');\n $this->forward($action);\n }", "public function showAction(){\n\n }", "public function didInvokeAction(string $action, ControllerResultInterface $result): void;", "public function route() {\n\t\t$action = $this->validateAction();\n\t\tif (method_exists($this, str_replace('-', '', $action))) {\n\t\t\t$this->$action();\n\t\t} else {\n\t\t\t$this->error($action);\n\t\t}\n\t}", "function executeController()\r\n{\r\n\t// Uri and figure out the path to the controller.\r\n\t$request = trim($_GET['request'], \"/ \");\r\n\t\r\n\tif ($request != '') {\r\n\t // Using the URL segments, construct the name of the class.\r\n\t // Note: The class name is mapped to the directory structure.\r\n\t $reqSegments = explode(\"/\", $request);\r\n\t}\r\n\t\r\n\t$controllerName = 'App_Pages_';\r\n\t$controllerName .= ($reqSegments[0])?$reqSegments[0]:'Index';\r\n\t$controllerName .= '_Controller';\r\n\t\r\n\t$actionName = ($reqSegments[1])?$reqSegments[1]:'index';\r\n\r\n\tif (class_exists($controllerName)) {\r\n\t\tif (method_exists($controllerName, $actionName)) {\r\n\t\t\t$controller = new $controllerName();\r\n\t\t\t$controller->$actionName();\r\n\t\t} else {\r\n\t\t\tdie('Page not found');\r\n\t\t}\r\n\t} else {\r\n\t\tdie('Page not found');\r\n\t}\r\n}", "public function executeAction() {\n return $this->{$this->action}();\n }", "private function _execute($controller, $action, $params=null)\n\t{\n $controllerObj = App::controller($controller);\n\n\t\t$inst = Request::CONTROLLER_SUFFIX;\n\t\tif (!($controllerObj instanceof $inst))\n\t\t\tthrow new RequestException('Controller must be extends class - '.Request::CONTROLLER_SUFFIX, E_USER_ERROR);\n\n\t\tif( !method_exists($controllerObj,$action) && !method_exists($controllerObj,'__call') )\n\t\t\tthrow new RequestException('Can\\'t find method '.$action);\n\n $run = true;\n if(method_exists($controllerObj, Request::BEFORE_ACTION_PREFIX.ucfirst($action)))\n {\n $run = $run && call_user_func(array($controllerObj, Request::BEFORE_ACTION_PREFIX.ucfirst($action)), $params);\n }\n \n if($run)\n call_user_func(array($controllerObj, $action), $params);\n \n if(method_exists($controllerObj, Request::AFTER_ACTION_PREFIX.ucfirst($action)))\n {\n call_user_func(array($controllerObj, Request::AFTER_ACTION_PREFIX.ucfirst($action)), $params);\n }\n\n\t\t$controllerObj->_end();\n\t}", "public function action($func, $params)\n {\n }", "protected function executeAction() {\n \n }", "private function callAction(string $controller, ?string $action) {\n if ($action !== null) {\n if (method_exists($controller, $action)) {\n call_user_func_array(array($controller, $action), $this->getArrayOfParameters(new \\ReflectionMethod($controller, $action)));\n } else {\n throw new MissingActionException([$controller, $action]);\n }\n }\n }", "public function process() {\r\n if(!in_array($this->getRouter()->getAction(), $this->getAllowActions()) || $this->getRouter()->getAction() == null) {\r\n $this->defaultAction();\r\n } else {\r\n $customAction = $this->getRouter()->getAction().Globals::getConfig()->action->suffix;\r\n $this->$customAction();\r\n }\r\n }", "public function willInvokeAction(string $action): void;", "function dispatch_route($controller, $action, array $parameters){\r\n\t\t$this->current_controller = $controller;\r\n\t\t$this->current_action = $action;\r\n\t\t\r\n\t\t$result = $this->call_action($controller, $action, $parameters);\r\n\t\t\r\n\t\t$response = $this->handle_result($result);\r\n\t\t\r\n\t\treturn $response;\r\n\t}", "public function post($route, $controllerAction = '');", "protected function getAction() {}", "public function dispatch(Action $action): mixed;", "public function SetControllerAction ($controllerAction);", "public function doAction($action)\n {\n $this->resetInput();\n $this->action = $action;\n }", "public function indexAction() : string\n {\n // Deal with the action and return a response.\n return \"index\";\n }", "public function dispatch($controller, $action, $params) {\n\t\t// Include Controller File\n\t\trequire_once \"src/{$controller}.php\";\n\t\t// Load Action\n\t\t$controller .= 'Controller';\n\t\t$action.= 'Action';\n\t\t$c = new $controller($controller, $action, $params);\n\t\t$c->$action($params);\n\t\treturn;\n\t}", "public function action($parameter);", "public function action() {\n\t\tif( ! $this->request_method )\n\t\t\treturn false;\n\t\tswitch ($this->request_method) {\n\t\t\tcase 'read':\n\t\t\t\t$this->read();\t\t\t\t\t\n\t\t\tbreak;\t\t\t\t\n\t\t\tcase 'create':\t\n\t\t\t\t$this->create();\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'update':\n\t\t\t\t$this->update();\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\t$this->delete();\t\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}", "public function performAction()\n {\n if (isset($_SESSION['user_id'])) {\n $this->_userLoggedIn();\n } else if (isset($_POST['signin'])) {\n $this->_signInRequested();\n } else if (isset ($_POST['signup'])) {\n $this->_signUpPageRequested();\n } else {\n $this->_noActionTaken();\n }\n }", "public function route($action) {\n\t\tswitch($action) {\n\n\t\t\tcase 'view':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->view($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'index':\n\t\t\t\t$this->index();\n\t\t\t\tbreak;\n\n\t\t\tcase 'add':\n\t\t\t\t$this->add();\n\t\t\t\tbreak;\n\n\t\t\tcase 'addProcess':\n\t\t\t\t$this->addProcess();\n\t\t\t\tbreak;\n\n\t\t\tcase 'addLifeEventProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->addLifeEventProcess($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'deleteProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->deleteProcess($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'edit':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->edit($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'editProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->editProcess($id);\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "public static function call($actionName=null, $arguments=null){ }" ]
[ "0.79901946", "0.79188377", "0.77416223", "0.766105", "0.746453", "0.7463241", "0.74615264", "0.742825", "0.7390713", "0.7387026", "0.7281645", "0.72419536", "0.72375214", "0.72012496", "0.7192136", "0.71918553", "0.7183155", "0.7164269", "0.7158835", "0.7156036", "0.7128411", "0.709674", "0.7093085", "0.7080364", "0.70693654", "0.7053803", "0.7021605", "0.7017008", "0.69989234", "0.697602", "0.69721895", "0.69641405", "0.69604194", "0.6960403", "0.69528174", "0.694546", "0.694546", "0.694546", "0.6944885", "0.6943682", "0.6926335", "0.69222856", "0.6888673", "0.68715376", "0.6860843", "0.68509924", "0.6846993", "0.68427306", "0.68427175", "0.68364507", "0.6819923", "0.68020976", "0.67833483", "0.67811245", "0.6764533", "0.67629296", "0.67499286", "0.6738865", "0.6711036", "0.6694298", "0.66881156", "0.66874546", "0.6685427", "0.66772735", "0.6651299", "0.66462326", "0.66246444", "0.66133493", "0.6612959", "0.66122216", "0.6611313", "0.6609869", "0.660774", "0.6587604", "0.65850407", "0.65805393", "0.65691566", "0.6567735", "0.65607476", "0.65604526", "0.65535784", "0.65535337", "0.65504736", "0.6548041", "0.65473586", "0.65397555", "0.6538217", "0.6517756", "0.65134275", "0.6512347", "0.6508389", "0.65021825", "0.6501863", "0.64948446", "0.64944524", "0.64908624", "0.64740586", "0.64732283", "0.6466085", "0.6465312", "0.64645344" ]
0.0
-1
Return the form metadata.
public static function get_term_definition() { return array( 'title' => 'Term editor', 'category' => 'General Purpose Data Entry Forms', 'description' => 'A simple page for editing terms in a warehouse termlist.' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMetaData()\n {\n if (is_null($this->_metaData)) {\n list($app, $name) = explode('/', $this->_config['name']);\n $args = array($name, $this->_config['params']);\n $this->_metaData = $GLOBALS['registry']->callByPackage(\n $app, 'getTableMetaData', $args);\n\n // We need to make vars for the columns.\n foreach ($this->_metaData['sections'] as $secname => $section) {\n foreach ($section['columns'] as $col) {\n $title = isset($col['title']) ? $col['title'] : '';\n $typename = isset($col['type']) ? $col['type'] : 'text';\n $params = isset($col['params']) ? $col['params'] : array();\n // Column types which begin with % are pseudo-types handled\n // directly.\n if (substr($typename, 0, 1) != '%') {\n $type = Horde_Form::getType($typename, $params);\n $var = new Horde_Form_Variable(\n $title, $col['name'], $type, false, true, '');\n $this->_formVars[$secname][$col['name']] = $var;\n }\n }\n }\n }\n\n return $this->_metaData;\n }", "public function metadata()\r\n\t{\r\n return array(\"nit\" => array(),\r\n \"nombre\" => array(),\r\n \"telefono\" => array(),\r\n \"direccion\" => array(),\r\n \"correo\" => array());\r\n }", "public function provideMetaDataFieldsDefinition(AbstractCrudForm $form): array;", "public function getFieldsMetadata()\n {\n return $this->fieldsMetadata;\n }", "abstract public function getFormDesc();", "public function getMetaData()\n {\n return $this->metadata;\n }", "protected function metadataFields()\n {\n return [\n 'first_name',\n 'last_name',\n 'city',\n 'phone_number',\n 'state',\n 'postal_code',\n 'modified_by'\n ];\n }", "function getMetadata() {\n\t\treturn $this->_Metadata;\n\t}", "public function getMetaData()\n {\n return [\n 'type' => $this->type,\n 'mimetype' => $this->mimetype,\n 'size' => $this->size,\n 'width' => $this->width,\n 'height' => $this->height\n ];\n }", "public function getMetadata()\n {\n return $this->Metadata;\n }", "public function getFormContent()\n {\n return $this->form->getContent();\n }", "public function getForm() {\n\t\treturn isset($this->attributes['form'])?$this->attributes['form']:null;\n\t}", "public function get_data()\n {\n return $this->form_data;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getFormParameters()\n {\n return $this->form_parameters;\n }", "public function getMetadata()\n {\n return $this->_metadata;\n }", "public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }", "public function getMetadata();", "public function getMetadata();", "public function getMetadata();", "public function formdata()\n {\n return Formdata::getinstance();\n }", "public function getFormData()\n {\n return $this->_getApi()->getFormFields($this->_getOrder(), $this->getRequest()->getParams());\n }", "public function getMetadata() {}", "public function getMetadata() {}", "public function get_metadata() {\n return $this->metadata;\n }", "public function getMeta();", "public function getMeta();", "public function form_fields() {\n\t\treturn apply_filters( \"appthemes_{$this->box_id}_metabox_fields\", $this->form() );\n\t}", "public function getForm();", "protected function getMetadata()\n {\n // object not working must use array\n $metadata['platform'] = \"Magento 1\";\n $metadata['version'] = Mage::getVersion();\n return $metadata;\n }", "public function getMetaData();", "public static function getFormFieldMap() {\n return array(\n 'name' => 'title',\n 'blurb' => 'blurb',\n 'image' => 'image',\n 'link' => 'link',\n );\n }", "protected function _getForm() \r\n\t{ \r\n\t\t$form = \"\";\r\n\t\t$allElementSets = $this->_getAllElementSets();\r\n\t\t$ignoreElements = array();\r\n\t\tforeach ($allElementSets as $elementSet) { //traverse each element set to create a form group for each\r\n\t\t\tif($elementSet['name'] != \"Item Type Metadata\") { // start with non item type metadata\r\n\t\t\t\t\r\n\t\t\t\t$form .= '<div id=\"' . text_to_id($elementSet['name']) . '-metadata\">';\r\n\t\t\t\t$form .= '<fieldset class=\"set\">';\r\n\t\t\t\t$form .= '<h2>' . __($elementSet['name']) . '</h2>';\r\n\t\t\t\t$form .= '<p class=\"element-set-description\" id=\"';\r\n\t\t\t\t$form .= html_escape(text_to_id($elementSet['name']) . '-description') . '\">';\r\n\t\t\t\t$form .= url_to_link(__($elementSet['description'])) . '</p>';\r\n\t\t\t\t\r\n\t\t\t\t$elements = $this->_getAllElementsInSet($elementSet['id']);\r\n\t\t\t\tforeach ($elements as $element) { //traverse each element in the set to create a form input for each in the form group\r\n\t\t\t\t\t$allElementValues = $this->_allElementValues($element['id'], $elements);\r\n\t\t\t\t\tif ((!in_array($element['id'], $ignoreElements)) && (count($allElementValues) > 1)) { // if the element has a value and has multiple inputs\r\n\t\t\t\t\t\t$form .= $this->_field($allElementValues, true);\r\n\t\t\t\t\t\tarray_push($ignoreElements, $element['id']);\r\n\t\t\t\t\t} else if (!in_array($element['id'], $ignoreElements)) { \r\n\t\t\t\t\t\t$form .= $this->_field($allElementValues, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$form .= \"</fieldset>\";\r\n\t\t\t\t$form .= \"</div>\";\r\n\t\t\t} else { // if item type metadata\r\n\t\t\t\t$item_types = get_records('ItemType', array('sort_field' => 'name'), 1000);\r\n\t\t\t\t$defaultItemType = $this->_helper->db->getTable('DefaultMetadataValue')->getDefaultItemType();\r\n\t\t\t\t$defaultItemTypeId = 0;\r\n\t\t\t\tif (!empty($defaultItemType)) {\r\n\t\t\t\t\t$defaultItemTypeId = intval($defaultItemType[0][\"text\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$form .= '<div id=\"item-type-metadata-metadata\">';\r\n\t\t\t\t$form .= '<h2>' . __($elementSet['name']) . '</h2>';\r\n\t\t\t\t$form .= '<div class=\"field\" id=\"type-select\">';\r\n\t\t\t\t$form .= '<div class=\"two columns alpha\">';\r\n\t\t\t\t$form .= '<label for=\"item-type\">Item Type</label> </div>';\r\n\t\t\t\t$form .= '<div class=\"inputs five columns omega\">';\r\n\t\t\t\t$form .= '<select name=\"item_type_id\" id=\"item-type\">';\r\n\t\t\t\t$form .= '<option value=\"\">Select Below </option>';\r\n\t\t\t\tforeach ($item_types as $item_type) {\r\n\t\t\t\t\tif($item_type[\"id\"] == $defaultItemTypeId) {\r\n\t\t\t\t\t\t$form .= '<option value=\"' . $item_type['id'] . '\" selected=\"selected\">' . $item_type['name'] . '</option>';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$form .= '<option value=\"' . $item_type['id'] . '\">' . $item_type['name'] . '</option>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$form .= '</select> </div>';\r\n\t\t\t\t$form .= '<input type=\"submit\" name=\"change_type\" id=\"change_type\" value=\"Pick this type\" style=\"display: none;\">';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '<div id=\"type-metadata-form\">';\r\n\t\t\t\t$form .= '<div class=\"five columns offset-by-two omega\">';\r\n\t\t\t\t$form .= '<p class=\"element-set-description\">';\r\n\t\t\t\t$form .= '</p>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t$form .= '</div>';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n return $form;\r\n }", "public function getMetaInfo() {\n return $this->meta;\n }", "function getForm()\n {\n return $this->getAttribute(\"form\");\n }", "public function getMetaData() {\n\t\treturn $this->arrMetadata;\n\t}", "public function MetadataEntryForm()\n {\n // NIWA are worried about parameter case and would like it case insensitive so convert all get vars to lower\n // I think this is because they are not 100% what case the parameters from oracle will be in.\n $params = array_change_key_case($this->getRequest()->getVars(), CASE_LOWER);\n\n // Check in the parameters sent to this page if there are certian fields needed to power the\n // functionality which emails project coordinators and if so get them as we will need to add\n // them to the bottom of the form as hidden fields, this way we can access them in the form\n // processing and send the email.\n $hiddenFields = array();\n\n // These 2 fields can be populated either by Project_Coordinator or Project_Administrator as Oracle actually\n // sends Project_Administrator. NIWA want to keep the field here called coordinator.\n if (!empty($params['project_coordinator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_coordinator'];\n } else if (!empty($params['project_administrator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_administrator'];\n }\n\n if (!empty($params['project_coordinator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_coordinator_email'];\n } else if (!empty($params['project_administrator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_administrator_email'];\n }\n\n if (!empty($params['project_manager'])) {\n $hiddenFields['_Project_Manager'] = $params['project_manager'];\n }\n\n if (!empty($params['project_code'])) {\n $hiddenFields['_Project_Code'] = $params['project_code'];\n }\n\n // Get the fields defined for this page, exclude the placeholder fields as they are not displayed to the user.\n $metadataFields = $this->Fields()->where(\"FieldType != 'PLACEHOLDER'\")->Sort('SortOrder', 'asc');\n\n // Create fieldfield for the form fields.\n $formFields = FieldList::create();\n $actions = FieldList::create();\n $requiredFields = array();\n\n // Push the required fields message as a literal field at the top.\n $formFields->push(\n LiteralField::create('required', '<p>* Required fields</p>')\n );\n\n if ($metadataFields->count()) {\n foreach($metadataFields as $field) {\n // Create a version of the label with spaces replaced with underscores as that is how\n // any paraemters in the URL will come (plus we can use it for the field name)\n $fieldName = str_replace(' ', '_', $field->Label);\n $fieldLabel = $field->Label;\n\n // If the field is required then add it to the required fields and also add an\n // asterix to the end of the field label.\n if ($field->Required) {\n $requiredFields[] = $fieldName;\n $fieldLabel .= ' *';\n }\n\n // Check if there is a parameter in the GET vars with the corresponding name.\n $fieldValue = null;\n\n if (isset($params[strtolower($fieldName)])) {\n $fieldValue = $params[strtolower($fieldName)];\n }\n\n // Define a var for the new field, means no matter the type created\n // later on in the code we can apply common things like the value.\n $newField = null;\n\n // Single line text field creation.\n if ($field->FieldType == 'TEXTBOX') {\n $formFields->push($newField = TextField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'TEXTAREA') {\n $formFields->push($newField = TextareaField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'KEYWORDS') {\n // If keywords then output 2 fields the textbox for the keywords and then also a\n // literal read only list of those already specified by the admin below.\n $formFields->push($newField = TextAreaField::create($fieldName, $fieldLabel));\n $formFields->push(LiteralField::create(\n $fieldName . '_adminKeywords',\n \"<div class='control-group' style='margin-top: -12px'>Already specified : \" . $field->KeywordsValue . \"</div>\"\n ));\n } else if ($field->FieldType == 'DROPDOWN') {\n // Some dropdowns have an 'other' option so must add the 'other' to the entries\n // and also have a conditionally displayed text field for when other is chosen.\n $entries = $field->DropdownEntries()->sort('SortOrder', 'Asc')->map('Key', 'Label');\n\n if ($field->DropdownOtherOption == true) {\n $entries->push('other', 'Other');\n }\n\n $formFields->push(\n $newField = DropdownField::create(\n $fieldName,\n $fieldLabel,\n $entries\n )->setEmptyString('Select')\n );\n\n if ($field->DropdownOtherOption == true) {\n $formFields->push(\n TextField::create(\n \"${fieldName}_other\",\n \"Please specify the 'other'\"\n )->hideUnless($fieldName)->isEqualTo(\"other\")->end()\n );\n\n //++ @TODO\n // Ideally if the dropdown is required then if other is selected the other field\n // should also be required. Unfortunatley the conditional validation logic of ZEN\n // does not work in the front end - so need to figure out how to do this.\n }\n }\n\n // If a new field was created then set some things on it which are common no matter the type.\n if ($newField) {\n // Set help text for the field if defined.\n if (!empty($field->HelpText)) {\n $newField->setRightTitle($field->HelpText);\n }\n\n // Field must only be made readonly if the admin specified that they should be\n // provided that a value was specified in the URL for it.\n if ($field->Readonly && $fieldValue) {\n $newField->setReadonly(true);\n }\n\n // Set the value of the field one was plucked from the URL params.\n if ($fieldValue) {\n $newField->setValue($fieldValue);\n }\n }\n }\n\n // Add fields to the bottom of the form for the user to include a message in the email sent to curators\n // this is entirely optional and will not be used in most cases so is hidden until a checkbox is ticked.\n $formFields->push(\n CheckboxField::create('AdditionalMessage', 'Include a message from me to the curators')\n );\n\n // For the email address, because its project managers filling out the form, check if the Project_Manager_email\n // has been specified in the URL params and if so pre-populate the field with that value.\n $formFields->push(\n $emailField = EmailField::create('AdditionalMessageEmail', 'My email address')\n ->setRightTitle('Please enter your email address so the curator knows who the message below is from.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n if (isset($params['project_manager_email'])) {\n $emailField->setValue($params['project_manager_email']);\n }\n\n $formFields->push(\n TextareaField::create('AdditionalMessageText', 'My message')\n ->setRightTitle('You can enter a message here which is appended to the email sent the curator after the record has successfully been pushed to the catalogue.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n // If there are any hidden fields then loop though and add them as hidden fields to the bottom of the form.\n if ($hiddenFields) {\n foreach($hiddenFields as $key => $val) {\n $formFields->push(\n HiddenField::create($key, '', $val)\n );\n }\n }\n\n // We have at least one field so set the action for the form to submit the entry to the catalogue.\n $actions = FieldList::create(FormAction::create('sendMetadataForm', 'Send'));\n } else {\n $formFields->push(\n ErrorMessage::create('No metadata entry fields have been specified for this page.')\n );\n }\n\n // Set up the required fields validation.\n $validator = ZenValidator::create();\n $validator->addRequiredFields($requiredFields);\n\n // Create form.\n $form = Form::create($this, 'MetadataEntryForm', $formFields, $actions, $validator);\n\n // Check if the data for the form has been saved in the session, if so then populate\n // the form with this data, if not then just return the default form.\n $data = Session::get(\"FormData.{$form->getName()}.data\");\n\n return $data ? $form->loadDataFrom($data) : $form;\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function getMeta()\n {\n return $this->getValue('meta');\n }", "public function metadata()\n\t{\n\t\treturn array(\"id\" => array(), \"dia\" => array(), \"hora\" => array(), \"empleado\" => array()); \n\t}", "public function form(){\n\t\treturn $this->form;\n\t}", "public function meta()\n {\n return $this->meta;\n }", "protected function getCreateFormFields()\n {\n return $this->formFields();\n }", "public function getFormValues() {\n return $this->values[HVAL_FORMPARAM];\n }", "public function getFormFields()\n {\n return $this->form->getFields();\n }", "public function getForm() {\n return $this->form;\n }", "private function getMeta() {\n $metadata = array(\n 'title' => 'User', \n 'desc' => 'Request URL: ' . Config::get('app.api_url'), \n 'meta' => array( \n 'title' => 'User | Seeties', \n 'description' => 'Sample meta description' \n ),\n 'sidebar' => View::make('user.sidebar')\n );\n\n return $metadata;\n }", "public function getGenericMetadata()\n {\n return $this->generic_metadata;\n }", "function getForm() {\n return $this->form;\n }", "private function getMetaData ()\n\t\t{\n\t\t\t$data = file_get_contents (\"META.inf\");\n\t\t\t$o = json_decode ($data,true);\n\t\t\treturn $o;\t\n\t\t}", "public static function metadata()\n {\n return Metadata::get(get_called_class());\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getMeta()\n {\n return $this->meta;\n }", "public function getFileMetadata()\n {\n return $this->get('FileMetadata');\n }", "public function getForm()\n {\n RETURN $this->strategy->getForm();\n }", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "public function getMeta()\n {\n return $this->Meta;\n }", "public function getForm()\n {\n return $this->form;\n }", "public function getForm()\n {\n return $this->form;\n }", "abstract protected function getFormIntroductionFields();", "public function getMeta() {\n return $this->meta;\n }", "public function getForm(): array\n {\n return $this->form;\n }", "public function getFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n $value = $element['object']->getSubmittedValue();\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "public function meta()\n {\n return array_merge(parent::meta(), [\n 'fields' => 'adasd'\n ]);\n }", "public function getInfo() {\n $class = get_class($this);\n return [\n '#input' => TRUE,\n '#id_label_id' => 0,\n '#process' => [\n [$class, 'processIdLabel'],\n ],\n '#element_validate' => [\n [$class, 'validateIdLabel'],\n ],\n '#theme_wrappers' => ['fieldset'],\n '#multiple' => FALSE,\n '#cardinality' => self::CARDINALITY_UNLIMITED,\n ];\n }", "protected function getMeta()\n {\n return array('displayname' => $this->__('TinyMCE'),\n 'description' => $this->__('TinyMCE editor.'),\n 'version' => '3.5.8',\n 'url' => 'http://www.tinymce.com/',\n 'license' => 'LGPL-2.1',\n );\n }", "public function getMeta() {\n return $this->meta;\n }", "function GetMetaInfo(){\r\n\r\n\treturn !empty($_POST['app_meta'])? json_decode($_POST['app_meta'],true):array();\r\n}", "protected function forms()\r\n {\r\n $metaFileInfo = $this->getFormObj()->GetMetaFileInfo();\r\n $modulePath = $metaFileInfo['modules_path'];\r\n $modulePath = substr($modulePath,0,strlen($modulePath)-1);\r\n global $g_MetaFiles;\r\n php_grep(\"<EasyForm\", $modulePath);\r\n \r\n for ($i=0; $i<count($g_MetaFiles); $i++)\r\n {\r\n $g_MetaFiles[$i] = str_replace('/','.',str_replace(array($modulePath.'/','.xml'),'', $g_MetaFiles[$i]));\r\n $list[$i]['val'] = $g_MetaFiles[$i];\r\n $list[$i]['txt'] = $g_MetaFiles[$i];\r\n }\r\n\r\n return $list; \r\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "public function &getForm() {\n return $this->form;\n }", "public function getFormData()\n {\n return $this->form->getData();\n }", "public function getMetaData(): array {\n\t\treturn $this->content['metadata'] ?? [];\n\t}", "protected function getInputMetaData(MortarFormInput $input)\n\t{\n\t\t$inputOptions = array();\n\t\t$validationRules = $input->getRules();\n\t\t$validationClientSideRules = array();\n\t\tif(!is_null($validationRules) && count($validationRules) > 0)\n\t\t{\n\t\t\t$validationClientSideRules = array();\n\t\t\tforeach($validationRules as $ruleName => $ruleArgument)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif(!($className = MortarFormValidationLookup::getClass($ruleName)))\n\t\t\t\t\t\tthrow new FormWarning('Unable to load validation class for rule ' . $ruleName);\n\n\t\t\t\t\t$argument = $className::getHtmlArgument($input, $ruleArgument);\n\t\t\t\t\t$validationClientSideRules[$ruleName] = $argument;\n\n\t\t\t\t}catch(Exception $e){\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(count($validationClientSideRules) > 0)\n\t\t\t\t$inputOptions['validation'] = $validationClientSideRules;\n\t\t}\n\n\t\tif($input->property('html'))\n\t\t\t$inputOptions['html'] = true;\n\n\t\tif(isset($input->mask))\n\t\t\t$inputOptions['mask'] = $input->mask;\n\n\t\tif(isset($input->properties['autocomplete']) && $input->properties['autocomplete'])\n\t\t{\n\t\t\t$inputOptions['autocomplete']['data'] = $input->properties['autocomplete'];\n\t\t\tif(isset($input->properties['multiple']))\n\t\t\t{\n\t\t\t\t$inputOptions['autocomplete']['options']['multiple'] = true;\n\t\t\t}\n\t\t\tunset($input->properties['autocomplete']);\n\t\t}\n\n\t\t$plugins = new Hook();\n\t\t$plugins->enforceInterface('FormMetadataHook');\n\t\t$plugins->loadPlugins('Forms', 'Metadata', 'Base');\n\t\t$plugins->loadPlugins('Forms', 'Metadata', $input->type);\n\t\t$pluginInput = $plugins->getMetadataOptions($input);\n\n\t\tforeach($pluginInput as $inputItem)\n\t\t\t$inputOptions = array_merge($inputOptions, $inputItem);\n\n\t\treturn (count($inputOptions > 0)) ? $inputOptions : false;\n\t}", "public function getRichFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n\n $value = array (\n \t'value' => $element['object']->getSubmittedValue(),\n \t'description' => $element['object']->getDescription()\n );\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "protected function _readFormFields() {}", "function fields() {\n return array(\n 'title' => 'The title of the content',\n 'fieldname' => t('fieldname'),\n 'title' => t('title'),\n 'label' => t('Label'),\n 'data_type' => t('data type'),\n 'html_type' => t('html_type'),\n );\n }", "public function getMetas()\n {\n return $this->metas;\n }", "public function getForm()\n {\n return $this->_form;\n }", "public function formData()\n {\n return array(\n 'id' => $this->_id,\n 'name' => $this->_name,\n 'content' => $this->_content,\n 'categoryId' => $this->_category_id,\n 'userId' => $this->_user_id\n );\n }", "public function formInfo()\n {\n $value = Recipe::find(1);\n\n return view('form-recipe_page',\n [\n 'value' => $value\n ]);\n }", "public function form() {\n\t\treturn array();\n\t}", "abstract function getForm();", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer name'),\n 'name' => 'MF_TITLE',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer description'),\n 'name' => 'MF_DESCRIPTION',\n 'label' => $this->l('Provide a description for the heading'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Number of manufacturers to display (Enter 0 to display all)'),\n 'name' => 'MF_MAN_NUMBER',\n 'label' => $this->l('Number of Manufacturers'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on desktops'),\n 'name' => 'MF_PER_ROW_DESKTOP',\n 'label' => $this->l('Logo\\'s per row (Desktop)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on tablets'),\n 'name' => 'MF_PER_ROW_TABLET',\n 'label' => $this->l('Logo\\'s per row (Tablet)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on mobiles'),\n 'name' => 'MF_PER_ROW_MOBILE',\n 'label' => $this->l('Logo\\'s per row (Mobile)'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'desc' => 'How the logo\\'s should be sorted',\n 'name' => 'MF_MAN_ORDER',\n 'label' => $this->l('Order by'),\n 'options' => array(\n 'query' => array(\n array(\n 'id_option' => 'name_asc',\n 'name' => $this->l('Name ASC'),\n ),\n array(\n 'id_option' => 'name_desc',\n 'name' => $this->l('Name DESC'),\n ),\n array(\n 'id_option' => 'manu_asc',\n 'name' => $this->l('Manufacturer ID ASC'),\n ),\n array(\n 'id_option' => 'manu_desc',\n 'name' => $this->l('Manufacturer ID DESC'),\n ),\n ),\n 'id' => 'id_option',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'name' => 'MF_SHOW_MAN_NAME',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes'),\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No'),\n )\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function getFormParams() {\n\t\treturn $this->_formParams;\n\t}", "public function model()\n {\n return FormInfo::class;\n }", "public function getFormCustomFields(){\n\t}" ]
[ "0.7069291", "0.6970771", "0.6890191", "0.6722233", "0.6678683", "0.6641073", "0.6616351", "0.66120785", "0.6585969", "0.6539794", "0.653801", "0.65291524", "0.6526674", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.6525057", "0.65049636", "0.65012014", "0.649713", "0.64892817", "0.64892817", "0.64892817", "0.6470759", "0.64666706", "0.6464076", "0.6464076", "0.6447667", "0.64307714", "0.64307714", "0.64146876", "0.6396654", "0.63954884", "0.6381739", "0.63743263", "0.63632905", "0.6339569", "0.6335655", "0.63290447", "0.63260996", "0.6325171", "0.6325171", "0.6317418", "0.63110673", "0.6309669", "0.6307945", "0.6302714", "0.6300597", "0.6279092", "0.62778485", "0.6273024", "0.6266592", "0.6257825", "0.6248985", "0.6238815", "0.6238815", "0.6238815", "0.6238815", "0.6238815", "0.62343323", "0.6234082", "0.62280285", "0.6215414", "0.62134063", "0.62134063", "0.62042874", "0.6187947", "0.6187825", "0.6173366", "0.61672485", "0.61660326", "0.6156526", "0.6150419", "0.61497337", "0.61440045", "0.6135441", "0.6126317", "0.61260366", "0.6093409", "0.6092681", "0.60672235", "0.60664475", "0.60481435", "0.604608", "0.60305107", "0.60265505", "0.60238457", "0.60153115", "0.599827", "0.5993986", "0.5985485", "0.5985029", "0.59814465" ]
0.0
-1
Get the list of parameters for this form.
public static function get_parameters() { return array( array( 'name' => 'termlist_id', 'caption' => 'Term List', 'description' => 'The term list being edited.', 'type' => 'select', 'table' => 'termlist', 'captionField' => 'title', 'valueField' => 'id', 'siteSpecific'=>true, 'group' => 'Terms', 'required'=>true ), array( 'name' => 'language_id', 'caption' => 'Language', 'description' => 'The language that terms are created in.', 'type' => 'select', 'table' => 'language', 'captionField' => 'language', 'valueField' => 'id', 'siteSpecific'=>true, 'group' => 'Terms', 'required'=>true ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormParameters()\n {\n return $this->form_parameters;\n }", "public function getParameters()\n {\n return $this->parameters->all();\n }", "function getFormParams() {\n\t\treturn $this->_formParams;\n\t}", "public function get_parameters() {\r\n\t\treturn $this->parameters;\r\n\t}", "public function parameters()\n\t{\n\t\treturn [\n\t\t\t'parent_id' => $this->input('parent_id'),\n\t\t\t'title' => $this->input('title'),\n\t\t\t'icon' => $this->input('icon'),\n\t\t\t'description' => $this->input('description'),\n\t\t\t'is_active' => $this->has('is_active')\n\t\t];\n\t}", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function parameters()\n {\n return $this->parameters;\n }", "public function parameters()\n {\n return $this->parameters;\n }", "public function get_parameters()\n\t{\n\t\treturn $this->set_params;\n\t}", "public function getParameters()\n {\n return array();\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "function getParameters() {\n\t\treturn $this->inputParameters;\n\t}", "public function getParameters() {\n \n return $this->params;\n \n }", "public function getParameters() {\n return $this->parameters;\n }", "public function getParameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParametersList(){\n return $this->_get(2);\n }", "public function getParameters()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function GetParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters() {\n\t\treturn $this->parameters;\n\t}", "public function all()\r\n {\r\n return $this->parameters;\r\n }", "public function parameters(): array\n {\n return $this->getAttribute('parameters');\n }", "function getParameters() {\n return $this->parameters;\n }", "public function all()\n {\n return $this->params;\n }", "public function getParameters() : array\n {\n return $this->parameters;\n }", "public function params() : DeepList {\n return $this->_params;\n }", "public function params()\n {\n if (empty($this->params)) {\n return null;\n }\n\n $params = isset($this->params) ? $this->params : array();\n\n $many = $this->hasMany('params');\n\n return array(\n 'title' => $many ? 'Options' : 'Option',\n 'txt' => $many\n ? 'The following request parameters are available:'\n : 'The following request parameter is available:',\n 'items' => array_values($params)\n );\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParams()\n {\n return $this->getAttribute('params', false, null);\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function parameters()\n {\n return array_merge($this->get, $this->post);\n }", "public function getParams() {\n return $this->params;\n }", "public static function get_parameters() {\n return array(array(\n 'name' => 'groups_page_path',\n 'caption' => 'Path to main groups page',\n 'description' => 'Path to the Drupal page which my groups are listed on.',\n 'type' => 'text_input'\n ), array(\n 'name' => 'group_home_path',\n 'caption' => 'Path to the group home page',\n 'description' => 'Path to the Drupal page which hosts group home pages.',\n 'type' => 'text_input',\n 'required'=>false\n ));\n }", "public function getParameters(/* ... */)\n {\n return $this->_params;\n }", "public function params()\n {\n return $this->params;\n }", "public static function get_parameters() {\n return array(array(\n 'name' => 'groups_page_path',\n 'caption' => 'Path to main groups page',\n 'description' => 'Path to the Drupal page which my groups are listed on.',\n 'type' => 'text_input'\n ), array(\n 'name' => 'group_home_path',\n 'caption' => 'Path to the group home page',\n 'description' => 'Path to the Drupal page which hosts group home pages.',\n 'type' => 'text_input'\n ));\n }", "public function getParams() {\n \n return $this->_params;\n }", "public function getParameters(): array {\n\t\t\treturn $this->parameters;\n\t\t}", "public function get_params() {\n\t\treturn $this->params;\n\t}", "public static function parameters()\n {\n $fields = array('name', 'amount');\n return array_intersect_key(self::fields(), array_flip($fields));\n }", "public function getParams()\r\n\t{\r\n\t\treturn $this->params;\r\n\t}", "public function parameters()\n {\n return [\n 'dir' => $this->input('dir'),\n 'hash' => $this->input('hash', ''),\n 'data' => $this->input('data'),\n 'name' => $this->input('name'),\n 'type' => $this->input('type'),\n 'offset' => $this->input('offset'),\n 'eof' => $this->input('eof'),\n ];\n }", "function get_parameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParams()\n\t{\n\t\treturn $this->params;\n\t}", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParameters()\n {\n // TODO: Implement getParameters() method.\n }", "public function getParams() {\n return $this->_params;\n }", "public function getParams() {\n\t\treturn $this->params;\n\t}", "public function params()\n {\n return $this->_params;\n }", "public function getParameters()\n {\n return get_object_vars($this->record);\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 }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\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();", "public function getParams() {\n\n\t\treturn $this->_params;\n\t}", "public function getParams() {\n\t\treturn $this -> v_params;\n\t}" ]
[ "0.83327293", "0.7673348", "0.7606245", "0.74927783", "0.74764305", "0.74746084", "0.74746084", "0.74746084", "0.74746084", "0.74587613", "0.74587613", "0.7454035", "0.74270177", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.7424826", "0.74190485", "0.74065864", "0.7400599", "0.7380418", "0.73673797", "0.73620605", "0.7344714", "0.73370904", "0.73370904", "0.7322551", "0.72675997", "0.72658515", "0.72496194", "0.72356", "0.7234166", "0.72079825", "0.7204918", "0.71987224", "0.71987224", "0.71987224", "0.71987224", "0.7187377", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.71816355", "0.7175386", "0.71659005", "0.7164047", "0.71633047", "0.7156758", "0.7154604", "0.7154072", "0.71368784", "0.7134007", "0.7131284", "0.71287924", "0.7109835", "0.7099531", "0.7096913", "0.7096496", "0.7096496", "0.7096496", "0.7096496", "0.7092919", "0.70918566", "0.70773697", "0.7073514", "0.7073472", "0.7068684", "0.70681244", "0.70678", "0.70678", "0.7051882", "0.7051882", "0.7051882", "0.7051882", "0.7051882", "0.7051882", "0.7051882", "0.7051882", "0.7046302", "0.7038388" ]
0.78400004
1
Return the generated form output.
public static function get_form($args, $nid, $response=null) { $reloadPath = self::get_reload_path(); $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']); $r = "<form method=\"post\" id=\"entry_form\" action=\"$reloadPath\">\n"; $r .= $auth['write']; data_entry_helper::$entity_to_load = []; if (!empty($_GET['termlists_term_id'])) { data_entry_helper::load_existing_record($auth['read'], 'termlists_term', $_GET['termlists_term_id']); // map fields to their appropriate supermodels data_entry_helper::$entity_to_load['term:term'] = data_entry_helper::$entity_to_load['termlists_term:term']; data_entry_helper::$entity_to_load['term:id'] = data_entry_helper::$entity_to_load['termlists_term:term_id']; data_entry_helper::$entity_to_load['meaning:id'] = data_entry_helper::$entity_to_load['termlists_term:meaning_id']; if (function_exists('hostsite_set_page_title')) hostsite_set_page_title(lang::get('Edit {1}', data_entry_helper::$entity_to_load['term:term'])); } $r .= data_entry_helper::hidden_text(array( 'fieldname' => 'website_id', 'default' => $args['website_id'] )); $r .= data_entry_helper::hidden_text(array( 'fieldname' => 'termlists_term:id' )); $r .= data_entry_helper::hidden_text(array( 'fieldname' => 'termlists_term:termlist_id', 'default' => $args['termlist_id'] )); $r .= data_entry_helper::hidden_text(array( 'fieldname' => 'termlists_term:preferred', 'default' => 't' )); $r .= data_entry_helper::hidden_text(array( 'fieldname' => 'term:id' )); $r .= data_entry_helper::hidden_text(array( 'fieldname' => 'term:language_id', 'default' => $args['language_id'] )); $r .= data_entry_helper::hidden_text(array( 'fieldname' => 'meaning:id' )); // request automatic JS validation data_entry_helper::enable_validation('entry_form'); $r .= data_entry_helper::text_input(array( 'label' => lang::get('Term'), 'fieldname' => 'term:term', 'helpText' => lang::get('Please provide the term'), 'validation' => array('required'), 'class' => 'control-width-5' )); $r .= "<input type=\"submit\" name=\"form-submit\" id=\"delete\" value=\"Delete\" />\n"; $r .= "<input type=\"submit\" name=\"form-submit\" value=\"Save\" />\n"; $r .= '<form>'; self::set_breadcrumb($args); return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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\treturn $this->getFormItBuilderOutput();\n\t}", "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 }", "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 }", "function renderWholeForm() {\n\t\t$output = $this->renderCurrentStep();\n\t\t$output .= $this->renderSubmitButtons();\n\n\t\treturn $this->wrapWithForm ($output);\n\t}", "function toString()\n\t{\n\t\t// Start main form attributes\n\t\t$formAttributes = array();\n\t\t$formAttributes['method'] = 'POST';\t\n\t\t\n\t\t// Use custom action attribute?\n\t\tif ($this->actionURL) {\n\t\t\t$formAttributes['action'] = $this->actionURL;\n\t\t} else {\n\t\t\t// Current page\n\t\t\t$formAttributes['action'] = str_replace( '%7E', '~', $_SERVER['REQUEST_URI']);\n\t\t}\n\t\t\n\t\t// Add the form name if specified\n\t\t$namestring = \"\";\n\t\tif ($this->formName) {\n\t\t\t$formAttributes['name'] = $this->formName;\t\n\t\t\t$formAttributes['id'] = $this->formName;\n\t\t}\n\t\t\n\t\t// Need extra attribute if there's a upload field\n\t\tif ($this->haveFileUploadField()) {\n\t\t\t$formAttributes['enctype'] = 'multipart/form-data';\n\t\t}\n\t\t\n\t\t// Render form with all attributes\n\t\t$attributeString = false;\n\t\tforeach($formAttributes as $name => $value) {\n\t\t\t$attributeString .= sprintf('%s=\"%s\" ', $name, $value);\n\t\t}\n\t\t\n\t\t// Start form\n\t\t$resultString = \"\\n<form $attributeString>\\n\";\n\t\t\n\t\t// Is first item a break? If so, render it.\n\t\tif (isset($this->breakList[FORM_BUILDER_START_OF_FORM])) {\n\t\t\t$resultString .= $this->createTableHeader(array('id' => $this->breakList[FORM_BUILDER_START_OF_FORM]['sectionid']), $this->breakList[FORM_BUILDER_START_OF_FORM]['prefixHTML']);\n\t\t} else {\n\t\t\t$resultString .= $this->createTableHeader();\n\t\t}\t\t\n\t\t\n\t\t// Now add all form elements\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\t// Hidden elements are added later\n\t\t\tif ($element->type == 'hidden') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// Render form element\t\t\t\t\n\t\t\t$resultString .= $element->toString($this->showRequiredLabels);\n\n\t\t\t// Add section breaks if this element is in the break list.\n\t\t\t// Add break after element HTML\n\t\t\tif (in_array($element->name, array_keys($this->breakList)))\n\t\t\t{\n\t\t\t\t$resultString .= $this->createTableFooter();\n\t\t\t\t$resultString .= $this->createTableHeader(array('id' => $this->breakList[$element->name]['sectionid']), $this->breakList[$element->name]['prefixHTML']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$resultString .= $this->createTableFooter();\n\t\t\n\t\t// Button area\n\t\t$resultString .= '<p class=\"submit\">'.\"\\n\";\n\t\t\n\t\t// Add submit button\n\t\t$resultString .= \"\\t\".'<input class=\"button-primary\" type=\"submit\" name=\"Submit\" value=\"'.$this->submitlabel.'\" />'.\"\\n\";\n\t\t\n\t\t// Add remaining buttons\n\t\tforeach ($this->buttonList as $buttonName => $buttonLabel) {\n\t\t\t$resultString .= \"\\t<input type=\\\"submit\\\" class=\\\"button-secondary\\\" name=\\\"$buttonName\\\" value=\\\"$buttonLabel\\\" />\\n\";\t\t\n\t\t}\n\t\t\t\t\n\t\t// Hidden field to indicate update is happening\n\t\t$resultString .= sprintf(\"\\t\".'<input type=\"hidden\" name=\"update\" value=\"%s\" />'.\"\\n\", $this->formName);\n\t\t\t\t\n\t\t// Add any extra hidden elements\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\t// Leave all hidden elements until the end.\n\t\t\tif ($element->type == 'hidden') {\t\n\t\t\t\t$resultString .= \"\\t\".'<input type=\"hidden\" name=\"'.$element->name.'\" value=\"'.$element->value.'\" />'.\"\\n\";\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t$resultString .= '</p>'.\"\\n\";\n\t\t\t\t\t\t\t\n\t\t// End form\n\t\t$resultString .= \"\\n</form>\\n\";\n\t\t\n\t\treturn $resultString;\n\t}", "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 cs_generate_form() {\n global $post;\n }", "public function outputRaw(){\n\t\techo $this->getFormItBuilderOutput();\n\t\texit();\n\t}", "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 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}", "public function printForm() {\n\t\t$html = '';\n\t\t$values = $this->value();\n\n\t\tforeach ($this->options as $value => $label) {\n\t\t\t$id = $this->name().'_'.$value;\n\t\t\t$html .= '<div><input type=\"checkbox\" id=\"'.$id.'\" name=\"'.$id.'\" value=\"'.$value.'\" '.((isset($this->selected[$id]) && $this->selected[$id])?' checked':'').'/><label for=\"'.$id.'\">'.$label.'</label></div>'.\"\\n\";\n\t\t}\n\n\t\tforeach ($this->others as $name => $label) {\n\t\t\t$value = $values[$name];\n\n\n\t\t\t$id = $this->name().'_'.$name;\n\t\t\t$label = '<label for=\"'.$id.'\">'.$label.'</label> <input onclick=\"document.getElementById(\\''.$id.'\\').checked=\\'checked\\';\" name=\"'.$id.'[]\" value=\"'.htmlentities($value).'\" />';\n\t\t\t$input = '<input type=\"checkbox\" id=\"'.$id.'\" '.(($value)?(' checked=\"checked\" '):('')).'name=\"'.$id.'[]\" value=\"'.htmlentities($value).'\" />';\n\t\t\t$html .= '<div class=\"checkbox\">'.($this->label_left?($label.$input):($input.$label)).'</div>';\n\t\t}\n\t\treturn $html;\n\t}", "public function render()\n {\n return $this->getFormCreator()->render();\n }", "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 }", "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 }", "public function outputSetupForm() {\n\t\t$this->_directFormHtml( 'webinarjamstudio' );\n\t}", "public function getForm(): string\n {\n return $this->html;\n }", "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 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 static function form(){\n\t\treturn \"\";\n\t}", "public function renderForm()\n {\n $formUnit = $this->interActor->formUnit($this->inputHandler->getArrayMap());\n\n $view = new \\View\\Model(\n \\View\\Customer::form($formUnit),\n $this->inputHandler->routeArrayMap()\n );\n return $view->render();\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 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}", "public function forms()\n\t{\n\t\techo view('sketchpad::help/output/form', ['form' => Sketchpad::$form]);\n\t}", "public function generateFormClose() {\n\t\t$form = '';\n\t\t// add hidden fields\n\t\t$hidden_fields = $this->getHiddenFields();\n\t\tforeach ( $hidden_fields as $field => $value ) {\n\t\t\t$form .= Html::hidden( $field, $value );\n\t\t}\n\n\t\t$form .= Xml::closeElement( 'form' ); // close form 'payment'\n\t\t$form .= $this->generateDonationFooter();\n\t\t$form .= Xml::closeElement( 'td' );\n\t\t$form .= Xml::closeElement( 'tr' );\n\t\t$form .= Xml::closeElement( 'table' );\n\t\treturn $form;\n\t}", "public function render(): String\n {\n\n $this->view = \"<form action='$this->action' method='$this->method' name='$this->name' id='$this->id'\";\n\n // Add all other attributes like class, id, required etc.\n foreach ($this->attr as $key => $value) {\n $this->view .= \" $key=$value \";\n }\n $this->view .= \"/>\";\n\n // Add field's HTML code\n $fieldsView = $this->renderFields();\n $this->view .= \" <br> $fieldsView\";\n\n // Add submit button HTML code\n $submitButtonView = $this->buildSubmitButton();\n $this->view .= \" <br> $submitButtonView\";\n\n // Close the form tag\n $this->view .= \" <br> </form>\";\n\n return $this->view;\n }", "protected function output() {\n\t\t\techo $this->before();\n\t\t\techo wponion_input_group_html( $this->data( 'prefix' ), $this->data( 'surfix' ), $this->element_html() );\n\t\t\techo $this->datalist();\n\t\t\techo $this->after();\n\t\t}", "function printForm() {\n $this->printDebugMessage('printForm', 'Begin', 1);\n $stypeStr = $this->paramDetailToStr('stype');\n $programStr = $this->paramDetailToStr('program');\n $databaseStr = $this->paramDetailToStr('database', TRUE);\n $scoresStr = $this->paramDetailToStr('scores');\n $alignmentsStr = $this->paramDetailToStr('alignments');\n $expStr = $this->paramDetailToStr('exp');\n \n print <<<EOF\n<form method=\"POST\">\n<p>E-mail: <input type=\"text\" name=\"email\" />&nbsp;\nJob title: <input type=\"text\" name=\"title\" /></p>\n\n<p>$stypeStr<br />\n<a href=\"?paramDetail=sequence\">Sequence</a>:<br />\n<textarea name=\"sequence\" rows=\"5\" cols=\"80\">\n</textarea></p>\n\n<p>$programStr $databaseStr</p>\n\n<p>$scoresStr $alignmentsStr $expStr</p>\n\n<p align=\"right\">\n<input type=\"submit\" value=\"Submit\" />\n<input type=\"reset\" value=\"Reset\" />\n</p>\n</form>\nEOF\n ;\n $this->printDebugMessage('printForm', 'End', 1);\n }", "public function renderForm() {\n $enctype = $this->_enctype ? \"enctype=\\\"multipart/form-data\\\"\" : \"\";\n $formAttributes = $this->_renderAttributes($this->_formAttributes);\n $html = \"<form action=\\\"{$this->getAction()}\\\" method=\\\"{$this->_method}\\\" {$enctype} $formAttributes>\";\n $currentFieldset = NULL;\n\n if (count($this->_inputElements)) {\n foreach ($this->_inputElements as $element) {\n if ($element[1] !== NULL) {\n if ($element[1] !== $currentFieldset) {\n if ($currentFieldset !== NULL)\n $html .= \"</fieldset>\";\n $fieldset = $this->_fieldsets[$element[1]];\n $fieldsetAttributes = $this->_renderAttributes($fieldset[1]);\n $html .= \"<fieldset {$fieldsetAttributes}><legend>{$fieldset[0]}</legend>\";\n $currentFieldset = $element[1];\n }\n } else {\n if ($currentFieldset !== NULL)\n $html .= \"</fieldset>\";\n }\n $html .= $this->renderElement($element[0]->getName());\n $currentFieldset = $element[1];\n }\n }\n if (count($this->_hiddenElements)) {\n foreach ($this->_hiddenElements as $element) {\n $html .= $this->renderElement($element->getName());\n }\n }\n $html .= \"</form>\";\n return $html;\n }", "public function getContent()\n {\n $this->_html = '';\n \n /**\n * If values have been submitted in the form, validate and process.\n */\n if (((bool)Tools::isSubmit('submitOrderrefModule')) == true) {\n $errors = $this->postValidation();\n if (!count($errors)) {\n $this->postProcess();\n } else {\n $this->_html .= $this->displayError($errors);\n }\n }\n \n $this->_html .= $this->renderForm();\n\n return $this->_html;\n }", "public function outputSetupForm()\n {\n $this->_directFormHtml('iContact');\n }", "protected abstract function printFormElements();", "public function buildForm() {\n\t\t$form = '';\n\n\t\tforeach ($this->_properties as $row) {\n\t\t\tif (!in_array($row['Field'],$this->_ignore)) {\n\t\t\t\t$elem = $this->buildElement($row);\n\t\t\t\t$row['Comment'] != '' ? $comment = $row['Comment'].\"<br />\": $comment = '';\n\t\t\t\t$this->_properties[$row['Field']]['HTMLElement']=$elem;\n\t\t\t\tif ($row['ElementType']=='hidden')\n\t\t\t\t\t$form .= $elem;\n\t\t\t\telse \n\t\t\t\t\t$form .= sprintf(\"<div class='formElem'>\\n%s<br />\\n%s\\n%s</div>\\n\",ucwords (str_replace (\"_\",\" \",$row['Field'])),$comment,$elem);\n\t\t\t}\n\t\t}\n\t\treturn $form;\n\t}", "public function __toString()\n {\n $this->appendChild((new Hidden('_method', $this->method))->render());\n\n if (function_exists('csrf_token')) {\n $this->appendChild((new Hidden('_token', csrf_token()))->render());\n }\n\n return str_replace('</form>', '', $this->render());\n }", "function getFormHTML()\n\t{\n\t\tstatic $id_num = 1000;\n\n\t\t$type = $this->type;\n\t\t$name = $this->name;\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\t\t$default = $this->_getTypeValue($this->type, $this->default);\n\t\t$column_name = 'extra_vars' . $this->idx;\n\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t$buff = array();\n\t\tswitch($type)\n\t\t{\n\t\t\t// Homepage\n\t\t\tcase 'homepage' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"homepage\" />';\n\t\t\t\tbreak;\n\t\t\t// Email Address\n\t\t\tcase 'email_address' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"email_address\" />';\n\t\t\t\tbreak;\n\t\t\t// Phone Number\n\t\t\tcase 'tel' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[0] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[1] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[2] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\tbreak;\n\t\t\t// textarea\n\t\t\tcase 'textarea' :\n\t\t\t\t$buff[] = '<textarea name=\"' . $column_name . '\" rows=\"8\" cols=\"42\">' . $value . '</textarea>';\n\t\t\t\tbreak;\n\t\t\t// multiple choice\n\t\t\tcase 'checkbox' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] =' <li><input type=\"checkbox\" name=\"' . $column_name . '[]\" id=\"' . $tmp_id . '\" value=\"' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '\" ' . $checked . ' /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// single choice\n\t\t\tcase 'select' :\n\t\t\t\t$buff[] = '<select name=\"' . $column_name . '\" class=\"select\">';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$selected = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t\t$buff[] = ' <option value=\"' . $v . '\" ' . $selected . '>' . $v . '</option>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</select>';\n\t\t\t\tbreak;\n\t\t\t// radio\n\t\t\tcase 'radio' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] = '<li><input type=\"radio\" name=\"' . $column_name . '\" id=\"' . $tmp_id . '\" ' . $checked . ' value=\"' . $v . '\" class=\"radio\" /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// date\n\t\t\tcase 'date' :\n\t\t\t\t// datepicker javascript plugin load\n\t\t\t\tContext::loadJavascriptPlugin('ui.datepicker');\n\n\t\t\t\t$buff[] = '<input type=\"hidden\" name=\"' . $column_name . '\" value=\"' . $value . '\" />'; \n\t\t\t\t$buff[] =\t'<input type=\"text\" id=\"date_' . $column_name . '\" value=\"' . zdate($value, 'Y-m-d') . '\" class=\"date\" />';\n\t\t\t\t$buff[] =\t'<input type=\"button\" value=\"' . Context::getLang('cmd_delete') . '\" class=\"btn\" id=\"dateRemover_' . $column_name . '\" />';\n\t\t\t\t$buff[] =\t'<script type=\"text/javascript\">';\n\t\t\t\t$buff[] = '//<![CDATA[';\n\t\t\t\t$buff[] =\t'(function($){';\n\t\t\t\t$buff[] =\t'$(function(){';\n\t\t\t\t$buff[] =\t' var option = { dateFormat: \"yy-mm-dd\", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\\'-100:+10\\', onSelect:function(){';\n\t\t\t\t$buff[] =\t' $(this).prev(\\'input[type=\"hidden\"]\\').val(this.value.replace(/-/g,\"\"))}';\n\t\t\t\t$buff[] =\t' };';\n\t\t\t\t$buff[] =\t' $.extend(option,$.datepicker.regional[\\'' . Context::getLangType() . '\\']);';\n\t\t\t\t$buff[] =\t' $(\"#date_' . $column_name . '\").datepicker(option);';\n\t\t\t\t$buff[] =\t' $(\"#dateRemover_' . $column_name . '\").click(function(){';\n\t\t\t\t$buff[] =\t' $(this).siblings(\"input\").val(\"\");';\n\t\t\t\t$buff[] =\t' return false;';\n\t\t\t\t$buff[] =\t' })';\n\t\t\t\t$buff[] =\t'});';\n\t\t\t\t$buff[] =\t'})(jQuery);';\n\t\t\t\t$buff[] = '//]]>';\n\t\t\t\t$buff[] = '</script>';\n\t\t\t\tbreak;\n\t\t\t// address\n\t\t\tcase \"kr_zip\" :\n\t\t\t\tif(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' ))\n\t\t\t\t{\n\t\t\t\t\t$buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// General text\n\t\t\tdefault :\n\t\t\t\t$buff[] =' <input type=\"text\" name=\"' . $column_name . '\" value=\"' . ($value ? $value : $default) . '\" class=\"text\" />';\n\t\t}\n\t\tif($this->desc)\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->replaceDefinedLangCode($this->desc);\n\t\t\t$buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';\n\t\t}\n\t\t\n\t\treturn join(PHP_EOL, $buff);\n\t}", "public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }", "public function __toString()\n {\n $form = '<form action=\"https://'.$this->_country\n .'.dineromail.com/Shop/Shop_Ingreso.asp\" method=\"post\">';\n\n foreach ($this->_data as $name => $value) {\n $form .= '<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value\n .'\" />';\n }\n $form .= '<input type=\"image\" src=\"'.$this->_image\n .'\" name=\"submit\" alt=\"'.$this->_alt.'\"></form>';\n\n return $form;\n }", "function getForm()\r\n\t{\r\n\t\t$this->action();\r\n\t\t$mainForm\t= $this->getMainForm();\r\n\t\tif($this->isFormRequire)\r\n\t\t{\r\n\t\t\t$cls = ' class=\"formIsRequire\"';\r\n\t\t\tlink_js(_PEA_URL.'includes/formIsRequire.js', false);\r\n\t\t}else{\r\n\t\t\t$cls = '';\r\n\t\t}\r\n\r\n\t\t$i = 0;\r\n\t\t$out = '';\r\n\r\n\t\t$out .= '<form method=\"'.$this->methodForm.'\" action=\"'.$this->actionUrl.'\" name=\"'. $this->formName .'\"'.$cls.' enctype=\"multipart/form-data\" role=\"form\">';\r\n\t\t$out .= $this->getSaveSuccessPage();\r\n\t\t$out .= $this->getDeleteSuccessPage();\r\n\r\n\t\t$hover= $this->isChangeBc ? ' table-hover' : '';\r\n\t\t$out .= '<table class=\"table table-striped table-bordered'.$hover.'\">';\r\n\t\t$out .= '<thead><tr>';\r\n\r\n\t\t// ngambil tr title\r\n\t\t$numColumns = 0;\r\n\r\n\t\tforeach($this->arrInput as $input)\r\n\t\t{\r\n\t\t\tif ($input->isInsideRow && !$input->isInsideMultiInput && !$input->isHeader)\r\n\t\t\t{\r\n\t\t\t\t// buat array data untuk report\r\n\t\t\t\tif ($this->isReportOn && $input->isIncludedInReport)\r\n\t\t\t\t{\r\n\t\t\t\t\t$arrHeader[]\t= $input->title;\r\n\t\t\t\t}\r\n\t\t\t\t// dapatkan text bantuan\r\n\t\t\t\tif (!empty($input->textHelp))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->help->value[$input->name] = $input->textHelp;\r\n\t\t\t\t}\r\n\t\t\t\tif (!empty($input->textTip))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->tip->value[$input->name] = $input->textTip;\r\n\t\t\t\t}\r\n\t\t\t\t$label = '';\r\n\t\t\t\tif (@$input->isCheckAll)\r\n\t\t\t\t{\r\n\t\t\t\t\t$label = $this->getCheckAll($input);\r\n\t\t\t\t}\r\n\t\t\t\t$href = $this->getOrderUrl($input, $input->title);\r\n\t\t\t\tif (!empty($this->tip->value[$input->name]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$input->title = tip($input->title, $this->tip->value[$input->name]);\r\n\t\t\t\t}\r\n\t\t\t\t$label .= $href['start'].$input->title.$href['end'];\r\n\t\t\t\t$out .= ' <th>'.$label;\r\n\t\t\t\tif (!empty($this->help->value[$input->name]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$out .= ' <span style=\"font-weight: normal;\">'.help($this->help->value[$input->name],'bottom').'</span>';\r\n\t\t\t\t}\r\n\t\t\t\t$out\t\t.= \"</th>\\n\";\r\n\t\t\t\t$numColumns++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out .= '</tr></thead>';\r\n\t\t$this->reportData['header']\t= isset($arrHeader) ? $arrHeader : array();\r\n\t\t// ambil mainFormnya\r\n\t\t$out .= $mainForm;\r\n\r\n\t\t/* Return, Save, Reset, Navigation, Delete */\r\n\t\t$button = '';\r\n\t\tif (!empty($_GET['return']) && empty($_GET['is_ajax']))\r\n\t\t{\r\n\t\t\t$button .= $GLOBALS['sys']->button($_GET['return']);\r\n\t\t}\r\n\t\tif ($this->saveTool)\r\n\t\t{\r\n\t\t\t$button .= '<button type=\"submit\" name=\"'. $this->saveButton->name .'\" value=\"'. $this->saveButton->value\r\n\t\t\t\t\t\t.\t'\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-'.$this->saveButton->icon.'\"></span>'\r\n\t\t\t\t\t\t. $this->saveButton->label .'</button>';\r\n\t\t}\r\n\t\tif ($this->resetTool)\r\n\t\t{\r\n\t\t\t$button .= '<button type=\"reset\" class=\"btn btn-warning btn-sm\"><span class=\"glyphicon glyphicon-'.$this->resetButton->icon.'\"></span>'.$this->resetButton->label.'</button> ';\r\n\t\t}\r\n\t\t$nav = $this->nav->getNav();\r\n\t\tif (!empty($nav))\r\n\t\t{\r\n\t\t\tif (!empty($button))\r\n\t\t\t{\r\n\t\t\t\t$button = '<table style=\"width: 100%;\"><tr><td style=\"width: 10px;white-space: nowrap;\">'.$button.'</td><td style=\"text-align: center;\">'.$nav.'</td></tr></table>';\r\n\t\t\t}else{\r\n\t\t\t\t$button .= $nav;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$footerTD = array();\r\n\t\t$colspan = $numColumns;\r\n\t\tif ($this->deleteTool)\r\n\t\t{\r\n\t\t\t$colspan -= 1;\r\n\t\t}\r\n\t\t$attr = $colspan > 1 ? ' colspan=\"'.$colspan.'\"' : '';\r\n\t\t$footerTD[] = '<td'.$attr.'>'.$button.'</td>';\r\n\t\tif ($this->deleteTool)\r\n\t\t{\r\n\t\t\t$footerTD[] = '<td>'\r\n\t\t\t\t. '<button type=\"submit\" name=\"'.$this->deleteButton->name.'\" value=\"'. $this->deleteButton->value.'\" class=\"btn btn-danger btn-sm\" '\r\n\t\t\t\t. 'onclick=\"if (confirm(\\'Are you sure want to delete selected row(s) ?\\')) { return true; }else{ return false; }\">'\r\n\t\t\t\t. '<span class=\"glyphicon glyphicon-'.$this->deleteButton->icon.'\"></span>'.$this->deleteButton->label .'</button>'\r\n\t\t\t\t. '</td>';\r\n\t\t}\r\n\t\tif (!empty($footerTD))\r\n\t\t{\r\n\t\t\t$out .= '<tfoot><tr>'.implode('', $footerTD).'</tr></tfoot>';\r\n\t\t}\r\n\t\t$out .= '</table>';\r\n\t\t$out .= '</form>';\r\n\r\n\t\t/* Export Tool, Page Status, Form Navigate */\r\n\t\t$nav = $this->nav->getViewAllLink();\r\n\t\tif (!empty($nav))\r\n\t\t{\r\n\t\t\t$nav = '<span class=\"input-group-addon\">'.$nav.'</span>';\r\n\t\t}\r\n\t\t$nav .= $this->nav->getGoToForm(false);\r\n\t\t$out .= '<form method=\"get\" action=\"\" role=\"form\" style=\"margin-top:-20px;margin-bottom: 20px;\">'\r\n\t\t\t\t.\t'<div class=\"input-group\">'\r\n\t\t\t\t. $this->getReport($this->nav->int_cur_page)\r\n\t\t\t\t. '<span class=\"input-group-addon\">'\r\n\t\t\t\t. $this->nav->getStatus().'</span>'.$nav.'</div></form>';\r\n\r\n\t\t/* Form Panel */\r\n\t\t$formHeader = $this->getHeaderType();\r\n\t\tif (!empty($formHeader))\r\n\t\t{\r\n\t\t\t$out = '\r\n\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-heading\">\r\n\t\t\t\t\t\t<h3 class=\"panel-title\">'.$formHeader.'</h3>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t'.$out.'\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>';\r\n\t\t}\r\n\t\t$out = $this->getHideFormToolStart().$out.$this->getHideFormToolEnd();\r\n\t\treturn $out;\r\n\t}", "public function getContent()\n {\n $postProcessConfigResult = null;\n if (((bool)Tools::isSubmit('submitSatispayModuleConfig')) == true) {\n $postProcessConfigResult = $this->postProcessConfig();\n }\n\n $postProcessRefundResult = null;\n if (((bool)Tools::isSubmit('submitSatispayModuleRefund')) == true) {\n $postProcessRefundResult = $this->postProcessRefund();\n }\n\n return $this->renderForm($postProcessConfigResult, $postProcessRefundResult);\n }", "private function getFormItBuilderOutput(){\n\t\t$s_submitVar = 'submitVar_'.$this->_id;\n\t\t$b_customSubmitVar=false;\n\t\tif(empty($this->_submitVar)===false){\n\t\t\t$s_submitVar = $this->_submitVar;\n\t\t\t$b_customSubmitVar=true;\n\t\t}\n\t\t$s_recaptchaJS='';\n\t\t$b_posted = false;\n\t\tif(isset($_REQUEST[$s_submitVar])===true){\n\t\t\t$b_posted=true;\n\t\t}\n\t\t$nl=\"\\r\\n\";\n\n\t\t//process and add form rules\n\t\t$a_fieldProps=array();\n\t\t$a_fieldProps_jqValidate=array();\n\t\t$a_fieldProps_jqValidateGroups=array();\n\t\t$a_fieldProps_errstringFormIt=array();\n\t\t$a_fieldProps_errstringJq=array();\n\t\t\n\t\t$a_formProps=array();\n\t\t$a_formProps_custValidate=array();\n\t\t$a_formPropsFormItErrorStrings=array();\n\n\t\tforeach($this->_rules as $rule){\n\t\t\t$o_elFull = $rule->getElement();\n\t\t\tif(is_array($o_elFull)===true){\n\t\t\t\t$o_el = $o_elFull[0];\n\t\t\t}else{\n\t\t\t\t$o_el = $o_elFull;\n\t\t\t}\n\t\t\t$elId = $o_el->getId();\n\t\t\t$elName = $o_el->getName();\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_jqValidate[$elId])===false){\n\t\t\t\t$a_fieldProps_jqValidate[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringFormIt[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringFormIt[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringJq[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringJq[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_formProps_custValidate[$elId])===false){\n\t\t\t\t$a_formProps_custValidate[$elId]=array();\n\t\t\t}\n\t\t\t\n\t\t\t$s_validationMessage=$rule->getValidationMessage();\n\t\t\tswitch($rule->getType()){\n\t\t\t\tcase FormRuleType::email:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'email';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextEmailInvalid=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'email:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'email:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::fieldMatch:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'password_confirm=^'.$o_elFull[1]->getId().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextPasswordConfirm=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'equalTo:\"#'.$o_elFull[1]->getId().'\"';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'equalTo:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','maxLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'maxLength=^'.$rule->getValue().'^';\n\t\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t}\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'maxlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'maxlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'maxValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'max:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'max:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}\n\t\t\t\t\t//Made own validation rule cause FormIt doesnt behave with required.\n\t\t\t\t\t//$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'minlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'minlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'minValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'min:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'min:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::numeric:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'isNumber';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextIsNumber=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'digits:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'digits:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::required:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementMatrix')){\n\t\t\t\t\t\t$s_type=$o_el->getType();\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementMatrix_'.$s_type,'required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_rows = $o_el->getRows();\n\t\t\t\t\t\t$a_columns = $o_el->getColumns();\n\t\t\t\t\t\t$a_namesForGroup=array();\n\t\t\t\t\t\tswitch($s_type){\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\tfor($col_cnt=0; $col_cnt<count($a_columns); $col_cnt++){\n\t\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt.'_'.$col_cnt;\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:\"'.$s_validationMessage.'\"';\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\tbreak;\n\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'check':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$s_fieldName = $elName.'_'.$row_cnt.'[]';\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$s_fieldName;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$s_fieldName][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$s_fieldName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$a_fieldProps_jqValidateGroups[$elName]=implode(' ',$a_namesForGroup);\n\t\t\t\t\t}else if(is_a($o_el, 'FormItBuilder_elementDate')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementDate','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_0'][] = 'required:true,dateElementRequired:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_0'][] = 'required:\"'.$s_validationMessage.'\",dateElementRequired:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'required:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::date:\n\t\t\t\t\t$s_thisVal = $rule->getValue();\n\t\t\t\t\t$s_thisErrorMsg = str_replace('===dateformat===',$s_thisVal,$s_validationMessage);\n\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'date','fieldFormat'=>$s_thisVal,'errorMessage'=>$s_thisErrorMsg);\n\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'dateFormat:\\''.$s_thisVal.'\\'';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'dateFormat:\"'.$s_thisErrorMsg.'\"';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//if some custom validation options were found (date etc) then add formItBuilder custom validate snippet to the list\n\t\tif(count($a_formProps_custValidate)>0){\n\t\t\t$GLOBALS['FormItBuilder_customValidation']=$a_formProps_custValidate;\n\t\t\tif(empty($this->_customValidators)===false){\n\t\t\t\t$this->_customValidators.=',';\n\t\t\t}\n\t\t\t$this->_customValidators.='FormItBuilder_customValidation';\n\t\t}\n\t\t\n\t\t//build inner form html\n\t\t$b_attachmentIncluded=false;\n\t\t$s_form='<div>'.$nl\n\t\t.$nl.'<div class=\"process_errors_wrap\"><div class=\"process_errors\">[[!+fi.error_message:notempty=`[[!+fi.error_message]]`]]</div></div>'\n\t\t.$nl.($b_customSubmitVar===false?'<input type=\"hidden\" name=\"'.$s_submitVar.'\" value=\"1\" />':'')\n\t\t.$nl.'<input type=\"hidden\" name=\"fke'.date('Y').'Sp'.date('m').'Blk:blank\" value=\"\" /><!-- additional crude spam block. If this field ends up with data it will fail to submit -->'\n\t\t.$nl;\n\t\tforeach($this->_formElements as $o_el){\n\t\t\t$s_elClass=get_class($o_el);\n\t\t\tif($s_elClass=='FormItBuilder_elementFile'){\n\t\t\t\t$b_attachmentIncluded=true;\n\t\t\t}\n\t\t\tif(is_a($o_el,'FormItBuilder_elementHidden')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else if(is_a($o_el,'FormItBuilder_htmlBlock')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else{\n\t\t\t\t$s_typeClass = substr($s_elClass,14,strlen($s_elClass)-14);\n\t\t\t\t$forId=$o_el->getId();\n\t\t\t\tif(\n\t\t\t\t\tis_a($o_el,'FormItBuilder_elementRadioGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementCheckboxGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementDate')===true\n\t\t\t\t){\n\t\t\t\t\t$forId=$o_el->getId().'_0';\n\t\t\t\t}else if(is_a($o_el,'FormItBuilder_elementMatrix')){\n\t\t\t\t\t$forId=$o_el->getId().'_0_0';\n\t\t\t\t}\n\t\t\t\t$s_forStr = ' for=\"'.htmlspecialchars($forId).'\"';\n\t\t\t\t\n\t\t\t\tif(is_a($o_el,'FormItBuilder_elementReCaptcha')===true){\n\t\t\t\t\t$s_forStr = ''; // dont use for attrib for Recaptcha (as it is an external program outside control of formitbuilder\n\t\t\t\t\t$s_recaptchaJS=$o_el->getJsonConfig();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$s_extraClasses='';\n\t\t\t\t$a_exClasses=$o_el->getExtraClasses();\n\t\t\t\tif(count($a_exClasses)>0){\n\t\t\t\t\t$s_extraClasses = ' '.implode(' ',$o_el->getExtraClasses());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$b_required = $o_el->isRequired();\n\t\t\t\t$s_form.='<div title=\"'.$o_el->getLabel().'\" class=\"formSegWrap formSegWrap_'.htmlspecialchars($o_el->getId()).' '.$s_typeClass.($b_required===true?' required':'').$s_extraClasses.'\">';\n\t\t\t\t\t$s_labelHTML='';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_desc=$o_el->getDescription();\n\t\t\t\t\t\tif(empty($s_desc)===false){\n\t\t\t\t\t\t\t$s_desc='<span class=\"description\">'.$s_desc.'</span>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s_labelHTML='<label class=\"mainElLabel\"'.$s_forStr.'><span class=\"before\"></span><span class=\"mainLabel\">'.$o_el->getLabel().'</span>'.$s_desc.'<span class=\"after\"></span></label>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$s_element='<div class=\"elWrap\">'.$nl.' <span class=\"before\"></span>'.$o_el->outputHTML().'<span class=\"after\"></span>';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_element.='<div class=\"errorContainer\"><label class=\"formiterror\" '.$s_forStr.'>[[+fi.error.'.htmlspecialchars($o_el->getId()).']]</label></div>';\n\t\t\t\t\t}\n\t\t\t\t\t$s_element.='</div>';\n\t\t\t\t\t\n\t\t\t\t\tif($o_el->getLabelAfterElement()===true){\n\t\t\t\t\t\t$s_form.=$s_element.$s_labelHTML;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$s_form.=$s_labelHTML.$s_element;\n\t\t\t\t\t}\n\t\t\t\t$s_form.=$nl.'</div>'.$nl;\n\t\t\t}\n\t\t}\n\t\t$s_form.=$nl.'</div>';\n\n\t\t//wrap form elements in form tags\n\t\t$s_form='<form action=\"'.$this->_formAction.'\" method=\"'.htmlspecialchars($this->_method).'\"'.($b_attachmentIncluded?' enctype=\"multipart/form-data\"':'').' class=\"form\" id=\"'.htmlspecialchars($this->_id).'\">'.$nl\n\t\t.$s_form.$nl\n\t\t.'</form>';\n\t\t\n\t\t//add all formit validation rules together in one array for easy implode\n\t\t$a_formItCmds=array();\n\t\t$a_formItErrorMessage=array();\n\t\tforeach($a_fieldProps as $fieldID=>$a_fieldProp){\n\t\t\tif(count($a_fieldProp)>0){\n\t\t\t\t$a_formItCmds[]=$fieldID.':'.implode(':',$a_fieldProp);\n\t\t\t}\n\t\t}\n\t\t//add formIT error messages\n\t\tforeach($a_fieldProps_errstringFormIt as $fieldID=>$msgArray){\n\t\t\tforeach($msgArray as $msg){\n\t\t\t\t$a_formItErrorMessage[]='&'.$fieldID.'.'.$msg;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor($i=0; $i<count($a_formProps); $i++){\n\t\t\t$a_formItCmds[]=$a_formProps[$i];\n\t\t\tif(empty($a_formPropsFormItErrorStrings[$i])===false){\n\t\t\t\t$a_formItErrorMessage[]=$a_formPropsFormItErrorStrings[$i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if using database table then add call to final hook\n\t\t$b_addFinalHooks=false;\n\t\t$GLOBALS['FormItBuilder_hookCommands']=array('formObj'=>&$this,'commands'=>array());\n\t\tif(empty($this->_databaseTableObjectName)===false){\n\t\t\t$GLOBALS['FormItBuilder_hookCommands']['commands'][]=array('name'=>'dbEntry','value'=>array('tableObj'=>$this->_databaseTableObjectName,'mapping'=>$this->_databaseTableFieldMapping));\n\t\t\t$b_addFinalHooks=true;\n\t\t}\n\t\tif($b_addFinalHooks===true){\n\t\t\t$this->_hooks[]='FormItBuilder_hooks';\n\t\t}\n\t\t\n\t\t//rebuild hooks system\n\t\t$s_hooksStr = '';\n\t\tif(empty($this->_postHookName)===false){\n\t\t $s_hooksStr.=$this->_postHookName;\n\t\t}\n\t\tif(count($this->_hooks)>0){\n\t\t if(empty($this->_postHookName)===false){\n\t\t\t$s_hooksStr.=',';\n\t\t }\n\t\t $s_hooksStr.=implode(',',$this->_hooks);\n\t\t}\n\t\t$s_fullHooksParam='';\n\t\tif(empty($s_hooksStr)===false){\n\t\t $s_fullHooksParam=$nl.'&hooks=`'.$s_hooksStr.'`';\n\t\t}\n\t\t\n\t\t$s_formItCmd='[[!FormIt?'\n\t\t.$s_fullHooksParam\t\t\t\t\n\t\t.(empty($s_recaptchaJS)===false?$nl.'&recaptchaJs=`'.$s_recaptchaJS.'`':'')\n\t\t.(empty($this->_customValidators)===false?$nl.'&customValidators=`'.$this->_customValidators.'`':'')\n\t\t\t\n\t\t.(empty($this->_emailTpl)===false?$nl.'&emailTpl=`'.$this->_emailTpl.'`':'')\n\t\t.(empty($this->_emailToAddress)===false?$nl.'&emailTo=`'.$this->_emailToAddress.'`':'')\n\t\t.(empty($this->_emailToName)===false?$nl.'&emailToName=`'.$this->_emailToName.'`':'')\n\t\t.(empty($this->_emailFromAddress)===false?$nl.'&emailFrom=`'.$this->_emailFromAddress.'`':'')\n\t\t.(empty($this->_emailFromName)===false?$nl.'&emailFromName=`'.$this->_emailFromName.'`':'')\n\t\t.(empty($this->_emailReplyToAddress)===false?$nl.'&emailReplyTo=`'.$this->_emailReplyToAddress.'`':'')\n\t\t.(empty($this->_emailReplyToName)===false?$nl.'&emailReplyToName=`'.$this->_emailReplyToName.'`':'')\n\t\t.(empty($this->_emailCCAddress)===false?$nl.'&emailCC=`'.$this->_emailCCAddress.'`':'')\n\t\t.(empty($this->_emailCCName)===false?$nl.'&emailCCName=`'.$this->_emailCCName.'`':'')\n\t\t.(empty($this->_emailBCCAddress)===false?$nl.'&emailBCC=`'.$this->_emailBCCAddress.'`':'')\n\t\t.(empty($this->_emailBCCName)===false?$nl.'&emailBCCName=`'.$this->_emailBCCName.'`':'')\n\t\t\n\t\t.(empty($this->_autoResponderTpl)===false?$nl.'&fiarTpl=`'.$this->_autoResponderTpl.'`':'')\n\t\t.(empty($this->_autoResponderSubject)===false?$nl.'&fiarSubject=`'.$this->_autoResponderSubject.'`':'')\n\t\t.(empty($this->_autoResponderToAddressField)===false?$nl.'&fiarToField=`'.$this->_autoResponderToAddressField.'`':'')\n\t\t.(empty($this->_autoResponderFromAddress)===false?$nl.'&fiarFrom=`'.$this->_autoResponderFromAddress.'`':'')\n\t\t.(empty($this->_autoResponderFromName)===false?$nl.'&fiarFromName=`'.$this->_autoResponderFromName.'`':'')\n\t\t.(empty($this->_autoResponderReplyTo)===false?$nl.'&fiarReplyTo=`'.$this->_autoResponderReplyTo.'`':'')\n\t\t.(empty($this->_autoResponderReplyToName)===false?$nl.'&fiarReplyToName=`'.$this->_autoResponderReplyToName.'`':'')\n\t\t.(empty($this->_autoResponderCC)===false?$nl.'&fiarCC=`'.$this->_autoResponderCC.'`':'')\n\t\t.(empty($this->_autoResponderCCName)===false?$nl.'&fiarCCName=`'.$this->_autoResponderCCName.'`':'')\n\t\t.(empty($this->_autoResponderBCC)===false?$nl.'&fiarBCC=`'.$this->_autoResponderBCC.'`':'')\n\t\t.(empty($this->_autoResponderBCCName)===false?$nl.'&fiarBCCName=`'.$this->_autoResponderBCCName.'`':'')\n\t\t.$nl.'&fiarHtml=`'.($this->_autoResponderHtml===false?'0':'1').'`'\t\t\t\t\n\t\t\t\t\n\t\t.$nl.'&emailSubject=`'.$this->_emailSubject.'`'\n\t\t.$nl.'&emailUseFieldForSubject=`1`'\n\t\t.$nl.'&redirectTo=`'.$this->_redirectDocument.'`'\n\t\t.(empty($this->_redirectParams)===false?$nl.'&redirectParams=`'.$this->_redirectParams.'`':'')\n\t\t.$nl.'&store=`'.($this->_store===true?'1':'0').'`'\n\t\t.$nl.'&submitVar=`'.$s_submitVar.'`'\n\t\t.$nl.implode($nl,$a_formItErrorMessage)\n\t\t.$nl.'&validate=`'.(isset($this->_validate)?$this->_validate.',':'').implode(','.$nl.' ',$a_formItCmds).','.$nl.'`]]'.$nl;\n\t\t\n\t\tif($this->_jqueryValidation===true){\n\t\t\t$s_js='\t\n$().ready(function() {\n\njQuery.validator.addMethod(\"dateFormat\", function(value, element, format) {\n\tvar b_retStatus=false;\n\tvar s_retValue=\"\";\n\tvar n_retTimestamp=0;\n\tif(value.length==format.length){\n\t\tvar separator_only = format;\n\t\tvar testDate;\n\t\tif(format.toLowerCase()==\"yyyy\"){\n\t\t\t//allow just yyyy\n\t\t\ttestDate = new Date(value, 1, 1);\n\t\t\tif(testDate.getFullYear()==value){\n\t\t\t\tb_retStatus=true;\n\t\t\t}\n\t\t}else{\n\t\t\tseparator_only = separator_only.replace(/m|d|y/g,\"\");\n\t\t\tvar separator = separator_only.charAt(0)\n\n\t\t\tif(separator && separator_only.length==2){\n\t\t\t\tvar dayPos; var day; var monthPos; var month; var yearPos; var year;\n\t\t\t\tvar s_testYear;\n\t\t\t\tvar newStr = format;\n\n\t\t\t\tdayPos = format.indexOf(\"dd\");\n\t\t\t\tday = parseInt(value.substr(dayPos,2),10)+\"\";\n\t\t\t\tif(day.length==1){day=\"0\"+day;}\n\t\t\t\tnewStr=newStr.replace(\"dd\",day);\n\n\t\t\t\tmonthPos = format.indexOf(\"mm\");\n\t\t\t\tmonth = parseInt(value.substr(monthPos,2),10)+\"\";\n\t\t\t\tif(month.length==1){month=\"0\"+month;}\n\t\t\t\tnewStr=newStr.replace(\"mm\",month);\n\n\t\t\t\tyearPos = format.indexOf(\"yyyy\");\n\t\t\t\tyear = parseInt(value.substr(yearPos,4),10);\n\t\t\t\tnewStr=newStr.replace(\"yyyy\",year);\n\n\t\t\t\ttestDate = new Date(year, month-1, day);\n\n\t\t\t\tvar testDateDay=(testDate.getDate())+\"\";\n\t\t\t\tif(testDateDay.length==1){testDateDay=\"0\"+testDateDay;}\n\n\t\t\t\tvar testDateMonth=(testDate.getMonth()+1)+\"\";\n\t\t\t\tif(testDateMonth.length==1){testDateMonth=\"0\"+testDateMonth;}\n\n\t\t\t\tif (testDateDay==day && testDateMonth==month && testDate.getFullYear()==year) {\n\t\t\t\t\tb_retStatus = true;\n\t\t\t\t\t$(element).val(newStr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Please enter a valid date.\");\n\njQuery.validator.addMethod(\"dateElementRequired\", function(value, element, format) {\n\tvar el=element;\n\tb_retStatus=true;\n\tvar elBaseId=element.id.substr(0,element.id.length-2);\n\tif($(\"#\"+elBaseId+\"_0\").val()==\"\" || $(\"#\"+elBaseId+\"_1\").val()==\"\" || $(\"#\"+elBaseId+\"_2\").val()==\"\"){\n\t\tb_retStatus=false;\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Date element is required.\");\n\n//Main validate call\nvar thisFormEl=$(\"#'.$this->_id.'\");\nthisFormEl.validate({errorPlacement:function(error, element) {\n\tvar labelEl = element.parents(\".formSegWrap\").find(\".errorContainer\");\n\terror.appendTo( labelEl );\n},success: function(element) {\n\telement.addClass(\"valid\");\n\tvar formSegWrapEl = element.parents(\".formSegWrap\");\n\tformSegWrapEl.children(\".mainElLabel\").removeClass(\"mainLabelError\");\n},highlight: function(el, errorClass, validClass) {\n\tvar element= $(el);\n\telement.addClass(errorClass).removeClass(validClass);\n\telement.parents(\".formSegWrap\").children(\".mainElLabel\").addClass(\"mainLabelError\");\n},invalidHandler: function(form, validator){\n\t//make nice little animation to scroll to the first invalid element instead of an instant jump\n\tvar jumpEl = $(\"#\"+validator.errorList[0].element.id).parents(\".formSegWrap\");\n\t$(\"html,body\").animate({scrollTop: jumpEl.offset().top});\n if(FormItBuilderInvalidCallback){FormItBuilderInvalidCallback();}\n},ignore:\":hidden\",'.\n\t\t\t\t\t\n$this->jqueryValidateJSON(\n\t$a_fieldProps_jqValidate,\n\t$a_fieldProps_errstringJq,\n\t$a_fieldProps_jqValidateGroups\n).'});\n\t\n'.\n//Force validation on load if already posted\n($b_posted===true?'thisFormEl.valid();':'')\n.'\n\t\n});\n';\n\t\t}\n\t\t\n\t\t//Allows output of the javascript into a paceholder so in can be inserted elsewhere in html (head etc)\n\t\tif(empty($this->_placeholderJavascript)===false){\n\t\t\t$this->modx->setPlaceholder($this->_placeholderJavascript,$s_js);\n\t\t\treturn $s_formItCmd.$s_form;\n\t\t}else{\n\t\t\treturn $s_formItCmd.$s_form.\n'<script type=\"text/javascript\">\n// <![CDATA[\n'.$s_js.'\n// ]]>\n</script>';\n\t\t}\n\t}", "private function viewBuilder() {\n $html = '';\n $file = false;\n // Create fields\n foreach ($this->formDatas as $field) {\n $type = $field['type'];\n switch ($type) {\n case 'text' :\n case 'password' :\n case 'hidden' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n // Addon - 2013-07-31\n case 'date' :\n case 'datetime' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"text\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n\n\n if ($type == 'datetime') {\n $plugin = $this->addPlugin('widget', false);\n $plugin = $this->addPlugin('date');\n }\n $plugin = $this->addPlugin($type);\n if (!isset($this->js['script'])) {\n $this->js['script'] = '';\n }\n if ($type == 'datetime') {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datetimepicker({ dateFormat: \"yy-mm-dd\", timeFormat : \"HH:mm\"});});</script>';\n } else {\n $this->js['script'] .= '\n <script type=\"text/javascript\">$(document).ready(function() {$(\"#' . $field['name'] . '\").datepicker({ dateFormat: \"yy-mm-dd\"});});</script>';\n }\n break;\n // End Addon\n case 'select' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <select name=\"' . $field['name'] . '\">';\n // Add options\n foreach ($field['options'] as $option) {\n $html .= '\n <option value=\"' . $option . '\" <?php echo set_select(\"' . $field['name'] . '\", \"' . $option . '\"); ?>>' . $option . '</option>';\n }\n $html .= '\n </select>';\n break;\n case 'checkbox' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['checkbox'] as $option) {\n $html .= '\n <input type=\"checkbox\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'radio' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n ';\n // Add options\n foreach ($field['radio'] as $option) {\n $html .= '\n <input type=\"radio\" value=\"' . $option . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $option . '\"); ?>\"><span>' . $option . '</span>';\n }\n break;\n case 'reset' :\n case 'submit' :\n $html .= '\n <input type=\"' . $type . '\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" value=\"<?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?>\"/>';\n break;\n case 'textarea' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <textarea name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\"><?php echo set_value(\"' . $field['name'] . '\", \"' . $field['value'] . '\"); ?></textarea>';\n break;\n case 'file' :\n $html .= '\n <label for=\"' . $field['name'] . '\">' . $field['label'] . '</label>\n <input type=\"file\" name=\"' . $field['name'] . '\" id=\"' . $field['name'] . '\" />';\n $file = true;\n break;\n }\n }\n\n $view = '\n <html>\n <head>\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo base_url() ?>assets/css/generator/' . $this->cssName . '.css\">\n '; // Addon - 2013-07-31\n foreach ($this->css as $css) {\n $view .= $css . '\n ';\n }\n foreach ($this->js as $js) {\n $view .= $js . '\n ';\n }\n // End Addon\n $view .= '\n </head>\n <body>\n <?php\n // Show errors\n if(isset($error)) {\n switch($error) {\n case \"validation\" :\n echo validation_errors();\n break;\n case \"save\" :\n echo \"<p class=\\'error\\'>Save error !</p>\";\n break;\n }\n }\n if(isset($errorfile)) {\n foreach($errorfile as $name => $value) {\n echo \"<p class=\\'error\\'>File \\\"\".$name.\"\\\" upload error : \".$value.\"</p>\";\n }\n }\n ?>\n <form action=\"<?php echo base_url() ?>' . $this->formName . '\" method=\"post\" ' . ($file == true ? 'enctype=\"multipart/form-data\"' : '') . '>\n ' . $html . '\n </form>\n </body>\n </html>';\n return array(str_replace('<', '&lt;', $view), $view);\n }", "function renderForm()\t{\n\n\t\t$fields[] = $this->renderField( $GLOBALS['LANG']->getLL('settings'), 'divider', '');\n\t\t$fields[] = $this->renderField( $GLOBALS['LANG']->getLL('spaceTitle'), 'text', 'title');\n\t\n\t\tif(count($this->error) > 0) {\n\t\t\t$form .= \"<span style='display:block;color:red;font-weight:bold;padding:10px;'>\" .\n\t\t\t\t\t\t\t implode(\"<br />\", $this->error) . \n\t\t\t\t\t \"</span>\";\t\n\t\t}\n\n\t\t$form .= \"<form action=\" . t3lib_div::getThisUrl() . \"><table border='0' cellpadding='7'>\";\n\t\t$form .= implode(\"\\n\", $fields);\n\t\t$form .= \"<tr><td colspan='2' align='right'>\" .\n\t\t\t\t \"<input type='hidden' name='formPosted' value='1'>\" . \n\t\t\t\t \"<input type='submit' value='\" . $GLOBALS['LANG']->getLL('createSpace') . \"'></td></tr></table></form>\";\n\n\t\treturn $form;\n\t}", "public function form() {\n\t\treturn array();\n\t}", "public function render()\n {\n echo htmlspecialcharsbx($this->getPrefix());\n $action = $this->getAction();\n $id = $this->getId();\n $class = $this->getClass();\n $name = $this->getName();\n $dataAttributes = $this->getDataAttributes();\n $dataAttributesString = '';\n foreach ($dataAttributes as $key => $value) {\n $dataAttributesString .= ' data-' . $key . '=\"' . $value . '\" ';\n }\n\n $formArguments = 'action=\"' . (($action !== null) ? $action : '#') . '\" ';\n $formArguments .= ($id !== null) ? 'id=\"' . $id . '\" ' : '';\n $formArguments .= !empty($class) ? 'class=\"' . implode(' ', $class) . '\" ' : '';\n $formArguments .= ($name !== null) ? 'name=\"' . $name . '\" ' : '';\n $formArguments .= $dataAttributesString;\n echo '<form ' . $formArguments . '>';\n\n $fields = $this->getFields();\n foreach ($fields as $key => $field) {\n $field->render();\n }\n\n echo '</form>';\n\n echo htmlspecialcharsbx($this->getPostfix());\n }", "protected function getForm() {\n $lUpdate = ($this -> mPhraseTyp == 'product') ? 'yes' : 'no';\n $this -> setParam('ref_update', $lUpdate);\n\n $lRet = '<div id=\"job_form\" class=\"frm\">'.LF;\n\t$lRet.= $this -> getFieldForm();\n $lRet.= '</div>' . LF;\n \n /*if($this -> mCanBuild) {\n $lRet.= '<div id=\"save_dialog\" title=\"Publish PDF\" style=\"display:none;\">'.LF;\n\t $lRet.= '<input id=\"templateId\" type=\"hidden\" value=\"\" />'.LF;\n $lRet.= '<iframe src=\"\" onload=\"javascript:GetEditor()\" id=\"chiliEditor\" class=\"dn\" style=\"width:100%;height:100%;\"></iframe>'.LF;\n $lRet.= '</div>'.LF;\n }*/\n \n $lDlg = new CJob_Cms_Content_Dialog($this -> mJobId, $this -> mSrc, $this -> mJob);\n $lRet.= $lDlg -> getContent();\n \n $lRet.= $lDlg -> getModals();\n \n return $lRet;\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitKushkipagosModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n if(Currency::getDefaultCurrency()->iso_code=='COP'){\n return $helper->generateForm(array($this->getConfigFormCOP()));\n }else{\n return $helper->generateForm(array($this->getConfigForm()));\n }\n\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 buildForm()\n {\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitOrderrefModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submit_apisfact_prestashop';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "public function getContent()\n {\n\n $output = null;\n /**\n * If values have been submitted in the form, process.\n */\n if ((bool)Tools::isSubmit('submit'.$this->name)) {\n $this->postProcess();\n }\n\n $this->context->smarty->assign('module_dir', $this->_path);\n\n $output = $this->context->smarty->fetch($this->local_path.'views/templates/admin/configure.tpl');\n\n return $output.$this->renderForm();\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitCaptureleadsxavierModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "public function RenderFormEnd() {\n\n return '</form>';\n }", "protected function renderForm()\n {\n $helper = PrestashopFactory::buildHelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitIfthenpayModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitWi_weatherModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "public static function endForm(){\n\t\treturn '</form>';\n\t}", "function buildOutput()\n {\n $dom = new DOMDocument('1.0', 'UTF-8');\n $field = $dom->createElement('field');\n if ( !isset($this->class) )\n {\n $field->setAttribute('class', $this->type);\n } else {\n $field->setAttribute('class', $this->class);\n }\n $field->setAttribute('id', $this->name);\n $field->setAttribute('label', $this->label);\n $field->setAttribute('name', $this->name);\n $field->setAttribute('type', $this->type);\n if ( is_array($this->options) )\n {\n foreach ( $this->options AS $name=>$value )\n {\n $field->setAttribute($name, $value);\n }\n }\n $field->appendChild($dom->createCDATASection($this->value));\n return $field;\n }", "public function get_buffer()\n\t{\n\t\t$this->end_fieldset();\n\t\t$buffer = $this->buffer.'</form>';\n\t\t\n\t\t$this->clean(); // flush le buffer\n\t\treturn $buffer;\n\t}", "public function html(){\n\t\treturn '<div class=\"form-group\">'.$this->label.$this->input.'</div>';\n\t}", "public function displayAsHTML() {\n // The page parameter of the form action must be assigned a value that corresponds to the switch statement string in index.php\n\n $customerDDHtml = $this->customerDropDown(\"customerId\", $this->customerId);\n\n $outputHtml = <<<EOT\n <form action=\"index.php?page=properties\" method=\"post\">\n <input type=\"hidden\" name=\"action\" value=\"save\" />\n <input type=\"hidden\" name=\"propertyId\" value=\"$this->propertyId\" />\n <table width=\"90%\"><tr><td><div class=\"instructions\" id=\"instructionText\"></div></td></tr></table>\n <div class=\"dataentry\">\n <table width=\"90%\">\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">Property Owner:</p></td>\n <td colspan=\"3\">$customerDDHtml</td>\n </tr>\n <tr><td colspan=\"4\"><p class=\"pageedit\"><strong>Tenant Information</strong></p></td></tr>\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">First Name:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"firstName\" id=\"firstName\" value=\"$this->firstName\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n <td width=\"15%\"><p class=\"pageedit\">Last Name:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"lastName\" id=\"lastName\" value=\"$this->lastName\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n </tr>\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">Phone:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"10\" size=\"11\" name=\"phone\" id=\"phone\" value=\"$this->phone\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n <td width=\"15%\"><p class=\"pageedit\">E-mail:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"email\" id=\"email\" value=\"$this->email\" onfocus=\"prHelpText(event, true);\" onblur=\"prHelpText(event, false);\" /></td>\n </tr>\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">Address:</p></td>\n <td colspan=\"3\"><input type=\"text\" maxlength=\"255\" size=\"80\" name=\"address\" id=\"address\" value=\"$this->address\" /></td>\n </tr>\nEOT;\n\n $outputHtml .= $this->errorRow(\"address\");\n $defaultState = $this->state;\n if (!$defaultState) {\n $defaultState = \"TX\";\n }\n $stateDDHtml = stateDropDown(\"state\", $defaultState);\n $outputHtml .= <<<EOT\n <tr>\n <td width=\"15%\"><p class=\"pageedit\">City:</p></td>\n <td width=\"35%\"><input type=\"text\" maxlength=\"40\" size=\"40\" name=\"city\" id=\"city\" value=\"$this->city\" /></td>\n <td width=\"15%\"><p class=\"pageedit\">State/Zip:</p></td>\n <td width=\"35%\">\n <table>\n <tr>\n <td width=\"50%\">\n $stateDDHtml\n </td>\n <td width=\"50%\">\n <input type=\"text\" maxlength=\"5\" size=\"6\" name=\"zip\" id=\"zip\" value=\"$this->zip\" />\n </td>\n </tr>\n </table>\n </td>\n </tr>\nEOT;\n\n\n $outputHtml .= $this->errorRow(\"city\", \"state\", \"zip\");\n $outputHtml .= <<<EOT\n <tr>\n <td><p class=\"pageedit\">Notes:</p></td>\n <td colspan=\"3\"><textarea name=\"notes\" id=\"notes\" cols=\"80\" rows=\"2\">$this->notes</textarea></td>\n </tr>\n\n <tr>\n <td colspan=\"4\"><input type=\"submit\" value=\"Save\" /><a href=\"index.php?page=properties\"><input type=\"button\" value=\"New\" /></a></td>\n </tr>\n <tr>\n <td colspan=\"4\"><p class=\"instructions\">$this->statusMessage</p></td>\n </tr>\n </table>\n </div>\n </form>\n <br><br>\nEOT;\n\n\n $outputHtml .= <<<EOT\n <table class=\"searchresults\">\n <tr>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Customer Name</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Customer Contact</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Tenant Name</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Tenant Contact</p></td>\n <td class=\"searchresultshdr\" width=\"20%\"><p class=\"searchresultsheader\">Address</p></td>\n </tr>\nEOT;\n\n foreach ($this->propertyList as $key => $tableRow) {\n $outputHtml .= '<tr>' . $tableRow . '</tr>';\n }\n\n $customerDDHtml = $this->customerDropDown(\"searchCustomerId\", '', true);\n $outputHtml .= <<<EOT\n </table>\n <br><br>\n <form action=\"index.php?page=properties\" method=\"post\">\n <input type=\"hidden\" name=\"listby\" value=\"name\" />\n <p class=\"pageedit\"><strong>Find property by customer, tenant name, or address</strong></p>\n <p class=\"pageedit\">Customer: $customerDDHtml</p>\n <p class=\"pageedit\">First name: <input type=\"text\" maxlength=\"40\" size=\"40\" name=\"searchFName\" id=\"searchFName\" /></p>\n <p class=\"pageedit\">Last name: <input type=\"text\" maxlength=\"40\" size=\"40\" name=\"searchLName\" id=\"searchLName\" /></p>\n <p class=\"pageedit\">Address: <input type=\"text\" maxlength=\"255\" size=\"80\" name=\"searchAddress\" id=\"searchAddress\" /></p>\n <input type=\"submit\" value=\"Search\">\n </form>\nEOT;\n\n return $outputHtml;\n }", "public function buildFormTemplate() {\n\t\t$formTemplatepath = \"src/Templates/\".$this->stateName.\"_\".$this->stateType.\".php\";\n\t\t$formTemplate = fopen($formTemplatepath, \"w\") or die (\"Unable to create html template for \\\"\".$this->stateName.\"_\".$this->stateType.\"\\\" state.\");\n\t\t$formHtml = \"<!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\tif ($this->stateType == \"generation\") {\n\t\t\t$formHtml .= \"<form method=\\\"\".$this->method.\"\\\" action=\\\"../Scripts/generationHandleRequest.php\\\" >\";\n\t\t}\n\t\t\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Skip the Database elements.\n\t\t\tif ($input['inputType'] == \"DATABASE\") {\n\t\t\t\tcontinue;\n\t\t\t}\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\t$formHtml .= \"<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\t$formHtml .= \" required\";\n\t\t\t}\n\t\t\t// Makes the html page more readable, i.e. appending with a new line.\n\t\t\t$formHtml .= \">\n\t\t\t<br>\";\n\t\t}\n\n\t\t$formHtml .= \"</form>\n\t\t</body>\n\t\t</html>\";\n\n\t\tfwrite($formTemplate, $formHtml);\n\t\tfclose($formTemplate);\n\t}", "private function get_inputs_output_html() {\n\t\t$i = 0;\n\t\t$j = 0;\n\n\t\t$addon_title = $this->addon_raw['title'];\n\t\t$fieldsets = array();\n\t\tforeach ($this->options as $key => $option) {\n\t\t\t\t$fieldsets[$key] = $option;\n\t\t}\n\n\t\t$output = '';\n\n\t\tif(count((array) $fieldsets)) {\n\t\t\t$output .= '<div class=\"sp-pagebuilder-fieldset\">';\n\t\t\t$output .= '<ul class=\"sp-pagebuilder-nav sp-pagebuilder-nav-tabs\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<li class=\"'. (( $i === 0 )?\"active\":\"\" ) .'\"><a href=\"#sp-pagebuilder-tab-'. $key .'\" aria-controls=\"'. $key .'\" data-toggle=\"tab\">'. ucfirst( $key ) .'</a></li>';\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$output .= '</ul>';\n\t\t\t$output .= '<div class=\"tab-content\">';\n\t\t\tforeach ( $fieldsets as $key => $value ) {\n\t\t\t\t$output .= '<div class=\"tab-pane '. (( $j === 0 )? \"active\":\"\" ) .'\" id=\"sp-pagebuilder-tab-'. $key .'\">';\n\t\t\t\t$output .= $this->get_input_fields( $key, $addon_title );\n\t\t\t\t$output .= '</div>';\n\n\t\t\t\t$j++;\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\treturn $output;\n\t}", "public function display()\n {\n $output = \"\";\n\n // Ouverture\n /// ID HTML\n $openId = $this->getAttr('container_id');\n /// Classes HTML\n $openClass = [];\n $openClass[] = 'tiFyForm-FieldContainer';\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getType();\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getSlug();\n if ($this->getErrors()) :\n $openClass[] = 'tiFyForm-FieldContainer--error';\n endif;\n $openClass[] = $this->getAttr('container_class');\n if ($this->getAttr('required')) :\n $openClass[] = 'tiFyForm-FieldContainer--required';\n endif;\n $output .= $this->form()\n ->factory()\n ->fieldOpen($this, $openId, join(' ', $openClass));\n\n // Contenu du champ\n $output .= $this->type()->_display();\n\n // Fermeture\n $output .= $this->form()->factory()->fieldClose($this);\n\n return $output;\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submit'.$this->name;\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFieldsValues(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\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}", "abstract function builder_form(): string;", "public function render_moodleform($form) {\n ob_start();\n $form->display();\n $output = ob_get_contents();\n ob_clean();\n return $output;\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}", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitWi_spentModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitPromoModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n // Ligne de code pour afficher le formulaire de base du module\n // return $helper->generateForm(array($this->getConfigForm()));\n return $helper->generateForm(array());\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitStatsProfitMarginModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "public function getContent()\n {\n if (((bool)Tools::isSubmit('submitprice_product')) == true) {\n $this->postProcess();\n }\n\n $this->context->smarty->assign('module_dir', $this->_path);\n\n /*$output = $this->context->smarty->fetch($this->local_path.'views/templates/admin/configure.tpl');*/\n\n return $output.$this->renderForm();\n }", "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 }", "public function buildView(){\n $html = '';\n\n $html .= $this->getValidatedMessage();\n\n foreach($this->fields as $field){\n $html .= $field->buildModule();\n }\n\n return $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 ProductsBody()\n\t{\t//$this->FilterForm();\n\t\techo $this->cat->InputForm();\n\t}", "public function _Render() {\n $form_instance = $this->form_instance;\n // Return the contents\n return '3/15 Questions Answered';\n }", "public function generateForm() : string\n {\n $fields = $this->fields;\n $availableFormFields = [];\n\n $this->form = '';\n foreach ($fields as $field => $config) {\n $fieldClass = config('platform.fields.' . $config['tag']);\n\n if (is_null($fieldClass)) {\n throw new TypeException('Field ' . $config['tag'] . ' does not exist');\n }\n\n\n $config['lang'] = $this->language;\n $config['prefix'] = $this->buildPrefix($config);\n $config = $this->fill($config);\n\n\n $firstTimeRender = false;\n if (!in_array($fieldClass, $availableFormFields)) {\n array_push($availableFormFields, $fieldClass);\n $firstTimeRender = true;\n }\n\n $field = (new $fieldClass())->create($config, $firstTimeRender);\n $this->form .= $field->render();\n }\n\n return $this->form;\n }", "public function form(){\n\t\treturn $this->form;\n\t}", "public function doRender(){\r\n\t\t$label = ($this->label != '') ? Label::get($this)->doRender() : '';\r\n\r\n\t\treturn\r\n\t\t\t '<div class=\"'.$this->printWrapperClasses().'\">'\r\n\t\t\t\t.$label\r\n\t\t\t\t.'<div class=\"'.parent::WIDGETCLASS.'\">'\r\n\t\t\t\t\t.'<input'\r\n\t\t\t\t\t\t.$this->printId()\r\n\t\t\t\t\t\t.$this->printName()\r\n\t\t\t\t\t\t.' type=\"file\"'\r\n\t\t\t\t\t\t.$this->printTitle()\r\n\t\t\t\t\t\t.$this->printAccept()\r\n\t\t\t\t\t\t.$this->printSize()\r\n\t\t\t\t\t\t.$this->printMaxLength()\r\n\t\t\t\t\t\t.$this->printCssClasses()\r\n\t\t\t\t\t\t.$this->printJavascriptEventHandler()\r\n\t\t\t\t\t\t.$this->printTabindex()\r\n\t\t\t\t\t\t.$this->printReadonly()\r\n\t\t\t\t\t\t.$this->printDisabled()\r\n\t\t\t\t\t\t.$this->masterForm->printSlash()\r\n\t\t\t\t\t.'>'\r\n\t\t\t\t.'</div>'\r\n\t\t\t\t.$this->masterForm->printFloatBreak()\r\n\t\t\t.'</div>'\r\n\t\t;\r\n\t}", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: save PHP/CSS code');\r\n\r\n $code[] =& $this->createElement('checkbox', 'P', null, 'PHP');\r\n $code[] =& $this->createElement('checkbox', 'C', null, 'CSS');\r\n $this->addGroup($code, 'phpcss', 'PHP and/or StyleSheet source code:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('next','apply'));\r\n }", "public function end()\n {\n $this->associatedEntity = null;\n\n return \"</form>\";\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitB2binpayModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "protected function renderForm()\n {\n $default_lang = (int)Configuration::get('PS_LANG_DEFAULT');\n $this->renderConfigurationForm();\n\n $helper = new HelperForm();\n $helper->module = $this;\n $helper->name_controller = $this->name;\n $helper->identifier = $this->identifier;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n foreach (Language::getLanguages(false) as $lang) {\n $helper->languages[] = array(\n 'id_lang' => $lang['id_lang'],\n 'iso_code' => $lang['iso_code'],\n 'name' => $lang['name'],\n 'is_default' => ($default_lang == $lang['id_lang'] ? 1 : 0)\n );\n }\n\n $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;\n $helper->default_form_language = $default_lang;\n $helper->allow_employee_form_lang = $default_lang;\n $helper->toolbar_scroll = true;\n $helper->title = $this->displayName;\n $helper->submit_action = 'save'.$this->name;\n $helper->toolbar_btn = array(\n 'save' =>\n array(\n 'desc' => $this->l('Save'),\n 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'),\n )\n );\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFieldsValues(),\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id\n );\n\n return $helper->generateForm($this->fields_form);\n }", "static function newform()\n\t{\n\t\treturn '\n\t\t<h2>Neue Wette eintragen</h2>\n\t\t<small>Eine Wette wird erst gestartet wenn der Wetter (das bist DU wenn du eine Wette einträgst) die offene Wette startet.</small>\n\t\t<form action=\"'.getURL(false,false).'\" method=\"post\">\n\t\t<table class=\"border\">\n\t\t<tr><td>\n\t\t<b>Wett Titel:<b> <br />\n\t\t<input type=\"text\" name=\"titel\" class=\"text\" size=\"40\">\n\t\t</td></tr><tr><td>\n\t\t<b>Wette: </b><br />\n\t\t<textarea name=\"wette\" cols=\"40\" rows=\"5\" class=\"text\"></textarea>\n\t\t</td></tr><tr><td>\n\t\t<b>Wetteinsatz: </b><br />\n\t\t<textarea name=\"einsatz\" cols=\"40\" rows=\"3\" class=\"text\"></textarea>\n\t\t</td></tr><tr><td>\n\t\t<b><small>Gültigkeit (in Tagen ab Wettstart, 0 steht für unbegrenzt):</small></b>\n\t\t<br />\n\t\t<input type=\"text\" name=\"dauer\" class=\"text\" size=\"4\">\n\t\t</td></tr><tr><td>\n\t\t<br />\n\t\t<small>\n\t\tEine Wette ist beendet wenn, <b>beide Parteien</b> <br />\n\t\tsich auf einen <b>Sieg oder eine Niederlage einigen</b> können.<br />\n\t\t</small>\n\t\t<br />\n\t\t<input type=\"submit\" value=\"Wette eintragen\" class=\"button\">\n\t\t</td></tr>\n\t\t</table>\n\t\t</form>';\n\t}", "public function render()\n {\n $root =& XCube_Root::getSingleton();\n $renderSystem =& $root->getRenderSystem(XOOPSFORM_DEPENDENCE_RENDER_SYSTEM);\n\n $renderTarget =& $renderSystem->createRenderTarget('main');\n\n $renderTarget->setAttribute('legacy_module', 'legacy');\n $renderTarget->setTemplateName('legacy_xoopsform_tableform.html');\n $renderTarget->setAttribute('form', $this);\n\n $renderSystem->render($renderTarget);\n\n return $renderTarget->getResult();\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitMyeticketsModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitTwispayModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitMClModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "public function render() {\n /* verify all fields except checkbox */\n if($this->required\n && $this->form->isSubmitted()\n && !$this->checkValue()) {\n $this->error = TRUE;\n $this->cssClass = 'error';\n }\n\n /* verify checkbox */\n $tempName = str_replace('[]', NULL, $this->name);\n\n if($this->required\n && $this->form->isSubmitted()\n && $this->type == 'checkbox'\n && !isset($_REQUEST[$tempName])) {\n $this->error = TRUE;\n $this->cssClass = 'error';\n }\n\n $html = NULL;\n $this->value = htmlspecialchars($this->value);\n\n $html .= '<input type=\"'.$this->type.'\" id=\"'.$this->id.'\" name=\"'.$this->name.'\" value=\"'.$this->value.'\"';\n $html .= (bool)$this->size ? ' size= \"'.$this->size.'\"' : NULL;\n $html .= (bool)$this->maxlength ? ' maxlength= \"'.$this->maxlength.'\"' : NULL;\n $html .= (bool)$this->size ? ' size=\"'.$this->size.'\"' : NULL;\n $html .= ($this->type == 'text' || $this->type == 'password') ? ' class=\"' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'submit') ? ' class=\"submit ' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'checkbox') ? ' class=\"checkbox ' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'radio') ? ' class=\"radio ' . $this->cssClass .'\"' : NULL;\n $html .= ($this->type == 'image') ? ' source=\"'.$this->source.'\"' : NULL;\n $html .= ($this->type == 'image' && (bool)$this->width && (bool)$this->height) ? ' style=\"width:'.$this->width.'px; height:'.$this->height.'px;\"' : NULL;\n $html .= (bool)$this->checked ? ' checked' : NULL;\n $html .= ' />';\n\n if (isset($this->label)) {\n $html .= '<span class=\"label\">' . $this->label . '</span>';\n }\n\n $this->html = ($this->type == 'hidden') ? $html : $this->wrap($html);\n }", "function onGetFormFooter($output = false) {\n\t\t$html = '';\n\t\t$html .= $this->_getFormSpamControls ();\n\t\t$html .= $this->_getItemIdElement ();\n\t\t$html .= '<input type=\"hidden\" name=\"bf_preview_' . $this->_FORM_CONFIG ['id'] . '\" id=\"bf_preview_' . $this->_FORM_CONFIG ['id'] . '\" value=\"0\" />';\n\t\t\n\t\t$tmpl = bfRequest::getVar ( 'tmpl' );\n\t\tif (_BF_PLATFORM == 'JOOMLA1.5' && $tmpl == 'component') {\n\t\t\t$html .= '<input type=\"hidden\" name=\"tmpl\" id=\"tmpl\" value=\"component\" />';\n\t\t}\n\t\t$html .= \"\\n\\n\" . '</form>';\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 render() {\n $formContainsRequiredFields = FALSE;\n $htmlElements = array();\n\n foreach($this->elements as $element) {\n if(!$this->getMarkRequiredFields()) {\n $element['object']->markIfRequired(FALSE);\n }\n\n if($element['object']->isRequired()) $formContainsRequiredFields = TRUE;\n $element['object']->render();\n if($element['object']->errorOccured()) $this->setError(TRUE);\n\n $htmlElements[] = $element['object']->fetch();\n $this->javascripts .= $element['object']->getJavaScripts();\n }\n\n $this->html = implode(\"\\n<span class=\\\"element_separator\\\">&nbsp;</span>\", $htmlElements);\n $preForm = (bool)$this->headline ? FORMWIZARD_PRE_FORM_HEADLINE : FORMWIZARD_PRE_FORM;\n\n $html = NULL;\n\n $html .= '<style type=\"text/css\">@import url('.FORMWIZARD_CSS_URL.\");</style>\\n\";\n $html .= str_replace('{headline}', $this->headline, $preForm);\n $html .= \"\\n\".'<form name=\"'.$this->name.'\" method=\"'.$this->method.'\" action=\"'.$this->action.'\" enctype=\"multipart/form-data\">';\n $html .= \"\\n\".'<input type=\"hidden\" name=\"__'.$this->name.'_submitted\" value=\"1\" />';\n $html .= \"\\n\".$this->html;\n $html .= \"\\n\".'</form>';\n $html .= \"\\n\".'<script type=\"text/javascript\">'.$this->javascripts.'</script>';\n\n if($formContainsRequiredFields && $this->markRequiredFields) {\n $html .= \"\\n\".FORMWIZARD_LEGEND_REQUIRED_FIELD;\n }\n\n $this->html = $html.\"\\n\".FORMWIZARD_POST_FORM;\n\n $this->isRendered = TRUE;\n }", "public function getHTML()\n\t{\n\t\t$start = '\n\t\t\t<form';\n\t\t$start .= ( $this->id ) ? ' id=\"' . $this->id . '\"' : '';\n $start .= ' class=\"group\"';\n $start .= ' action=\"' . $this->action . '\"';\n\t\t$start .= ' method=\"' . $this->method . '\"';\n\t\t$start .= ( $this->enctype ) ? ' enctype=\"multipart/form-data\"' : '';\n\t\t$start .= \">\\n\";\n\t\t\n\t\t$end = \"</form>\\n\";\n\t\t\n\t\t$content = '';\n\t\tforeach ( $this->elements as $element ) {\n\t\t\t$content .= $element->getHtml();\n\t\t}\n\t\t\n\t\treturn $start . $content . $end;\n\t}", "public function setAsStaticForm() {\n\t\treturn $this->form_tag(implode('<br />', $this->_elements));\n\t}", "public function createFinaliseRepairFields()\r\n {\r\n echo \"\r\n <fieldset>\r\n <legend> Finalise Repair </legend>\r\n <div class=\\\"input-wrapper\\\">\r\n <div class=\\\"left-wrapper\\\">\r\n <label>Repair Cost: </label>\r\n <input type=\\\"text\\\" class=\\\"input-text-fifty\\\" name=\\\"repair-cost-input\\\" id=\\\"repair-cost-input\\\"\r\n value=\\\"\".$this->checkRepairCost().\"\\\">\r\n </div>\r\n\r\n <div class=\\\"right-wrapper\\\">\r\n <label>Authorised By: </label>\r\n <input type=\\\"text\\\" class=\\\"input-text-fifty\\\" name=\\\"return-authorized-name-input\\\" id=\\\"return-authorized-name-input\\\"\r\n value=\\\"\".$this->queryResult[\"ReturnAuthorizedName\"].\"\\\">\r\n </div>\r\n </div>\r\n\r\n <div class=\\\"input-wrapper\\\">\r\n <div class=\\\"left-wrapper\\\" style=\\\"width:330px\\\">\r\n <input type=\\\"checkbox\\\" name=\\\"print-checkbox\\\" value=\\\"print-checkbox\\\"\r\n \".$this->checkPrintCondition().\">\r\n <label>Print Repair Order Form/s </label>\r\n\r\n </div>\r\n </div>\r\n\r\n <div class=\\\"input-wrapper\\\">\r\n <div class=\\\"left-wrapper\\\" style=\\\"width:100%\\\">\r\n <input type=\\\"checkbox\\\" name=\\\"ra-checkbox\\\" value=\\\"ra-checkbox\\\" id=\\\"ra-checkbox\\\" \".$this->checkRACondition().\">\r\n <label> Send request for \\\"Return Authorisation Number\\\" now (recommended) </label>\r\n </div>\r\n </div>\r\n </fieldset> \";\r\n }", "function formFooter(){\r\n\r\n\t\t$ret = '</form>';\r\n\r\n\t\treturn $ret;\r\n\t}", "public function finForm(): self\n {\n $this->formCode .= '</form>';\n return $this;\n }", "public function render(): string\n {\n $output = $this->openForm();\n\n foreach($this->options['groups'] as $fieldset_id => $fieldset) {\n if (!empty($fieldset['legend'])) {\n $output .= sprintf('<fieldset id=\"%s\" class=\"%s\">',\n $fieldset_id,\n $fieldset['class'] ?? ''\n );\n $output .= '<legend>'.$fieldset['legend'].'</legend>';\n\n if (!empty($fieldset['description'])) {\n $output .= '<p>'.$fieldset['description'].'</p>';\n }\n }\n\n foreach($fieldset['elements'] as $element_id => $element_info) {\n if (!empty($element_info[1]['belongsTo']))\n $element_id = $element_info[1]['belongsTo'].'_'.$element_id;\n\n if (isset($this->fields[$element_id])) {\n $field = $this->fields[$element_id];\n $output .= $field->render($this->name);\n }\n }\n\n if (!empty($fieldset['legend'])) {\n $output .= '</fieldset>';\n }\n }\n\n $output .= $this->fields[self::CSRF_FIELD_NAME]->render($this->name);\n\n $output .= $this->closeForm();\n return $output;\n }", "public function render()\n {\n $content = \"Ext.create('Ext.form.Panel', {\";\n \n $content .= \"frame: true\";\n \n if ($this->getAction()) {\n $content .= \", url: '\" . $this->getAction() . \"'\";\n }\n \n foreach ($this->getAttribs() as $name => $value) {\n $content .= \", \";\n \n switch ($name) {\n case 'renderTo':\n $content .= \"renderTo: Ext.get('\" . (string)$value . \"')\";\n break;\n case 'height':\n case 'width':\n $content .= $name . \": \" . (int)$value;\n break;\n case 'standardSubmit':\n case 'hidden':\n $content .= $name . \": \" . ((boolean)$value === true ? 'true' : 'false');\n break;\n case 'onEnter':\n $content .= \"listeners: {\n afterRender: function(form, options){\n this.keyNav = Ext.create('Ext.util.KeyNav', this.el, {\n enter: function() {\" . $value . \"},\n scope: this\n });\n }\n }\";\n break;\n case 'defaults':\n $content .= \"defaults: \" . (string)$value;\n break;\n default:\n $content .= $name . \": '\" . htmlspecialchars((string)$value, ENT_QUOTES) . \"'\";\n break;\n }\n }\n \n if (!$this->getAttrib('renderTo')) {\n $content .= \", renderTo: Ext.getBody()\";\n }\n \n $content .= \", items: [\";\n \n if ($this->hasSubForms()) {\n $iterator = new ArrayIterator($this->getSubForms());\n while($iterator->valid()) {\n $subForm = $iterator->current();\n $content .= \"{\";\n \n if ($subForm->getAttrib('width')) {\n $content .= \"width: \" . (int)$subForm->getAttrib('width') . \",\";\n }\n \n $content .= $subForm->render();\n \n $content .= \"}\";\n \n $iterator->next();\n if ($iterator->valid()) {\n $content .= \",\";\n } \n }\n }\n \n if ($this->hasElements()) {\n $iterator = new ArrayIterator($this->getElements());\n while ($iterator->valid()) {\n $element = $iterator->current();\n $content .= $element->render();\n \n $iterator->next();\n if ($iterator->valid()) {\n $content .= \",\";\n }\n }\n }\n\n $content .= \"],\";\n \n $content .= \"buttons: [\";\n \n $iterator = new ArrayIterator($this->getButtons());\n while ($iterator->valid()) {\n $button = $iterator->current();\n \n $content .= $button->render();\n \n $iterator->next();\n \n if ($iterator->valid()) {\n $content .= \",\";\n }\n \n }\n \n $content .= \"]\";\n \n $content .= '});';\n \n return $content;\n }", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $table->add_row($this->element_label($this->getUploadFileLabel()),\r\n $this->element_form($this->getUploadFileLabel())) ;\r\n\r\n $td = html_td(null, null, $this->element_form('Override Z0 Record Validation')) ;\r\n $td->set_tag_attribute('colspan', 2) ;\r\n $table->add_row($td) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }" ]
[ "0.8029879", "0.7985797", "0.7943031", "0.7599915", "0.7370136", "0.73588634", "0.7323223", "0.72862345", "0.72655404", "0.72550696", "0.7203186", "0.7136657", "0.7024562", "0.7005112", "0.69933575", "0.69517636", "0.69491816", "0.6901462", "0.6894805", "0.68864113", "0.68781394", "0.6865276", "0.6858077", "0.68544585", "0.68458426", "0.68135166", "0.6799984", "0.6790872", "0.6771921", "0.6769148", "0.67686236", "0.6753913", "0.6738232", "0.6731289", "0.66962814", "0.66739017", "0.6668323", "0.6638954", "0.6638879", "0.6609426", "0.66034", "0.65853727", "0.65834224", "0.6577277", "0.6575624", "0.6570434", "0.65678746", "0.65660906", "0.65532804", "0.65262043", "0.65166277", "0.6514838", "0.65087354", "0.6498801", "0.649201", "0.64764", "0.64675945", "0.6466401", "0.64636093", "0.64613724", "0.6459144", "0.6456044", "0.6453806", "0.64480156", "0.64461213", "0.6442995", "0.64415354", "0.64389116", "0.64355886", "0.6422988", "0.642297", "0.6420806", "0.641579", "0.6402112", "0.6399181", "0.63984096", "0.63900626", "0.6386008", "0.63852835", "0.63849777", "0.6384549", "0.637456", "0.636751", "0.6366727", "0.63639957", "0.63570905", "0.63483095", "0.6347063", "0.63452524", "0.63432527", "0.6340332", "0.6328246", "0.6327651", "0.63191247", "0.63133186", "0.6312879", "0.6312296", "0.6306049", "0.63036317", "0.63022345", "0.62942684" ]
0.0
-1
If we know the page to return to, we can set the page breadcrumb.
protected static function set_breadcrumb($args) { if (!empty($args['redirect_on_success']) && function_exists('hostsite_set_breadcrumb')) { $breadcrumb = [$args['redirect_on_success'] => 'Terms']; hostsite_set_breadcrumb($breadcrumb); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function breadcrumb_navigation( $page, $ref = array() ){\n\t$breadcrumb = $ref;\n\tif( !count( $breadcrumb ) ){\n\t\tarray_unshift( $breadcrumb, array( $page->post_title ) );\n\t} else {\n\t\tarray_unshift( $breadcrumb, array( $page->post_title, get_permalink( $page->ID ) ) );\n\t}\n\tif( $page->post_parent ){\n\t\tbreadcrumb_navigation( get_page( $page->post_parent ), $breadcrumb );\n\t\treturn;\n\t} else {\n\t\t/// process the breadcrumb\n\t\t$output = '<li class=\"home\"><a href=\"' . get_home_url() . '\">' . __( 'Home', '_supply_ontario' ) . '</a></li>';\n\t\tfor( $q = 0; $q < count( $breadcrumb ); ++$q ){\n\t\t\tif( count( $breadcrumb[$q] ) > 1 ){\n\t\t\t\t$output .= '<li><a href=\"' . $breadcrumb[$q][1] . '\">' . $breadcrumb[$q][0] . '</a></li>';\n\t\t\t} else {\n\t\t\t\t$output .= '<li class=\"current\">' . $breadcrumb[$q][0] . '</li>';\n\t\t\t}\n\t\t}\n\t\techo '<ul class=\"breadcrumb\">' . $output . '</ul>';\n\t}\n}", "function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }", "function ninja_forms_mp_breadcrumb_update_current_page(){\r\n\tglobal $ninja_forms_processing;\r\n\r\n\t$form_id = $ninja_forms_processing->get_form_ID();\r\n\t$nav = '';\r\n\t$all_extras = $ninja_forms_processing->get_all_extras();\r\n\tif( is_array( $all_extras ) AND !empty( $all_extras ) ){\r\n\t\tforeach( $all_extras as $key => $val ){\r\n\t\t\tif( strpos( $key, '_mp_page_' ) !== false ){\r\n\t\t\t\t$nav = str_replace( '_mp_page_', '', $key );\r\n\t\t\t\t$ninja_forms_processing->update_extra_value( '_current_page', $nav );\r\n\t\t\t\t$show = ninja_forms_mp_check_page_conditional( $form_id, $nav );\r\n\t\t\t\tif( !$show ){\r\n\t\t\t\t\t$ninja_forms_processing->update_extra_value( '_prev', 'Previous' );\r\n\t\t\t\t\tninja_forms_mp_nav_update_current_page();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $nav;\r\n}", "public function setBreadcrumb($value)\n {\n $this->breadcrumb = $value;\n }", "abstract protected function setPreviousPage();", "protected function breadcrumbForIndex()\n {\n $breadcrumbTree = new ullPhoneBreadcrumbTree();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "function _get_breadcrumbs($starting_page, $container = array())\n{\n\n //make sure you're working with an object\n $sp = (!is_object($starting_page)) ? get_post($starting_page) : $starting_page;\n\n //make sure to insert starting page only once\n if (!in_array(get_permalink($sp->ID), $container)) {\n $container[get_permalink($sp->ID)] = get_the_title($sp->ID);\n }\n\n //if parent, recursion!\n if ($sp->post_parent > 0) {\n $container[get_permalink($sp->post_parent)] = get_the_title($sp->post_parent);\n $container = _get_breadcrumbs($sp->post_parent, $container);\n }\n\n return $container;\n}", "function BreadCrumb(){}", "function eo_bbpm_get_breadcrumb() {\n}", "function appointment_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Content'), 'admin/content'),\n l(t('Appointment'), 'admin/content/appointment'),\n );\n \n drupal_set_breadcrumb($breadcrumb);\n}", "protected function breadcrumbForList()\n {\n $breadcrumbTree = new ullPhoneBreadcrumbTree();\n $breadcrumbTree->addDefaultListEntry();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "public function setBreadcrumbs()\n {\n static $set = false;\n if ($set == true) {\n return true;\n } else {\n $set = true;\n }\n\n if (JRequest::getCmd('view') != 'root') {\n return true;\n }\n\n $application = JFactory::getApplication();\n $pathway = $application->getPathway();\n $data = $this->getResponseData();\n\n if (!is_array($data)) {\n $data = array();\n }\n\n if (MageBridgeTemplateHelper::isCartPage()) {\n $pathway->addItem(JText::_('COM_MAGEBRIDGE_SHOPPING_CART'), MageBridgeUrlHelper::route('checkout/cart'));\n\n } else if (MageBridgeTemplateHelper::isCheckoutPage()) {\n $pathway->addItem(JText::_('COM_MAGEBRIDGE_SHOPPING_CART'), MageBridgeUrlHelper::route('checkout/cart'));\n $pathway->addItem(JText::_('COM_MAGEBRIDGE_CHECKOUT'), MageBridgeUrlHelper::route('checkout'));\n }\n\n @array_shift($data);\n if (empty($data)) {\n return true;\n }\n\n $pathway_items = array();\n foreach ($pathway->getPathway() as $pathway_item) {\n $pathway_item->link = preg_replace('/\\/$/', '', JURI::root()).JRoute::_($pathway_item->link);\n $pathway_items[] = $pathway_item;\n }\n @array_pop($pathway_items);\n\n foreach ($data as $item) {\n\n // Do not add the current link\n if (MageBridgeUrlHelper::current() == $item['link']) continue;\n\n // Loop through the current pathway-items to prevent double links\n if (!empty($pathway_items)) {\n $match = false;\n foreach ($pathway_items as $pathway_item) {\n if ($pathway_item->link == $item['link']) $match = true;\n }\n if ($match == true) continue;\n }\n\n $pathway_item = (object)null;\n $pathway_item->name = JText::_($item['label']);\n $pathway_item->link = $item['link'];\n $pathway_item->magento = 1;\n $pathway_items[] = $pathway_item;\n\n }\n\n $pathway->setPathway($pathway_items);\n\n return true;\n }", "protected function _generateBreadcrumb()\r\n {\r\n $links = null;\r\n $texthomelink = $this->view->translate('id_menu_home');\r\n // id_title_overseas = 'Overseas Representatives'\r\n $title = $this->view->translate('id_title_overseas');\r\n $links = array(\r\n $texthomelink => $this->view->baseUrl('/'),\r\n $title => '',\r\n );\r\n $this->view->pageTitle = $title;\r\n\r\n Zend_Registry::set('breadcrumb', $links);\r\n }", "public function trail() {\n\n\t\t$breadcrumb = '';\n\t\t$item_count = count( $this->items );\n\t\t$item_position = 0;\n\n\t\tif ( 0 < $item_count ) {\n\n\t\t\tif ( true === $this->args['show_browse'] )\n\t\t\t\t$breadcrumb .= sprintf( '<h2 class=\"trail-browse\">%s</h2>', $this->labels['browse'] );\n\n\t\t\t$breadcrumb .= '<ol class=\"breadcrumb '.$this->args['classes'].'\" itemscope itemtype=\"http://schema.org/BreadcrumbList\">';\n\n\t\t\t$breadcrumb .= sprintf( '<meta name=\"numberOfItems\" content=\"%d\" />', absint( $item_count ) );\n\t\t\t$breadcrumb .= '<meta name=\"itemListOrder\" content=\"Ascending\" />';\n\n\t\t\tforeach ( $this->items as $item ) {\n\n\t\t\t\t++$item_position;\n\n\t\t\t\tpreg_match( '/(<a.*?>)(.*?)(<\\/a>)/i', $item, $matches );\n\n\t\t\t\t$item = !empty( $matches ) ? sprintf( '%s<span itemprop=\"name\">%s</span>%s', $matches[1], $matches[2], $matches[3] ) : sprintf( '<span itemprop=\"name\">%s</span>', $item );\n\n\t\t\t\t$item_class = 'breadcrumb-item';\n\n\t\t\t\tif ( $item_count === $item_position )\n\t\t\t\t\t$item_class .= ' active';\n\n\t\t\t\t$attributes = 'itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\" class=\"' . $item_class . '\"';\n\n\t\t\t\t$meta = sprintf( '<meta itemprop=\"position\" content=\"%s\" />', absint( $item_position ) );\n\n\t\t\t\t$breadcrumb .= sprintf( '<li %s>%s%s</li>', $attributes, $item, $meta );\n\t\t\t}\n\n\t\t\t$breadcrumb .= '</ol>';\n\n\t\t\t$breadcrumb = sprintf(\n\t\t\t\t'<%1$s role=\"navigation\" aria-label=\"%2$s\" class=\"breadcrumbs\" itemprop=\"breadcrumb\">%3$s%4$s%5$s</%1$s>',\n\t\t\t\ttag_escape( $this->args['container'] ),\n\t\t\t\tesc_attr( $this->labels['aria_label'] ),\n\t\t\t\t$this->args['before'],\n\t\t\t\t$breadcrumb,\n\t\t\t\t$this->args['after']\n\t\t\t);\n\t\t}\n\n\t\tif ( false === $this->args['echo'] )\n\t\t\treturn $breadcrumb;\n\n\t\techo $breadcrumb;\n\t}", "function thumbwhere_contentcollection_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollection'), 'admin/content'),\n l(t('ContentCollection'), 'admin/thumbwhere/thumbwhere_contentcollections'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function thumbwhere_contentcollectionitem_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollectionItem'), 'admin/content'),\n l(t('ContentCollectionItem'), 'admin/thumbwhere/thumbwhere_contentcollectionitems'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function tac_override_yoast_breadcrumb_trail( $links ) {\n global $post;\n\n if ( is_home() || is_singular( 'post' ) || is_archive() ) :\n\n \tif ( 'event' == get_post_type() ) :\n\n\t $breadcrumb[] = array(\n\t 'url' => get_permalink( get_post_type_archive_link( 'event' ) ),\n\t 'text' => 'Our Events',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\n\t elseif ( 'course' == get_post_type() ) :\n\n\t \t$breadcrumb[] = array(\n\t 'url' => get_permalink( get_post_type_archive_link( 'course' ) ),\n\t 'text' => 'Our Learning',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\n\t else :\n\n\t \t\t$breadcrumb[] = array(\n\t 'url' => get_permalink( get_option( 'page_for_posts' ) ),\n\t 'text' => 'Our Series',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\t endif;\n endif;\n\n return $links;\n}", "function vodi_toggle_page_breadcrumb( $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_breadcrumb'] ) && $page_meta_values['hide_breadcrumb'] == '1' ) {\n $show = false;\n }\n } elseif( vodi_is_masvideos_activated() && is_videos() ) {\n if( is_search() ) {\n $show = false;\n }\n } elseif ( vodi_is_masvideos_activated() && is_tv_shows() ) {\n if( is_search() ) {\n $show = false;\n }\n } elseif ( vodi_is_masvideos_activated() && is_movies() ) {\n if( is_search() ) {\n $show = false;\n }\n }\n\n return $show;\n }", "public function getBreadCrumbs($page){\n\t\tif(substr($page, -3) == \" VN\"){\n\t\t\t$query = \"[[$page]]|?\".MODELLINKPROPERTY;\n\t\t\t$result = $this->askAPI->ask($query);\n\t\t\t$page = $result['query']['results'][$page]['printouts'][MODELLINKPROPERTY][0]['fulltext'];\n\t\t}\n\t\t\n\t\tif(!$page)\n\t\t\treturn;\t//if page is empty or not set, quit.\n\t\t\n\t\t//create empty trailset\n\t\t$trailset=array();\n\t\t\n\t\t//fill trailset\n\t\t$this->getTrails( array( new Node($page, false) ), $trailset);\n\t\t\n\t\t//extract the bread crumb trails from the trails found\n\t\tforeach($trailset as $trail){\n\t\t\t$bcTrail = array();\t\t\t\t\t\t\t\t\t\t\t//start with an empty array!\n\t\t\tforeach($trail as $node){\n\t\t\t\t$bc = $node->getBreadCrumb();\t\t\t\t\t\t\t//NB bc may be an array\n\t\t\t\tif( is_array($bc) )\n\t\t\t\t\t$bc = $bc[0];\t//assume there is only one! FIXME?: use all? -But a practice always has at most one context\n\t\t\t\tif(is_a($bc, \"Node\") && $bc->getUrl()){\t\t\t\t\t//the starting $node has value false for url (see getTrails call a few lines above) \n\t\t\t\t\t$name = $bc->getName();\n\t\t\t\t\t$url = $bc->getUrl();\n\n\t\t\t\t\t//change to VN url if available\n\t\t\t\t\t$query = \"[[\".MODELLINKPROPERTY.\"::$name]]\";\t\t//get all (VN) pages that refer to this page through MODELLINK\n\t\t\t\t\t$result = $this->askAPI->ask($query);\t\t\t\t//check with code Thijs (search engine, how VN's are found)\n\t\t\t\t\t$result = array_pop($result['query']['results']);\t//assume there is only one (always take first VN page found)\n\t\t\t\t\tif($result){\n\t\t\t\t\t\t$url = $result['fullurl'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Change name to 'heading <lng>' property value, if available\n\t\t\t\t\t//FIXME: this is duplicate code, from function setPagetitle() in helper.php \n\t\t\t\t\t//Mooiere oplossing: zie todo regel 12 helper.php: elke link die de skin laat zien moet door het page naming algorithm worden gehaald\n\t\t\t\t\t$langCode=\"NL\";\n\t\t\t\t\t$page = $name;\n\t\t\t\t\t$parheadpluslang = PARHEADINGPROPERTY.strtolower($langCode);\n\t\t\t\t\t$query = \"[[\".$page.\"]]|?\".$parheadpluslang; \t//get value(s!) of heading property on page $pagename\n\t\t\t\t\t$result = APIAsker::getInstance()->ask($query);\n\t\t\t\t\t$result = array_shift($result['query']['results']);\n\t\t\t\t\t$paragraphHeading = $result['printouts'][$parheadpluslang][0];\n\t\t\t\t\tif($paragraphHeading)\n\t\t\t\t\t\t$name = $paragraphHeading;\n\t\t\t\t\t\n\t\t\t\t\t$bcTrail[$name] = $url;\t\t\t\t\t\t\t\t//this eliminates doubles in the bcTrail! That's a good thing!\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( !in_array(array_reverse($bcTrail), $bcTrailSet) )\n\t\t\t\t$bcTrailSet[] = array_reverse($bcTrail);\n\t\t}\n\n\t\t/*FIXME/TODO some thoughts:\n\t\t- l. {$bcTrail[$name] = $url;} eliminates doubles in $bcTrail (by page name): however: structures with doubles are wrong models? Notification of this?\n\t\t- l. is_a() needed because of Ontwerpen van een kleidijk (Activity), see textEdit, $bc may still contain: \"practice\"\n\t\t- l. {$bcTrail = array();} is very important: start looping over nodes with an empty array!\n\t\t- this code may also result in empty arrays $bcTrail in $bcTrailSet... (e.g. Building_with_Nature_interventies_VN)\n\t\t- also tested with (incl VN): Delta-ecosysteem, Ameland, Waterkering, Zeeweringen_Begrippen_VN\n\t\t- VN checking of links should be done automatically and generally for all links by the skin (i.e. for search results too, etc?)\n\t\t- page naming algorithm should be used for linklabels too\n\t\t- prevent doubles in the trailset bij the finishing if(!array())...?\n\t\t- Moet er nog in volgens bauke: broader en part-of - Duinsuppletie - hans? for now: used SKOSEMBROADER property, see getNodeParents()\n\t\t- ...\n\t\t*/\n\t\t\n\t\treturn $bcTrailSet;\n\t}", "function setBreadCrumb($bcObjArr){\n\t\t$this->title=$bcObjArr['title'];\n\t\t$this->url=$bcObjArr['url'];\n\t\t$this->isRoot=$bcObjArr['isRoot'];\n\n\t\t$CI =& get_Instance();\n\t\t$CI->breadcrumblist->add($this);\n\t\t$_SESSION['breadCrumbList'] = $CI->breadcrumblist->getBreadCrumbs();\n\t}", "protected function prepareCrumbs(){\n $crumbs = $this->_crumbs;\n $_helper = Mage::helper('rulletka/breadcrumbs');\n if($_helper->isItProductPage() /*&& !$_helper->hasCurrentCategory()*/){\n $catPath = $_helper->getCategoryPath();\n foreach($crumbs as $_crumbName => $_crumbInfo){\n if(strstr($_crumbName, 'product')){\n unset($crumbs[$_crumbName]);\n }\n }\n $crumbs += $catPath;\n }\n $this->_crumbs = $crumbs;\n }", "function breadcrumbs(): void\n{\n\tif (function_exists('yoast_breadcrumb')) {\n\t\tyoast_breadcrumb(\n\t\t\t'<nav aria-label=\"You are here:\" role=\"navigation\" xmlns:v=\"http://rdf.data-vocabulary.org/#\">\n\t\t\t\t<ul class=\"breadcrumbs\">',\n\t\t\t'</ul></nav>'\n\t\t);\n\t}\n}", "function the_breadcrumb() {\n\tif (!is_home()) {\n\t\techo '<span title=\"';\n\t\techo get_option('home');\n\t echo '\">';\n\t\tbloginfo('name');\n\t\techo \"</span> » \";\n\t\tif (is_page_template()) {\n\t\t\t\techo \" » \";\n echo the_title();\n\n \n \t\n\t\t} elseif (is_single()) {\n\t\t\techo the_title();\n\t\t}\n\t}\n}", "protected function _initBreadcrumb(){\r\n\n\t\t$layout = $this->bootstrap('layout')->getResource('layout');\r\n\t\t$view = $layout->getView();\r\n\t\t$config = new Zend_Config(require APPLICATION_PATH.'/configs/navigationShop.php');\r\n\t\t$navigation = new Zend_Navigation();\n\t\t$view->navigation($navigation);\r\n\t\t$navigation->addPage($config);\n\t\tZend_Registry::set('navigation',$navigation);\n\t}", "function x_breadcrumbs() {\n\n\tif ( x_get_option( 'x_breadcrumb_display', '1' ) ) {\n\n\t GLOBAL $post;\n\n\t $is_ltr = ! is_rtl();\n\t $stack = x_get_stack();\n\t $delimiter = x_get_breadcrumb_delimiter();\n\t $home_text = x_get_breadcrumb_home_text();\n\t $home_link = home_url();\n\t $current_before = x_get_breadcrumb_current_before();\n\t $current_after = x_get_breadcrumb_current_after();\n\t $page_title = get_the_title();\n\t $blog_title = get_the_title( get_option( 'page_for_posts', true ) );\n\n\t if ( ! is_404() ) {\n\t\t$post_parent = $post->post_parent;\n\t } else {\n\t\t$post_parent = '';\n\t }\n\n\t if ( X_WOOCOMMERCE_IS_ACTIVE ) {\n\t\t//$shop_url = x_get_shop_link();\n\t\t$shop_url = home_url() . 'products';\n\t\t$shop_title = x_get_option( 'x_' . $stack . '_shop_title', __( 'The Shop', '__x__' ) );\n\t\t$shop_link = '<a href=\"'. $shop_url .'\">' . $shop_title . '</a>';\n\t }\n\n\t echo '<div class=\"x-breadcrumbs\"><a href=\"' . $home_link . '\">' . $home_text . '</a>' . $delimiter;\n\n\t\tif ( is_home() ) {\n\n\t\t echo $current_before . $blog_title . $current_after;\n\n\t\t} elseif ( is_category() ) {\n\n\t\t $the_cat = get_category( get_query_var( 'cat' ), false );\n\t\t if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\n\t\t} elseif ( x_is_product_category() ) {\n\t\t\n\t\t $the_cat = get_queried_object();\n\t\t if ( $the_cat->parent != 0 ) echo x_get_taxonomy_parents( $the_cat->parent, $the_cat->taxonomy, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\t\t\n\t\t /*\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t */\n\t\t\n\t\t} elseif ( x_is_product_tag() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\n\t\t} elseif ( is_search() ) {\n\n\t\t echo $current_before . __( 'Search Results for ', '__x__' ) . '&#8220;' . get_search_query() . '&#8221;' . $current_after;\n\n\t\t} elseif ( is_singular( 'post' ) ) {\n\n\t\t if ( get_option( 'page_for_posts' ) == is_front_page() ) {\n\t\t\techo $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\tif ( $is_ltr ) {\n\t\t\t echo '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t\t} else {\n\t\t\t echo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>';\n\t\t\t}\n\t\t }\n\n\t\t} elseif ( x_is_portfolio() ) {\n\n\t\t echo $current_before . get_the_title() . $current_after;\n\n\t\t} elseif ( x_is_portfolio_item() ) {\n\n\t\t $link = x_get_parent_portfolio_link();\n\t\t $title = x_get_parent_portfolio_title();\n\n\t\t if ( $is_ltr ) {\n\t\t\techo '<a href=\"' . $link . '\">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . $link . '\">' . $title . '</a>';\n\t\t }\n\n\t\t} elseif ( x_is_product() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t \n\t\t} elseif ( x_is_buddypress() ) {\n\n\t\t if ( bp_is_group() ) {\n\t\t\techo '<a href=\"' . bp_get_groups_directory_permalink() . '\">' . x_get_option( 'x_buddypress_groups_title', __( 'Groups', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } elseif ( bp_is_user() ) {\n\t\t\techo '<a href=\"' . bp_get_members_directory_permalink() . '\">' . x_get_option( 'x_buddypress_members_title', __( 'Members', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } else {\n\t\t\techo $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t }\n\n\t\t} elseif ( x_is_bbpress() ) {\n\n\t\t remove_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t if ( bbp_is_forum_archive() ) {\n\t\t\techo $current_before . bbp_get_forum_archive_title() . $current_after;\n\t\t } else {\n\t\t\techo bbp_get_breadcrumb();\n\t\t }\n\n\t\t add_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t} elseif ( is_page() && ! $post_parent ) {\n\n\t\t echo $current_before . $page_title . $current_after;\n\n\t\t} elseif ( is_page() && $post_parent ) {\n\n\t\t $parent_id = $post_parent;\n\t\t $breadcrumbs = array();\n\n\t\t if ( is_rtl() ) {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter;\n\t\t }\n\n\t\t while ( $parent_id ) {\n\t\t\t$page = get_page( $parent_id );\n\t\t\t$breadcrumbs[] = '<a href=\"' . get_permalink( $page->ID ) . '\">' . get_the_title( $page->ID ) . '</a>';\n\t\t\t$parent_id = $page->post_parent;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\t$breadcrumbs = array_reverse( $breadcrumbs );\n\t\t }\n\n\t\t for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {\n\t\t\techo $breadcrumbs[$i];\n\t\t\tif ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $delimiter . $current_before . $page_title . $current_after;\n\t\t }\n\n\t\t} elseif ( is_tag() ) {\n\n\t\t echo $current_before . single_tag_title( '', false ) . $current_after;\n\n\t\t} elseif ( is_author() ) {\n\n\t\t GLOBAL $author;\n\t\t $userdata = get_userdata( $author );\n\t\t echo $current_before . __( 'Posts by ', '__x__' ) . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';\n\n\t\t} elseif ( is_404() ) {\n\n\t\t echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;\n\n\t\t} elseif ( is_archive() ) {\n\n\t\t if ( x_is_shop() ) {\n\t\t\techo $current_before . $shop_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . __( 'Archives ', '__x__' ) . $current_after;\n\t\t }\n\n\t\t}\n\n\t echo '</div>';\n\n\t}\n}", "public function getBreadcrumb()\n {\n return $this->breadcrumb;\n }", "function thumbwhere_host_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Host'), 'admin/content'),\n l(t('Host'), 'admin/thumbwhere/thumbwhere_hosts'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "protected function markBreadcrumb($node)\r\n {\r\n if(!$node) {\r\n return false;\r\n }\r\n while ($parent = $node->getParent()) {\r\n $parent->is_in_trail = true;\r\n $node = $parent;\r\n }\r\n }", "public function get_navigation_breadcrumbs() {\n if (empty($this->navigation_breadcrumbs)) {\n $nazev_seo = Hana_Application::instance()->get_actual_seo();\n $breadcrumbs_part = array();\n $leaf_module = Hana_Application::instance()->get_main_controller();\n\n if ($leaf_module != \"page\") {\n\n $service = \"Service_\" . ucfirst($leaf_module);\n try {\n $breadcrumbs_part = $service::get_navigation_breadcrumbs($nazev_seo);\n } catch (Exception $exc) {\n throw new Kohana_Exception(\"Chyba v systému navigace - v servise \" . $service . \" chybí metoda \\\"get_navigation_breadcrumbs\\\", nebo je chybná:\" . $exc);\n }\n\n if (!empty($breadcrumbs_part)) {\n\n $temp = $breadcrumbs_part;\n $linked_breadcrumb = array_pop($temp);\n if (isset($linked_breadcrumb[\"parent_nazev_seo\"]))\n $nazev_seo = $linked_breadcrumb[\"parent_nazev_seo\"];\n }\n }\n\n if ($nazev_seo && $nazev_seo != I18n::get(\"index\")) {\n $this->navigation_breadcrumbs = array_merge($breadcrumbs_part, Service_Page::get_navigation_breadcrumbs($nazev_seo));\n } else {\n $this->navigation_breadcrumbs = $breadcrumbs_part;\n }\n }\n //die(print_r($this->navigation_breadcrumbs));\n return $this->navigation_breadcrumbs;\n }", "function rella_breadcrumb( $args = array() ) {\n\n\t$breadcrumb = new Rella_Breadcrumb( $args );\n\n\treturn $breadcrumb->trail();\n}", "public function setCurrentPage( $page );", "public function init() {\n\t\tif ($this->breadState <= 0 ) unset($_SESSION['breadcrumb']);\n\t\tif ($this->breadState >= 0) {\n\t\t\t// Recupère le tableau en session\n\t\t\t$this->breadcrumb = isset($_SESSION['breadcrumb'])?$_SESSION['breadcrumb']:[];\n\t\t\tif (($posKey = $this->hasBread($this->breadKey)) === false) {\n\t\t\t\t$i = count($this->breadcrumb);\n\t\t\t\t$this->breadcrumb[$i]['title'] = $this->breadKey;\n\t\t\t\t$this->breadcrumb[$i]['url'] = $_SERVER['REQUEST_URI'];\n\t\t\t}else{\n\t\t\t\t$this->breadcrumb = array_splice($this->breadcrumb,0, $posKey+1);\n\t\t\t}\n\n\t\t\t//$posKey = array_search($this->breadKey, array_keys($this->breadcrumb))+1;\n\t\t\t//\n\t\t\t$_SESSION['breadcrumb'] = $this->breadcrumb;\n\t\t}\n\t}", "private function add_breadcrumbs() {\n\t\tif ( is_front_page() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->context->breadcrumbs_enabled ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function getBreadcrumbs();", "private function back(){\n \t$params = array(\n \t\t\t'page'=>intval(I('p')) ? intval(I('p')) : 1,\n \t\t\t'pagesize'=>$this->pagesize,\n \t\t\t'type'=>Status::AfterSaleBack,\n \t);\n \tif (session('distributor_id')) {\n \t\t$params['distributor_id'] = session('distributor_id');\n \t}\n \t$result = $this->afterSalesService()->getPagerList($params);\n \t$this->assign('back_list', $result['list']);\n }", "public function getBreadcrumb() \r\n {\r\n if(!empty($this->_current_cms_seo)) {\r\n return isset($this->_current_cms_seo['breadcrumb']) ? $this->_current_cms_seo['breadcrumb'] : '';\r\n }\r\n }", "function wiki_breadcrumbs($chain, $current_title = null, $final_link = false, $links = true, $this_link_virtual_root = false)\n{\n $segments = array();\n $token = strtok($chain, '/');\n $rebuild_chain = '';\n while ($token !== false) {\n $next_token = strtok('/');\n\n if ($rebuild_chain != '') {\n $rebuild_chain .= '/';\n }\n $rebuild_chain .= $token;\n\n $link_id = ($this_link_virtual_root && ($next_token === false)) ? $token : $rebuild_chain;\n\n if (is_numeric($token)) {\n $id = intval($token);\n } else {\n $url_moniker_where = array('m_resource_page' => 'wiki', 'm_moniker' => $token);\n $_id = $GLOBALS['SITE_DB']->query_select_value_if_there('url_id_monikers', 'm_resource_id', $url_moniker_where);\n if ($_id === null) {\n return array();\n }\n $id = intval($_id);\n }\n\n $page_link = build_page_link(array('page' => 'wiki', 'type' => 'browse', 'id' => $link_id) + (($this_link_virtual_root && ($next_token === false)) ? array('keep_wiki_root' => $id) : array()), get_module_zone('wiki'));\n\n if ($next_token !== false) { // If not the last token (i.e. not the current page)\n $title = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $id));\n if (is_null($title)) {\n continue;\n }\n $token_title = get_translated_text($title);\n $segments[] = $links ? array($page_link, $token_title) : array('', $token_title);\n } else {\n if (is_null($current_title)) {\n $_current_title = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $id));\n $current_title = is_null($_current_title) ? do_lang('MISSING_RESOURCE', 'wiki_page') : get_translated_text($_current_title);\n }\n if ($final_link) {\n $segments[] = array($page_link, $current_title);\n } else {\n $segments[] = array('', $current_title);\n }\n }\n\n $token = $next_token;\n }\n\n return $segments;\n}", "private function prepend($page='', $href='') {\n // no crumb provided\n if (!$page || !$href) {\n // add home page\n $page = lang('home');\n $href = base_url() . $this->lang;\n $this->breadcrumbs[$href] = array('page' => $page, 'href' => $href);\n \n return;\n }\n\n // Prepend site url\n $href .= $this->lang . '/' . $href;\n $href = site_url($href);\n\n // add at firts\n array_unshift($this->breadcrumbs[$href], array('page' => $page, 'href' => $href));\n }", "function the_breadcrumb() {\n global $post;\n echo '<ol class=\"breadcrumb\">';\n if (!is_home()) {\n echo '<li><a href=\"';\n echo get_option('home');\n echo '\">';\n echo 'Home';\n echo '</a></li>';\n if (is_category() || is_single()) {\n echo '<li>';\n the_category('</li><li> ');\n if (is_single()) {\n echo '</li><li>';\n the_title();\n echo '</li>';\n }\n } elseif (is_page()) {\n if($post->post_parent){\n $anc = get_post_ancestors( $post->ID );\n $title = get_the_title();\n foreach ( $anc as $ancestor ) {\n $output = '<li><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>';\n }\n echo $output;\n echo '<strong title=\"'.$title.'\"> '.$title.'</strong>';\n } else {\n echo '<li><strong>'.get_the_title().'</strong></li>';\n }\n }\n }\n elseif (is_tag()) {single_tag_title();}\n elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n echo '</ol>';\n}", "function dimox_breadcrumbs() {\n\t\t$text['home'] = 'Home'; // text for the 'Home' link\n\t\t$text['category'] = '%s'; // text for a category page\n\t\t$text['search'] = 'Wyniki wyszukiwania dla \"%s\"'; // text for a search results page\n\t\t$text['404'] = 'Błąd 404'; // text for the 404 page\n\t\t$text['page'] = '%s'; // text 'Page N'\n\t\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\t\t$wrap_before = '<div class=\"breadcrumbs\" itemscope itemtype=\"htt://schema.org/BreadCrumbList\">'; // the opening wrapper tag\n\t\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t\t$sep = '›'; // separator between crumbs\n\t\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t\t$sep_after = '</span>'; // tag after separator\n\t\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t\t$show_on_home = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t\t$after = '</span>'; // tag after the current crumb\n\t\t/* === END OF OPTIONS === */\n\t\tglobal $post;\n\t\t$home_link = home_url('/');\n\t\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t\t$link_after = '</span>';\n\t\t$link_attr = ' itemprop=\"url\"';\n\t\t$link_in_before = '<span itemprop=\"title\">';\n\t\t$link_in_after = '</span>';\n\t\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t\t$frontpage_id = get_option('page_on_front');\n\t\t$parent_id = $post->post_parent;\n\t\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\t\tif (is_home() || is_front_page()) {\n\t\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>' . $wrap_after;\n\t\t} else {\n\t\t\techo $wrap_before;\n\t\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\t\t\tif ( is_category() ) {\n\t\t\t\t$cat = get_category(get_query_var('cat'), false);\n\t\t\t\tif ($cat->parent != 0) {\n\t\t\t\t\t$cats = get_category_parents($cat->parent, TRUE, $sep);\n\t\t\t\t\t$cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $cats;\n\t\t\t\t}\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\t$cat = $cat->cat_ID;\n\t\t\t\t\techo $sep . sprintf($link, get_category_link($cat), get_cat_name($cat)) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . sprintf($text['category'], single_cat_title('', false)) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_search() ) {\n\t\t\t\tif (have_posts()) {\n\t\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\t\tif ($show_current) echo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\t\tprintf($link, $home_link . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t\t} else {\n\t\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\techo $cats;\n\t\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\t\techo $sep . sprintf($link, get_permalink(), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t// custom post type\n\t\t\t} elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\techo $sep . sprintf($link, get_post_type_archive_link($post_type->name), $post_type->label) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . $post_type->label . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_page() && !$parent_id ) {\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t$breadcrumbs = array();\n\t\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, get_permalink($page->ID), get_the_title($page->ID));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t\t}\n\t\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_404() ) {\n\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\t\t\t} elseif ( has_post_format() && !is_singular() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\techo get_post_format_string( get_post_format() );\n\t\t\t}\n\t\t\techo $wrap_after;\n\t\t}\n\t}", "function gwt_drupal_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n $output = '';\n\n // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('gwt_drupal_breadcrumb');\n if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('gwt_drupal_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $breadcrumb_separator = filter_xss_admin(theme_get_setting('gwt_drupal_breadcrumb_separator'));\n $trailing_separator = $title = '';\n if (theme_get_setting('gwt_drupal_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $breadcrumb[] = check_plain($item['title']);\n }\n else {\n $breadcrumb[] = drupal_get_title();\n }\n }\n elseif (theme_get_setting('gwt_drupal_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users.\n if (empty($variables['title'])) {\n $variables['title'] = t('You are here');\n }\n $variables['title_attributes_array']['class'][] = 'breadcrumbs-here-label';\n\n // Build the breadcrumb trail.\n $output = '<nav role=\"navigation\">';\n $output .= '<ol class=\"breadcrumbs\">'.\n '<li'.drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . ':</li>'.\n '<li>' . implode('</li>'.\n '<li>', $breadcrumb) . '</li>'.\n '</ol>';\n $output .= '</nav>';\n }\n }\n\n return $output;\n}", "function opensky_islandora_breadcrumbs_alter(&$data, $context) {\n // only make change if there is a collection param\n if (!isset($_GET['collection'])) {\n return;\n }\n $collection = $_GET['collection'];\n\n // Look for the collection_breadcrumb - it has a \"collection-crumb\" class so\n // we just look for that string\n foreach ($data as $crumb) {\n if (strpos($crumb, 'collection-crumb') !== false) {\n // our work is done - we've already added the collection breadcrumb\n return;\n }\n }\n $collection_breadcrumb = opensky_collection_breadcrumb($_GET);\n\n // splice it into existing breadcrums\n array_splice ($data, 1, 0, $collection_breadcrumb);\n}", "function breadcrumbs(){\n global $post;\n $seperator = \"/\";\n $home = \"Home\";\n \n echo \"<ul class='breadcrumbs'>\";\n echo \"<li>You are here: </li>\";\n \n if(is_front_page()){\n echo \"<li>\" . $home . \"</li>\";\n }else{\n echo \"<li><a href=\" . get_site_url() . \">\" . $home . \"</a></li>\";\n }\n \n if(is_home() || is_single()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(is_home()){\n echo \"<li>Recipe</li>\";\n }else {\n echo \"<li><a href=\" . get_post_type_archive_link('post') . \">Shop</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n }\n \n if(is_page() && !is_front_page()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(!empty($post->post_parent)){\n echo \"<li>\";\n echo \"<a href=\" . get_permalink($post->post_parent). \">\";\n echo get_the_title($post->post_parent);\n echo \"</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n }\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n \n echo \"</ul>\";\n }", "function breadcrumb()\r\n\t{\r\n\t\t$breadcrumbs = array();\r\n\t\tpr($this->Link);\r\n\t\t//$cLink = ClassRegistry::init('JavanLink');pr($cLink);\r\n\t\t//$conditions = array(\"controller\"=>$this->info['controller'], \"action\"=>$this->info['action']);\r\n\t\t//$link = $cLink->find(\"first\", array(\"conditions\"=>$conditions, \"recursive\"=>-1));\r\n\t\t//if(!$link){\r\n\t\t//\t//trigger_error(__('Alamat yang Anda akses tidak terdaftar.', true), E_USER_WARNING);\r\n\t\t//\treturn false ;\r\n\t\t//}else{\r\n\t\t//\t$breadcrumbs = $cLink->getpath($link['Link']['id']);\r\n\t\t//}\r\n\t\treturn $breadcrumbs;\r\n\t}", "function wcc_change_breadcrumb_home_text( $defaults ) {\n\t$defaults['home'] = 'HankArt';\n\treturn $defaults;\n}", "function buildBreadCrumbs(&$pageInformationArray){\n //This Function builds the breadcrumbs on every page except the home page\n if (!(Count($pageInformationArray) > 0)){\n return;\n } ?>\n\n <div class=\"breadcrumbs\">\n <div class=\"container\">\n <ol class=\"breadcrumb breadcrumb1 animated wow slideInLeft animated\" data-wow-delay=\".5s\" style=\"visibility: visible; animation-delay: 0.5s; animation-name: slideInLeft;\">\n <li><a href=\"index.php\"><span class=\"glyphicon glyphicon-home\" aria-hidden=\"true\"></span>Home</a></li>\n<?php //Loop through array passed in which will create the multiple breadcrumbs\n for($index = 0; $index < Count($pageInformationArray); $index++){\n if( $index < (Count($pageInformationArray) - 1)){ ?>\n <li><a href=\"<?php echo $pageInformationArray[$index][0];?>\"><?php echo $pageInformationArray[$index][1];?></a></li>\n <?php } else{ ?>\n <li class=\"active\"><?php echo $pageInformationArray[$index][1];?></li>\n <?php } \n } ?>\n </ol>\n </div>\n </div>\n<?php }", "public static function breadcrumbs() {\n\t\tif(!self::has_breadcrumbs()) return;\n\t\t?>\n\t\t\t<h6 id=\"header-breadcrumbs\">\n\t\t\t\t<?php dimox_breadcrumbs('&middot;') ?>\n\t\t\t</h6>\n\t\t<?php\n\t}", "function atwork_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb']; // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('atwork_breadcrumb');\n if ($show_breadcrumb == 'yes' || ($show_breadcrumb == 'admin' && arg(0) == 'admin')) {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('atwork_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $breadcrumb_separator = theme_get_setting('atwork_breadcrumb_separator');\n $trailing_separator = $title = '';\n if (theme_get_setting('atwork_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $title = check_plain($item['title']);\n }\n else {\n $title = drupal_get_title();\n }\n if ($title) {\n $trailing_separator = $breadcrumb_separator;\n }\n }\n elseif (theme_get_setting('atwork_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n return '<h2 class=\"breadcrumb\">' . implode($breadcrumb_separator, $breadcrumb) . $trailing_separator . $title . '</h2>';\n }\n }\n // Otherwise, return an empty string.\n return '';\n}", "protected function registerBreadCrumb()\n {\n BreadcrumbFacade::make('admin.review.index', function ($breadcrumbs) {\n $breadcrumbs->label('Review')\n ->parent('admin.dashboard');\n });\n }", "function apoc_breadcrumbs( $args = array() ) {\n\t$crumbs = new Apoc_Breadcrumbs( $args );\n\techo $crumbs->crumbs;\n}", "function Steps_prepare_parent_breadcrumbs($Step) {\n\tif ($Step && $Step->parent_guid) {\n\t\t$parents = array();\n\t\t$parent = get_entity($Step->parent_guid);\n\t\twhile ($parent) {\n\t\t\tarray_push($parents, $parent);\n\t\t\t$parent = get_entity($parent->parent_guid);\n\t\t}\n\t\twhile ($parents) {\n\t\t\t$parent = array_pop($parents);\n\t\t\telgg_push_breadcrumb($parent->title, $parent->getURL());\n\t\t}\n\t}\n}", "function simple_pages_display_breadcrumbs($pageId = null, $seperator=' > ', $includePage=true)\n{\n $html = '';\n\n if ($pageId === null) {\n $page = get_current_record('simple_pages_page', false);\n } else {\n $page = get_db()->getTable('SimplePagesPage')->find($pageId);\n }\n\n if ($page) {\n $ancestorPages = get_db()->getTable('SimplePagesPage')->findAncestorPages($page->id);\n $bPages = array_merge(array($page), $ancestorPages);\n\n // make sure all of the ancestors and the current page are published\n foreach($bPages as $bPage) {\n if (!$bPage->is_published) {\n $html = '';\n return $html;\n }\n }\n\n // find the page links\n $pageLinks = array();\n foreach($bPages as $bPage) {\n if ($bPage->id == $page->id) {\n if ($includePage) {\n $pageLinks[] = html_escape($bPage->title);\n }\n } else {\n $pageLinks[] = '<a href=\"' . public_url($bPage->slug) . '\">' . html_escape($bPage->title) . '</a>';\n }\n }\n $pageLinks[] = '<a href=\"'. public_url('') . '\">' . __('Home') . '</a>';\n\n // create the bread crumb\n $html .= implode(html_escape($seperator), array_reverse($pageLinks));\n }\n return $html;\n}", "function mpcth_display_breadcrumb() {\r\n\tglobal $post;\r\n\t$id = $post->ID;\r\n\t$return = '<a href=\"/\">' . __('Home', 'mpcth') . '</a>';\r\n\r\n\tif(is_front_page()) {\r\n\t\t// do nothing\r\n\t} elseif(is_page()) {\r\n\t\t$page = get_post($id);\r\n\r\n\t\t$parent_pages = array();\r\n\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> ' . $page->post_title . \"\\n\";\r\n\r\n\t\twhile ($page->post_parent) {\r\n\t\t\t$page = get_post($page->post_parent);\r\n\t\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_permalink($page->ID) . '\">' . $page->post_title . '</a>';\r\n\t\t}\r\n\r\n\t\t$parent_pages = array_reverse($parent_pages);\r\n\r\n\t\tforeach ($parent_pages as $parent) {\r\n\t\t\t$return .= $parent;\r\n\t\t}\r\n\t} elseif(is_single()) {\r\n\t\tif($post->post_type == 'post') {\r\n\t\t\t$category = get_the_category($id);\r\n\r\n\t\t\tif(!empty($category)){\r\n\t\t\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data, 0, -strlen(' <span class=\"mpcth-header-devider\">/</span> '));\r\n\t\t\t}\r\n\t\t} elseif($post->post_type == 'portfolio') {\r\n\t\t\t$terms = get_the_terms($id, 'mpcth_portfolio_category');\r\n\t\t\t\r\n\t\t\tif(!empty($terms)){\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ';\r\n\r\n\t\t\t\tforeach ($terms as $term) {\r\n\t\t\t\t\t$return .= ' <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($term !== end($terms))\r\n\t\t\t\t\t\t$return .= ', ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . $post->post_title . \"\\n\";\r\n\t} elseif(is_category()) {\r\n\t\t$category = get_the_category($id);\r\n\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\r\n\t\tif(!empty($category)){\r\n\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data,0,-8);\r\n\t\t}\r\n\t} elseif(is_tax()) {\r\n\t\t$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t}\r\n\r\n\treturn $return;\r\n}", "public function setFoundPage($value) { $this->_foundpage = $value; }", "function protik_process_page(&$variables) {\n // Hook into color.module.\n if (module_exists('color')) {\n _color_page_alter($variables);\n }\n\n // get rid of breadcrumbs\n $variables['breadcrumb'] = FALSE;\n}", "function the_breadcrumb() {\r\n\tif (!is_home()) {\r\n\t\techo '<div class=\"breadcrumb\"><a href=\"';\r\n\t\techo get_option('home');\r\n\t\techo '\">'.__('Home','templatic');\r\n\t\techo \"</a>\";\r\n\t\tif (is_category() || is_single() || is_archive()) {\r\n\t\t\tthe_category('title_li=');\r\n\t\t\tif(is_archive())\r\n\t\t\t{\t\t\r\n\t\t\t\techo \" » \";\r\n\t\t\t\tsingle_cat_title();\r\n\t\t\t}\r\n\t\t\tif (is_single()) {\r\n\t\t\t\techo \" » \";\r\n\t\t\t\tthe_title();\r\n\t\t\t}\r\n\t\t} elseif (is_page()) {\r\n\t\t\techo the_title();\r\n\t\t}\t\t\r\n\t\techo \"</div>\";\r\n\t}\t\r\n}", "public function addPage(Page $page): void\n {\n if (null === ($breadcrumb = $this->getPageBreadcrumb($page))) {\n return;\n }\n\n $nbEntries = count($breadcrumb);\n $parentEntry = $this;\n\n // Summary order\n $summaryOrder = $page->getMeta('summary-order', '');\n !is_array($summaryOrder) && $summaryOrder = explode(';', (string)$summaryOrder);\n array_walk($summaryOrder, fn(&$value) => $value = (int)trim($value));\n array_walk($summaryOrder, fn(&$value) => $value = empty($value) ? null : $value);\n $summaryOrder = array_pad($summaryOrder, 0 - $nbEntries, null);\n $summaryOrder = array_slice($summaryOrder, 0, $nbEntries);\n\n for ($i = 0; $i < $nbEntries; $i++) {\n $entry = $parentEntry->getEntryByTitle($breadcrumb[$i]);\n\n // Create if not exists or it's the last of list\n if (null === $entry) {\n $entry = new Entry($breadcrumb[$i]);\n $parentEntry->addEntry($entry);\n }\n\n // Define url and order if it's last element\n if ($i + 1 == $nbEntries) {\n $entryVisible = (bool)$page->getMeta('summary-visible', true);\n $entry->setPath($page->getPath());\n $entry->setVisible($entryVisible, $entryVisible);\n }\n\n if (isset($summaryOrder[$i])) {\n $entry->setOrder($summaryOrder[$i]);\n }\n\n $parentEntry = $entry;\n }\n\n $this->orderEntries();\n }", "public function breadcrumbs($h)\n {\n if ($h->pageName == 'edit_post') {\n $post_link = \"<a href='\" . $h->url(array('page'=>$h->post->id)) . \"'>\";\n $post_link .= $h->post->title . \"</a>\";\n $h->pageTitle = $h->pageTitle . \" / \" . $post_link;\n }\n }", "public static function getBreadcrumbs($sep='&#x279D;')\n\t{\n\t\t$path = parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH);\n\n\t\t$str = '';\n\t\t$linkURL = '';\n\n\t\t$pagesList = explode('/',ltrim($path, \"/\"));\n\n\t\t$c = count($pagesList);\n\t\tfor ($i=0; $i < $c; $i++) {\n\t\t\tunset($linkText);\n\n\t\t\t$page = array_shift($pagesList);\n\t\t\t\n\t\t\t$linkURL .= \"/$page\";\n\t\t\t\n\t\t\t$fullFilePath = BP.\"/app/views$linkURL.phtml\";\n\t\t\t\n\t\t\t# find the break point for the meta data\n\t\t\tif (file_exists($fullFilePath)) {\n\t\t\t\t$fileParts = explode(\"{endmeta}\", file_get_contents($fullFilePath), 2);\n\t\t\t\t\n\t\t\t\tif (isset($fileParts[0])) # does the template have meta data\n\t\t\t\t\t$metaDataArray = parse_ini_string($fileParts[0]);\n\t\t\t\t\n\t\t\t\tif (isset($metaDataArray['linkText']))\n\t\t\t\t\t$linkText = $metaDataArray['linkText'];\n\t\t\t\telseif (isset($metaDataArray['title']))\n\t\t\t\t\t$linkText = $metaDataArray['title'];\n\t\t\t}\n\n\t\t\tif (!isset($linkText))\n\t\t\t\t$linkText = self::ucwordss(str_replace('-',' ',$page), [\"is\", \"to\", \"the\", \"for\"]);\t\t\t\t\n\n\t\t\tif ($i+1 == $c) # last one\n\t\t\t\t$str .= ' '.$sep.' '.$linkText;\n\t\t\telse\n\t\t\t\t$str .= ' '.$sep.' <a href=\"'.$linkURL.'\">'.$linkText.'</a>';\n\t\t}\n\n\t\t$indexFileParts = explode(\"{endmeta}\", file_get_contents(BP.\"/app/views/index.phtml\"), 2);\n\t\t\t\t\n\t\tif (isset($indexFileParts[0])) # does the template have meta data\n\t\t\t$metaDataArray = parse_ini_string($indexFileParts[0]);\n\t\t\n\t\tif (isset($metaDataArray['linkText']))\n\t\t\t$linkText = $metaDataArray['linkText'];\n\t\telse\n\t\t\t$linkText = 'Home';\n\n\t\treturn '<a href=\"/\">'.$linkText.'</a>'.$str;\n\t}", "public function buildViewBreadCrumb(\\Symfony\\Component\\Routing\\Route $route)\n {\n $routeDefaults = $route->getDefaults();\n // By setting a \"cache context\" to the \"url\", each requested URL gets it's own cache.\n // This way a single breadcrumb isn't cached for all pages on the site.\n $this->breadcrumb->addCacheContexts([\n \"url\"\n ]);\n // By adding \"cache tags\" for this specific node, the cache is invalidated when the node is edited.\n $this->breadcrumb->addCacheTags([\n \"view:\" . $routeDefaults['view_id'] . $routeDefaults['display_id']\n ]);\n $currentRoute = \\Drupal::routeMatch()->getRouteName();\n $r = $route->getPath();\n // Add \"Home\" breadcrumb link.\n $this->breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '<front>'));\n if ($currentRoute == 'view.temoignage.page_1' && $route->getPath() == '/maigrir/la-communaute/temoignages') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Ils en parlent', Url::fromUri('base:/ils-en-parlent'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.livres_des_experts.page_1' && $route->getPath() == '/maigrir/livres/livres-des-experts') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Méthode', Url::fromUri('base:/methode-maigrir-sans-regime'))\n );\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Experts et coachs', Url::fromUri('base:/maigrir/nos-experts/nos-experts-maigrir-sans-regime'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.ils_en_parle.page_1' && $route->getPath() == '/maigrir/methode/maigrir-sans-regime-revue-presse') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Ils en parlent', Url::fromUri('base:/ils-en-parlent'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.ils_en_parle.page_2' && $route->getPath() == '/paroles-utilisateurs') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Ils en parlent', Url::fromUri('base:/ils-en-parlent'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.chat_historique.page_1' || $route->getPath() == '/maigrir/la-communaute/temoignages' || $route->getPath() == '/maigrir/la-communaute/chat-historique' ) {\n\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Community'), Url::fromUri('base:/maigrir/la-communaute')));\n if ($route->getPath() == '/maigrir/la-communaute/chat-historique') {\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Chat avec les experts'), Url::fromUri('base:/maigrir/la-communaute/chat-direct')));\n }\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.blog.blog_all' && $route->getPath() == '/blog') {\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Community'), Url::fromUri('base:/maigrir/la-communaute')));\n }\n elseif ($currentRoute == 'view.blog.blog_user_all' && $route->getPath() == '/blog/{arg_0}') {\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Community'), Url::fromUri('base:/maigrir/la-communaute')));\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t(\"Member's blog\"), Url::fromUri('base:/blog')));\n }\n elseif ($route->getPath() != '/maigrir/la-communaute/temoignages'&& $route->getPath() !='/paroles-utilisateurs') {\n // /add current view title\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n return $this->breadcrumb;\n }", "protected function redirectToCurrentPage() {}", "function Ancestors($page) {\n\n\t\t$breadcrumbs = array();\n\n\t\tif ( $page->URLSegment == 'home' )\n\t\t\treturn $breadcrumbs;\n\n\t\t//Debug::Log( 'Ancestors: ' . $page->ID . ' - ' .$page->MenuTitle . ' has parent ' . $page->ParentID );\n\n\t\t// Add ancestor pages to the array\n\t\tif ( $page->ParentID )\n\t\t\t$breadcrumbs += $this->Ancestors( $page->Parent() );\n\n\t\t// Add the page to the array\n\t\tif ( get_class($page) != 'SubmenuHolder' )\n\t\t\t$breadcrumbs[] = $page;\n\n\t\treturn $breadcrumbs;\n\t}", "function hudson_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n $output = '';\n\n // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('zen_breadcrumb');\n if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $zen_breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');\n $breadcrumb_separator = '<span class=\"separator\">&nbsp;' . $zen_breadcrumb_separator . '&nbsp;</span>';\n $trailing_separator = $title = '';\n if (theme_get_setting('zen_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $breadcrumb[] = check_plain($item['title']);\n }\n else {\n $breadcrumb[] = drupal_get_title();\n }\n }\n elseif (theme_get_setting('zen_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users.\n if (empty($variables['title'])) {\n $variables['title'] = t('You are here');\n }\n // Unless overridden by a preprocess function, make the heading invisible.\n if (!isset($variables['title_attributes_array']['class'])) {\n $variables['title_attributes_array']['class'][] = 'element-invisible';\n }\n\n // Build the breadcrumb trail.\n $output = '<nav class=\"breadcrumb\" role=\"navigation\">';\n $output .= '<h2' . drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . '</h2>';\n $output .= '<ol><li>' . implode($breadcrumb_separator . '</li><li>', $breadcrumb) . $trailing_separator . '</li></ol>';\n $output .= '</nav>';\n }\n }\n\n return $output;\n}", "protected function _redirectBack()\n {\n $this->_helper->redirector->gotoUrl($this->_request->getServer('HTTP_REFERER'));\n }", "function bbpress_crumbs() {\n\t\t\n\t\t// Setup the trail\n\t\t$bbp_trail = array();\n\t\t\n\t\t// If it is the forum root, just display \"Forums\"\n\t\tif ( bbp_is_forum_archive() ) {\n\t\t\t$bbp_trail[] = 'Forums';\n\t\t\treturn $bbp_trail;\n\t\t}\n\t\t\t\t\t\n\t\t// Otherwise link to the root forums\n\t\t$bbp_trail[] = '<a href=\"' . get_post_type_archive_link( 'forum' ) . '\">Forums</a>';\n\t\t\n\t\t// Recent topics page \n\t\tif ( bbp_is_topic_archive() ) :\n\t\t\t$bbp_trail[] = 'Recent Topics';\n\t\t\n\t\t// Topic tag archives \n\t\telseif ( bbp_is_topic_tag() ) :\n\t\t\t$bbp_trail[] = bbp_get_topic_tag_name();\n\t\t\n\t\t// Editing a topic tag\n\t\telseif ( bbp_is_topic_tag_edit() ) :\n\t\t\t$bbp_trail[] = '<a href=\"' . bbp_get_topic_tag_link() . '\">' . bbp_get_topic_tag_name() . '</a>';\n\t\t\t$bbp_trail[] = 'Edit';\n\t\t\n\t\t// Single topic \n\t\telseif ( bbp_is_single_topic() ) :\t\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_topic_forum_id( $topic_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_topic_title( $topic_id );\n\t\t\t\t\n\t\t// If it's a split, merge, or edit, link back to the topic \n\t\telseif ( bbp_is_topic_split() || bbp_is_topic_merge() || bbp_is_topic_edit() ) :\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $topic_id ) );\n\t\t\n\t\t\tif ( bbp_is_topic_split() ) \t\t: $bbp_trail[] = 'Split Topic';\n\t\t\telseif ( bbp_is_topic_merge() ) \t: $bbp_trail[] = 'Merge Topic';\n\t\t\telseif ( bbp_is_topic_edit() ) \t\t: $bbp_trail[] = 'Edit Topic';\n\t\t\tendif;\n\t\t\t\n\t\t// Single reply \n\t\telseif ( bbp_is_single_reply() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_reply_title( $reply_id );\n\t\t\n\t\t// Single reply edit \n\t\telseif ( bbp_is_reply_edit() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = 'Edit Reply';\n\t\t\t\n\t\t// Single forum \n\t\telseif ( bbp_is_single_forum() ) :\n\t\t\n\t\t\t// Get the queried forum ID and its parent forum ID. \n\t\t\t$forum_id \t\t\t= get_queried_object_id();\n\t\t\t$forum_parent_id \t= bbp_get_forum_parent_id( $forum_id );\n\t\t\t\n\t\t\t// Get the forum parents\n\t\t\tif ( 0 != $forum_parent_id) \n\t\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $forum_parent_id ) );\n\t\t\t\t\n\t\t\t// Give the forum title\n\t\t\t$bbp_trail[] = bbp_get_forum_title( $forum_id );\n\t\t\n\t\tendif;\n\t\t\n\t\t// Return the bbPress trail \n\t\treturn $bbp_trail;\n\t}", "function megatron_ubc_clf_breadcrumbs($variables) {\n $title = drupal_set_title();\n $output = '';\n $output .= '<ul class=\"breadcrumb expand\">';\n\n if (theme_get_setting('clf_crumbumbrellaunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbumbrellawebsite') . '\">' . theme_get_setting('clf_crumbumbrellaunit') . '</a><span class=\"divider\">/</span>';\n }\n if (theme_get_setting('clf_crumbunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbwebsite') . '\">' . theme_get_setting('clf_crumbunit') . '</a><span class=\"divider\">/</span>';\n }\n $output .= '<li>' . $title . '</li></ul>';\n return $output;\n}", "private function addBreadcrumb(DataContainer $dc): void\n {\n /** @var AttributeBagInterface $session */\n $session = $this->requestStack->getSession()->getBag('contao_backend');\n\n // Set a new node\n if (isset($_GET['nn'])) {\n // Check the path\n if (Validator::isInsecurePath(Input::get('nn', true))) {\n throw new \\RuntimeException('Insecure path '.Input::get('nn', true));\n }\n\n $session->set(self::BREADCRUMB_SESSION_KEY, Input::get('nn', true));\n Controller::redirect(preg_replace('/&nn=[^&]*/', '', Environment::get('request')));\n }\n\n if (($nodeId = $session->get(self::BREADCRUMB_SESSION_KEY)) < 1) {\n return;\n }\n\n // Check the path\n if (Validator::isInsecurePath($nodeId)) {\n throw new \\RuntimeException('Insecure path '.$nodeId);\n }\n\n $ids = [];\n $links = [];\n $user = BackendUser::getInstance();\n\n // Generate breadcrumb trail\n if ($nodeId) {\n $id = $nodeId;\n\n do {\n $node = $this->db->fetchAssociative(\"SELECT * FROM {$dc->table} WHERE id=?\", [$id]);\n\n if (!$node) {\n // Currently selected node does not exist\n if ((int) $id === (int) $nodeId) {\n $session->set(self::BREADCRUMB_SESSION_KEY, 0);\n\n return;\n }\n\n break;\n }\n\n $ids[] = $id;\n\n // No link for the active node\n if ((int) $node['id'] === (int) $nodeId) {\n $links[] = $this->onLabelCallback($node, '', null, '', true).' '.$node['name'];\n } else {\n $links[] = $this->onLabelCallback($node, '', null, '', true).' <a href=\"'.Backend::addToUrl('nn='.$node['id']).'\" title=\"'.StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['selectNode']).'\">'.$node['name'].'</a>';\n }\n\n // Do not show the mounted nodes\n if (!$user->isAdmin && $user->hasAccess($node['id'], 'nodeMounts')) {\n break;\n }\n\n $id = $node['pid'];\n } while ($id > 0 && 'root' !== $node['type']);\n }\n\n // Check whether the node is mounted\n if (!$user->hasAccess($ids, 'nodeMounts')) {\n $session->set(self::BREADCRUMB_SESSION_KEY, 0);\n\n throw new AccessDeniedException('Node ID '.$nodeId.' is not mounted.');\n }\n\n // Limit tree\n $GLOBALS['TL_DCA'][$dc->table]['list']['sorting']['root'] = [$nodeId];\n\n // Add root link\n $links[] = Image::getHtml($GLOBALS['TL_DCA'][$dc->table]['list']['sorting']['icon']).' <a href=\"'.Backend::addToUrl('nn=0').'\" title=\"'.StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['selectAllNodes']).'\">'.$GLOBALS['TL_LANG']['MSC']['filterAll'].'</a>';\n $links = array_reverse($links);\n\n // Insert breadcrumb menu\n $GLOBALS['TL_DCA'][$dc->table]['list']['sorting']['breadcrumb'] = '\n\n<nav aria-label=\"'.$GLOBALS['TL_LANG']['MSC']['breadcrumbMenu'].'\">\n <ul id=\"tl_breadcrumb\">\n <li>'.implode(' › </li><li>', $links).'</li>\n </ul>\n</nav>';\n }", "function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}", "function get_uams_breadcrumbs()\n{\n\nglobal $post;\n$ancestors = array_reverse( get_post_ancestors( $post->ID ) );\n$html = '<li><a href=\"http://inside.uams.edu\" title=\"University of Arkansas for Medical Scineces\">Home</a></li>';\nif ( !is_main_site() )\n{\n$html .= '<li' . (is_front_page() ? ' class=\"current\"' : '') . '><a href=\"' . home_url('/') . '\" title=\"' . str_replace(' ', ' ', get_bloginfo('title')) . '\">' . str_replace(' ', ' ', get_bloginfo('title')) . '</a><li>';\n}\n\nif ( is_404() )\n{\n $html .= '<li class=\"current\"><span>Ooops!</span>';\n} else\n\nif ( is_search() )\n{\n $html .= '<li class=\"current\"><span>Search results for ' . get_search_query() . '</span>';\n} else\n\nif ( is_author() )\n{\n $author = get_queried_object();\n $html .= '<li class=\"current\"><span> Author: ' . $author->display_name . '</span>';\n} else\n\nif ( get_queried_object_id() === (Int) get_option('page_for_posts') ) {\n $html .= '<li class=\"current\"><span> '. get_the_title( get_queried_object_id() ) . ' </span>';\n}\n\n// If the current view is a post type other than page or attachment then the breadcrumbs will be taxonomies.\nif( is_category() || is_tax() || is_single() || is_post_type_archive() )\n{\n\n if ( is_post_type_archive() && !is_tax() )\n {\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_post_type_archive_link( $posttype->query_var ) .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n $html .= '<li class=\"current\"><span>'. $posttype->labels->menu_name . '</span>';\n }\n\n if ( is_category() )\n {\n $category = get_category( get_query_var( 'cat' ) );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. get_cat_name($category->term_id ) . '</span>';\n }\n\n if ( is_tax() && !is_post_type_archive() )\n {\n $term = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $tax = get_taxonomy( get_query_var(\"taxonomy\") );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->labels->name .': '. $term->name .'</span>';\n }\n\n if ( is_tax() && is_post_type_archive() )\n {\n $tax = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->name . '</span>';\n }\n\n if ( is_single() )\n {\n if ( has_category() )\n {\n $thecat = get_the_category( $post->ID );\n $category = array_shift( $thecat ) ;\n $html .= '<li><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n }\n if ( uams_is_custom_post_type() )\n {\n $posttype = get_post_type_object( get_post_type() );\n $archive_link = get_post_type_archive_link( $posttype->query_var );\n if (!empty($archive_link)) {\n $html .= '<li><a href=\"' . $archive_link .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n else if (!empty($posttype->rewrite['slug'])){\n $html .= '<li><a href=\"' . site_url('/' . $posttype->rewrite['slug'] . '/') .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n }\n $html .= '<li class=\"current\"><span>'. get_the_title( $post->ID ) . '</span>';\n }\n}\n\n// If the current view is a page then the breadcrumbs will be parent pages.\nelse if ( is_page() )\n{\n\n if ( ! is_home() || ! is_front_page() )\n $ancestors[] = $post->ID;\n\n if ( ! is_front_page() )\n {\n foreach ( array_filter( $ancestors ) as $index=>$ancestor )\n {\n $class = $index+1 == count($ancestors) ? ' class=\"current\" ' : '';\n $page = get_post( $ancestor );\n $url = get_permalink( $page->ID );\n $title_attr = esc_attr( $page->post_title );\n if (!empty($class)){\n $html .= \"<li $class><span>{$page->post_title}</span></li>\";\n }\n else {\n $html .= \"<li><a href=\\\"$url\\\" title=\\\"{$title_attr}\\\">{$page->post_title}</a></li>\";\n }\n }\n }\n\n}\n\nreturn \"<nav class='uams-breadcrumbs' aria-label='breadcrumbs'><ul>$html</ul></nav>\";\n}", "function tac_link_to_last_crumb( $output, $crumb){ \n\n\t$output = '<a property=\"v:title\" rel=\"v:url\" class=\"thisLink\" href=\"'. $crumb['url']. '\" >';\n\t$output.= $crumb['text'];\n\t$output.= '</a>';\n\n\treturn $output;\n}", "public function xml_breadcrumbs()\n {\n $post_url = build_url(array('page' => '_SELF', 'type' => '_xml_breadcrumbs'), '_SELF');\n\n return do_template('XML_CONFIG_SCREEN', array(\n '_GUID' => '456f56149832d459bce72ca63a1578b9',\n 'TITLE' => $this->title,\n 'POST_URL' => $post_url,\n 'XML' => file_exists(get_custom_file_base() . '/data_custom/xml_config/breadcrumbs.xml') ? cms_file_get_contents_safe(get_custom_file_base() . '/data_custom/xml_config/breadcrumbs.xml') : cms_file_get_contents_safe(get_file_base() . '/data/xml_config/breadcrumbs.xml'),\n ));\n }", "function custom_breadcrumbs() {\n\n // Settings\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = 'TOP';\n\n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. care_cat)\n $custom_taxonomy = 'knowledge-cat';\n\n // Get the query & post information\n global $post;\n\n // Do not display on the Home\n if ( !is_front_page() ) {\n\n // Build the breadcrums\n echo '<ul id=\"' . $breadcrums_id . '\" class=\"' . $breadcrums_class . '\">';\n\n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . $home_title . '\"><i class=\"fa fa-home\" aria-hidden=\"true\"></i>' . $home_title . '</a></li>';\n\n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . post_type_archive_title($prefix, false) . '</strong></li>';\n\n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n // If it is a custom post type display name and link\n \t\t\t\t\t\t if($post_type == 'post') {\n $post_type_object = get_post_type_object($post_type);\n\n\t\t\t\t\t\t\t $post_type_archive_label = \"整骨院・接骨院・整体・鍼灸院\";\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_category_link(get_category_by_slug('clinic')->term_id);\n\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n }\n\n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . $custom_tax_name . '</strong></li>';\n\n } else if ( is_single() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n if( $post_type == 'post' ) {\n $clinic_cat = get_the_category(get_the_ID())[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( $post_type == 'hikikomori' || $post_type == 'violence' || $post_type == 'voice' || $post_type == 'question' ) {\n $clinic_id = $clinic_page->ID;\n $clinic_cat = get_the_category($clinic_id)[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$post_type_object = get_post_type_object($post_type);\n\t\t\t\t\t\t\t\t$post_type_archive_label = $post_type_object->label;\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_post_type_archive_link( $post_type );\n\t\t\t\t\t\t\t\techo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\n // Get post category info\n $category = get_the_category();\n\n if(!empty($category)) {\n\n // Get last category post is in\n $last_category = end(array_values($category));\n\n // Get parent any categories and create array\n $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n $cat_parents = explode(',',$get_cat_parents);\n\n // Loop through parent categories and store in variable $cat_display\n $cat_display = '';\n // foreach($cat_parents as $parents) {\n \t\t\t\t\t\t\t\t// \t $cat_display .= '<li class=\"item-cat\">'.$parents.'</li>';\n // }\n \t\t\t\t\t\t\t\t $cat_display .= '<li class=\"item-cat\">'.$cat_parents[0].'</li>';\n\n }\n\n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n\n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n\n }\n\n // Check if the post is in a category\n if(!empty($last_category)) {\n // echo $cat_display;\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n\n echo '<li class=\"item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '\"><a class=\"bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '\" href=\"' . $cat_link . '\" title=\"' . $cat_name . '\">' . $cat_name . '</a></li>';\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n } else {\n\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_category() ) {\n\n // Category page\n echo '<li class=\"item-current item-cat\"><strong class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</strong></li>';\n\n } else if ( is_page() ) {\n\n // Standard page\n if( $post->post_parent ){\n\n // If child page, get parents\n $anc = get_post_ancestors( $post->ID );\n\n // Get parents in the right order\n $anc = array_reverse($anc);\n\n // Parent page loop\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . $ancestor . '\"><a class=\"bread-parent bread-parent-' . $ancestor . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n }\n\n // Display parent pages\n echo $parents;\n\n // Current page\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong title=\"' . get_the_title() . '\"> ' . get_the_title() . '</strong></li>';\n\n } else {\n\n // Just display current page if not parents\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\"> ' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_tag() ) {\n // Tag page\n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n\n // Display the tag name\n echo '<li class=\"item-current item-tag-' . $get_term_id . ' item-tag-' . $get_term_slug . '\"><strong class=\"bread-current bread-tag-' . $get_term_id . ' bread-tag-' . $get_term_slug . '\">' . $get_term_name . '</strong></li>';\n\n } elseif ( is_day() ) {\n // Day archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</a></li>';\n\n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><strong class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_month() ) {\n\n // Month Archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><strong class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_year() ) {\n\n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><strong class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</strong></li>';\n\n } else if ( is_author() ) {\n\n // Auhor archive\n\n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n\n // Display author name\n echo '<li class=\"item-current item-current-' . $userdata->user_nicename . '\"><strong class=\"bread-current bread-current-' . $userdata->user_nicename . '\" title=\"' . $userdata->display_name . '\">' . 'Author: ' . $userdata->display_name . '</strong></li>';\n\n } else if ( get_query_var('paged') && !is_search() ) {\n\n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><strong class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"Page ' . get_query_var('paged') . '\">'.__('Page') . ' ' . get_query_var('paged') . '</strong></li>';\n\n } else if ( is_search() ) {\n\n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><strong class=\"bread-current bread-current-' . get_search_query() . '\" title=\"検索結果: ' . get_search_query() . '\">検索結果: ' . get_search_query() . '</strong></li>';\n\n } elseif ( is_404() ) {\n\n // 404 page\n echo '<li>' . 'Error 404' . '</li>';\n }\n echo '</ul>';\n }\n }", "public static function add_to_breadcrumb($title)\n {\n $new_url = self::get_new_url();\n $_breadcrumb = self::get_session($new_url, $title);\n\n // *shh* Check Does New Breadcrumb is Member of Master URLs\n if (self::does_need_reset($new_url)) {\n self::reset($new_url, $title);\n return [];\n }\n\n // todo : comment\n// var_dump( $_step = self::is_familiar_url_with_old_ones($_breadcrumb,$new_url) );\n// die();\n if ($_step = self::is_familiar_url_with_old_ones($_breadcrumb,$new_url))\n return self::make_new_broken_familiar_breadcrumb($_breadcrumb, $new_url, $title, $_step);\n\n // *shh* check Is New Breadcrumb now Exist In Breadcrumb or Not,\n // If Now Its Exist, We Could Delete The Newer Breadcrumbs until The New Url($new_url) and Call ( make_new_broken_breadcrumb() )\n // And If Its The New BC, We Add It In The Last Child Of 'before_url' nested arrays. Calling ( make_new_breadcrumb() )\n return (self::does_new_url_exist_in_current_breadcrumb($_breadcrumb, $new_url)) ?\n self::make_new_broken_breadcrumb($_breadcrumb, $new_url) : self::make_new_breadcrumb($_breadcrumb, $new_url, $title);\n }", "function okcdesign_breadcrumb($variables) {\n $html = theme_plugins_invoke(__FUNCTION__, $variables);\n if ($html) return $html;\n return theme_breadcrumb($variables);\n}", "function Breadcrumb ($pathinfo) {\n if (strlen($pathinfo)<1) { $pathinfo = $REQUEST_URI; } \n $divider = \">>\";\n print \"<p id=\\\"breadcrumbs\\\" style=\\\"clear: both; margin-left: 8ex; text-indent:-8ex\\\">\\n\";\n $pre_path = \"/docs\";\n $more_path= \"/\";\n $path = split (\"/\", $pathinfo);\n print \"Return to: <a href=\\\"/lib/\\\">Library Homepage</a>\";\n \n $count = count($path);\n $less = $count-1;\n \n if (preg_match(\"/^index\\./\",\"$path[$less]\",$matches)) {\n array_pop($path);\n // $count = $count-2;\n $count = count($path);\n } \n /*\n print \"<!-- COUNT ME: $count -->\";\n print \"<!--\";\n print_r($path);\n print \"-->\";\n */\n\n for ($i=1; $i<$count; $i++) {\n $dir = $path[$i];\n $fn = \"$pre_path$more_path$dir/breadcrumb.data\";\n if (file_exists($fn)) {\n if ($file = fopen(\"$fn\", \"r\")) {\n\t$line=fgetss($file,255);\n\tif (preg_match(\"/\\\"(.+)\\\"/\",$line,$matches)) { \n\t $line = preg_replace(\"/\\s+/\",\"&nbsp;\",$matches[1]); \n\t}\n\tprint \" $divider <a href=\\\"$more_path$dir/\\\">$line</a>\";\n\tfclose($file);\n } // end if file opens\n } //end if file exists\n $more_path .= \"$dir/\";\n } // end for\n}", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "function the_breadcrumb() {\n\t global $post;\n\t $separator = '<span class=\"breadcrumb-divider\"><svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 8.49993L13.4394 5.93933V7.99599H0V9.00394H13.4394V11.0606L16 8.49993Z\" fill=\"#121212\" /></svg></span>';\n\t echo '<nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb\">';\n\t if (!is_home()) {\n\t\t\t echo '<li class=\"breadcrumb-item\"><a href=\"';\n\t\t\t echo get_option('home');\n\t\t\t echo '\">';\n\t\t\t echo __( 'Home', 'thegrapes' );\n\t\t\t echo '</a></li>' . $separator;\n\t\t\t if ( is_category() ) {\n\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">';\n\t\t\t\t\t the_category(' </li>' . $separator . '<li class=\"breadcrumb-item\"> ');\n\t\t\t } elseif ( is_single() ) {\n echo '<li class=\"breadcrumb-item\">';\n echo '<a href=\"' . get_post_type_archive_link( 'post' ) . '\">';\n echo get_the_title( get_option('page_for_posts', true) );\n echo '</a>';\n echo '</li>' . $separator . '<li class=\"breadcrumb-item active\">';\n the_title();\n echo '</li>';\n } elseif ( is_page() ) {\n\t\t\t\t\t if($post->post_parent){\n\t\t\t\t\t\t\t $anc = get_post_ancestors( $post->ID );\n\t\t\t\t\t\t\t $title = get_the_title();\n\t\t\t\t\t\t\t foreach ( $anc as $ancestor ) {\n\t\t\t\t\t\t\t\t\t $output = '<li class=\"breadcrumb-item\"><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>' . $separator;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t echo $output;\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.$title.'</li>';\n\t\t\t\t\t } else {\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.get_the_title().'</li>';\n\t\t\t\t\t }\n\t\t\t }\n\t }\n\t elseif (is_tag()) {single_tag_title();}\n\t elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n\t elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n\t elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n\t elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n\t elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n\t elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n\t echo '</ol></nav>';\n}", "public function set_page($page);", "function wimbase_breadcrumb($variables) {\n if (module_exists('hansel')) {\n $hansel_breadcrumb = hansel_get_breadcrumbs();\n $breadcrumb = $hansel_breadcrumb['breadcrumb'];\n }\n else {\n $breadcrumb = $variables['breadcrumb'];\n }\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $title = '<p id=\"breadcrums-nav-title\" class=\"element-invisible\">'\n . t('You are here') . '</p>';\n $output = '<nav class=\"breadcrumb\" aria-labelledby=\"breadcrums-nav-title\"\">'\n . $title . implode(' / ', $breadcrumb) . '</nav>';\n return $output;\n }\n}", "function CreateBreadcrumb($categoryid, $tagtype='<a>') // or '<li>'\n{\n global $DB, $userinfo, $mainsettings, $pages_md_arr, $pages_parents_md_arr;\n\n if(!isset($pages_parents_md_arr)) return;\n $categories = array();\n $cat_id = $categoryid;\n while(!empty($cat_id))\n {\n if(isset($pages_md_arr[$cat_id]))\n {\n $cat = $pages_md_arr[$cat_id];\n array_unshift($categories, $cat);\n $cat_id = $cat['parentid'];\n }\n else\n {\n break;\n }\n }\n\n if(empty($categories))\n {\n return '';\n }\n\n $Breadcrumb = '';\n $count = count($categories);\n $idx = 1;\n // $categories is array with pages for a specific parent page\n foreach($categories as $category_arr)\n {\n // $category_arr contains actual page row (either cached or from DB)\n $category_name = strlen($category_arr['title'])?$category_arr['title']:$category_arr['name'];\n $category_link = strlen($category_arr['link']) ? $category_arr['link'] : RewriteLink('index.php?categoryid=' . $category_arr['categoryid']);\n $category_target = strlen($category_arr['target']) ? ' target=\"' . $category_arr['target'] . '\"' : '';\n switch($idx)\n {\n case 1 : $class ='class=\"first\" '; break;\n case $count: $class ='class=\"last\" '; break;\n default : $class = '';\n }\n //SD370: allow list items output\n //if($tagtype == '<li>') $Breadcrumb .= '<li>';\n if($category_arr['categoryid'] == $categoryid){\n $Breadcrumb .= '<li>'.$category_name.'</li>';\n }\n else{\n $Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n }\n //$Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n //if($tagtype == '<li>') $Breadcrumb .= '</li>';\n $idx++;\n }\n $Breadcrumb .= '<div style=\"clear:both;\"></div>'.\"\\n\";\n\n return $Breadcrumb;\n\n}", "protected function setInitialBackPath() {}", "function add_additional_breadcrumbs(BreadcrumbTrail $breadcrumbtrail)\n {\n // Translation :: get('PeerAssessmentToolBrowserComponent')));\n }", "function the_breadcrumb() {\r\n\techo '<a href=\"';\r\n\techo get_option('home');\r\n\techo '\">';\r\n\techo \"HOME\";\r\n\techo \"</a>\";\r\n\tif(is_home()){\r\n\t\techo \" &#47; <span style='font-size:12px;letter-spacing:0px;'>Welcome to Under One Roof Properties, a new generation of workspace.</span>\";\r\n\t}\r\n\tif(!is_home()) {\r\n\t\techo \" &#47; \";\r\n\t\tif (is_category() || is_single()) {\r\n\t\t\tthe_category('title_li=');\r\n\t\t\tif (is_single()) {\r\n\t\t\t\techo \" &#47; \";\r\n\t\t\t\tstrtoupper(the_title());\r\n\t\t\t}\r\n\t\t} elseif (is_page()) {\r\n\t\t\techo strtoupper(the_title());\r\n\t\t}\r\n\t}\r\n}", "function get_breadcrumb() {\n\n // Outputs home breadcrumb \n echo '<a href=\"'.home_url().'\" rel=\"nofollow\">Home</a>';\n\n // Retrievea post categories.\n $category = get_the_category();\n\n // Checks if page template is category or single \n if (is_category() || is_single() || is_tag() || is_date()) {\n\n // Outputs arrows\n echo \"&nbsp;&nbsp;&#187;&nbsp;&nbsp;\";\n\n // Checks if category array is not empty\n if ( $category[0] ) {\n // Outputs current category of post (NOTE: only outputs one category)\n echo '<a href=\"' . get_category_link( $category[0]->term_id ) . '\">' . $category[0]->cat_name . '</a>';\n }\n\n // Determines whether the query is for an existing single post\n if (is_single()) {\n // Outputs arrows \n echo \" &nbsp;&nbsp;&#187;&nbsp;&nbsp; \";\n // Outputs the title\n the_title();\n }\n\n } \n}", "public function process(BreadcrumbableModelInterface $entity): Breadcrumb;", "public function menu_get_active_breadcrumb()\n {\n return menu_get_active_breadcrumb();\n }", "function faculty_settings_breadcrumb() { \n faculty_setting_line(faculty_add_color_setting('breadcrumb_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('breadcrumb_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('breadcrumb_text_transform', __('Text Transform', FACULTY_DOMAIN), 'transform'));\n faculty_setting_line(faculty_add_border_setting('breadcrumb_border', __('Bottom Border', FACULTY_DOMAIN)));\n do_action('faculty_settings_breadcrumb');\n}", "protected static function get_breadcrumb()\n {\n $new_url = self::get_new_url();\n $breadcrumb = self::get_session($new_url);\n\n return self::get_before_urls_value($breadcrumb);\n }", "public function init(){\r\n\t\t\tparent::init();\r\n\t\t\t$this->breadcrumbs->addStep('Account', $this->getUrl(null, 'account'));\r\n\t\t}", "function goToPage($page) {\n\t\t$this->link->setPage($page);\n\t\tResponse::sendRedirect($this->link->toString());\n\t}", "function dimox_breadcrumbs() {\n\n\t/* === OPTIONS === */\n\t$text['home'] = 'Home'; // text for the 'Home' link\n\t$text['category'] = 'Archive by Category \"%s\"'; // text for a category page\n\t$text['search'] = 'Search Results for \"%s\" Query'; // text for a search results page\n\t$text['tag'] = 'Posts Tagged \"%s\"'; // text for a tag page\n\t$text['author'] = 'Articles Posted by %s'; // text for an author page\n\t$text['404'] = 'Error 404'; // text for the 404 page\n\t$text['page'] = 'Page %s'; // text 'Page N'\n\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\n\t$wrap_before = '<div class=\"breadcrumbs\">'; // the opening wrapper tag\n\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t$sep = '>'; // separator between crumbs\n\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t$sep_after = '</span>'; // tag after separator\n\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t$show_on_home = 1; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t$after = '</span>'; // tag after the current crumb\n\t/* === END OF OPTIONS === */\n\n\tglobal $post;\n\tglobal $pre_path;\n\t$home_link = 'https://www.nationalarchives.gov.uk/';\n\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t$link_after = '</span>';\n\t$link_attr = ' itemprop=\"url\"';\n\t$link_in_before = '<span itemprop=\"title\">';\n\t$link_in_after = '</span>';\n\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t$frontpage_id = get_option('page_on_front');\n\t$parent_id = $post->post_parent;\n\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\n\tif (is_home() || is_front_page()) {\n\n\t\t// TNA additional breadcrumbs for front page\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\t$numItems = count($pre_crumbs);\n\t\t\t$i = 0;\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\tif (++$i === $numItems) {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span>'. $crumb_name . '</span> ';\n\t\t\t\t} else {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tglobal $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>';\n\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_after;\n\n\t} else {\n\n\t\t// TNA additional breadcrumbs\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_before;\n\n\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\n\t\tif ( is_page() && !$parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t$breadcrumbs = array();\n\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, str_replace(home_url(), $pre_path, get_permalink($page->ID)), get_the_title($page->ID));\n\t\t\t\t\t}\n\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t}\n\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_404() ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\n\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\tglobal $pre_crumbs_st, $pre_crumbs_post;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_post) echo $pre_crumbs_post;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\tprintf($link, $home_link . '/' . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} else {\n\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t/*echo $cats;*/\n\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\techo $sep . sprintf($link, str_replace(home_url(), $pre_path, get_permalink()), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_after;\n\n\t}\n}", "function knb_breadcrumb()\n{\n\n $breadcrumb = new \\DSC\\Reference\\Breadcrumbs();\n\n $breadcrumb_option = get_post_meta(get_the_ID(), '_knowledgebase_breadcrumbs_meta_key', true);\n\n\t$args = array(\n 'post_type' => 'knowledgebase',\n 'taxonomy' => 'knb-categories',\n 'separator_icon' => ' ' . get_option('reference_knb_breadcrumbs_separator') . ' ',\n 'breadcrumbs_id' => 'breadcrumbs-wrap',\n 'breadcrumbs_classes' => 'breadcrumb-trail breadcrumbs',\n 'home_title' => get_option('reference_knb_plural'),\n\t);\n\n if (empty($breadcrumb_option) && (bool)get_option('reference_knb_breadcrumbs') === true) {\n $breadcrumb_option = 'enable';\n }\n\n if ((bool)get_option('reference_knb_breadcrumbs') === true) {\n\n if (is_option_enabled($breadcrumb_option)) {\n\n echo $breadcrumb->render( $args );\n\n }\n }\n}", "function thim_learnpress_breadcrumb() {\n\t\tif ( is_front_page() || is_404() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the query & post information\n\t\tglobal $post;\n\n\t\t// Build the breadcrums\n\t\techo '<ul itemprop=\"breadcrumb\" itemscope itemtype=\"http://schema.org/BreadcrumbList\" id=\"breadcrumbs\" class=\"breadcrumbs\">';\n\n\t\t// Home page\n\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_html( get_home_url() ) . '\" title=\"' . esc_attr__( 'Home', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'Home', 'eduma' ) . '</span></a></li>';\n\n\t\tif ( is_single() ) {\n\n\t\t\t$categories = get_the_terms( $post, 'course_category' );\n\n\t\t\tif ( get_post_type() == 'lp_course' ) {\n\t\t\t\t// All courses\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\t\t\t} else {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_permalink( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\" title=\"' . esc_attr( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\"><span itemprop=\"name\">' . esc_html( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '</span></a></li>';\n\t\t\t}\n\n\t\t\t// Single post (Only display the first category)\n\t\t\tif ( isset( $categories[0] ) ) {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_term_link( $categories[0] ) ) . '\" title=\"' . esc_attr( $categories[0]->name ) . '\"><span itemprop=\"name\">' . esc_html( $categories[0]->name ) . '</span></a></li>';\n\t\t\t}\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( get_the_title() ) . '\">' . esc_html( get_the_title() ) . '</span></li>';\n\n\t\t} else if ( is_tax( 'course_category' ) || is_tax( 'course_tag' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Category page\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( single_term_title( '', false ) ) . '\">' . esc_html( single_term_title( '', false ) ) . '</span></li>';\n\t\t} else if ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['ref'] ) && ( $_REQUEST['ref'] == 'course' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Search result\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'Search results for:', 'eduma' ) . ' ' . esc_attr( get_search_query() ) . '\">' . esc_html__( 'Search results for:', 'eduma' ) . ' ' . esc_html( get_search_query() ) . '</span></li>';\n\t\t} else {\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\">' . esc_html__( 'All courses', 'eduma' ) . '</span></li>';\n\t\t}\n\n\t\techo '</ul>';\n\t}", "function print_breadcrumb()\n{\n $breadcrumbs = get_breadcrumb();\n for ($i = 0; $i < sizeof($breadcrumbs); $i++) {\n echo '<li class=\"breadcrumb-path breadcrumb-level-' . $i . '\">';\n echo '<a href=\"' . $breadcrumbs[$i]['url'] . '\">' . $breadcrumbs[$i]['title'] . '</a>';\n echo '</li>';\n }\n}", "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 }", "function ibio_breadcrumbs(){\n\n genesis_do_breadcrumbs();\n\n /*if ( function_exists('yoast_breadcrumb') ) {\n yoast_breadcrumb('<p id=\"breadcrumbs\">','</p>');\n } else{\n genesis_do_breadcrumbs();\n }*/\n}", "function issues_prepare_parent_breadcrumbs($issue) {\n\tif ($issue && $issue->parent_guid) {\n\t\t$parents = array();\n\t\t$parent = get_entity($issue->parent_guid);\n\t\twhile ($parent) {\n\t\t\tarray_push($parents, $parent);\n\t\t\t$parent = get_entity($parent->parent_guid);\n\t\t}\n\t\twhile ($parents) {\n\t\t\t$parent = array_pop($parents);\n\t\t\telgg_push_breadcrumb($parent->title, $parent->getURL());\n\t\t}\n\t}\n}", "public function getBreadCrumb() {\n\t\treturn $this->breadCrumb;\n\t}", "public function set_breadcrumb($link, $title)\n\t{\n\t\tstatic $_crumbs = array();\n\n\t\tif (is_object($link))\n\t\t{\n\t\t\t$link = $link->compile();\n\t\t}\n\n\t\t$_crumbs[$link] = $title;\n\t\tee()->view->cp_breadcrumbs = $_crumbs;\n\t}" ]
[ "0.6693949", "0.6681852", "0.66400194", "0.6554783", "0.6448106", "0.63784754", "0.6377361", "0.628439", "0.621664", "0.609958", "0.6056628", "0.6018356", "0.60119325", "0.60022247", "0.59743476", "0.59193677", "0.58909965", "0.5878137", "0.5832546", "0.57717067", "0.57672626", "0.57472354", "0.5745456", "0.57378775", "0.5730918", "0.57210135", "0.57178825", "0.5680425", "0.5679616", "0.56472623", "0.56351143", "0.5631609", "0.5630934", "0.5619638", "0.5618682", "0.5616201", "0.5614931", "0.5589133", "0.55754435", "0.5546136", "0.5537665", "0.5537586", "0.5535161", "0.5529019", "0.5526774", "0.5508139", "0.550578", "0.5499635", "0.54837394", "0.54784244", "0.5477546", "0.5477303", "0.5467326", "0.5459735", "0.544606", "0.54381007", "0.5434416", "0.5432247", "0.5431445", "0.5428184", "0.54255605", "0.5418236", "0.54099476", "0.54056406", "0.54017735", "0.53993833", "0.5394688", "0.5394096", "0.5392864", "0.53908145", "0.5383722", "0.53831595", "0.53829694", "0.5381374", "0.5376901", "0.53731", "0.53731", "0.53699505", "0.5356208", "0.5348284", "0.53433", "0.5342764", "0.5336234", "0.53343207", "0.53339684", "0.5333363", "0.53293866", "0.5328379", "0.53262", "0.5317844", "0.53170806", "0.5307633", "0.5303656", "0.5289529", "0.52874744", "0.528565", "0.52846825", "0.52829856", "0.52817637", "0.52790236" ]
0.6627657
3
Handles the construction of a submission array from a set of form values.
public static function get_submission($values, $args) { iform_load_helpers(array('submission_builder')); return submission_builder::build_submission($values, array( 'model' => 'termlists_term', 'superModels'=>array( 'meaning'=>array('fk' => 'meaning_id'), 'term'=>array('fk' => 'term_id') ) )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _processForm (array $values, $form) {\n \n //---> blank codes <------\n $code99 = array(\n 'aborid','gender','popgrp','homelang',\n 'borncan','referby','marital','adults','numchild',\n 'actlim1', 'actlim2'\n );\n \n\t$code88 = array(\n\t\t'brsc5','brsc6'\n\t);\n \n $code77 = array(\n 'grade','ch1age','ch2age','ch3age','ch4age',\n 'ch5age','ch6age','ch7age','ch8age','hous1a',\n\t 'prlt1a','prlt2a','prlt3a','prlt4a','prlt5a','prlt6a','prlt7a',\n\t 'prlt1b','prlt2b','prlt3b','prlt4b','prlt5b','prlt6b','prlt7b',\n\t 'prst1a','prst2a','prst3a','prst4a',\n\t 'prst1b','prst2b','prst3b','prst4b'\n );\n \n $code777 = array(\n 'yrscan'\n );\n\n $code1 = array(\n 'cadu1', 'cadu2', 'cadu3', 'cadu4', 'cadu5', 'cadu6', 'cadu7', 'cadu8',\n 'cadu9', 'cadu10', 'cadu11', 'cadu12', 'cadu13', 'cadu14', 'cadu15', 'cadu16'\n );\n \n $codeDate = array(\n 'hous1until'\n );\n\n\t $codeNA = array(\n\t 'genderoth'\n\t );\n \n //---> alphanumeric questions <----\n $alphaNums = array(\n 'popgrp','homelang','country', 'referby'\n );\n \n //end code book option arrays\n \n $questions = array();\n //get all necessary elements\n $elementSQL = \"SELECT elementID,fsiiName,options \n FROM customFormElements\n WHERE fsiiName IS NOT NULL\n AND formID = $form\";\n $elementList = $this->elmntModel->getAdapter()\n ->fetchAll(\"$elementSQL\");\n \n foreach ($elementList as $element) {\n $eName = $element['elementID'];\n \n if (array_key_exists($eName, $values)) {\n $val = $values[$eName];\n } else {\n $val = '';\n }\n \n \n $qCode = $element['fsiiName'];\n //FCSS handles multiple-answer questions as series of\n //separate 'yes/no' dyads; we prefer checkboxes,\n //so must process. we've called these 'processCheck' for convenience\n \n if ($qCode == 'processCheck') {\n $submittedAnswers = explode(' , ' , strtolower($val));\n \n $set = json_decode($element['options'], TRUE);\n \n foreach ($set as $newQuestionCode => $newValue) {\n \n if (in_array(strtolower(trim($newValue)), $submittedAnswers)) {\n $answerCode = '2'; //YES\n } elseif (strlen($val) > 0) {\n $answerCode = '1'; //NO\n } else {\n $answerCode = '77' ; //NA\n }\n $processedCheckSet = array (\n 'QuestionCode' => $newQuestionCode,\n 'Answer' => $answerCode\n );\n array_push($questions,$processedCheckSet);\n }\n continue;\n }\n \n \n $answers = json_decode($element['options'], TRUE);\n \n //if there are coded options, $answers will be > 0,\n //but some coded options (in $alphaNums) no longer want their codes\n \n if ((!in_array($qCode,$alphaNums)) && (count ($answers) > 0)) {\n $codes = array_flip($answers);\n if (array_key_exists($val,$codes)) {\n $response = $codes[$val]; \n } else {\n $response = '';\n }\n } else {\n //keep free text\n $response = $val;\n }\n \n if (in_array($qCode, $code99)) {\n $blankCode = '99';\n } elseif (in_array ($qCode, $code88)){\n $blankCode = '88';\n } elseif (in_array ($qCode, $code77)){\n $blankCode = '77';\n } elseif (in_array($qCode, $code777)) {\n $blankCode = '777';\n } elseif (in_array($qCode, $code1)) {\n $blankCode = '1';\n } elseif (in_array($qCode, $codeDate)) {\n $blankCode = '7777-77-77'; \n } elseif (in_array($qCode, $codeNA)) {\n $blankCode = 'na'; \n } else {\n $blankCode = '';\n }\n \n if ($response == '') $response = $blankCode;\n \n $tempAnswerSet = array (\n 'QuestionCode' => $qCode,\n 'Answer' => $response\n );\n \n array_push($questions,$tempAnswerSet);\n \n }\n \n if ($form == '100') //Intake form requires age, will calculate\n {\n $ptcp = new Application_Model_DbTable_Participants;\n $ptcpID = $values['uid'];\n $ptcpRecord = $ptcp->getRecord($ptcpID);\n $age = $ptcpRecord['age'];\n $tempAnswerSet = array (\n 'QuestionCode' => 'age',\n 'Answer' => $age\n );\n array_push($questions,$tempAnswerSet); \n }\n \n if ($form == '103') //Discontinue form requires date twice\n {\n $tempAnswerSet = array (\n 'QuestionCode' => 'disc',\n 'Answer' => $values['responseDate']\n );\n \n array_push($questions,$tempAnswerSet);\n }\n \n /* LEGACY \n if ($form == '102' || $form == '113') { //In poverty forms, question-codes vary based on prepost\n \n if ($values['prepost'] == 'pre') {\n $suffix = 'a';\n $emptySuffix = 'b';\n } else {\n $suffix = 'b';\n $emptySuffix = 'a';\n }\n \n foreach ($questions as $key => $qArray) { \n $code = $qArray['QuestionCode'];\n \n $qArray['QuestionCode'] = $code . $suffix;\n $questions[$key] = $qArray;\n \n $emptyArray = array(\n 'QuestionCode' => $code . $emptySuffix,\n 'Answer' => '77'\n );\n array_push($questions, $emptyArray);\n }\n \n } */\n \n return $questions;\n }", "function get_input_array () {\n\t$input = array();\n\n\t// collect input values from the form\n\t$input['maker'] = isset($_POST['maker']) ? $_POST['maker'] : '';\n\t$input['model'] = isset($_POST['model']) ? $_POST['model'] : '';\n\t$input['speed'] = isset($_POST['speed']) ? $_POST['speed'] : '';\n\t$input['ram'] = isset($_POST['ram']) ? $_POST['ram'] : '';\n\t$input['hd'] = isset($_POST['hd']) ? $_POST['hd'] : '';\n\t$input['price'] = isset($_POST['price']) ? $_POST['price'] : '';\n\n\t// use the new_maker field instead of the maker field if it's set\n\t$new_maker = isset($_POST['new_maker']) ? $_POST['new_maker'] : '';\n\tif (!empty($new_maker)) {\n\t\t$input['maker'] = $new_maker;\n\t}\n\n\treturn $input;\n}", "public function getSubmissionArray($submission, $form) {\n $form_fields = $this->CI->form_m->getFormFields($form->form_id);\n// preVarDump($form_fields);\n foreach ($form_fields as $key => $field) {\n if ($field->field_type == 'textbox' || $field->field_type == 'textarea' || $field->field_type == 'datepicker') {\n $return_array[] = array(\n 'label' => $field->field_label,\n 'value' => $submission[$field->field_name],\n );\n } else if ($field->field_type == 'radios' || $field->field_type == 'checkboxes' || $field->field_type == 'select') {\n foreach ($field->options as $option) {\n if ($option->option_value == $submission[$field->field_name]) {\n $return_array[] = array(\n 'label' => $field->field_label,\n 'value' => $option->option_name,\n );\n }\n }\n }\n }\n \n \n\n return $return_array;\n }", "protected function buildRequestArray() {\n\n // isolate the action_data for the submission\n $field_map_data = $this->action_settings[ NF_ZohoCRM()->constants->field_map_action_key ];\n\n $auth_level = $this->auth_params->authLevel();\n\n $request_array_object = NF_ZohoCRM()->factory->buildRequestArray( $field_map_data, $auth_level );\n\n $field_map_array = $request_array_object->getFieldMapArray();\n\n NF_ZohoCRM()->stored_data->modifyCommData( $field_map_array, 'field_map_array', FALSE );\n\n $this->request_array = $request_array_object->getRequestArray();\n\n NF_ZohoCRM()->stored_data->modifyCommData( $this->request_array, 'request_array', FALSE );\n }", "function condition_form_submit($values) {\n $parsed = array();\n $items = explode(\"\\n\", $values);\n if (!empty($items)) {\n foreach ($items as $v) {\n $v = trim($v);\n if (!empty($v)) {\n $parsed[$v] = $v;\n }\n }\n }\n return $parsed;\n }", "function _onGetFormFieldsArray() {\n\t\t\n\t\t/* Are we resuming a paused submission ??? */\n\t\t$form_id = ( int ) bfRequest::getVar ( 'form_id' );\n\t\t$submission_id = ( int ) bfRequest::getVar ( 'submission_id' );\n\t\t$user = bfUser::getInstance ();\n\t\tif ($form_id && $submission_id && $user->get ( 'id' ) > 0) {\n\t\t\t\n\t\t\t/* get submission */\n\t\t\t$path = _BF_JPATH_BASE . DS . 'components' . DS . 'com_form' . DS . 'model' . DS . 'submission.php';\n\t\t\trequire_once ($path);\n\t\t\t$submission = new Submission ( );\n\t\t\t$submission->setTableName ( $form_id );\n\t\t\t$submission->get ( $submission_id );\n\t\t\t\n\t\t\t/* check its mine and paused */\n\t\t\tif ($submission->bf_status != 'Paused' || $submission->bf_user_id != $user->get ( 'id' )) {\n\t\t\t\tunset ( $submission );\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t$rows = array ();\n\t\t\n\t\tif (count ( $this->_FIELDS_CONFIG )) {\n\t\t\tforeach ( $this->_FIELDS_CONFIG as $field ) {\n\t\t\t\t$fieldname = 'FIELD_' . $field->id;\n\t\t\t\t\n\t\t\t\t$vars = array ();\n\t\t\t\tforeach ( $field as $k => $v ) {\n\t\t\t\t\t$vars [$k] = $v;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* if unpausing a submission then */\n\t\t\t\tif (isset ( $submission ) && @$submission->$fieldname != '') {\n\t\t\t\t\t\n\t\t\t\t\tswitch ($field->type) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"checkbox\" :\n\t\t\t\t\t\tcase \"radio\" :\n\t\t\t\t\t\t\t$field->multiple = $submission->$fieldname;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Tested and Works for: \n\t\t\t\t\t\t * textbox \n\t\t\t\t\t\t * textarea\n\t\t\t\t\t\t * select\n\t\t\t\t\t\t * password\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$field->value = $submission->$fieldname;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* Done unpausing */\n\t\t\t\t\n\t\t\t\tPlugins_Fields::loadPlugin ( $field->plugin );\n\t\t\t\t\n\t\t\t\tswitch ($field->plugin) {\n\t\t\t\t\tcase \"text\" :\n\t\t\t\t\t\t$field->plugin = 'textbox';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"file\" :\n\t\t\t\t\t\t$field->plugin = 'fileupload';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"UNKNOWN\" :\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$plugin = 'plugins_fields_' . $field->plugin;\n\t\t\t\t$fieldObj = new $plugin ( );\n\t\t\t\t$fieldObj->setConfig ( $field );\n\t\t\t\t\n\t\t\t\t$vars ['element'] = $fieldObj->toString ();\n\t\t\t\t$vars ['label'] = '';\n\t\t\t\t\n\t\t\t\t$rows [] = $vars;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rows;\n\t\n\t}", "public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "function getFormData($array) {\r\n $data = array();\r\n foreach($array as $key=>$dataname){\r\n $data[$dataname] = xtc_db_input($_POST[$dataname]);\r\n }\r\n return $data;\r\n }", "public static function createFromArray() {\n\n $args = func_get_args();\n\t\n\tswitch (count($args)) {\n\n\t\tcase 2: \n\t\t\t\t$buttonset = $args[0];\n\t\t\t\t$array = $args[1];\n\t\t\t\t$auto = 0; // don't auto-submit\n\t\t\t\tbreak;\n\n\t\tcase 3: \n\t\t\t\t$buttonset = $args[0];\n\t\t\t\t$array = $args[1];\n\t\t\t\t$atuo = DropDownList::testAutoSubmit($args[2]);\n\t\t\t\tbreak;\n }\n \n \t// Check to see if a choice has been made previously or is a session variable\n \n $choice = RadioButton::getChoice($buttonset);\n \n // Create the radio button set... \n if ($choice == -1) { // No choice made -- user prompted to select\n \n while (list($key, $value) = each ($array)) {\n echo \"<INPUT type=\\\"radio\\\" name=\\\"$buttonset\\\" value=\\\"$key\\\"> $value<BR>\"; \n } // end of while loop\n }\n else { // prior choice made -- select that value\n while (list($key, $value) = each ($array)) {\n if ($key == $choice) { echo \"<INPUT type=\\\"radio\\\" name=\\\"$buttonset\\\" value=\\\"$key\\\" checked> $value<BR>\"; }\n else { echo \"<INPUT type=\\\"radio\\\" name=\\\"$buttonset\\\" value=\\\"$key\\\"> $value<BR>\"; }\n } // end of while loop\n \n }\n \n return;\n \n}", "protected static function getValues() \n\t{\n\t\t$values = [\n\t\t\t'title_id' => isset($_POST['title_id']) ? $_POST['title_id'] : null,\n\t\t\t'firstname' => isset($_POST['firstname']) ? $_POST['firstname'] : null,\n\t\t\t'dob' => isset($_POST['dob']) ? $_POST['dob'] : null,\n\t\t\t'client_type' => isset($_POST['client_type']) ? $_POST['client_type'] : null,\n\t\t\t'company_phone' => isset($_POST['company_phone']) ? $_POST['company_phone'] : null,\n\t\t\t'country_id' => isset($_POST['country_id']) ? $_POST['country_id'] : null,\n\t\t\t'surname' => isset($_POST['surname']) ? $_POST['surname'] : null,\n\t\t\t'phone' => isset($_POST['phone']) ? $_POST['phone'] : null,\n\t\t\t'company_name' => isset($_POST['company_name']) ? $_POST['company_name'] : null,\n\t\t\t'company_country' => isset($_POST['company_country']) ? $_POST['company_country'] : null,\n\t\t\t'email' => isset($_POST['email']) ? $_POST['email'] : null,\n\t\t\t'confirm-email' => isset($_POST['confirm-email']) ? $_POST['confirm-email'] : null,\n\t\t];\n\t\t\n\t\treturn $values;\n\t}", "public abstract function validateFormInput($FORM_array);", "public function getValues( array $arr = array() ){\n $values = isset( $arr['__post'] ) ? $arr['__post'] : $arr;\n if( !isset($arr[ self::returnName($this->getName()) ]) ){\n $formPrefix = $this->getName().'/';\n foreach( $values as $k => $v ){\n if( strpos( $k, $formPrefix ) == 0 ){\n $this->values[ substr( $k, strlen($formPrefix) ) ] = $v;\n }\n }\n } else {\n $data = $arr[ self::returnName( $this->getName() ) ];\n foreach( $data as $k => $v ){\n $this->values[ $k ] = $v;\n }\n }\n\n if( isset( $arr['__errors'] ) ){\n $this->errors = $arr['__errors'];\n }\n }", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "public function getFormData(){\n\n\t\t\t\n\t\t\t$expectedVariables = ['title','email','checkbox'];\n\n\n\t\t\tforeach ($expectedVariables as $variable) {\n\n\t\t\t\t// creating entries for error field\t\n\t\t\t\t$this->moviesuggest['errors'][$variable]=\"\";\n\n\t\t\t\t// move all $_POST values into MovieSuggest array\n\t\t\t\tif(isset($_POST[$variable])){\n\t\t\t\t\t$this->moviesuggest[$variable] = $_POST[$variable];\n\t\t\t\t}else{\n\t\t\t\t\t$this->moviesuggest[$variable] = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// var_dump($moviesuggest);\n\t\t\t// die();\n\t}", "public function options_form_submit($values) {\n $data = array();\n\n // Build an array of key-value pairs.\n if (!empty($values['data']['context_datalayer'])) {\n foreach ($values['data']['context_datalayer'] as $key) {\n $data[$key] = $values['data']['values'][$key];\n }\n }\n\n // AJAX handler for Add and Remove buttons.\n if (strstr(request_uri(), 'system/ajax')) {\n $form_state = array('submitted' => FALSE);\n $form_build_id = $_POST['form_build_id'];\n $form = form_get_cache($form_build_id, $form_state);\n\n $form_state['input'] = $_POST;\n $form_state['values'] = array();\n $form = form_builder($form['#form_id'], $form, $form_state);\n\n switch ($form_state['triggering_element']['#value']) {\n case t('Add Reaction'):\n $key = $values['data']['add']['key'];\n $value = $values['data']['add']['value'];\n // @todo: Move this to the validation callback.\n if (empty($key)) {\n form_set_error('', t('Key is a required field.'));\n break;\n }\n if (empty($value)) {\n form_set_error('', t('Value is a required field.'));\n break;\n }\n if (!empty($data[$key])) {\n form_set_error('', t('Key \"%key\" already exists.', array('%key' => $key)));\n break;\n }\n\n $data[$key] = $value;\n break;\n\n case t('Remove'):\n unset($data[$form_state['triggering_element']['#name']]);\n break;\n }\n }\n\n ksort($data);\n return array(\n 'overwrite' => $values['overwrite'],\n 'data' => $data,\n );\n }", "public static function getFormComponents(): array {\n return [\n 'title' => ['attr' => ['required' => true, 'maxlength' => AppConstants::INDEXED_STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'status' => ['type' => 'translated', 'attr' => ['required' => true, 'maxlength' => AppConstants::INDEXED_STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'startDate' => ['type' => 'date', 'attr' => ['required' => true]],\n 'endDate' => ['type' => 'date', 'attr' => ['required' => true]],\n 'price' => ['attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n 'type' => ['type' => 'translated', 'attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n // 'major_id' => ['type'=>'reference','attr' => ['maxlength' => AppConstants::STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'requiredNumberOfUsers' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'appliedUsersCount' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'language' => ['details-type' => 'multi-data'],\n 'location' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'workHoursCount' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'willTakeCertificate' => ['type' => 'boolean', 'attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n // 'major' => [\n // 'type' => 'reference',\n // 'reference' => 'major.name',\n // 'displayColumn' => 'major.name',\n // ],\n 'company' => [\n 'type' => 'reference',\n 'reference' => 'company.name',\n 'displayColumn' => 'company.name',\n ],\n 'requiredNumberOfUsers' => ['attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n 'briefDescription' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'fullDescription' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'majors' => ['details-type' => 'multi-data-majors'],\n\n ];\n }", "protected function parseValues($_values)\n\t{\n\t\t$use_ingroup = $this->field->parameters->get('use_ingroup', 0);\n\t\t$multiple = $use_ingroup || (int) $this->field->parameters->get('allow_multiple', 0);\n\n\t\t// Make sure we have an array of values\n\t\tif (!$_values)\n\t\t{\n\t\t\t$vals = array(array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vals = !is_array($_values)\n\t\t\t\t? array($_values)\n\t\t\t\t: $_values;\n\t\t}\n\n\t\t// Compatibility with legacy storage, we no longer serialize all values to one, this way the field can be reversed and filtered\n\t\tif (count($vals) === 1 && is_string(reset($vals)))\n\t\t{\n\t\t\t$array = $this->unserialize_array(reset($vals), $force_array = false, $force_value = false);\n\t\t\t$vals = $array ?: $vals;\n\t\t}\n\n\t\t// Force multiple value format (array of arrays)\n\t\tif (!$multiple)\n\t\t{\n\t\t\tif (is_string(reset($vals)))\n\t\t\t{\n\t\t\t\t$vals = array($vals);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($vals as & $v)\n\t\t\t{\n\t\t\t\tif (!is_array($v))\n\t\t\t\t{\n\t\t\t\t\t$v = strlen($v) ? array($v) : array();\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($v);\n\t\t}\n\n\t\t//echo '<div class=\"alert alert-info\"><h2>parseValues(): ' . $this->field->label . '</h2><pre>'; print_r($vals); echo '</pre></div>';\n\t\treturn $vals;\n\t}", "function setInputValues( array $values );", "public function safe_array()\n\t{\n\t\t// Load choices\n\t\t$choices = func_get_args();\n\t\t$choices = empty($choices) ? NULL : array_combine($choices, $choices);\n\n\t\t// Get field names\n\t\t$fields = $this->field_names();\n\n\t\t$safe = array();\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\tif ($choices === NULL OR isset($choices[$field]))\n\t\t\t{\n\t\t\t\tif (isset($this[$field]))\n\t\t\t\t{\n\t\t\t\t\t$value = $this[$field];\n\n\t\t\t\t\tif (is_object($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Convert the value back into an array\n\t\t\t\t\t\t$value = $value->getArrayCopy();\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// Even if the field is not in this array, it must be set\n\t\t\t\t\t$value = NULL;\n\t\t\t\t}\n\n\t\t\t\t// Add the field to the array\n\t\t\t\t$safe[$field] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $safe;\n\t}", "function getInputValues() {\r\n $vals = array();\r\n \r\n $vals['datetime'] = @$_REQUEST['datetime'];\r\n $vals['mileage'] = @$_REQUEST['mileage'];\r\n $vals['location'] = @$_REQUEST['location'];\r\n $vals['pricepergallon'] = @$_REQUEST['pricepergallon'];\r\n $vals['gallons'] = @$_REQUEST['gallons'];\r\n $vals['grade'] = @$_REQUEST['grade'];\r\n $vals['pumpprice'] = @$_REQUEST['pumpprice'];\r\n $vals['notes'] = @$_REQUEST['notes'];\r\n \r\n return $vals;\r\n}", "public function getPostValues()\n {\n // Define the check for params\n $post_check_array = array(\n // submit action\n 'toevoegen' => array('filter' => FILTER_SANITIZE_STRING),\n 'bijwerken' => array('filter' => FILTER_SANITIZE_STRING),\n 'verwijderen' => array('filter' => FILTER_SANITIZE_STRING),\n // question\n 'vraag' => array('filter' => FILTER_SANITIZE_STRING),\n // question type (open or closed)\n 'vraagId' => array('filter' => FILTER_SANITIZE_INT),\n // question type (open or closed)\n 'vraagSoort' => array('filter' => FILTER_SANITIZE_STRING),\n // Education\n 'opleiding' => array('filter' => FILTER_SANITIZE_STRING),\n // question send time\n 'verstuurTijd' => array('filter' => FILTER_SANITIZE_STRING)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n // RTS\n return $inputs;\n }", "function create_content_array()\n {\n if ($this->fetch_post('cancel', false)) {\n $this->redirect(page::fetch_post('redirect'));\n } else {\n // set action url\n $action = INFORMAL_URLBASE . '?'\n . $_SERVER['QUERY_STRING'];\n \n // find out where this page has been called from\n $redirect = $_SERVER['HTTP_REFERER'];\n \n // create form instance\n $form = new form('add', 'post', $action);\n \n // add text input field and make mandatory\n $form->addElement('text', 'name', 'Form Name');\n $form->set_mandatory('name');\n \n // add hidden field for redirect target\n $form->addElement('hidden', 'redirect', $redirect);\n \n // add buttons\n $button_submit = &HTML_QuickForm::createElement('submit',\n 'submit', 'erstelle Form', 'class=\"submitButton\"');\n $button_cancel = &HTML_QuickForm::createElement('submit',\n 'cancel', 'abbrechen', 'class=\"submitButton\"');\n \n // group buttons\n $form->addGroup(array($button_submit, $button_cancel));\n \n // see if form validates\n if ($form->validate()) {\n $name = $form->getElementValue('name');\n $all_forms = new all_forms();\n $new_form_id = $all_forms->add_form($name);\n // redirect either to a given url or the http referer\n if ($this->redirect_url) {\n // %d is replaced by new form id\n $url = sprintf($this->redirect_url, $new_form_id);\n $this->redirect($url);\n } else {\n $this->redirect(page::fetch_post('redirect'));\n }\n } else {\n $content['form'] = $form->smarty_html($this);\n }\n \n // return content html for page\n return $content;\n }\n }", "public function transfArray($valuepost) {\n\t\t$total = 0;\n\t\tforeach ( $valuepost as $value ) {\n\t\t\t$arr [$total] = $this->validStringForm ( $value );\n\t\t\t$total ++;\n\t\t}\n\t\treturn $arr;\n\t}", "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 check_all_incomming_vars($request_array, $save_name = null) {\n//checks all the incomming vars\n// V0.8 forces the use of an non empty array\n// if (empty($request_array)) {\n// $request_array = $_REQUEST;\n// } else {\n if (!is_array($request_array)) {\n die(__FUNCTION__ . \" need an array to work\");\n }\n// }\n $form = array();\n foreach ($request_array as $index => $value) {\n if (!is_array($value)) {\n $form[$index] = \\k1lib\\forms\\check_single_incomming_var($value);\n } else {\n $form[$index] = check_all_incomming_vars($value);\n }\n }\n if (!empty($save_name)) {\n \\k1lib\\common\\serialize_var($form, $save_name);\n }\n return $form;\n}", "function parse_form($array) {\n// build reserved keyword array\n//Anything put in here will not show up in your email when form is processed\n $reserved_keys[] = \"MAX_FILE_SIZE\";\n $reserved_keys[] = \"required\";\n $reserved_keys[] = \"redirect\";\n //$reserved_keys[] = \"email\";\n $reserved_keys[] = \"require\";\n $reserved_keys[] = \"path_to_file\";\n $reserved_keys[] = \"recipient\";\n $reserved_keys[] = \"subject\";\n $reserved_keys[] = \"bgcolor\";\n $reserved_keys[] = \"text_color\";\n $reserved_keys[] = \"link_color\";\n $reserved_keys[] = \"vlink_color\";\n $reserved_keys[] = \"alink_color\";\n $reserved_keys[] = \"title\";\n $reserved_keys[] = \"missing_fields_redirect\";\n $reserved_keys[] = \"env_report\";\n $reserved_keys[] = \"Submit\";\n $reserved_keys[] = \"submit\";\n //$reserved_keys[] = \"name\";\n $reserved_keys[] = \"Name\";\n $reserved_keys[] = \"submit_x\";\n $reserved_keys[] = \"submit_y\";\n $reserved_keys[] = \"sendit\";\n if (count($array)) {\n while (list($key, $val) = each($array)) {\n//check for email injection\n\t\tif(!has_no_emailheaders($val)){\n\t\t\tprint_error(\"Please don't spam\");\n\t\t}\n\t\t\n// exclude reserved keywords\n $reserved_violation = 0;\n for ($ri=0; $ri<count($reserved_keys); $ri++) {\n if ($key == $reserved_keys[$ri]) $reserved_violation = 1;\n }\n// prepare content\n if ($reserved_violation != 1) {\n\t// let's check to see if they are check boxes\n if (is_array($val)) {\n for ($z=0; $z<count($val); $z++) {\n $nn=$z+1;\n $content .= \"$key #$nn: $val[$z]\\n\";\n }\n }\n\t // if the values contains nothing do nothing then\n\t // don't add it to the content)\n elseif($val != \"\") $content .= \"$key: $val\\n\";\n }\n } // end of while\nreturn $content;\n }\n}", "public function getFormValues()\n {\n return array(\n 'title' => $this->issue['subject'],\n 'reference' => $this->issue['id'],\n 'date_started' => $this->issue['start_date'],\n 'description' => $this->issue['description']\n );\n }", "public function form() {\n\t\treturn array();\n\t}", "public function getFormValues()\n {\n $validator = App::make(SubmitForm::class);\n return $validator->getSubmissions();\n }", "function isubmit_multi($array, $label, $confirm = false, $class = false, $id = false)\r\n{\r\n $name = 'multi_var';\r\n $value = ret_multivar($array);\r\n\r\n isubmit($name, $value, $label, $confirm, $class, $id);\r\n}", "function obtenerDataForm( $pairs ){\r\n\t\t$dataform = array();\r\n\t\t//Chequeo por pares (campo=valor),(campo=valor),...,(campo=valor)\r\n\t\tforeach ( $pairs as $i ) {\r\n\t\t\tlist( $name, $value ) = explode( '=', $i, 2 );\r\n\t\t\t$par[\"f\"] = urldecode( $name );\r\n\t\t\t$par[\"v\"] = urldecode( $value );\r\n\t\t\t$dataform[] = $par;\r\n\t\t}\r\n\t\t//$dataform = insertarFecha( $dataform );\r\n\t\treturn $dataform;\r\n\t}", "function process_post()\n{\n $myReturn = ''; //set to initial empty value\n\n foreach($_POST as $varName=> $value)\n {#loop POST vars to create JS array on the current page - include email\n $strippedVarName = str_replace(\"_\",\" \",$varName);#remove underscores\n if(is_array($_POST[$varName]))\n {#checkboxes are arrays, and we need to collapse the array to comma separated string!\n $myReturn .= $strippedVarName . \": \" . implode(\",\",$_POST[$varName]) . PHP_EOL;\n }else{//not an array, create line\n $myReturn .= $strippedVarName . \": \" . $value . PHP_EOL;\n }\n }\n return $myReturn;\n}", "function options_form($value, &$handler = NULL) {\n return array();\n }", "protected function setSubmittedValues()\n {\n if ( $this->setFundraiserId() ) {\n $this->setFundraiserProfile(); \n }\n\n $this->setAmount();\n \n $this->setFirstName();\n $this->setLastName();\n $this->setEmail();\n $this->setTelephone();\n \n $this->setAddress();\n $this->setCity();\n $this->setCountry();\n $this->setRegion();\n $this->setPostalCode();\n \n $this->setAnonymity();\n $this->setHideAmount();\n }", "function process_post()\r\n{\r\n $myReturn = ''; //set to initial empty value\r\n\r\n foreach($_POST as $varName=> $value)\r\n {#loop POST vars to create JS array on the current page - include email\r\n $strippedVarName = str_replace(\"_\",\" \",$varName);#remove underscores\r\n if(is_array($_POST[$varName]))\r\n {#checkboxes are arrays, and we need to collapse the array to comma separated string!\r\n $myReturn .= $strippedVarName . \": \" . implode(\",\",$_POST[$varName]) . PHP_EOL;\r\n }else{//not an array, create line\r\n $myReturn .= $strippedVarName . \": \" . $value . PHP_EOL;\r\n }\r\n }\r\n return $myReturn;\r\n}", "protected function getPostValues() {}", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n\n // Adding default value to the list\n\n // Setting the lists in $data array\n $data = [\n ];\n\n //dd($data);\n\n return $data;\n }", "function processPost($formvalues) {\n\t\t// trim spaces from the name field\n\t\tif(isArrayKeyAnEmptyString('status', $formvalues)){\n\t\t\tunset($formvalues['status']);\n\t\t}\n\t\tif(isArrayKeyAnEmptyString('starttime', $formvalues)){\n\t\t\t$formvalues['starttime'] = NULL;\n\t\t} else {\n\t\t\t$formvalues['starttime'] = date(\"H:i:s\", strtotime($formvalues['starttime']));\n\t\t}\n\t\tif(isArrayKeyAnEmptyString('endtime', $formvalues)){\n\t\t\t$formvalues['endtime'] = NULL;\n\t\t} else {\n\t\t\t$formvalues['endtime'] = date(\"H:i:s\", strtotime($formvalues['endtime']));\n\t\t}\n\t\tif(isArrayKeyAnEmptyString('startdate', $formvalues)){\n\t\t\tif(!isArrayKeyAnEmptyString('startdate_old', $formvalues)){\n\t\t\t\t$formvalues['startdate'] = NULL;\n\t\t\t} else {\n\t\t\t\tunset($formvalues['startdate']);\n\t\t\t}\n\t\t} else {\n\t\t\t$formvalues['startdate'] = date('Y-m-d', strtotime($formvalues['startdate']));\n\t\t}\n\t\tif(isArrayKeyAnEmptyString('enddate', $formvalues)){\n\t\t\tif(!isArrayKeyAnEmptyString('enddate_old', $formvalues)){\n\t\t\t\t$formvalues['enddate'] = NULL;\n\t\t\t} else {\n\t\t\t\tunset($formvalues['enddate']);\n\t\t\t}\n\t\t} else {\n\t\t\t$formvalues['enddate'] = date('Y-m-d', strtotime($formvalues['enddate']));\n\t\t}\n\t\t\n\t\tif(!isArrayKeyAnEmptyString('workingdaysids', $formvalues)) {\n\t\t\t$formvalues['workingdays'] = implode(',', $formvalues['workingdaysids']);\n\t\t} else {\n\t\t\tif(!isArrayKeyAnEmptyString('workingdays_old', $formvalues)){\n\t\t\t\tif(isArrayKeyAnEmptyString('workingdaysids', $formvalues)) {\n\t\t\t\t\t$formvalues['workingdays'] = NULL;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset($formvalues['workingdays']);\n\t\t\t}\n\t\t}\n\t\t// debugMessage($formvalues); exit();\n\t\tparent::processPost($formvalues);\n\t}", "public function PostProcessFormValues($FormArray)\n {\n // extend this function to process values -- simply return the array back\n return $FormArray;\n }", "public function getPostValues() {\n $post_check_array = array(\n// submit action\n 'add' => array('filter' => FILTER_SANITIZE_STRING),\n 'update' => array('filter' => FILTER_SANITIZE_STRING),\n // List all update form fields !!!\n// event type name.\n 'datum' => array('filter' => FILTER_SANITIZE_STRING),\n 'prioriteit' => array('filter' => FILTER_SANITIZE_STRING),\n 'username' => array('filter' => FILTER_SANITIZE_STRING),\n 'user' => array('filter' => FILTER_SANITIZE_STRING),\n 'password' => array('filter' => FILTER_SANITIZE_STRING),\n // Help text\n 'status' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'alarm_id' => array('filter' => FILTER_VALIDATE_INT),\n 'alarm_noticed' => array('filter' => FILTER_VALIDATE_INT),\n\t\t\t'alarm_origin' => array('filter' => FILTER_SANITIZE_STRING)\n );\n// Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n// RTS\n return $inputs;\n }", "private function buildValidFormData()\n {\n $attributes = $this->getAttributeTypes();\n\n $result = [\n 'dashboard_bundle_entity_type[publishButton]' => '',\n 'dashboard_bundle_entity_type[metadata][importUrl]' => 'https://engine.surfconext.nl/authentication/sp/metadata',\n 'dashboard_bundle_entity_type[metadata][pastedMetadata]' => '',\n 'dashboard_bundle_entity_type[metadata][metadataUrl]' => 'https://sp2-surf.com/metadata',\n 'dashboard_bundle_entity_type[metadata][entityId]' => 'https://sp2-surf.com',\n 'dashboard_bundle_entity_type[metadata][nameIdFormat]' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',\n 'dashboard_bundle_entity_type[metadata][certificate]' => file_get_contents(__DIR__ . '/fixtures/publish/valid.cer'),\n 'dashboard_bundle_entity_type[metadata][logoUrl]' => 'https://sp2-surf.com/images/logo.png',\n 'dashboard_bundle_entity_type[metadata][nameNl]' => 'De Nederlandse naam voor dit entity',\n 'dashboard_bundle_entity_type[metadata][descriptionNl]' => 'SURF SP2 Description Dutch',\n 'dashboard_bundle_entity_type[metadata][nameEn]' => 'SURF SP2 Name English',\n 'dashboard_bundle_entity_type[metadata][descriptionEn]' => 'SURF SP2 Description English',\n 'dashboard_bundle_entity_type[metadata][applicationUrl]' => '',\n 'dashboard_bundle_entity_type[metadata][eulaUrl]' => '',\n 'dashboard_bundle_entity_type[contactInformation][administrativeContact][firstName]' => 'Jane',\n 'dashboard_bundle_entity_type[contactInformation][administrativeContact][lastName]' => 'Doe',\n 'dashboard_bundle_entity_type[contactInformation][administrativeContact][email]' => '[email protected]',\n 'dashboard_bundle_entity_type[contactInformation][administrativeContact][phone]' => '',\n 'dashboard_bundle_entity_type[contactInformation][technicalContact][firstName]' => 'Joe',\n 'dashboard_bundle_entity_type[contactInformation][technicalContact][lastName]' => 'Doe',\n 'dashboard_bundle_entity_type[contactInformation][technicalContact][email]' => '[email protected]',\n 'dashboard_bundle_entity_type[contactInformation][technicalContact][phone]' => '',\n 'dashboard_bundle_entity_type[contactInformation][supportContact][firstName]' => 'givenname',\n 'dashboard_bundle_entity_type[contactInformation][supportContact][lastName]' => 'surname',\n 'dashboard_bundle_entity_type[contactInformation][supportContact][email]' => '[email protected]',\n 'dashboard_bundle_entity_type[contactInformation][supportContact][phone]' => 'telephonenumber',\n 'dashboard_bundle_entity_type[comments][comments]' => 'I need a new name NL'\n ];\n\n foreach ($attributes as $attribute) {\n\n $entry = sprintf('dashboard_bundle_entity_type[attributes][%s][motivation]', $attribute->getName());\n $entryRequested = sprintf('dashboard_bundle_entity_type[attributes][%s][requested]', $attribute->getName());\n $result[$entryRequested] = true;\n $result[$entry] = 'some data here!';\n }\n\n return $result;\n }", "private function getSelectFormValues()\n {\n $program_id = User::getLoggedInUser()->getCurrentProgram()->id;\n $selection_by = $this->_getParam('selection_by');\n $all_students = true;\n\n if ($selection_by == \"by-requirements\") {\n $default_filters = array('graduationStatus' => array(1), 'show_instructors' => 1);\n\n // format sub-filters for the students\n $filters = [];\n\n if ($this->_getParam('graduationMonth')) {\n $filters['graduationMonth'] = $this->_getParam('graduationMonth');\n }\n if ($this->_getParam('graduationYear')) {\n $filters['graduationYear'] = $this->_getParam('graduationYear');\n }\n if ($this->_getParam('certs')) {\n $filters['certificationLevels'] = $this->_getParam('certs');\n }\n if ($this->_getParam('status')) {\n $filters['graduationStatus'] = $this->_getParam('status');\n }\n if ($this->_getParam('groups')) {\n $filters['section'] = $this->_getParam('groups');\n }\n $filters['show_instructors'] = $this->_getParam('show_instructors');\n\n // if the filters are different than our standard set\n if ($filters != $default_filters) {\n $all_students = false;\n } else {\n $all_students = true;\n }\n\n if ($this->_getParam('all_students')) {\n $all_students = true;\n $filters = $default_filters;\n }\n $userContextIds = $this->getRoleDataIds($filters, $this->getParam('show_instructors'));\n $requirement_ids = array_unique($this->_getParam('requirement_ids'));\n } else {\n $userContextIds = $this->getParam('userContextIds');\n $requirement_ids = $this->requirementRepository->getRequirements($program_id, true, true, true, true);\n }\n\n $selectFormValues = [\n \"selection-by\" => $selection_by,\n \"userContextIds\" => $userContextIds,\n \"requirementIds\" => $requirement_ids,\n \"people_sub_filters\" => $filters,\n \"all_students\" => $all_students\n ];\n\n return $selectFormValues;\n }", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n $client = new Client();\n $street_type = new StreetType();\n $state = new State();\n\n // Adding default value to the list\n $clients = $client->getSelectList();\n $street_types = $street_type->getSelectList();\n $states = $state->getSelectList();\n\n // Setting the lists in $data array\n $data = [\n 'clients' => $clients,\n 'street_types' => $street_types,\n 'states' => $states,\n ];\n\n //dd($data);\n\n return $data;\n }", "function pnFormGetValues()\n {\n $result = array();\n\n $this->pnFormGetValues_rec($this->pnFormPlugins, $result);\n\n return $result;\n }", "function getFormValues($selectList = false)\n\t{\n\t\tif (!$this->formSubmitted())\n\t\t\treturn false;\n\t\t\t\n\t\t$returnList = array();\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\t// Don't return custom types\n\t\t\tif ($element->type == 'custom') {\n\t\t\t\tcontinue;\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif ($selectList && is_array($selectList))\n\t\t\t{\n\t\t\t\t// Only add if in the list of specified elements.\n\t\t\t\tif (in_array($element->name, $selectList)) {\t\t\t\n\t\t\t\t\t$returnList[$element->name] = $element->value;\n\t\t\t\t}\n\t\t\t} \n\t\t\t// Add anyway, no list to choose from.\n\t\t\telse {\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$returnList[$element->name] = $element->value;\n\t\t\t}\n\t\t\t\n\t\t} // end of foreach\n\t\t\n\t\treturn $returnList;\n\t}", "function processPost($formvalues) {\n\t\t// check if the parentid is specified\n\t\tif (isArrayKeyAnEmptyString('type', $formvalues)) {\n\t\t\tunset($formvalues['type']);\n\t\t}\n\t\tif (isArrayKeyAnEmptyString('farmistype', $formvalues)) {\n\t\t\tunset($formvalues['farmistype']);\n\t\t}\n\t\tif (isArrayKeyAnEmptyString('status', $formvalues)) {\n\t\t\tunset($formvalues['status']);\n\t\t}\n\t\tif (isArrayKeyAnEmptyString('showind', $formvalues)) {\n\t\t\tunset($formvalues['showind']);\n\t\t}\n\t\t\n\t\tif(!isArrayKeyAnEmptyString('theregionids', $formvalues)) {\n\t\t\t$ids = $formvalues['theregionids'];\n\t\t\t$typelist = '';\n\t\t\tif(count($ids) > 0){\n\t\t\t\t$typelist = createHTMLCommaListFromArray($ids, \",\");\n\t\t\t}\n\t\t\t$formvalues['regionids'] = $typelist;\n\t\t\t# remove the usergroups_groupid array, it will be ignored, but to be on the safe side\n\t\t\tunset($formvalues['theregionids']);\n\t\t} else {\n\t\t\tif(!isArrayKeyAnEmptyString('regionids_old', $formvalues)){\n\t\t\t\t$formvalues['regionids'] = NULL;\n\t\t\t} else {\n\t\t\t\tunset($formvalues['regionids']);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!isArrayKeyAnEmptyString('thedistrictids', $formvalues)) {\n\t\t\t$ids = $formvalues['thedistrictids'];\n\t\t\t$typelist = '';\n\t\t\tif(count($ids) > 0){\n\t\t\t\t$typelist = createHTMLCommaListFromArray($ids, \",\");\n\t\t\t}\n\t\t\t$formvalues['districtids'] = $typelist;\n\t\t\t# remove the usergroups_groupid array, it will be ignored, but to be on the safe side\n\t\t\tunset($formvalues['thedistrictids']);\n\t\t} else {\n\t\t\tif(!isArrayKeyAnEmptyString('districtids_old', $formvalues)){\n\t\t\t\t$formvalues['districtids'] = NULL;\n\t\t\t} else {\n\t\t\t\tunset($formvalues['districtids']);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!isArrayKeyAnEmptyString('thednaids', $formvalues)) {\n\t\t\t$ids = $formvalues['thednaids'];\n\t\t\t$typelist = '';\n\t\t\tif(count($ids) > 0){\n\t\t\t\t$typelist = createHTMLCommaListFromArray($ids, \",\");\n\t\t\t}\n\t\t\t$formvalues['dnaids'] = $typelist;\n\t\t\t# remove the usergroups_groupid array, it will be ignored, but to be on the safe side\n\t\t\tunset($formvalues['thednaids']);\n\t\t} else {\n\t\t\tif(!isArrayKeyAnEmptyString('dnaids_old', $formvalues)){\n\t\t\t\t$formvalues['dnaids'] = NULL;\n\t\t\t} else {\n\t\t\t\tunset($formvalues['dnaids']);\n\t\t\t}\n\t\t}\n\t\t// debugMessage($formvalues); // exit;\n\t\tparent::processPost($formvalues);\n\t}", "protected function form()\n {\n return [];\n }", "protected function form()\n {\n return [];\n }", "public function store_form_values($form_values){\n\t\t$this->__construct($form_values);\n\t}", "public static function init($arr)\n {\n //print_r($arr);\n //exit;\n self::makeFormString($arr);\n }", "public function getFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n $value = $element['object']->getSubmittedValue();\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "public function createEmployeeArray($request){\n return array(\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'email'\t\t\t => $request->email,\n 'phone'\t\t\t => $request->phone,\n 'company_id' => $request->company_id\n );\n }", "function qa_post_array($field)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tif (!isset($_POST[$field]) || !is_array($_POST[$field])) {\n\t\treturn null;\n\t}\n\n\t$result = array();\n\tforeach ($_POST[$field] as $key => $value)\n\t\t$result[$key] = preg_replace('/\\r\\n?/', \"\\n\", trim(qa_gpc_to_string($value)));\n\n\treturn $result;\n}", "public function processAdminGatewayForm(array $values) {\n return $values;\n }", "public static function getForm($dataArray = array()){\n $dataForm = new Form('cptvisit');\n\n $dataForm->add('Select', 'cptNbDigit')\n ->label('nombre de chiffres du compteur')\n ->choices(Array(\n 5=>'00005',\n 6=>'000006',\n 7=>'0000007',\n 8=>'00000008',\n 9=>'000000009')\n )\n ->required(true);\n\n $dataForm->add('Text', 'cptBeginDigit')\n ->label('Votre compteur commence à')\n ->required(FALSE);\n\n\n $dataForm->add('Submit', 'submit')->value('Mettre à jour');\n\n $dataForm->bound($dataArray);\n\n return $dataForm;\n }", "function re_post_form($var, $ignore=array('submit'))\r\n{\r\n $input_hiddens = '';\r\n\r\n foreach($var as $k=>$v)\r\n {\r\n $k = format_str($k);\r\n if(in_array($k, $ignore)!=false) continue;\r\n\r\n if(is_array($v))\r\n {\r\n foreach($v as $k2=>$v2){\r\n $input_hiddens .= \"<input type='hidden' name='{$k}[{$k2}]' value='{$v2}' />\\r\\n\";\r\n }\r\n }\r\n else{\r\n $input_hiddens .= \"<input type='hidden' name='{$k}' value='{$v}' />\\r\\n\";\r\n }\r\n }\r\n\r\n return $input_hiddens;\r\n}", "public static function Form() : iterable\n {\n return [\n 'role_id' => '',\n 'staff_id' => '',\n 'full_name' => '',\n 'date_of_appointment' => '',\n 'status' => '',\n 'category' => '',\n 'phone_number' => '',\n 'highest_qualification' => '',\n 'branch_id' => '',\n 'email' => '',\n 'address' => '',\n 'gender' => '',\n 'referee_1' => '',\n 'referee_2' => '',\n 'referee_1_phone_no' => '',\n 'referee_2_phone_no' => '',\n 'date_of_birth' => '',\n 'nationality' => '',\n 'next_of_kin_name' => '',\n 'next_of_kin_phone_no' => '',\n 'guarantor_name' => '',\n 'guarantor_phone_no' => '',\n 'guarantor_address' => '',\n 'guarantor_relationship' => '',\n 'guarantor_name_2' => '',\n 'guarantor_phone_no_2' => '',\n 'guarantor_address_2' => '',\n 'guarantor_relationship_2' => '',\n 'cv' => '',\n ];\n }", "private function prepareConfigFormArrays()\n {\n if ((float) _PS_VERSION_ >= 1.6) {\n $switch = 'switch';\n } else {\n $switch = 'radio';\n }\n $orderStatesData = OrderState::getOrderStates($this->context->language->id);\n $orderStates = [];\n foreach ($orderStatesData as $state) {\n array_push($orderStates, [\n 'id_option' => $state['id_order_state'],\n 'name' => $state['name'],\n ]);\n }\n\n $generalSettings = require_once dirname(__FILE__).'/ConfigFieldsDef/GeneralSettingsDefinition.php';\n $basicPayment = require_once dirname(__FILE__).'/ConfigFieldsDef/BasicPaymentDefinition.php';\n $blikPayment = require_once dirname(__FILE__).'/ConfigFieldsDef/BlikPaymentDefinition.php';\n $cardPayment = require_once dirname(__FILE__).'/ConfigFieldsDef/CardPaymentDefinition.php';\n\n return [$generalSettings, $basicPayment, $blikPayment, $cardPayment];\n }", "function prepare_form_vars($recipient_guids = null, $message_type = null, $entity = null) {\n\n\tif (!$message_type) {\n\t\t$message_type = Message::TYPE_PRIVATE;\n\t}\n\n\t$recipient_guids = Group::create($recipient_guids)->guids();\n\t\n\t$policy = new Config();\n\t$ruleset = $policy->getRuleset($message_type);\n\n\t$values = array(\n\t\t'entity' => $entity,\n\t\t'multiple' => $ruleset->allowsMultipleRecipients(),\n\t\t'has_subject' => $ruleset->hasSubject(),\n\t\t'allows_attachments' => $ruleset->allowsAttachments(),\n\t\t'subject' => ($entity) ? \"Re: $entity->title\" : '',\n\t\t'body' => '',\n\t\t'recipient_guids' => $recipient_guids,\n\t\t'message_type' => $message_type,\n\t);\n\n\tif (elgg_is_sticky_form('messages')) {\n\t\t$sticky = elgg_get_sticky_values('messages');\n\t\tforeach ($sticky as $field => $value) {\n\t\t\tif ($field == 'recipient_guids' && is_string($value)) {\n\t\t\t\t$value = string_to_tag_array($value);\n\t\t\t}\n\t\t\t$values[$field] = $value;\n\t\t}\n\t}\n\n\telgg_clear_sticky_form('messages');\n\treturn $values;\n}", "function testValidateAddsValidatedValuesToPassedInArrayByValidateFieldset() {\n\t\t// arrange\n\t\tglobal $post;\n\t\t$_POST = array( 'field_num' => '0123456789', 'field_desc' => 'description' );\n\t\t$testValidFieldsetField = new TestValidFieldsetField();\n\t\t$actual = array();\n\t\t$expected = array( 'num' => '0123456789', 'desc' => 'description' );\n\n\t\t//act\n\t\t$testValidFieldsetField->validate_fieldset( $post->ID, $testValidFieldsetField->fields['field'], $actual, array() );\n\n\t\t//assert\n\t\t$this->assertEquals( $expected, $actual );\n\t}", "public static function allPost()\n {\n try {\n $form = [];\n foreach ($_POST as $name => $value) {\n $form[htmlspecialchars($name)] = htmlspecialchars($value);\n }\n return $form;\n } catch (Exception $e) {\n die($e);\n }\n }", "public function collectPostForm($names)\n {\n $defaults = array_fill_keys($names, null);\n $result = array_intersect_key($_POST, $defaults) + $defaults;\n array_walk_recursive(\n $result,\n function (&$item, $key) {\n $item = trim($item);\n }\n );\n\n return $result;\n }", "public function populate($params=NULL) {\n if ((!is_null($params)) && (is_array($params))) {\n foreach($params as $key => $value) {\n if (array_key_exists($key,$this->form_fields)) {\n if (strcasecmp($this->form_fields[$key]->data_type,\"array\") == 0) {\n if ($value instanceof Parameter) {\n $this->form_fields[$key]->value = implode(',',$value->asArray());\n }\n else {\n $this->form_fields[$key]->value = implode(',',$value);\n }\n }\n else {\n if ($value instanceof Parameter) {\n $this->form_fields[$key]->value = $value->asString();\n }\n else {\n $this->form_fields[$key]->value = $value;\n }\n }\n }\n }\n $this->form_populated = TRUE;\n // run the post populate method to levy modifications against the input\n $this->postPopulate();\n }\n }", "public function createForm( $submitValue = null, $legend = null, Array $values = null )\n {\n\t\tif( ! $settings = unserialize( @$values['settings'] ) )\n\t\t{\n\t\t\tif( is_array( $values['data'] ) )\n\t\t\t{\n\t\t\t\t$settings = $values['data'];\n\t\t\t}\n\t\t\telseif( is_array( $values['settings'] ) )\n\t\t\t{\n\t\t\t\t$settings = $values['settings'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$settings = $values;\n\t\t\t}\n\t\t}\n\t//\t$settings = unserialize( @$values['settings'] ) ? : $values['settings'];\n $form = new Ayoola_Form( array( 'name' => $this->getObjectName() ) );\n\t\t$form->submitValue = $submitValue ;\n\t\t$form->oneFieldSetAtATime = true;\n\t\t$fieldset = new Ayoola_Form_Element;\n\n\n\n // Sample Text Field Retrieving E-mail Address\n\t\t$fieldset->addElement( array( 'name' => 'log_interval', 'label' => 'Member log Interval (Secs)', 'value' => @$settings['log_interval'], 'type' => 'InputText' ) );\n\t\t$fieldset->addElement( array( 'name' => 'cost_per_sec', 'label' => 'How much charge to put on Workspace per sec', 'value' => @$settings['cost_per_sec'], 'type' => 'InputText' ) );\n\t\t$fieldset->addLegend( 'Workplace Settings' ); \n \n\t\t$form->addFieldset( $fieldset );\n\t\t$this->setForm( $form );\n\t\t//\t\t$form->addFieldset( $fieldset );\n\t//\t$this->setForm( $form );\n }", "public function storeFormValues( $params ) {\r\n \r\n // store the parameters\r\n $this->__construct( $params );\r\n \r\n }", "public function construct_value_array() {\r\n\t\t$fields = array(\r\n\t\t\t'Amount' => $this->cart_data['total_price'] * 100,\r\n\t\t\t'CurrencyCode' => $this->get_currency_iso_code( $this->cart_data['store_currency'] ),\r\n\t\t\t'OrderID' => $this->purchase_id,\r\n\t\t\t'TransactionType' => 'SALE',\r\n\t\t\t'TransactionDateTime' => date( 'Y-m-d H:i:s P' ),\r\n\t\t\t'CallbackURL' => add_query_arg( 'gateway', 'paymentsense', $this->cart_data['notification_url'] ),\r\n\t\t\t'OrderDescription' => 'Order ID: ' . $this->purchase_id . ' - ' . $this->cart_data['session_id'],\r\n\t\t\t'CustomerName' => $this->cart_data['billing_address']['first_name'] . ' ' . $this->cart_data['billing_address']['last_name'],\r\n\t\t\t'Address1' => trim( implode( '&#10;', explode( \"\\n\\r\", $this->cart_data['billing_address']['address'] ) ), '&#10;' ),\r\n\t\t\t'Address2' => '',\r\n\t\t\t'Address3' => '',\r\n\t\t\t'Address4' => '',\r\n\t\t\t'City' => $this->cart_data['billing_address']['city'],\r\n\t\t\t'State' => $this->cart_data['billing_address']['state'],\r\n\t\t\t'PostCode' => $this->cart_data['billing_address']['post_code'],\r\n\t\t\t'CountryCode' => $this->get_country_iso_code( $this->cart_data['billing_address']['country'] ),\r\n\t\t\t'EmailAddress' => $this->cart_data['email_address'],\r\n\t\t\t'PhoneNumber' => $this->cart_data['billing_address']['phone'],\r\n\t\t\t'EmailAddressEditable' => 'true',\r\n\t\t\t'PhoneNumberEditable' => 'true',\r\n\t\t\t'CV2Mandatory' => 'true',\r\n\t\t\t'Address1Mandatory' => 'true',\r\n\t\t\t'CityMandatory' => 'true',\r\n\t\t\t'PostCodeMandatory' => 'true',\r\n\t\t\t'StateMandatory' => 'true',\r\n\t\t\t'CountryMandatory' => 'true',\r\n\t\t\t'ResultDeliveryMethod' => 'POST',\r\n\t\t\t'ServerResultURL' => '',\r\n\t\t\t'PaymentFormDisplaysResult' => 'false',\r\n\t\t);\r\n\r\n\t\t$data = 'MerchantID=' . get_option( 'paymentsense_id' );\r\n\t\t$data .= '&Password=' . get_option( 'paymentsense_password' );\r\n\r\n\t\tforeach ( $fields as $key => $value ) {\r\n\t\t\t$data .= '&' . $key . '=' . $value;\r\n\t\t};\r\n\r\n\t\t$additional_fields = array(\r\n\t\t\t'HashDigest' => $this->calculate_hash_digest( $data, 'SHA1', get_option( 'paymentsense_preshared_key' ) ),\r\n\t\t\t'MerchantID' => get_option( 'paymentsense_id' ),\r\n\t\t);\r\n\r\n\t\t$this->request_data = array_merge( $additional_fields, $fields );\r\n\t}", "protected function _fillMappingsArray()\n {\n if ($this->getRequest()->isPost())\n {\n $this->view->mappings_array = $this->getParam('mappings');\n }\n else\n {\n $this->view->mappings_array = $this->view->batch_upload_mapping_set->getMappingsArray();\n }\n }", "function setValueByArray($a_values)\n\t{\n\t\t$this->setValue($a_values[$this->getPostVar()]);\n\t}", "function formValid()\n\t{\n\t\t// Not submitted, so can't be valid.\n\t\tif (!$this->formSubmitted())\n\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t// Empty error list\n\t\t$this->errorList = array();\n\t\t\t\t\t\t\n\t\t// Check each field is valid.\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\t// Elements with lots of selected values, so copy list of values across.\n\t\t\tif ($element->type == 'checkboxlist') \n\t\t\t{\t\n\t\t\t\t// Dynamic function to retrieve all fields that start with the element name\n\t\t\t\t// for multi-item lists.\t\t\t\n\t\t\t\t$filterFunc = create_function('$v', '$filterStr = \"'.$element->name.'_\"; return (substr($v, 0, strlen($filterStr)) == $filterStr);');\n\t\t\t\t\n\t\t\t\t// Extract all values for this multi-item list.\n\t\t\t\t$itemList = array_filter(array_keys($_POST), $filterFunc);\n\t\t\t\t\n\t\t\t\t// If we've got some values, extract just the values of the list\t\t\t\t\n\t\t\t\tif (count($itemList) > 0) \n\t\t\t\t{\n\t\t\t\t\t$element->value = array();\n\t\t\t\t\t$regexp = sprintf('/%s_(.*)/', $element->name);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($itemList as $fieldname)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Extract the actual field name from the list, and then assign it \n\t\t\t\t\t\t// to the internal list of values for this particular multi-item field.\n\t\t\t\t\t\tif (preg_match($regexp, $fieldname, $matches)) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Proper value is still held in $_POST, so retrieve it using\n\t\t\t\t\t\t\t// full name of field (field name plus sub-item name)\n\t\t\t\t\t\t\t$element->value[$matches[1]] = $this->getArrayValue($_POST, $fieldname); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Merged elements, so extract each of their values\n\t\t\telse if ($element->type == 'merged') \n\t\t\t{\n\t\t\t\t$mergedValueList = array();\n\t\t\t\tif (!empty($element->subElementList))\n\t\t\t\t{\n\t\t\t\t\tforeach ($element->subElementList as $subElem)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Extract the value from the POST array, and add to array for this element\n\t\t\t\t\t\t$mergedValueList[$subElem->name] = $this->getArrayValue($_POST, $subElem->name);\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\t$element->setValue($mergedValueList);\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Single value element - just copy standard post value\n\t\t\telse {\n\t\t\t\tif (isset($_POST[$element->name])) {\n\t\t\t\t\t$element->value = $this->getArrayValue($_POST, $element->name);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Validate the element\n\t\t\tif (!$element->isValid())\n\t\t\t{\n\t\t\t\t// Add error to internal list of errors for this form.\n\t\t\t\t$this->errorList[] = $element->getErrorMessage();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we have errors, clearly the form is not valid\n\t\treturn (count($this->errorList) == 0); \n\t}", "function handle_post($indata) {\n// showDebug('form_class POST:');\n// showArray($indata); \n return;\n }", "public function setValues(array $_values=array()){\n foreach(($getElements=self::getElements()) as $key=>$items){\n $this->{$key}=(\n (isset($_values[self::getFormName()][$key]))\n ?$_values[self::getFormName()][$key]\n :NULL\n );\n $getElementsv[$key]->setValue($this->{$key});\n }\n }", "public function normalizeFormData(array $postVars)\n {\n $output = array();\n\n foreach ($postVars as $key => $val) {\n if (strstr($key, 'action_') || $key == 'SecurityID') {\n continue;\n }\n\n if (is_array($val)) {\n $val = implode(\",\", $val);\n }\n\n $key = str_replace(\"_\", \" \", $key);\n $output[$key] = $val;\n }\n\n return $output;\n }", "public function toFormArray() : array {\n $return = [];\n\n foreach ($this->toArray() as $component) {\n $return = array_merge($return, $component->toFormArray());\n }\n\n return $return;\n }", "public function storeFormValues ( $params ) {\n\n // Store all the parameters\n $this->__construct( $params );\n\t\n // Parse and store the program start date \n if ( isset($params['programStart']) ) {\n $programStart = explode ( '-', $params['programStart'] );\n\n if ( count($programStart) == 3 ) {\n list ( $y, $m, $d ) = $programStart;\n $this->programStart = mktime ( 0, 0, 0, $m, $d, $y );\n }\n }\n }", "function make_single_input($request)\n{\n // Create container\n $data = [];\n\n // Add data to array\n $data[$request->name] = $request->value;\n\n // Return input\n return $data;\n}", "public function storeFormValues ( $params ) {\n $this->__construct( $params );\n }", "public function getSubmittedData()\n\t{\n\t\t//Check we have received the Formisimo tracking data from the submission\n\t\t$data = isset($this->data['formisimo-tracking'])\n\t\t\t? $this->data['formisimo-tracking']\n\t\t\t: array(); //Default to empty array\n\n\t\treturn ! is_array($data)\n\t\t\t? (array) json_decode($data, true) //cast array in case json_decode fails\n\t\t\t: $data; //Just return the array\n\t}", "private function buildRequest(): array\n {\n return [\n \"documentoResponsavelPagamento\" => $this->payerTaxId,\n \"numeroNotaFiscal\" => $this->invoiceNumber,\n \"numeroSerieNotaFiscal\" => $this->invoiceSeries,\n \"conhecimentoTransporteEletronico\" => $this->eBillOfLadingNumber,\n \"numeroSerieConhecimentoTransporteEletronico\" => $this->ebillsOfLadingeries,\n \"documentoDestinatario\" => $this->receiverTaxId,\n \"codigoFilialOrigem\" => $this->originBranch,\n \"dataInicial\" => $this->initialDate,\n \"dataFinal\" => $this->finalDate\n ];\n }", "public function Create($extra_meta=array()) {\n $form_instance = $this->form_instance;\n // Retrieve the form instance\n $action_instance = $this->action_instance;\n // Create a new entry SQL helper\n $entries_sql_helper = new VCFF_Reports_Helper_SQL_Entries();\n // Add the entry\n $entries_sql_helper\n ->Add_Entry(array(\n 'form_uuid' => $form_instance->Get_UUID(),\n 'form_type' => $form_instance->Get_Type(),\n 'event_id' => $action_instance->Get_ID(),\n 'event_code' => $action_instance->Get_Code(),\n 'source_url' => 'http://something',\n ));\n // If extra meta information was supplied\n if ($extra_meta && is_array($extra_meta)) {\n // Loop through each submission meta item\n foreach ($extra_meta as $meta_key => $meta_data) {\n // Add the submission meta item\n $entries_sql_helper\n ->Add_Meta_Item(array(\n 'meta_code' => $meta_data['meta_code'],\n 'meta_value' => $meta_data['meta_value'],\n 'meta_label' => $meta_data['meta_label'],\n ));\n }\n }\n // Return the form fields\n $form_fields = $form_instance->fields;\n // Loop through each form field\n foreach ($form_fields as $machine_code => $field_instance) { \n // Add the entry\n $entries_sql_helper\n ->Add_Field_Item(array(\n 'machine_code' => $machine_code,\n 'field_label' => $field_instance->Get_Label(),\n 'field_value' => $field_instance->Get_Value(),\n 'field_value_html' => $field_instance->Get_HTML_Value(false),\n 'field_value_text' => $field_instance->Get_TEXT_Value(false),\n ));\n }\n // Store and retrieve the stored entry\n $entry = $entries_sql_helper->Store();\n \n $flags_sql_helper = new VCFF_Reports_Helper_SQL_Flags();\n \n $flags_sql_helper\n ->Add_Flag(array(\n 'entry_uuid' => $entry['uuid'],\n 'form_uuid' => $form_instance->Get_UUID(),\n 'flag_code' => 'unread',\n 'flag_data' => array('hey'),\n ))\n ->Store();\n \n return $this;\n }", "public function modifyInputAfterValidation(array $requestValues): array;", "public function values(): ?array\n {\n $parameters = [];\n foreach ($this->data['fields'] as $index => $input) {\n $parameters[$index] = FILTER_SANITIZE_SPECIAL_CHARS;\n }\n return filter_input_array(INPUT_POST, $parameters);\n }", "function ConvertToForm($data) {\n $outdata = array();\n foreach($data as $field){\n if($field[0]==\"select\") {\n $nextfield = '<select name=\"'.$field[1].'\">';\n $endtag = '</select>';\n } else {\n $nextfield = '<input type=\"'.$field[0].'\" name=\"'.$field[1].'\" ';\n $endtag = '/>';\n }\n\n if(!empty($field[2])){\n switch($field[0]){\n case \"select\":\n for ($i=0;$i<count($field[2]);$i++){\n $nextfield .= '<option value=\"'.$field[2][$i].'\">'.$field[2][$i].'</option>';\n }\n break;\n case \"radio\":\n case \"checkbox\":\n if($field[3]) $nextfield .= 'checked=\"checked\" ';\n case \"text\":\n default:\n $nextfield .= 'value=\"'.$field[2].'\" ';\n }\n }\n\n $nextfield .= $endtag;\n $outdata[]=$nextfield;\n }\n return $outdata;\n }", "public static function create_post_array( $params_array ) {\n if (\n empty( $params_array[ 'hostname' ] )\n || empty( $params_array[ 'ip' ] )\n || empty( $params_array[ 'hosthash' ] )\n || empty( $params_array[ 'agent' ] )\n || empty( $params_array[ 'stats' ] )\n || empty( $params_array[ 'hostinfo' ] )\n || ! filter_var( $params_array[ 'ip' ], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE )\n ) {\n return false;\n }\n return array(\n self::POST_FIELD_HOSTNAME => $params_array[ 'hostname' ],\n self::POST_FIELD_IP => $params_array[ 'ip' ],\n self::POST_FIELD_HOSTHASH => $params_array[ 'hosthash' ],\n self::POST_FIELD_AGENT => $params_array[ 'agent' ],\n self::POST_FIELD_STATS => $params_array[ 'stats' ],\n self::POST_FIELD_HOSTINFO => $params_array[ 'hostinfo' ]\n );\n }", "private function setPostParameters() {\n\t\tforeach (array_keys($_POST) as $currentKey) {\n\t\t\t$this->postArray[$currentKey] = $_POST[$currentKey];\n\t\t}\n\t}", "private function getFormItBuilderOutput(){\n\t\t$s_submitVar = 'submitVar_'.$this->_id;\n\t\t$b_customSubmitVar=false;\n\t\tif(empty($this->_submitVar)===false){\n\t\t\t$s_submitVar = $this->_submitVar;\n\t\t\t$b_customSubmitVar=true;\n\t\t}\n\t\t$s_recaptchaJS='';\n\t\t$b_posted = false;\n\t\tif(isset($_REQUEST[$s_submitVar])===true){\n\t\t\t$b_posted=true;\n\t\t}\n\t\t$nl=\"\\r\\n\";\n\n\t\t//process and add form rules\n\t\t$a_fieldProps=array();\n\t\t$a_fieldProps_jqValidate=array();\n\t\t$a_fieldProps_jqValidateGroups=array();\n\t\t$a_fieldProps_errstringFormIt=array();\n\t\t$a_fieldProps_errstringJq=array();\n\t\t\n\t\t$a_formProps=array();\n\t\t$a_formProps_custValidate=array();\n\t\t$a_formPropsFormItErrorStrings=array();\n\n\t\tforeach($this->_rules as $rule){\n\t\t\t$o_elFull = $rule->getElement();\n\t\t\tif(is_array($o_elFull)===true){\n\t\t\t\t$o_el = $o_elFull[0];\n\t\t\t}else{\n\t\t\t\t$o_el = $o_elFull;\n\t\t\t}\n\t\t\t$elId = $o_el->getId();\n\t\t\t$elName = $o_el->getName();\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_jqValidate[$elId])===false){\n\t\t\t\t$a_fieldProps_jqValidate[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringFormIt[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringFormIt[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringJq[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringJq[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_formProps_custValidate[$elId])===false){\n\t\t\t\t$a_formProps_custValidate[$elId]=array();\n\t\t\t}\n\t\t\t\n\t\t\t$s_validationMessage=$rule->getValidationMessage();\n\t\t\tswitch($rule->getType()){\n\t\t\t\tcase FormRuleType::email:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'email';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextEmailInvalid=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'email:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'email:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::fieldMatch:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'password_confirm=^'.$o_elFull[1]->getId().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextPasswordConfirm=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'equalTo:\"#'.$o_elFull[1]->getId().'\"';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'equalTo:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','maxLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'maxLength=^'.$rule->getValue().'^';\n\t\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t}\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'maxlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'maxlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'maxValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'max:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'max:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}\n\t\t\t\t\t//Made own validation rule cause FormIt doesnt behave with required.\n\t\t\t\t\t//$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'minlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'minlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'minValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'min:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'min:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::numeric:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'isNumber';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextIsNumber=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'digits:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'digits:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::required:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementMatrix')){\n\t\t\t\t\t\t$s_type=$o_el->getType();\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementMatrix_'.$s_type,'required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_rows = $o_el->getRows();\n\t\t\t\t\t\t$a_columns = $o_el->getColumns();\n\t\t\t\t\t\t$a_namesForGroup=array();\n\t\t\t\t\t\tswitch($s_type){\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\tfor($col_cnt=0; $col_cnt<count($a_columns); $col_cnt++){\n\t\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt.'_'.$col_cnt;\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:\"'.$s_validationMessage.'\"';\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\tbreak;\n\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'check':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$s_fieldName = $elName.'_'.$row_cnt.'[]';\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$s_fieldName;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$s_fieldName][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$s_fieldName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$a_fieldProps_jqValidateGroups[$elName]=implode(' ',$a_namesForGroup);\n\t\t\t\t\t}else if(is_a($o_el, 'FormItBuilder_elementDate')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementDate','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_0'][] = 'required:true,dateElementRequired:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_0'][] = 'required:\"'.$s_validationMessage.'\",dateElementRequired:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'required:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::date:\n\t\t\t\t\t$s_thisVal = $rule->getValue();\n\t\t\t\t\t$s_thisErrorMsg = str_replace('===dateformat===',$s_thisVal,$s_validationMessage);\n\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'date','fieldFormat'=>$s_thisVal,'errorMessage'=>$s_thisErrorMsg);\n\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'dateFormat:\\''.$s_thisVal.'\\'';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'dateFormat:\"'.$s_thisErrorMsg.'\"';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//if some custom validation options were found (date etc) then add formItBuilder custom validate snippet to the list\n\t\tif(count($a_formProps_custValidate)>0){\n\t\t\t$GLOBALS['FormItBuilder_customValidation']=$a_formProps_custValidate;\n\t\t\tif(empty($this->_customValidators)===false){\n\t\t\t\t$this->_customValidators.=',';\n\t\t\t}\n\t\t\t$this->_customValidators.='FormItBuilder_customValidation';\n\t\t}\n\t\t\n\t\t//build inner form html\n\t\t$b_attachmentIncluded=false;\n\t\t$s_form='<div>'.$nl\n\t\t.$nl.'<div class=\"process_errors_wrap\"><div class=\"process_errors\">[[!+fi.error_message:notempty=`[[!+fi.error_message]]`]]</div></div>'\n\t\t.$nl.($b_customSubmitVar===false?'<input type=\"hidden\" name=\"'.$s_submitVar.'\" value=\"1\" />':'')\n\t\t.$nl.'<input type=\"hidden\" name=\"fke'.date('Y').'Sp'.date('m').'Blk:blank\" value=\"\" /><!-- additional crude spam block. If this field ends up with data it will fail to submit -->'\n\t\t.$nl;\n\t\tforeach($this->_formElements as $o_el){\n\t\t\t$s_elClass=get_class($o_el);\n\t\t\tif($s_elClass=='FormItBuilder_elementFile'){\n\t\t\t\t$b_attachmentIncluded=true;\n\t\t\t}\n\t\t\tif(is_a($o_el,'FormItBuilder_elementHidden')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else if(is_a($o_el,'FormItBuilder_htmlBlock')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else{\n\t\t\t\t$s_typeClass = substr($s_elClass,14,strlen($s_elClass)-14);\n\t\t\t\t$forId=$o_el->getId();\n\t\t\t\tif(\n\t\t\t\t\tis_a($o_el,'FormItBuilder_elementRadioGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementCheckboxGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementDate')===true\n\t\t\t\t){\n\t\t\t\t\t$forId=$o_el->getId().'_0';\n\t\t\t\t}else if(is_a($o_el,'FormItBuilder_elementMatrix')){\n\t\t\t\t\t$forId=$o_el->getId().'_0_0';\n\t\t\t\t}\n\t\t\t\t$s_forStr = ' for=\"'.htmlspecialchars($forId).'\"';\n\t\t\t\t\n\t\t\t\tif(is_a($o_el,'FormItBuilder_elementReCaptcha')===true){\n\t\t\t\t\t$s_forStr = ''; // dont use for attrib for Recaptcha (as it is an external program outside control of formitbuilder\n\t\t\t\t\t$s_recaptchaJS=$o_el->getJsonConfig();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$s_extraClasses='';\n\t\t\t\t$a_exClasses=$o_el->getExtraClasses();\n\t\t\t\tif(count($a_exClasses)>0){\n\t\t\t\t\t$s_extraClasses = ' '.implode(' ',$o_el->getExtraClasses());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$b_required = $o_el->isRequired();\n\t\t\t\t$s_form.='<div title=\"'.$o_el->getLabel().'\" class=\"formSegWrap formSegWrap_'.htmlspecialchars($o_el->getId()).' '.$s_typeClass.($b_required===true?' required':'').$s_extraClasses.'\">';\n\t\t\t\t\t$s_labelHTML='';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_desc=$o_el->getDescription();\n\t\t\t\t\t\tif(empty($s_desc)===false){\n\t\t\t\t\t\t\t$s_desc='<span class=\"description\">'.$s_desc.'</span>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s_labelHTML='<label class=\"mainElLabel\"'.$s_forStr.'><span class=\"before\"></span><span class=\"mainLabel\">'.$o_el->getLabel().'</span>'.$s_desc.'<span class=\"after\"></span></label>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$s_element='<div class=\"elWrap\">'.$nl.' <span class=\"before\"></span>'.$o_el->outputHTML().'<span class=\"after\"></span>';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_element.='<div class=\"errorContainer\"><label class=\"formiterror\" '.$s_forStr.'>[[+fi.error.'.htmlspecialchars($o_el->getId()).']]</label></div>';\n\t\t\t\t\t}\n\t\t\t\t\t$s_element.='</div>';\n\t\t\t\t\t\n\t\t\t\t\tif($o_el->getLabelAfterElement()===true){\n\t\t\t\t\t\t$s_form.=$s_element.$s_labelHTML;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$s_form.=$s_labelHTML.$s_element;\n\t\t\t\t\t}\n\t\t\t\t$s_form.=$nl.'</div>'.$nl;\n\t\t\t}\n\t\t}\n\t\t$s_form.=$nl.'</div>';\n\n\t\t//wrap form elements in form tags\n\t\t$s_form='<form action=\"'.$this->_formAction.'\" method=\"'.htmlspecialchars($this->_method).'\"'.($b_attachmentIncluded?' enctype=\"multipart/form-data\"':'').' class=\"form\" id=\"'.htmlspecialchars($this->_id).'\">'.$nl\n\t\t.$s_form.$nl\n\t\t.'</form>';\n\t\t\n\t\t//add all formit validation rules together in one array for easy implode\n\t\t$a_formItCmds=array();\n\t\t$a_formItErrorMessage=array();\n\t\tforeach($a_fieldProps as $fieldID=>$a_fieldProp){\n\t\t\tif(count($a_fieldProp)>0){\n\t\t\t\t$a_formItCmds[]=$fieldID.':'.implode(':',$a_fieldProp);\n\t\t\t}\n\t\t}\n\t\t//add formIT error messages\n\t\tforeach($a_fieldProps_errstringFormIt as $fieldID=>$msgArray){\n\t\t\tforeach($msgArray as $msg){\n\t\t\t\t$a_formItErrorMessage[]='&'.$fieldID.'.'.$msg;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor($i=0; $i<count($a_formProps); $i++){\n\t\t\t$a_formItCmds[]=$a_formProps[$i];\n\t\t\tif(empty($a_formPropsFormItErrorStrings[$i])===false){\n\t\t\t\t$a_formItErrorMessage[]=$a_formPropsFormItErrorStrings[$i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if using database table then add call to final hook\n\t\t$b_addFinalHooks=false;\n\t\t$GLOBALS['FormItBuilder_hookCommands']=array('formObj'=>&$this,'commands'=>array());\n\t\tif(empty($this->_databaseTableObjectName)===false){\n\t\t\t$GLOBALS['FormItBuilder_hookCommands']['commands'][]=array('name'=>'dbEntry','value'=>array('tableObj'=>$this->_databaseTableObjectName,'mapping'=>$this->_databaseTableFieldMapping));\n\t\t\t$b_addFinalHooks=true;\n\t\t}\n\t\tif($b_addFinalHooks===true){\n\t\t\t$this->_hooks[]='FormItBuilder_hooks';\n\t\t}\n\t\t\n\t\t//rebuild hooks system\n\t\t$s_hooksStr = '';\n\t\tif(empty($this->_postHookName)===false){\n\t\t $s_hooksStr.=$this->_postHookName;\n\t\t}\n\t\tif(count($this->_hooks)>0){\n\t\t if(empty($this->_postHookName)===false){\n\t\t\t$s_hooksStr.=',';\n\t\t }\n\t\t $s_hooksStr.=implode(',',$this->_hooks);\n\t\t}\n\t\t$s_fullHooksParam='';\n\t\tif(empty($s_hooksStr)===false){\n\t\t $s_fullHooksParam=$nl.'&hooks=`'.$s_hooksStr.'`';\n\t\t}\n\t\t\n\t\t$s_formItCmd='[[!FormIt?'\n\t\t.$s_fullHooksParam\t\t\t\t\n\t\t.(empty($s_recaptchaJS)===false?$nl.'&recaptchaJs=`'.$s_recaptchaJS.'`':'')\n\t\t.(empty($this->_customValidators)===false?$nl.'&customValidators=`'.$this->_customValidators.'`':'')\n\t\t\t\n\t\t.(empty($this->_emailTpl)===false?$nl.'&emailTpl=`'.$this->_emailTpl.'`':'')\n\t\t.(empty($this->_emailToAddress)===false?$nl.'&emailTo=`'.$this->_emailToAddress.'`':'')\n\t\t.(empty($this->_emailToName)===false?$nl.'&emailToName=`'.$this->_emailToName.'`':'')\n\t\t.(empty($this->_emailFromAddress)===false?$nl.'&emailFrom=`'.$this->_emailFromAddress.'`':'')\n\t\t.(empty($this->_emailFromName)===false?$nl.'&emailFromName=`'.$this->_emailFromName.'`':'')\n\t\t.(empty($this->_emailReplyToAddress)===false?$nl.'&emailReplyTo=`'.$this->_emailReplyToAddress.'`':'')\n\t\t.(empty($this->_emailReplyToName)===false?$nl.'&emailReplyToName=`'.$this->_emailReplyToName.'`':'')\n\t\t.(empty($this->_emailCCAddress)===false?$nl.'&emailCC=`'.$this->_emailCCAddress.'`':'')\n\t\t.(empty($this->_emailCCName)===false?$nl.'&emailCCName=`'.$this->_emailCCName.'`':'')\n\t\t.(empty($this->_emailBCCAddress)===false?$nl.'&emailBCC=`'.$this->_emailBCCAddress.'`':'')\n\t\t.(empty($this->_emailBCCName)===false?$nl.'&emailBCCName=`'.$this->_emailBCCName.'`':'')\n\t\t\n\t\t.(empty($this->_autoResponderTpl)===false?$nl.'&fiarTpl=`'.$this->_autoResponderTpl.'`':'')\n\t\t.(empty($this->_autoResponderSubject)===false?$nl.'&fiarSubject=`'.$this->_autoResponderSubject.'`':'')\n\t\t.(empty($this->_autoResponderToAddressField)===false?$nl.'&fiarToField=`'.$this->_autoResponderToAddressField.'`':'')\n\t\t.(empty($this->_autoResponderFromAddress)===false?$nl.'&fiarFrom=`'.$this->_autoResponderFromAddress.'`':'')\n\t\t.(empty($this->_autoResponderFromName)===false?$nl.'&fiarFromName=`'.$this->_autoResponderFromName.'`':'')\n\t\t.(empty($this->_autoResponderReplyTo)===false?$nl.'&fiarReplyTo=`'.$this->_autoResponderReplyTo.'`':'')\n\t\t.(empty($this->_autoResponderReplyToName)===false?$nl.'&fiarReplyToName=`'.$this->_autoResponderReplyToName.'`':'')\n\t\t.(empty($this->_autoResponderCC)===false?$nl.'&fiarCC=`'.$this->_autoResponderCC.'`':'')\n\t\t.(empty($this->_autoResponderCCName)===false?$nl.'&fiarCCName=`'.$this->_autoResponderCCName.'`':'')\n\t\t.(empty($this->_autoResponderBCC)===false?$nl.'&fiarBCC=`'.$this->_autoResponderBCC.'`':'')\n\t\t.(empty($this->_autoResponderBCCName)===false?$nl.'&fiarBCCName=`'.$this->_autoResponderBCCName.'`':'')\n\t\t.$nl.'&fiarHtml=`'.($this->_autoResponderHtml===false?'0':'1').'`'\t\t\t\t\n\t\t\t\t\n\t\t.$nl.'&emailSubject=`'.$this->_emailSubject.'`'\n\t\t.$nl.'&emailUseFieldForSubject=`1`'\n\t\t.$nl.'&redirectTo=`'.$this->_redirectDocument.'`'\n\t\t.(empty($this->_redirectParams)===false?$nl.'&redirectParams=`'.$this->_redirectParams.'`':'')\n\t\t.$nl.'&store=`'.($this->_store===true?'1':'0').'`'\n\t\t.$nl.'&submitVar=`'.$s_submitVar.'`'\n\t\t.$nl.implode($nl,$a_formItErrorMessage)\n\t\t.$nl.'&validate=`'.(isset($this->_validate)?$this->_validate.',':'').implode(','.$nl.' ',$a_formItCmds).','.$nl.'`]]'.$nl;\n\t\t\n\t\tif($this->_jqueryValidation===true){\n\t\t\t$s_js='\t\n$().ready(function() {\n\njQuery.validator.addMethod(\"dateFormat\", function(value, element, format) {\n\tvar b_retStatus=false;\n\tvar s_retValue=\"\";\n\tvar n_retTimestamp=0;\n\tif(value.length==format.length){\n\t\tvar separator_only = format;\n\t\tvar testDate;\n\t\tif(format.toLowerCase()==\"yyyy\"){\n\t\t\t//allow just yyyy\n\t\t\ttestDate = new Date(value, 1, 1);\n\t\t\tif(testDate.getFullYear()==value){\n\t\t\t\tb_retStatus=true;\n\t\t\t}\n\t\t}else{\n\t\t\tseparator_only = separator_only.replace(/m|d|y/g,\"\");\n\t\t\tvar separator = separator_only.charAt(0)\n\n\t\t\tif(separator && separator_only.length==2){\n\t\t\t\tvar dayPos; var day; var monthPos; var month; var yearPos; var year;\n\t\t\t\tvar s_testYear;\n\t\t\t\tvar newStr = format;\n\n\t\t\t\tdayPos = format.indexOf(\"dd\");\n\t\t\t\tday = parseInt(value.substr(dayPos,2),10)+\"\";\n\t\t\t\tif(day.length==1){day=\"0\"+day;}\n\t\t\t\tnewStr=newStr.replace(\"dd\",day);\n\n\t\t\t\tmonthPos = format.indexOf(\"mm\");\n\t\t\t\tmonth = parseInt(value.substr(monthPos,2),10)+\"\";\n\t\t\t\tif(month.length==1){month=\"0\"+month;}\n\t\t\t\tnewStr=newStr.replace(\"mm\",month);\n\n\t\t\t\tyearPos = format.indexOf(\"yyyy\");\n\t\t\t\tyear = parseInt(value.substr(yearPos,4),10);\n\t\t\t\tnewStr=newStr.replace(\"yyyy\",year);\n\n\t\t\t\ttestDate = new Date(year, month-1, day);\n\n\t\t\t\tvar testDateDay=(testDate.getDate())+\"\";\n\t\t\t\tif(testDateDay.length==1){testDateDay=\"0\"+testDateDay;}\n\n\t\t\t\tvar testDateMonth=(testDate.getMonth()+1)+\"\";\n\t\t\t\tif(testDateMonth.length==1){testDateMonth=\"0\"+testDateMonth;}\n\n\t\t\t\tif (testDateDay==day && testDateMonth==month && testDate.getFullYear()==year) {\n\t\t\t\t\tb_retStatus = true;\n\t\t\t\t\t$(element).val(newStr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Please enter a valid date.\");\n\njQuery.validator.addMethod(\"dateElementRequired\", function(value, element, format) {\n\tvar el=element;\n\tb_retStatus=true;\n\tvar elBaseId=element.id.substr(0,element.id.length-2);\n\tif($(\"#\"+elBaseId+\"_0\").val()==\"\" || $(\"#\"+elBaseId+\"_1\").val()==\"\" || $(\"#\"+elBaseId+\"_2\").val()==\"\"){\n\t\tb_retStatus=false;\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Date element is required.\");\n\n//Main validate call\nvar thisFormEl=$(\"#'.$this->_id.'\");\nthisFormEl.validate({errorPlacement:function(error, element) {\n\tvar labelEl = element.parents(\".formSegWrap\").find(\".errorContainer\");\n\terror.appendTo( labelEl );\n},success: function(element) {\n\telement.addClass(\"valid\");\n\tvar formSegWrapEl = element.parents(\".formSegWrap\");\n\tformSegWrapEl.children(\".mainElLabel\").removeClass(\"mainLabelError\");\n},highlight: function(el, errorClass, validClass) {\n\tvar element= $(el);\n\telement.addClass(errorClass).removeClass(validClass);\n\telement.parents(\".formSegWrap\").children(\".mainElLabel\").addClass(\"mainLabelError\");\n},invalidHandler: function(form, validator){\n\t//make nice little animation to scroll to the first invalid element instead of an instant jump\n\tvar jumpEl = $(\"#\"+validator.errorList[0].element.id).parents(\".formSegWrap\");\n\t$(\"html,body\").animate({scrollTop: jumpEl.offset().top});\n if(FormItBuilderInvalidCallback){FormItBuilderInvalidCallback();}\n},ignore:\":hidden\",'.\n\t\t\t\t\t\n$this->jqueryValidateJSON(\n\t$a_fieldProps_jqValidate,\n\t$a_fieldProps_errstringJq,\n\t$a_fieldProps_jqValidateGroups\n).'});\n\t\n'.\n//Force validation on load if already posted\n($b_posted===true?'thisFormEl.valid();':'')\n.'\n\t\n});\n';\n\t\t}\n\t\t\n\t\t//Allows output of the javascript into a paceholder so in can be inserted elsewhere in html (head etc)\n\t\tif(empty($this->_placeholderJavascript)===false){\n\t\t\t$this->modx->setPlaceholder($this->_placeholderJavascript,$s_js);\n\t\t\treturn $s_formItCmd.$s_form;\n\t\t}else{\n\t\t\treturn $s_formItCmd.$s_form.\n'<script type=\"text/javascript\">\n// <![CDATA[\n'.$s_js.'\n// ]]>\n</script>';\n\t\t}\n\t}", "public function submissionFields()\n {\n return array(\n 'missing domain' => array('domain'),\n );\n }", "function checkFormParams($param_array){\n\t$cnt = 0;\n\tfor($i=0; $i < count($param_array); $i++){\n\t\tif(isset($_POST[$param_array[$i]])){\n\t\t\t$params_set[$param_array[$i]] = $_POST[$param_array[$i]];\n\t\t\t$cnt++;\n\t\t}\n\t\t$params_set[\"cnt\"] = $cnt;\n\t}\n\treturn $params_set;\n}", "public function valuesFromPost()\n {\n return $this->setDefaultValues($_POST);\n }", "function processPost($formvalues) {\n\t\t// check if the parentid is specified\n\t\tif (isArrayKeyAnEmptyString('parentid', $formvalues)) {\n\t\t\t$formvalues['parentid'] = NULL;\n\t\t}\n\t\t// trim spaces from the name field\n\t\tif (!isArrayKeyAnEmptyString('name', $formvalues)) {\n\t\t\t$formvalues['name'] = trim($formvalues['name']);\n\t\t}\n\t\tparent::processPost($formvalues);\n\t}", "private function processPostData() {\n\n if (isset($this->postDataArray['week']) && isset($this->postDataArray['year']))\n {\n\n $this->weekSelected = $this->cleanse_input($this->postDataArray['week']);\n $this->yearSelected = $this->cleanse_input($this->postDataArray['year']);\n }\n else\n {\n $this->weekSelected = $this->weeks[0];\n $this->yearSelected = $this->years[0];\n }\n }", "public function get_post_data() {\n\t\tforeach($this->form_fields as $form_field_key => $form_field_value) {\n\t\t\tif ($form_field_value['type'] == \"select_card_types\") {\n\t\t\t\t$form_field_key_select_card_types = $this->plugin_id . $this->id . \"_\" . $form_field_key;\n\t\t\t\t$select_card_types_values = array();\n\t\t\t\t$_POST[$form_field_key_select_card_types] = $select_card_types_values;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->data ) && is_array( $this->data ) ) {\n\t\t\treturn $this->data;\n\t\t}\n\t\treturn $_POST;\n\t}", "public function get_form() : ?array\n {\n $form_filtro = array();\n \n $form_filtro['estado'] = $this->estado;\n $form_filtro['cidade'] = $this->cidade;\n $form_filtro['ordem_preco'] = $this->ordem_preco;\n $form_filtro['ordem_data'] = $this->ordem_data;\n $form_filtro['estado_uso'] = $this->estado_uso;\n $form_filtro['preferencia_entrega'] = $this->preferencia_entrega;\n $form_filtro['status_peca'] = $this->status_peca;\n \n return $form_filtro;\n }", "function acfe_import_form($args){\n \n // json\n if(is_string($args))\n $args = json_decode($args, true);\n \n if(!is_array($args) || empty($args))\n return new WP_Error('acfe_import_form_invalid_input', __(\"Input is invalid: Must be a json string or an array.\"));\n \n // Instance\n $instance = acf_get_instance('acfe_dynamic_forms');\n \n // Single\n if(acf_maybe_get($args, 'title')){\n \n $name = acf_maybe_get($args, 'acfe_form_name');\n \n $args = array(\n $name => $args\n );\n \n }\n \n $result = array();\n \n foreach($args as $name => $data){\n \n // Import\n $post_id = $instance->import($name, $data);\n \n $return = array(\n 'success' => true,\n 'post_id' => $post_id,\n 'message' => 'Form \"' . acf_maybe_get($data, 'title') . '\" successfully imported.',\n );\n \n // Error\n if(is_wp_error($post_id)){\n \n $return['post_id'] = 0;\n $return['success'] = false;\n $return['message'] = $post_id->get_error_message();\n \n if($post_id->get_error_code() === 'acfe_form_import_already_exists'){\n \n $get_post = get_page_by_path($name, OBJECT, $instance->post_type);\n \n if($get_post){\n $return['post_id'] = $get_post->ID;\n }\n \n }\n \n }\n \n $result[] = $return;\n \n }\n \n if(count($result) === 1){\n $result = $result[0];\n }\n \n return $result;\n \n}", "public function storeFormValues ( $params ) {\n\n // Store all the parameters\n $this->__construct( $params );\n\n }", "function unpack_post() {\n // Globals\n global $min_words;\n global $add_num;\n global $add_char;\n global $case_opt;\n global $separator;\n\n if (array_key_exists('min-words', $_POST)) {\n $min_words = $_POST['min-words'];\n }\n\n if (array_key_exists('add-num', $_POST)) {\n $add_num = True;\n }\n\n if (array_key_exists('add-char', $_POST)) {\n $add_char = True;\n }\n\n if (array_key_exists('separator', $_POST)) {\n $separator = $_POST['separator'];\n }\n\n if (array_key_exists('case-opt', $_POST)) {\n $case_opt = $_POST['case-opt'];\n }\n\n // Mostly just for testing\n return [$min_words, (int)$add_num, (int)$add_char, $separator, $case_opt];\n}", "protected function _setFormData($submitCheck)\n\t{\n\t\n\t\t// Get form data\n\t\t$request = $this->getRequest();\n\t\t$data = $request->getPost();\n\t\t\t\t\n\t\t# Errors are set then warnings must not be set (null in fact)\n\t\t# When errors are empty, then set the warnings thing once\n\t\t# When errors are empty and warnings set, then put warnings given\n\t\t\n\t\t// Find out if submitted form data had a previous\n\t\t// error or warning attached with it\n\t\t$errors = $request->getParam(\"errors\");\n\t\t$warnings = $request->getParam(\"warnings\");\n\t\t\n\t\tif (empty($errors)) {\n\t\t\tif ($warnings)\n\t\t\t\t$this->_warningsGiven = True;\n\t\t} else {\n\t\t\t$this->_errorsGiven = True;\n\t\t}\t\t\n\t\t\n\t\t// Take out errors and warnings\n\t\tunset($data[\"warnings\"]);\n\t\tunset($data[\"errors\"]);\n\t\t\n\t\t// Take out submit value\n\t\tif ($submitCheck)\n\t\t\tunset($data[$submitCheck]);\n\t\t\t\t\t\n\t\t// Always have 'default' sectionName\n\t\t$this->addSectionName(\"default\");\n\t\t\n\t\t// Set form data\n\t\t// Want to make everything into a multi-dimensional array\n\t\t// (e.g. $sectionName => array(0 => array('key' => 'value'), 1 => array('key' => 'value')))\t\t\t\n\t\tforeach ($data as $sectionName => $section) {\n\t\t\t// If sectionValues string, then clump with 'default' section\n\t\t\t// (e.g. $sectionName => 'value')\n\t\t\tif (is_string($section)) {\n\t\t\t\t$this->_formData[\"default\"][0][$sectionName] = $section;\n\t\t\t} elseif (is_array($section)) {\n\t\t\t\t$test = array_keys($section);\n\t\t\t\tif(is_numeric($test[0]))\n\t\t\t\t\t$section = array_values($section);\n\t\t\t\t$this->addSectionName($sectionName);\n\t\t\t\t$this->addFormData($sectionName, $section);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn True;\n\t}", "public static function create($formInputs,$fileInputs){\n $formArray = []; \n // var_dump($formInputs);\n // die;\n foreach($formInputs as $key => $value) {\n $formArray[$key] = $value;\n if($value==Null){\n $formArray[$key]=Null;\n }\n }\n foreach($fileInputs as $key => $value) {\n \n if($value[\"name\"] != \"\"){\n $formArray[$key] = wp_upload_dir()[\"subdir\"] .\"/\". $value[\"name\"];\n }\n else{\n $formArray[$key] = Null;\n }\n\n }\n \n\n\n DataWebGl::create($formArray);\n }", "public function _verifyForm($submitted_values)\n{\n\t$object = new JObject;\n\t$object->error = false;\n\t$object->message = '';\n\t$user = JFactory::getUser();\n\n\tforeach ($submitted_values as $key => $value)\n\t{\n\t\tswitch ($key)\n\t\t{\n\t\t\tcase \"cardtype\":\n\t\t\t\tif (!isset($submitted_values[$key]) || !JString::strlen($submitted_values[$key]))\n\t\t\t\t:\n\t\t\t\t{\n\t\t\t\t\t$object->error = true;\n\t\t\t\t\t$object->message . = \"<li>\" . JText::_('COM_TIENDA_PAYMILL_CARD_TYPE_INVALID') . \"</li>\";\n\t\t\t\t}\n\t\t\t\tendif;\n\t\t\tbreak;\n\t\t\tcase \"cardnum\":\n\t\t\t\tif (!isset($submitted_values[$key]) || !JString::strlen($submitted_values[$key]))\n\t\t\t\t:\n\t\t\t\t{\n\t\t\t\t\t$object->error = true;\n\t\t\t\t\t$object->message . = \"<li>\" . JText::_('COM_TIENDA_PAYMILL_CARD_NUMBER_INVALID') . \"</li>\";\n\t\t\t\t}\n\t\t\t\tendif;\n\t\t\tbreak;\n\t\t\tcase \"cardexp\":\n\t\t\t\tif (!isset($submitted_values[$key]) || JString::strlen($submitted_values[$key]) != 4)\n\t\t\t\t:\n\t\t\t\t{\n\t\t\t\t\t$object->error = true;\n\t\t\t\t\t$object->message . = \"<li>\" . JText::_('COM_TIENDA_PAYMILL_CARD_EXPIRATION_DATE_INVALID') . \"</li>\";\n\t\t\t\t}\n\t\t\t\tendif;\n\t\t\tbreak;\n\t\t\tcase \"cardcvv\":\n\t\t\t\tif (!isset($submitted_values[$key]) || !JString::strlen($submitted_values[$key]))\n\t\t\t\t:\n\t\t\t\t{\n\t\t\t\t\t$object->error = true;\n\t\t\t\t\t$object->message . = \"<li>\" . JText::_('COM_TIENDA_PAYMILL_CARD_CVV_INVALID') . \"</li>\";\n\t\t\t\t}\n\t\t\t\tendif;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn $object;\n}", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "private function generate_request_array()\n {\n while (list($req_key, $req_val) = each($_REQUEST)) {\n if (!defined('FS_CURL_DEBUG') && $req_key == 'fs_curl_debug') {\n define('FS_CURL_DEBUG', $req_val);\n }\n //$this -> comment(\"$req_key => $req_val\");\n $this->request[$req_key] = $req_val;\n }\n }" ]
[ "0.6105827", "0.60898715", "0.59504795", "0.59503204", "0.59291774", "0.586009", "0.5797843", "0.5793347", "0.5768017", "0.5761831", "0.5712504", "0.5664335", "0.5611966", "0.55608684", "0.55404115", "0.5514258", "0.5498708", "0.54789215", "0.54621834", "0.5445514", "0.54440564", "0.54388124", "0.54227835", "0.5422192", "0.538488", "0.5342292", "0.5325234", "0.53249776", "0.5316242", "0.53097624", "0.52967054", "0.5288593", "0.5273841", "0.5268155", "0.52570784", "0.5238976", "0.5237593", "0.52342", "0.52245504", "0.5212953", "0.5200852", "0.51997083", "0.5199555", "0.5192708", "0.51873046", "0.51799804", "0.5171359", "0.5171359", "0.5170454", "0.5157035", "0.51537615", "0.51493603", "0.51480776", "0.51479954", "0.5141633", "0.5132415", "0.512608", "0.5125577", "0.51222277", "0.51186323", "0.511257", "0.51072377", "0.5107055", "0.50891006", "0.5087518", "0.50862783", "0.5077097", "0.5071816", "0.5070675", "0.5062891", "0.5058205", "0.5053571", "0.50518924", "0.5050942", "0.50476515", "0.504689", "0.5036155", "0.5034136", "0.5030115", "0.50299245", "0.49992126", "0.49984726", "0.49962693", "0.49766546", "0.49729395", "0.49723575", "0.49721846", "0.49609062", "0.4959971", "0.49592796", "0.49547344", "0.4943927", "0.49353373", "0.49322468", "0.49267912", "0.49261805", "0.49223876", "0.49222165", "0.49193704", "0.4916925" ]
0.54079604
24
Return the templates configuration structure which control what extra fields will be shown in the "Template" tab when configuring a form's PDF. The fields key is based on our \GFPDF\Helper\Helper_Abstract_Options Settings API See the Helper_Options_Fields::register_settings() method for the exact fields that can be passed in
public function configuration() { return [ /* Enable core fields */ 'core' => [ 'enable_conditional' => true, 'show_empty' => true, 'background_image' => true, ], /* Create custom fields to control the look and feel of a template */ 'fields' => [ 'letter_number' => [ 'id' => 'letter_number', 'name' => esc_html__( 'Number of letter', 'gravity-forms-pdf-extended' ), 'type' => 'number', 'desc' => esc_html__( 'The number of letter (Shomare-ye name)', 'gravity-forms-pdf-extended' ), ], 'letter_date' => [ 'id' => 'letter_date', 'name' => esc_html__( 'Date of letter', 'gravity-forms-pdf-extended' ), 'type' => 'text', 'desc' => esc_html__( 'The date of letter (Tarikh-e name) in YYY/mm/dd format (jalali calendar)', 'gravity-forms-pdf-extended' ), ], 'first_user_data' => [ 'id' => 'first_user_data', 'name' => esc_html__( 'First user data', 'gravity-forms-pdf-extended' ), 'type' => 'text', 'desc' => esc_html__( 'The first user data', 'gravity-forms-pdf-extended' ), 'inputClass' => 'merge-tag-support mt-hide_all_fields', /* add merge tag support */ ], 'first_user_data_top_space' => [ 'id' => 'first_user_data_top_space', 'name' => esc_html__( 'First user data top space', 'gravity-forms-pdf-extended' ), 'type' => 'number', 'desc' => esc_html__( 'Space from top (in px) for first data', 'gravity-forms-pdf-extended' ), ], 'first_user_data_right_space' => [ 'id' => 'first_user_data_right_space', 'name' => esc_html__( 'First user data right space', 'gravity-forms-pdf-extended' ), 'type' => 'number', 'desc' => esc_html__( 'Space from right (in px) for first data', 'gravity-forms-pdf-extended' ), ], 'second_user_data' => [ 'id' => 'second_user_data', 'name' => esc_html__( 'Second user data', 'gravity-forms-pdf-extended' ), 'type' => 'text', 'desc' => esc_html__( 'Second user data', 'gravity-forms-pdf-extended' ), 'inputClass' => 'merge-tag-support mt-hide_all_fields', /* add merge tag support */ ], 'second_user_data_top_space' => [ 'id' => 'second_user_data_top_space', 'name' => esc_html__( 'Second user data top space', 'gravity-forms-pdf-extended' ), 'type' => 'number', 'desc' => esc_html__( 'Space from top (in px) for second data', 'gravity-forms-pdf-extended' ), ], 'second_user_data_right_space' => [ 'id' => 'second_user_data_right_space', 'name' => esc_html__( 'Second user data right space', 'gravity-forms-pdf-extended' ), 'type' => 'number', 'desc' => esc_html__( 'Space from right (in px) for second data', 'gravity-forms-pdf-extended' ), ], ], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function template_options() {\n\t\treturn array(\n\t\t\t'title' => __( 'Protected Content Markup', 'byobgpcm' ),\n\t\t\t'fields' => array(\n\t\t\t\t'use_protected_content_markup' => array(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __( 'Does this template contain protected content?', 'byobgpcm' ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'yes' => __( 'Use protected content markup on this template', 'byobgpcm' )\n\t\t\t\t\t),\n\t\t\t\t\t'dependents' => array( 'yes' )\n\t\t\t\t),\n\t\t\t\t'organization_name' => array(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Organization name is required', 'byobgpcm' ),\n\t\t\t\t\t'width' => 'full',\n\t\t\t\t\t'placeholder' => 'ACME Company',\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'use_protected_content_markup' => 'yes'\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => __( 'Google requires that the name of the organization be published', 'byobgpcm' )\n\t\t\t\t),\n\t\t\t\t'logo_url' => array(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Organization logo URL', 'byobgpcm' ),\n\t\t\t\t\t'width' => 'full',\n\t\t\t\t\t'placeholder' => 'http://acmeco.com/logo-img.jpg',\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'use_protected_content_markup' => 'yes'\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => __( 'Google requires a logo image for the organization - use an absolute url', 'byobgpcm' )\n\t\t\t\t),\n\t\t\t\t'use_more_protection' => array(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __( 'Does this template protect content using the \"More Tag\"?', 'byobgpcm' ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'yes' => __( 'Include \"More Tag\" protection', 'byobgpcm' )\n\t\t\t\t\t),\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'use_protected_content_markup' => 'yes'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'selector1' => array(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Selector to protect', 'byobgpcm' ),\n\t\t\t\t\t'width' => 'medium',\n\t\t\t\t\t'code' => 'true',\n\t\t\t\t\t'placeholder' => '.post_box',\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'use_protected_content_markup' => 'yes'\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => __( 'place the class selector you wish to be marked as protected. Include the class indicator', 'byobgpcm' )\n\t\t\t\t),\n\t\t\t\t'selector2' => array(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Selector to protect', 'byobgpcm' ),\n\t\t\t\t\t'width' => 'medium',\n\t\t\t\t\t'code' => 'true',\n\t\t\t\t\t'placeholder' => '.comment_list',\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'use_protected_content_markup' => 'yes'\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => __( 'place the class selector you wish to be marked as protected. Include the class indicator', 'byobgpcm' )\n\t\t\t\t),\n\t\t\t\t'selector3' => array(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Selector to protect', 'byobgpcm' ),\n\t\t\t\t\t'width' => 'medium',\n\t\t\t\t\t'code' => 'true',\n\t\t\t\t\t'placeholder' => '.post_box',\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'use_protected_content_markup' => 'yes'\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => __( 'place the class selector you wish to be marked as protected. Include the class indicator', 'byobgpcm' )\n\t\t\t\t),\n\t\t\t\t'selector4' => array(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Selector to protect', 'byobgpcm' ),\n\t\t\t\t\t'width' => 'medium',\n\t\t\t\t\t'code' => 'true',\n\t\t\t\t\t'placeholder' => '.post_box',\n\t\t\t\t\t'parent' => array(\n\t\t\t\t\t\t'use_protected_content_markup' => 'yes'\n\t\t\t\t\t),\n\t\t\t\t\t'tooltip' => __( 'place the class selector you wish to be marked as protected. Include the class indicator', 'byobgpcm' )\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function plugin_settings_fields() {\n\t\t\t\t\t\t\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'title' => '',\n\t\t\t\t'description' => $this->plugin_settings_description(),\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'app_id',\n\t\t\t\t\t\t'label' => esc_html__( 'Application ID', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t\t'feedback_callback' => array( $this, 'initialize_api' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'api_username',\n\t\t\t\t\t\t'label' => esc_html__( 'Account Username', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t\t'feedback_callback' => array( $this, 'initialize_api' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'api_password',\n\t\t\t\t\t\t'label' => esc_html__( 'API Password', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t\t'input_type' => 'password',\n\t\t\t\t\t\t'feedback_callback' => array( $this, 'initialize_api' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'client_folder',\n\t\t\t\t\t\t'label' => esc_html__( 'Client Folder', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'choices' => version_compare( GFForms::$version, '2.5-dev-1', '>=' ) ? array( $this, 'client_folders_for_plugin_setting' ) : $this->client_folders_for_plugin_setting(),\n\t\t\t\t\t\t'dependency' => array( $this, 'initialize_api' ),\n\t\t\t\t\t\t'no_choices' => esc_html__( 'Unable to retrieve Client Folders.', 'gravityformsicontact' ),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'type' => 'save',\n\t\t\t\t\t\t'messages' => array(\n\t\t\t\t\t\t\t'success' => esc_html__( 'iContact settings have been updated.', 'gravityformsicontact' )\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\n\t}", "public function getFormTemplates();", "public function getTemplateOptions();", "function get_settings() {\n\n $defaults = [\n 'general' => [\n 'label' => __( 'General', 'fwp' ),\n 'fields' => [\n 'license_key' => [\n 'label' => __( 'License Key', 'fwp' ),\n 'html' => $this->get_field_html( 'license_key' )\n ],\n 'gmaps_api_key' => [\n 'label' => __( 'Google Maps API Key', 'fwp' ),\n 'html' => $this->get_field_html( 'gmaps_api_key' )\n ],\n 'separators' => [\n 'label' => __( 'Separators', 'fwp' ),\n 'html' => $this->get_field_html( 'separators' )\n ],\n 'loading_animation' => [\n 'label' => __( 'Loading Animation', 'fwp' ),\n 'html' => $this->get_field_html( 'loading_animation', 'dropdown', [\n 'choices' => [ 'fade' => __( 'Fade', 'fwp' ), '' => __( 'Spin', 'fwp' ), 'none' => __( 'None', 'fwp' ) ]\n ] )\n ],\n 'prefix' => [\n 'label' => __( 'URL Prefix', 'fwp' ),\n 'html' => $this->get_field_html( 'prefix', 'dropdown', [\n 'choices' => [ 'fwp_' => 'fwp_', '_' => '_' ]\n ] )\n ],\n 'debug_mode' => [\n 'label' => __( 'Debug Mode', 'fwp' ),\n 'html' => $this->get_field_html( 'debug_mode', 'toggle', [\n 'true_value' => 'on',\n 'false_value' => 'off'\n ] )\n ]\n ]\n ],\n 'woocommerce' => [\n 'label' => __( 'WooCommerce', 'fwp' ),\n 'fields' => [\n 'wc_enable_variations' => [\n 'label' => __( 'Support product variations?', 'fwp' ),\n 'notes' => __( 'Enable if your store uses variable products.', 'fwp' ),\n 'html' => $this->get_field_html( 'wc_enable_variations', 'toggle' )\n ],\n 'wc_index_all' => [\n 'label' => __( 'Include all products?', 'fwp' ),\n 'notes' => __( 'Show facet choices for out-of-stock products?', 'fwp' ),\n 'html' => $this->get_field_html( 'wc_index_all', 'toggle' )\n ]\n ]\n ],\n 'backup' => [\n 'label' => __( 'Backup', 'fwp' ),\n 'fields' => [\n 'export' => [\n 'label' => __( 'Export', 'fwp' ),\n 'html' => $this->get_field_html( 'export' )\n ],\n 'import' => [\n 'label' => __( 'Import', 'fwp' ),\n 'html' => $this->get_field_html( 'import' )\n ]\n ]\n ]\n ];\n\n if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {\n unset( $defaults['woocommerce'] );\n }\n\n return apply_filters( 'facetwp_settings_admin', $defaults, $this );\n }", "public function getConfigurationFields()\n {\n return [\n 'restApiKey' => [\n //Should be replaced by a password formType but which doesn't\n //empty the field at each edit\n 'type' => 'text',\n 'options' => [\n 'required' => true,\n 'help' => 'pim_prestashop_connector.export.restApiKey.help',\n 'label' => 'pim_prestashop_connector.export.restApiKey.label',\n ],\n ],\n 'prestashopUrl' => [\n 'options' => [\n 'required' => true,\n 'help' => 'pim_prestashop_connector.export.prestashopUrl.help',\n 'label' => 'pim_prestashop_connector.export.prestashopUrl.label',\n ],\n ],\n 'httpLogin' => [\n 'options' => [\n 'required' => false,\n 'help' => 'pim_prestashop_connector.export.httpLogin.help',\n 'label' => 'pim_prestashop_connector.export.httpLogin.label',\n ],\n ],\n 'httpPassword' => [\n 'options' => [\n 'required' => false,\n 'help' => 'pim_prestashop_connector.export.httpPassword.help',\n 'label' => 'pim_prestashop_connector.export.httpPassword.label',\n ],\n ],\n 'defaultStoreView' => [\n 'options' => [\n 'required' => false,\n 'help' => 'pim_prestashop_connector.export.defaultStoreView.help',\n 'label' => 'pim_prestashop_connector.export.defaultStoreView.label',\n 'data' => $this->getDefaultStoreView(),\n ],\n ],\n ];\n }", "public function get_settings_fields() {\n\n\n\t\t/*\n\t\t * name ( name of the field)\n\t\t * type ( type of the field which help to call call class back)\n\t\t * label ( [optional] if you want to display any think the description )\n\t\t * default ( [optional] default values)\n\t\t * options ( [optional] options we use when type is select mostly but this use to give option to fields)\n\t\t * link ( [optional] in case you send a link to field)\n\t\t * sanitize_callback ( [optional] sanitize call back of the field)\n\t\t * priority [ [optional] use to giving parity to the user]\n\t\t * page ( page name we use menu slug this fields belong to this page)\n\t\t *\n\t\t * */\n\n\n\t\t// setting files index key is ( section => array( fields ))\n\t\t$settings_fields = array(\n\t\t\t'test_1' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'name',\n\t\t\t\t\t'label' => __( 'Enter the name', 'sharaz_settings' ),\n\t\t\t\t\t'desc' => __( '<h4>Sharaz Setting Api</h4>if you like please share to others', 'sharaz_settings' ),\n\t\t\t\t\t'type' => 'ss_text',\n\t\t\t\t\t'page' => 'ss_page',\n\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t'priority' => '5',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'salary',\n\t\t\t\t\t'label' => 'Select your salary range',\n\t\t\t\t\t'type' => 'ss_select',\n\t\t\t\t\t'page' => 'ss_page',\n\t\t\t\t\t'default' => '2000',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'1000' => '1000',\n\t\t\t\t\t\t'2000' => '2000',\n\t\t\t\t\t\t'3000' => '3000',\n\t\t\t\t\t),\n\t\t\t\t\t'priority' => '10'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'advance_bonus',\n\t\t\t\t\t'label' => __( 'Receving advance bonus', 'sharaz_settings' ),\n\t\t\t\t\t'type' => 'ss_checkbox',\n\t\t\t\t\t'page' => 'ss_page',\n\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t'priority' => '15',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'your_color',\n\t\t\t\t\t'label' => __( 'Your Setting', 'sharaz-setting' ),\n\t\t\t\t\t'type' => 'ss_color',\n\t\t\t\t\t'page' => 'ss_page',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'priority' => '20',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'test_2' => array(\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'suggestion',\n\t\t\t\t\t\t'label' => __( 'Ang suggestion', 'sharaz_settings' ),\n\t\t\t\t\t\t'desc' => __( '<h4>Please type some</h4>if you like suggest some thing to us', 'sharaz_settings' ),\n\t\t\t\t\t\t'type' => 'ss_text',\n\t\t\t\t\t\t'page' =>'ss_page1',\n\t\t\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t\t\t'priority' => '5',\n\t\t\t\t\t),\n\n\t\t\t)\n\t\t);\n\n\t\treturn $settings_fields;\n\t}", "private function getSectionSettingFields(){\n\t\t\t\n\t\t\t$fields = array(\n\n\t\t\t\tField::text(\n\t\t\t\t\t'name',\n\t\t\t\t\t__( 'Template name', 'chefsections' )\n\t\t\t\t),\n\n\t\t\t\tField::text( \n\t\t\t\t\t'classes',\n\t\t\t\t\t__( 'CSS Classes', 'chefsections' ),\n\t\t\t\t\tarray( \n\t\t\t\t\t\t'placeholder' => __( 'Seperate with commas\\'s', 'chefsections' ),\n\t\t\t\t\t)\n\t\t\t\t),\n\n\t\t\t\tField::checkbox(\n\t\t\t\t\t'hide_container',\n\t\t\t\t\t__( 'Hide Container', 'chefsections' )\n\t\t\t\t),\n\n\t\t\t);\n\n\t\t\t$fields = apply_filters( 'chef_sections_setting_fields', $fields, $this );\n\n\t\t\treturn $fields;\n\t\t}", "function awm_fields_configuration()\n {\n $metas = array(\n 'awm_fields' => array(\n 'item_name' => __('Field', 'extend-wp'),\n 'label' => __('Fields', 'extend-wp'),\n 'case' => 'repeater',\n 'include' => array(\n 'key' => array(\n 'label' => __('Meta key', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'label' => array(\n 'label' => __('Meta label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'case' => array(\n 'label' => __('Field type', 'extend-wp'),\n 'case' => 'select',\n 'options' => awmInputFields(),\n 'label_class' => array('awm-needed'),\n 'attributes' => array('data-callback' => \"awm_get_case_fields\"),\n ),\n 'case_extras' => array(\n 'label' => __('Field type configuration', 'extend-wp'),\n 'case' => 'html',\n 'value' => '<div class=\"awm-field-type-configuration\"></div>',\n 'exclude_meta' => true,\n 'show_label' => true\n ),\n 'attributes' => array(\n 'label' => __('Attributes', 'extend-wp'),\n 'explanation' => __('like min=0 / onchange=action etc'),\n 'minrows' => 0,\n 'case' => 'repeater',\n 'item_name' => __('Attribute', 'extend-wp'),\n 'include' => array(\n 'label' => array(\n 'label' => __('Attribute label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'value' => array(\n 'label' => __('Attribute value', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n )\n ),\n 'class' => array(\n 'label' => __('Class', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'attributes' => array('placeholder' => __('Seperated with (,) comma', 'extend-wp')),\n ),\n 'required' => array(\n 'label' => __('Required', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n ),\n 'admin_list' => array(\n 'label' => __('Show in admin list', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n ),\n 'auto_translate' => array(\n 'label' => __('Auto translate', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n ),\n 'order' => array(\n 'label' => __('Order', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'number',\n ),\n 'explanation' => array(\n 'label' => __('User message', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'attributes' => array('placeholder' => __('Guidelines for the user', 'extend-wp')),\n ),\n )\n )\n );\n return apply_filters('awm_fields_configuration_filter', $metas);\n }", "private function __getConfigurationFields()\n {\n ob_start();\n\n foreach ($this->config['configuration'] as $config) {\n include 'view/formFields.php';\n }\n\n $html = ob_get_clean();\n\n return $html;\n }", "public function plugin_settings_fields() {\n\n\t\t// Get current plugin settings.\n\t\t$settings = $this->get_plugin_settings();\n\n\t\t// Prepare base fields.\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'accessToken',\n\t\t\t\t'type' => 'hidden',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'customAppEnable',\n\t\t\t\t'type' => 'hidden',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => null,\n\t\t\t\t'label' => null,\n\t\t\t\t'type' => 'auth_token_button',\n\t\t\t),\n\t\t);\n\n\t\t// If API is initialized, add custom app key/secret fields.\n\t\tif ( $this->initialize_api() ) {\n\t\t\t$fields[] = array( 'name' => 'customAppKey', 'type' => 'hidden' );\n\t\t\t$fields[] = array( 'name' => 'customAppSecret', 'type' => 'hidden' );\n\t\t}\n\n\t\t// Setup base fields.\n\t\treturn array( array( 'fields' => $fields ) );\n\n\t}", "public function init_fields () {\r\n\t $options = array( 'wp_die' => __( 'Use WordPress Default', 'woodojo-maintenance-mode' ), 'theme-503' => __( '503.php in the current theme', 'woodojo-maintenance-mode' ) );\r\n\r\n\t $results = $this->find_templates();\r\n\r\n\t\tif ( is_array( $results ) && count( $results ) > 0 ) {\r\n\t\t\tforeach ( $results as $k => $v ) {\r\n\t\t\t\t$options[$k] = $v;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Allow themes/plugins to filter here.\r\n\t $options = apply_filters( 'woodojo_maintenance_mode_templates', $options );\r\n\r\n\t $fields = array();\r\n\t \r\n\t\t$fields['enable'] = array(\r\n\t\t 'name' => __( 'Enable', 'woodojo-maintenance-mode' ), \r\n\t\t 'description' => __( 'Turn on maintenance mode.', 'woodojo-maintenance-mode' ), \r\n\t\t 'type' => 'checkbox', \r\n\t\t 'default' => false, \r\n\t\t 'section' => 'general'\r\n\t\t);\r\n\t \r\n\t\t$fields['role'] = array(\r\n\t\t 'name' => __( 'Bypass Capability Requirement', 'woodojo-maintenance-mode' ), \r\n\t\t 'description' => __( 'Determine which level of users can see the website when in Maintenance Mode.', 'woodojo-maintenance-mode'), \r\n\t\t 'type' => 'select', \r\n\t\t 'default' => 'manage_options', \r\n\t\t 'options'\t=> array(\r\n\t\t \t'manage_options'\t=> __( 'Administrator', 'woodojo-maintenance-mode' ),\r\n\t\t \t'publish_pages'\t\t=> __( 'Editor', 'woodojo-maintenance-mode' ),\r\n\t\t \t'publish_posts'\t\t=> __( 'Author', 'woodojo-maintenance-mode' ),\r\n\t\t \t'edit_posts'\t\t=> __( 'Contributor', 'woodojo-maintenance-mode' ),\r\n\t\t \t'read'\t\t\t\t=> __( 'Subscriber', 'woodojo-maintenance-mode' )\r\n\t\t ),\r\n\t\t 'section' => 'general'\r\n\t\t);\r\n\t \r\n\t\t$fields['template'] = array(\r\n\t\t 'name' => __( 'Template', 'woodojo-maintenance-mode' ), \r\n\t\t 'description' => __( 'Choose the design to be used for your Maintenance Mode screen.', 'woodojo-maintenance-mode' ), \r\n\t\t 'type' => 'select', \r\n\t\t 'default' => 'wp_die', \r\n\t\t 'options'\t=> $options,\r\n\t\t 'section' => 'general'\r\n\t\t);\r\n\t \r\n\t\t$fields['page_title'] = array(\r\n\t\t 'name' => __( 'Maintenance Page Title', 'woodojo-maintenance-mode' ), \r\n\t\t 'description' => __( 'This is the page title for the Maintenance Mode page. Leave blank to use your website\\'s title.', 'woodojo-maintenance-mode' ), \r\n\t\t 'type' => 'text', \r\n\t\t 'default' => '', \r\n\t\t 'section' => 'general'\r\n\t\t);\r\n\r\n\t\t$fields['title'] = array(\r\n\t\t 'name' => __( 'Maintenance Title', 'woodojo-maintenance-mode' ), \r\n\t\t 'description' => __( 'This is the HTML title of the Maintenance Mode page. Leave blank for the default.', 'woodojo-maintenance-mode' ), \r\n\t\t 'type' => 'text', \r\n\t\t 'default' => '', \r\n\t\t 'section' => 'general'\r\n\t\t);\r\n\t \r\n\t\t$fields['note'] = array(\r\n\t\t 'name' => __( 'Maintenance Note', 'woodojo-maintenance-mode' ), \r\n\t\t 'description' => __( 'A brief note that will be included in the Maintenance Mode page. Leave blank for the default text.', 'woodojo-maintenance-mode' ), \r\n\t\t 'type' => 'textarea', \r\n\t\t 'default' => '', \r\n\t\t 'section' => 'general'\r\n\t\t);\r\n\t\t\r\n\t\t$this->fields = $fields;\r\n\t\r\n\t}", "public function get_settings_fields() {\n $settings_fields = array(\n 'grocery-general' => array(\n 'popup_logo' => array(\n 'name' => 'popup_logo',\n 'label' => __( 'Popup Logo', 'fondendpost' ),\n 'desc' => __( 'Logo to show in the popup.', 'fondendpost' ),\n 'type' => 'file',\n ),\n ),\n );\n \n return $settings_fields;\n\n }", "public function load_settings_fields() {\n\t\t\tglobal $wp_rewrite;\n\t\t\tif ( $wp_rewrite->using_permalinks() ) {\n\t\t\t\t$this->setting_option_fields = array(\n\t\t\t\t\t'courses' => array(\n\t\t\t\t\t\t'name' => 'courses',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Courses.\n\t\t\t\t\t\t\tesc_html_x( '%s', 'placeholder: Courses', 'learndash' ),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'courses' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'value' => $this->setting_option_values['courses'],\n\t\t\t\t\t\t'class' => 'regular-text',\n\t\t\t\t\t),\n\t\t\t\t\t'lessons' => array(\n\t\t\t\t\t\t'name' => 'lessons',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Lessons.\n\t\t\t\t\t\t\tesc_html_x( '%s', 'placeholder: Lessons', 'learndash' ),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'lessons' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'value' => $this->setting_option_values['lessons'],\n\t\t\t\t\t\t'class' => 'regular-text',\n\t\t\t\t\t),\n\t\t\t\t\t'topics' => array(\n\t\t\t\t\t\t'name' => 'topics',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Topics.\n\t\t\t\t\t\t\tesc_html_x( '%s', 'placeholder: Topics', 'learndash' ),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'topics' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'value' => $this->setting_option_values['topics'],\n\t\t\t\t\t\t'class' => 'regular-text',\n\t\t\t\t\t),\n\t\t\t\t\t'quizzes' => array(\n\t\t\t\t\t\t'name' => 'quizzes',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quizzes.\n\t\t\t\t\t\t\tesc_html_x( '%s', 'placeholder: Quizzes', 'learndash' ),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quizzes' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'value' => $this->setting_option_values['quizzes'],\n\t\t\t\t\t\t'class' => 'regular-text',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $wp_rewrite->using_permalinks() ) {\n\t\t\t\t$example_regular_topic_url = get_option( 'home' ) . '/' . $this->setting_option_values['topics'] . '/topic-slug';\n\t\t\t\t$example_nested_topic_url = get_option( 'home' ) . '/' . $this->setting_option_values['courses'] . '/course-slug/' . $this->setting_option_values['lessons'] . '/lesson-slug/' . $this->setting_option_values['topics'] . '/topic-slug';\n\t\t\t} else {\n\t\t\t\t$example_regular_topic_url = add_query_arg( learndash_get_post_type_slug( 'topic' ), 'topic-slug', get_option( 'home' ) );\n\n\t\t\t\t$example_nested_topic_url = get_option( 'home' );\n\t\t\t\t$example_nested_topic_url = add_query_arg( learndash_get_post_type_slug( 'course'), 'course-slug', $example_nested_topic_url );\n\t\t\t\t$example_nested_topic_url = add_query_arg( learndash_get_post_type_slug( 'lesson' ), 'lesson-slug', $example_nested_topic_url );\n\t\t\t\t$example_nested_topic_url = add_query_arg( learndash_get_post_type_slug( 'topic' ), 'topic-slug', $example_nested_topic_url );\n\t\t\t}\n\n\t\t\t$this->setting_option_fields['nested_urls'] = array(\n\t\t\t\t'name' => 'nested_urls',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable Nested URLs', 'learndash' ),\n\t\t\t\t'desc' => sprintf(\n\t\t\t\t\t// translators: placeholders: Lesson, Topic, Quiz, Course, Site Home URL, URL to Course Builder Settings.\n\t\t\t\t\t_x(\n\t\t\t\t\t\t'This option will restructure %1$s, %2$s and %3$s URLs so they are nested hierarchically within the %4$s URL.<br />For example instead of the default topic URL <code>%5$s</code> the nested URL would be <code>%6$s</code>. If <a href=\"%7$s\">Course Builder Share Steps</a> has been enabled this setting is also automatically enabled.',\n\t\t\t\t\t\t'placeholders: Lesson, Topic, Quiz, Course, Site Home URL, URL to Course Builder Settings',\n\t\t\t\t\t\t'learndash'\n\t\t\t\t\t),\n\t\t\t\t\tLearnDash_Custom_Label::get_label( 'lesson' ),\n\t\t\t\t\tLearnDash_Custom_Label::get_label( 'topic' ),\n\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' ),\n\t\t\t\t\tLearnDash_Custom_Label::get_label( 'course' ),\n\t\t\t\t\t$example_regular_topic_url,\n\t\t\t\t\t$example_nested_topic_url,\n\t\t\t\t\tadmin_url( 'admin.php?page=courses-options' )\n\t\t\t\t),\n\t\t\t\t'value' => isset( $this->setting_option_values['nested_urls'] ) ? $this->setting_option_values['nested_urls'] : '',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'yes' => __( 'Yes', 'learndash' ),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$this->setting_option_fields['nonce'] = array(\n\t\t\t\t'name' => 'nonce',\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'label' => '',\n\t\t\t\t'value' => wp_create_nonce( 'learndash_permalinks_nonce' ),\n\t\t\t\t'class' => 'hidden',\n\t\t\t);\n\n\t\t\t$this->setting_option_fields = apply_filters( 'learndash_settings_fields', $this->setting_option_fields, $this->settings_section_key );\n\n\t\t\tparent::load_settings_fields();\n\t\t}", "public function xml_fields()\n {\n $post_url = build_url(array('page' => '_SELF', 'type' => '_xml_fields'), '_SELF');\n\n return do_template('XML_CONFIG_SCREEN', array(\n '_GUID' => 'cc21f921ecbdbdf83e1e28d2b3f75a3a',\n 'TITLE' => $this->title,\n 'POST_URL' => $post_url,\n 'XML' => file_exists(get_custom_file_base() . '/data_custom/xml_config/fields.xml') ? cms_file_get_contents_safe(get_custom_file_base() . '/data_custom/xml_config/fields.xml') : cms_file_get_contents_safe(get_file_base() . '/data/xml_config/fields.xml'),\n ));\n }", "function layout_get_templates_options_object( )\n\t{\n\n\t\t$ret = new stdClass();\n\n $template_option = $this->get_option('templates');\n if ($template_option) {\n foreach($template_option as $file => $layout) {\n $layout_templates[] = $file;\n }\n }\n\n\t\t$templates = wp_get_theme()->get_page_templates();\n\n\t\t$ret->layout_templates = $this->templates_have_layout( $templates );\n\t\t$ret->template_option = $template_option;\n\n\t\treturn $ret;\n\t}", "function get_settings_fields() {\n global $wrr_pro;\n $settings_fields = array(\n \n 'wc_segmented_ratings' => array(\n array(\n 'name' => 'enable',\n 'label' => 'Enable Segmented Ratings?',\n 'type' => 'checkbox',\n 'desc' => 'Check to enable. Please note, it will not work, if product rating is disabled from <a href=\"' . admin_url( 'admin.php?page=wc-settings&tab=products' ) . '\">WooCommerce setting</a>.',\n ),\n array(\n 'name' => 'member_only',\n 'label' => 'Verified buyers only?',\n 'desc' => 'Check to enable segmented ratings for users only who already purchased the item <i><a href=\"' . $wrr_pro . '\">(Pro Feature)</a></i>',\n 'type' => 'checkbox',\n 'disabled' => true,\n ),\n array(\n 'name' => 'params_per',\n 'label' => 'Parameter Base',\n 'desc' => 'How do you want to set rating parameters for your products? <i><a href=\"' . $wrr_pro . '\">(Pro Feature)</a></i>',\n 'type' => 'radio',\n 'options' => array(\n 'site' => 'Same parameters for all products',\n 'category' => 'Different parameters for each category',\n 'product' => 'Different parameters for each product',\n ),\n 'default' => 'site',\n 'disabled' => true,\n ),\n array(\n 'name' => 'fields',\n 'label' => 'Rating Parameters',\n 'desc' => 'If \\'<strong><label for=\"mdc-wc_segmented_ratings[params_per][site]\">Same parameters for all products</label></strong>\\' choosen for \\'Parameter Base\\' above. Ignore otherwise.<br />Type one segment per line. Separate \\'key\\' and \\'label\\' with a pipe symbol (\\'|\\').',\n 'type' => 'textarea',\n 'default' => 'price|Price'.PHP_EOL.'quality|Quality',\n ),\n ),\n 'wc_rich_editor' => array(\n array(\n 'name' => 'enable',\n 'label' => 'Enable Rich Editor?',\n 'type' => 'checkbox',\n 'desc' => 'Check to enable rich editor (<a href=\"https://en.wikipedia.org/wiki/WYSIWYG\">WYSIWYG</a>) in product review <i><a href=\"' . $wrr_pro . '\">(Pro Feature)</a></i>',\n 'disabled' => true,\n ),\n array(\n 'name' => 'member_only',\n 'label' => 'Verified buyers only?',\n 'desc' => 'Check to enable rich editor for users only who already purchased the item <i><a href=\"' . $wrr_pro . '\">(Pro Feature)</a></i>',\n 'type' => 'checkbox',\n 'disabled' => true,\n ),\n array(\n 'name' => 'teeny',\n 'label' => 'Teeny Mode?',\n 'desc' => 'Check to enable teeny mode. It\\'ll hide some features of WYSIWYG editor. <i><a href=\"' . $wrr_pro . '\">(Pro Feature)</a></i>',\n 'type' => 'checkbox',\n 'default' => 'off',\n 'disabled' => true,\n ),\n array(\n 'name' => 'quicktags',\n 'label' => 'Enable Text editor?',\n 'desc' => 'Check to enable quick tag mode. It\\'ll show \\'Text\\' tab in WYSIWYG editor to write/view HTML. <i><a href=\"' . $wrr_pro . '\">(Pro Feature)</a></i>',\n 'type' => 'checkbox',\n 'default' => 'off',\n 'disabled' => true,\n ),\n array(\n 'name' => 'media_buttons',\n 'desc' => 'Check to allow reviewers to upload/attach media files with review. <i><a href=\"' . $wrr_pro . '\">(Pro Feature)</a></i>',\n 'label' => 'Enable Media Uploader?',\n 'type' => 'checkbox',\n 'default' => 'off',\n 'disabled' => true,\n ),\n ), \n );\n\n return $settings_fields;\n }", "function ca_services_node_template_access_settings($form, &$form_state, $conf) {\n $form['settings']['ca_services_node_template'] = array(\n '#type' => 'select',\n '#title' => t('Services\\'s node template'),\n '#options' => array(\n 'ca_services_node_template_one' => t('Template one'),\n 'ca_services_node_template_two' => t('Template two'),\n 'ca_services_node_template_three' => t('Template three'),\n ),\n '#required' => TRUE,\n '#default_value' => $conf['ca_services_node_template'],\n );\n\n return $form;\n}", "public function load_settings_fields() {\n\t\t\t$this->setting_option_fields = array(\n\t\t\t\t'admin_mail_from_name' => array(\n\t\t\t\t\t'name' => 'admin_mail_from_name',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__( 'From Name', 'learndash' ),\n\t\t\t\t\t'help_text' => esc_html__( 'This is the name of the sender. If not provided will default to the system email name.', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['admin_mail_from_name'] ) ? $this->setting_option_values['admin_mail_from_name'] : '',\n\t\t\t\t),\n\t\t\t\t'admin_mail_from_email' => array(\n\t\t\t\t\t'name' => 'admin_mail_from_email',\n\t\t\t\t\t'type' => 'email',\n\t\t\t\t\t'label' => esc_html__( 'From Email', 'learndash' ),\n\t\t\t\t\t'help_text' => sprintf(\n\t\t\t\t\t\t// translators: placeholder: admin email.\n\t\t\t\t\t\tesc_html_x( 'This is the email address of the sender. If not provided the admin email %s will be used.', 'placeholder: admin email', 'learndash' ),\n\t\t\t\t\t\t'(<strong>' . get_option( 'admin_email' ) . '</strong>)'\n\t\t\t\t\t),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['admin_mail_from_email'] ) ? $this->setting_option_values['admin_mail_from_email'] : '',\n\t\t\t\t),\n\t\t\t\t'admin_mail_to' => array(\n\t\t\t\t\t'name' => 'admin_mail_to',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__( 'Mail To', 'learndash' ),\n\t\t\t\t\t'help_text' => esc_html__( 'Separate multiple email addresses with a comma, e.g. [email protected], [email protected].', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['admin_mail_to'] ) ? $this->setting_option_values['admin_mail_to'] : '',\n\t\t\t\t),\n\t\t\t\t'admin_mail_subject' => array(\n\t\t\t\t\t'name' => 'admin_mail_subject',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__( 'Subject', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['admin_mail_subject'] ) ? $this->setting_option_values['admin_mail_subject'] : '',\n\t\t\t\t),\n\t\t\t\t'admin_mail_message' => array(\n\t\t\t\t\t'name' => 'admin_mail_message',\n\t\t\t\t\t'type' => 'wpeditor',\n\t\t\t\t\t'label' => esc_html__( 'Message', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['admin_mail_message'] ) ? stripslashes( $this->setting_option_values['admin_mail_message'] ) : '',\n\t\t\t\t\t'editor_args' => array(\n\t\t\t\t\t\t'textarea_name' => $this->setting_option_key . '[admin_mail_message]',\n\t\t\t\t\t\t'textarea_rows' => 5,\n\t\t\t\t\t\t'editor_class' => 'learndash_mail_message ' . $this->setting_option_key . '_admin_mail_message',\n\t\t\t\t\t),\n\t\t\t\t\t'label_description' => '<div>\n\t\t\t\t\t\t<h4>' . esc_html__( 'Supported variables', 'learndash' ) . ':</h4>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li><span>$userId</span> - ' . esc_html__( 'User-ID', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$username</span> - ' . esc_html__( 'Username', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$quizname</span> - ' . esc_html__( 'Quiz-Name', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$result</span> - ' . esc_html__( 'Result in percent', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$points</span> - ' . esc_html__( 'Reached points', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$ip</span> - ' . esc_html__( 'IP-address of the user', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$categories</span> - ' . esc_html__( 'Category-Overview', 'learndash' ) . '</li>\n\t\t\t\t\t\t</ul>\t\n\t\t\t\t\t</div>',\n\t\t\t\t),\n\t\t\t\t'admin_mail_html' => array(\n\t\t\t\t\t'name' => 'admin_mail_html',\n\t\t\t\t\t'type' => 'checkbox-switch',\n\t\t\t\t\t'label' => esc_html__( 'Allow HTML', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['admin_mail_html'] ) ? $this->setting_option_values['admin_mail_html'] : '',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'yes' => '',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t\t'user_mail_from_name' => array(\n\t\t\t\t\t'name' => 'user_mail_from_name',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__( 'From Name', 'learndash' ),\n\t\t\t\t\t'help_text' => esc_html__( 'This is the name of the sender. If not provided will default to the system email name.', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['admin_mail_from_name'] ) ? $this->setting_option_values['admin_mail_from_name'] : '',\n\t\t\t\t),\n\t\t\t\t'user_mail_from_email' => array(\n\t\t\t\t\t'name' => 'user_mail_from_email',\n\t\t\t\t\t'type' => 'email',\n\t\t\t\t\t'label' => esc_html__( 'From Email', 'learndash' ),\n\t\t\t\t\t'help_text' => sprintf(\n\t\t\t\t\t\t// translators: placeholder: admin email.\n\t\t\t\t\t\tesc_html_x( 'This is the email address of the sender. If not provided the admin email %s will be used.', 'placeholder: admin email', 'learndash' ),\n\t\t\t\t\t\t'(<strong>' . get_option( 'admin_email' ) . '</strong>)'\n\t\t\t\t\t),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['user_mail_from_email'] ) ? $this->setting_option_values['user_mail_from_email'] : '',\n\t\t\t\t),\n\t\t\t\t'user_mail_subject' => array(\n\t\t\t\t\t'name' => 'user_mail_subject',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__( 'Subject', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['user_mail_subject'] ) ? $this->setting_option_values['user_mail_subject'] : '',\n\t\t\t\t),\n\t\t\t\t'user_mail_message' => array(\n\t\t\t\t\t'name' => 'user_mail_message',\n\t\t\t\t\t'type' => 'wpeditor',\n\t\t\t\t\t'label' => esc_html__( 'Message', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['user_mail_message'] ) ? stripslashes( $this->setting_option_values['user_mail_message'] ) : '',\n\t\t\t\t\t'editor_args' => array(\n\t\t\t\t\t\t'textarea_name' => $this->setting_option_key . '[user_mail_message]',\n\t\t\t\t\t\t'textarea_rows' => 5,\n\t\t\t\t\t\t'editor_class' => 'learndash_mail_message ' . $this->setting_option_key . '_user_mail_message',\n\t\t\t\t\t),\n\t\t\t\t\t'label_description' => '<div>\n\t\t\t\t\t\t<h4>' . esc_html__( 'Supported variables', 'learndash' ) . ':</h4>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li><span>$userId</span> - ' . esc_html__( 'User-ID', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$username</span> - ' . esc_html__( 'Username', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$quizname</span> - ' . esc_html__( 'Quiz-Name', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$result</span> - ' . esc_html__( 'Result in percent', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$points</span> - ' . esc_html__( 'Reached points', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$ip</span> - ' . esc_html__( 'IP-address of the user', 'learndash' ) . '</li>\n\t\t\t\t\t\t\t<li><span>$categories</span> - ' . esc_html__( 'Category-Overview', 'learndash' ) . '</li>\n\t\t\t\t\t\t</ul>\t\n\t\t\t\t\t</div>',\n\t\t\t\t),\n\t\t\t\t'user_mail_html' => array(\n\t\t\t\t\t'name' => 'user_mail_html',\n\t\t\t\t\t'type' => 'checkbox-switch',\n\t\t\t\t\t'label' => esc_html__( 'Allow HTML', 'learndash' ),\n\t\t\t\t\t'value' => isset( $this->setting_option_values['user_mail_html'] ) ? $this->setting_option_values['user_mail_html'] : '',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'yes' => '',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$this->setting_option_fields = apply_filters( 'learndash_settings_fields', $this->setting_option_fields, $this->settings_section_key );\n\n\t\t\tparent::load_settings_fields();\n\t\t}", "public function feed_settings_fields() {\n\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'title' => '',\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feedName',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'label' => esc_html__( 'Name', 'gravityformsdropbox' ),\n\t\t\t\t\t\t'save_callback' => array( $this, 'sanitize_settings_value' ),\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'Name', 'gravityformsdropbox' ),\n\t\t\t\t\t\t\tesc_html__( 'Enter a feed name to uniquely identify this setup.', 'gravityformsdropbox' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'fileUploadField',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'label' => esc_html__( 'File Upload Field', 'gravityformsdropbox' ),\n\t\t\t\t\t\t'choices' => $this->get_file_upload_field_choices(),\n\t\t\t\t\t\t'save_callback' => array( $this, 'sanitize_settings_value' ),\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'File Upload Field', 'gravityformsdropbox' ),\n\t\t\t\t\t\t\tesc_html__( 'Select the specific File Upload field that you want to be uploaded to Dropbox.', 'gravityformsdropbox' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'destinationFolder',\n\t\t\t\t\t\t'type' => 'folder',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'label' => esc_html__( 'Destination Folder', 'gravityformsdropbox' ),\n\t\t\t\t\t\t'save_callback' => array( $this, 'sanitize_settings_value' ),\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s<br /><br />%s',\n\t\t\t\t\t\t\tesc_html__( 'Destination Folder', 'gravityformsdropbox' ),\n\t\t\t\t\t\t\tesc_html__( 'Select the folder in your Dropbox account where the files will be uploaded to.', 'gravityformsdropbox' ),\n\t\t\t\t\t\t\tesc_html__( 'By default, all files are stored in the \"Gravity Forms Add-On\" folder within the Dropbox Apps folder in your Dropbox account.', 'gravityformsdropbox' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feedCondition',\n\t\t\t\t\t\t'type' => 'feed_condition',\n\t\t\t\t\t\t'label' => esc_html__( 'Upload Condition', 'gravityformsdropbox' ),\n\t\t\t\t\t\t'checkbox_label' => esc_html__( 'Enable Condition', 'gravityformsdropbox' ),\n\t\t\t\t\t\t'instructions' => esc_html__( 'Upload to Dropbox if', 'gravityformsdropbox' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t}", "function snax_admin_get_settings_fields() {\n\treturn (array) apply_filters( 'snax_admin_get_settings_fields', array(\n\n\t\t/** General Section **************************************************** */\n\n\t\t'snax_settings_general' => array(\n\t\t\t'snax_active_formats' => array(\n\t\t\t\t'title' => __( 'Active formats', 'snax' ) . '<br /><span style=\"font-weight: normal;\">' . __( '(drag to reorder)', 'snax' ) . '</span>',\n\t\t\t\t'callback' => 'snax_admin_setting_callback_active_formats',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_formats_order' => array(\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t),\n\t\t\t'snax_featured_media_required' => array(\n\t\t\t\t'title' => __( 'Featured image field', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_featured_media_required',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_required' => array(\n\t\t\t\t'title' => __( 'Category field', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_required',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_multi' => array(\n\t\t\t\t'title' => __( 'Multiple categories selection?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_multi',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_whitelist' => array(\n\t\t\t\t'title' => __( 'Category whitelist', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_whitelist',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_category_whitelist',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_category_auto_assign' => array(\n\t\t\t\t'title' => __( 'Auto assign to categories', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_category_auto_assign',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_category_whitelist',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_allow_snax_authors_to_add_referrals' => array(\n\t\t\t\t'title' => __( 'Referral link field ', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_allow_snax_authors_to_add_referrals',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_froala_for_items' => array(\n\t\t\t\t'title' => __( 'Allow rich editor for items in Frontend Submission', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_froala_for_items',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_froala_for_list_items' => array(\n\t\t\t\t'title' => __( 'Allow rich editor for items in open lists', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_froala_for_list_items',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_single_post_page_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Single Post Page', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_featured_images_for_formats' => array(\n\t\t\t\t'title' => __( 'Show featured images for single:', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_show_featured_images_for_formats',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_display_comments_on_lists' => array(\n\t\t\t\t'title' => __( 'Display items comments on list view ', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_display_comments_on_lists',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_origin' => array(\n\t\t\t\t'title' => __( 'Show the \"This post was created with our nice and easy submission form.\" text', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_show_origin',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_misc_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Misc', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_item_count_in_title' => array(\n\t\t\t\t'title' => __( 'Show items count in title', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_count_in_title',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_disable_admin_bar' => array(\n\t\t\t\t'title' => __( 'Disable admin bar for non-administrators', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_disable_admin_bar',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_disable_dashboard_access' => array(\n\t\t\t\t'title' => __( 'Disable Dashboard access for non-administrators', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_disable_dashboard_access',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_disable_wp_login' => array(\n\t\t\t\t'title' => __( 'Disable WP login form', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_disable_wp_login',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_enable_login_popup' => array(\n\t\t\t\t'title' => __( 'Enbable the login popup ', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_enable_login_popup',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_skip_verification' => array(\n\t\t\t\t'title' => __( 'Moderate new posts?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_skip_verification',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_mail_notifications' => array(\n\t\t\t\t'title' => __( 'Send mail to admin when new post/item was added?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_mail_notifications',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Lists Section ****************************************************** */\n\n\t\t'snax_settings_lists' => array(\n\t\t\t'snax_active_item_forms' => array(\n\t\t\t\t'title' => __( 'Item forms', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_active_item_forms',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_show_open_list_in_title' => array(\n\t\t\t\t'title' => __( 'Show list status in title', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_list_status_in_title',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Pages Section ***************************************************** */\n\n\t\t'snax_settings_pages' => array(\n\t\t\t// Frontend Submission.\n\t\t\t'snax_frontend_submission_page_id' => array(\n\t\t\t\t'title' => __( 'Frontend Submission', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_frontend_submission_page',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_published_post',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t// Terms & Conditions.\n\t\t\t'snax_legal_page_id' => array(\n\t\t\t\t'title' => __( 'Terms and Conditions', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_legal_page',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_published_post',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t// Report.\n\t\t\t'snax_report_page_id' => array(\n\t\t\t\t'title' => __( 'Report', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_report_page',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_published_post',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Voting Section **************************************************** */\n\n\t\t'snax_settings_voting' => array(\n\t\t\t'snax_voting_is_enabled' => array(\n\t\t\t\t'title' => __( 'Enable voting?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_voting_enabled',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_guest_voting_is_enabled' => array(\n\t\t\t\t'title' => __( 'Guests can vote?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_guest_voting_enabled',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_voting_post_types' => array(\n\t\t\t\t'title' => __( 'Allow users to vote on post types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_voting_post_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_fake_vote_count_base' => array(\n\t\t\t\t'title' => __( 'Fake vote count base', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_fake_vote_count_base',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Limits Section **************************************************** */\n\n\t\t'snax_settings_limits' => array(\n\n\t\t\t/* IMAGES UPLOAD */\n\n\t\t\t'snax_limits_image_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Image upload', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_image_upload_allowed' => array(\n\t\t\t\t'title' => __( 'Allowed?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array( 'type' => 'image' ),\n\t\t\t),\n\t\t\t'snax_max_upload_size' => array(\n\t\t\t\t'title' => __( 'Maximum file size', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_max_size',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'type' => 'image' ),\n\t\t\t),\n\t\t\t'snax_image_allowed_types' => array(\n\t\t\t\t'title' => __( 'Allowed types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array( 'type' => 'image' ),\n\t\t\t),\n\n\t\t\t/* AUDIO UPLOAD */\n\n\t\t\t'snax_limits_audio_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Audio upload', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_audio_upload_allowed' => array(\n\t\t\t\t'title' => __( 'Allowed?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array( 'type' => 'audio' ),\n\t\t\t),\n\t\t\t'snax_audio_max_upload_size' => array(\n\t\t\t\t'title' => __( 'Maximum file size', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_max_size',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'type' => 'audio' ),\n\t\t\t),\n\t\t\t'snax_audio_allowed_types' => array(\n\t\t\t\t'title' => __( 'Allowed types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array( 'type' => 'audio' ),\n\t\t\t),\n\n\t\t\t/* VIDEO UPLOAD */\n\n\t\t\t'snax_limits_video_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Video upload', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_video_upload_allowed' => array(\n\t\t\t\t'title' => __( 'Allowed?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array( 'type' => 'video' ),\n\t\t\t),\n\t\t\t'snax_video_max_upload_size' => array(\n\t\t\t\t'title' => __( 'Maximum file size', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_max_size',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'type' => 'video' ),\n\t\t\t),\n\t\t\t'snax_video_allowed_types' => array(\n\t\t\t\t'title' => __( 'Allowed types', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_upload_allowed_types',\n\t\t\t\t'sanitize_callback' => 'snax_sanitize_text_array',\n\t\t\t\t'args' => array( 'type' => 'video' ),\n\t\t\t),\n\n\t\t\t/* POSTS */\n\n\t\t\t'snax_limits_posts_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Posts', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_items_per_page' => array(\n\t\t\t\t'title' => __( 'List items per page', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_items_per_page',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_user_posts_per_day' => array(\n\t\t\t\t'title' => __( 'User can submit', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_new_posts_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_new_post_items_limit' => array(\n\t\t\t\t'title' => __( 'User can submit', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_new_post_items_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_user_submission_limit' => array(\n\t\t\t\t'title' => __( 'User can submit', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_user_submission_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_tags_limit' => array(\n\t\t\t\t'title' => __( 'Tags', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_tags_limit',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_post_title_max_length' => array(\n\t\t\t\t'title' => __( 'Title length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_post_title_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_post_description_max_length' => array(\n\t\t\t\t'title' => __( 'Description length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_post_description_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_post_content_max_length' => array(\n\t\t\t\t'title' => __( 'Content length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_post_content_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\n\t\t\t/* ITEMS */\n\n\t\t\t'snax_limits_items_header' => array(\n\t\t\t\t'title' => '<h2>' . __( 'Items', 'snax' ) . '</h2>',\n\t\t\t\t'callback' => '__return_empty_string',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_title_max_length' => array(\n\t\t\t\t'title' => __( 'Title length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_title_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_content_max_length' => array(\n\t\t\t\t'title' => __( 'Description length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_content_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_source_max_length' => array(\n\t\t\t\t'title' => __( 'Source length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_source_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_item_ref_link_max_length' => array(\n\t\t\t\t'title' => __( 'Referral link length', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_item_ref_link_max_length',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Auth Section ***************************************************** */\n\n\t\t'snax_settings_auth' => array(\n\t\t\t'snax_facebook_app_id' => array(\n\t\t\t\t'title' => __( 'Facebook App ID', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_facebook_app_id',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_login_recaptcha' => array(\n\t\t\t\t'title' => __( 'reCaptcha for login form', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_login_recaptcha',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_recaptcha_site_key' => array(\n\t\t\t\t'title' => __( 'reCaptcha Site Key', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_recaptcha_site_key',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_recaptcha_secret' => array(\n\t\t\t\t'title' => __( 'reCaptcha Secret', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_recaptcha_secret',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\n\t\t/** Demo Section ***************************************************** */\n\n\t\t'snax_settings_demo' => array(\n\t\t\t'snax_demo_mode' => array(\n\t\t\t\t'title' => __( 'Enable demo mode?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_mode',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_demo_image_post_id' => array(\n\t\t\t\t'title' => __( 'Image', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'image' ),\n\t\t\t),\n\t\t\t'snax_demo_gallery_post_id' => array(\n\t\t\t\t'title' => __( 'Gallery', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'gallery' ),\n\t\t\t),\n\t\t\t'snax_demo_embed_post_id' => array(\n\t\t\t\t'title' => __( 'Embed', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'embed' ),\n\t\t\t),\n\t\t\t'snax_demo_list_post_id' => array(\n\t\t\t\t'title' => __( 'List', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'list' ),\n\t\t\t),\n\t\t\t'snax_demo_meme_post_id' => array(\n\t\t\t\t'title' => __( 'Meme', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_demo_post',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array( 'format' => 'meme' ),\n\t\t\t),\n\t\t),\n\n\t\t/** Embedly Section ********************************************** */\n\n\t\t'snax_settings_embedly' => array(\n\t\t\t'snax_embedly_enable' => array(\n\t\t\t\t'title' => __( 'Enable Embedly support?', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_enable',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_dark_skin' => array(\n\t\t\t\t'title' => __( 'Dark skin', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_dark_skin',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_buttons' => array(\n\t\t\t\t'title' => __( 'Share buttons', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_buttons',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_width' => array(\n\t\t\t\t'title' => __( 'Width', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_width',\n\t\t\t\t'sanitize_callback' => 'intval',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_alignment' => array(\n\t\t\t\t'title' => __( 'Alignment', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_alignment',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_embedly_api_key' => array(\n\t\t\t\t'title' => __( 'Embedly cards API key', 'snax' ),\n\t\t\t\t'callback' => 'snax_admin_setting_callback_embedly_api_key',\n\t\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\t\t/** Permalinks Section ********************************************** */\n\n\t\t'snax_permalinks' => array(\n\t\t\t'snax_item_slug' => array(\n\t\t\t\t'title' => __( 'Item url', 'snax' ),\n\t\t\t\t'callback' => 'snax_permalink_callback_item_slug',\n\t\t\t\t'sanitize_callback' => 'sanitize_text',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t\t'snax_url_var_prefix' => array(\n\t\t\t\t'title' => __( 'URL variable', 'snax' ),\n\t\t\t\t'callback' => 'snax_permalink_callback_url_var_prefix',\n\t\t\t\t'sanitize_callback' => 'sanitize_text',\n\t\t\t\t'args' => array(),\n\t\t\t),\n\t\t),\n\t) );\n}", "public function optionsdemo_setup_fields() {\n\t\t\t\n\t\t\t$fields = array(\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Text field', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_textfield',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'placeholder' => esc_html__( 'Text field', 'optionsdemo' ),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Email field', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_email',\n\t\t\t\t\t'type' => 'email',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'placeholder' => esc_html__( 'Email field', 'optionsdemo' ),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Password field', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_password',\n\t\t\t\t\t'type' => 'password',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'placeholder' => esc_html__( 'Password field', 'optionsdemo' ),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Number field', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_number',\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'placeholder' => esc_html__( 'Number field', 'optionsdemo' ),\n\t\t\t\t\t'min' => 1,\n\t\t\t\t\t'max' => 5,\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'URL field', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_url',\n\t\t\t\t\t'type' => 'url',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'placeholder' => esc_html__( 'URL field', 'optionsdemo' ),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Textarea', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_textarea',\n\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'placeholder' => esc_html__( 'Textarea', 'optionsdemo' ),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Multiple Checkbox', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_checkbox',\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'countries' => array(\n\t\t\t\t\t\tesc_html__( 'Afghanistan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Bangladesh', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Bhutan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'India', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Maldives', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Nepal', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Pakistan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Sri Lanka', 'optionsdemo' )\n\t\t\t\t\t),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Radio', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_radio',\n\t\t\t\t\t'type' => 'radio',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\tesc_html__( 'Yes', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'No', 'optionsdemo' ),\n\t\t\t\t\t),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Select', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_select',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'countries' => array(\n\t\t\t\t\t\tesc_html__( 'Afghanistan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Bangladesh', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Bhutan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'India', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Maldives', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Nepal', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Pakistan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Sri Lanka', 'optionsdemo' )\n\t\t\t\t\t),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Multiple Select', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_multi_select',\n\t\t\t\t\t'type' => 'multiple',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'countries' => array(\n\t\t\t\t\t\tesc_html__( 'Afghanistan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Bangladesh', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Bhutan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'India', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Maldives', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Nepal', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Pakistan', 'optionsdemo' ),\n\t\t\t\t\t\tesc_html__( 'Sri Lanka', 'optionsdemo' )\n\t\t\t\t\t),\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'File upload 1', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_image',\n\t\t\t\t\t'type' => 'file',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'File upload 2', 'optionsdemo' ),\n\t\t\t\t\t'id' => 'optionsdemo_image2',\n\t\t\t\t\t'type' => 'file',\n\t\t\t\t\t'section' => 'optionsdemo_section',\n\t\t\t\t\t'option_name' => 'optionsdemo_general'\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tforeach ( $fields as $field ) {\n\t\t\t\tadd_settings_field( $field['id'], $field['label'],\n\t\t\t\t\tarray( $this, 'optionsdemo_field_callback' ),\n\t\t\t\t\t'optionsdemo_general', $field['section'], $field );\n\t\t\t}\n\t\t\t//Setting Register\n\t\t\tregister_setting( 'optionsdemo_general', 'optionsdemo_general' );\n\t\t}", "public function feed_settings_fields() {\n\t\t\n\t\treturn array(\n\t\t\tarray(\t\n\t\t\t\t'title' => '',\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feed_name',\n\t\t\t\t\t\t'label' => esc_html__( 'Feed Name', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'Name', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'Enter a feed name to uniquely identify this setup.', 'gravityformsicontact' ),\n\t\t\t\t\t\t'default_value' => $this->get_default_feed_name(),\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'list',\n\t\t\t\t\t\t'label' => esc_html__( 'iContact List', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'choices' => $this->lists_for_feed_setting(),\n\t\t\t\t\t\t'no_choices' => esc_html__( 'Unable to retrieve Lists.', 'gravityformsicontact' ),\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'iContact List', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'Select which iContact list this feed will add contacts to.', 'gravityformsicontact' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'fields',\n\t\t\t\t\t\t'label' => esc_html__( 'Map Fields', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'field_map',\n\t\t\t\t\t\t'field_map' => $this->fields_for_feed_mapping(),\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'Map Fields', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'Select which Gravity Form fields pair with their respective iContact fields.', 'gravityformsicontact' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'custom_fields',\n\t\t\t\t\t\t'label' => '',\n\t\t\t\t\t\t'type' => 'dynamic_field_map',\n\t\t\t\t\t\t'field_map' => version_compare( GFForms::$version, '2.5-dev-1', '<' ) ? $this->custom_fields_for_feed_setting() : array( $this, 'custom_fields_for_feed_setting' ),\n\t\t\t\t\t\t'save_callback' => array( $this, 'create_new_custom_fields' ),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feed_condition',\n\t\t\t\t\t\t'label' => esc_html__( 'Opt-In Condition', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'feed_condition',\n\t\t\t\t\t\t'checkbox_label' => esc_html__( 'Enable', 'gravityformsicontact' ),\n\t\t\t\t\t\t'instructions' => esc_html__( 'Export to iContact if', 'gravityformsicontact' ),\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'Opt-In Condition', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'When the opt-in condition is enabled, form submissions will only be exported to iContact when the condition is met. When disabled, all form submissions will be exported.', 'gravityformsicontact' )\n\t\t\t\t\t),\n\t\t\t\t)\t\n\t\t\t)\n\t\t);\n\t\t\n\t}", "protected function getOptionFieldsConfig()\n {\n $fields['custom_option_group'] = $this->getCustomOptionGroupFieldConfig();\n\n return $fields;\n }", "protected function getConfigFormAdvanced()\n {\n return [\n 'form' => [\n 'legend' => [\n 'title' => $this->l('Advanced Options'),\n 'icon' => 'icon-cogs',\n ],\n 'input' => [\n [\n 'type' => 'text',\n 'label' => $this->l('Doofinder Api Key'),\n 'name' => 'DF_API_KEY',\n ],\n [\n 'type' => 'text',\n 'label' => $this->l('Region'),\n 'name' => 'DF_REGION',\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('Enable v9 layer (Livelayer)'),\n 'name' => 'DF_ENABLED_V9',\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('Debug Mode. Write info logs in doofinder.log file'),\n 'name' => 'DF_DEBUG',\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('CURL disable HTTPS check'),\n 'name' => 'DF_DSBL_HTTPS_CURL',\n 'desc' => $this->l('CURL_DISABLE_HTTPS_EXPLANATION'),\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('Debug CURL error response'),\n 'name' => 'DF_DEBUG_CURL',\n 'desc' => $this->l('To debug if your server has symptoms of connection problems'),\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n ],\n 'submit' => [\n 'title' => $this->l('Save Internal Search Options'),\n 'name' => 'submitDoofinderModuleAdvanced',\n ],\n ],\n ];\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Twispay settings'),\n 'icon' => 'icon-cogs',\n ),\n /** Form fields */\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Live mode'),\n 'name' => 'TWISPAY_LIVE_MODE',\n 'is_bool' => false,\n 'desc' => $this->l('Select \"YES\" if you wish to use the payment gateway in Production or \"No\" if you want to use it in staging mode.'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-lock\"></i>',\n 'desc' => $this->l('Enter the SITE ID for staging mode'),\n 'name' => 'TWISPAY_SITEID_STAGING',\n 'label' => $this->l('Staging Site ID'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-key\"></i>',\n 'desc' => $this->l('Enter the Private key for staging mode'),\n 'name' => 'TWISPAY_PRIVATEKEY_STAGING',\n 'label' => $this->l('Staging Private key'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-lock\"></i>',\n 'desc' => $this->l('Enter the SITE ID for live mode'),\n 'name' => 'TWISPAY_SITEID_LIVE',\n 'label' => $this->l('Live Site ID'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-key\"></i>',\n 'desc' => $this->l('Enter the Private key for live mode'),\n 'name' => 'TWISPAY_PRIVATEKEY_LIVE',\n 'label' => $this->l('Live Private key'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable iframe payment form'),\n 'name' => 'TWISPAY_IFRAME_FORM',\n 'is_bool' => false,\n 'desc' => $this->l('Select \"YES\" if you wish to use the iframe payment form.'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-link\"></i>',\n 'desc' => $this->l('Put this URL in your twispay account'),\n 'name' => 'TWISPAY_NOTIFICATION_URL',\n 'label' => $this->l('Server-to-server notification URL'),\n 'readonly' => true,\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "static function get_settings(){\n\t\t\t\treturn array(\t\n\t\t\t\t\t'icon' => GDLR_CORE_URL . '/framework/images/page-builder/nav-template.png', \n\t\t\t\t\t'title' => esc_html__('Templates', 'goodlayers-core')\n\t\t\t\t);\n\t\t\t}", "function render_field_settings( $field ) {\n\t\t$templateKeys=array_keys(Context::current()->ui->setting('content/templates',[]));\n\n\t\t$choices=[];\n\t\tforeach($templateKeys as $key)\n\t\t\t$choices[$key] = $key;\n\n\n\t\tacf_render_field_setting( $field, array(\n\t\t\t'label' => __('Content Type','stem-content'),\n\t\t\t'instructions' => __('Select the content type to display alternate templates for.','stem-content'),\n\t\t\t'type' => 'select',\n\t\t\t'name' => 'content_type',\n\t\t\t'layout' => 'horizontal',\n\t\t\t'multiple' => 0,\n\t\t\t'choices' => $choices\n\t\t));\n\t}", "function init_form_fields() {\n\n $default_site_name = home_url() ;\n\n\t\t\t$this->form_fields = array(\n\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t'title' => __( 'Enable/Disable', 'woothemes' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __( 'Enable Payment Express', 'woothemes' ),\n\t\t\t\t\t'default' => 'yes'\n\t\t\t\t),\n\n\t\t\t\t'title' => array(\n\t\t\t\t\t'title' => __( 'Title', 'woothemes' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', 'woothemes' ),\n\t\t\t\t\t'default' => __( 'Payment Express', 'woothemes' ),\n\t\t\t\t\t'css' => 'width: 400px;'\n\t\t\t\t),\n\n\t\t\t\t'description' => array(\n\t\t\t\t\t'title' => __( 'Description', 'woothemes' ),\n\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t'description' => __( 'This controls the description which the user sees during checkout.', 'woothemes' ),\n\t\t\t\t\t'default' => __(\"Allows credit card payments by Payment Express PX-Pay method\", 'woothemes')\n\t\t\t\t),\n\n\t\t\t\t'site_name' => array(\n\t\t\t\t\t//'title' => __( 'Px-Pay Access Key', 'woothemes' ),\n 'title' => 'Merchant Reference',\n 'description' => 'A name (or URL) to identify this site in the \"Merchant Reference\" field (shown when viewing transactions in the site\\'s Digital Payment Express back-end). This name <b>plus</b> the longest Order/Invoice Number used by the site must be <b>no longer than 53 characters</b>.',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => $default_site_name,\n\t\t\t\t\t'css' => 'width: 400px;',\n 'custom_attributes' => array( 'maxlength' => '53' )\n ),\n\n\t\t\t\t'access_userid' => array(\n\t\t\t\t\t//'title' => __( 'Access User Id', 'woothemes' ),\n\t\t\t\t\t'title' => __( 'Px-Pay Access User ID', 'woothemes' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'css' => 'width: 400px;'\n\t\t\t\t),\n\n\t\t\t\t'access_key' => array(\n\t\t\t\t\t//'title' => __( 'Access Key', 'woothemes' ),\n\t\t\t\t\t'title' => __( 'Px-Pay Access Key', 'woothemes' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'css' => 'width: 400px;'\n\t\t\t\t)\n\n\t\t\t);\n\n\t\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'textarea',\n 'label' => $this->l('CGV'),\n 'name' => 'MYETICKETS_CGV',\n 'desc' => $this->l('Set the CGV that will be print to e-tckets.'),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of days to use e-tickets'),\n 'name' => 'MYETICKETS_PERIOD',\n 'class' => 'fixed-width-xs',\n 'desc' => $this->l('Set the number of days to use and check e-tckets.'),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function ca_services_admin_settings_form() {\n $form = array();\n\n $form['ca_services_list'] = array(\n '#type' => 'select',\n '#title' => t('Services\\'s List Template'),\n '#options' => array(\n 'ca_services_list_template_one' => t('Template One'),\n 'ca_services_list_template_two' => t('Template Two'),\n 'ca_services_list_template_three' => t('Template Three'),\n ),\n '#default_value' => variable_get('ca_services_list_template', 'ca_services_list_template_one'),\n '#required' => TRUE,\n );\n $form['ca_services_node'] = array(\n '#type' => 'select',\n '#title' => t('Services\\'s Node Template'),\n '#options' => array(\n 'ca_services_node_template_one' => t('Template One'),\n 'ca_services_node_template_two' => t('Template Two'),\n 'ca_services_node_template_three' => t('Template Three'),\n ),\n '#default_value' => variable_get('ca_services_node_template', 'ca_services_node_template_one'),\n '#required' => TRUE,\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n '#submit' => array('ca_services_admin_settings_form_submit'),\n );\n\n return $form;\n}", "public static function option_fields() {\n\n // Only need to initiate the array once per page-load\n if ( ! empty( self::$theme_options ) )\n return self::$theme_options;\n\n self::$theme_options = array(\n 'id' => 'theme_options',\n 'show_on' => array( 'key' => 'options-page', 'value' => array( self::$key, ), ),\n 'show_names' => true,\n 'fields' => array(\n array(\n 'name' => __( 'Place Name', 'myprefix' ),\n 'desc' => __( 'field description (optional)', 'myprefix' ),\n 'id' => 'place_name',\n 'type' => 'text_medium',\n ),\n\t\t\t\tarray(\n\t\t\t\t 'name' => __( 'Facebook page URL', 'cmb' ),\n\t\t\t\t 'id' => $prefix . 'facebook_url',\n\t\t\t\t 'type' => 'text_url',\n\t\t\t\t // 'protocols' => array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet' ), // Array of allowed protocols\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t 'name' => __( 'Twitter URL', 'cmb' ),\n\t\t\t\t 'id' => $prefix . 'twitter_url',\n\t\t\t\t 'type' => 'text_url',\n\t\t\t\t // 'protocols' => array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet' ), // Array of allowed protocols\n\t\t\t\t),\n array(\n 'name' => __( 'Test Color Picker', 'myprefix' ),\n 'desc' => __( 'field description (optional)', 'myprefix' ),\n 'id' => 'test_colorpicker',\n 'type' => 'colorpicker',\n 'default' => '#ffffff'\n ),\n array(\n 'name' => __( 'Footer Text', 'myprefix' ),\n 'desc' => __( 'field description (optional)', 'myprefix' ),\n 'id' => 'footer_text',\n 'type' => 'text',\n ),\n ),\n );\n return self::$theme_options;\n }", "public function init_form_fields() {\n\n\t\t$this->form_fields = array(\n\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable this email notification', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'default' => 'yes',\n\t\t\t),\n\n\t\t\t'subject' => array(\n\t\t\t\t'title' => __( 'Subject', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->subject ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'subject_multiple' => array(\n\t\t\t\t'title' => __( 'Subject Multiple', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the email subject line when the email contains more than one voucher. Leave blank to use the default subject: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->subject_multiple ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'heading' => array(\n\t\t\t\t'title' => __( 'Email Heading', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->heading ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'heading_multiple' => array(\n\t\t\t\t'title' => __( 'Email Heading Multiple', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the main heading contained within the email notification when the email contains more than one voucher. Leave blank to use the default heading: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->heading_multiple ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'email_type' => array(\n\t\t\t\t'title' => __( 'Email type', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'Choose which format of email to send.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'plain' => __( 'Plain text', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t\t'html' => __( 'HTML', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t\t'multipart' => __( 'Multipart', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "function _name_field_settings_pre_render($form) {\n\n $warning = t('<strong>Warning! Changing this setting after data has been created could result in the loss of data!</strong>');\n\n $form['field_properties'] = array(\n '#prefix' => '<table>',\n '#suffix' => '</table>',\n '#weight' => 1,\n 'thead' => array(\n '#prefix' => '<thead><tr><th>' . t('Field') . '</th>',\n '#suffix' => '</tr></thead>',\n '#weight' => 0,\n ),\n 'tbody' => array(\n '#prefix' => '<tbody>',\n '#suffix' => '</tbody>',\n '#weight' => 1,\n 'components' => array(\n '#prefix' => '<tr><td><strong>' . t('Components') . ' <sup>1</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 1,\n ),\n 'minimum_components' => array(\n '#prefix' => '<tr><td><strong>' . t('Minimum components') . ' <sup>2</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 2,\n ),\n 'max_length' => array(\n '#prefix' => '<tr><td><strong>' . t('Maximum length') . ' <sup>3</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 3,\n ),\n 'labels' => array(\n '#prefix' => '<tr><td><strong>' . t('Labels') . ' <sup>4</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 4,\n ),\n 'sort_options' => array(\n '#prefix' => '<tr><td><strong>' . t('Sort options') . ' <sup>5</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 5,\n ),\n\n ),\n 'tfoot' => array(\n '#value' => '<tfoot><tr><td colspan=\"6\"><ol>'\n . '<li>'. t('Only selected components will be activated on this field. All non-selected components / component settings will be ignored.')\n . '<br/>'. $warning .'</li>'\n . '<li>'. t('The minimal set of components required before considered the name field to be incomplete.') . '</li>'\n . '<li>'. t('The maximum length of the field in characters. This must be between 1 and 255.')\n . '<br/>'. $warning .'</li>'\n . '<li>'. t('The labels are used to distinguish the fields. You can use the special label \"!tag\" to hide this.', array('!tag' => '<none>')) . '</li>'\n . '<li>'. t('This enables sorting on the options after the vocabulary terms are added and duplicate values are removed.') . '</li>'\n . '</ol></td></tr></tfoot>',\n '#weight' => 2,\n ),\n );\n\n $i = 0;\n foreach (_name_translations() as $key => $title) {\n // Adds the table header for the particullar field.\n $form['field_properties']['thead'][$key]['#value'] = '<th>' . $title . '</th>';\n $form['field_properties']['thead'][$key]['#weight'] = ++$i;\n\n // Strip the title & description.\n unset($form['components'][$key]['#description']);\n unset($form['components'][$key]['#title']);\n\n unset($form['minimum_components'][$key]['#description']);\n unset($form['minimum_components'][$key]['#title']);\n\n unset($form['max_length'][$key]['#description']);\n unset($form['max_length'][$key]['#title']);\n $form['max_length'][$key]['#size'] = 10;\n\n unset($form['labels'][$key]['#description']);\n unset($form['labels'][$key]['#title']);\n $form['labels'][$key]['#size'] = 10;\n\n if (isset($form['sort_options'][$key])) {\n unset($form['sort_options'][$key]['#description']);\n unset($form['sort_options'][$key]['#title']);\n }\n\n // Moves the elements into the table.\n $form['field_properties']['tbody']['components'][$key] = $form['components'][$key];\n $form['field_properties']['tbody']['components'][$key]['#prefix'] = '<td>';\n $form['field_properties']['tbody']['components'][$key]['#suffix'] = '</td>';\n $form['field_properties']['tbody']['components'][$key]['#weight'] = $i;\n\n $form['field_properties']['tbody']['minimum_components'][$key] = $form['minimum_components'][$key];\n $form['field_properties']['tbody']['minimum_components'][$key]['#prefix'] = '<td>';\n $form['field_properties']['tbody']['minimum_components'][$key]['#suffix'] = '</td>';\n $form['field_properties']['tbody']['minimum_components'][$key]['#weight'] = $i;\n\n $form['field_properties']['tbody']['max_length'][$key] = $form['max_length'][$key];\n $form['field_properties']['tbody']['max_length'][$key]['#prefix'] = '<td>';\n $form['field_properties']['tbody']['max_length'][$key]['#suffix'] = '</td>';\n $form['field_properties']['tbody']['max_length'][$key]['#weight'] = $i;\n\n $form['field_properties']['tbody']['labels'][$key] = $form['labels'][$key];\n $form['field_properties']['tbody']['labels'][$key]['#prefix'] = '<td>';\n $form['field_properties']['tbody']['labels'][$key]['#suffix'] = '</td>';\n $form['field_properties']['tbody']['labels'][$key]['#weight'] = $i;\n\n if (isset($form['sort_options'][$key])) {\n $form['field_properties']['tbody']['sort_options'][$key] = $form['sort_options'][$key];\n }\n else {\n $form['field_properties']['tbody']['sort_options'][$key] = array('#value' => '&nbsp;');\n }\n $form['field_properties']['tbody']['sort_options'][$key]['#prefix'] = '<td>';\n $form['field_properties']['tbody']['sort_options'][$key]['#suffix'] = '</td>';\n $form['field_properties']['tbody']['sort_options'][$key]['#weight'] = $i;\n\n // Clean up the leftovers.\n unset($form['components'][$key]);\n $form['components']['#access'] = FALSE;\n\n unset($form['minimum_components'][$key]);\n $form['minimum_components']['#access'] = FALSE;\n\n unset($form['max_length'][$key]);\n $form['max_length']['#access'] = FALSE;\n\n unset($form['labels'][$key]);\n $form['labels']['#access'] = FALSE;\n\n if (isset($form['sort_options'][$key])) {\n unset($form['sort_options'][$key]);\n $form['sort_options']['#access'] = FALSE;\n }\n }\n\n // Move the additional options under the table.\n $form['extra_fields'] = array(\n '#weight' => 2,\n );\n $form['title_options']['#weight'] = 0;\n $form['generational_options']['#weight'] = 1;\n $form['extra_fields']['title_options'] = $form['title_options'];\n $form['extra_fields']['generational_options'] = $form['generational_options'];\n unset($form['title_options']);\n unset($form['generational_options']);\n\n return $form;\n}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'radio',\n 'name' => 'ORDERREF_MODE',\n 'label' => $this->l('How to generate order references'),\n 'desc' => $this->l('Choose between generation methods'),\n 'values' => array(\n array(\n 'id' => 'ORDERREF_MODE_RANDOM',\n 'value' => self::ORDERREF_MODE_RANDOM,\n 'label' => $this->l('Random numbers'),\n ),\n array(\n 'id' => 'ORDERREF_MODE_CONSEQUENT',\n 'value' => self::ORDERREF_MODE_CONSEQUENT,\n 'label' => $this->l('Consequent'),\n ),\n array(\n 'id' => 'ORDERREF_MODE_PS',\n 'value' => self::ORDERREF_MODE_PS,\n 'label' => $this->l('Don\\'t change an order reference'),\n ),\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'name' => 'ORDERREF_LENGTH',\n 'label' => $this->l('Length of reference'),\n 'desc' => $this->l('Length of generated reference value'),\n 'required' => true,\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function ca_video_gallery_list_template_access_settings(&$form, &$form_state, $conf) {\n $form['settings']['ca_video_gallery_list_template'] = array(\n '#type' => 'select',\n '#title' => t('Vidoe Gallery\\'s List Template'),\n '#options' => array(\n 'ca_video_gallery_list_template_one' => t('Template One'),\n 'ca_video_gallery_list_template_two' => t('Template Two'),\n 'ca_video_gallery_list_template_three' => t('Template Three'),\n ),\n '#required' => TRUE,\n '#default_value' => $conf['ca_video_gallery_list_template'],\n );\n return $form;\n}", "public function settings_fields() {\n\t\t$this->create_sections();\n\t\t$this->create_fields();\n\t\tregister_setting( $this->token, $this->token, array( $this, 'validate_fields' ) );\n\t}", "private function get_settings_fields() {\n\n\t\t$fields = array();\n\n\t\t$fields[] = array(\n\t\t\t'name' => 'vibrant_life_sherpa_api_key',\n\t\t\t'type' => 'password',\n\t\t\t'settings_label' => __( 'Sherpa API Key', 'schedule-a-visit-to-sherpa' ),\n\t\t\t'no_init' => true,\n\t\t\t'option_field' => true,\n\t\t\t'description' => '<p class=\"description\">' . __( 'Enter an API Key and save your changes for the other fields to appear', 'schedule-a-visit-to-sherpa' ) . '</p>',\n\t\t\t'description_tip' => false,\n\t\t);\n\n\t\tif ( ! $api_key = get_option( 'vibrant_life_sherpa_api_key' ) ) {\n\n\t\t\treturn $fields;\n\n\t\t}\n\n\t\tif ( ! $form = get_theme_mod( 'vibrant_life_schedule_a_visit_form' ) ) {\n\n\t\t\t$forms = wp_list_pluck( RGFormsModel::get_forms( null, 'title' ), 'title', 'id' );\n\n\t\t\t$fields[] = array(\n\t\t\t\t'name' => 'schedule_a_visit_to_sherpa_form',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'settings_label' => __( 'Which Form is the Schedule a Visit Form?', 'schedule-a-visit-form' ),\n\t\t\t\t'no_init' => true,\n\t\t\t\t'option_field' => true,\n\t\t\t\t'option_none' => __( '-- Choose a Gravity Form --', 'schedule-a-visit-to-sherpa' ),\n\t\t\t\t'options' => $forms,\n\t\t\t);\n\n\t\t}\n\n\t\t$locations_query = new WP_Query( array(\n\t\t\t'post_type' => 'facility',\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'title',\n\t\t\t'order' => 'ASC',\n\t\t) );\n\n\t\t$locations = wp_list_pluck( $locations_query->posts, 'post_title', 'ID' );\n\n\t\t$sherpa_communities = apply_filters( 'schedule_a_visit_to_sherpa_communities', array(\n\t\t\t2 => __( 'Lodges of Durand', 'schedule-a-visit-to-sherpa' ),\n\t\t\t4 => __( 'New Friends Memory Care Kalamazoo', 'schedule-a-visit-to-sherpa' ),\n\t\t\t1 => __( 'Vibrant Life Superior Township', 'schedule-a-visit-to-sherpa' ),\n\t\t\t3 => __( 'Vibrant Life Temperance', 'schedule-a-visit-to-sherpa' ),\n\t\t) );\n\n\t\t$fields[] = array(\n\t\t\t'name' => 'vibrant_life_sherpa_mapping',\n\t\t\t'type' => 'repeater',\n\t\t\t'settings_label' => __( 'Location/Sherpa Mapping', 'schedule-a-visit-to-sherpa' ),\n\t\t\t'no_init' => true,\n\t\t\t'option_field' => true,\n\t\t\t'description' => '<p class=\"description\">' . __( 'Associate each Location with each Community within Sherpa', 'schedule-a-visit-to-sherpa' ) . '</p>',\n\t\t\t'description_tip' => false,\n\t\t\t'fields' => array(\n\t\t\t\t'location_id' => array(\n\t\t\t\t\t'type' => 'select',\t\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'label' => '<strong>' . __( 'Location', 'schedule-a-visit-to-sherpa' ) . '</strong>',\n\t\t\t\t\t\t'options' => $locations,\n\t\t\t\t\t\t'option_none' => __( '-- Choose a Location --', 'schedule-a-visit-to-sherpa' ),\n\t\t\t\t\t\t'input_class' => 'regular-text',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'community_id' => array(\n\t\t\t\t\t'type' => 'select',\t\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'label' => '<strong>' . __( 'Sherpa Community', 'schedule-a-visit-to-sherpa' ) . '</strong>',\n\t\t\t\t\t\t'options' => $sherpa_communities,\n\t\t\t\t\t\t'option_none' => __( '-- Choose a Community from Sherpa --', 'schedule-a-visit-to-sherpa' ),\n\t\t\t\t\t\t'input_class' => 'regular-text',\n\t\t\t\t\t\t'description' => '<p class=\"description\">' . __( 'These values are hardcoded. We cannot add or remove Sherpa Communities without updating the plugin.', 'schedule-a-visit-to-sherpa' ) . '</p>',\n\t\t\t\t\t\t'description_tip' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn apply_filters( 'schedule_a_visit_to_sherpa_settings_fields', $fields );\n\n\t}", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable plugin', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title' => __( 'Title', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => __( 'PayEx Financing', 'woocommerce-gateway-payex-payment' )\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title' => __( 'Description', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\t'account_no' => array(\n\t\t\t\t'title' => __( 'Account Number', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Account Number of PayEx Merchant.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'encrypted_key' => array(\n\t\t\t\t'title' => __( 'Encryption Key', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'PayEx Encryption Key of PayEx Merchant.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'mode' => array(\n\t\t\t\t'title' => __( 'Payment Type', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'SELECT' => __( 'User select', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t\t'FINANCING' => __( 'Financing Invoice', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t\t'CREDITACCOUNT' => __( 'Part Payment', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t),\n\t\t\t\t'description' => __( 'Default payment type.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'FINANCING'\n\t\t\t),\n\t\t\t'language' => array(\n\t\t\t\t'title' => __( 'Language', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'en-US' => 'English',\n\t\t\t\t\t'sv-SE' => 'Swedish',\n\t\t\t\t\t'nb-NO' => 'Norway',\n\t\t\t\t\t'da-DK' => 'Danish',\n\t\t\t\t\t'es-ES' => 'Spanish',\n\t\t\t\t\t'de-DE' => 'German',\n\t\t\t\t\t'fi-FI' => 'Finnish',\n\t\t\t\t\t'fr-FR' => 'French',\n\t\t\t\t\t'pl-PL' => 'Polish',\n\t\t\t\t\t'cs-CZ' => 'Czech',\n\t\t\t\t\t'hu-HU' => 'Hungarian'\n\t\t\t\t),\n\t\t\t\t'description' => __( 'Language of pages displayed by PayEx during payment.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'en-US'\n\t\t\t),\n\t\t\t'testmode' => array(\n\t\t\t\t'title' => __( 'Test Mode', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable PayEx Test Mode', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'yes'\n\t\t\t),\n\t\t\t'debug' => array(\n\t\t\t\t'title' => __( 'Debug', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable logging', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'fee' => array(\n\t\t\t\t'title' => __( 'Fee', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'number',\n\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t'step' => 'any'\n\t\t\t\t),\n\t\t\t\t'description' => __( 'Financing fee. Set 0 to disable.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => '0'\n\t\t\t),\n\t\t\t'fee_is_taxable' => array(\n\t\t\t\t'title' => __( 'Fee is Taxable', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Fee is Taxable', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'fee_tax_class' => array(\n\t\t\t\t'title' => __( 'Tax class of Fee', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => $this->getTaxClasses(),\n\t\t\t\t'description' => __( 'Tax class of fee.', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'standard'\n\t\t\t),\n\t\t\t'checkout_field' => array(\n\t\t\t\t'title' => __( 'SSN Field on Checkout page', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'SSN Field on Checkout page', 'woocommerce-gateway-payex-payment' ),\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t);\n\t}", "public function get_custom_fields_settings()\n {\n $fields = [];\n\n $fields['quiz_title'] = [\n 'name' => __('Quiz Title', $this->token),\n 'description' => __('The title that will be displayed for your quiz.', $this->token),\n 'placeholder' => 'Can chirotherapy treat your pain?',\n 'type' => 'text',\n 'default' => 'Can chirotherapy treat your pain?',\n 'section' => 'info'\n ];\n\n $fields['show_fields'] = [\n 'name' => __('Show Opt-In Before Score', $this->token),\n 'description' => __('If set to no, opt-in fields will be shown after the users see their score.', $this->token),\n 'placeholder' => '',\n 'type' => 'select',\n 'default' => 'yes',\n 'options' => ['no', 'yes'],\n 'section' => 'info'\n ];\n\n $fields['legal_broker'] = [\n 'name' => __('Your Business Name', $this->token),\n 'description' => __('This will be displayed on the bottom of each page.', $this->token),\n 'placeholder' => '',\n 'type' => 'text',\n 'default' => '',\n 'section' => 'info'\n ];\n\n $fields['api_key'] = [\n 'name' => __('Custom API Key', $this->token),\n 'description' => __('This API key will be used for submitting leads to your CRM. Leave blank to use default API key.', $this->token),\n 'placeholder' => '',\n 'type' => 'text',\n 'default' => '',\n 'section' => 'info'\n ];\n\n $fields['email'] = [\n 'name' => __('Notification Email', $this->token),\n 'description' => __('This address will be emailed when a user opts-into your ad. If left empty, emails will be sent to the default address for your site.', $this->token),\n 'placeholder' => '',\n 'type' => 'text',\n 'default' => '',\n 'section' => 'info'\n ];\n\n $fields['retargeting'] = [\n 'name' => __('Facebook Pixel - Retargeting (optional)', $this->token),\n 'description' => __('Facebook Pixel to allow retargeting of people that view this quiz.', $this->token),\n 'placeholder' => __('Ex: 4123423454', $this->token),\n 'type' => 'text',\n 'default' => '',\n 'section' => 'info'\n ];\n\n $fields['conversion'] = [\n 'name' => __('Facebook Pixel - Conversion (optional)', $this->token),\n 'description' => __('Facebook Pixel to allow conversion tracking of people that submit this quiz.', $this->token),\n 'placeholder' => __('Ex: 170432123454', $this->token),\n 'type' => 'text',\n 'default' => '',\n 'section' => 'info'\n ];\n\n $fields['primary_color'] = [\n 'name' => __('Primary Color', $this->token),\n 'description' => __('Change the primary color of the quiz.', $this->token),\n 'placeholder' => '',\n 'type' => 'color',\n 'default' => '',\n 'section' => 'info'\n ];\n\n $fields['hover_color'] = [\n 'name' => __('Hover Color', $this->token),\n 'description' => __('Change the button hover color of the quiz.', $this->token),\n 'placeholder' => '',\n 'type' => 'color',\n 'default' => '',\n 'section' => 'info'\n ];\n\n return apply_filters($this->token . '_fields', $fields);\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Website'),\n 'name' => $this->mod_prefix.'SHOW_WEBSITE',\n 'is_bool' => true,\n 'desc' => $this->l('Show Website structured data'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type'\t\t=> 'switch',\n 'label'\t\t=> $this->l('Show Website -> Sitelinks Searchbox '),\n 'name'\t\t=> $this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX',\n 'is_bool'\t=> true,\n 'desc' \t\t=> $this->l('Show \"Website - Sitelinks Searchbox\" structured data?').'<br />'\n .$this->l('See:').'\n <a href=\"https://developers.google.com/search/docs/data-types/sitelinks-searchbox\" target=\"_blank\">\n https://developers.google.com/search/docs/data-types/sitelinks-searchbox\n </a>',\n 'values' \t=> array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'separator',\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION',\n 'is_bool' => true,\n 'desc' => $this->l('Show Organization structured data'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization -> Logo'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION_LOGO',\n 'is_bool' => true,\n 'desc' => $this->l('Show Organization Logo.').'<br />'\n .$this->l('See more at:').' <a href =\"https://developers.google.com/search/docs/data-types/logo\" target=\"_blank\">https://developers.google.com/search/docs/data-types/logo</a> '\n .$this->l('or').'<a href=\"https://schema.org/logo\" target=\"_blank\">https://schema.org/logo</a>',\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization -> Contact'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION_CONTACT',\n 'is_bool' => true,\n 'desc' => $this->l('Show Organization Contact structured data').'<br />'.$this->l('See more at:').' <a href=\"https://developers.google.com/search/docs/data-types/corporate-contact\">https://developers.google.com/search/docs/data-types/corporate-contact</a>',\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('email address, if other than main').': '.Configuration::get('PS_SHOP_EMAIL'),\n 'name' => $this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-phone\"></i>',\n 'desc' => $this->l('Organization telephone number (optional)'),\n 'name' => $this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE',\n 'label' => $this->l('Telephone:'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show Organization -> Facebook page?'),\n 'name' => $this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK',\n 'is_bool' => true,\n 'desc' => $this->l('Show Facebook page URL in Organization structured data.'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-facebook\"></i>',\n 'desc' => $this->l('Facebook page full URL eg.:').' https://www.facebook.com/YourPage',\n 'name' => $this->mod_prefix.'ORGANIZATION_FACEBOOK',\n 'label' => $this->l('Facebook Fan page URL:'),\n ),\n array(\n 'type' => 'separator',\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show \"LocalBusiness\" data?'),\n 'name' => $this->mod_prefix.'SHOW_LOCALBUSINESS',\n 'is_bool' => true,\n 'desc' => $this->l('Show LocalBusiness structured data'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Select LocalBusiness type:'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_TYPE',\n 'desc' => $this->l(''),\n 'required' => true,\n //'disabled' => true,\n //'class' => '',\n 'options' => array(\n 'query' => array(\n array(\n 'option_id' => 'Store',\n 'option_name' => 'Store'\n ),\n array(\n 'option_id' => 'LocalBusiness',\n 'option_name' => 'LocalBusiness'\n )\n ),\n 'id' => 'option_id',\n 'name' => 'option_name'\n )\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_STORENAME',\n 'label' => $this->l('Name of store:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n 'desc' => $this->l('Short description of your business'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_DESC',\n 'label' => $this->l('Description:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_VAT',\n 'label' => $this->l('Tax id:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-money\"></i>',\n 'desc' => $this->l('Range of products prices in this shop from min to max.'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_PRANGE',\n 'label' => $this->l('Store price range:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n //\t'prefix' => '<i class=\"icon icon-address-book\"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_STREET',\n 'label' => $this->l('Street:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_COUNTRY',\n 'label' => $this->l('Country:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_REGION',\n 'label' => $this->l('Region:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_CODE',\n 'label' => $this->l('Postal code:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n // 'prefix' => '<i class=\"icon icon- \"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_LOCALITY',\n 'label' => $this->l('Locality:'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-phone\"></i>',\n 'desc' => $this->l('telephone if other than main'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_PHONE',\n 'label' => $this->l('Telephone:'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show priceRange?'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW',\n 'is_bool' => true,\n 'desc' => $this->l('Show Localbusiness priceRange?'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show \"LocalBusiness\" GPS lat , lon?'),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_GPS_SHOW',\n 'is_bool' => true,\n 'desc' => $this->l('Show LocalBusiness GPS?'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Show')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Hide')\n )\n ),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-map-marker\"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_GPS_LAT',\n 'label' => $this->l('GPS lat:'),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-map-marker\"></i>',\n // 'desc' => $this->l(''),\n 'name' => $this->mod_prefix.'LOCALBUSINESS_GPS_LON',\n 'label' => $this->l('GPS lon:'),\n ),\n ),\n // Submit form\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function general_fields() {\n\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'id' => 'vpn_general_help_url',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => __( 'URL To Help Pages', 'wpcd' ),\n\t\t\t\t'default' => 'https://spinupvpn.com/help',\n\t\t\t\t'tooltip' => __( 'Certain error messages will be more helpful to your users if it includes a link to additional help resources. Add that link here.', 'wpcd' ),\n\t\t\t\t'tab' => 'vpn-general',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'vpn_general_wc_thank_you_text_before',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'name' => __( 'WooCommerce Thank You Page Text', 'wpcd' ),\n\t\t\t\t'tooltip' => __( 'You will likely need to give the user some instructions on how to proceed after checking out. This will go at the top of the thank-you page after checkout - it will not completely replace any existing text though!', 'wpcd' ),\n\t\t\t\t'rows' => '10',\n\t\t\t\t'tab' => 'vpn-general',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'vpn_general_wc_show_acct_link_ty_page',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => __( 'Show a link to the VPN account screen on the thank you page?', 'wpcd' ),\n\t\t\t\t'tooltip' => __( 'You can offer the user an option to go straight to their account page after checkout. Turn this on and fill out the two boxes below to enable this. IMPORTANT: For this to work, you do need the token ##VPNACCOUNTPAGE## in the thank you text above.', 'wpcd' ),\n\t\t\t\t'tab' => 'vpn-general',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'vpn_general_wc_ty_acct_link_url',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => __( 'URL to VPN Account Page', 'wpcd' ),\n\t\t\t\t'default' => 'https://spinupvpn.com/account/vpn/',\n\t\t\t\t'tooltip' => __( 'You can offer the user an option to go straight to their account page after checkout. This link is the account page link you will send them to.', 'wpcd' ),\n\t\t\t\t'tab' => 'vpn-general',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'vpn_general_wc_ty_acct_link_text',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => __( 'Text that the user should see for the account link on the thank you page', 'wpcd' ),\n\t\t\t\t'tooltip' => __( 'Example: Go to your account page now', 'wpcd' ),\n\t\t\t\t'size' => '90',\n\t\t\t\t'tab' => 'vpn-general',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'vpn_general_notes',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'name' => __( 'Settings Notes', 'wpcd' ),\n\t\t\t\t'tooltip' => __( 'Use this to store any private notes related to VPN configurations. This is a notational field only.', 'wpcd' ),\n\t\t\t\t'rows' => '10',\n\t\t\t\t'tab' => 'vpn-general',\n\t\t\t),\n\t\t);\n\t\treturn $fields;\n\t}", "protected function getConfigForm()\n {\n // toDo: Add config to choose items showed by viewedItems\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Live mode'),\n 'name' => 'CAPTURELEADSXAVIER_LIVE_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a valid email address'),\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'type' => 'password',\n 'name' => 'CAPTURELEADSXAVIER_ACCOUNT_PASSWORD',\n 'label' => $this->l('Password'),\n ),\n array(\n 'type' => 'radio',\n 'label' => $this->l('Column selector'),\n 'name' => 'CAPTURELEADSXAVIER_COL_SEL',\n 'required' => true,\n 'is_bool' => true,\n 'desc' => $this->l('Select on what column you want the module'),\n 'values' => array(\n array(\n 'id' => 'col_left',\n 'value' => \"left\",\n 'label' => $this->l('Left')\n ),\n array(\n 'id' => 'col_right',\n 'value' => \"right\",\n 'label' => $this->l('Right')\n )\n\n ),\n ),\n \n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n )\n )\n );\n }", "public function feed_settings_fields() {\n\n return array(\n\t\t\tarray(\n\t\t\t\t'title' => esc_html__( 'Configurações do Feed BuddyPress', 'gravityformsbuddy' ),\n\t\t\t\t'description' => '',\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feedName',\n\t\t\t\t\t\t'label' => esc_html__( 'Nome', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'Nome', 'gravityformsbuddy' ),\n\t\t\t\t\t\t\tesc_html__( 'Entre com um nome para o Feed para identificá-lo.', 'gravityformsbuddy' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'toUser',\n\t\t\t\t\t\t'label' => esc_html__( 'Para quem enviar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'select_custom',\n\t\t\t\t\t\t'choices' => $this->get_buddy_users_as_choices( 'outgoing_numbers' ),\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'input_class' => 'merge-tag-support mt-position-right',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'Para quem enviar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t\tesc_html__( 'Usuário o qual receberá as notificações', 'gravityformsbuddy' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'pathUrl',\n\t\t\t\t\t\t'label' => esc_html__( 'URL para redirecionar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'class' \t => 'medium',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'URL para redirecionar?', 'gravityformsbuddy' ),\n\t\t\t\t\t\t\tesc_html__( 'Link que será redirecionado para quando o usuário clicar na notificação', 'gravityformsbuddy' )\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'message',\n\t\t\t\t\t\t'label' => esc_html__( 'Mensagem Padrão', 'gravityformsbuddy' ),\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'class' => 'medium merge-tag-support mt-position-right',\n\t\t\t\t\t\t'tooltip' => sprintf(\n\t\t\t\t\t\t\t'<h6>%s</h6>%s',\n\t\t\t\t\t\t\tesc_html__( 'Mensagem', 'gravityformstwilio' ),\n\t\t\t\t\t\t\tesc_html__( 'Escreva uma mensagem que será mostrada como notificação', 'gravityformsbuddy' )\n\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t}", "public function init_form_fields() {\n\n\t\t$this->form_fields = array(\n\n\t\t\t'api_settings_section' => array(\n\t\t\t\t'title' => __( 'API Settings', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Enter your API key to start tracking.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'section',\n\t\t\t\t'default' => ''\n\t\t\t),\n\n\t\t\t'api_key' => array(\n\t\t\t\t'title' => __( 'API Key', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Log into your account and go to Site Settings. Leave blank to disable tracking.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => ''\n\t\t\t),\n\n\t\t\t'identity_pref' => array(\n\t\t\t\t'title' => __( 'Identity Preference', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Select how to identify logged in users.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'email' => __( 'Email Address', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'username' => __( 'Wordpress Username', WC_KISSmetrics::TEXT_DOMAIN )\n\t\t\t\t)\n\t\t\t),\n\n\t\t\t'logging' => array(\n\t\t\t\t'title' => __( 'Logging', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Select whether to log nothing, queries, errors, or both queries and errors to the WooCommerce log. Careful, this can fill up log files very quickly on a busy site.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'default' => '',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'off' => __( 'Off', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'queries' => __( 'Queries', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'errors' => __( 'Errors', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'queries_and_errors' => __( 'Queries & Errors', WC_KISSmetrics::TEXT_DOMAIN )\n\t\t\t\t)\n\t\t\t),\n\n\t\t\t'event_names_section' => array(\n\t\t\t\t'title' => __( 'Event Names', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Customize the event names. Leave a field blank to disable tracking of that event.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'section',\n\t\t\t\t'default' => ''\n\t\t\t),\n\n\t\t\t'signed_in_event_name' => array(\n\t\t\t\t'title' => __( 'Signed In', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer signs in.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'signed in'\n\t\t\t),\n\n\t\t\t'signed_out_event_name' => array(\n\t\t\t\t'title' => __( 'Signed Out', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer signs out.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'signed out'\n\t\t\t),\n\n\t\t\t'viewed_signup_event_name' => array(\n\t\t\t\t'title' => __( 'Viewed Signup', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer views the registration form.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'viewed signup'\n\t\t\t),\n\n\t\t\t'signed_up_event_name' => array(\n\t\t\t\t'title' => __( 'Signed Up', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer registers a new account.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'signed up'\n\t\t\t),\n\n\t\t\t'viewed_homepage_event_name' => array(\n\t\t\t\t'title' => __( 'Viewed Homepage', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer views the homepage.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'viewed homepage'\n\t\t\t),\n\n\t\t\t'viewed_product_event_name' => array(\n\t\t\t\t'title' => __( 'Viewed Product', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer views a single product', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'viewed product'\n\t\t\t),\n\n\t\t\t'added_to_cart_event_name' => array(\n\t\t\t\t'title' => __( 'Added to Cart', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer adds an item to the cart.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'added to cart'\n\t\t\t),\n\n\t\t\t'removed_from_cart_event_name' => array(\n\t\t\t\t'title' => __( 'Removed from Cart', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer removes an item from the cart.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'removed from cart'\n\t\t\t),\n\n\t\t\t'changed_cart_quantity_event_name' => array(\n\t\t\t\t'title' => __( 'Changed Cart Quantity', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer changes the quantity of an item in the cart.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'changed cart quantity'\n\t\t\t),\n\n\t\t\t'viewed_cart_event_name' => array(\n\t\t\t\t'title' => __( 'Viewed Cart', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer views the cart.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'viewed cart'\n\t\t\t),\n\n\t\t\t'applied_coupon_event_name' => array(\n\t\t\t\t'title' => __( 'Applied Coupon', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer applies a coupon', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'applied coupon'\n\t\t\t),\n\n\t\t\t'started_checkout_event_name' => array(\n\t\t\t\t'title' => __( 'Started Checkout', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer starts the checkout.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'started checkout'\n\t\t\t),\n\n\t\t\t'started_payment_event_name' => array(\n\t\t\t\t'title' => __( 'Started Payment', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer views the payment page (used with direct post payment gateways)', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'started payment'\n\t\t\t),\n\n\t\t\t'completed_purchase_event_name' => array(\n\t\t\t\t'title' => __( 'Completed Purchase', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer completes a purchase.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'completed purchase'\n\t\t\t),\n\n\t\t\t'wrote_review_event_name' => array(\n\t\t\t\t'title' => __( 'Wrote Review', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer writes a review.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'wrote review'\n\t\t\t),\n\n\t\t\t'commented_event_name' => array(\n\t\t\t\t'title' => __( 'Commented', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer write a comment.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'commented'\n\t\t\t),\n\n\t\t\t'viewed_account_event_name' => array(\n\t\t\t\t'title' => __( 'Viewed Account', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer views the My Account page.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'viewed account'\n\t\t\t),\n\n\t\t\t'viewed_order_event_name' => array(\n\t\t\t\t'title' => __( 'Viewed Order', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer views an order', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'viewed order'\n\t\t\t),\n\n\t\t\t'updated_address_event_name' => array(\n\t\t\t\t'title' => __( 'Updated Address', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer updates their address.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'updated address'\n\t\t\t),\n\n\t\t\t'changed_password_event_name' => array(\n\t\t\t\t'title' => __( 'Changed Password', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer changes their password.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'changed password'\n\t\t\t),\n\n\t\t\t'estimated_shipping_event_name' => array(\n\t\t\t\t'title' => __( 'Estimated Shipping', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer estimates shipping.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'estimated shipping'\n\t\t\t),\n\n\t\t\t'tracked_order_event_name' => array(\n\t\t\t\t'title' => __( 'Tracked Order', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer tracks an order.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'tracked order'\n\t\t\t),\n\n\t\t\t'cancelled_order_event_name' => array(\n\t\t\t\t'title' => __( 'Cancelled Order', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer cancels an order.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'cancelled order'\n\t\t\t),\n\n\t\t\t'reordered_event_name' => array(\n\t\t\t\t'title' => __( 'Reordered', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Triggered when a customer reorders a previous order.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'reordered'\n\t\t\t),\n\n\t\t\t'property_names_section' => array(\n\t\t\t\t'title' => __( 'Property Names', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Customize the property names. Leave a field blank to disable tracking of that property.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'section',\n\t\t\t\t'default' => ''\n\t\t\t),\n\n\t\t\t'product_name_property_name' => array(\n\t\t\t\t'title' => __( 'Product Name', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer views a product, adds / removes / changes quantities in the cart, or writes a review.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'product name'\n\t\t\t),\n\n\t\t\t'quantity_property_name' => array(\n\t\t\t\t'title' => __( 'Product Quantity', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer adds a product to their cart or changes the quantity in their cart.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'quantity'\n\t\t\t),\n\n\t\t\t'category_property_name' => array(\n\t\t\t\t'title' => __( 'Product Category', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer adds a product to their cart.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'category'\n\t\t\t),\n\n\t\t\t'coupon_code_property_name' => array(\n\t\t\t\t'title' => __( 'Coupon Code', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer applies a coupon.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'coupon code'\n\t\t\t),\n\n\t\t\t'order_id_property_name' => array(\n\t\t\t\t'title' => __( 'Order ID', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer completes their purchase.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'order id'\n\t\t\t),\n\n\t\t\t'order_total_property_name' => array(\n\t\t\t\t'title' => __( 'Order Total', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer completes their purchase.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'order total'\n\t\t\t),\n\n\t\t\t'shipping_total_property_name' => array(\n\t\t\t\t'title' => __( 'Shipping Total', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer completes their purchase.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'shipping total'\n\t\t\t),\n\n\t\t\t'total_quantity_property_name' => array(\n\t\t\t\t'title' => __( 'Total Quantity', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer completes their purchase.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'total quantity'\n\t\t\t),\n\n\t\t\t'payment_method_property_name' => array(\n\t\t\t\t'title' => __( 'Payment Method', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer completes their purchase.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'payment method'\n\t\t\t),\n\n\t\t\t'post_title_property_name' => array(\n\t\t\t\t'title' => __( 'Post Title', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer leaves a comment on a post.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'post title'\n\t\t\t),\n\n\t\t\t'country_property_name' => array(\n\t\t\t\t'title' => __( 'Shipping Country', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'description' => __( 'Tracked when a customer estimates shipping.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'default' => 'country'\n\t\t\t),\n\t\t);\n\n\t\t// WooCommerce Subscriptions support, since 1.1\n\n\t\tif( $this->is_subscriptions_active() ) :\n\n\t\t\t$this->form_fields = array_merge( $this->form_fields, array(\n\n\t\t\t\t'subscription_event_names_section' => array(\n\t\t\t\t\t'title' => __( 'Subscription Event Names', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Customize the event names for Subscription events. Leave a field blank to disable tracking of that event.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'section',\n\t\t\t\t),\n\n\t\t\t\t'activated_subscription_event_name' => array(\n\t\t\t\t\t'title' => __( 'Activated Subscription', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Triggered when a customer activates their subscription.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'activated subscription',\n\t\t\t\t),\n\n\t\t\t\t'subscription_trial_ended_event_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Free Trial Ended', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Triggered when a the free trial ends for a subscription.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription trial ended',\n\t\t\t\t),\n\n\t\t\t\t'subscription_expired_event_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Expired', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Triggered when a subscription expires.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription expired',\n\t\t\t\t),\n\n\t\t\t\t'suspended_subscription_event_name' => array(\n\t\t\t\t\t'title' => __( 'Suspended Subscription', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Triggered when a customer suspends their subscription.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'suspended subscription',\n\t\t\t\t),\n\n\t\t\t\t'reactivated_subscription_event_name' => array(\n\t\t\t\t\t'title' => __( 'Reactivated Subscription', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Triggered when a customer reactivates their subscription.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'reactivated subscription',\n\t\t\t\t),\n\n\t\t\t\t'cancelled_subscription_event_name' => array(\n\t\t\t\t\t'title' => __( 'Cancelled Subscription', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Triggered when a customer cancels their subscription.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'cancelled subscription',\n\t\t\t\t),\n\n\t\t\t\t'renewed_subscription_event_name' => array(\n\t\t\t\t\t'title' => __( 'Renewed Subscription', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Triggered when a customer is automatically billed for a subscription renewal.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription billed',\n\t\t\t\t),\n\n\t\t\t\t'subscription_property_names_section' => array(\n\t\t\t\t\t'title' => __( 'Subscription Property Names', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Customize the property names for Subscription events. Leave a field blank to disable tracking of that property.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'section',\n\t\t\t\t),\n\n\t\t\t\t'subscription_name_property_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Name', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracked anytime a subscription event occurs.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription name'\n\t\t\t\t),\n\n\t\t\t\t'total_initial_payment_property_name' => array(\n\t\t\t\t\t'title' => __( 'Total Initial Payment', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracked for subscription activations. Includes the Recurring amount and Sign Up Fee.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription name'\n\t\t\t\t),\n\n\t\t\t\t'initial_sign_up_fee_property_name' => array(\n\t\t\t\t\t'title' => __( 'Initial Sign Up Fee', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracked for subscription activations. This will be zero if the subscription has no sign up fee.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'initial sign up fee'\n\t\t\t\t),\n\n\t\t\t\t'subscription_period_property_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Period', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracks the period (e.g. Day, Month, Year) for subscription activations.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription period'\n\t\t\t\t),\n\n\t\t\t\t'subscription_interval_property_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Interval', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracks the interval (e.g. every 1st, 2nd, 3rd, etc.) for subscription activations.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription interval'\n\t\t\t\t),\n\n\t\t\t\t'subscription_length_property_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Length', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracks the length (e.g. infinite, 12 months, 2 years, etc.) for subscription activations.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription length'\n\t\t\t\t),\n\n\t\t\t\t'subscription_trial_period_property_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Trial Period', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracks the trial period (e.g. Day, Month, Year) for subscription activations with a free trial.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription trial period'\n\t\t\t\t),\n\n\t\t\t\t'subscription_trial_length_property_name' => array(\n\t\t\t\t\t'title' => __( 'Subscription Trial Length', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracks the trial length (e.g. 1-90 periods) for subscription activations with a free trial.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription trial length'\n\t\t\t\t),\n\n\t\t\t\t'billing_amount_property_name' => array(\n\t\t\t\t\t'title' => __( 'Billing Amount for Subscription Renewal', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracks the amount billed to the customer when their subscription automatically renews.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription billing amount'\n\t\t\t\t),\n\n\t\t\t\t'billing_description_property_name' => array(\n\t\t\t\t\t'title' => __( 'Billing Description for Subscription Renewal', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'description' => __( 'Tracks the name of the subscription billed to the customer when the subscription automatically renews.', WC_KISSmetrics::TEXT_DOMAIN ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'default' => 'subscription billing description'\n\t\t\t\t),\n\n\t\t\t) );\n\n\t\tendif;\n\t}", "public static function get_input_fields() {\n\t\t$allowed_settings = DataSource::get_allowed_settings();\n\n\t\t$input_fields = [];\n\n\t\tif ( ! empty( $allowed_settings ) ) {\n\n\t\t\t/**\n\t\t\t * Loop through the $allowed_settings and build fields\n\t\t\t * for the individual settings\n\t\t\t */\n\t\t\tforeach ( $allowed_settings as $key => $setting ) {\n\n\t\t\t\t/**\n\t\t\t\t * Determine if the individual setting already has a\n\t\t\t\t * REST API name, if not use the option name.\n\t\t\t\t * Sanitize the field name to be camelcase\n\t\t\t\t */\n\t\t\t\tif ( ! empty( $setting['show_in_rest']['name'] ) ) {\n\t\t\t\t\t$individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $setting['show_in_rest']['name'], '_' ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $key, '_' ) ) );\n\t\t\t\t}\n\n\t\t\t\t$replaced_setting_key = preg_replace( '[^a-zA-Z0-9 -]', ' ', $individual_setting_key );\n\n\t\t\t\tif ( ! empty( $replaced_setting_key ) ) {\n\t\t\t\t\t$individual_setting_key = $replaced_setting_key;\n\t\t\t\t}\n\n\t\t\t\t$individual_setting_key = lcfirst( $individual_setting_key );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( '_', ' ', ucwords( $individual_setting_key, '_' ) ) );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( '-', ' ', ucwords( $individual_setting_key, '_' ) ) );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( ' ', '', ucwords( $individual_setting_key, ' ' ) ) );\n\n\t\t\t\t/**\n\t\t\t\t * Dynamically build the individual setting,\n\t\t\t\t * then add it to the $input_fields\n\t\t\t\t */\n\t\t\t\t$input_fields[ $individual_setting_key ] = [\n\t\t\t\t\t'type' => $setting['type'],\n\t\t\t\t\t'description' => $setting['description'],\n\t\t\t\t];\n\n\t\t\t}\n\t\t}\n\n\t\treturn $input_fields;\n\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n\n\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'title',\n 'label' => $this->l('Titre'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'description',\n 'label' => $this->l('Description'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'legend',\n 'label' => $this->l('Légende'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'url',\n 'label' => $this->l('Url'),\n ), \n array(\n 'col' => 6,\n 'type' => 'file',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter an image'),\n 'name' => 'image',\n 'label' => $this->l('Image_up'),\n ),\n array(\n 'col' => 4,\n 'type' => 'date',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a start date'),\n 'name' => 'debut',\n 'label' => $this->l('Debut'),\n ),\n array(\n 'col' => 4,\n 'type' => 'date',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a end date'),\n 'name' => 'fin',\n 'label' => $this->l('Fin'),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function init_form_fields() {\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'dokan' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable this email notification', 'dokan' ),\n 'default' => 'yes',\n ),\n 'subject' => array(\n 'title' => __( 'Subject', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{site_name},{amount},{seller_name},{order_id},{status}</code>' ),\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __( 'Email heading', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{site_name},{amount},{seller_name},{order_id},{status}</code>' ),\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'email_type' => array(\n 'title' => __( 'Email type', 'dokan' ),\n 'type' => 'select',\n 'description' => __( 'Choose which format of email to send.', 'dokan' ),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "public function get_plugin_settings() {\n $settings = apply_filters( \"ninja_forms_settings\", get_option( \"ninja_forms_settings\" ) );\n\n $settings['date_format'] = isset ( $settings['date_format'] ) ? $settings['date_format'] : 'd/m/Y';\n $settings['currency_symbol'] = isset ( $settings['currency_symbol'] ) ? $settings['currency_symbol'] : '$';\n $settings['recaptcha_lang'] = isset ( $settings['recaptcha_lang'] ) ? $settings['recaptcha_lang'] : 'en';\n $settings['req_div_label'] = isset ( $settings['req_div_label'] ) ? $settings['req_div_label'] : sprintf( __( 'Fields marked with an %s*%s are required', 'ninja-forms' ), '<span class=\"ninja-forms-req-symbol\">','</span>' );\n $settings['req_field_symbol'] = isset ( $settings['req_field_symbol'] ) ? $settings['req_field_symbol'] : '<strong>*</strong>';\n $settings['req_error_label'] = isset ( $settings['req_error_label'] ) ? $settings['req_error_label'] : __( 'Please ensure all required fields are completed.', 'ninja-forms' );\n $settings['req_field_error'] = isset ( $settings['req_field_error'] ) ? $settings['req_field_error'] : __( 'This is a required field', 'ninja-forms' );\n $settings['spam_error'] = isset ( $settings['spam_error'] ) ? $settings['spam_error'] : __( 'Please answer the anti-spam question correctly.', 'ninja-forms' );\n $settings['honeypot_error'] = isset ( $settings['honeypot_error'] ) ? $settings['honeypot_error'] : __( 'Please leave the spam field blank.', 'ninja-forms' );\n $settings['timed_submit_error'] = isset ( $settings['timed_submit_error'] ) ? $settings['timed_submit_error'] : __( 'Please wait to submit the form.', 'ninja-forms' );\n $settings['javascript_error'] = isset ( $settings['javascript_error'] ) ? $settings['javascript_error'] : __( 'You cannot submit the form without Javascript enabled.', 'ninja-forms' );\n $settings['invalid_email'] = isset ( $settings['invalid_email'] ) ? $settings['invalid_email'] : __( 'Please enter a valid email address.', 'ninja-forms' );\n $settings['process_label'] = isset ( $settings['process_label'] ) ? $settings['process_label'] : __( 'Processing', 'ninja-forms' );\n $settings['password_mismatch'] = isset ( $settings['password_mismatch'] ) ? $settings['password_mismatch'] : __( 'The passwords provided do not match.', 'ninja-forms' );\n\n $settings['date_format'] = apply_filters( 'ninja_forms_labels/date_format' , $settings['date_format'] );\n $settings['currency_symbol'] = apply_filters( 'ninja_forms_labels/currency_symbol' , $settings['currency_symbol'] );\n $settings['req_div_label'] = apply_filters( 'ninja_forms_labels/req_div_label' , $settings['req_div_label'] );\n $settings['req_field_symbol'] = apply_filters( 'ninja_forms_labels/req_field_symbol' , $settings['req_field_symbol'] );\n $settings['req_error_label'] = apply_filters( 'ninja_forms_labels/req_error_label' , $settings['req_error_label'] );\n $settings['req_field_error'] = apply_filters( 'ninja_forms_labels/req_field_error' , $settings['req_field_error'] );\n $settings['spam_error'] = apply_filters( 'ninja_forms_labels/spam_error' , $settings['spam_error'] );\n $settings['honeypot_error'] = apply_filters( 'ninja_forms_labels/honeypot_error' , $settings['honeypot_error'] );\n $settings['timed_submit_error'] = apply_filters( 'ninja_forms_labels/timed_submit_error' , $settings['timed_submit_error'] );\n $settings['javascript_error'] = apply_filters( 'ninja_forms_labels/javascript_error' , $settings['javascript_error'] );\n $settings['invalid_email'] = apply_filters( 'ninja_forms_labels/invalid_email' , $settings['invalid_email'] );\n $settings['process_label'] = apply_filters( 'ninja_forms_labels/process_label' , $settings['process_label'] );\n $settings['password_mismatch'] = apply_filters( 'ninja_forms_labels/password_mismatch' , $settings['password_mismatch'] );\n\n return $settings;\n }", "function ting_ting_collection_context_settings_form($conf) {\n $form = array();\n return $form;\n}", "public function init_form_fields()\n {\n\n // Get available placeholders for this email\n $placeholder_text = sprintf(__('Available placeholders: %s', 'subscriptio'), '<code>' . esc_html(implode('</code>, <code>', array_keys($this->placeholders))) . '</code>');\n\n // Define form fields\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __('Enable/Disable', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Enable this email notification', 'subscriptio'),\n 'default' => 'yes',\n ),\n 'send_to_admin' => array(\n 'title' => __('Send to admin', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Send BCC copy to admin', 'subscriptio'),\n 'default' => 'no',\n ),\n 'subject' => array(\n 'title' => __('Subject', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __('Email heading', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'additional_content' => array(\n 'title' => __('Additional content', 'subscriptio'),\n 'description' => __( 'Text to appear to appear below the main email content.', 'subscriptio' ) . ' ' . $placeholder_text,\n 'css' => 'width: 400px; height: 75px;',\n 'placeholder' => __('N/A', 'subscriptio'),\n 'type' => 'textarea',\n 'default' => $this->get_default_additional_content(),\n 'desc_tip' => true,\n ),\n 'email_type' => array(\n 'title' => __('Email type', 'subscriptio'),\n 'type' => 'select',\n 'description' => __('Choose which format of email to send.', 'subscriptio'),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "protected function admin_fields_settings() {\n\n $settings_fields = array(\n\n 'wcsales_general_tabs' => array(),\n \n 'wcsales_settings_tabs' => array(\n\n array(\n 'name' => 'enableresalenotification',\n 'label' => __( 'Enable / Disable Sale Notification', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Enable', 'wc-sales-notification-pro' ),\n 'type' => 'checkbox',\n 'default' => 'off',\n 'class'=>'woolentor_table_row',\n ),\n\n array(\n 'name' => 'notification_content_type',\n 'label' => __( 'Notification Content Type', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Select Content Type', 'wc-sales-notification-pro' ),\n 'type' => 'radio',\n 'default' => 'actual',\n 'options' => array(\n 'actual' => __('Real','wc-sales-notification-pro'),\n 'fakes' => __('Fakes','wc-sales-notification-pro'),\n )\n ),\n\n array(\n 'name' => 'notification_pos',\n 'label' => __( 'Position', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Sale Notification Position on frontend.', 'wc-sales-notification-pro' ),\n 'type' => 'select',\n 'default' => 'bottomleft',\n 'options' => array(\n 'topleft' =>__( 'Top Left','wc-sales-notification-pro' ),\n 'topright' =>__( 'Top Right','wc-sales-notification-pro' ),\n 'bottomleft' =>__( 'Bottom Left','wc-sales-notification-pro' ),\n 'bottomright' =>__( 'Bottom Right','wc-sales-notification-pro' ),\n ),\n ),\n\n array(\n 'name' => 'notification_layout',\n 'label' => __( 'Image Position', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Notification Layout.', 'wc-sales-notification-pro' ),\n 'type' => 'select',\n 'default' => 'imageleft',\n 'options' => array(\n 'imageleft' =>__( 'Image Left','wc-sales-notification-pro' ),\n 'imageright' =>__( 'Image Right','wc-sales-notification-pro' ),\n ),\n 'class' => 'notification_real'\n ),\n\n array(\n 'name' => 'notification_loadduration',\n 'label' => __( 'Loading Time', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Notification Loading duration.', 'wc-sales-notification-pro' ),\n 'type' => 'select',\n 'default' => '3',\n 'options' => array(\n '2' =>__( '2 seconds','wc-sales-notification-pro' ),\n '3' =>__( '3 seconds','wc-sales-notification-pro' ),\n '4' =>__( '4 seconds','wc-sales-notification-pro' ),\n '5' =>__( '5 seconds','wc-sales-notification-pro' ),\n '6' =>__( '6 seconds','wc-sales-notification-pro' ),\n '7' =>__( '7 seconds','wc-sales-notification-pro' ),\n '8' =>__( '8 seconds','wc-sales-notification-pro' ),\n '9' =>__( '9 seconds','wc-sales-notification-pro' ),\n '10' =>__( '10 seconds','wc-sales-notification-pro' ),\n '20' =>__( '20 seconds','wc-sales-notification-pro' ),\n '30' =>__( '30 seconds','wc-sales-notification-pro' ),\n '40' =>__( '40 seconds','wc-sales-notification-pro' ),\n '50' =>__( '50 seconds','wc-sales-notification-pro' ),\n '60' =>__( '1 minute','wc-sales-notification-pro' ),\n '90' =>__( '1.5 minutes','wc-sales-notification-pro' ),\n '120' =>__( '2 minutes','wc-sales-notification-pro' ),\n ),\n ),\n\n array(\n 'name' => 'notification_time_int',\n 'label' => __( 'Time Interval', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Time between notifications.', 'wc-sales-notification-pro' ),\n 'type' => 'select',\n 'default' => '4',\n 'options' => array(\n '2' =>__( '2 seconds','wc-sales-notification-pro' ),\n '4' =>__( '4 seconds','wc-sales-notification-pro' ),\n '5' =>__( '5 seconds','wc-sales-notification-pro' ),\n '6' =>__( '6 seconds','wc-sales-notification-pro' ),\n '7' =>__( '7 seconds','wc-sales-notification-pro' ),\n '8' =>__( '8 seconds','wc-sales-notification-pro' ),\n '9' =>__( '9 seconds','wc-sales-notification-pro' ),\n '10' =>__( '10 seconds','wc-sales-notification-pro' ),\n '20' =>__( '20 seconds','wc-sales-notification-pro' ),\n '30' =>__( '30 seconds','wc-sales-notification-pro' ),\n '40' =>__( '40 seconds','wc-sales-notification-pro' ),\n '50' =>__( '50 seconds','wc-sales-notification-pro' ),\n '60' =>__( '1 minute','wc-sales-notification-pro' ),\n '90' =>__( '1.5 minutes','wc-sales-notification-pro' ),\n '120' =>__( '2 minutes','wc-sales-notification-pro' ),\n ),\n ),\n\n array(\n 'name' => 'notification_limit',\n 'label' => __( 'Limit', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Order Limit for notification.', 'wc-sales-notification-pro' ),\n 'min' => 1,\n 'max' => 100,\n 'default' => '5',\n 'step' => '1',\n 'type' => 'number',\n 'sanitize_callback' => 'number',\n 'class' => 'notification_real',\n ),\n\n array(\n 'name' => 'notification_uptodate',\n 'label' => __( 'Order Upto', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Do not show purchases older than.', 'wc-sales-notification-pro' ),\n 'type' => 'select',\n 'default' => '7',\n 'options' => array(\n '1' =>__( '1 day','wc-sales-notification-pro' ),\n '2' =>__( '2 days','wc-sales-notification-pro' ),\n '3' =>__( '3 days','wc-sales-notification-pro' ),\n '4' =>__( '4 days','wc-sales-notification-pro' ),\n '5' =>__( '5 days','wc-sales-notification-pro' ),\n '6' =>__( '6 days','wc-sales-notification-pro' ),\n '7' =>__( '1 week','wc-sales-notification-pro' ),\n '10' =>__( '10 days','wc-sales-notification-pro' ),\n '14' =>__( '2 weeks','wc-sales-notification-pro' ),\n '21' =>__( '3 weeks','wc-sales-notification-pro' ),\n '28' =>__( '4 weeks','wc-sales-notification-pro' ),\n '35' =>__( '5 weeks','wc-sales-notification-pro' ),\n '42' =>__( '6 weeks','wc-sales-notification-pro' ),\n '49' =>__( '7 weeks','wc-sales-notification-pro' ),\n '56' =>__( '8 weeks','wc-sales-notification-pro' ),\n ),\n 'class' => 'notification_real',\n ),\n\n array(\n 'name' => 'notification_inanimation',\n 'label' => __( 'Animation In', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Notification Enter Animation.', 'wc-sales-notification-pro' ),\n 'type' => 'select',\n 'default' => 'fadeInLeft',\n 'options' => array(\n 'bounce' =>__( 'bounce','wc-sales-notification-pro' ),\n 'flash' =>__( 'flash','wc-sales-notification-pro' ),\n 'pulse' =>__( 'pulse','wc-sales-notification-pro' ),\n 'rubberBand' =>__( 'rubberBand','wc-sales-notification-pro' ),\n 'shake' =>__( 'shake','wc-sales-notification-pro' ),\n 'swing' =>__( 'swing','wc-sales-notification-pro' ),\n 'tada' =>__( 'tada','wc-sales-notification-pro' ),\n 'wobble' =>__( 'wobble','wc-sales-notification-pro' ),\n 'jello' =>__( 'jello','wc-sales-notification-pro' ),\n 'heartBeat' =>__( 'heartBeat','wc-sales-notification-pro' ),\n 'bounceIn' =>__( 'bounceIn','wc-sales-notification-pro' ),\n 'bounceInDown' =>__( 'bounceInDown','wc-sales-notification-pro' ),\n 'bounceInLeft' =>__( 'bounceInLeft','wc-sales-notification-pro' ),\n 'bounceInRight' =>__( 'bounceInRight','wc-sales-notification-pro' ),\n 'bounceInUp' =>__( 'bounceInUp','wc-sales-notification-pro' ),\n 'fadeIn' =>__( 'fadeIn','wc-sales-notification-pro' ),\n 'fadeInDown' =>__( 'fadeInDown','wc-sales-notification-pro' ),\n 'fadeInDownBig' =>__( 'fadeInDownBig','wc-sales-notification-pro' ),\n 'fadeInLeft' =>__( 'fadeInLeft','wc-sales-notification-pro' ),\n 'fadeInLeftBig' =>__( 'fadeInLeftBig','wc-sales-notification-pro' ),\n 'fadeInRight' =>__( 'fadeInRight','wc-sales-notification-pro' ),\n 'fadeInRightBig' =>__( 'fadeInRightBig','wc-sales-notification-pro' ),\n 'fadeInUp' =>__( 'fadeInUp','wc-sales-notification-pro' ),\n 'fadeInUpBig' =>__( 'fadeInUpBig','wc-sales-notification-pro' ),\n 'flip' =>__( 'flip','wc-sales-notification-pro' ),\n 'flipInX' =>__( 'flipInX','wc-sales-notification-pro' ),\n 'flipInY' =>__( 'flipInY','wc-sales-notification-pro' ),\n 'lightSpeedIn' =>__( 'lightSpeedIn','wc-sales-notification-pro' ),\n 'rotateIn' =>__( 'rotateIn','wc-sales-notification-pro' ),\n 'rotateInDownLeft' =>__( 'rotateInDownLeft','wc-sales-notification-pro' ),\n 'rotateInDownRight' =>__( 'rotateInDownRight','wc-sales-notification-pro' ),\n 'rotateInUpLeft' =>__( 'rotateInUpLeft','wc-sales-notification-pro' ),\n 'rotateInUpRight' =>__( 'rotateInUpRight','wc-sales-notification-pro' ),\n 'slideInUp' =>__( 'slideInUp','wc-sales-notification-pro' ),\n 'slideInDown' =>__( 'slideInDown','wc-sales-notification-pro' ),\n 'slideInLeft' =>__( 'slideInLeft','wc-sales-notification-pro' ),\n 'slideInRight' =>__( 'slideInRight','wc-sales-notification-pro' ),\n 'zoomIn' =>__( 'zoomIn','wc-sales-notification-pro' ),\n 'zoomInDown' =>__( 'zoomInDown','wc-sales-notification-pro' ),\n 'zoomInLeft' =>__( 'zoomInLeft','wc-sales-notification-pro' ),\n 'zoomInRight' =>__( 'zoomInRight','wc-sales-notification-pro' ),\n 'zoomInUp' =>__( 'zoomInUp','wc-sales-notification-pro' ),\n 'hinge' =>__( 'hinge','wc-sales-notification-pro' ),\n 'jackInTheBox' =>__( 'jackInTheBox','wc-sales-notification-pro' ),\n 'rollIn' =>__( 'rollIn','wc-sales-notification-pro' ),\n 'rollOut' =>__( 'rollOut','wc-sales-notification-pro' ),\n ),\n ),\n\n array(\n 'name' => 'notification_outanimation',\n 'label' => __( 'Animation Out', 'wc-sales-notification-pro' ),\n 'desc' => __( 'Notification Out Animation.', 'wc-sales-notification-pro' ),\n 'type' => 'select',\n 'default' => 'fadeOutRight',\n 'options' => array(\n 'bounce' =>__( 'bounce','wc-sales-notification-pro' ),\n 'flash' =>__( 'flash','wc-sales-notification-pro' ),\n 'pulse' =>__( 'pulse','wc-sales-notification-pro' ),\n 'rubberBand' =>__( 'rubberBand','wc-sales-notification-pro' ),\n 'shake' =>__( 'shake','wc-sales-notification-pro' ),\n 'swing' =>__( 'swing','wc-sales-notification-pro' ),\n 'tada' =>__( 'tada','wc-sales-notification-pro' ),\n 'wobble' =>__( 'wobble','wc-sales-notification-pro' ),\n 'jello' =>__( 'jello','wc-sales-notification-pro' ),\n 'heartBeat' =>__( 'heartBeat','wc-sales-notification-pro' ),\n 'bounceOut' =>__( 'bounceOut','wc-sales-notification-pro' ),\n 'bounceOutDown' =>__( 'bounceOutDown','wc-sales-notification-pro' ),\n 'bounceOutLeft' =>__( 'bounceOutLeft','wc-sales-notification-pro' ),\n 'bounceOutRight' =>__( 'bounceOutRight','wc-sales-notification-pro' ),\n 'bounceOutUp' =>__( 'bounceOutUp','wc-sales-notification-pro' ),\n 'fadeOut' =>__( 'fadeOut','wc-sales-notification-pro' ),\n 'fadeOutDown' =>__( 'fadeOutDown','wc-sales-notification-pro' ),\n 'fadeOutDownBig' =>__( 'fadeOutDownBig','wc-sales-notification-pro' ),\n 'fadeOutLeft' =>__( 'fadeOutLeft','wc-sales-notification-pro' ),\n 'fadeOutLeftBig' =>__( 'fadeOutLeftBig','wc-sales-notification-pro' ),\n 'fadeOutRight' =>__( 'fadeOutRight','wc-sales-notification-pro' ),\n 'fadeOutRightBig' =>__( 'fadeOutRightBig','wc-sales-notification-pro' ),\n 'fadeOutUp' =>__( 'fadeOutUp','wc-sales-notification-pro' ),\n 'fadeOutUpBig' =>__( 'fadeOutUpBig','wc-sales-notification-pro' ),\n 'flip' =>__( 'flip','wc-sales-notification-pro' ),\n 'flipOutX' =>__( 'flipOutX','wc-sales-notification-pro' ),\n 'flipOutY' =>__( 'flipOutY','wc-sales-notification-pro' ),\n 'lightSpeedOut' =>__( 'lightSpeedOut','wc-sales-notification-pro' ),\n 'rotateOut' =>__( 'rotateOut','wc-sales-notification-pro' ),\n 'rotateOutDownLeft' =>__( 'rotateOutDownLeft','wc-sales-notification-pro' ),\n 'rotateOutDownRight' =>__( 'rotateOutDownRight','wc-sales-notification-pro' ),\n 'rotateOutUpLeft' =>__( 'rotateOutUpLeft','wc-sales-notification-pro' ),\n 'rotateOutUpRight' =>__( 'rotateOutUpRight','wc-sales-notification-pro' ),\n 'slideOutUp' =>__( 'slideOutUp','wc-sales-notification-pro' ),\n 'slideOutDown' =>__( 'slideOutDown','wc-sales-notification-pro' ),\n 'slideOutLeft' =>__( 'slideOutLeft','wc-sales-notification-pro' ),\n 'slideOutRight' =>__( 'slideOutRight','wc-sales-notification-pro' ),\n 'zoomOut' =>__( 'zoomOut','wc-sales-notification-pro' ),\n 'zoomOutDown' =>__( 'zoomOutDown','wc-sales-notification-pro' ),\n 'zoomOutLeft' =>__( 'zoomOutLeft','wc-sales-notification-pro' ),\n 'zoomOutRight' =>__( 'zoomOutRight','wc-sales-notification-pro' ),\n 'zoomOutUp' =>__( 'zoomOutUp','wc-sales-notification-pro' ),\n 'hinge' =>__( 'hinge','wc-sales-notification-pro' ),\n ),\n ),\n \n array(\n 'name' => 'background_color',\n 'label' => __( 'Background Color', 'wc-sales-notification-pro' ),\n 'desc' => wp_kses_post( 'Notification Background Color.', 'wc-sales-notification-pro' ),\n 'type' => 'color',\n ),\n\n array(\n 'name' => 'heading_color',\n 'label' => __( 'Heading Color', 'wc-sales-notification-pro' ),\n 'desc' => wp_kses_post( 'Notification Heading Color.', 'wc-sales-notification-pro' ),\n 'type' => 'color',\n ),\n\n array(\n 'name' => 'content_color',\n 'label' => __( 'Content Color', 'wc-sales-notification-pro' ),\n 'desc' => wp_kses_post( 'Notification Content Color.', 'wc-sales-notification-pro' ),\n 'type' => 'color',\n ),\n\n array(\n 'name' => 'cross_color',\n 'label' => __( 'Cross Icon Color', 'wc-sales-notification-pro' ),\n 'desc' => wp_kses_post( 'Notification Cross Icon Color.', 'wc-sales-notification-pro' ),\n 'type' => 'color'\n ),\n\n ),\n\n 'wcsales_fakes_data_tabs' => array(),\n 'wcsales_plugins_tabs' => array(),\n\n );\n \n return array_merge( $settings_fields );\n }", "abstract public function getSettingsFields();", "function init_form_fields() {\n\t\t\t\n\t\t\t$abs_path = str_replace('/wp-admin', '', getcwd());\n\t\t\n\t\t\t$this->form_fields = array(\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Activer/Désactiver:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'checkbox', \n\t\t\t\t\t\t\t\t'label' => __( 'Activer le module de paiement Atos.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => 'yes'\n\t\t\t\t\t\t\t), \n\t\t\t\t'title' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Nom:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Intitulé affiché à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __( 'Paiement sécurisé par carte bancaire', 'woothemes' )\n\t\t\t\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Description:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Description affichée à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Payez en toute sécurité grâce à notre système de paiement Atos.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'merchant_id' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Identifiant commerçant:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Identifiant commerçant fourni par votre banque. Ex: 014295303911112', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('014295303911112', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'pathfile' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier pathfile:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier de configuration \"pathfile\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/param/pathfile', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'request_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier request:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"request\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/request', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'response_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier response:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"response\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/response', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'payment_means' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Cartes acceptées:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Moyens de paiement acceptés. Ex pour CB, Visa et Mastercard: CB,2,VISA,2,MASTERCARD,2', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('CB,2,VISA,2,MASTERCARD,2', 'woothemes')\n\t\t\t\t\t\t\t),\n\n\t\t\t\t'currency_code' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Devise:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'select', \n\t\t\t\t\t\t\t\t'description' => __( 'Veuillez sélectionner une devise pour les paiemenents.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => '978',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'840' => 'USD',\n\t\t\t\t\t\t\t\t\t'978' => 'EUR',\n\t\t\t\t\t\t\t\t\t'124' => 'CAD',\n\t\t\t\t\t\t\t\t\t'392' => 'JPY',\n\t\t\t\t\t\t\t\t\t'826' => 'GBP',\n\t\t\t\t\t\t\t\t\t'036' => 'AUD' \n\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\t\n\t\t\t\t'paybtn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton qui redirige vers le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Régler la commande.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'paymsg' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Message page de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Message affiché sur la page de commande validée, avant passage sur le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Merci pour votre commande. Veuillez cliquer sur le bouton ci-dessous pour effectuer le règlement.', 'woothemes')\n\t\t\t\t\t\t\t)\n\t\t\t\t/*'payreturn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton retour:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton de retour ver la boutique.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Retour', 'woothemes')\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);\n\t\t\n\t\t}", "function get_extra_fields()\n\t{\n\t\t// Give user options\n\t\t// - where to copy files from [actually this field is in admin_import.php]\n\t\t// - theme to save into (advise they should use Theme Wizard to create a theme with similar colour first)\n\t\t// - whether to Comcode-convert\n\t\t// - whether to fix invalid XHTML\n\t\t// - the base URL to use to turn absolute URLs into relative URLs\n\n\t\t$fields=new ocp_tempcode();\n\n\t\t$themes=new ocp_tempcode();\n\t\trequire_code('themes2');\n\t\t$_themes=find_all_themes();\n\t\trequire_code('form_templates');\n\t\tforeach ($_themes as $theme=>$theme_title)\n\t\t{\n\t\t\t$themes->attach(form_input_list_entry($theme,($theme==$GLOBALS['FORUM_DRIVER']->get_theme()),$theme_title));\n\t\t}\n\t\t$fields=form_input_list(do_lang_tempcode('THEME'),do_lang_tempcode('THEME_TO_SAVE_INTO'),'theme',$themes,NULL,true);\n\n\t\t$fields->attach(form_input_tick(do_lang_tempcode('WHETHER_CONVERT_COMCODE'),do_lang_tempcode('DESCRIPTION_WHETHER_CONVERT_COMCODE'),'convert_to_comcode',false));\n\n\t\t$fields->attach(form_input_tick(do_lang_tempcode('FIX_INVALID_HTML'),do_lang_tempcode('DESCRIPTION_FIX_INVALID_HTML'),'fix_html',true));\n\n\t\t$fields->attach(form_input_line(do_lang_tempcode('installer:BASE_URL'),do_lang_tempcode('DESCRIPTION_IMPORT_BASE_URL'),'base_url',get_base_url(),true));\n\n\t\treturn $fields;\n\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 2,\n 'type' => 'text',\n 'suffix' => '<i class=\"icon icon-euro\"></i>',\n 'required' => true,\n 'label' => $this->l('Customer must spent'),\n 'desc' => $this->l('Enter the amount which your customers have to sepent to receibe the coupon.'),\n 'name' => 'WI_SPENT_AMOUNT',\n ),\n array(\n 'col' => 2,\n 'type' => 'text',\n 'suffix' => '<i class=\"icon icon-euro\"></i>',\n 'required' => true,\n 'label' => $this->l('Amount of the coupon'),\n 'desc' => $this->l('Enter the amount of the coupon for gift to your customers.'),\n 'name' => 'WI_SPENT_COUPON',\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'required' => true,\n 'label' => $this->l('Coupon validity in days'),\n 'desc' => $this->l('Enter the number of days while the coupon will be valid.'),\n 'name' => 'WI_SPENT_DAYS',\n ),\n array(\n 'col' => 6,\n 'type' => 'switch',\n 'label' => $this->l('Enabled'),\n 'name' => 'WI_SPENT_ENABLED',\n 'desc' => $this->l('Enable or disable this feature.'),\n 'values' => array(\n array('value' => 1, 'name' => $this->l('Yes')),\n array('value' => 0, 'name' => $this->l('No')),\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable eSewa Payment Method', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => 'yes',\n ),\n 'title' => array(\n 'title' => __( 'Title', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'This controls the title which the user sees during checkout.', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => __( 'eSewa', 'esewa-payment-gateway-for-woocommerce' ),\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => __( 'Customer Message', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'textarea',\n 'description' => __( 'Enter description of payment gateway', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => __( 'eSewa is the first online payment gateway of Nepal. It facilitates its users to pay and get paid online.', 'esewa-payment-gateway-for-woocommerce' ),\n ),\n 'merchant' => array(\n 'title' => __( 'Merchant ID', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'text',\n 'description' => __( 'Enter Merchant ID. Eg. 0000ETM', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => '',\n 'placeholder' => __( 'Enter Merchant ID', 'esewa-payment-gateway-for-woocommerce' ),\n ),\n 'testing' => array(\n 'title' => __( 'For Developers', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'title',\n 'description' => '',\n ),\n 'testmode' => array(\n 'title' => __( 'Test mode', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Test mode', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => 'no',\n 'description' => __( 'Used for development purpose', 'esewa-payment-gateway-for-woocommerce' ),\n ),\n 'debug' => array(\n 'title' => __( 'Debug Log', 'esewa-payment-gateway-for-woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable logging', 'esewa-payment-gateway-for-woocommerce' ),\n 'default' => 'no',\n 'description' => sprintf( __( 'Log eSewa events, inside <code>%s</code>', 'esewa-payment-gateway-for-woocommerce' ),\n wc_get_log_file_path( 'esewa' )\n ),\n ),\n );\n\n\t\t}", "function init_form_fields() {\r\n $this->form_fields = array (\r\n 'enabled' => array (\r\n 'title' => __('Enable/Disable','Bitcoin_Payment'),\r\n 'type' => 'checkbox',\r\n 'label' => __('Enable/Disable the bitcoin payment','Bitcoin_Payment'),\r\n 'default' => 'no',\r\n 'section' => 'default'\r\n ),\r\n 'title' => array (\r\n 'title' => __('Payment gateway title','Bitcoin_Payment'),\r\n 'type' => 'text',\r\n 'default' => __('Bitcoin Payment','Bitcoin_Payment'),\r\n 'desc_tip' => true,\r\n 'css' => 'width:400px',\r\n 'section' => 'default'\r\n ),\r\n 'description' => array (\r\n 'title' => __('Payment gateway description','Bitcoin_Payment'),\r\n 'type' => 'textarea',\r\n 'default' => __('Bitcoin payment','Bitcoin_Payment'),\r\n 'desc_tip' => true,\r\n 'css' => 'width:400px',\r\n 'section' => 'default'\r\n ),\r\n 'instructions' => array(\r\n 'title' => __( 'Instructions', 'Bitcoin_Payment' ),\r\n 'type' => 'textarea',\r\n 'css' => 'width:400px',\r\n 'description' => __( 'Instructions that will be added to the thank you page.', 'Bitcoin_Payment' ),\r\n 'default' => '',\r\n 'section' => 'default'\r\n ),\r\n 'access_key' => array(\r\n 'title' => __( 'access key', 'Bitcoin_Payment' ),\r\n 'type' => 'text',\r\n 'css' => 'width:400px',\r\n 'default' => '',\r\n 'section' => 'default'\r\n ),\r\n 'access_secret' => array(\r\n 'title' => __( 'access secret', 'Bitcoin_Payment' ),\r\n 'type' => 'text',\r\n 'css' => 'width:400px',\r\n 'default' => '',\r\n 'section' => 'default'\r\n ),\r\n \r\n 'recv_secret' => array (\r\n 'title' => __( 'Callback key for signature','Bitcoin_Payment'),\r\n 'type' => 'text',\r\n 'default' => '1',\r\n 'description' => __( 'detail: https://coincheck.com/payment/shop','Bitcoin_Payment'),\r\n 'css' => 'width:400px;',\r\n 'section' => 'default'\r\n )\r\n );\r\n }", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable plugin', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title' => __( 'Title', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'This controls the title which the user sees during checkout.', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => __( 'Invoice', 'payex-woocommerce-payments' )\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title' => __( 'Description', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'This controls the description which the user sees during checkout.', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => __( 'Invoice', 'payex-woocommerce-payments' ),\n\t\t\t),\n\t\t\t'merchant_token' => array(\n\t\t\t\t'title' => __( 'Merchant Token', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Merchant Token', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => $this->merchant_token\n\t\t\t),\n\t\t\t'payee_id' => array(\n\t\t\t\t'title' => __( 'Payee Id', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Payee Id', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => $this->payee_id\n\t\t\t),\n\t\t\t'testmode' => array(\n\t\t\t\t'title' => __( 'Test Mode', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable PayEx Test Mode', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => $this->testmode\n\t\t\t),\n\t\t\t'debug' => array(\n\t\t\t\t'title' => __( 'Debug', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable logging', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => $this->debug\n\t\t\t),\n\t\t\t'culture' => array(\n\t\t\t\t'title' => __( 'Language', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'en-US' => 'English',\n\t\t\t\t\t'sv-SE' => 'Swedish',\n\t\t\t\t\t'nb-NO' => 'Norway',\n\t\t\t\t),\n\t\t\t\t'description' => __( 'Language of pages displayed by PayEx during payment.', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => $this->culture\n\t\t\t),\n\t\t\t'terms_url' => array(\n\t\t\t\t'title' => __( 'Terms & Conditions Url', 'payex-woocommerce-payments' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Terms & Conditions Url', 'payex-woocommerce-payments' ),\n\t\t\t\t'default' => get_site_url()\n\t\t\t),\n\t\t);\n\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 6,\n 'type' => 'select',\n 'required' => true,\n 'label' => $this->l('Weather provider'),\n 'desc' => $this->l('Select your preferred Weather provider'),\n 'name' => 'WI_WEATHER_PROVIDER',\n 'options' => array(\n 'query' => $this->getProvidersAsOptions(),\n 'id' => 'id',\n 'name' => 'name',\n ),\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'required' => true,\n 'label' => $this->l('Provider API key'),\n 'desc' => $this->l('Enter your provider API key. Must be obtained from your provider account.'),\n 'name' => 'WI_WEATHER_KEY',\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'label' => $this->l('City for testing'),\n 'desc' => $this->l('Enter a city, only for test purpose.'),\n 'name' => 'WI_WEATHER_CITY',\n ),\n array(\n 'col' => 6,\n 'type' => 'switch',\n 'label' => $this->l('Enabled'),\n 'name' => 'WI_WEATHER_ENABLED',\n 'desc' => $this->l('Enable the weather block in your home.'),\n 'values' => array(\n array('value' => 1, 'name' => $this->l('Yes')),\n array('value' => 0, 'name' => $this->l('No')),\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "protected static function get_typography_fields() {\n\t\treturn array(\n\t\t\t'font_family' => array(\n\t\t\t\t'name' => _x( 'Font family', 'theme-options', 'the7mk2' ),\n\t\t\t\t'type' => 'web_fonts',\n\t\t\t\t'std' => 'Open Sans',\n\t\t\t\t'fonts' => 'all',\n\t\t\t\t'class' => 'font-family',\n\t\t\t),\n\t\t\t'font_size' => array(\n\t\t\t\t'name' => _x( 'Font size', 'theme-options', 'the7mk2' ),\n\t\t\t\t'std' => 20,\n\t\t\t\t'type' => 'slider',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'min' => 1,\n\t\t\t\t\t'max' => 120,\n\t\t\t\t),\n\t\t\t\t'sanitize' => 'font_size',\n\t\t\t\t'class' => 'font-size',\n\t\t\t),\n\t\t\t'line_height' => array(\n\t\t\t\t'name' => _x( 'Line height', 'theme-options', 'the7mk2' ),\n\t\t\t\t'std' => 30,\n\t\t\t\t'type' => 'slider',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'min' => 1,\n\t\t\t\t\t'max' => 120,\n\t\t\t\t),\n\t\t\t\t'sanitize' => 'font_size',\n\t\t\t\t'class' => 'line-height',\n\t\t\t),\n\t\t\t'text_transform' => array(\n\t\t\t\t'name' => _x( 'Text transformation', 'theme-options', 'the7mk2' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'std' => 'none',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'none' => 'None',\n\t\t\t\t\t'uppercase' => 'Uppercase',\n\t\t\t\t\t'lowercase' => 'Lowercase',\n\t\t\t\t\t'capitalize' => 'Capitalize',\n\t\t\t\t),\n\t\t\t\t'class' => 'mini text-transform',\n\t\t\t),\n\t\t);\n\t}", "protected function getConfigForm()\n {\n // TODO : add default blog text per lang ?\n $employees = Employee::getEmployeesByProfile(\n 1,\n true\n );\n $default_snippet = array(\n array(\n 'snippet' => 'Article',\n 'name' => $this->l('Simple article')\n ),\n array(\n 'snippet' => 'NewsArticle',\n 'name' => $this->l('News article')\n ),\n );\n $layouts = array(\n array(\n 'layout' => 'layouts/layout-full-width.tpl',\n 'name' => $this->l('Full width')\n ),\n array(\n 'layout' => 'layouts/layout-left-column.tpl',\n 'name' => $this->l('Left column')\n ),\n array(\n 'layout' => 'layouts/layout-right-column.tpl',\n 'name' => $this->l('Right column')\n ),\n array(\n 'layout' => 'layouts/layout-both-columns.tpl',\n 'name' => $this->l('Both columns')\n ),\n );\n $trash_days = array(\n array(\n 'id_trash' => 0,\n 'name' => $this->l('Do not empty trash')\n ),\n array(\n 'id_trash' => 1,\n 'name' => $this->l('One day')\n ),\n array(\n 'id_trash' => 2,\n 'name' => $this->l('Two days')\n ),\n array(\n 'id_trash' => 3,\n 'name' => $this->l('Three days')\n ),\n array(\n 'id_trash' => 4,\n 'name' => $this->l('Four days')\n ),\n array(\n 'id_trash' => 5,\n 'name' => $this->l('Five days')\n ),\n array(\n 'id_trash' => 6,\n 'name' => $this->l('Six days')\n ),\n array(\n 'id_trash' => 7,\n 'name' => $this->l('One week')\n ),\n );\n $css_files = array(\n array(\n 'id_file' => 'default',\n 'name' => $this->l('default.css file')\n ),\n array(\n 'id_file' => 'red',\n 'name' => $this->l('red.css file')\n ),\n array(\n 'id_file' => 'green',\n 'name' => $this->l('green.css file')\n ),\n array(\n 'id_file' => 'yellow',\n 'name' => $this->l('yellow.css file')\n ),\n array(\n 'id_file' => 'white',\n 'name' => $this->l('white.css file')\n ),\n );\n $post_status = array(\n array(\n 'id_status' => 'draft',\n 'name' => $this->l('draft')\n ),\n array(\n 'id_status' => 'pending',\n 'name' => $this->l('pending')\n ),\n array(\n 'id_status' => 'published',\n 'name' => $this->l('published')\n ),\n array(\n 'id_status' => 'trash',\n 'name' => $this->l('trash')\n ),\n array(\n 'id_status' => 'planned',\n 'name' => $this->l('planned')\n ),\n );\n $form_fields = [];\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog default Settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->l('Blog base route'),\n 'name' => 'EVERPSBLOG_ROUTE',\n 'desc' => $this->l('Leaving empty will set \"blog\"'),\n 'hint' => $this->l('Use a keyword associated to your shop'),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post content excerpt'),\n 'name' => 'EVERPSBLOG_EXCERPT',\n 'desc' => $this->l('Post excerpt length for content on listing'),\n 'hint' => $this->l('Please set post content excerpt'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post title length'),\n 'name' => 'EVERPSBLOG_TITLE_LENGTH',\n 'desc' => $this->l('Post title length for content on listing'),\n 'hint' => $this->l('Please set post title length'),\n 'required' => true,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Extends TinyMCE on blog management ?'),\n 'desc' => $this->l('Set yes to extends TinyMCE on blog management pages'),\n 'hint' => $this->l('Else TinyMCE will be default'),\n 'required' => false,\n 'name' => 'EVERBLOG_TINYMCE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post views count ?'),\n 'desc' => $this->l('Set yes to show views count'),\n 'hint' => $this->l('Else will only be shown on admin'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_POST_COUNT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post on homepage ?'),\n 'desc' => $this->l('Set yes to show posts on homepage'),\n 'hint' => $this->l('Else posts won\\'t be shown on homepage'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_HOME',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for home'),\n 'name' => 'EVERPSBLOG_HOME_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for product'),\n 'name' => 'EVERPSBLOG_PRODUCT_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Posts per page'),\n 'name' => 'EVERPSBLOG_PAGINATION',\n 'desc' => $this->l('Leaving empty will set 10 posts per page'),\n 'hint' => $this->l('Will add pagination'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Admin email'),\n 'desc' => $this->l('Will receive new comments notification by email'),\n 'hint' => $this->l('You can set a new account on your shop'),\n 'required' => true,\n 'name' => 'EVERBLOG_ADMIN_EMAIL',\n 'options' => array(\n 'query' => $employees,\n 'id' => 'id_employee',\n 'name' => 'email'\n )\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow comments on posts ?'),\n 'desc' => $this->l('Set yes to allow comments'),\n 'hint' => $this->l('You can check them before publishing'),\n 'required' => false,\n 'name' => 'EVERBLOG_ALLOW_COMMENTS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Check comments on posts before they are published ?'),\n 'desc' => $this->l('Set yes to check comments before publishing'),\n 'hint' => $this->l('In order to avoid spam'),\n 'required' => false,\n 'name' => 'EVERBLOG_CHECK_COMMENTS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow only registered customers to comment ?'),\n 'desc' => $this->l('Set yes to allow only registered customers to comment'),\n 'hint' => $this->l('Else everyone will be able to comment'),\n 'required' => false,\n 'name' => 'EVERBLOG_ONLY_LOGGED_COMMENT',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Empty trash'),\n 'desc' => $this->l('Please choose auto empty trash in days'),\n 'hint' => $this->l('Will auto delete trashed posts on CRON task'),\n 'required' => true,\n 'name' => 'EVERBLOG_EMPTY_TRASH',\n 'options' => array(\n 'query' => $trash_days,\n 'id' => 'id_trash',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Default blog SEO title'),\n 'name' => 'EVERBLOG_TITLE',\n 'desc' => $this->l('Max 65 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog SEO meta description'),\n 'name' => 'EVERBLOG_META_DESC',\n 'desc' => $this->l('Max 165 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog type'),\n 'desc' => $this->l('Will be used for structured metadatas'),\n 'hint' => $this->l('Select blog type depending on your posts'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TYPE',\n 'options' => array(\n 'query' => $default_snippet,\n 'id' => 'snippet',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog top text'),\n 'name' => 'EVERBLOG_TOP_TEXT',\n 'desc' => $this->l('Will be shown on blog top default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog bottom text'),\n 'name' => 'EVERBLOG_BOTTOM_TEXT',\n 'desc' => $this->l('Will be shown on blog bottom default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Use RSS feed ?'),\n 'desc' => $this->l('Will add a link to RSS feed on blog and each tag, category, author'),\n 'hint' => $this->l('Else feed wont be used'),\n 'required' => false,\n 'name' => 'EVERBLOG_RSS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show author ?'),\n 'desc' => $this->l('Will show author name and avatar on posts'),\n 'hint' => $this->l('Else author name and avatar will be hidden'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_AUTHOR',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned users'),\n 'name' => 'EVERBLOG_BANNED_USERS',\n 'desc' => $this->l('Add banned users typing their emails, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned IP'),\n 'name' => 'EVERBLOG_BANNED_IP',\n 'desc' => $this->l('Add banned users typing their IP addresses, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show parent categories list on left/right columns ?'),\n 'desc' => $this->l('Set yes show a list of all parent categories on left or right columns'),\n 'hint' => $this->l('Will show ordered parent categories on left/right columns'),\n 'name' => 'EVERBLOG_CATEG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show tags list on left/right columns ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Set yes show a tags cloud on left or right columns'),\n 'required' => false,\n 'name' => 'EVERBLOG_TAG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show archives list on left/right columns ?'),\n 'desc' => $this->l('Set yes show links for monthly posts on left or right columns'),\n 'hint' => $this->l('Will show yearly and monthly posts'),\n 'required' => false,\n 'name' => 'EVERBLOG_ARCHIVE_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show related posts on products pages ?'),\n 'desc' => $this->l('Set yes show related posts on product pages footer'),\n 'hint' => $this->l('Will show related posts on product page footer'),\n 'required' => false,\n 'name' => 'EVERBLOG_RELATED_POST',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on categories ?'),\n 'desc' => $this->l('Set yes to show each category featured image'),\n 'hint' => $this->l('Else category featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_CAT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on tags ?'),\n 'desc' => $this->l('Set yes to show each tag featured image'),\n 'hint' => $this->l('Else tag featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_TAG',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Activate cool CSS animations ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Will add animations on posts, images, etc'),\n 'name' => 'EVERBLOG_ANIMATE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Fancybox'),\n 'hint' => $this->l('Set no if your theme already uses it'),\n 'desc' => $this->l('Use Fancybox for popups on post images'),\n 'name' => 'EVERBLOG_FANCYBOX',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Featured category on blog default page'),\n 'name' => 'EVERBLOG_CAT_FEATURED',\n 'desc' => $this->l('Featured category'),\n 'hint' => $this->l('Will show category products on blog page'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n ),\n 'buttons' => array(\n 'generateBlogSitemap' => array(\n 'name' => 'submitGenerateBlogSitemap',\n 'type' => 'submit',\n 'class' => 'btn btn-default pull-right',\n 'icon' => 'process-icon-refresh',\n 'title' => $this->l('Generate sitemaps')\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog layout settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog layout'),\n 'desc' => $this->l('Will add or remove columns from blog page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_BLOG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post layout'),\n 'desc' => $this->l('Will add or remove columns from post page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_POST_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default category layout'),\n 'desc' => $this->l('Will add or remove columns from category page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_CAT_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default author layout'),\n 'desc' => $this->l('Will add or remove columns from author page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_AUTHOR_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default tag layout'),\n 'desc' => $this->l('Will add or remove columns from tag page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TAG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('WordPress XML import settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post state on XML import'),\n 'desc' => $this->l('Will set default post state on XML import'),\n 'hint' => $this->l('Please select default post state on XML file import'),\n 'required' => true,\n 'name' => 'EVERBLOG_IMPORT_POST_STATE',\n 'options' => array(\n 'query' => $post_status,\n 'id' => 'id_status',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress authors'),\n 'hint' => $this->l('Else no authors will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress categories'),\n 'hint' => $this->l('Else no categories will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress tags'),\n 'hint' => $this->l('Else no tags will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress authors'),\n 'hint' => $this->l('Else no authors will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress categories'),\n 'hint' => $this->l('Else no categories will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress tags'),\n 'hint' => $this->l('Else no tags will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'file',\n 'label' => $this->l('Import WordPress XML file'),\n 'desc' => $this->l('Import WordPress XML posts file'),\n 'hint' => $this->l('Will import posts from WordPress XML file'),\n 'name' => 'wordpress_xml',\n 'required' => false\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save and import'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Design settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Custom CSS file'),\n 'desc' => $this->l('You can change here default CSS file'),\n 'hint' => $this->l('By changing CSS file, you will change blog colors'),\n 'required' => true,\n 'name' => 'EVERBLOG_CSS_FILE',\n 'options' => array(\n 'query' => $css_files,\n 'id' => 'id_file',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Custom CSS for blog'),\n 'desc' => $this->l('Add here your custom CSS rules'),\n 'hint' => $this->l('Webdesigners here can manage CSS rules for blog'),\n 'name' => 'EVERBLOG_CSS',\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n return $form_fields;\n }", "public function getConfigForm()\r\n {\r\n $form = parent::getConfigForm();\r\n $form->addElementPath(dirname(__FILE__) . '/fields');\r\n return $form;\r\n }", "private function _get_general_section_settings() {\r\n\r\n global $WWOF_SETTINGS_SORT_BY, $WWOF_SETTINGS_DEFAULT_PPP;\r\n\r\n return array(\r\n\r\n array(\r\n 'title' => __( 'General Options', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'title',\r\n 'desc' => '',\r\n 'id' => 'wwof_general_main_title'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Use Alternate View Of Wholesale Page?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Checkbox on the right side of each product, and add to cart button at the bottom of the list' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_use_alternate_view_of_wholesale_page'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Disable Pagination?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Shows all products by lazy loading them in when the user scrolls down. The form will load in groups of products based on the number specified in the Products Per Page setting.' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_disable_pagination'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Products Per Page' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'number',\r\n 'desc_tip' => sprintf( __( 'Number of products to display per page (for pagination) or how many products to load at a time (for lazy loading). Default is 12 products when left empty.' , 'woocommerce-wholesale-order-form' ) , $WWOF_SETTINGS_DEFAULT_PPP ),\r\n 'id' => 'wwof_general_products_per_page',\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show In Stock Quantity?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we display product stock quantity on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_show_product_stock_quantity'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show Product SKU?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we display product sku on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_show_product_sku'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Allow Product SKU Search?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we allow searching for products via sku on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_allow_product_sku_search'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show Product Thumbnail?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we display a small product thumbnail on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_show_product_thumbnail'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Product Thumbnail Size', 'woocommerce-wholesale-order-form' ),\r\n 'desc' => __( 'This size is used in wholesale product listings', 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_product_thumbnail_image_size',\r\n 'css' => '',\r\n 'type' => 'wwof_image_dimension',\r\n 'default' => array(\r\n 'width' => '48',\r\n 'height' => '48'\r\n ),\r\n 'desc_tip' => true,\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Display the product details in a lightbox popup on click?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( \"Should the product details be displayed in a popup or redirect the user to the product's page?\" , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_display_product_details_on_popup'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Display Zero Inventory Products?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Zero inventory products are products that are out of inventory and do not allow backorders. This also includes non simple products whose composition requires a certain products that have zero inventory.' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_display_zero_products'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Hide wholesale quantity discount prices.' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => sprintf( __( 'Hides the small table printed under the wholesale price when quantity based discounts are available for that product. Only used when <a href=\"%1$s\" target=\"blank\">WooCommerce Wholesale Prices Premium</a> is active.' , 'woocommerce-wholesale-order-form' ) , 'https://wholesalesuiteplugin.com/product/woocommerce-wholesale-prices-premium/' ),\r\n 'id' => 'wwof_general_hide_quantity_discounts'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Sort By' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => '',\r\n 'id' => 'wwof_general_sort_by',\r\n 'class' => 'chosen_select',\r\n 'options' => $WWOF_SETTINGS_SORT_BY\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Sort Order' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => '',\r\n 'id' => 'wwof_general_sort_order',\r\n 'class' => 'chosen_select',\r\n 'options' => array(\r\n 'asc' => __( 'Ascending' , 'woocommerce-wholesale-order-form' ),\r\n 'desc' => __( 'Descending' , 'woocommerce-wholesale-order-form' )\r\n )\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Display Cart Subtotal?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Display cart subtotal at the bottom of the order form' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_display_cart_subtotal'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Cart Sub Total Prices Display' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => __( 'Either to include or exclude price on sub total. Only used if \"Display Cart Sub Total\" option above is enabled.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_general_cart_subtotal_prices_display',\r\n 'class' => 'chosen_select',\r\n 'options' => array (\r\n 'incl' => __( 'Including tax' , 'woocommerce-wholesale-order-form' ),\r\n 'excl' => __( 'Excluding tax' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'default' => 'incl'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'List product variation individually' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Enabling this setting will list down each product variation individually and have its own row in the wholesale order form.' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_list_product_variation_individually',\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show Wholesale Order Requirements Message in Order Form' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => __( 'Only works if there are Order Requirements set in WooCommerce Wholesale Prices Premium plugin settings.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_display_wholesale_price_requirement',\r\n 'class' => 'chosen_select',\r\n 'options' => array (\r\n 'yes' => __( 'Yes' , 'woocommerce-wholesale-order-form' ),\r\n 'no' => __( 'No' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'default' => 'yes'\r\n ),\r\n \r\n array(\r\n 'type' => 'sectionend',\r\n 'id' => 'wwof_general_sectionend'\r\n )\r\n\r\n );\r\n\r\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-user\"></i>',\n 'desc' => $this->l('Ingrese la llave pública'),\n 'name' => 'KUSHKIPAGOS_PUBLIC_KEY',\n 'label' => $this->l('Public key'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-user-secret\"></i>',\n 'desc' => $this->l('Ingrese la llave privada'),\n 'name' => 'KUSHKIPAGOS_PRIVATE_KEY',\n 'label' => $this->l('Private key'),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Entorno de pruebas'),\n 'name' => 'KUSHKIPAGOS_DEV',\n 'is_bool' => true,\n 'desc' => $this->l('Usar este módulo en entorno de pruebas'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n )\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function fields() {\n return array(\n 'title' => 'The title of the content',\n 'fieldname' => t('fieldname'),\n 'title' => t('title'),\n 'label' => t('Label'),\n 'data_type' => t('data type'),\n 'html_type' => t('html_type'),\n );\n }", "private function settings_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Global Settings', 'formidable' ) . '</h3>'\n\t\t\t\t. '<p><strong>' . __( 'General', 'formidable' ) . '</strong><br/>'\n\t\t\t\t. __( 'Turn stylesheets and scripts off, set which user roles have access to change and create forms, setup your reCaptcha, and set default messages for new forms and fields.', 'formidable' )\n\t\t\t\t. '<p><strong>' . __( 'Plugin Licenses', 'formidable' ) . '</strong><br/>'\n\t\t\t\t. sprintf( __( 'Once you&#8217;ve purchased %1$s or any addons, you&#8217;ll have to enter a license key to get access to all of their powerful features. A Plugin Licenses tab will appear here for you to enter your license key.', 'formidable' ), 'Formidable Pro' )\n \t . '</p>',\n\t\t\t'prev_page' => 'import',\n\t\t\t'next_page' => 'addons',\n\t\t);\n\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'b2binpay-warning',\n 'name' => 'B2BINPAY_WARNING',\n ),\n array(\n 'col' => 2,\n 'type' => 'text',\n 'name' => 'B2BINPAY_TITLE',\n 'label' => $this->l('Title'),\n 'desc' => $this->l('The payment method title which a customer sees at the checkout'),\n 'required' => true,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Test Mode (Sandbox)'),\n 'name' => 'B2BINPAY_TEST_MODE',\n 'is_bool' => true,\n 'desc' => $this->l(\n 'Use this module in test mode. Warning: Sandbox and main gateway has their own credentials!'\n ),\n 'required' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled'),\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled'),\n ),\n ),\n ),\n array(\n 'col' => 2,\n 'type' => 'text',\n 'name' => 'B2BINPAY_AUTH_KEY',\n 'label' => $this->l('Auth Key'),\n 'desc' => $this->l('B2BinPay API Auth Key'),\n 'required' => true,\n ),\n array(\n 'col' => 2,\n 'type' => 'text',\n 'name' => 'B2BINPAY_AUTH_SECRET',\n 'label' => $this->l('Auth Secret'),\n 'desc' => $this->l('B2BinPay API Auth Secret'),\n 'required' => true,\n ),\n array(\n 'type' => 'b2binpay-wallets',\n 'name' => 'B2BINPAY_WALLETS',\n 'label' => $this->l('Wallets'),\n 'required' => true,\n ),\n array(\n 'col' => 2,\n 'type' => 'text',\n 'name' => 'B2BINPAY_MARKUP',\n 'label' => $this->l('Markup (%)'),\n 'desc' => $this->l('Markup percentage for each payment'),\n ),\n array(\n 'col' => 2,\n 'type' => 'text',\n 'name' => 'B2BINPAY_LIFETIME',\n 'label' => $this->l('Order lifetime (seconds)'),\n 'desc' => $this->l('Lifetime for your orders in seconds'),\n 'required' => true,\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "private function _settings() \n\t{\n\t\t\t$settings[$this->sn_prefix.\"_jpg\"] = array('template_name'\t=> 'Image: JPG',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_file_ext' => '.jpg',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_headers' => array('Content-Type: image/jpg')\n\t\t\t\t\t\t\t \t\t \t\t\t\t );\n\t\t\t$settings[$this->sn_prefix.\"_gif\"] = array('template_name'\t=> 'Image: GIF',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_file_ext' => '.gif',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_headers' => array('Content-Type: image/gif')\n\t\t\t\t\t\t\t \t\t \t\t\t\t );\n\t\t\t$settings[$this->sn_prefix.\"_png\"] = array('template_name'\t=> 'Image: PNG',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_file_ext' => '.png',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_headers' => array('Content-Type: image/png')\n\t\t\t\t\t\t\t \t\t \t\t\t\t );\n\t\t\t$settings[$this->sn_prefix.\"_swf\"] = array('template_name'\t=> 'Image: SWF',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_file_ext' => '.swf',\n\t\t\t\t\t\t\t \t\t \t\t\t\t 'template_headers' => array('Content-Type: application/x-shockwave-flash')\n\t\t\t\t\t\t\t \t\t \t\t\t\t );\n\t\treturn($settings);\t\n\t}", "function template_options()\n{\n\tglobal $context, $settings, $options, $scripturl, $txt;\n\n\t$context['theme_options'] = array(\n\t\tarray(\n\t\t\t'id' => 'show_board_desc',\n\t\t\t'label' => $txt['board_desc_inside'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_children',\n\t\t\t'label' => $txt['show_children'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'use_sidebar_menu',\n\t\t\t'label' => $txt['use_sidebar_menu'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_avatars',\n\t\t\t'label' => $txt['show_no_avatars'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_signatures',\n\t\t\t'label' => $txt['show_no_signatures'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_censored',\n\t\t\t'label' => $txt['show_no_censored'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'return_to_post',\n\t\t\t'label' => $txt['return_to_post'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'no_new_reply_warning',\n\t\t\t'label' => $txt['no_new_reply_warning'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_first',\n\t\t\t'label' => $txt['recent_posts_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_pm_first',\n\t\t\t'label' => $txt['recent_pms_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'posts_apply_ignore_list',\n\t\t\t'label' => $txt['posts_apply_ignore_list'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'wysiwyg_default',\n\t\t\t'label' => $txt['wysiwyg_default'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'popup_messages',\n\t\t\t'label' => $txt['popup_messages'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'copy_to_outbox',\n\t\t\t'label' => $txt['copy_to_outbox'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'pm_remove_inbox_label',\n\t\t\t'label' => $txt['pm_remove_inbox_label'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'auto_notify',\n\t\t\t'label' => $txt['auto_notify'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'topics_per_page',\n\t\t\t'label' => $txt['topics_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'messages_per_page',\n\t\t\t'label' => $txt['messages_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'calendar_start_day',\n\t\t\t'label' => $txt['calendar_start_day'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['days'][0],\n\t\t\t\t1 => $txt['days'][1],\n\t\t\t\t6 => $txt['days'][6],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_reply',\n\t\t\t'label' => $txt['display_quick_reply'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_reply1'],\n\t\t\t\t1 => $txt['display_quick_reply2'],\n\t\t\t\t2 => $txt['display_quick_reply3']\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_mod',\n\t\t\t'label' => $txt['display_quick_mod'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_mod_none'],\n\t\t\t\t1 => $txt['display_quick_mod_check'],\n\t\t\t\t2 => $txt['display_quick_mod_image'],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t);\n}", "protected function getTypeFieldConfig()\n {\n return [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'groupsConfig' => [\n 'filewithattachment' => [\n 'values' => ['filewithattachment'],\n 'indexes' => [\n CustomOptions::CONTAINER_TYPE_STATIC_NAME,\n self::FIELD_ATTACHMENT_INFO_NAME,\n self::FIELD_ATTACHMENT_LABEL_NAME,\n self::FIELD_ATTACHMENT_PATH_NAME,\n \\Magento\\Catalog\\Ui\\DataProvider\\Product\\Form\\Modifier\\CustomOptions::FIELD_FILE_EXTENSION_NAME\n ]\n ]\n ],\n ],\n ],\n ],\n ];\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer name'),\n 'name' => 'MF_TITLE',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Show manufacturer description'),\n 'name' => 'MF_DESCRIPTION',\n 'label' => $this->l('Provide a description for the heading'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('Number of manufacturers to display (Enter 0 to display all)'),\n 'name' => 'MF_MAN_NUMBER',\n 'label' => $this->l('Number of Manufacturers'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on desktops'),\n 'name' => 'MF_PER_ROW_DESKTOP',\n 'label' => $this->l('Logo\\'s per row (Desktop)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on tablets'),\n 'name' => 'MF_PER_ROW_TABLET',\n 'label' => $this->l('Logo\\'s per row (Tablet)'),\n 'required' => true,\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'desc' => $this->l('How many logo\\'s should be visible on mobiles'),\n 'name' => 'MF_PER_ROW_MOBILE',\n 'label' => $this->l('Logo\\'s per row (Mobile)'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'desc' => 'How the logo\\'s should be sorted',\n 'name' => 'MF_MAN_ORDER',\n 'label' => $this->l('Order by'),\n 'options' => array(\n 'query' => array(\n array(\n 'id_option' => 'name_asc',\n 'name' => $this->l('Name ASC'),\n ),\n array(\n 'id_option' => 'name_desc',\n 'name' => $this->l('Name DESC'),\n ),\n array(\n 'id_option' => 'manu_asc',\n 'name' => $this->l('Manufacturer ID ASC'),\n ),\n array(\n 'id_option' => 'manu_desc',\n 'name' => $this->l('Manufacturer ID DESC'),\n ),\n ),\n 'id' => 'id_option',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Manufacturers Name'),\n 'name' => 'MF_SHOW_MAN_NAME',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes'),\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No'),\n )\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "private function _fieldSettings($settings)\n {\n $settings = array_merge([\n 'toolset_id' => ee()->config->item('rte_default_toolset'),\n 'defer' => 'n'\n ], $settings);\n\n // load the language file\n ee()->lang->loadfile('rte');\n\n $configModels = ee('Model')->get('rte:Toolset')->all(true);\n $configOptions = array();\n foreach ($configModels as $model) {\n $configOptions[$model->toolset_id] = $model->toolset_name;\n }\n\n if (!empty($configOptions)) {\n $configFields = array(\n 'rte[toolset_id]' => array(\n 'type' => 'select',\n 'choices' => $configOptions,\n 'value' => $settings['toolset_id']\n ),\n array(\n 'type' => 'html',\n 'content' => '(<a href=\"' . ee('CP/URL')->make('addons/settings/rte')->compile() . '\">' . lang('rte_edit_configs') . '</a>)'\n )\n );\n } else {\n $configFields = array(\n array(\n 'type' => 'html',\n 'content' => '<a href=\"' . ee('CP/URL')->make('addons/settings/rte/edit_toolset')->compile() . '\">' . lang('rte_create_config') . '</a>'\n )\n );\n }\n\n $settings = array(\n array(\n 'title' => lang('rte_editor_config'),\n 'fields' => $configFields\n ),\n array(\n 'title' => lang('rte_defer'),\n 'fields' => array(\n 'rte[defer]' => array(\n 'type' => 'yes_no',\n 'value' => (isset($settings['defer']) && $settings['defer'] == 'y') ? 'y' : 'n'\n )\n )\n ),\n array(\n 'title' => 'db_column_type',\n 'desc' => 'db_column_type_desc',\n 'fields' => array(\n 'rte[db_column_type]' => array(\n 'type' => 'radio',\n 'choices' => [\n 'text' => lang('TEXT'),\n 'mediumtext' => lang('MEDIUMTEXT')\n ],\n 'value' => isset($settings['db_column_type']) ? $settings['db_column_type'] : 'text'\n )\n )\n )\n );\n\n return $settings;\n }", "function create_extra_profile_fields() {\n\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'About you', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'type' => 'section'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'City', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'id' => 'city',\n\t\t\t\t'type' => 'text'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'Mobile Phone', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'id' => 'mobile',\n\t\t\t\t'type' => 'text'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'Date of Birth', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'id' => 'birthday',\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray (\n\t\t\t\t'label'\t=> _x( 'Shirt Size', 'Team Profile Form', 'h3-mgmt' ),\n\t\t\t\t'id'\t=> 'shirt_size',\n\t\t\t\t'type'\t=> 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t0 => array(\n\t\t\t\t\t\t'value' => 0,\n\t\t\t\t\t\t'label' => _x( 'Please select your size...', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'ms',\n\t\t\t\t\t\t'label' => _x( \"Unisex S\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'mm',\n\t\t\t\t\t\t'label' => _x( \"Unisex M\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'ml',\n\t\t\t\t\t\t'label' => _x( \"Unisex L\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'mx',\n\t\t\t\t\t\t'label' => _x( \"Unisex XL\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'gs',\n\t\t\t\t\t\t'label' => _x( 'Slimfit S', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'gm',\n\t\t\t\t\t\t'label' => _x( 'Slimfit M', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'gl',\n\t\t\t\t\t\t'label' => _x( 'Slimfit L', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray (\n\t\t\t\t'label'\t=> _x( 'Could we give our partner Ortel Mobile your personal Information?', 'Team Profile Form', 'h3-mgmt' ),\n\t\t\t\t'id'\t=> 'public_mobile_inf',\n\t\t\t\t'type'\t=> 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t0 => array(\n\t\t\t\t\t\t'value' => 0,\n\t\t\t\t\t\t'label' => _x( 'Please select if it is ok or not...', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'yes',\n\t\t\t\t\t\t'label' => _x( \"YES, give them my personal information\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'no',\n\t\t\t\t\t\t'label' => _x( \"Please not (So you do not get your sponsored sim-card\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t)\t\t\t\t\t\n\t\t\t\t)\n ),\n\t\t\tarray (\n\t\t\t\t'label'\t=> _x( 'Address for Ortel', 'Team Profile Form', 'h3-mgmt' ),\n 'id'\t=> 'addressMobile',\n\t\t\t\t'type'\t=> 'textarea'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'Avatar', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'type' => 'section',\n\t\t\t\t'admin_hide' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'avatar',\n\t\t\t\t'id' => 'simple-local-avatar',\n\t\t\t\t'admin_hide' => true\n\t\t\t)\n\t\t);\n\t\treturn $fields;\n\t}", "public function getSettingsHtml()\n\t{\n\t\t$columns = $this->getSettings()->columns;\n\t\t$defaults = $this->getSettings()->defaults;\n\n\t\tif (!$columns)\n\t\t{\n\t\t\t$columns = array('col1' => array('heading' => '', 'handle' => '', 'type' => 'singleline'));\n\n\t\t\t// Update the actual settings model for getInputHtml()\n\t\t\t$this->getSettings()->columns = $columns;\n\t\t}\n\n\t\tif ($defaults === null)\n\t\t{\n\t\t\t$defaults = array('row1' => array());\n\t\t}\n\n\t\t$columnSettings = array(\n\t\t\t'heading' => array(\n\t\t\t\t'heading' => Craft::t('Column Heading'),\n\t\t\t\t'type' => 'singleline',\n\t\t\t\t'autopopulate' => 'handle'\n\t\t\t),\n\t\t\t'handle' => array(\n\t\t\t\t'heading' => Craft::t('Handle'),\n\t\t\t\t'class' => 'code',\n\t\t\t\t'type' => 'singleline'\n\t\t\t),\n\t\t\t'width' => array(\n\t\t\t\t'heading' => Craft::t('Width'),\n\t\t\t\t'class' => 'code',\n\t\t\t\t'type' => 'singleline',\n\t\t\t\t'width' => 50\n\t\t\t),\n\t\t\t'type' => array(\n\t\t\t\t'heading' => Craft::t('Type'),\n\t\t\t\t'class' => 'thin',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'datetime' => Craft::t('Date/Time'),\n\t\t\t\t\t'date' => Craft::t('Date'),\n\t\t\t\t\t'time' => Craft::t('Time'),\n\t\t\t\t\t'singleline' => Craft::t('Single-line Text'),\n\t\t\t\t\t'multiline' => Craft::t('Multi-line text'),\n\t\t\t\t\t'number' => Craft::t('Number'),\n\t\t\t\t\t'checkbox' => Craft::t('Checkbox'),\n\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\n\t\tcraft()->templates->includeJsResource('js/TableFieldSettings.js');\n\t\tcraft()->templates->includeJs('new Craft.TableFieldSettings(' .\n\t\t\t'\"'.craft()->templates->namespaceInputName('columns').'\", ' .\n\t\t\t'\"'.craft()->templates->namespaceInputName('defaults').'\", ' .\n\t\t\tJsonHelper::encode($columns).', ' .\n\t\t\tJsonHelper::encode($defaults).', ' .\n\t\t\tJsonHelper::encode($columnSettings) .\n\t\t');');\n\n\t\t$columnsField = craft()->templates->renderMacro('_includes/forms', 'editableTableField', array(\n\t\t\tarray(\n\t\t\t\t'label' => Craft::t('Table Columns'),\n\t\t\t\t'instructions' => Craft::t('Define the columns your table should have.'),\n\t\t\t\t'id' => 'columns',\n\t\t\t\t'name' => 'columns',\n\t\t\t\t'cols' => $columnSettings,\n\t\t\t\t'rows' => $columns,\n\t\t\t\t'addRowLabel' => Craft::t('Add a column'),\n\t\t\t\t'initJs' => false\n\t\t\t)\n\t\t));\n\n\t\t$defaultsField = craft()->templates->renderMacro('_includes/forms', 'editableTableField', array(\n\t\t\tarray(\n\t\t\t\t'label' => Craft::t('Default Values'),\n\t\t\t\t'instructions' => Craft::t('Define the default values for the field.'),\n\t\t\t\t'id' => 'defaults',\n\t\t\t\t'name' => 'defaults',\n\t\t\t\t'cols' => $columns,\n\t\t\t\t'rows' => $defaults,\n\t\t\t\t'initJs' => false\n\t\t\t)\n\t\t));\n\n\t\treturn $columnsField.$defaultsField;\n\t}", "function buildSettingsForm() {\n $form = parent::buildSettingsForm();\n\n $form['entity:file']['show_scheme'] = array(\n '#title' => t('Show file scheme'),\n '#type' => 'checkbox',\n '#default_value' => isset($this->conf['show_scheme']) ? $this->conf['show_scheme'] : array()\n );\n\n $form['entity:file']['group_by_scheme'] = array(\n '#title' => t('Group files by scheme'),\n '#type' => 'checkbox',\n '#default_value' => isset($this->conf['group_by_scheme']) ? $this->conf['group_by_scheme'] : array(),\n );\n\n $image_extra_info_options = array(\n 'thumbnail' => t('Show thumbnails <em>(using the image style !linkit_thumb_link)</em>', array('!linkit_thumb_link' => l('linkit_thumb', 'admin/config/media/image-styles/edit/linkit_thumb'))),\n 'dimensions' => t('Show pixel dimensions'),\n );\n\n $form['entity:file']['image_extra_info'] = array(\n '#title' => t('Images'),\n '#type' => 'checkboxes',\n '#options' => $image_extra_info_options,\n '#default_value' => isset($this->conf['image_extra_info']) ? $this->conf['image_extra_info'] : array('thumbnail', 'dimensions'),\n );\n\n return $form;\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'col' => 6,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-key\"></i>',\n 'desc' => $this->l('Ingrese un token de empresa - Vea la documentación'),\n 'name' => 'APISFACT_PRESTASHOP_TOKEN',\n 'label' => $this->l('Token'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle text-success\"></i>',\n 'desc' => $this->l('Ingrese la serie para las facturas'),\n 'name' => 'APISFACT_PRESTASHOP_SERIEF',\n 'label' => $this->l('Serie Factura'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle text-success\"></i>',\n 'desc' => $this->l('Ingrese el número inicial para las facturas'),\n 'name' => 'APISFACT_PRESTASHOP_NUMEROF',\n 'label' => $this->l('Numero de Factura'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle\"></i>',\n 'desc' => $this->l('Ingrese la serie para las boletas'),\n 'name' => 'APISFACT_PRESTASHOP_SERIEB',\n 'label' => $this->l('Serie Boleta'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-circle\"></i>',\n 'desc' => $this->l('Ingrese el número inicial para las boletas'),\n 'name' => 'APISFACT_PRESTASHOP_NUMEROB',\n 'label' => $this->l('Numero de Boleta'),\n )\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public static function setTemplateData()\n\t{\n\n\t\tself::$templateData = array();\n\n\t\t// Request values\n\t\tself::$templateData['get'] = $_GET;\n\t\tself::$templateData['post'] = $_POST;\n\n\t\t// Config values\n self::$templateData['config'] = array();\n foreach( get_class_vars( 'Kiki\\Config' ) as $configKey => $configValue )\n {\n\t\t\t// Lame security check, but better safe than sorry until a proper\n\t\t\t// audit has been done that in no way unauthorised user content get\n\t\t\t// parsed as template itself, through parsing recursion or otherwise. \n\t\t\t// Should mostly be careful about direct assignment of any of it to\n\t\t\t// 'content'.\n if ( !preg_match( '~(^db|pass|secret)~i', $configKey ) )\n self::$templateData['config'][$configKey] = $configValue;\n }\n\n if ( Config::$customCss )\n self::$templateData['stylesheets'] = array( Config::$customCss );\n\n\t\t// Is that all we want?\n self::$templateData['server'] = array(\n 'host' => $_SERVER['HTTP_HOST'] ?? null,\n 'name' => $_SERVER['SERVER_NAME'] ?? null,\n 'requestUri' => $_SERVER['REQUEST_URI'] ?? null,\n );\n\n self::$templateData['user'] = self::$user ? self::$user->templateData() : null;\n\n\t\t// Account service(s). Although multiple routing entries are technically\n\t\t// possible, templateData currently only populates one: the first found or else\n\t\t// the internal fallback in the Kiki controller.\n\t\t// FIXME: disabled for now, this shouldn't be db-populated anyway\n\t\t// $accountServices = array_values( Router::getBaseUris('account') );\n\t\t$baseUri = isset($accountServices[0]) ? $accountServices[0]->base_uri : Config::$kikiPrefix. \"/account\";\n\t\t$title = isset($accountServices[0]) ? $accountServices[0]->title : _(\"Account\");\n\t\tself::$templateData['accountService'] = array( 'url' => $baseUri, 'title' => $title );\n\t\t\n\t\t// Active connections. Only typing laziness explains why this isn't simply in {$user.connections}.\n self::$templateData['activeConnections'] = array();\n\n $connectedServices = array();\n if ( self::$user )\n {\n foreach( self::$user->connections() as $connection )\n {\n self::$templateData['activeConnections'][] = array(\n 'serviceName' => $connection->serviceName(),\n 'screenName' => $connection->screenName(),\n 'userName' => $connection->name(),\n 'pictureUrl' => $connection->picture()\n );\n\n $connectedServices[] = $connection->serviceName();\n }\n }\n\n // Log::debug( \"user cons: \". print_r(self::$user->connections(),true) );\n\n // Inactive connections. Might as well be in {$user) as well,\n // potentially in {$user.connections} with an {active} switch, although\n // the separation at this level is not the worst.\n\n // Log::debug( \"config: \". print_r(Config::$connectionServices, true) );\n // Log::debug( \"connected: \". print_r($connectedServices,true) );\n\n foreach( Config::$connectionServices as $name )\n {\n if ( !in_array( $name, $connectedServices ) )\n {\n $connection = ConnectionService\\Factory::getInstance($name);\n self::$templateData['inactiveConnections'][] = array( 'serviceName' => $connection->name(), 'loginUrl' => $connection->loginUrl() );\n }\n }\n\n // @todo Allow starttime and execution time from Log(::init) to be\n // queried and assign them. Just in case someone wants to output it in\n // a template.\n\n self::$templateData['now'] = time();\n }", "protected function getConfigContainer1Extra()\n {\n $tpl = $this->initSmartyTemplate('providers/Jira/templates');\n\n $tpl->assign(\"centreon_open_tickets_path\", $this->centreon_open_tickets_path);\n $tpl->assign(\"img_brick\", \"./modules/centreon-open-tickets/images/brick.png\");\n $tpl->assign(\"header\", array(\"jira\" => _(\"Jira\")));\n\n // Form\n $address_html = '<input size=\"50\" name=\"address\" type=\"text\" value=\"' .\n $this->getFormValue('address') . '\" />';\n $rest_api_resource_html = '<input size=\"50\" name=\"rest_api_resource\" type=\"text\" value=\"' .\n $this->getFormValue('rest_api_resource') . '\" />';\n $username_html = '<input size=\"50\" name=\"username\" type=\"text\" value=\"' .\n $this->getFormValue('username') . '\" />';\n $user_token_html = '<input size=\"50\" name=\"user_token\" type=\"password\" value=\"' .\n $this->getFormValue('user_token') . '\" autocomplete=\"off\" />';\n $timeout_html = '<input size=\"2\" name=\"timeout\" type=\"text\" value=\"' .\n $this->getFormValue('timeout') . '\" />';\n\n $array_form = array(\n 'address' => array(\n 'label' => _(\"Address\") . $this->required_field,\n 'html' => $address_html\n ),\n 'rest_api_resource' => array(\n 'label' => _(\"Rest Api Resource\") . $this->required_field,\n 'html' => $rest_api_resource_html\n ),\n 'username' => array(\n 'label' => _(\"Username\") . $this->required_field,\n 'html' => $username_html\n ),\n 'user_token' => array(\n 'label' => _(\"User Token\") . $this->required_field,\n 'html' => $user_token_html\n ),\n 'timeout' => array('label' => _(\"Timeout\"), 'html' => $timeout_html),\n 'mappingticket' => array('label' => _(\"Mapping ticket arguments\")),\n );\n\n // mapping Ticket clone\n $mappingTicketValue_html = '<input id=\"mappingTicketValue_#index#\" name=\"mappingTicketValue[#index#]\" ' .\n 'size=\"20\" type=\"text\" />';\n $mappingTicketArg_html = '<select id=\"mappingTicketArg_#index#\" name=\"mappingTicketArg[#index#]\" ' .\n 'type=\"select-one\">' .\n '<option value=\"' . self::ARG_PROJECT . '\">' . _('Project') . '</options>' .\n '<option value=\"' . self::ARG_SUMMARY . '\">' . _('Summary') . '</options>' .\n '<option value=\"' . self::ARG_DESCRIPTION . '\">' . _('Description') . '</options>' .\n '<option value=\"' . self::ARG_ASSIGNEE . '\">' . _('Assignee') . '</options>' .\n '<option value=\"' . self::ARG_PRIORITY . '\">' . _('Priority') . '</options>' .\n '<option value=\"' . self::ARG_ISSUETYPE . '\">' . _('Issue Type') . '</options>' .\n '</select>';\n $array_form['mappingTicket'] = array(\n array('label' => _(\"Argument\"), 'html' => $mappingTicketArg_html),\n array('label' => _(\"Value\"), 'html' => $mappingTicketValue_html),\n );\n\n $tpl->assign('form', $array_form);\n\n $this->config['container1_html'] .= $tpl->fetch('conf_container1extra.ihtml');\n\n $this->config['clones']['mappingTicket'] = $this->getCloneValue('mappingTicket');\n }", "function getSubFields( $options = true ) {\n\n\treturn [\n\t\t$options ? [\n\t\t\t'label' => 'General',\n\t\t\t'name' => 'generalTab',\n\t\t\t'type' => 'tab',\n\t\t\t'placement' => 'top',\n\t\t\t'endpoint' => 0,\n\t\t] : [],\n\t\t$options ? [\n\t\t\t'label' => '',\n\t\t\t'name' => 'info',\n\t\t\t'type' => 'message',\n\t\t\t'instructions' => '',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => \n\t\t\t[\n\t\t\t 'width' => '',\n\t\t\t 'class' => '',\n\t\t\t 'id' => '',\n\t\t\t],\n\t\t\t'message' => 'Nessuna impostazione necessaria. <br>Il blocco stampa un form di iscrizione newsletter (servizio mailchimp) con nome, cognome ed email',\n\t\t\t'new_lines' => 'wpautop',\n\t\t\t'esc_html' => 0,\n\t\t] : [],\n\t\t$options ? [\n\t\t\t'label' => 'Options',\n\t\t\t'name' => 'optionsTab',\n\t\t\t'type' => 'tab',\n\t\t\t'placement' => 'top',\n\t\t\t'endpoint' => 0\n\t\t] : [],\n\t\t$options ? [\n\t\t\t'label' => '',\n\t\t\t'name' => 'options',\n\t\t\t'type' => 'group',\n\t\t\t'layout' => 'row',\n\t\t\t'sub_fields' => [\n\t\t\t\tFieldVariables\\getSectionId(),\n\t\t\t\tFieldVariables\\getSectionClasses(),\n\t\t\t\tFieldVariables\\getContainer(),\n\t\t\t\tFieldVariables\\getRow(),\n\t\t\t\tFieldVariables\\getColsClasses(),\n\t\t\t\tFieldVariables\\getItemClasses(),\n\t\t\t]\n\t\t] : [],\n\t];\n}", "protected function getFields() {\n return $this->getConfiguration()['settings']['fields'];\n }", "public function init_form_fields() {\n\n $gatewayids = $this->get_gatewayids();\n $this->form_fields = apply_filters( 'wc_fabric_form_fields', array(\n 'enabled' => array(\n 'title' => 'Enable/Disable',\n 'type' => 'checkbox',\n 'label' => 'Enable PayFabric',\n 'default' => 'yes',\n ),\n 'title' => array(\n 'title' => 'Title',\n 'type' => 'text',\n 'description' => '',\n 'default' => 'PayFabric',\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => 'Description',\n 'type' => 'textarea',\n 'description' => '',\n 'default' => 'Description here',\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => 'Instructions',\n 'type' => 'textarea',\n 'description' => '',\n 'default' => 'Instructions here',\n 'desc_tip' => true,\n ),\n 'deviceId' => array(\n 'title' => 'Device ID',\n 'type' => 'text',\n 'description' => '',\n 'default' => '',\n 'desc_tip' => true,\n ),\n 'password' => array(\n 'title' => 'Device Password',\n 'type' => 'password',\n 'description' => '',\n 'default' => '',\n 'desc_tip' => true,\n ),\n 'gatewayid' => array(\n 'title' => 'Gateway Account Name',\n 'type' => 'select',\n 'description' => 'Required set Device ID and Password',\n 'default' => '',\n 'desc_tip' => true,\n 'options' => $gatewayids,\n ),\n 'book' => array(\n 'title' => 'Book',\n 'type' => 'checkbox',\n 'default' => 'no',\n 'description' => 'Enable Pre-Authorization Only',\n ),\n 'production' => array(\n 'title' => 'Production',\n 'type' => 'checkbox',\n 'default' => 'no',\n 'description' => 'Enable Production',\n ),\n ));\n }", "public function defineFormFields()\n {\n return 'fields.yaml';\n }", "public function init_form_fields() {\n\t\t$this->form_fields = [\n\t\t\t'enabled' => [\n\t\t\t\t'title' => 'Enable/Disable',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => 'Enable this email digest',\n\t\t\t\t'default' => 'no'\n\t\t\t],\n\t\t\t'recipient' => [\n\t\t\t\t'title' => 'Recipient(s)',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => 'Enter recipients (comma separated) for this email. Defaults to ' . get_option( 'admin_email' ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t],\n\t\t\t'schedule' => [\n\t\t\t\t'type' => 'select',\n\t\t\t\t'title' => 'Scheduled Frequency',\n\t\t\t\t'description' => 'Weekly emails will be sent on Mondays. All emails are sent at 7:00am.',\n\t\t\t\t'options' => [\n\t\t\t\t\t'daily' => 'Daily',\n\t\t\t\t\t'weekly' => 'Weekly'\n\t\t\t\t],\n\t\t\t\t'default' => 'daily'\n\t\t\t],\n\t\t\t'email_type' => [\n\t\t\t\t'title' => 'Email type',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => 'Choose which format of email to send.',\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type wc-enhanced-select',\n\t\t\t\t'options' => $this->get_email_type_options(),\n\t\t\t\t'desc_tip' => true,\n\t\t\t],\n\t\t\t'send_now' => [\n\t\t\t\t'title' => 'Send now?',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => 'Yes, send the email digest on save',\n\t\t\t\t'default' => 'no'\n\t\t\t]\n\t\t];\n\t}", "public function get_options_settings() {\n $default_options = $this->get_default_option_settings();\n\n $settings = array(\n array(\n 'name' => 'qr_type',\n 'title' => __( 'Allowed Types', 'wpuf-pro' ),\n 'type' => 'checkbox',\n 'section' => 'advanced',\n 'priority' => 15,\n 'help_text' => __( 'Some details text about the section', 'wpuf-pro' ),\n 'options' => array(\n 'url' => __( 'URL', 'wpuf-pro' ),\n 'text' => __( 'Text', 'wpuf-pro' ),\n 'geo' => __( 'Location', 'wpuf-pro' ),\n 'sms' => __( 'SMS', 'wpuf-pro' ),\n 'wifi' => __( 'Wifi', 'wpuf-pro' ),\n 'card' => __( 'Card', 'wpuf-pro' ),\n 'email' => __( 'Email', 'wpuf-pro' ),\n 'calendar' => __( 'Calendar', 'wpuf-pro' ),\n 'phone' => __( 'Phone', 'wpuf-pro' ),\n )\n ),\n );\n\n return array_merge( $default_options, $settings );\n }", "function init_form_fields()\n\t{\n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', 'topgroupshops' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable this email notification', 'topgroupshops' ),\n\t\t\t\t'default' => 'yes'\n\t\t\t),\n\t\t\t'subject' => array(\n\t\t\t\t'title' => __( 'Subject', 'topgroupshops' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'topgroupshops' ), $this->subject ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'heading' => array(\n\t\t\t\t'title' => __( 'Email Heading', 'topgroupshops' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'topgroupshops' ), $this->heading ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'email_type' => array(\n\t\t\t\t'title' => __( 'Email type', 'topgroupshops' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'Choose which format of email to send.', 'topgroupshops' ),\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'plain' => __( 'Plain text', 'topgroupshops' ),\n\t\t\t\t\t'html' => __( 'HTML', 'topgroupshops' ),\n\t\t\t\t\t'multipart' => __( 'Multipart', 'topgroupshops' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function init_form_fields() {\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable this email notification', 'woocommerce' ),\n 'default' => 'yes'\n ),\n 'subject' => array(\n 'title' => __( 'Email Subject', 'woocommerce' ),\n 'type' => 'text',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->subject ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'heading' => array(\n 'title' => __( 'Email Heading', 'woocommerce' ),\n 'type' => 'text',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->heading ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'custom_message' => array(\n 'title' => __( 'Custom Message', 'yith-woocommerce-membership' ),\n 'type' => 'textarea',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->custom_message ),\n 'placeholder' => '',\n 'default' => __( 'Dear Customer {firstname} {lastname}, your membership {membership_name} is cancelled.', 'yith-woocommerce-membership' )\n ),\n 'email_type' => array(\n 'title' => __( 'Email type', 'woocommerce' ),\n 'type' => 'select',\n 'description' => __( 'Choose which format of email to send.', 'woocommerce' ),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options()\n )\n );\n }", "public function createFormFields()\n {\n return array(\n 'tab' => 'sepacredittransfer',\n 'fields' => array(\n array(\n 'name' => 'enabled',\n 'label' => $this->getTranslatedString('text_enable'),\n 'type' => 'onoff',\n 'doc' => $this->getTranslatedString('enable_heading_title_sepact'),\n 'default' => 0,\n ),\n array(\n 'name' => 'merchant_account_id',\n 'label' => $this->getTranslatedString('config_merchant_account_id'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getMerchantAccountId(),\n 'required' => true,\n ),\n array(\n 'name' => 'secret',\n 'label' => $this->getTranslatedString('config_merchant_secret'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getSecret(),\n 'required' => true,\n ),\n array(\n 'name' => 'base_url',\n 'label' => $this->getTranslatedString('config_base_url'),\n 'type' => 'text',\n 'doc' => $this->getTranslatedString('config_base_url_desc'),\n 'default' => $this->credentialsConfig->getBaseUrl(),\n 'required' => true,\n ),\n array(\n 'name' => 'http_user',\n 'label' => $this->getTranslatedString('config_http_user'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getHttpUser(),\n 'required' => true,\n ),\n array(\n 'name' => 'http_pass',\n 'label' => $this->getTranslatedString('config_http_password'),\n 'type' => 'text',\n 'default' => $this->credentialsConfig->getHttpPassword(),\n 'required' => true,\n ),\n\n array(\n 'name' => 'test_credentials',\n 'type' => 'linkbutton',\n 'required' => false,\n 'buttonText' => $this->getTranslatedString('test_config'),\n 'id' => 'SepaCreditTransferConfig',\n 'method' => 'sepacredittransfer',\n 'send' => array(\n 'WIRECARD_PAYMENT_GATEWAY_SEPACREDITTRANSFER_BASE_URL',\n 'WIRECARD_PAYMENT_GATEWAY_SEPACREDITTRANSFER_HTTP_USER',\n 'WIRECARD_PAYMENT_GATEWAY_SEPACREDITTRANSFER_HTTP_PASS'\n )\n )\n )\n );\n }", "protected function getSourceConfig()\n {\n return [\n 'config' => [\n 'form' => [\n 'umc_module' => [\n 'id' => 'umc_module',\n 'fieldset' => [\n 'settings' => [\n 'id' => 'settings',\n 'sort' => 10,\n 'collapsible' => true,\n 'translate' => 'label',\n 'label' => 'Module settings',\n 'field' => [\n 'qualified' => [\n 'id' => 'qualified',\n 'type' => 'select',\n 'required' => true,\n 'sort' => 10,\n 'system' => true,\n 'label' => 'Fully qualified class names',\n 'tooltip' => 'tooltip goes here',\n ],\n 'underscore' => [\n 'id' => 'underscore',\n 'type' => 'select',\n 'required' => true,\n 'sort' => 20,\n 'system' => true,\n 'label' => 'Use underscore',\n 'tooltip' => 'tooltip goes here',\n 'depends' => [\n 'type' => [\n 'depend' => [\n 'type' => [\n 'id' => 'type',\n 'type' => 'self',\n 'val' => [\n 1 => [\n 'id' => 1,\n 'value' => 1,\n ]\n ]\n ]\n ]\n ]\n ]\n ],\n 'disabled' => [\n 'id' => 'disabled',\n 'type' => 'text',\n 'required' => true,\n 'sort' => 30,\n 'system' => true,\n 'label' => 'Disabled field',\n 'disabled' => true\n ]\n ]\n ],\n 'disabled' => [\n 'id' => 'disabled',\n 'sort' => 20,\n 'collapsible' => true,\n 'translate' => 'label',\n 'label' => 'Disabled fieldset',\n 'disabled' => 'true',\n 'field' => [\n 'some_field' => [\n 'id' => 'some_field',\n 'type' => 'select',\n 'required' => true,\n 'sort' => 10,\n 'system' => true,\n 'label' => 'Some field',\n 'tooltip' => 'tooltip goes here',\n ],\n ]\n ]\n ]\n ]\n ]\n ]\n ];\n }", "protected function getFileFieldSettings() { ?>\n\t\t<div class=\"form-group\" v-if=\"['job_logo', 'job_cover', 'job_gallery'].indexOf(field.slug) <= -1\">\n\t\t\t<label>Allowed file types</label>\n\t\t\t<select multiple=\"multiple\" v-model=\"field.allowed_mime_types_arr\" @change=\"editFieldMimeTypes($event, field)\">\n\t\t\t\t<?php foreach ( (array) get_allowed_mime_types() as $extension => $mime ): ?>\n\t\t\t\t\t<option value=\"<?php echo \"{$extension} => {$mime}\" ?>\"><?php echo $mime ?></option>\n\t\t\t\t<?php endforeach ?>\n\t\t\t</select>\n\t\t\t<br><br>\n\t\t\t<label><input type=\"checkbox\" v-model=\"field.multiple\" class=\"form-checkbox\"> Allow multiple files?</label>\n\t\t</div>\n\t\t<div class=\"form-group\" v-show=\"field.multiple\">\n\t\t\t<label>Maximum number of uploads allowed</label>\n\t\t\t<input type=\"number\" v-model=\"field.file_limit\" style=\"width: 100px; margin: 0;\">\n\t\t</div>\n\t<?php }", "public function KemiSitemap_settings_fields()\n {\n // Section: KemiSitemap_section\n add_settings_field(\n 'KemiSitemap_cpt',\n __('', 'KemiSitemap'),\n array( $this, 'KemiSitemap_cpt_output' ),\n 'KemiSitemap_group',\n 'KemiSitemap_options',\n ''\n );\n }", "public function get_config_field_subtext()\n\t{\n\t\treturn array(\n\t\t\t'site_url'\t\t\t\t\t=> array('url_explanation'),\n\t\t\t'is_site_on'\t\t\t\t=> array('is_site_on_explanation'),\n\t\t\t'is_system_on'\t\t\t\t=> array('is_system_on_explanation'),\n\t\t\t'debug'\t\t\t\t\t\t=> array('debug_explanation'),\n\t\t\t'show_profiler'\t\t\t\t=> array('show_profiler_explanation'),\n\t\t\t'max_caches'\t\t\t\t=> array('max_caches_explanation'),\n\t\t\t'use_newrelic'\t\t\t\t=> array('use_newrelic_explanation'),\n\t\t\t'newrelic_app_name'\t\t\t=> array('newrelic_app_name_explanation'),\n\t\t\t'gzip_output'\t\t\t\t=> array('gzip_output_explanation'),\n\t\t\t'server_offset'\t\t\t\t=> array('server_offset_explain'),\n\t\t\t'default_member_group'\t\t=> array('group_assignment_defaults_to_two'),\n\t\t\t'smtp_server'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_port'\t\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_username'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_password'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'email_batchmode'\t\t\t=> array('batchmode_explanation'),\n\t\t\t'email_batch_size'\t\t\t=> array('batch_size_explanation'),\n\t\t\t'webmaster_email'\t\t\t=> array('return_email_explanation'),\n\t\t\t'cookie_domain'\t\t\t\t=> array('cookie_domain_explanation'),\n\t\t\t'cookie_prefix'\t\t\t\t=> array('cookie_prefix_explain'),\n\t\t\t'cookie_path'\t\t\t\t=> array('cookie_path_explain'),\n\t\t\t'deny_duplicate_data'\t\t=> array('deny_duplicate_data_explanation'),\n\t\t\t'redirect_submitted_links'\t=> array('redirect_submitted_links_explanation'),\n\t\t\t'require_secure_passwords'\t=> array('secure_passwords_explanation'),\n\t\t\t'allow_dictionary_pw'\t\t=> array('real_word_explanation', 'dictionary_note'),\n\t\t\t'censored_words'\t\t\t=> array('censored_explanation', 'censored_wildcards'),\n\t\t\t'censor_replacement'\t\t=> array('censor_replacement_info'),\n\t\t\t'password_lockout'\t\t\t=> array('password_lockout_explanation'),\n\t\t\t'password_lockout_interval' => array('login_interval_explanation'),\n\t\t\t'require_ip_for_login'\t\t=> array('require_ip_explanation'),\n\t\t\t'allow_multi_logins'\t\t=> array('allow_multi_logins_explanation'),\n\t\t\t'name_of_dictionary_file'\t=> array('dictionary_explanation'),\n\t\t\t'force_query_string'\t\t=> array('force_query_string_explanation'),\n\t\t\t'image_resize_protocol'\t\t=> array('image_resize_protocol_exp'),\n\t\t\t'image_library_path'\t\t=> array('image_library_path_exp'),\n\t\t\t'thumbnail_prefix'\t\t\t=> array('thumbnail_prefix_exp'),\n\t\t\t'member_theme'\t\t\t\t=> array('member_theme_exp'),\n\t\t\t'require_terms_of_service'\t=> array('require_terms_of_service_exp'),\n\t\t\t'email_console_timelock'\t=> array('email_console_timelock_exp'),\n\t\t\t'log_email_console_msgs'\t=> array('log_email_console_msgs_exp'),\n\t\t\t'use_membership_captcha'\t=> array('captcha_explanation'),\n\t\t\t'strict_urls'\t\t\t\t=> array('strict_urls_info'),\n\t\t\t'enable_template_routes'\t=> array('enable_template_routes_exp'),\n\t\t\t'tmpl_display_mode'\t\t\t=> array('tmpl_display_mode_exp'),\n\t\t\t'site_404'\t\t\t\t\t=> array('site_404_exp'),\n\t\t\t'channel_nomenclature'\t\t=> array('channel_nomenclature_exp'),\n\t\t\t'enable_sql_caching'\t\t=> array('enable_sql_caching_exp'),\n\t\t\t'email_debug'\t\t\t\t=> array('email_debug_exp'),\n\t\t\t'use_category_name'\t\t\t=> array('use_category_name_exp'),\n\t\t\t'reserved_category_word'\t=> array('reserved_category_word_exp'),\n\t\t\t'auto_assign_cat_parents'\t=> array('auto_assign_cat_parents_exp'),\n\t\t\t'save_tmpl_revisions'\t\t=> array('template_rev_msg'),\n\t\t\t'max_tmpl_revisions'\t\t=> array('max_revisions_exp'),\n\t\t\t'max_page_loads'\t\t\t=> array('max_page_loads_exp'),\n\t\t\t'time_interval'\t\t\t\t=> array('time_interval_exp'),\n\t\t\t'lockout_time'\t\t\t\t=> array('lockout_time_exp'),\n\t\t\t'banishment_type'\t\t\t=> array('banishment_type_exp'),\n\t\t\t'banishment_url'\t\t\t=> array('banishment_url_exp'),\n\t\t\t'banishment_message'\t\t=> array('banishment_message_exp'),\n\t\t\t'enable_search_log'\t\t\t=> array('enable_search_log_exp'),\n\t\t\t'dynamic_tracking_disabling'=> array('dynamic_tracking_disabling_info')\n\t\t);\n\t}", "function _name_field_instance_settings_pre_render($form) {\n\n $form['instance_properties'] = array(\n '#prefix' => '<table>',\n '#suffix' => '</table>',\n '#weight' => 1,\n 'thead' => array(\n '#prefix' => '<thead><tr><th>' . t('Field') . '</th>',\n '#suffix' => '</tr></thead>',\n '#weight' => 0,\n ),\n 'tbody' => array(\n '#prefix' => '<tbody>',\n '#suffix' => '</tbody>',\n '#weight' => 1,\n 'title_display' => array(\n '#prefix' => '<tr><td><strong>' . t('Title display') . ' <sup>1</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 1,\n ),\n 'size' => array(\n '#prefix' => '<tr><td><strong>' . t('HTML size') . ' <sup>2</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 2,\n ),\n 'inline_css_enabled' => array(\n '#prefix' => '<tr><td><strong>' . t('Inline style') . ' <sup>3</sup></strong></td>',\n '#suffix' => '</tr>',\n '#weight' => 3,\n ),\n ),\n 'tfoot' => array(\n '#value' => '<tfoot><tr><td colspan=\"6\"><ol>'\n . '<li>'. t('The title display controls how the label of the name component is displayed in the form. \"%above\" is the standard title; \"%below\" is the standard description; \"%hidden\" removes the label.',\n array('%above' => t('above'), '%below' => t('below'), '%hidden' => t('hidden'))) . '</li>'\n . '<li>'. t('The HTML size property tells the browser what the width of the field should be when it is rendered. This gets overriden by the themes CSS properties. This must be between 1 and 255.') . '</li>'\n . '<li>'. t('The inline style property tells the browser what the width of the field <strong>really</strong> should be when it is rendered. This is dynamically calculated from the HTML size property.') . '</li>'\n . '</ol></td></tr></tfoot>' ,\n '#weight' => 2,\n ),\n 'extra_fields' => array(\n '#weight' => 3,\n ),\n );\n\n $i = 0;\n foreach (_name_translations() as $key => $title) {\n // Adds the table header for the particullar field.\n $form['instance_properties']['thead'][$key]['#value'] = '<th>' . $title . '</th>';\n $form['instance_properties']['thead'][$key]['#weight'] = ++$i;\n\n // Strip the title & description.\n unset($form['size'][$key]['#description']);\n unset($form['size'][$key]['#title']);\n $form['size'][$key]['#size'] = 5;\n\n unset($form['title_display'][$key]['#description']);\n unset($form['title_display'][$key]['#title']);\n\n unset($form['inline_css_enabled'][$key]['#description']);\n unset($form['inline_css_enabled'][$key]['#title']);\n\n // Moves the size element into the table.\n $form['instance_properties']['tbody']['size'][$key] = $form['size'][$key];\n $form['instance_properties']['tbody']['size'][$key]['#prefix'] = '<td>';\n $form['instance_properties']['tbody']['size'][$key]['#suffix'] = '</td>';\n $form['instance_properties']['tbody']['size'][$key]['#weight'] = $i;\n\n $form['instance_properties']['tbody']['title_display'][$key] = $form['title_display'][$key];\n $form['instance_properties']['tbody']['title_display'][$key]['#prefix'] = '<td>';\n $form['instance_properties']['tbody']['title_display'][$key]['#suffix'] = '</td>';\n $form['instance_properties']['tbody']['title_display'][$key]['#weight'] = $i;\n\n $form['instance_properties']['tbody']['inline_css_enabled'][$key] = $form['inline_css_enabled'][$key];\n $form['instance_properties']['tbody']['inline_css_enabled'][$key]['#prefix'] = '<td>';\n $form['instance_properties']['tbody']['inline_css_enabled'][$key]['#suffix'] = '</td>';\n $form['instance_properties']['tbody']['inline_css_enabled'][$key]['#weight'] = $i;\n\n // Clean up the leftovers.\n unset($form['size'][$key]);\n $form['size']['#access'] = FALSE;\n\n unset($form['title_display'][$key]);\n $form['title_display']['#access'] = FALSE;\n\n unset($form['inline_css_enabled'][$key]);\n $form['inline_css_enabled']['#access'] = FALSE;\n\n }\n\n // Move the additional options under the table.\n $form['extra_fields'] = array(\n '#weight' => 2,\n );\n $form['inline_css']['#weight'] = 0;\n $form['title_field']['#weight'] = 1;\n $form['generational_field']['#weight'] = 2;\n $form['extra_fields']['inline_css'] = $form['inline_css'];\n $form['extra_fields']['title_field'] = $form['title_field'];\n $form['extra_fields']['generational_field'] = $form['generational_field'];\n unset($form['title_field']);\n unset($form['inline_css']);\n unset($form['generational_field']);\n\n return $form;\n}", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'api_key' => array(\n\t\t\t\t'title' => __( 'API Key', PLUGIN_TXT ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Enter with your API Key. You can find this in \"User Profile\" drop-down (top right corner) > API Keys.', PLUGIN_TXT ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'debug' => array(\n\t\t\t\t'title' => __( 'Debug Log', PLUGIN_TXT ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable logging', PLUGIN_TXT ),\n\t\t\t\t'default' => 'no',\n\t\t\t\t'description' => __( 'Log events such as API requests', PLUGIN_TXT ),\n\t\t\t),\n\t\t);\n\t}", "public function get_configuration_template() {\n\t\t$template_str = $this->get_configuration_middlesection_template();\n\t\t$template_str .= $this->get_test_button_html($this->desc);\n\t\treturn $template_str;\n\t}", "protected function getConfigForm()\n {\n $config_form = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Equivalence surcharge'),\n 'name' => 'PROFITMARGIN_EQUIVALENCE_SURCHARGE_ENABLED',\n 'is_bool' => true,\n 'desc' => $this->l('Enable equivalence surcharge when calculating profit'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n\n\n $available_taxes = $this->getAvailableTaxes();\n foreach ($available_taxes as $tax) {\n $config_form['form']['input'][] = array(\n 'type' => 'text',\n 'name' => \"PROFITMARGIN_EQUIVALENCE_SURCHARGE_{$tax['id_tax']}\",\n 'label' => $this->l($tax['name']),\n 'desc' => $this->l('Equivalence surcharge'),\n 'suffix' => '%', \n 'col' => 1,\n );\n }\n\n $config_form['form']['input'][] = array( // @TODO: Default shipping cost for each carrier\n 'type' => 'text',\n 'name' => 'PROFITMARGIN_DEFAULT_SHIPPING_COST',\n 'label' => $this->l('Default shipping cost'),\n 'suffix' => '€', \n 'col' => 1,\n );\n\n $config_form['form']['input'][] = array(\n 'type' => 'radio',\n 'name' => 'PROFITMARGIN_SHIPPING_COST_TAX',\n 'label' => $this->l('Shipping cost tax'),\n 'values' => array()\n );\n \n foreach ($available_taxes as $tax) {\n $shipping_cost_tax = &$config_form['form']['input'];\n $shipping_cost_tax[array_key_last($shipping_cost_tax)]['values'][] = array(\n 'id' => \"tax_{$tax['id_tax']}\",\n 'value' => $tax['id_tax'],\n 'label' => $this->l($tax['name'])\n );\n }\n \n foreach ($this->getAvailablePaymentModules() as $payment_module) {\n $config_form['form']['input'][] = array(\n 'type' => 'text',\n 'name' => \"PROFITMARGIN_PAYMENT_FEE_BASE_{$payment_module['id_module']}\",\n 'label' => $this->l($payment_module['name']),\n 'desc' => $this->l('Base fee'),\n 'suffix' => '€', \n 'col' => 1,\n );\n $config_form['form']['input'][] = array(\n 'type' => 'text',\n 'name' => \"PROFITMARGIN_PAYMENT_FEE_PERCENTAGE_{$payment_module['id_module']}\",\n 'desc' => $this->l('Percentage fee'),\n 'suffix' => '%',\n 'col' => 1,\n );\n }\n\n return $config_form;\n }", "public function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', $this->domain ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Custom Payment', $this->domain ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Title', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'This controls the title which the user sees during checkout.', $this->domain ),\n 'default' => __( 'Cartão de Crédito', $this->domain ),\n 'desc_tip' => true,\n ),\n 'order_status' => array(\n 'title' => __( 'Order Status', $this->domain ),\n 'type' => 'select',\n 'class' => 'wc-enhanced-select',\n 'description' => __( 'Choose whether status you wish after checkout.', $this->domain ),\n 'default' => 'wc-completed',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses()\n ),\n 'description' => array(\n 'title' => __( 'Description', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ),\n 'default' => __('Informação do método de pagamento', $this->domain),\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => __( 'Instructions', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ),\n 'default' => '',\n 'desc_tip' => true,\n ),\n );\n }", "public function adminSettingsSubform () {\n $form = array();\n $this->adminSettingsPrintFriendlyForm($form);\n return $form;\n }", "public function create_fields() {\n\t\tif ( count( $this->sections ) > 0 ) {\n\t\t\tforeach ( $this->fields as $k => $v ) {\n\t\t\t\t$method = $this->determine_method( $v, 'form' );\n\t\t\t\t$name = $v['name'];\n\t\t\t\tif ( $v['type'] == 'info' ) { $name = ''; }\n\t\t\t\tadd_settings_field( $k, $name, $method, $this->token, $v['section'], array( 'key' => $k, 'data' => $v ) );\n\n\t\t\t\t// Let the API know that we have a colourpicker field.\n\t\t\t\tif ( $v['type'] == 'range' && $this->_has_range == false ) { $this->_has_range = true; }\n\t\t\t}\n\t\t}\n\t}", "function theme_devshop_projects_create_settings_form($vars) {\n $form = $vars['form'];\n $rows = array();\n $header = array();\n foreach (element_children($form['environments']) as $env_name) {\n $row = array();\n $header['primary'] = 'Primary';\n $header['name'] = 'Name';\n $header['git_ref'] = t('Branch/Tag');\n\n $name_element = $form['environments'][$env_name]['name'];\n $git_ref_element = $form['environments'][$env_name]['git_ref'];\n $settings_element = $form['environments'][$env_name]['settings'];\n\n $primary_radio = $form['primary_environment'][$env_name];\n $primary_radio['#title'] = '';\n $primary_radio['#attributes']['class'][] = 'pull-right';\n \n $row[] = drupal_render($primary_radio);\n $row[] = drupal_render($name_element);\n $row[] = drupal_render($git_ref_element);\n\n foreach (element_children($settings_element) as $setting) {\n if (!isset($header[$setting])) {\n $header[$setting] = isset($form['environments'][$env_name]['settings'][$setting]['#title']) ? $form['environments'][$env_name]['settings'][$setting]['#title'] : '';\n }\n $form['environments'][$env_name]['settings'][$setting]['#title'] = '';\n\n $element = $form['environments'][$env_name]['settings'][$setting];\n $row[] = drupal_render($element);\n }\n $rows[] = $row;\n }\n $output = theme('table', array(\n 'header' => $header,\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('table', 'project-environments-table'),\n )\n ));\n return $output;\n}" ]
[ "0.76471496", "0.67804855", "0.65752053", "0.6542611", "0.6516883", "0.6471955", "0.64517903", "0.6407626", "0.6317888", "0.6291372", "0.6283711", "0.62689734", "0.6260548", "0.62224627", "0.6182933", "0.61812454", "0.61769915", "0.61704165", "0.6169526", "0.61485046", "0.6139677", "0.61364806", "0.61095095", "0.60918707", "0.6076809", "0.6058777", "0.60477567", "0.6034203", "0.60229427", "0.6017084", "0.6006428", "0.5999553", "0.59878325", "0.59820914", "0.59772533", "0.597648", "0.5938977", "0.59336096", "0.59305257", "0.5925325", "0.5923954", "0.5910578", "0.5905486", "0.5892012", "0.58747286", "0.58653176", "0.58619773", "0.5857136", "0.5851782", "0.5844299", "0.5844186", "0.58323586", "0.58138627", "0.58057404", "0.57982624", "0.5793071", "0.5790199", "0.57865155", "0.57830656", "0.57804", "0.5755517", "0.57329273", "0.57291305", "0.5724964", "0.5723516", "0.5721648", "0.57004064", "0.56965315", "0.5691384", "0.56847984", "0.56841594", "0.5682545", "0.56793636", "0.56716657", "0.5666386", "0.56595194", "0.56574875", "0.5656211", "0.5653625", "0.56508607", "0.5645582", "0.5643675", "0.56395525", "0.5638362", "0.56242514", "0.5608089", "0.5597386", "0.55973494", "0.5591094", "0.558907", "0.5586334", "0.558447", "0.5580712", "0.5579472", "0.5576188", "0.5574265", "0.55740714", "0.557246", "0.5571009", "0.5570845" ]
0.725489
1
order page (index) (ajax)
public function actionIndex() { $model = new OrderForm; if( Request::isAjaxRequest() ) { $model->setAttributes( Request::getPosts() ); if( !$model->validate() ) { \Framework::end( json_encode( [ 'status' => 'error', 'content' => $model->getMessages() ] ) ); } $product = Product::model()->find( [ 'conditions' => [ 'productId = :id', 'productStatus = 1' ], 'params' => [ ':id' => $model->product] ] ); if( !$product ) { \Framework::end( json_encode( [ 'status' => 'error', 'content' => [ $this->lang->getIndex( 'order', 'productNotFound' ) ] ] ) ); } $errors = []; $module = Module::model()->find( [ 'conditions' => [ 'moduleId = :id', 'moduleType = 0', 'moduleStatus = 1' ], 'params' => [ ':id' => $model->gateway ] ] ); if( !$module ) { $errors[] = $this->lang->getIndex( 'order', 'gatewayNotFound' ); } Card::model()->lock(); $totalCards = Card::model()->getTotalProductCards( $model->product ); if( $totalCards->total < $model->quantity ) { $errors[] = str_replace( '{total}', $totalCards->total, $this->lang->getIndex( 'order', 'quantityNotAvailable' ) ); } if( $errors ) { Card::model()->unlock(); \Framework::end( json_encode( [ 'status' => 'error', 'content' => $errors ] ) ); } $cards = Card::model()->getProductCards( $model->product, $model->quantity ); $nowTime = time(); foreach( $cards as $card ) { Card::model()->update( [ 'fields' => [ 'cardReserveDate' => ':date' ], 'conditions' => 'cardId = :id', 'params' => [ ':id' => $card->cardId, ':date' => ( $nowTime + $this->reserve_second ) ] ] ); } Card::model()->unlock(); $lastId = Trans::model()->find( [ 'select' => 'MAX(transId) as last' ] ); $au = $this->random( 6, $lastId->last+1 ); $transId = Trans::model()->insertData( $au, ($nowTime+$this->reserve_second), $model->product, ( $product->productPrice*$model->quantity ), $model->quantity, $model->email, $model->mobile, $model->content, $model->gateway ); TransInfo::model()->insertData( $transId, base64_encode( serialize( $_SERVER ) ) ); foreach( $cards as $card ) { TransCard::model()->insertData( $card->cardId, $transId ); } \Framework::end( json_encode( [ 'status' => 'success', 'redirect' => \Framework::createUrl( 'site/payment/factor', [ $au ] ) ] ) ); } $products = Product::model()->getProducts(); foreach( $products as $product ) { $total = Card::model()->getTotalProductCards( $product->productId ); $product->productHaveCard = $total->total; } $categories = Category::model()->findAll( [ 'conditions' => [ 'categoryStatus = 1' ], 'orderBy' => 'categoryOrder ASC' ] ); $gateways = Module::model()->findAll( [ 'conditions' => [ 'moduleType = 0', 'moduleStatus = 1' ] ] ); $this->render( 'common/index', [ 'products' => $products, 'categories' => $categories, 'gateways' => $gateways ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function order_ajax ()\n {\n if (isset($_POST['sortable'])) {\n $this->slider_model->save_order($_POST['sortable']);\n }\n \n // Fetch all pages\n $this->data['pages'] = $this->slider_model->get_nested($this->data['content_language_id']);\n \n // Load view\n $this->load->view('admin/sliders/order_ajax', $this->data);\n }", "public function index() {\n $this->show_order();\n }", "public function ajaxorderlistAction(){\n\t\ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n \t\t$params = $this->getRequest()->getQuery()->toArray();\n\t\t\t$pagenum = $params['pagenum'];\n\t\t\t$limit = $params['pagesize'];\n\t\t\t$keyword = $params['keyword'];\n\t\t\t$cust_id = $params['cust_id'];\n\t\t\t\n\t\t\t$sortdatafield = $params['sortdatafield'];\n\t\t\t$sortorder = $params['sortorder'];\n\t\t\t\n\t\t\tsettype($limit, 'int');\n\t\t\t$offset = $pagenum * $limit;\n\t\t\t$orderTable = $this->getServiceLocator()->get('Order\\Model\\OrderTable');\n\t\t\tif(!empty($keyword)){\n\t\t\t\t$offset = 0;\n\t\t\t}\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\n\t\t\t//$xero = new \\Invoice\\Model\\Xero($sm);\n\t\t\t//$object = $xero->getAllInvoicesFromWebSerice();\n\t\t\t\n\t\t\t$ordersArr = $orderTable->fetchAll($limit, $offset, $keyword, $cust_id, $sortdatafield, $sortorder);\n\t\t\tforeach($ordersArr['Rows'] as $key => $value){\n\t\t\t\tforeach($value as $field => $fieldValue){\n\t\t\t\t\tif($field == 'created_date'){\n\t\t\t\t\t\t$ordersArr['Rows'][$key][$field] = date($config['phpDateFormat'], strtotime($ordersArr['Rows'][$key]['created_date']));\n\t\t\t\t\t}\n\t\t\t\t\tif(empty($fieldValue)){\n\t\t\t\t\t\t$ordersArr['Rows'][$key][$field] = '-';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($field == 'invoice_number'){\n\t\t\t\t\t\t$ordersArr['Rows'][$key]['invoice_number'] = $value['invoice_number'];\n\t\t\t\t\t\t$ordersArr['Rows'][$key]['xero_tax_rate'] = $value['xero_tax_rate'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($value['xero_date_due']!='0000-00-00 00:00:00')\n\t\t\t\t\t\t\t$ordersArr['Rows'][$key]['xero_date_due'] = date($config['phpDateFormat'], strtotime($value['xero_date_due']));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t$ordersArr['Rows'][$key]['xero_date_due'] ='';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$ordersArr['Rows'][$key]['payment_made'] = $value['xero_payment_made'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ordersArr['Rows'][$key]['value'] = $value['xero_total'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t\tforeach($object->Invoices->Invoice as $invoice){\n\t\t\t\t\t\t\t$invoice = (array)$invoice;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($invoice['InvoiceNumber'] == $fieldValue){\n\t\t\t\t\t\t\t\t$ordersArr['Rows'][$key]['value'] = $invoice['Total'];\n\t\t\t\t\t\t\t\t$payment_made = !empty($invoice['AmountPaid']) ? number_format($invoice['AmountPaid'] * 100 / $invoice['Total'], 2) : $invoice['AmountPaid'];\n\t\t\t\t\t\t\t\t$ordersArr['Rows'][$key]['payment_made'] = $payment_made.'%';\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\techo json_encode($ordersArr);\n\t\t\texit;\t\t\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 index()\n {\n //Get the value from the select control\n $sort = $this->input->post('sort');\n\n if($sort === NULL || is_null($sort)) $sort = 1;\n \n //Put the value in an array to pass to the view. \n $this->sort = $sort;\n $this->data['sort'] = $this->factory->getItem($sort);\n \n $this->page(1);\n }", "public function actionIndex()\n {\n//\n $req = Yii::$app->request;\n $sort = $req->get('sort');\n $query = Order::find();\n $countQuery = clone $query;\n $pages = new Pagination(['totalCount' => $countQuery->count()]);\n $orders = $query\n ->offset($pages->offset)\n ->orderBy($sort)\n ->limit($pages->limit)\n ->all();\n\n $this->data = [\n 'pages' => $pages,\n 'orders' => $orders,\n ];\n return $this->xrender();\n }", "public function HandlePage()\n\t\t{\n\t\t\t$this->SetOrderData();\n\n\t\t\t$action = \"\";\n\t\t\tif(isset($_REQUEST['action'])) {\n\t\t\t\t$action = isc_strtolower($_REQUEST['action']);\n\t\t\t}\n\n\t\t\tswitch($action) {\n\t\t\t\tdefault: {\n\t\t\t\t\t$this->FinishOrder();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function index()\r\n {\r\n $this->page_list_grid();\r\n }", "public function pageAction()\n {\n $page = $this->getRequest()->getParam('page', 1);\n $count = $this->getRequest()->getParam('count', 20);\n $collectionJson = Mage::helper('neklo_productposition/product')->getCollectionJson($page, $count);\n $this->getResponse()->setBody($collectionJson);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n }", "function index()\n {\n // Build a list of orders\n // Get all files in data folder\n $files = directory_map('./data');\n\n // filter out orders\n $orders = array();\n //Extract number from order<num>.xml files\n //preg_match_all('/(?<=order).*(?=\\.xml*)/', implode(\"\\n\", $files), $orders);\n\n preg_match_all('/order.*\\.xml/', implode(\"\\n\", $files), $orders);\n\n $orderlinks = array();\n foreach($orders[0] as $order)\n {\n $orderlink = array(\n 'file' => $order,\n 'order' => preg_split(\"/\\./\", $order)[0],\n );\n $orderlinks[] = $orderlink;\n }\n\n // Present the list to choose from\n $this->data['pagebody'] = 'homepage';\n $this->data['orders'] = $orderlinks;\n\n $this->render();\n }", "public function actionIndex() {\n\t\treturn $this->render('ajax');\n\t}", "function index() {\r\n $this->page();\r\n }", "public function action_ajax_get_pages_list() {\n\t\t// Get the media model\n\t\t$plugin_model = new Model_Pages();\n\n\t\t// Get the complete list of Pages\n\t\t$list = array();\n\t\tforeach ($plugin_model->get_all_pages('name_tag ASC') as $item) {\n\t\t\tarray_push($list, $item);\n\t\t}\n\n\t\t// Return\n\t\t$this->auto_render = false;\n\t\t$this->response->body(json_encode($list));\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function execute()\n\t{\n\t\t$isAjax = $this->getRequest()->isAjax();\n\t\tif ($isAjax){\n\t\t\t$layout = $this->_layout;\n\t\t\t$layout->getUpdate()->load(['listingtabs_index_ajax']);\n\t\t\t$layout->generateXml();\n $output = $layout->getOutput();\n $this->getResponse()->setHeader('Content-type', 'application/json');\n\t\t\tdie($this->jsonEncoder->encode(array('items_markup' => $output)));\n }\n\t\t$resultPage = $this->resultPageFactory->create();\n\t\t$resultPage->getConfig()->getTitle()->prepend(__('SM Listing Tabs'));\n\t\treturn $resultPage;\n\t}", "function go_page_list() {\n\t\tglobal $ROW, $TEMPLATE;\n\t\tLOG_MSG('INFO',\"go_page_list(): START \");\n\t\t// Do we have a search string?\n\t\t// Get all the args from $_GET\n\t\t$name=get_arg($_GET,\"name\");\n\t\t$title=get_arg($_GET,\"title\");\n\t\t$type=get_arg($_GET,\"type\");\n\t\tLOG_MSG('DEBUG',\"go_page_list(): Got args\");\n\t\t// Validate parameters as normal strings \n\t\tLOG_MSG('DEBUG',\"go_page_list(): Validated args\");\n\t\t// Rebuild search string for future pages\n\t\t$search_str=\"name=$name&title=$title&type=$type\";\n\t\t$ROW=$this->admin_model->db_page_select(\n\t\t\t\"\",\n\t\t\t\t$name,\n\t\t\t\t$title,\n\t\t\t\t'',\n\t\t\t\t$type);\n\n\t\tif ( $ROW[0]['STATUS'] != \"OK\" ) {\n\t\t\tadd_msg(\"ERROR\",\"There was an error loading the Pages. Please try again later. \");\n\t\t\treturn;\n\t\t}\n\t\t\t\t$this->data['rows'] = $ROW;\n\t\t\t\t$this->load->view('admin/html/header', $this->data,'');\n\t\t\t\t$this->load->view('admin/html/topbar', $this->data);\n\t\t\t\t$this->load->view('admin/html/leftnav', $this->data);\n\t\t\t\t$this->load->view('admin/page/list', $this->data);\n\t\t\t\t$this->load->view('admin/html/footer', $this->data);\n\t\tLOG_MSG('INFO',\"go_page_list(): END\");\n\t}", "function rowpage() {\n $dir = APPPATH . 'controllers/';\n $this->load->library('directoryinfo');\n $arr = $this->directoryinfo->readDirectory($dir, array(\"Auth.php\", \"Ajax.php\"));\n $arr = array($arr);\n // $sortedarray2 = $this->directoryinfo->readDirectory($dirmodule, true);\n // $arr = array_merge(array($sortedarray1), $sortedarray2);\n// echo \"<pre>\";\n// print_r($arr);\n// die();\n $dataselect = array();\n foreach ($arr as $key => $row) {\n $module = mb_strtolower($key, 'UTF-8');\n foreach ($row as $key1 => $row1) {\n $class = mb_strtolower($key1, 'UTF-8');\n foreach ($row1 as $row2) {\n $method = mb_strtolower($row2, 'UTF-8');\n if ($module) {\n $page = $module . \"/\" . $class . \"/\" . $method;\n } else {\n $page = $class . \"/\" . $method;\n }\n $dataselect[$page] = $page;\n }\n }\n }\n $arr_page = $this->page_model->where(array(\"deleted\" => 0))->as_array()->get_all();\n $page_ava = array_map(function($item) {\n return $item['link'];\n }, $arr_page);\n $this->data['page_ava'] = $page_ava;\n $this->data['link'] = $dataselect;\n echo $this->blade->view()->make('ajax/ajaxpage', $this->data)->render();\n }", "public function indexAction() {\n\t\t// loads index view\n\t\t// handle errors\n\t\tif (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == \"XMLHttpRequest\") {\n\t\t $this->view->setTemplate('ajax');\n\t\t}\n\t\tif(!empty($_SESSION['error'])) {\n\t\t $this->view->error = $_SESSION['error'];\n unset($_SESSION['error']);\n }\n\t}", "public function indexAction(){\n \t/*$request = $this->getRequest();\n\t\t$items \t= $this->getCached()->getLayoutItems();\n\n \t$this->view->layoutItems = $items['html'];\n\n \tif($request->isXmlHttpRequest()){\n \t\t$output = $this->view->render('design/index.phtml');\n \t\t$this->_utility->setAjaxData($output);\n \t}*/\n\n \t//$grid = new Admin_Service_Grid('Admin_Model_Page');\n \t//$script = $grid->display();\n }", "public function actionAjaxsort() {\n if (isset(\\Yii::$app->request->post()['cat'])) {\n $number = 1;\n foreach(\\Yii::$app->request->post()['cat'] as $id) {\n $model = BbiiForum::find($id);\n $model->sort = $number++;\n $model->save();\n }\n $json = array('succes' => 'yes');\n } elseif (isset(\\Yii::$app->request->post()['frm'])) {\n $number = 1;\n foreach(\\Yii::$app->request->post()['frm'] as $id) {\n $model = BbiiForum::find($id);\n $model->sort = $number++;\n $model->save();\n }\n $json = array('succes' => 'yes');\n } else { \n $json = array('succes' => 'no');\n }\n echo json_encode($json);\n \\Yii::$app->end();\n }", "public function indexAction()\r\n {\r\n\t\tif(isset($_POST['params']))\r\n\t\t\t$params = json_decode($_POST['params'],true);\r\n\t\tif(isset($_POST['searchParams']) && $_POST['searchParams'])\r\n\t\t\tparse_str($_POST['searchParams'], $searchArray);\r\n\t\t$this->view->is_ajax = $is_ajax = isset($_POST['is_ajax']) ? true : false;\r\n\t\t$page = isset($_POST['page']) ? $_POST['page'] : 1 ;\r\n\t\t$this->view->identityForWidget = isset($_POST['identity']) ? $_POST['identity'] : '';\r\n\t\t$this->view->defaultOptionsArray = $defaultOptionsArray = $this->_getParam('search_type');\r\n\t\t$this->view->loadOptionData = $loadOptionData = isset($params['pagging']) ? $params['pagging'] : $this->_getParam('pagging', 'auto_load');\r\n\t\tif(!$is_ajax){\r\n\t\t\t//order tabs\r\n\t\t\tif(count($defaultOptionsArray) == 0)\r\n\t\t\t\t\treturn $this->setNoRender();\r\n\t\t\t$defaultOptions = $arrayOptions = array();\r\n\t\t\tforeach($defaultOptionsArray as $key=>$defaultValue){\r\n\t\t\t\tif( $this->_getParam($defaultValue.'_order'))\r\n\t\t\t\t\t$order = $this->_getParam($defaultValue.'_order').'||'.$defaultValue;\r\n\t\t\t\telse\r\n\t\t\t\t\t$order = (999+$key).'||'.$defaultValue;\r\n\t\t\t\tif( $this->_getParam($defaultValue.'_label'))\r\n\t\t\t\t\t\t$valueLabel = $this->_getParam($defaultValue.'_label');\r\n\t\t\t\telse{\r\n\t\t\t\t\tif($defaultValue == 'recentlySPcreated')\r\n\t\t\t\t\t\t$valueLabel ='Recently Created';\r\n\t\t\t\t\telse if($defaultValue == 'mostSPviewed')\r\n\t\t\t\t\t\t$valueLabel = 'Most Viewed';\r\n\t\t\t\t\telse if($defaultValue == 'mostSPliked')\r\n\t\t\t\t\t\t$valueLabel = 'Most Liked';\r\n\t\t\t\t\telse if($defaultValue == 'mostSPcommented')\r\n\t\t\t\t\t\t$valueLabel = 'Most Commented';\r\n\t\t\t\t\telse if($defaultValue == 'mostSPrated')\r\n\t\t\t\t\t\t$valueLabel = 'Most Rated';\r\n\t\t\t\t\telse if($defaultValue == 'mostSPfavourite')\r\n\t\t\t\t\t\t$valueLabel = 'Most Favourite';\r\n\t\t\t\t\telse if($defaultValue == 'mostSPdownloaded')\r\n\t\t\t\t\t\t$valueLabel = 'Most Downloaded';\r\n\t\t\t\t\telse if($defaultValue == 'featured')\r\n\t\t\t\t\t\t$valueLabel = 'Featured';\r\n\t\t\t\t\telse if($defaultValue == 'sponsored')\r\n\t\t\t\t\t\t$valueLabel = 'Sponsored';\r\n\t\t\t\t}\r\n\t\t\t\t$arrayOptions[$order] = $valueLabel;\r\n\t\t\t}\r\n\t\t\tksort($arrayOptions);\r\n\t\t\t$counter = 0;\r\n\t\t\tforeach($arrayOptions as $key => $valueOption){\r\n\t\t\t\t$key = explode('||',$key);\r\n\t\t\tif($counter == 0)\r\n\t\t\t\t$this->view->defaultOpenTab = $defaultOpenTab = $key[1];\r\n\t\t\t\t$defaultOptions[$key[1]]=$valueOption;\r\n\t\t\t\t$counter++;\r\n\t\t\t}\t\t\t\t\r\n\t\t\t$this->view->defaultOptions = $defaultOptions;\r\n\t\t\t$this->view->tab_option = $this->_getParam('tab_option','filter');\r\n\t\t}\r\n\t\t//default params\r\n\t\tif(isset($_GET['openTab']) || $is_ajax){\r\n\t\t $this->view->defaultOpenTab = $defaultOpenTab = !empty($searchArray['sort']) ? $searchArray['sort'] : (!empty($_GET['openTab']) ? $_GET['openTab'] : ($this->_getParam('openTab',false) ? $this->_getParam('openTab') : (!empty($params['openTab']) ? $params['openTab'] : '' )));\r\n\t\t}\r\n\t\t$defaultOptions =isset($params['defaultOptions']) ? $params['defaultOptions'] : $defaultOptions;\r\n\t\t$this->view->height = $defaultHeight =isset($params['height']) ? $params['height'] : $this->_getParam('height', '160px');\r\n\t\t$this->view->width = $defaultWidth= isset($params['width']) ? $params['width'] :$this->_getParam('width', '140px');\r\n\t\t$this->view->hide_row = $hide_row= isset($params['hide_row']) ? $params['hide_row'] :$this->_getParam('hide_row', '1');\r\n\t\t$this->view->limit_data = $limit_data = isset($params['limit_data']) ? $params['limit_data'] :$this->_getParam('limit_data', '9');\r\n\t\t$this->view->show_limited_data = $show_limited_data = isset($params['show_limited_data']) ? $params['show_limited_data'] :$this->_getParam('show_limited_data', 'no');\r\n \t $this->view->limit = ($page-1)*$limit_data;\r\n\t\t$this->view->title_truncation = $title_truncation = isset($params['title_truncation']) ? $params['title_truncation'] :$this->_getParam('title_truncation', '45');\r\n\t\t$show_criterias = isset($params['show_criterias']) ? $params['show_criterias'] : $this->_getParam('show_criteria',array('like','comment','rating','by','title','socialSharing','view','photoCount','favouriteCount','featured','sponsored','favouriteButton','likeButton','downloadCount'));\r\n\t\t$this->view->fixHover = $fixHover = isset($params['fixHover']) ? $params['fixHover'] :$this->_getParam('fixHover', 'fix');\r\n\t\t$this->view->insideOutside = $insideOutside = isset($params['insideOutside']) ? $params['insideOutside'] : $this->_getParam('insideOutside', 'inside');\r\n\t\tforeach($show_criterias as $show_criteria)\r\n\t\t\t$this->view->$show_criteria = $show_criteria;\r\n\t\t$this->view->view_type = $view_type = isset($params['view_type']) ? $params['view_type'] : $this->_getParam('view_type', 'masonry');\r\n\t\t$value['category_id'] = isset($searchArray['category_id']) ? $searchArray['category_id'] : (isset($_GET['category_id']) ? $_GET['category_id'] : (isset($params['category_id']) ? $params['category_id'] : '')) ;\r\n\t\t$value['subcat_id'] = isset($searchArray['subcat_id']) ? $searchArray['subcat_id'] : (isset($_GET['subcat_id']) ? $_GET['subcat_id'] : (isset($params['subcat_id']) ? $params['subcat_id'] : '')) ;\r\n\t\t$value['subsubcat_id'] = isset($searchArray['subsubcat_id']) ? $searchArray['subsubcat_id'] : (isset($_GET['subsubcat_id']) ? $_GET['subsubcat_id'] : (isset($params['subsubcat_id']) ? $params['subsubcat_id'] : '')) ;\r\n\t\t$value['sort'] = isset($searchArray['sort']) ? $searchArray['sort'] : (isset($_GET['sort']) ? $_GET['sort'] : (isset($params['sort']) ? $params['sort'] : '')) ;\r\n\t\t$value['search'] = isset($searchArray['search']) ? $searchArray['search'] : (isset($_GET['search']) ? $_GET['search'] : (isset($params['search']) ? $params['search'] : '')) ;\r\n\t\t$value['location'] = isset($searchArray['location']) ? $searchArray['location'] : (isset($_GET['location']) ? $_GET['location'] : (isset($params['location']) ? $params['location'] : ''));\r\n\t\t$value['lat'] = isset($searchArray['lat']) ? $searchArray['lat'] : (isset($searchArray['lat']) ? $_GET['lat'] : (isset($params['lat']) ? $params['lat'] : ''));\r\n\t\t$value['lng'] = isset($searchArray['lng']) ? $searchArray['lng'] : (isset($searchArray['lng']) ? $_GET['lng'] : (isset($params['lng']) ? $params['lng'] : ''));\r\n\t\t$value['miles'] = isset($searchArray['miles']) ? $searchArray['miles'] : (isset($_GET['miles']) ? $_GET['miles'] : (isset($params['miles']) ? $params['miles'] : ''));\t\t\r\n\t\t$value['show'] = isset($searchArray['show']) ? $searchArray['show'] : (isset($_GET['show']) ? $_GET['show'] : (isset($params['show']) ? $params['show'] : ''));\r\n\t $this->view->albumPhotoOption = $albumPhotoOption = isset($params['albumPhotoOption']) ? $params['albumPhotoOption'] : $this->_getParam('photo_album', 'photo');\r\n\t\t$this->view->description_truncation = $description_truncation = isset($params['description_truncation']) ? $params['description_truncation'] : $this->_getParam('description_truncation', '80');\r\n\t\t$this->view->view_type = $view_type = isset($params['view_type']) ? $params['view_type'] : $this->_getParam('view_type', 'masonry');\r\n\t\t$params = $this->view->params = array('height'=>$defaultHeight,'width' => $defaultWidth,'limit_data' => $limit_data,'albumPhotoOption' =>$albumPhotoOption,'openTab'=>$defaultOpenTab,'pagging'=>$loadOptionData,'show_criterias'=>$show_criterias,'view_type'=>$view_type,'title_truncation' =>$title_truncation,'insideOutside' =>$insideOutside,'fixHover'=>$fixHover,'defaultOptions'=>$defaultOptions,'sort'=>$value['sort'],'search'=>$value['search'],'category_id'=>$value['category_id'],'subcat_id'=>$value['subcat_id'],'subsubcat_id'=>$value['subsubcat_id'],'lat'=>$value['lat'],'lng'=>$value['lng'],'location'=>$value['location'],'miles'=>$value['miles'],'show_limited_data'=>$show_limited_data,'show'=>$value['show'],'description_truncation'=>$description_truncation);\r\n\t\t$this->view->loadMoreLink = $this->_getParam('openTab') != NULL ? true : false;\r\n\t\t// initialize type variable type\r\n\t\t$type = '';\r\n\t\tif(!$is_ajax){\r\n\t\t\t$defaultOpenTab = (isset($_GET['sort']) && $_GET['sort'] ? $_GET['sort'] : $defaultOpenTab);\t\r\n\t\t}\r\n\t\tswitch($defaultOpenTab){\r\n\t\t\tcase 'recentlySPcreated':\r\n\t\t\t\t$popularCol = 'creation_date';\r\n\t\t\t\t$type = 'creation';\r\n\t\t\tbreak;\r\n\t\t\tcase 'mostSPviewed':\r\n\t\t\t\t$popularCol = 'view_count';\r\n\t\t\t\t$type = 'view';\r\n\t\t\tbreak;\r\n\t\t\tcase 'mostSPliked':\r\n\t\t\t\t$popularCol = 'like_count';\r\n\t\t\t\t$type = 'like';\r\n\t\t\tbreak;\r\n\t\t\tcase 'mostSPcommented':\r\n\t\t\t\t$popularCol = 'comment_count';\r\n\t\t\t\t$type = 'comment';\r\n\t\t\tbreak;\r\n\t\t\tcase 'mostSPrated':\r\n\t\t\t\t$popularCol = 'rating';\r\n\t\t\t\t$type = 'rating';\r\n\t\t\tbreak;\r\n\t\t\tcase 'featured':\r\n\t\t\t\t$popularCol = 'is_featured';\r\n\t\t\t\t$type = 'is_featured';\r\n\t\t\t\t$fixedData = 'is_featured';\r\n\t\t\tbreak;\r\n\t\t\tcase 'sponsored':\r\n\t\t\t\t$popularCol = 'is_sponsored';\r\n\t\t\t\t$type = 'is_sponsored';\r\n\t\t\t\t$fixedData = 'is_sponsored';\r\n\t\t\tbreak;\r\n\t\t\tcase 'mostSPfavourite':\r\n\t\t\t\t$popularCol = 'favourite_count';\r\n\t\t\t\t$type = 'favourite';\r\n\t\t\tbreak;\r\n\t\t\tcase 'mostSPdownloaded':\r\n\t\t\t\t$popularCol = 'download_count';\r\n\t\t\t\t$type = 'download';\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->setNoRender();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t$this->view->type = $type;\r\n\t\t$this->view->itemOrigTitle = isset($defaultOptions[$defaultOpenTab]) ? $defaultOptions[$defaultOpenTab] : 'items';\r\n\t\t$value['popularCol'] = isset($popularCol) ? $popularCol : 'creation_date';\r\n\t\t$value['fixedData'] = \tisset($fixedData) ? $fixedData : ''; \r\n\t\t//fetch data\r\n\r\n\t\tif($albumPhotoOption == 'photo'){\r\n\t\t$paginator = Engine_Api::_()->getDbTable('photos', 'sesalbum')->tabWidgetPhotos($value);\r\n\t\t}else{\r\n\t\t\t$paginator = Engine_Api::_()->getDbTable('albums', 'sesalbum')->tabWidgetAlbums($value);\r\n\t\t}\r\n $this->view->paginator = $paginator ;\r\n // Set item count per page and current page number\r\n $paginator->setItemCountPerPage($this->_getParam('itemCountPerPage',$limit_data));\r\n\t\t$this->view->page = $page ;\r\n $paginator->setCurrentPageNumber($page);\r\n\t\t$this->view->canCreate = Engine_Api::_()->authorization()->isAllowed('album', null, 'create');\r\n\t\tif($is_ajax)\r\n\t\t\t$this->getElement()->removeDecorator('Container');\r\n\t\telse{\r\n\t\t\t// Do not render if nothing to show\r\n\t\t\tif( $paginator->getTotalItemCount() <= 0 ) {\r\n\t\t\t\t$nameFunction = 'count'.ucfirst($albumPhotoOption).'s';\r\n\t\t\t\t$checkAlbumCount = Engine_Api::_()->getDbTable($albumPhotoOption.'s', 'sesalbum')->$nameFunction();\r\n\t\t\t\tif( $checkAlbumCount <= 0 ) {\r\n\t\t\t\t\treturn $this->setNoRender();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }", "public function indexAction() {\n if(isset($_SESSION['fhost'])&&isset($_SESSION['fstatus'])&&isset($_SESSION['faction_pay'])){\n $this -> smarty -> assign('fhost', $_SESSION['fhost']);\n $this -> smarty -> assign('fstatus', $_SESSION['fstatus']);\n $this -> smarty -> assign('faction_pay', $_SESSION['faction_pay']);\n } else {\n $this -> smarty -> assign('fhost', \"\");\n $this -> smarty -> assign('fstatus', \"\");\n $this -> smarty -> assign('faction_pay', 2);\n }\n\n\t\tif( ($this->_hasParam('page')&&$this->_getParam('page')==0)\n\t\t\t||!$this->_hasParam('page')\n\t\t\t||(($this->_hasParam('page')&&$this->_getParam('page')>1) && ($this -> orders ->getAdminOrdersPagesCount()<=1 ))\n\t\t\t||($this->_getParam('page')>1&&$this -> orders ->getAdminOrdersPagesCount()<$this->_getParam('page'))\n\t\t){\n\t\t\t$this->_redirect(\"/admin/orders/index/page/1\");\n\t\t}\n\t\t\n\t\t$page = $this->_hasParam('page')?((int)$this->_getParam('page')-1):0;\n\n\t\t$ordersData = $this -> orders ->getAdminOrdersForPage($page);\n\n for($i=0; $i<sizeof($ordersData); $i++){\n if($ordersData[$i]['user_id']>0){\n $userData = $this->users->getUserById($ordersData[$i]['user_id']);\n $ordersData[$i]['client_name'] = $userData['first_name'];\n } else {\n $ordersData[$i]['client_name'] = '';\n }\n }\n\n //die();\n $this -> smarty -> assign('sites', $this->site->getAllSites());\n $this -> smarty -> assign('orders', $ordersData);\n $this -> smarty -> assign('countpage', $this -> orders ->getAdminOrdersPagesCount());\n $this -> smarty -> assign('page',$page+1);\n $this -> smarty -> assign('PageBody', 'admin/orders/items_list.tpl');\n $this -> smarty -> assign('Title', 'Orders List');\n $this -> smarty -> display('admin/index.tpl');\n }", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "function index()\n {\n\t// Build a list of orders\n $map = directory_map('./data/');\n $orders = array();\n \n\tforeach($map as $file)\n {\n if (substr($file, strlen($file) - 4) == \".xml\" && $file != \"menu.xml\")\n {\n $this->order->makeOrder($file);\n $orders[$file] = array('filename' => (string)$file,\n 'order_title' => (substr($file, 0, strlen($file) - 4)), \n 'name' => $this->order->getOrder($file)['customer']);\n }\n }\n \n\t// Present the list to choose from\n\t$this->data['pagebody'] = 'homepage';\n $this->data['orders'] = $orders;\n\t$this->render();\n }", "public function index()\n {\n if(request()->ajax() || request()->wantsJson()){\n $sort= request()->has('sort')?request()->get('sort'):'name';\n $order= request()->has('order')?request()->get('order'):'asc';\n $search= request()->has('searchQuery')?request()->get('searchQuery'):'';\n \n $order= \\DB::table('orders')->select('orders.*')\n ->orderBy(\"$sort\", \"$order\")\n ->paginate(10);\n \n $paginator=[\n 'total_count' => $order->total(),\n 'total_pages' => $order->lastPage(),\n 'current_page' => $order->currentPage(),\n 'limit' => $order->perPage()\n ];\n return response([\n \"data\" => $order->all(),\n \"paginator\" => $paginator,\n \"status_code\" => 200\n ],200);\n }\n\n\n return view('employee.inventory.orders');\n \n }", "public function indexAction() {\n\t\t$this->_model->where_clause(NULL);\n\n\t\tif(!isset($this->params['page'])) {\n\t\t\tself::$params['page'] = 1;\n\t\t} \n\n\t\t$this->_view->data['info'] = $this->_model->getPage($this->params['page'], $this->config->pagination_limit);\n\t\t$this->_view->data['total_items'] = $this->_model->getCount();\n\t\t$this->addModuleTemplate($this->module, 'index');\n\n\t}", "public function index()\n {\n return Order::paginate(5);\n }", "public function actionOrder()\n {\n if (Yii::app()->getRequest()->getIsPostRequest()) {\n $gp = $_POST['order'];\n $orders = array();\n $i = 0;\n foreach ($gp as $k => $v) {\n if (!$v) $gp[$k] = $k;\n $orders[] = $gp[$k];\n $i++;\n }\n sort($orders);\n $i = 0;\n foreach ($gp as $k => $v) {\n /** @var $p GalleryPhoto */\n $p = GalleryPhoto::model()->findByPk($k);\n $p->rank = $orders[$i];\n $p->save(false);\n $i++;\n }\n if ($_POST['ajax'] == true) {\n echo CJSON::encode(array('result' => 'ok'));\n } else {\n $this->redirect($_POST['returnUrl']);\n }\n } else\n throw new CHttpException(403);\n }", "public function index()\n {\n $data[\"page_id\"] = 1;\n $data[\"page_tag\"] = \"Articulos\";\n $data[\"page_title\"] = \"Articulos - Yo contribuyo\";\n $data[\"page_name\"] = \"articulos\";\n $data[\"nav_articulos\"] = \"active\";\n $data[\"script\"] = \"Articulo/articulos.js\";\n $this->getView(\"Articulo/articulos\", $data);\n }", "public function index()\n {\n $this->data['list'] = $this->cms_page_model->get_all();\n \n $this->template->load_asset(array('datatable', 'dialog', 'bootstrap_switch'));\n \n $this->template->build('admin/cms/page/index', $this->data);\n }", "public function pageAction(){\n $this->_request->setParam('table', 'Page'); \n \t$this->view->gridIndexRoute = Rhema_Constant::ROUTE_GRID_INDEX ; \t \n \t$this->_helper->displayGrid(); \t \n }", "function admin_index()\n\t{\n\t $this->set('pagetitle',\"Manage Pages\");\n\t $this->paginate=array('order'=>'Page.name ASC');\n\t $lists = $this->paginate('Page');\n\t $this->set('list', $lists);\n\t \n\t if((isset($this->data[\"Page\"][\"setStatus\"])))\n\t {\n\t\t$status = ife($_POST['active'],1,0);\n\t\t$record = $this->data[\"Page\"][\"Record\"];\n\t\t$CheckedList=$_POST['box1'];\n\t\t$controller= $this->params['controller'];\n\t\t$action='index'; \n\t\t$prefix='admin';\n\t\t$model='Page';\n\t\t$relation=null;\n\t\t\n\t\tswitch($status)\n\t\t{ \n\t\t case '1': \n\t\t\t$this->setStatus('1',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break;\n\t\t case '0':\n\t\t\t$this->setStatus('0',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break; \n\t\t}\n\t }\n\t}", "function load_page($args=''){//$page,$maxrows,$order,$ordertype,$capa,\n\t\t$r= getResponse();\t\t\n\t\tsetLocaleMode();\n\t\tif (!xvalidaAcceso($r,PAGE_PRIV)){\n\t\t\t$r->assign($capa,inner,'Acceso denegado');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t//$r->alert($args);\n\t\t$c = new connection();\n\t\t$c->open();\n\t\t\n\t\t\n\t\t$sa_paquetes = $c->sa_v_paquetes;\n\t\t$query = new query($c);\n\t\t$query->add($sa_paquetes);\n\t\t$paginador = new fastpaginator('xajax_load_page',$args,$query);\n\t\t$arrayFiltros=array(\n\t\t\t'Empresa'=>array(\n\t\t\t\t'change'=>'h_empresa',\n\t\t\t\t'addevent'=>\"obj('empresa').value='';\"\n\t\t\t),\n\t\t\t'busca'=>array(\n\t\t\t\t'title'=>'B&uacute;squeda',\n\t\t\t\t'event'=>'restablecer();'\n\t\t\t),\n\t\t\t'fecha'=>array(\n\t\t\t\t'title'=>'Fecha'\n\t\t\t)\n\t\t);\n\t\t$argumentos = $paginador->getArrayArgs();\n\t\t$aplica_iva=($argumentos['iva']==1);\n\t\t$id_empresa=$argumentos['h_empresa'];\n\t\t$query->where(new criteria(sqlEQUAL,$sa_paquetes->id_empresa,$id_empresa));\n\t\t\n\t\tif($id_empresa==null){\n\t\t\t$r->assign($paginador->layer,inner,'Seleccione una Empresa');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t$rec=$paginador->run();\n\t\tif($rec){\n\t\t\tforeach($rec as $v){\n\t\t\t\t//buscando las unidades basicas del paquete\n\t\t\t\t$unidades=$c->sa_v_informe_tempario_unidades->doSelect($c, new criteria(sqlEQUAL,'id_paquete',$v->id_paquete))->getAssoc('id_paq_unidad','nombre_unidad_basica');\n\t\t\t\t$lista_unidades=implode(',',$unidades);\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"40%\" /><thead>';\n\t\t\t\t\n\t\t\t\t$html.='<tr><td>PAQUETE</td><td>Descripci&oacute;n</td><td>Unidades</td></tr></thead><tbody>';\n\t\t\t\t$html.='<tr><td>'.$v->codigo_paquete.'</td><td>'.$v->descripcion_paquete.'</td><td>'.$lista_unidades.'</td></tr></tbody></table>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"20%\" /><thead><tr><td>Codigo</td><td>Descripci&oacute;n</td><td>Unidad</td><td>Cantidad</td><td style=\"display:none;\">Precio</td><td style=\"display:none;\">Importe</td></tr></thead><tbody>';\n\t\t\t\t//cargando los detalles de tempario\n\t\t\t\t$sa_v_paq_tempario=$c->sa_paq_tempario;\n\t\t\t\t$sa_tempario= new table('sa_v_tempario','',$c);\n\t\t\t\t$join= $sa_tempario->join($sa_v_paq_tempario,$sa_tempario->id_tempario,$sa_v_paq_tempario->id_tempario);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_tempario->id_paquete,$v->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $temp){\n\t\t\t\t\t\t$html.='<tr><td>'.$temp->codigo_tempario.'</td><td>'.$temp->descripcion_tempario.'</td><td>'.$temp->descripcion_modo.'</td><td>N/A</td><td style=\"display:none;\">'.$temp->precio.'</td><td style=\"display:none;\">'.$temp->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sa_v_paq_repuestos=$c->sa_paquete_repuestos;\n\t\t\t\t$iv_articulos= new table('iv_articulos','',$c);\n\t\t\t\t$join= $iv_articulos->join($sa_v_paq_repuestos,$iv_articulos->id_articulo,$sa_v_paq_repuestos->id_articulo);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_repuestos->id_paquete,$rec->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $rep){\n\t\t\t\t\t\t$html.='<tr><td>'.$rep->codigo_articulo.'</td><td>'.$rep->descripcion.'</td><td>'.$rep->unidad.'</td><td>'.$rep->cantidad.'</td><td style=\"display:none;\">'.$rep->precio.'</td><td style=\"display:none;\">'.$rep->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html.='</tbody></table><br />';\n\t\t\t}\n\t\t}\n\t\t$html.='<br />Informe Generado el '.date(DEFINEDphp_DATETIME12).' - Empresa: '.$argumentos['Empresa'].'<strong>'.$tiva.'</strong>';\n\t\t$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div>');\n\t\t\n\t\t/*if($argumentos['busca']!=''){\n\t\t\t$query->where(\n\t\t\t\tnew criteria(sqlOR, array(\n\t\t\t\t\tnew criteria(' like ',$sa_paquetes->descripcion_paquete,\"'%\".$argumentos['busca'].\"%'\")//,\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->chasis,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->color,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$c->pg_empresa->nombre_empresa,\"'%\".$argumentos['busca'].\"%'\")\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t}\n\t\tif($argumentos['fecha']!=''){\n\t\t\t$query->where(new criteria(' = ',\"DATE_FORMAT(\".$sa_paquetes->fecha_rev.\",'%d-%m-%Y')\",\"'\".$argumentos['fecha'].\"'\"));\t\t\t\n\t\t}\n\t\tif($argumentos['h_empresa']!=''){\n\t\t\t$query->where(new criteria(sqlEQUAL,\"id_empresa\",\"'\".$argumentos['h_empresa'].\"'\"));\t\t\t\n\t\t}else{\n\t\t\t$arrayFiltros['Empresa']['hidden']=1;\n\t\t}*/\n\t\t//$r->alert($argumentos['h_empresa']);\n\t\t\n\t\t//$rec=$paginador->run();\n\t\t\n\t\t/*if($rec){\n\t\t\tif($rec->getNumRows()==0){\n\t\t\t\t$html.='<div class=\"order_empty\">No se han encontrado registros</div>';\n\t\t\t}else{\n\t\t\t\t$html.='<table class=\"order_table\"><thead><tr class=\"xajax_order_title\">\n\t\t\t\t\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->id_paquete,'ID').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->codigo_paquete,'C&oacute;digo').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->descripcion_paquete,'Descripci&oacute;n').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->nombre_empresa_sucursal,'Empresa').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->fecha_rev,'Fecha').'</td>\n\t\t\t\t</tr></thead><tbody>';\n\t\t\t\t$class='';\n\t\t\t\tforeach($rec as $v){\n\t\t\t\t\tif ($rec->parcial == '1')\n\t\t\t\t\t\t$parcial = 'Si';\n\t\t\t\t\telse\n\t\t\t\t\t\t$parcial = 'No';\n\t\t\t\t\t$html.='<tr class=\"'.$class.'\">\n\t\t\t\t\t\n\t\t\t\t\t<td align=\"center\">'.$rec->id_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->codigo_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->descripcion_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->nombre_empresa_sucursal.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->fecha_rev.'</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t\tif($class==''){\n\t\t\t\t\t\t$class='impar';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$class='';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html.='</tbody></table>';\n\t\t\t}\n\t\t\t\n\t\t}*/\n\t\t\n\t\t$r->assign($paginador->layer,inner,$html);\n\t\t\n\t\t\n\t\t//$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div><div class=\"ifilter\">'.$paginador->getRemoveFilters('datos',$arrayFiltros).'</div>');\n\n\t\t$r->assign('campoFecha','value',$fec);\n\t\t\n\t\t$r->script($paginador->fillJS('datos'));\n\t\n\t\t$c->close();\n\t\treturn $r;\n\t}", "public function ajaxAction(){\n \t$em = $this->getDoctrine()->getManager();\n \t\n \t$page = $_GET['page']; // get the requested page\n \t$limit = $_GET['rows']; // get how many rows we want to have into the grid\n \t$sidx = $_GET['sidx']; // get index row - i.e. user click to sort\n \t$sord = $_GET['sord']; // get the direction\n \n \t$criteria = array();\n \tif(isset($_GET['numDossier'])) $criteria['numDossier']=$_GET['numDossier'];\n// $statutRefuse = $em->getRepository('PenderieDefaultBundle:StatutDossier')->find(Dossier::STATUT_REFUSE_AUTOMATIQUE);\n \n// \t$criteria['statut']=$statutRefuse;\n \t// TODO : ajouter la selection par date du jour plus utilisateur connecté\n// \t$criteria['dateRefus']=array((new \\DateTime('2014-07-16'))->format('Y-m-d'));\n \n \t$count = $em->getRepository('PenderieDefaultBundle:Dossier')->getNbResultatsRefus($criteria, $this->getUser());\n \t$entities = $em->getRepository('PenderieDefaultBundle:Dossier')->getSearchRefus($criteria, $this->getUser(), array($sidx=>$sord), $limit, $page);\n \tif( $count >0 ) {\n \t\t$total_pages = ceil($count/$limit);\n \t} else {\n \t\t$total_pages = 0;\n \t}\n \tif ($page > $total_pages) $page=$total_pages;\n \t$start = $limit*$page - $limit; // do not put $limit*($page - 1)\n \n \t$responce = new \\stdClass();\n \t$responce->page = $page;\n \t$responce->total = $total_pages;\n \t$responce->records = $count;\n \t$i=0;\n \tforeach ($entities as $dossier) {\n \t\t$responce->rows[$i]['id']=$dossier->getId();\n \t\t$responce->rows[$i]['cell']=array(\n \t\t\t\t$dossier->getNumDossier(),\n \t\t\t\t$dossier->getStatut()->getLibelle(),\n \t\t\t\t($dossier->getDateRefus())?$dossier->getDateRefus()->format('d/m/Y'):\"\",\n \t\t);\n \t\t$i++;\n \t}\n \treturn new JsonResponse($responce);\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function ajaxReorderList()\n\t{\n\t\t$this->saveReorder($_POST['sort']['order-posts-list-nested']);\t\n\t}", "public function sort() {\n\t\tif ($this->request->is('post')) {\n\t\t\t$order = explode(\",\", $_POST['order']);\n\t\t\t$i = 1;\n\t\t\tforeach ($order as $photo) {\n\t\t\t\t$this->Picture->read(null, $photo);\n\t\t\t\t$this->Picture->set('order', $i);\n\t\t\t\t$this->Picture->save();\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$this->render(false, false);\n\t}", "public function index_ajax()\n {\n $this->department->getDepartmentAjax();\n }", "public function index()\n {\n $data['anggota'] = Anggota::orderBy('id','desc')->paginate(5);\n return view('ajax-anggota',$data);\n }", "public function enlacesPaginas(){\n if ( isset($_GET[\"action\"])) {\n $enlaces = $_GET[\"action\"];\n }else {\n $enlaces = \"index\";\n }\n\n\n $respuesta = ClsRoutes::routes($enlaces);\n include $respuesta;\n }", "public function indexAction()\n\t{\n\t\t$this->loadLayout();\n\n// This block will point to the file Block/Adminhtml/Order/Items.php\n\t\t$block = $this->getLayout()->createBlock('backend/adminhtml_order_items');\n\t\t$this->_addContent($block);\n\n// Render the layout\n\t\t$this->renderLayout();\n\t}", "public function index()\r\n {\r\n // // 引入实体类\r\n // $orderModel = new OrderModel();\r\n // // 数据查询\r\n // $orders = Db::name('order')->order(\"id asc\")->select();\r\n // $orders = Db::name('order')->order(\"id asc\")->select();\r\n $orders = Db::name('order')->order(\"id asc\")->paginate(10);\r\n // $orderModel1 = OrderModel::get(1);\r\n // echo '<pre>', $orderModel, '</pre>';\r\n // echo '<pre>', $orders, '</pre>';\r\n // echo '<pre>', $orderModel1['paymentType'], '</pre>';\r\n // $routeModel->getRoutes(true);\r\n $page = $orders->render();\r\n // 把查询的数据 放到对应的前端中去\r\n $this->assign(\"orders\", $orders);\r\n $this->assign(\"page\", $page);\r\n return $this->fetch();\r\n }", "public function indexAction() {\n try {\n \n $pageHeading = \"Orders\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n \n $orderStatus = $this->_getParam('order-status', 0);\n if ($orderStatus == 1) {\n $orderStatus = \"\";\n }\n \n $status = $this->_request->getParam('status');\n $clientId = $this->_request->getParam('client');\n \n $objPaggination = new Base_Model_ObtorLib_Base_Lib_Paggination();\n\n $objOrderService = new Base_Model_Lib_Order_Service_Order();\n $objOrderEntity = new Base_Model_Lib_Order_Entity_Order();\n $objOrderEntity->setStatus($orderStatus);\n $objOrderEntity->setUserId($clientId);\n\n $objOrderService->order = $objOrderEntity;\n\n $totalResult = $objOrderService->searchCount();\n $page = $this->_getParam('page', 1);\n $objPaggination->CurrentPage = $page;\n $objPaggination->TotalResults = $totalResult;\n $paginationData = $objPaggination->getPaggingData();\n $pageLimit1 = $paginationData['MYSQL_LIMIT1'];\n $pageLimit2 = $paginationData['MYSQL_LIMIT2'];\n\n $limit = \" LIMIT $pageLimit1,$pageLimit2\";\n\n if ($page == '') {\n $page = 1;\n }\n\n $result = $objOrderService->search($limit);\n $this->view->orders = $result;\n $this->view->paggination = $objPaggination;\n\n $this->view->pageNum = $page;\n $this->view->status = $status;\n $this->view->orderStatus = $orderStatus;\n \n } catch (Exception $ex) {\n throw new Exception('<ERROR>' . $ex->getMessage() . \"\\n\");\n }\n }", "function admin_index()\n {\n $perPage = 100;\n $this->lordModel('Post');\n $condition = array('type' => 'post');\n $d['posts'] = $this->Post->find(array(\n 'condition' => $condition,\n 'limit' => ($perPage * ($this->request->page - 1)) . ',' . $perPage\n ));\n $d['total'] = $this->Post->findCount($condition);\n $d['nbrPage'] = ceil($d['total'] / $perPage);\n //print_r($d);\n $this->setvars($d);\n //$this->setvars('phrase', 'bienvenue sur ma page');\n //$this->render('view');\n }", "public function ajaxOrdering() {\n $app = $this->getApplication();\n $text = $this->getContainer()->get('language')->getText();\n $result = new \\stdClass();\n\n // Bad request par défaut.\n $result->status = 400;\n $result->error = true;\n\n // On contrôle le jeton de la requête.\n if (!$app->checkToken()) {\n $result->status = 403;\n $result->message = $text->translate('APP_ERROR_INVALID_TOKEN');\n\n return $result;\n }\n\n $model = $this->getModel();\n $input = $this->getInput();\n\n $pks = $input->get('pks', [], 'array');\n $ordering = $input->get('ordering', [], 'array');\n\n if (empty($pks) || empty($ordering) || count($pks) != count($ordering)) {\n $result->message = $text->translate('APP_ERROR_BAD_REQUEST');\n return $result;\n }\n\n if (!$model->setOrdering($pks, $ordering)) {\n $result->status = 500;\n $error = $model->getError();\n if ($error instanceof \\Exception) {\n $error = $error->getMessage();\n }\n $result->message = $error;\n\n return $result;\n }\n\n // Si on est ici c'est OK.\n $result->status = 200;\n $result->error = false;\n\n return $result;\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Ordering')->findAll();\n\n return $this->render('AppBundle:Ordering:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index()\n {\n $allorder= [];\n if(auth()->user()->level == 'admin' )\n {\n $allorder= Order::paginate(10);\n }\n else{\n $allorder=Order::where('user_id',auth()->user()->id)->paginate(10);\n }\n\n \n return view(ad.'.order.index',['title'=>trans('admin.order'),'all'=>$allorder]);\n }", "public function indexAction() {\r\n if (isset($_POST['params']))\r\n $params = ($_POST['params']);\r\n $this->view->is_ajax = $is_ajax = isset($_POST['is_ajax']) ? true : false;\r\n $page = isset($_POST['page']) ? $_POST['page'] : 1;\r\n $this->view->identityForWidget = isset($_POST['identity']) ? $_POST['identity'] : '';\r\n $this->view->defaultOptionsArray = $defaultOptionsArray = $this->_getParam('search_type',array('recentlySPcreated','mostSPviewed','mostSPliked','mostSPcommented','mostSPrated','mostSPfavourite','hot','featured','sponsored'));\r\n $this->view->loadOptionData = $loadOptionData = isset($params['pagging']) ? $params['pagging'] : $this->_getParam('pagging', 'auto_load');\r\n $this->view->widgetType = 'tabbed';\r\n if (!$is_ajax && is_array($defaultOptionsArray)) {\r\n $defaultOptions = $arrayOptions = array();\r\n foreach ($defaultOptionsArray as $key => $defaultValue) {\r\n if ($this->_getParam($defaultValue . '_order'))\r\n $order = $this->_getParam($defaultValue . '_order') . '||' . $defaultValue;\r\n else\r\n $order = (1000 + $key).'||'.$defaultValue;\r\n if ($this->_getParam($defaultValue.'_label'))\r\n $valueLabel = $this->_getParam($defaultValue.'_label');\r\n else {\r\n if ($defaultValue == 'recentlySPcreated')\r\n $valueLabel = 'Recently Created';\r\n else if ($defaultValue == 'mostSPviewed')\r\n $valueLabel = 'Most Viewed';\r\n else if ($defaultValue == 'mostSPliked')\r\n $valueLabel = 'Most Liked';\r\n else if ($defaultValue == 'mostSPcommented')\r\n $valueLabel = 'Most Commented';\r\n else if ($defaultValue == 'mostSPrated')\r\n $valueLabel = 'Most Rated';\r\n else if ($defaultValue == 'mostSPfavourite')\r\n $valueLabel = 'Most Favourite';\r\n else if ($defaultValue == 'hot')\r\n $valueLabel = 'Hot';\r\n else if ($defaultValue == 'featured')\r\n $valueLabel = 'Featured';\r\n else if ($defaultValue == 'sponsored')\r\n $valueLabel = 'Sponsored';\r\n }\r\n $arrayOptions[$order] = $valueLabel;\r\n }\r\n ksort($arrayOptions);\r\n $counter = 0;\r\n foreach ($arrayOptions as $key => $valueOption) {\r\n $key = explode('||',$key);\r\n if ($counter == 0)\r\n $this->view->defaultOpenTab = $defaultOpenTab = $key[1];\r\n $defaultOptions[$key[1]] = $valueOption;\r\n $counter++;\r\n }\r\n $this->view->defaultOptions = $defaultOptions;\r\n }\r\n if (isset($_GET['openTab']) || $is_ajax) {\r\n $this->view->defaultOpenTab = $defaultOpenTab = (isset($_GET['openTab']) ? str_replace('_', 'SP', $_GET['openTab']) : ($this->_getParam('openTab') != NULL ? $this->_getParam('openTab') : (isset($params['openTab']) ? $params['openTab'] : '' )));\r\n }\r\n $this->view->height_list = $defaultHeightList = isset($params['height_list']) ? $params['height_list'] : $this->_getParam('height_list','160');\r\n $this->view->width_list = $defaultWidthList = isset($params['width_list']) ? $params['width_list'] : $this->_getParam('width_list','140');\r\n\t\t$this->view->height_grid = $defaultHeightGrid = isset($params['height_grid']) ? $params['height_grid'] : $this->_getParam('height_grid','160');\r\n $this->view->width_grid = $defaultWidthGrid = isset($params['width_grid']) ? $params['width_grid'] : $this->_getParam('width_grid','140');\r\n\t\t$this->view->width_pinboard = $defaultWidthPinboard = isset($params['width_pinboard']) ? $params['width_pinboard'] : $this->_getParam('width_pinboard','300');\r\n $this->view->title_truncation_list = $title_truncation_list = isset($params['title_truncation_list']) ? $params['title_truncation_list'] : $this->_getParam('title_truncation_list', '100');\r\n $this->view->title_truncation_grid = $title_truncation_grid = isset($params['title_truncation_grid']) ? $params['title_truncation_grid'] : $this->_getParam('title_truncation_grid', '100');\r\n\t\t$this->view->title_truncation_pinboard = $title_truncation_pinboard = isset($params['title_truncation_pinboard']) ? $params['title_truncation_pinboard'] : $this->_getParam('title_truncation_pinboard', '100');\r\n $this->view->description_truncation_list = $description_truncation_list = isset($params['description_truncation_list']) ? $params['description_truncation_list'] : $this->_getParam('description_truncation_list', '100');\r\n\t\t$this->view->description_truncation_grid = $description_truncation_grid = isset($params['description_truncation_grid']) ? $params['description_truncation_grid'] : $this->_getParam('description_truncation_grid', '100');\r\n\t\t$this->view->description_truncation_pinboard = $description_truncation_pinboard = isset($params['description_truncation_pinboard']) ? $params['description_truncation_pinboard'] : $this->_getParam('description_truncation_pinboard', '100');\r\n $show_criterias = isset($params['show_criterias']) ? $params['show_criterias'] : $this->_getParam('show_criteria', array('like', 'comment', 'rating', 'by', 'title', 'featuredLabel', 'sponsoredLabel', 'watchLater', 'category', 'description_list','description_grid','description_pinboard', 'duration', 'hotLabel', 'favouriteButton', 'playlistAdd', 'likeButton', 'socialSharing', 'view'));\r\n if(is_array($show_criterias)){\r\n\t\t\tforeach ($show_criterias as $show_criteria)\r\n \t$this->view->{$show_criteria . 'Active'} = $show_criteria;\r\n\t\t}\r\n\t\t$this->view->bothViewEnable = false;\r\n if (!$is_ajax) {\r\n $this->view->optionsEnable = $optionsEnable = $this->_getParam('enableTabs', array('list', 'grid', 'pinboard'));\r\n $view_type = $this->_getParam('openViewType', 'list');\r\n if (count($optionsEnable) > 1) {\r\n $this->view->bothViewEnable = true;\r\n }\r\n }\r\n\t\t $this->view->limit_data_pinboard = $limit_data_pinboard = isset($params['limit_data_pinboard']) ? $params['limit_data_pinboard'] : $this->_getParam('limit_data_pinboard', '10');\r\n\t\t$this->view->limit_data_grid = $limit_data_grid = isset($params['limit_data_grid']) ? $params['limit_data_grid'] : $this->_getParam('limit_data_grid', '10');\r\n\t\t$this->view->limit_data_list = $limit_data_list = isset($params['limit_data_list']) ? $params['limit_data_list'] : $this->_getParam('limit_data_list', '10');\r\n $this->view->view_type = $view_type = (isset($_POST['type']) ? $_POST['type'] : (isset($params['view_type']) ? $params['view_type'] : $view_type));\r\n\t\t$this->view->viewTypeStyle = $viewTypeStyle = (isset($_POST['viewTypeStyle']) ? $_POST['viewTypeStyle'] : (isset($params['viewTypeStyle']) ? $params['viewTypeStyle'] : $this->_getParam('viewTypeStyle','fixed')));\r\n\t\t$limit_data = $this->view->{'limit_data_'.$view_type};\r\n\t\t$show_limited_data = isset($params['show_limited_data']) ? $params['show_limited_data'] :$this->_getParam('show_limited_data', 'no');\r\n\t\tif($show_limited_data == 'yes')\r\n\t\t\t$this->view->show_limited_data = true;\r\n $params = $this->view->params = array('height_list' => $defaultHeightList, 'width_list' => $defaultWidthList,'height_grid' => $defaultHeightGrid, 'width_grid' => $defaultWidthGrid,'width_pinboard' => $defaultWidthPinboard,'limit_data_pinboard' => $limit_data_pinboard,'limit_data_list'=>$limit_data_list,'limit_data_grid'=>$limit_data_grid, 'openTab' => $defaultOpenTab, 'pagging' => $loadOptionData, 'show_criterias' => $show_criterias, 'view_type' => $view_type, 'description_truncation_list' => $description_truncation_list, 'title_truncation_list' => $title_truncation_list, 'title_truncation_grid' => $title_truncation_grid,'title_truncation_pinboard'=>$title_truncation_pinboard,'description_truncation_grid'=>$description_truncation_grid,'description_truncation_pinboard'=>$description_truncation_pinboard,'show_limited_data'=>$show_limited_data,'viewTypeStyle' =>$viewTypeStyle);\r\n $this->view->loadMoreLink = $this->_getParam('openTab') != NULL ? true : false;\r\n // custom list grid view options\r\n $options = array('tabbed' => true, 'paggindData' => true);\r\n $this->view->optionsListGrid = $options;\r\n $this->view->widgetName = 'tabbed-widget-video';\r\n $this->view->showTabType = $this->_getParam('showTabType', '1');\r\n // initialize type variable type\r\n $type = '';\r\n switch (@$defaultOpenTab) {\r\n case 'recentlySPcreated':\r\n $popularCol = 'creation_date';\r\n $type = 'creation';\r\n break;\r\n case 'mostSPviewed':\r\n $popularCol = 'view_count';\r\n $type = 'view';\r\n break;\r\n case 'mostSPliked':\r\n $popularCol = 'like_count';\r\n $type = 'like';\r\n break;\r\n case 'mostSPcommented':\r\n $popularCol = 'comment_count';\r\n $type = 'comment';\r\n break;\r\n case 'mostSPrated':\r\n $popularCol = 'rating';\r\n $type = 'rating';\r\n break;\r\n case 'mostSPfavourite':\r\n $popularCol = 'favourite_count';\r\n $type = 'favourite';\r\n break;\r\n case 'hot':\r\n $popularCol = 'is_hot';\r\n $type = 'is_hot';\r\n $fixedData = 'is_hot';\r\n break;\r\n case 'featured':\r\n $popularCol = 'is_featured';\r\n $type = 'is_featured';\r\n $fixedData = 'is_featured';\r\n break;\r\n case 'sponsored':\r\n $popularCol = 'is_sponsored';\r\n $type = 'is_sponsored';\r\n $fixedData = 'is_sponsored';\r\n break;\r\n }\r\n $this->view->type = $type;\r\n $value['popularCol'] = isset($popularCol) ? $popularCol : '';\r\n $value['fixedData'] = isset($fixedData) ? $fixedData : '';\r\n $value['status'] = 1;\r\n $value['search'] = 1;\r\n $value['watchLater'] = true;\r\n $this->view->tabbed_widget = true;\r\n $paginator = Engine_Api::_()->getDbTable('videos', 'sesvideo')->getVideo($value);\r\n $this->view->paginator = $paginator;\r\n // Set item count per page and current page number\r\n $paginator->setItemCountPerPage($limit_data);\r\n $this->view->page = $page;\r\n $paginator->setCurrentPageNumber($page);\r\n if ($is_ajax)\r\n $this->getElement()->removeDecorator('Container');\r\n else {\r\n // Do not render if nothing to show\r\n if ($paginator->getTotalItemCount() <= 0) {\r\n $checkVideoCount = Engine_Api::_()->getDbTable('videos', 'sesvideo')->countVideos();\r\n if ($checkVideoCount->getTotalItemCount() <= 0) {\r\n return $this->setNoRender();\r\n }\r\n }\r\n }\r\n }", "function bh_ajax_sort_posts(){\n\t?>\n <script>\n\t//add drop-downs to js pages\n\t$jq('.select-post-sorting').html(\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'<form action=\"#\">Sort by:<select name=\"posts_sort\" class=\"posts_sort\"><option value=\"newest\">Release Date, Newest First</option><option value=\"oldest\">Release Date, OIdest First</option><option value=\"az\">Product Title, A-Z</option><option value=\"za\">Product Title, Z-A</option></select> Quantity: <select name=\"posts_number\" class=\"posts_number\"><option value=\"10\">10</option><option value=\"15\">15</option><option value=\"20\">20</option><option value=\"25\" selected>25</option><option value=\"50\">50</option></select></form>'\n\t);\n\t\n\t//collect dropdown data\n\t$jq('.select-post-sorting select').on('change',function(){\n\t\t//get value from each box\n\t\t$sortby = $jq('.posts_sort').val();\n\t\t$number = $jq('.posts_number').val();\n\t\tvar loc = String(window.location);\n\t\t$link = loc.substring(0,(loc.lastIndexOf('/')+1));\n\t\tswitch($sortby){\n\t\t\tcase 'oldest':\n\t\t\to = '?orderby=pubdate&order=ASC';\n\t\t\tbreak;\n\t\t\tcase 'az':\n\t\t\to = '?orderby=title&order=ASC';\n\t\t\tbreak;\n\t\t\tcase 'za':\n\t\t\to = '?orderby=title&order=DESC';\n\t\t\tbreak;\n\t\t\tdefault: //newest\n\t\t\to = '?orderby=pubdate&order=DESC';\n\t\t}\t\n\t\t\n\t\tif($number){\n\t\t\tn='&ppp='+$number;\t\n\t\t\t}else{\n\t\t\tn='&ppp=25';\n\t\t\t//default 25\t\n\t\t}\n\t\t$link = $link + o + n;\n\t\t//v1 - load new page in div\n\t\t$plist = $jq('.product-category.product-list');\n\t\t$plist.fadeOut(300,function(){\n\t\t\t$jq(this).load($link + ' .product-category.product-list',function(){\n\t\t\t\t\t\t$plist.fadeIn(500);\n\t\t\t\t\t\t\t\t\t// update page url/hash \n\t\t\t\t\t\t\t\t\tif($link!=window.location){\n\t\t\t\t\t\t\t\t\t\t\t\t//window.history.pushState({path:$link},'',$link);\n\t\t\t\t\t\t\t\t\t} // if new url doesn't match current location\n\t\t\t\t}); //end load\n\t\t}); //end fade\n\t\t\n\t}); //end jq\n\n\t</script>\n\t<?php\n\t//v2 - use admin-ajax\n}", "public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }", "public function index()\n {\n //\n return OrderResource::collection(Order::paginate());\n }", "public function index(Request $request)\n {\n //\n if($request->ajax()){\n return response()->json(OrderResource::collection(Order::where('is_complete', false)->get()));\n }\n else{\n return view('orders');\n }\n }", "public function writeRecords_pages_order() {}", "public function order()\n {\n //加载用户下订单页面\n return view('Home/Order/order') ;\n }", "function pagination(){}", "function display() {\n\n\t\twp_nonce_field( 'ajax-custom-list-nonce', '_ajax_custom_list_nonce' );\n\n\t\techo '<input type=\"hidden\" id=\"order\" name=\"order\" value=\"' . $this->_pagination_args['order'] . '\" />';\n\t\techo '<input type=\"hidden\" id=\"orderby\" name=\"orderby\" value=\"' . $this->_pagination_args['orderby'] . '\" />';\n\n\t\tparent::display();\n\t}", "public function action_index()\n {\n /**\n *\n * If it was an ajax request, we only want to return a JSON object.\n *\n */\n if (Request::ajax())\n return Response::eloquent(Gig::find(1));\n else\n return $this->servePage('gig.gigs', array('gig' => Gig::find(1)));\n }", "public function get_index(){\n\n\t\tSession::put('href.previous', URL::current());\n\n\t\t$data = array();\n\t\t$data[\"page\"] = 'admin.media.main';\n\t\t$data[\"media\"] = Media::order_by('created_at', 'desc')->get();\n\n\t\treturn (Request::ajax()) ? View::make($data[\"page\"], $data) : View::make('admin.assets.no_ajax', $data);\n\t}", "public function index()\n {\n $result['result'] = $this->zipcode->findAll();\n $result['page'] = 'zipcode';\n $result['page_number'] = (isset($_GET['page']) && $_GET['page']) ? $_GET['page'] : 0;\n if (RequestFacade::ajax()) {\n return view('admin.zip_code_table', $result);\n }\n return view('admin.zipcode', $result);\n }", "public function index()\n {\n Config::setJsConfig('curPage', 'downloads-index');\n parent::displayIndex(get_class());\n }", "public function index(Request $request)\n {\n\t\t$query=null;\n\t\t$aciunta=\"\";\n\t\t\n\t\tif ($request->filled('order')) {\n\t\t\t$by=$request->order;\n\t\t\t$dir=$request->dir;\n\t\t\t\n\t\t} else {\n\t\t\t$by='id';\n\t\t\t$dir='asc';\n\t\t}\n\t\t\n \t$items = QueryModel::orderBy($by, $dir)->paginate(config('labimus.options.option_paginate'));\n\t\t\t\t\n $det=$this->det;\n $noadd=true;\n \n\t\tif (($request->has('page'))&&($request->ajax())) {\n\t\t\treturn view('query_rows',compact('items','det','aciunta','query'));\n\t\t} \n\t\telseif ($request->ajax())\n\t\t{\t\t\t\t\t\n\t\t\treturn view('layouts/table2',compact('items','det','aciunta','query','noadd'));\n\t\t}\n }", "function index()\n {\n\t// Build a list of orders\n $this->load->helper('directory');\n $this->load->model('order');\n $map = directory_map('data/', 1);\n $orders = array();\n \n // Generate array of XML files\n foreach ($map as $order)\n {\n $fileparts = pathinfo($order);\n if ($fileparts['extension'] == 'xml' && $fileparts['basename'] != 'menu.xml')\n {\n $this->order->loadFile(DATAPATH . $fileparts['basename']);\n \n $orders[] = array(\n 'filename' => substr($fileparts['basename'], 0, strlen($fileparts['basename']) - 4),\n 'name' => $this->order->getCustomer()\n );\n }\n }\n\t\n\t// Present the list to choose from\n $this->data['orders'] = $orders;\n\t$this->data['pagebody'] = 'homepage';\n\t$this->render();\n }", "function ListPage_Ajax(&$params) \n\t{\n\t\t// call parent constructor\n\t\tparent::ListPage ($params);\t\n\t}", "public function sort(){\n $this->session->order_by = $this->input->post(\"order_by\");\n $this->session->order_direction = $this->input->post(\"order_direction\");\n redirect(\"crm/oc/page/\".$this->session->page);\n }", "public function index()\n {\n $kredits = Kredit::where('status',1)->paginate(12);\n\n return view('paneladmin/indexOrder',['kredits'=>$kredits]);\n }", "public function admincp_index()\n {\n modules::run('admincp/chk_perm', $this->session->userdata('ID_Module'), 'r', 0);\n $default_func = 'order_num';\n $default_sort = 'ASC';\n $data = array(\n 'module' => $this->module,\n 'module_name' => $this->session->userdata('Name_Module'),\n 'default_func' => $default_func,\n 'default_sort' => $default_sort\n );\n\n $this->template->write_view('content', 'BACKEND/index', $data);\n $this->template->render();\n }", "public function index()\r\r\r\n\t{\r\r\r\n\t\t/*=============================================\r\r\r\n\t\t\t1.\tDATA FOR ALL PAGE ( FROM api_controller )\r\r\r\n\t\t=============================================*/\r\r\r\n\t\t$data = $this->data_for_all_pages();\r\r\r\n\t\t\r\r\r\n\t\t/*=============================================\r\r\r\n\t\t\t3.\tRESPONSE JSON \r\r\r\n\t\t=============================================*/\r\r\r\n\t\t$status \t= self::SUCCESS;\r\r\r\n\t\t$message \t= '';\r\r\r\n\t\t$this->jsonout(\t$status,\r\r\r\n\t\t\t\t\t\t$message, \r\r\r\n\t\t\t\t\t\t$data\r\r\r\n\t\t\t\t\t\t);\r\r\r\n\t\texit ;\r\r\r\n\t}", "public function actionIndex()\n\t{\n\t\t$model = new Order('search');\n\n\t\tif (!empty($_GET['Order']))\n\t\t\t$model->attributes = $_GET['Order'];\n\n\t\t$dataProvider = $model->search();\n\t\t$dataProvider->pagination->pageSize = Yii::app()->settings->get('core', 'productsPerPageAdmin');\n\n\t\t$this->render('index', array(\n\t\t\t'model'=>$model,\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t));\n\t}", "public function index()\n {\n //\n return view('admin.itemsList.orderList')->with([\n 'orders' => Order::orderBy('created_at', 'desc')->paginate(6)\n ]);\n }", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "public function indexAction()\n {\n $products = array();\n $products = ShoppingProducts::fetchAll(\n array(\n 'orderBy' => 'id desc',\n /*'paginate' => array(\n 'limit' => Url::segment(3)\n )*/\n )\n );\n\t\t\n $this->render('index')->with(\n array(\n 'products' => $products,\n 'links' => ShoppingProducts::createLinks(),\n 'title' => '',\n 'baseUrl' => Url::getBase(),\n 'pageNumber' => Url::segment(3),\n 'styles' => array(\n 'table' => Assets::addStyle('webroot/css/cygnite/table.css'),\n ),\n 'buttonAttributes' => array(\n 'primary' => array('class' => 'btn btn btn-info'),\n 'delete' => array('class' => 'btn btn-danger'),\n ),\n )\n );\n\n }", "public function actionIndex()\n\t{\n\t\t$this->session->delete('page.lastSearch');\n\n\t\treturn $this->template->partial('content', 'pages/index', [\n\t\t\t'pages' => Page::findAll('SELECT * FROM nerd_pages'),\n\t\t]);\n\t}", "public function index()\n {\n $orders = Order::latest()->paginate(5);\n \n return view('orders.index',compact('orders'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function admin_index()\n {\n \tif (!$this->request->is('ajax')) {\n \t $this->Session->delete('direction');\n \t $this->Session->delete('sort');\n \t}\n \t$this->layout = 'admin';\n \t$perpage = $this->Functions->get_param('perpage', Configure::read('PER_PAGE'), true);\n $page = $this->Functions->get_param('page', Configure::read('PAGE_NO'), false);\n \t$counter = (($page - 1) * $perpage) + 1;\n \t$this->set('counter', $counter);\n \n \t$search = $this->Functions->get_param('search');\n $this->Functions->set_param('direction'); \n $this->Functions->set_param('sort');\n \tif ($this->Session->read('sort') != '') {\n \t\t$this->paginate['Newsletter']['order'] = array($this->Session->read('sort') => $this->Session->read('direction'));\n \t}else{\n \t\t$this->paginate['Newsletter']['order']=array('modified'=>'desc');\n \t}\n \t//$this->paginate['Newsletter']['order']=array('Newsletter.id'=>'desc');\n \t$this->paginate['Newsletter']['limit'] = $perpage;\n \tif ($search != '') {\n \t\t$this->paginate['Newsletter']['conditions'] = array(\n \t\t\t\t'Newsletter.template_name LIKE' => '%' . $search . '%'\n \t\t);\n \t}\n \t$this->set('templates', $this->paginate('Newsletter'));\n \tif ($this->request->is('ajax')) {\n \t\t$this->layout = false;\n \t\t$this->set('perpage', $perpage);\n \t\t$this->set('search', $search);\n \t\t$this->render('admin_newsletter_ajax_list'); // View, Layout\n \t}\n }", "public function index()\n {\n\t\t$totalComments = count($this->model->findAllWithTheirAuthor(\"p_datetime DESC\"));\n\t\t$itemPerpage = 5;\n\t\t$totalPages = ceil($totalComments/$itemPerpage); //ceil around superior number\n\t\t\n\t\tif(isset($_GET['page']) AND !empty($_GET['page']) AND $_GET['page'] > 0)\n {\n $_GET['page'] = intval($_GET['page']); //return an entier value\n $currentPage = $_GET['page'];\n }\n else\n {\n $currentPage = 1;\n\t\t}\n\t\t$start = ($currentPage - 1)*$itemPerpage;\n $posts = $this->model->countItems($start, $itemPerpage, \"p_datetime\");\n\t\t\n\t\t$pageTitle = \"Articles\";\n\t\t\n\t\t$description = \"Liste des articles\";\n\n\t\t$author = \"Invest People\";\n\n \\Renderer::render('post/index', compact('pageTitle', 'posts', 'description', 'author', 'totalPages')); \n\t}", "public function sort()\n\t{\n\t\tif (app::is_ajax())\n\t\t{\n\t\t\tforeach($_POST as $key=>$val)\n\t\t\t{\n\t\t\t\tforeach($val as $position=>$id)\n\t\t\t\t{\n\t\t\t\t\t$this->rownd->update_position($id, $position);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function index()\n {\n $orders = Order::paginate(5);\n return view('admin.order.index')->with('orders',$orders);\n }", "function show() {\n global $_SERVER;\n global $lang;\n global $theme;\n global $_SESSION;\n global $__order_register;\n global $__order_register_tab;\n global $_REQUEST;\n global $sess;\n \n // odczytaj jakie sa ustawienia sortowania obecnie\n if (! empty($_SESSION[\"__order_register_set\"])){\n $tab=$_SESSION[\"__order_register_set\"];\n } else {\n $tab['partner']=0;\n $tab['amount']=0;\n $tab['rake_off']=0;\n }\n\n if (! empty($_REQUEST['order'])) {\n $order=$_REQUEST['order']; $set=false; \n $order=intval($order);\n \n switch ($order) {\n case \"1\":$tab['partner']=-1; $set=true; // zmien \"strzalke\" (kierunek sortowania)\n break;\n case \"2\":$tab['amount']=-1; $set=true;\n break;\n case \"3\":$tab['rake_off']=-1; $set=true;\n break;\n case \"-1\":$tab['partner']=1; $set=true;\n break;\n case \"-2\":$tab['amount']=1; $set=true;\n break;\n case \"-3\":$tab['rake_off']=1; $set=true;\n break;\n default:$tab['partner']=-1; $set=true;\n break;\n } // end switch\n \n } // end if\n\n // start: sprawdz czy wybrano jakiekolwiek sortowanie, jesli nie to wstaw sortowanie wg ceny od najmniejszej\n // chyba ze jest to wyszukiwanie wedlug slowa, wtedy wstaw sortowanie wedlug dopasowania\n if (@$set!=true) {\n $tab['partner']=-1;\n } \n // end:\n\n // zapamietaj tablice sortowania w sesji\n $__order_main_tab_register=&$tab;\n $sess->register(\"__order_register_tab\",$order_register_tab);\n $__order_main_register=&$order;\n $sess->register(\"__order_register\",$__order_register);\n\n $url=$_SERVER['REQUEST_URI'];\n \n // pomin sesje, uniknij duplikacji zmiennej sesji\n $url=preg_replace(\"/&session_id=[a-z0-9]+$/\",\"\",$url);\n $url=ereg_replace(\"\\?order=[0-9-]+$\",\"\",$url);\n \n // sortowanie wg nazwy\n if ($tab['partner']==1) {\n print \"<a href=$url?order=1><u>\".$lang->order_by['partner'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/up.png\"); print \"> \";\n } elseif ($tab['partner']==-1) {\n print \"<a href=$url?order=-1><u>\".$lang->order_by['partner'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/down.png\"); print \"> \";\n } else {\n print \"<a href=$url?order=1><u>\".$lang->order_by['partner'].\"</u></a> &nbsp;\";\n }\n\n // sortowanie wg ceny\n if ($tab['amount']==1) {\n print \"<a href=$url?order=2><u>\".$lang->order_by['amount'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/up.png\"); print \"> \"; \n } elseif ($tab['amount']==-1) {\n print \"<a href=$url?order=-2><u>\".$lang->order_by['amount'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/down.png\"); print \"> \"; \n } else {\n print \"<a href=$url?order=2><u>\".$lang->order_by['amount'].\"</u></a> &nbsp; \";\n } \n\n // sortowanie wg producenta\n if ($tab['rake_off']==1) {\n print \"<a href=$url?order=3><u>\".$lang->order_by['rake_off'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/up.png\"); print \"> \";\n } elseif ($tab['rake_off']==-1) {\n print \"<a href=$url?order=-3><u>\".$lang->order_by['rake_off'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/down.png\"); print \"> \";\n } else {\n print \"<a href=$url?order=3><u>\".$lang->order_by['rake_off'].\"</u></a> &nbsp;\";\n }\n\n return;\n }", "public function loadMoreOrderAction() {\n $block = Mage::getBlockSingleton('webpos/orderlist');\n $this->getResponse()->setBody(json_encode($block->toHtml()));\n }", "public function ajaxShowTopupTransactionAction() {\n $this->_helper->layout->disableLayout();\n \n /*Get parameters filter*/\n $params = $this->_getAllParams();\n $params['page'] = $this->_getParam('page',1);\n $params['perpage'] = $this->_getParam('perpage',20);\n \n /*Get all data*/\n $paginator = Zend_Paginator::factory($this->_model->getQuerySelectAll($params));\n $paginator->setCurrentPageNumber($params['page']);\n $paginator->setItemCountPerPage($params['perpage']);\n\n /*Assign varible to view*/\n $this->view->paginator = $paginator;\n $this->view->assign($params);\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$param = $this->getInput(array('status', 'title'));\n\n\t\tif ($param['status']) $search['status'] = intval($param['status'])-1;\n\t\tif ($param['title']) $search['title'] = array('LIKE', $param['title']);\n\t\t\n\t\tlist($total, $goods) = Fj_Service_Goods::getList($page, $this->perpage, $search, array('sort'=>'DESC','id'=>'DESC'));\n\t\t\n\t\t$this->assign('goods', $goods);\n\t\t$this->assign('total', $total);\n\t\t$this->assign('search', $param);\n\t\t\n\t\t//get pager\n\t\t$url = $this->actions['listUrl'].'/?' . http_build_query($param) . '&';\n\t\t$this->assign('pager', Common::getPages($total, $page, $this->perpage, $url));\n\t}", "public function actionIndex()\n {\n// $cache->name = './a/txt';\n//\n// $data = $cache->get();\n// $cache->add('abcd',$data);\n\n\n $page = isset($_GET['page'])?$_GET['page']:1;\n $limit=($page-1)*5;\n $user = M('UserModel');\n $uid = isset($_COOKIE['uid']) ? $_COOKIE['uid'] : '';\n $users=[];\n if ($uid) {\n $users = $user->find(['u_id' => $uid]);\n }\n $article = M('ArticleModel');\n $nums = $article->field('count(*) as nums')->join(['user', 'article.user_id', 'user.u_id'])->select();\n $article = M('ArticleModel');\n $data = $article->field('*')->join(['user', 'article.user_id', 'user.u_id'])->orderBy('add_time desc')->limit($limit,5)->select();\n $page_nums = $nums[0]['nums'];\n $page_num = floor($page_nums/5);\n if(IS_AJAX){\n Response::$format=Response::FORMAT_JSON;\n return ['code'=>200,'data'=>$data,'page_num'=>$page_num];\n }else{\n return $this->render('index', ['data' => $data,'user'=>$users,'page_num'=>$page_num]);\n }\n }", "public function indexAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * set page url array\r\n \t\t */\r\n \t\t$url_array = array(\r\n \t\t\t$this->module_name, $this->action_name,\r\n \t\t);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page number from url and set attribute\r\n \t\t */\r\n \t\t$page_no = $this->getUrlParam('page');\r\n \t\t\r\n \t\t/**\r\n \t\t * set page number to 1 if page number is empty and assign to view\r\n \t\t */\r\n \t\tif (empty($page_no)){\r\n \t\t\t$page_no = 1;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($page_no))\r\n \t\t\t\tarray_push($url_array, 'page',$page_no);\r\n \t\t}\r\n \t\t$this->viewAssign('page_no', $page_no);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page limit from parameter\r\n \t\t */\r\n \t\t$limit = $this->getUrlParam('limit');\r\n \t\tif (is_numeric($limit))\r\n \t\t\t$this->setAttribute('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * if page limit is empty set page limit and assign to view\r\n \t\t */\t\r\n \t\tif (empty($limit)){\r\n \t\t\t$limit = ADMIN_DISP;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($limit))\r\n \t\t\t\tarray_push($url_array, 'limit', $limit);\r\n \t\t}\r\n \t\t$this->viewAssign('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * set paging offset\r\n \t\t */\r\n \t\t$offset = ($page_no-1) * $limit;\r\n \t\t\r\n \t\t/**\r\n \t\t * set number to dispaly list number on view\r\n \t\t */\r\n \t\t$this->viewAssign('number', (($page_no-1)*$limit));\r\n \t\t\r\n \t\t/**\r\n\t\t * get form mail list\r\n\t\t */\r\n \t\t$list = $this->db_model->getFormList($limit, $offset);\r\n \t\t\r\n \t\t/**\r\n \t\t * page view list assign to view\r\n \t\t */\r\n \t\t$this->viewAssign('list', $list);\r\n \t\t \t\t\r\n \t\t/**\r\n \t\t * if show all in one page\r\n \t\t */\r\n\t\tif ($limit == 'all'){\r\n \t\t\t$limit = 0;\r\n \t\t\t$this->viewAssign(\"paging\",'<li><span>1</span></li>');\r\n \t\t}else {\r\n \t\t\t\r\n \t\t\t/**\r\n \t\t\t * get paging html, previous, next page info and assign to view\r\n \t\t \t */\r\n \t\t\t$page_class = new PageClass($total_rows, $page_no, $limit);\r\n \t\t\t$this->viewAssign('prev', $page_class->isPrev());\r\n\t\t\t$this->viewAssign('prev_pn', $page_no-1);\r\n\t\t\t$this->viewAssign('next', $page_class->isNext());\r\n\t\t\t$this->viewAssign('next_pn', $page_no+1);\r\n\t\t\t$link_url = $this->self_url.'/'.$this->action_name.'/limit/'.$limit;;\r\n\t\t\t$paging = $page_class->DisPage($link_url);\r\n\t\t\t$this->viewAssign(\"paging\",$paging);\r\n\t\t}\r\n \t\t\r\n\t\t\r\n \t\t\r\n \t\t$this->setDisplay('list');\r\n \t\t\r\n \t\t\r\n \t}", "public function actionIndex()\n {\n return $this->render('index');\n // return $this->render('..\\sales\\order\\order-by-Province');\n }", "public function index()\n {\n return OrderCollection::collection(Order::paginate(10));\n }", "public function index()\n {\n $orders=Order::orderBy('created_at','DESC')->paginate(10);\n //return $orders;\n return view('backend.order.index')->with('orders',$orders);\n }", "public function index()\n {\n $orders = Order::orderBy('created_at', 'desc')->paginate(20);\n\n\n return view('vendor.voyager.order.browse', ['orders' => $orders]);\n\n }", "function index() {\n\t\t$this->show_list();\n\t}", "public function index()\n\t{\n\t\t$rownds = $this->rownd->all(array('sort_order'=>'asc'), array('user_id'=>app::session('id')));\n\t\t\n\t\tif ($rownds)\n\t\t{\n\t\t\t$data['rownds'] = $rownds->result;\n\t\t\t$this->render($data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->render();\n\t\t}\n\t}", "public function getChapterAjaxAction(){\n try {\n $time = date('Y-m-d H:i:s');\n require 'default_simple_html_dom.php';\n $this->_helper->viewRenderer->setNoRender('true');\n $storyModel = new Model_api_manageapp_Story();\n $storyContentModel = new Model_api_manageapp_StoryContent();\n $params = $this->_arrParam;\n if ($this->_request->isPost()){\n if (!empty($params['site_id'])) {\n $listStory = $storyModel->getListStory(array( // lay ds truyen chua tong hop trang\n 'crawler' => CRAWLER_OFF,\n 'crawler_id' => $params['site_id'], \n ));\n if(!empty($listStory)){\n $num_story = 0;// bien dem truyen\n $value = $listStory[0];// lay phan tu dau tien trong ds \n if(isset($value['source'])){// neu co source\n preg_match('~(.*\\d+)\\.html~', $value['source'],$link_arr);// tach lay url phan trang\n $link_get_page = $link_arr[1];// lay link chuan phan trang\n if(!isset($value['page_crawler'])){// bien luu vi tri page da crawler\n\n $value['page_crawler'] = -1;\n }\n $page_max = $value['total_page'];// bien phan trang lon nhat\n if($value['page_crawler']<$page_max){// neu chua quet het trang\n $next_page = $value['page_crawler']+1;// bien trang quet lan nay\n $url_chapter = $link_get_page.'/page-'.$next_page.'.html'; // tao url de quet\n $dom1 = file_get_html($url_chapter);// load vao trang\n $linkpage1 = $dom1->find('.page-split',0);//tim den phan phan trang\n $content = $linkpage1->parent()->parent();// tim den phan chua cac danh sach chuong\n foreach ($content->children() as $child){\n if($child->getAttribute('class') == 'chuongmoi'){ \n foreach ($child->children() as $chapter){\n if($value['lastest_chapter'] < $value['total_chapter']){ \n $link_chapter = 'http://sstruyen.com'.$chapter->children(0)->href;\n $data = array(\n 'story_id' => $value['id'],\n 'status' => STATUS_OFF,\n 'chapter_number' => $value['lastest_chapter']+1,\n 'source' => $link_chapter,\n 'is_crawler' => CRAWLER_OFF,\n 'created_time' => $time,\n 'updated_time' => $time,\n 'published_time' => $time,\n );\n $storyContentModel->insert($data);\n // cap nhat chuong moi nhat \n $data_story = array(\n 'lastest_chapter' => $value['lastest_chapter']+1,\n 'page_crawler' => $next_page,\n );\n $where = 'id = ' . $value['id'];\n $storyModel ->update($data_story, $where);\n $value['lastest_chapter']++;\n } \n }\n }\n }\n // done 1 page\n $response = array(\n 'status' => 1,\n 'message' => 'truyện '.$value['story_name'].' tổng hợp đến trang thứ '. $next_page.'/'.$page_max,\n ); \n }\n else if($value['page_crawler'] == $page_max){\n // hoan thanh 1 truyen => update co is_crawler trong bang story\n $data_story_crawler = array(\n 'is_crawler' => '1'\n );\n $where = 'id = ' . $value['id'];\n $storyModel ->update($data_story_crawler, $where);\n $response = array(\n 'status' => 0,\n 'message' => 'truyện '.$value['story_name'].' hoàn thành',\n ); \n } \n }else{\n $response = array(\n 'status' => 0,\n 'message' => 'Truyện không có đường dẫn tổng hợp'\n );\n }\n }else{\n $response = array(\n 'status' => 0,\n 'message' => 'Đã tổng hợp hết truyện'\n );\n }\n }\n \n \n } \n else{\n // tao du lieu tra ve\n $response = array('status' => 0, 'message' => 'Phương thức truyền dữ liệu ko được hỗ trợ');\n }\n \n }catch (Exception $exc) {\n $response = array(\n 'status' => 0,\n 'message' => 'Lỗi xử lý server'\n );\n }\n exit(json_encode($response));\n }", "public function index()\n\t{\n\t\t// Go through all the groups\n\t\tforeach($this->data->groups as $group)\n\t\t{\n\t\t\t//... and get navigation links for each one\n\t\t\t$this->data->navigation[$group->id] = $this->navigation_m->get_link_tree($group->id);\n\t\t}\n\t\t\n\t\t$this->data->controller =& $this;\n\t\t\n\t\t// Create the layout\n\t\t$this->template\n\t\t\t->append_metadata( js('jquery/jquery.ui.nestedSortable.js') )\n\t\t\t->append_metadata( js('jquery/jquery.cookie.js') )\n\t\t\t->title($this->module_details['name'])\n\t\t\t->build('admin/index', $this->data);\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function index()\n {\n return Bien::paginate(3);\n }", "public function ajax_listPaging()\n\t{\n\t\t// grab getings\n\t\t$datatable_varibles = helper_datatable_varibles($this->input->get());\n\n\t\t// generate the JSON going to return to AJAX\n\t\t$returnAJAX = $this->members_model->read_datatable(0, get_user_id(), $datatable_varibles);\n\n\n\t\t//=============================插入计算后的数据\n\n $newData = $returnAJAX[\"data\"];\n\n foreach($newData as $key=>$sub){\n\n //0:picture, 1:name\n $newData[$key][\"member_position_picture\"] = $this->tags_model->read_images($sub[\"member_position\"]);\n // $newData[$key][\"member_position_name\"] = $this->tags_model->read_names($sub[\"member_position\"]);\n }\n $returnAJAX[\"data\"] = $newData;\n\n //=============================\n\t\techo json_encode($returnAJAX);\n\t}", "public function index()\n\t{\n\t\t//\n\t\t$store = Store::where('user_id', $GLOBALS['user']->id)->first();\n\t\t$orders = Order::where('store_id', $store->id)->orderBy('id', 'desc')->paginate(10);\n\t\treturn View::make('stores.admin.order_index', compact('store', 'orders'));\n\t}", "public function ajaxjoblistAction(){\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$keyword = '';\n\t\t\t$order_id = '';\n\t\t\t$cust_id = '';\n \t\t$params = $this->getRequest()->getQuery()->toArray();\n\t\t\t$pagenum = $params['pagenum'];\n\t\t\t$limit = $params['pagesize'];\n\t\t\tif($params['keyword'] != 'undefined'){\n\t\t\t\t$keyword = $params['keyword'];\n\t\t\t}\n\t\t\tif($params['order_id'] != 'undefined'){\n\t\t\t\t$order_id = $params['order_id'];\n\t\t\t}\n\t\t\tif($params['cust_id'] != 'undefined'){\n\t\t\t\t$cust_id = $params['cust_id'];\n\t\t\t}\n\t\t\t\n\t\t\t$sortdatafield = $params['sortdatafield'];\n\t\t\t$sortorder = $params['sortorder'];\n\t\t\t\n\t\t\tsettype($limit, 'int');\n\t\t\t$offset = $pagenum * $limit;\n\t\t\t$objJobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\tif($keyword != ''){\n\t\t\t\t$offset = 0;\n\t\t\t}\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t\t\t\n\t\t\t$jobsArr = $objJobPacketTable->fetchAll($limit, $offset, $sortdatafield, $sortorder, $order_id, $cust_id, $keyword);\n\t\t\t\n\t\t\tforeach($jobsArr['Rows'] as $key => $value){\n\t\t\t\tforeach($value as $k => $v){\n\t\t\t\t\tif($k == 'exp_delivery_date'){\n\t\t\t\t\t\t$jobsArr['Rows'][$key][$k] = date($config['phpDateFormat'], strtotime($v));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(empty($v)){\n\t\t\t\t\t\t$jobsArr['Rows'][$key][$k] = '-';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$milestoneList = $objJobPacketTable->fetchMilestones($value['job_id']);\n\t\t\t\t\n\t\t\t\t$array_milestones = array();\n\t\t\t\tforeach($milestoneList as $milesData){\n\t\t\t\t\t$array_milestones[] = $milesData['milestone_type_id'];\n\t\t\t\t}\n\t\t\t\t$value['milestones'] = implode(\",\",$array_milestones);\n\t\t\t\t$milestones = explode(',', $value['milestones']);\n\t\t\t\t$milestones_completed = 1;\n\t\t\t\t$completedMilestones = $objJobPacketTable->getMilestonesByJobId($value['job_id']);\n\t\t\t\t/*if($completedMilestones > 0){\n\t\t\t\t\t$milestones_completed = $completedMilestones;\n\t\t\t\t}\n\t\t\t\t$jobsArr['Rows'][$key]['milestone_progress'] = $milestones_completed . ' of ' . count($milestones);*/\n\n\t\t\t\t$jobsArr['Rows'][$key]['milestone_progress'] = $completedMilestones . ' of ' . count($milestones);\n\t\t\t\t\n\t\t\t\t$arr = array();\n\t\t\t\tforeach($milestones as $milestone){\n\t\t\t\t\t$arr[] = $config['milestones'][$milestone];\n\t\t\t\t}\n\t\t\t\t$jobsArr['Rows'][$key]['milestones_str'] = implode(', ', $arr);\n\t\t\t\t\n\t\t\t\t$arr = array();\n\t\t\t\tforeach($milestones_completed as $milestone){\n\t\t\t\t\t$arr[] = $config['milestones'][$milestone];\n\t\t\t\t}\n\t\t\t\t$jobsArr['Rows'][$key]['milestones_current_status'] = '';\n\t\t\t\t$jobsArr['Rows'][$key]['milestones_completed_str'] = '';\n\t\t\t\t$jobsArr['Rows'][$key]['milestones_supplier'] = '';\n\t\t\t\tif($value['current_milestone_id'] > 0 && $value['current_milestone_step_id'] > 0){\n\t\t\t\t\t$jobsArr['Rows'][$key]['milestones_current_status'] = $config['milestones_steps'][$value['current_milestone_id']][$value['current_milestone_step_id']];\n\t\t\t\t}\n\t\t\t\tif($value['current_milestone_id'] > 0){\n\t\t\t\t\t$jobsArr['Rows'][$key]['milestones_completed_str'] = $config['milestones'][$value['current_milestone_id']];\n\t\t\t\t}\n\t\t\t\tif($value['job_packet_status'] == 0){\n\t\t\t\t\t$jobsArr['Rows'][$key]['milestones_activity'] = '<span class=\"activeBall\" style=\" background-color:#11d307\"></span>';//Green\n\t\t\t\t} else if($value['job_packet_status'] == 1){\n\t\t\t\t\t$jobsArr['Rows'][$key]['milestones_activity'] = '<span class=\"activeBall\" style=\" background-color:orange\"></span>';//Orange\n\t\t\t\t} else if($value['job_packet_status'] == 2){\n\t\t\t\t\t$jobsArr['Rows'][$key]['milestones_activity'] = '<span class=\"activeBall\" style=\" background-color:blue\"></span>';//Blue\n\t\t\t\t} else if($value['job_packet_status'] == 3){\n\t\t\t\t\t$jobsArr['Rows'][$key]['milestones_activity'] = '<span class=\"activeBall\" style=\" background-color:#cecece\"></span>';//Gray\n\t\t\t\t}\n\t\t\t\tif($value['milestone_id'] > 0 && $value['current_milestone_id'] > 0){\n\t\t\t\t\t$supplier = $objJobPacketTable->getSupplierNameByMilestoneId($value['milestone_id'], $value['current_milestone_id']);\n\t\t\t\t\tif(count($supplier) > 0){\n\t\t\t\t\t\tforeach($supplier as $dataSup){\n\t\t\t\t\t\t\t$jobsArr['Rows'][$key]['milestones_supplier'] = $dataSup['supplier_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//$jobsArr['Rows'][$key]['milestones_supplier'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Population data for costs updated - starts\n\t\t\t\t\n\t\t\t\t$workshopList = array();\n\t\t\t\tforeach($milestoneList as $milestone){\n\t\t\t\t\tif($milestone['milestone_type_id'] == 4)\n\t\t\t\t\t\t$workshopList[]['workshop_id'] = $milestone['id'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($workshopList)){ // No Workshop milestone added\n\t\t\t\t\t$jobsArr['Rows'][$key]['costs_updated'] = '<span style=\"color:cecece; font-weight:bolder;\">NA</span>';\n\t\t\t\t}else{\t\t\t\t\t\n\t\t\t\t\t$objWorkshopTable = $sm->get('Order\\Model\\WorkshopTable');\n\t\t\t\t\tforeach($workshopList as $workshop){\t\t\t\t\t\n\t\t\t\t\t\t$supplierData = $objWorkshopTable->fetchWorkshopSuppliers($workshop['workshop_id']);\n\t\t\t\t\t\tif(empty($supplierData)){ // No suppliers are added to the Workshop milestone\n\t\t\t\t\t\t\t$jobsArr['Rows'][$key]['costs_updated'] = '<span style=\"color:cecece; font-weight:bolder;\">NA</span>';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tforeach($supplierData as $data){\n\t\t\t\t\t\t\t\tif(empty($data['tasks'])){ // No Tasks are created for the suppliers in the Workshop milestone\n\t\t\t\t\t\t\t\t\t$jobsArr['Rows'][$key]['costs_updated'] = '<span style=\"color:cecece; font-weight:bolder;\">NA</span>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$tasks = unserialize($data['tasks']);\n\t\t\t\t\t\t\t\t\tforeach($tasks as $task){\n\t\t\t\t\t\t\t\t\t\tif($task['cost'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t$jobsArr['Rows'][$key]['costs_updated'] = '<span style=\"color:#11d307; font-weight:bolder;\">Yes</span>';\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$jobsArr['Rows'][$key]['costs_updated'] = '<span style=\"color:red; font-weight:bolder;\">No</span>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Population data for costs updated - ends\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode($jobsArr);\n\t\t\texit;\t\t\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 index()\n {\n $data['pageTitle'] = 'Promo';\n $data['promo'] = $this->model_promo->get_where(array('mitra' => $this->session->userdata('id')))->result();\n $data['pageContent'] = $this->load->view('promo/promoList', $data, TRUE);\n\n // Jalankan view template/layout\n $this->load->view('template/layout', $data);\n }", "public function run() {\n if ($this->getItemCount() > $this->getPageSize() && !Yii::app()->getRequest()->isAjaxRequest) {\n ?>\n <div class=\"comment-item items-loader\" style=\"display: none\" >\n <div class=\"comment-item-in\">\n <div class=\"comment-more\">\n <img src=\"/i/comment-bottom-more.png\" alt=\"\" /> загрузка...\n <script type=\"text/javascript\">\n window.page = 1;\n var pagerOptions=<?= CJavaScript::encode(array('ajaxOptions'=>$this->ajaxOptions,'id'=>'post-list','isLastPage'=>false))?>;\n </script>\n <?php\n \nCHtml::ajaxLink($this->label, $this->ajaxLink, $this->ajaxOptions, array('id' => 'next-items')) \n ?>\n </div>\n </div>\n </div>\n <?php\n }\n }", "public function index()\n\t{\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'home' ;\n\n\n //Getting data\n $index_banners = $this->home_m->get_data('index_banners')->result_array();\n\n foreach ($index_banners as $key => $i_banner) \n {\n $content = $this->db->where('index_banner_id',$i_banner['id'])->get('index_banners_content')->num_rows();\n\n $index_banners[$key]['flag'] = ($content) ? 1 : 0 ;\n }\n\n $this->data['gallery_albums'] = array_reverse($this->home_m->get_data('gallery_albums')->result_array());\n $this->data['stories'] = array_reverse($this->home_m->get_data('stories')->result_array());\n $this->data['index_banners'] = $index_banners;\n \n\n $body = 'index' ;\n\n $this->load_pages($body,$this->data);\n\n\t}", "public function index()\n {\n $status = isset(request()->status)?request()->status:'5';\n // dd($status);\n if (isset(request()->status)) {\n $order = Order::where('status',request()->status)->orderBy('updated_at','desc')->get();\n }else{\n $order = Order::orderBy('updated_at','desc')->get();\n }\n return view('backend.order.index',compact('order','status'));\n }", "public function index() {\n if (!in_array('viewWorkorder', $this->permission)) {\n redirect('dashboard', 'refresh');\n }\n\n $this->render_template('workorder/index', $this->data);\n }", "function user_orders()\n {\n $data['fetch_category'] = $this->Admin_model->category();\n $data['fetch_sub_category'] = $this->Admin_model->sub_category();\n $data['accepted_projects'] = $this->Admin_model->accepted_projects();\n\n $data['fetch_tags'] = $this->Admin_model->fetch_tags();\n $data['basic_info'] = $this->Admin_model->basic_info();\n\n //...........for view page.................//\n $data['fetch_user_orders'] = $this->Admin_model->fetch_user_orders();\n\n $this->load->view('include/header', $data);\n $this->load->view('user_orders', $data);\n $this->load->view('include/footer', $data);\n }" ]
[ "0.79740536", "0.7035079", "0.67910475", "0.6684666", "0.65890193", "0.6518166", "0.6433249", "0.6413758", "0.63657266", "0.63521814", "0.6342062", "0.6315953", "0.63091487", "0.6293163", "0.6270938", "0.62316567", "0.6229661", "0.62277275", "0.622013", "0.6215571", "0.61852485", "0.6175293", "0.61680436", "0.61669564", "0.61491984", "0.6136033", "0.612368", "0.6105166", "0.61049354", "0.60926545", "0.60617536", "0.60584825", "0.605611", "0.60410327", "0.6037664", "0.6034554", "0.6026289", "0.6024088", "0.6023475", "0.5997731", "0.598953", "0.59890044", "0.5984399", "0.5983571", "0.598263", "0.5980105", "0.59752107", "0.59709746", "0.5964654", "0.59631824", "0.594367", "0.59342366", "0.5925002", "0.5924546", "0.592313", "0.591823", "0.5918085", "0.59177417", "0.5913721", "0.5913457", "0.59063184", "0.59052014", "0.59051776", "0.590509", "0.5900237", "0.5894683", "0.58922", "0.5889947", "0.5878941", "0.5878206", "0.58758575", "0.58704203", "0.586857", "0.5868062", "0.5867193", "0.58609325", "0.5859914", "0.58576804", "0.5857205", "0.5854659", "0.5851372", "0.5843509", "0.5840936", "0.5840788", "0.58380985", "0.58299136", "0.58262104", "0.5817906", "0.58143145", "0.58141625", "0.5813902", "0.58130956", "0.5810084", "0.5803172", "0.5803123", "0.58015096", "0.5795826", "0.57905877", "0.57862085", "0.5782688", "0.5780782" ]
0.0
-1
/============================================= = VISUA INFORMACION Docente = =============================================
public function ajaxVisuaDocente(){ $item ="id"; $valor = $this->idDocente; $respuesta = ControladorDocentes::ctrMostrarDocentes($item,$valor); echo json_encode($respuesta); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Documentos()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "function cl_conhistdoc() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conhistdoc\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function doc()\n {\n }", "public function show(Docente $docente)\n {\n //\n }", "public function metodo_publico() {\n }", "public function verVisorDocumentosEnPizarra( ) {\n $this->setComando(self::$PIZARRA_DIGITAL, \"CAMARA_DE_DOCUMENTOS\");\n $this->setEncendidoPizarra(1);\n }", "public function getElementos();", "public function getDocumentation(): string;", "public function getGeneralDocumentation();", "public function docHeaderContent() {}", "function cl_bensetiquetaimpressa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bensetiquetaimpressa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function getDetailedDocumentation();", "public function getSacadoDocumento();", "public function ogs()\r\n {\r\n }", "function palabraDescubierta($coleccionLetras){\n \n /*>>> Completar el cuerpo de la función, respetando lo indicado en la documentacion <<<*/\n}", "public function publicaciones() //Lleva ID del proveedor para hacer carga de BD\r\n\t{\r\n\t\t//Paso a ser totalmente otro modulo para generar mejor el proceso de visualizacion y carga de datos en la vistas\r\n\r\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function extObjContent() {}", "public function extObjContent() {}", "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}", "public function generateDocblock();", "public function acessarRelatorios(){\n\n }", "function archobjet_autoriser() {\n}", "function vimport_abonnes_autoriser() {\n}", "function conf__cuadro_docentes (toba_ei_cuadro $cuadro){\n if(count($this->s__docentes)>0){\n $cuadro->set_datos($this->s__docentes);\n }\n }", "function cl_evolucaodividaativa() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"evolucaodividaativa\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function getTiposDoc(){\n $params->Auth->Token = $this->TA->credentials->token;\n $params->Auth->Sign = $this->TA->credentials->sign;\n $params->Auth->Cuit = self::CUIT;\n $results = $this->client->FEParamGetTiposDoc($params);\n \n $e = $this->_checkErrors($results, 'FEParamGetTiposDoc');\n echo $e;\n $X=$results->FEParamGetTiposDocResult;\n $Texto=\" comprobantes\";\n //$fh=fopen(\"TiposDoc.txt\",\"w\");\n foreach ($X->ResultGet->DocTipo AS $Y) {\n //fwrite($fh,sprintf(\"%5s %-30s\\n\",$Y->Id, $Y->Desc));\n $Texto .= $Y->Id .' '.$Y->Desc;\n }\n //fclose($fh);\n return $Texto;\n }", "public function Documentos(){\r\n parent::__construct();\r\n $this->asigna_script('documentos/documentos.js'); \r\n $this->dbl = new Mysql($this->encryt->Decrypt_Text($_SESSION[BaseDato]), $this->encryt->Decrypt_Text($_SESSION[LoginBD]), $this->encryt->Decrypt_Text($_SESSION[PwdBD]) );\r\n $this->parametros = $this->nombres_columnas = $this->placeholder = array();\r\n $this->contenido = array();\r\n $this->id_org_acceso = array();\r\n $this->nivel_area = 2;\r\n }", "function aggiungiAllegato($pratica,$documento){\n \n}", "public function index()\n {\n BaseDinamica::connexionDynamicSon();\n $documentacion = DB::SELECT(/** @lang text */ 'SELECT * FROM \"Documento\"');\n return Documentacion::viewAndData('Documentacion.index', $documentacion);\n }", "public function _self_doc()\n\t{\n\t\t$info = array(\n\t\t\t'daily_deal' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display the current daily deal active in SHOP.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|cover_id|slug|name|description',\n\t\t\t\t'attributes' => array(),\n\t\t\t),\t\t\n\t\t\t'images' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display Gallery and cover images of products.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|src|alt|height|width|file_id|local',\t\t\t\t\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'type' => 'int',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'max' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'default' => '0',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\n\t\t\t\t\t'include_cover' => array(\n\t\t\t\t\t\t'type' => 'Boolean',\n\t\t\t\t\t\t'default' => 'NO',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\t\t\n\t\t\t\t\t'include_gallery' => array(\n\t\t\t\t\t\t'type' => 'Boolean',\n\t\t\t\t\t\t'default' => 'YES',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t),\n\t\t\t),\t\t\t\t\n\t\t\t'related' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display a list of related products to another product.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|cover_id|slug|name|description',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'type' => 'int',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'max' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'default' => '0',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\t\n\t\t\t'options' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display all hte options assigned to a Product.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'display|label|type',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'txtBoxClass' => array(\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'default' => '',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'categories' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display a list of Categories.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'link|categories',\n\t\t\t\t'attributes' => array(),\n\t\t\t),\t\t\t\t\n\t\t\t'category' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Get all fields of a particular category by Category-ID, OR just get the value of a particular field.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|slug|name|user_data',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'default' => '',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\t\n\t\t\t'cart' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display the cart contents.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|rowid|name|qty|price|subtotal',\n\t\t\t\t'attributes' => array(),\n\t\t\t),\t\t\t\n\t\t\t'currency' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display the Shop default currency symbol OR format a float value to the Shop currency format.'\n\t\t\t\t),\n\t\t\t\t'single' => true,\n\t\t\t\t'double' => false,\n\t\t\t\t'variables' => 'id|rowid|name|qty|price|subtotal',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t'type' => 'float',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\t\n\t\t\t'products' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display a list of ALL products'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|slug|name|cover_id|price|category_id',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'limit' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'default' => '0',\n\t\t\t\t\t),\n\t\t\t\t\t'order-by' => array(\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'default' => 'date_created',\n\t\t\t\t\t),\t\t\n\t\t\t\t\t'order-dir' => array(\n\t\t\t\t\t\t'type' => 'String',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'default' => 'asc',\n\t\t\t\t\t),\t\n\t\t\t\t\t'category_id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t\t'default' => '0',\n\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),\t\t\t\t\t\t\t\n\t\t\t'product' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display basic information about a product, Only 1 attribute is required.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|slug|name|cover_id|price|category_id',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\n\t\t\t\t\t'slug' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\t\t\t\t\t\n\t\t\t\t),\n\t\t\t),\t\n\t\t\t'digital_files' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Display a list of files associated with an order or product.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => 'id|filename|ext',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'order_id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\n\t\t\t\t\t'product_id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => false,\n\t\t\t\t\t),\t\t\t\t\t\n\t\t\t\t),\n\t\t\t),\t\n\t\t\t'in_wishlist' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Displays contents ONLY if the Product is IN the users wishlist.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => '',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => TRUE,\n\t\t\t\t\t),\t\t\t\t\n\t\t\t\t),\n\t\t\t),\t\n\t\t\t'notin_wishlist' => array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'en' => 'Displays contents ONLY if the Product is NOT-IN the users wishlist.'\n\t\t\t\t),\n\t\t\t\t'single' => false,\n\t\t\t\t'double' => true,\n\t\t\t\t'variables' => '',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'type' => 'Integer',\n\t\t\t\t\t\t'required' => TRUE,\n\t\t\t\t\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\n\t\t);\n\t\n\t\treturn $info;\n\t}", "public function elso()\n {\n }", "abstract public static function getDoc();", "public function get_Docente(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from docente;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function catalogos() \n\t{\n\t}", "function cl_far_listacontroladomed() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"far_listacontroladomed\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function notation_autoriser(){}", "function grappes_autoriser() {\n}", "function docportal($cod,$titulo,$tipo,$codcateg){\r\n\t\t$fDoc = new fachada_docportal();\r\n\t\t$oDocumento = $fDoc->docportal($cod,$titulo,$tipo,$codcateg);\r\n\t\treturn $oDocumento;\r\n\t}", "public static function accueilDatas(){\n return ['title'=>'Notre page d\\'accueil',\n 'h1'=>'Bienvenue',\n 'h2'=>'sur notre site',\n 'content' => [\"premier paragraphe\",\"Deuxieme paragraphe\",\"Paragraphe final\"]\n\n ];\n }", "public function silo_contents()\n\t{\n\t}", "private function metodo_privado() {\n }", "public function init(){\n $this->documento='760';\n }", "public function getDetalle();", "public function accueil()\n {\n }", "public function obtener()\n {\n }", "public function getCedenteDocumento();", "function opdsSearchDescriptor()\n{\n global $app;\n\n $gen = mkOpdsGenerator($app);\n $cat = $gen->searchDescriptor(null, '/opds/searchlist/0/');\n mkOpdsResponse($app, $cat, OpdsGenerator::OPENSEARCH_MIME);\n}", "function ooffice_write_referentiel( $referentiel_instance, $referentiel_referentiel, $param){\r\n global $CFG;\r\n\tglobal $odt;\r\n\tglobal $image_logo;\r\n\t\t$ok_saut_page=false;\r\n if ($referentiel_instance && $referentiel_referentiel) {\r\n $name = recode_utf8_vers_latin1(trim($referentiel_referentiel->name));\r\n $code = recode_utf8_vers_latin1(trim($referentiel_referentiel->code_referentiel));\r\n\t\t\t$description = recode_utf8_vers_latin1(trim($referentiel_referentiel->description_referentiel));\r\n\t\t\t\r\n\t\t\t$id = $referentiel_instance->id;\r\n $name_instance = recode_utf8_vers_latin1(trim($referentiel_instance->name));\r\n $description_instance = recode_utf8_vers_latin1(trim($referentiel_instance->description_instance));\r\n $label_domaine = recode_utf8_vers_latin1(trim($referentiel_instance->label_domaine));\r\n $label_competence = recode_utf8_vers_latin1(trim($referentiel_instance->label_competence));\r\n $label_item = recode_utf8_vers_latin1(trim($referentiel_instance->label_item));\r\n $date_instance = $referentiel_instance->date_instance;\r\n $course = $referentiel_instance->course;\r\n $ref_referentiel = $referentiel_instance->ref_referentiel;\r\n\t\t\t$visible = $referentiel_instance->visible;\r\n $id = $referentiel_instance->id;\r\n\t\t\t\r\n\t\t\t// $odt->SetDrawColor(128, 128, 128); \r\n\t\t\t// $odt->SetLineWidth(0.4); \r\n\t\t\t// logo\r\n\t\t\t// $posy=$odt->GetY(); \r\n\t\t\t\r\n\t\t\t//if (isset($image_logo) && ($image_logo!=\"\")){\r\n\t\t\t//\t$odt->Image($image_logo,150,$posy,40);\r\n\t\t\t// }\r\n\t\t\t// $posy=$odt->GetY()+60; \r\n \t\r\n\t\t\t$odt->SetLeftMargin(15);\r\n // $odt->SetX(20);\r\n\t\t\t\r\n \r\n\t\t\t$odt->SetFont('Arial','B',14); \r\n\t\t $odt->WriteParagraphe(0,get_string('certification','referentiel'));\r\n\t\t\t// $odt->Ln(1);\r\n\t\t\t$odt->SetFont('Arial','',12); \r\n\t\t $odt->WriteParagraphe(0, $name.'('.$code.')');\r\n\t\t\t// $odt->Ln(6);\r\n\t\t\t$odt->SetFont('Arial','',10);\r\n\t\t\t$odt->WriteParagraphe(0, $description);\r\n\t\t\t//$odt->Ln(6);\r\n if ($param->certificat_sel_referentiel){\t\t\t\t\r\n\t\t\t\t // DOMAINES\r\n\t\t\t\t // LISTE DES DOMAINES\r\n\t\t\t\t $compteur_domaine=0;\r\n\t\t\t\t $records_domaine = referentiel_get_domaines($referentiel_referentiel->id);\r\n\t\t if ($records_domaine){\r\n\t\t\t\t\t foreach ($records_domaine as $record_d){\r\n\t\t\t\t\t\t ooffice_write_domaine($record_d );\r\n\t\t\t\t\t }\r\n\t\t\t\t }\t\t\t\t\r\n $ok_saut_page=true;\t\t\t\t\r\n\t\t\t} \r\n\r\n\t\t\tif ($param->certificat_sel_referentiel_instance){\r\n $odt->SetFont('Arial','B',10); \r\n\t\t\t $odt->SetFont('Arial','B',14); \r\n\t\t\t $texte= recode_utf8_vers_latin1(get_string('certification','referentiel').' <i>'.$referentiel_instance->name.'</i>');\r\n\t \t$odt->WriteParagraphe(0,$texte);\r\n\t\t\t\r\n\t\t\t $odt->SetFont('Arial','N',12); \r\n\t\t\t $texte= \"$name : $description_instance\";\r\n\t\t\t // $texte.= \"$label_domaine, $label_competence, $label_item\";\r\n\t\t\t $odt->WriteParagraphe(0,$texte);\r\n\t\t\t\r\n /*\r\n\t\t\t$odt->Ln(2);\r\n\t\t\t$odt->Write(0,\"Cours : $course\");\r\n\t\t\t$odt->Ln();\r\n $odt->Write(0,\"R�f�rentiel : $ref_referentiel\");\r\n\t\t\t$odt->Ln();\r\n $odt->Write(0,\"Visible : $visible\");\r\n\t\t\t$odt->Ln();\r\n\t\t\t*/\r\n \r\n \t\t\t $ok_saut_page=true;\r\n }\r\n\t\t\tif ($ok_saut_page==true){ // forcer le saut de page \r\n $odt->AddPage();\r\n\t\t\t}\r\n \r\n\t\t\treturn true;\r\n }\r\n\t\treturn false;\r\n }", "function intromvc()\n {\n $data['$option'] = \"doc/intromvc\";\n $this->loadContent('doc/home', $data);\n }", "function cl_tfd_situacaopedidotfd() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_situacaopedidotfd\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_criterioavaliacaodisciplina() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"criterioavaliacaodisciplina\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ouvidoriaatendimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ouvidoriaatendimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "function informacao() {\n $this->layout = '_layout.perfilUsuario';\n $usuario = new Usuario();\n $api = new ApiUsuario();\n $usuario->codgusario = $this->getParametro(0);\n\n $this->dados = array(\n 'dados' => $api->Listar_informacao_cliente($usuario)\n );\n $this->view();\n }", "public function display_seo() {\n\n\t}", "public function listaVisitantes(){\n \n }", "public function masodik()\n {\n }", "public function index()\n {\n return EtatsDoccupation::getEtatFromTypeAndOccupation(1, '0');\n }", "public function getDocumentationConfig(): array;", "function cl_moblevantamentoedi() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamentoedi\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_procprocessodoc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"procprocessodoc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function getDemonstrativos();", "function getOverview() ;", "public function actionIndex() {\n\t\techo \"Documentação em desenvolvimento\";\n\t\t//$this->sendRestResponse(200,array('status'=>''));\n\t}", "public function apiDocs(){\n\t\t$data = array(\n \"pagedata\" => array(\n \"apidocs\" => true\n ) ,\n \"vars\" => $this->variables->getAll()\n );\n\t\t$this->view(\"system/capture.html\", $data);\n\t}", "public function index(){\n //crea un arreglo y pone como dato lo que se va a mostrar en la vista \n $noticias = $this->noticia_modelo->traerParte(0,15);\n $datos = [\n 'titulo' => 'NotiFalso',\n 'noticias' => $noticias\n ];\n //inicia la vista \n $this->vista('paginas/inicio',$datos);\n }", "function cl_liccomissao() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"liccomissao\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function imprimirAction() {\n\n $this->formato = DocumentoPdf::getConfigFormato($this->entity, $this->request['IdFormato']);\n\n // Márgenes: top,right,bottom,left\n $margenes = explode(',', trim($this->formato['margins']));\n if (count($margenes) != 4)\n $margenes = array('10', '10', '15', '10');\n $this->formato['margins'] = $margenes;\n $this->formato['printBorder'] = $this->request['printBorder'];\n\n $this->docPdf = new EtiquetaPdf($this->formato['orientation'], $this->formato['unit'], $this->formato['format']);\n $this->docPdf->SetTopMargin($margenes[0]);\n $this->docPdf->SetRightMargin($margenes[1]);\n $this->docPdf->SetLeftMargin($margenes[3]);\n $this->docPdf->SetAuthor(\"Informatica ALBATRONIC, SL\");\n $this->docPdf->SetTitle($this->format['title']);\n //$this->docPdf->AliasNbPages();\n //$this->docPdf->SetFillColor(210);\n $this->docPdf->SetAutoPageBreak(1, $margenes[2]);\n $this->docPdf->AddPage();\n //$primeraPagina = TRUE;\n\n $etiquetasPorPagina = $this->formato['rows'] * $this->formato['columns'];\n $puntero = $this->request['puntero'];\n if ($puntero <= 0 || $puntero > $etiquetasPorPagina)\n $puntero = 1;\n\n $etiqueta = new Etiquetas();\n $rows = $etiqueta->cargaCondicion(\"*\", \"IDAgente='{$_SESSION['usuarioPortal']['Id']}'\", \"Id ASC\");\n foreach ($rows as $row) {\n $i = 0;\n while ($i < $row['Unidades']) {\n $i += 1;\n if ($puntero > $etiquetasPorPagina) {\n $this->docPdf->AddPage();\n $puntero = 1;\n }\n $this->HazEtiqueta($row, $puntero);\n $puntero += 1;\n }\n }\n $archivo = Archivo::getTemporalFileName();\n $this->docPdf->Output($archivo, 'F');\n unset($this->docPdf);\n\n $this->values['archivo'] = $archivo;\n $template = '_global/documentoPdf.html.twig';\n return array('template' => $template, 'values' => $this->values,);\n }", "public function getDescription(): string\n {\n return 'Se adiciona filtros a los indicadores y se ajusta el alias a la vista';\n }", "public function getSponsorlogo() {}", "public function documentation() {\n\t\t$this->display(API_VIEWS_BASE.'/backend/documentation/index'); \n }", "public function verVisorDocumentosEnProyectorCentral( ) {\n $this->setComando(self::$PROYECTOR_CENTRAL, \"CAMARA_DE_DOCUMENTOS\");\n }", "function cilien_autoriser(){}", "function RellenarIndice()\r\n {\r\n $this->AddPage();\r\n\r\n $this->Imprimir('2. Revisión y Análisis de las siguientes interrupciones:', 20, 10);\r\n\r\n $cont_causa500 = 1;\r\n $cont_imp = 1;\r\n $cont_pro = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->ImprimirSubtituloIndice($evento, $cont_causa500, $cont_imp, $cont_pro);\r\n\r\n $fecha_evento = strftime(\"%A, %d/%m/%Y\", strtotime($evento->getFHoraIni()));\r\n $text = \"RI. \" . $evento->getCEventoD() . \" - Circuito \" . $evento->getCircuito() . \". \" . $fecha_evento . '. MVAmin: ' . $evento->getMvaMin();\r\n $this->Imprimir($text, 40, 10);\r\n }\r\n }\r\n }", "public function stampaDipendenti() {\n echo '<p> Nome: ' . $this->nome . '</p>';\n echo '<p> Cognome: ' . $this->cognome . '</p>';\n echo '<p> Software utilizzati: ' . $this->software . '</p>';\n }", "public function indexTypo3PageContent() {}", "public static function getDoc()\n {\n return array(\n 'trigger' => 'base-trait-repo',\n 'demo' => \"php owp update base-trait-repo\",\n 'doc' => \"Update current repo trait core\",\n );\n }", "public function UpdateDocente() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstDocente) $this->objDocente->DocenteId = $this->lstDocente->SelectedValue;\n\n\t\t\t\tif ($this->txtCreateby) $this->objDocente->Createby = $this->txtCreateby->Text;\n\n\t\t\t\tif ($this->calCreated) $this->objDocente->Created = $this->calCreated->DateTime;\n\n\t\t\t\tif ($this->txtUpdateby) $this->objDocente->Updateby = $this->txtUpdateby->Text;\n\n\t\t\t\tif ($this->calUpdated) $this->objDocente->Updated = $this->calUpdated->DateTime;\n\n\t\t\t\tif ($this->txtActive) $this->objDocente->Active = $this->txtActive->Text;\n\n\n\t\t\t\t// Update any UniqueReverseReferences for controls that have been created for it\n\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}", "public function index()\n {\n //\n return view('app.admin.docente');\n }", "public function getDocument();", "public function getSeoDescription(){ return $this->seo_description; }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "function cl_db_layouttxtgeracao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"db_layouttxtgeracao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_avaliacaoestruturanota() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"avaliacaoestruturanota\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function getDocentes(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraDocentes\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM empleados \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM empleados LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}" ]
[ "0.7126899", "0.67177516", "0.64016575", "0.6118226", "0.6094689", "0.609452", "0.60934013", "0.60649276", "0.60605836", "0.60273224", "0.6016364", "0.60095465", "0.6002308", "0.59825236", "0.5936013", "0.58974653", "0.58959174", "0.5895163", "0.5894386", "0.5855249", "0.5844205", "0.58400893", "0.5818936", "0.58185107", "0.5812649", "0.58124477", "0.5795899", "0.5779077", "0.574546", "0.5737923", "0.573776", "0.57355565", "0.57351583", "0.57287616", "0.57276785", "0.57188135", "0.57167035", "0.57110924", "0.5709348", "0.5705416", "0.5657547", "0.5644945", "0.5643013", "0.5635348", "0.5633406", "0.5633304", "0.56310475", "0.56222296", "0.56169087", "0.5614692", "0.56122077", "0.5610285", "0.5607959", "0.5604957", "0.5604957", "0.5604957", "0.5604957", "0.5604957", "0.5604957", "0.5604957", "0.5604957", "0.5604957", "0.5604957", "0.56032616", "0.56032616", "0.56032616", "0.56032616", "0.55995166", "0.55977786", "0.5594767", "0.5593875", "0.5589965", "0.5588262", "0.556822", "0.55631804", "0.55545753", "0.5550044", "0.5540043", "0.55359215", "0.5530736", "0.5529891", "0.5525605", "0.5524307", "0.55242795", "0.5522899", "0.5520455", "0.5512542", "0.55068254", "0.55033773", "0.5500356", "0.5499372", "0.549921", "0.54909253", "0.54868823", "0.5486179", "0.54856855", "0.5474819", "0.54640466", "0.54620934", "0.5459183", "0.5454668" ]
0.0
-1
optional double gym_longitude = 5
public function __construct($in = null, &$limit = PHP_INT_MAX) { parent::__construct($in, $limit); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function longitude();", "public function get_longitude()\n {\n }", "public function get_longitude()\n {\n }", "abstract public function latitude();", "public function getLongitude(): float;", "public function getLng();", "public function hasLongitude(): bool;", "public function getLongitude_atual(){\n\t\t \treturn $this->longitude_atual;\n\t\t}", "public function getLongitude() {\n return $this->nLongitude;\n }", "function parse_gis_location() {\n $output = $this->latitude . ';' . $this->longitude;\n if (!empty($this->radius)) {\n $output .= '!' . $this->radius;\n }\n return $output;\n }", "public function getLatitude(): float;", "function amap_ma_get_map_default_location_lon() {\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lng))\n return $map_default_lng;\n\n return 0;\n}", "public function getLongitude(): string|null;", "public function getLat();", "public function getDefaultLongitude(): string|null;", "public function getLongitude(){\r\n\t\treturn $this->longitude;\r\n\t}", "public function getlongitude()\r\n {\r\n return $this->_longitude;\r\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "function MaxLatitude() {\n return $GLOBALS[\"maxLat\"];\n }", "function getLocation();", "function amap_ma_get_map_default_location_coords() {\n $map_default_lat = trim(elgg_get_plugin_setting('map_default_lat', AMAP_MA_PLUGIN_ID));\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (empty($map_default_lat) || empty($map_default_lat))\n return AMAP_MA_CUSTOM_DEFAULT_COORDS; // set coords of Europe in case default location is not set\n else\n return $map_default_lat . ',' . $map_default_lng;\n}", "function MinLongitude() {\n return $GLOBALS[\"minLong\"];\n }", "public function getLocation();", "public function getLocation();", "public function getLongitude(): float\n {\n return $this->longitude;\n }", "function MaxLongitude() {\n return $GLOBALS[\"maxLong\"];\n }", "public function get_latitude()\n {\n }", "public function get_latitude()\n {\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "public function getLongitude()\n {\n return $this->longitude;\n }", "function tfnm_geocode_location( $location ){\n\t$api_key = get_option( 'tfnm_options' )[ 'g_api_key' ];\n\t$api_url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $location . '&key=' . $api_key;\n\n\t$response = tfnm_call_api( false, $api_url );\n\n\t// Add capability to have a MapQuest (Verizon) or HERE API key\n\n\t// This is latitude && This is longitude from Google Maps API\n\tif( !empty( $response->results[0]->geometry->location->lat ) && !empty( $response->results[0]->geometry->location->lng ) ){\n\t\treturn array(\n\t\t\t'latitude' => $response->results[0]->geometry->location->lat,\n\t\t\t'longitude' => $response->results[0]->geometry->location->lng\n\t\t);\n\t} else {\n\t\t// Will return if there is not a valid city inputted through the shortcode\n\t\t// OR if the quota limit has been reached\n\t\treturn 'There was an error finding the location. Please contact the administrator.';\n\t}\n\n}", "function geodetictoutm($lat, $lon) {\r\n\r\n $sm_a = 6378137.0;\r\n $sm_b = 6356752.314;\r\n $sm_EccSquared = 0.000669437999013;\r\n $UTMScaleFactor = 0.9996;\r\n\r\n // get UTM XY from Lat Lon\r\n $zone = floor(($lon + 180.0) / 6) + 1;\r\n\r\n // Compute the UTM zone\r\n $phi = $lat / 180 * Pi();\r\n $lambda = $lon / 180 * Pi();\r\n $lambda0 = (-183 + ($zone * 6))/ 180 * Pi(); //center merdian\r\n\r\n // Precalculate ep2\r\n $ep2 = (pow($sm_a,2) - pow($sm_b,2) ) / pow($sm_b,2);\r\n\r\n // Precalculate nu2\r\n $nu2 = $ep2 * pow(cos($phi),2);\r\n\r\n // Precalculate N\r\n $N = pow($sm_a,2) / ($sm_b * sqrt(1 + $nu2));\r\n\r\n // Precalculate t\r\n $t = tan ($phi);\r\n $t2 = $t * $t;\r\n $tmp = pow($t2,3) - pow($t,6);\r\n\r\n // Precalculate l\r\n $l = $lambda - $lambda0;\r\n\r\n //Precalculate coefficients for l**n in the equations below\r\n //so a normal human being can read the expressions for easting and northing\r\n\r\n $l3coef = 1 - $t2 + $nu2;\r\n $l4coef = 5 - $t2 + 9 * $nu2 + 4 * ($nu2 * $nu2);\r\n $l5coef = 5 - 18 * $t2 + ($t2 * $t2) + 14 * $nu2 - 58 * $t2 * $nu2;\r\n $l6coef = 61 - 58 * $t2 + ($t2 * $t2) + 270 * $nu2 - 330 * $t2 * $nu2;\r\n $l7coef = 61 - 479 * $t2 + 179 * ($t2 * $t2) - ($t2 * $t2 * $t2);\r\n $l8coef = 1385 - 3111 * $t2 + 543 * ($t2 * $t2) - ($t2 * $t2 * $t2);\r\n\r\n // ArcLengthOfMeridian\r\n //Precalculate n\r\n $n2 = ($sm_a - $sm_b) / ($sm_a + $sm_b);\r\n //Precalculate alpha\r\n $alpha = (($sm_a + $sm_b) / 2) * (1 + (pow($n2,2) / 4) + (pow($n2,4) / 64));\r\n //Precalculate beta\r\n $beta = (-3 * $n2 / 2) + (9 * pow($n2,3) / 16) + (-3 * pow($n2,5) / 32);\r\n //Precalculate gamma\r\n $gamma = (15 * pow($n2,2) / 16) + (-15 * pow($n2,4) / 32);\r\n //Precalculate delta\r\n $delta = (-35 * pow($n2,3) / 48) + (105 * pow($n2,5) / 256);\r\n //Precalculate epsilon\r\n $epsilon = (315 * pow($n2,4) / 512);\r\n //Now calculate the sum of the series and return\r\n $ArcLengthOfMeridian = $alpha * ($phi + ($beta * sin(2 * $phi)) + ($gamma * sin(4 * $phi)) + ($delta * sin (6 * $phi)) + ($epsilon * sin(8 * $phi)));\r\n\r\n //Calculate easting(x)\r\n $x = $N * cos($phi) * $l\r\n + ($N / 6 * pow(cos($phi),3) * $l3coef * pow($l,3))\r\n + ($N / 120 * pow(cos($phi),5) * $l5coef * pow($l,5))\r\n + ($N / 5040 * pow(cos($phi),7) * $l7coef * pow($l,7));\r\n\r\n //Calculate northing(y)\r\n $y = $ArcLengthOfMeridian\r\n + ($t / 2 * $N * pow(cos($phi),2) * pow($l,2))\r\n + ($t / 24 * $N * pow(cos($phi),4) * $l4coef * pow($l,4))\r\n + ($t / 720 * $N* pow(cos($phi),6) * $l6coef * pow($l,6))\r\n + ($t / 40320 * $N * pow(cos($phi),8) * $l8coef * pow($l,8));\r\n\r\n\r\n $x = $x * $UTMScaleFactor + 500000;\r\n $y = $y * $UTMScaleFactor;\r\n\r\n //print_r(get_defined_vars ( ));die;\r\n return array($x, $y, $zone);\r\n\r\n}", "public function getLongitude()\n {\n return $this->Longitude;\n }", "function UTMtoGeog_v1($Easting,$Northing,$UtmZone,$SouthofEquator=false) {\n\t//Declarations\n\t//Symbols as used in USGS PP 1395: Map Projections - A Working Manual\n\t$k0 = 0.9996;//scale on central meridian\n\t$a = 6378137.0;//equatorial radius, meters.\n\t$f = 1/298.2572236;//polar flattening.\n\t$b = $a*(1-$f);//polar axis.\n\t$e = sqrt(1 - $b*$b/$a*$a);//eccentricity\n\t$drad = pi()/180;//Convert degrees to radians)\n\t$phi = 0;//latitude (north +, south -), but uses phi in reference\n\t$e0 = $e/sqrt(1 - $e*$e);//e prime in reference\n\n\t$lng = 0;//Longitude (e = +, w = -)\n\t$lng0 = 0;//longitude of central meridian\n\t$lngd = 0;//longitude in degrees\n\t$M = 0;//M requires calculation\n\t$x = 0;//x coordinate\n\t$y = 0;//y coordinate\n\t$k = 1;//local scale\n\t$zcm = 0;//zone central meridian\n\t//End declarations\n\n\n\t//Convert UTM Coordinates to Geographic\n\n\t$k0 = 0.9996;//scale on central meridian\n\t$b = $a*(1-$f);//polar axis.\n\t$e = sqrt(1 - ($b/$a)*($b/$a));//eccentricity\n\t$e0 = $e/sqrt(1 - $e*$e);//Called e prime in reference\n\t$esq =(1 - ($b/$a)*($b/$a));//e squared for use in expansions\n\t$e0sq =$e*$e/(1-$e*$e);// e0 squared - always even powers\n\t$x = $Easting;\n\n\t/*\n\tif ($x<160000 || $x>840000)\n\t\techo \"($x,$y) Outside permissible range of easting values \\n Results may be unreliable \\n Use with caution\\n<br />\";\n\t$y = $Northing;\n\tif ($y<0)\n\t\techo \"Negative values not allowed \\n Results may be unreliable \\n Use with caution\\n\";\n\tif ($y>10000000)\n\t\techo \"Northing may not exceed 10,000,000 \\n Results may be unreliable \\n Use with caution\\n\";\n\t*/\n\n\t$zcm =3 + 6*($UtmZone-1) - 180;//Central meridian of zone\n\t$e1 =(1 - sqrt(1 - $e*$e))/(1 + sqrt(1 - $e*$e));//Called e1 in USGS PP 1395 also\n\t$M0 =0;//In case origin other than zero lat - not needed for standard UTM\n\t$M =$M0 + $y/$k0;//Arc length along standard meridian.\n\tif ($SouthofEquator === true)\n\t$M=$M0+($y-10000000)/$k;\n\t$mu =$M/($a*(1 - $esq*(1/4 + $esq*(3/64 + 5*$esq/256))));\n\t$phi1 =$mu + $e1*(3/2 - 27*$e1*$e1/32)*sin(2*$mu) + $e1*$e1*(21/16 -55*$e1*$e1/32)*sin(4*$mu);//Footprint Latitude\n\t$phi1 =$phi1 + $e1*$e1*$e1*(sin(6*$mu)*151/96 + $e1*sin(8*$mu)*1097/512);\n\t$C1 =$e0sq*pow(cos($phi1),2);\n\t$T1 =pow(tan($phi1),2);\n\t$N1 =$a/sqrt(1-pow($e*sin($phi1),2));\n\t$R1 =$N1*(1-$e*$e)/(1-pow($e*sin($phi1),2));\n\t$D =($x-500000)/($N1*$k0);\n\t$phi =($D*$D)*(1/2 - $D*$D*(5 + 3*$T1 + 10*$C1 - 4*$C1*$C1 - 9*$e0sq)/24);\n\t$phi =$phi + pow($D,6)*(61 + 90*$T1 + 298*$C1 + 45*$T1*$T1 -252*$e0sq - 3*$C1*$C1)/720;\n\t$phi =$phi1 - ($N1*tan($phi1)/$R1)*$phi;\n\t//Longitude\n\t$lng =$D*(1 + $D*$D*((-1 -2*$T1 -$C1)/6 + $D*$D*(5 - 2*$C1 + 28*$T1 - 3*$C1*$C1 +8*$e0sq + 24*$T1*$T1)/120))/cos($phi1);\n\t$lngd = $zcm+$lng/$drad;\n\n\treturn array(floor(1000000*$phi/$drad)/1000000,floor(1000000*$lngd)/1000000); //Latitude,Longitude\n\t}", "function get_lat_long($address){\r\n\t$API_KEY = 'AIzaSyC70LnMBiqyXcmpnQeryzq0VK12o6P5pnw';\r\n\t$address = str_replace(\" \", \"+\", $address);\r\n\t$url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$address.\"&key=\".$API_KEY.\"\";\r\n\t$json = file_get_contents($url);\r\n\t$json = json_decode($json);\r\n\tif($json->status == 'ZERO_RESULTS'){\r\n\t\t$lat = 0;\r\n\t\t$long = 0; \t\r\n\t}else{\r\n\t\t$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};\r\n\t\t$long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};\t\r\n\t}\r\n\t\r\n\t$location = [$lat,$long];\r\n\treturn $location;\r\n}", "function is_longlat ($longlat) {\n\n\t\t$return = true;\n\t\t$split = explode(\",\", $longlat);\n\t\tif(sizeof($split) != 2){\n\t\t\t$return = false;\n\t\t}else{\n\t\t\tif (!is_numeric(str_replace(\"-\", \"\", $split[0]))){\n\t\t\t\t$return = false;\n\t\t\t}\n\t\t\tif (!is_numeric(str_replace(\"-\", \"\", $split[1]))){\n\t\t\t\t$return = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\n\t}", "public function getLon()\n {\n $value = $this->get(self::LON);\n return $value === null ? (double)$value : $value;\n }", "public function getLongitude()\n\t{\n\t\treturn $this->longitude;\n\t}", "public function getLongitude()\n\t{\n\t\treturn $this->longitude;\n\t}", "function get_longitude($address){\n\t\t$output = get_geocode($address);\n\t\tif($output->status==\"OK\" && (count($output->results) == 1)){\n\t\t\t$longitude = $output->results[0]->geometry->location->lng;\t\t\t\n\t\t\treturn $longitude;\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t\t\n\t}", "function geo_param( $param )\n\t{\n\t\t$this->pieces = explode(\" \", str_replace ( ' O' , ' E' , str_replace( '_', ' ', $param )));\n\t\t$this->get_coor( );\n\t\t\n\t\t$this->latdeg_min = $this->latdeg_max = $this->latdeg;\n\t\t$this->londeg_min = $this->londeg_max = $this->londeg;\n\t\tif ( isset( $this->pieces[0] ) && $this->pieces[0] == \"to\") {\n\t\t\tarray_shift($this->pieces);\n\t\t\t$this->get_coor();\n\t\t\tif ($this->latdeg < $this->latdeg_max) {\n\t\t\t\t$this->latdeg_min = $this->latdeg;\n\t\t\t} else {\n\t\t\t\t$this->latdeg_max = $this->latdeg;\n\t\t\t}\n\t\t\tif ($this->londeg < $this->londeg_max) {\n\t\t\t\t$this->londeg_min = $this->londeg;\n\t\t\t} else {\n\t\t\t\t$this->londeg_max = $this->londeg;\n\t\t\t}\n\t\t\t$this->latdeg = ($this->latdeg_max+$this->latdeg_min) / 2;\n\t\t\t$this->londeg = ($this->londeg_max+$this->londeg_min) / 2;\n\t\t\t$this->coor = array();\n\t\t}\n\t}", "public function getLongitude()\n {\n return $this->get('Longitude');\n }", "public function setLng($value)\n {\n $this->lng = $value;\n }", "function make_position( $lat, $lon )\n\t{\n\t\t$latdms = geo_param::make_minsec( $lat );\n\t\t$londms = geo_param::make_minsec( $lon );\n\t\t$outlat = intval(abs($latdms['deg'])) . \"&deg;&nbsp;\";\n\t\t$outlon = intval(abs($londms['deg'])) . \"&deg;&nbsp;\";\n\t\tif ($latdms['min'] != 0 or $londms['min'] != 0\n\t\t or $latdms['sec'] != 0 or $londms['sec'] != 0) {\n\t\t\t$outlat .= intval($latdms['min']) . \"&prime;&nbsp;\";\n\t\t\t$outlon .= intval($londms['min']) . \"&prime;&nbsp;\";\n\t\t\tif ($latdms['sec'] != 0 or $londms['sec'] != 0) {\n\t\t\t\t$outlat .= $latdms['sec']. \"&Prime;&nbsp;\";\n\t\t\t\t$outlon .= $londms['sec']. \"&Prime;&nbsp;\";\n\t\t\t}\n\t\t}\n\t\treturn $outlat . $latdms['NS'] . \" \" . $outlon . $londms['EW'];\n\t}", "function gps($img){\n\tglobal $argv;\n\t// hemisphere\n\tif(!isset(exif_read_data($img)[\"GPSLatitudeRef\"]) || !isset(exif_read_data($img)[\"GPSLongitudeRef\"])) die(\"Error: No GPS metadata\");\n\t$lat_ref = exif_read_data($argv[1])[\"GPSLatitudeRef\"] == \"W\" ? 1 : -1;\n\t$lon_ref = exif_read_data($argv[1])[\"GPSLongitudeRef\"] == \"S\" ? 1 : -1;\n\n\t$lat = exif_read_data($argv[1])[\"GPSLatitude\"];\n\t$lon = exif_read_data($argv[1])[\"GPSLongitude\"];\n\n\t$coords[\"lat\"] = $lat_ref * deg2dec($lat[0],$lat[1],$lat[2]);\n\t$coords[\"lon\"] = $lon_ref * deg2dec($lon[0],$lon[1],$lon[2]);\n\n\treturn $coords;\n}", "function guifi_ED502WG84 ( $lon, $lat, $datum ) {\n // Transformar WG84 to ED50\n $XYZ_ED50 = guifi_lonlat2XYZ($datum, $lon, $lat, 0);\n $XYZ_WG84 = guifi_ND50_WG84( $XYZ_ED50[0], $XYZ_ED50[1], $XYZ_ED50[2], 1);\n $lonLat_WG84 = guifi_XYZ2lonlat(0, $XYZ_WG84[0], $XYZ_WG84[1], $XYZ_WG84[2]);\n \n return $lonLat_WG84;\n}", "function location_cmn($lat, $long, $usegeolocation, $customerno = null) {\n $address = NULL;\n $customerno = (!isset($customerno)) ? $_SESSION['customerno'] : $customerno;\n if (isset($lat) && isset($long)) {\n $GeoCoder_Obj = new GeoCoder($customerno);\n $address = $GeoCoder_Obj->get_location_bylatlong($lat, $long);\n }\n return $address;\n}", "public function GetLongitude()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_center_long;\n }", "public function getLocationByCoordinates($latlng);", "function amap_ma_get_map_default_location_lat() {\n $map_default_lat = trim(elgg_get_plugin_setting('map_default_lat', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lat))\n return $map_default_lat;\n\n return 0;\n}", "public function getLongitude() {\n\n return $this->longitude;\n\n }", "public function getGeoCoordinateY()\n {\n return $this->geo_coordinate_y;\n }", "public function __construct($lat)\r\n {\r\n $this->_lat = $lat;\r\n }", "protected function getLongitudeQuery()\n {\n return $this->longitudeQuery;\n }", "public function getLon()\n {\n return $this->lon;\n }", "private function getLocation() {\n }", "public function altitude($lon, $lat);", "function __construct($Latitude, $Longitude, $Miles) {\n global $maxLat, $minLat, $maxLong, $minLong;\n $EQUATOR_LAT_MILE = 69.172; // in MIles\n $maxLat = $Latitude + $Miles / $EQUATOR_LAT_MILE;\n $minLat = $Latitude - ($maxLat - $Latitude);\n $maxLong = $Longitude + $Miles / (cos($minLat * M_PI / 180) * $EQUATOR_LAT_MILE);\n $minLong = $Longitude - ($maxLong - $Longitude);\n }", "function MinLatitude() {\n return $GLOBALS[\"minLat\"];\n }", "private function getLongitudeLatitude(): array\n {\n $string = [];\n\n $string[] = '+---------------------------------------+';\n $string[] = sprintf('| %s |', $this->green('Longitude / Latitude'));\n $string[] = '+---------------------------------------|';\n $string[] = '| '.$this->blue('lat').' |';\n $string[] = '| |';\n $string[] = '| '.$this->blue('90° ⯅').' |';\n $string[] = '| '.$this->blue('|').' |';\n $string[] = '| '.$this->blue('|').' |';\n $string[] = '| '.$this->blue('|').' • Oslo (59.91°, 10.75°) |';\n $string[] = '| '.$this->blue('|').' • London (51.51°, -0.13°) |';\n $string[] = '| • New York (40.71°, -74.01°) |';\n $string[] = '| '.$this->blue('|').' |';\n $string[] = '| '.$this->blue('|').' |';\n $string[] = '| '.$this->blue('|').' |';\n $string[] = '| '.$this->blue('|').' • Null Island (0°, 0°) |';\n $string[] = '| '.$this->blue('⯇-------+-------------------⯈ lon').' |';\n $string[] = '| '.$this->blue('-180° | 180°').' |';\n $string[] = '| '.$this->blue('|').' |';\n $string[] = '| '.$this->blue('|').' • Cape Agulhas |';\n $string[] = '| '.$this->blue('-90° ⯆').' (-34.82°, 20.02°) |';\n $string[] = '+---------------------------------------+';\n\n return $string;\n }", "public function setGeo($value)\n {\n $this->geo = $value;\n }", "function get_position( )\n\t{\n\t\treturn $this->latdeg.\";\".$this->londeg;\n\t}", "public function setLongitude(?float $longitude): void\n {\n $this->longitude['value'] = $longitude;\n }", "private static function modifyLongitude($lat, $long, $deltaMiles) {\t return $long + $deltaMiles / (MILES_PER_DEGREE_LONG_EQUATOR * cos(deg2rad($lat)));\n\t}", "public function getLatitudeLongitude()\n\t\t\t{\n\t\t\t\t$latitude = $this->getLatitude();\n\t\t\t\t$longitude = $this->getLongitude();\n\n\t\t\t\tif ($latitude && $longitude)\n\t\t\t\t{\n\t\t\t\t\treturn $latitude . \",\" . $longitude;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}", "public function getLatLong()\n {\n return $this->latLong;\n }", "function get_city($lat, $lon) {\n\t\treturn \"hello\";\n\t}", "function map_large_link($location,$latitude,$longitude)\n {\n return \"https://maps.google.com/maps?ll={$latitude},{$longitude}&amp;z=16&amp;t=m&amp;hl=en-US&amp;gl=PT&amp;mapclient=embed&amp;\";\n }", "public function getLatLng() {\n return $point = $this->getLat().','.$this->getLng();\n }", "public function to(float $latitude, float $longitude): StationDetailsBuilder;", "function location($gps){\n\tglobal $api;\n\t$lat = $gps['lat'];\n\t$lon = $gps['lon'];\n\t$endpoint = \"https://us1.locationiq.com/v1/reverse.php?key=$api&lat=$lat&lon=$lon&format=json\";\n\techo \"https://www.google.com/maps/search/?q=$lat,$lon\\n\";\n\treturn file_get_contents($endpoint);\n}", "function distance($lat_1, $lon_1, $lat_2, $lon_2) {\n\n $radius_earth = 6371; // Радиус Земли\n\n $lat_1 = deg2rad($lat_1);\n $lon_1 = deg2rad($lon_1);\n $lat_2 = deg2rad($lat_2);\n $lon_2 = deg2rad($lon_2);\n\n $d = 2 * $radius_earth * asin(sqrt(sin(($lat_2 - $lat_1) / 2) ** 2 + cos($lat_1) * cos($lat_2) * sin(($lon_2 - $lon_1) / 2) ** 2));\n//\n return number_format($d, 2, '.', '');\n}", "public function setLongitude($lng)\n {\n $this->longitude = $lng;\n }", "public function test_make_coordinates_4()\n {\n $coord = \"52° 32' 25\\\" N; 89° 40' 31\\\" W\";\n $dd = \\SimpleMappr\\Mappr::makeCoordinates($coord);\n $this->assertEquals($dd[0], 52.540277777778);\n $this->assertEquals($dd[1], -89.675277777778);\n }", "public function setLon($value)\n {\n return $this->set(self::LON, $value);\n }", "public function setLon($value)\n {\n return $this->set(self::LON, $value);\n }", "function get_bounded_coordinates( $lat, $lon, $distance_in_km = 50 ) {\n\t// Based on http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates\n\n\t$angular_distance = $distance_in_km / 6371; // 6371 = radius of the earth in KM.\n\t$lat = deg2rad( $lat );\n\t$lon = deg2rad( $lon );\n\n\t$earth_min_lat = -1.5707963267949; // = deg2rad( -90 ) = -PI/2\n\t$earth_max_lat = 1.5707963267949; // = deg2rad( 90 ) = PI/2\n\t$earth_min_lon = -3.1415926535898; // = deg2rad( -180 ) = -PI\n\t$earth_max_lon = 3.1415926535898; // = deg2rad( 180 ) = PI\n\n\t$minimum_lat = $lat - $angular_distance;\n\t$maximum_lat = $lat + $angular_distance;\n\t$minimum_lon = $maximum_lon = 0;\n\n\t// Ensure that we're not within a pole-area of the world, weirdness will ensue.\n\tif ( $minimum_lat > $earth_min_lat && $maximum_lat < $earth_max_lat ) {\n\t\t$lon_delta = asin( sin( $angular_distance ) / cos( $lat ) );\n\t\t$minimum_lon = $lon - $lon_delta;\n\t\t$maximum_lon = $lon + $lon_delta;\n\n\t\tif ( $minimum_lon < $earth_min_lon ) {\n\t\t\t$minimum_lon += 2 * pi();\n\t\t}\n\n\t\tif ( $maximum_lon > $earth_max_lon ) {\n\t\t\t$maximum_lon -= 2 * pi();\n\t\t}\n\t} else {\n\t\t// Use a much simpler range in polar regions.\n\t\t$minimum_lat = max( $minimum_lat, $earth_min_lat );\n\t\t$maximum_lat = min( $maximum_lat, $earth_max_lat );\n\t\t$minimum_lon = $earth_min_lon;\n\t\t$maximum_lon = $earth_max_lon;\n\t}\n\n\treturn array(\n\t\t'latitude' => array(\n\t\t\t'min' => rad2deg( $minimum_lat ),\n\t\t\t'max' => rad2deg( $maximum_lat ),\n\t\t),\n\t\t'longitude' => array(\n\t\t\t'min' => rad2deg( $minimum_lon ),\n\t\t\t'max' => rad2deg( $maximum_lon ),\n\t\t),\n\t);\n}", "public function getLongitude()\n\t\t\t{\n\t\t\t\treturn $this->longitude;\n\t\t\t}", "function fumseck_extract_exif_geocoord($meta, $file) {\n\t\t$exif = exif_read_data( $file );\n\t\tif ( $exif['GPSLatitude'] and $exif['GPSLatitudeRef'] and $exif['GPSLongitude'] and $exif['GPSLongitudeRef'] ) {\n\t\t\t\n\t\t\t// Save both DMS and DegDec values for easier access later\n\t\t\t\n\t\t\t$meta['latitude_DMS'] = array( \n\t\t\t\t'degrees' => fumseck_frac_string_to_dec($exif['GPSLatitude'][0]),\n\t\t\t\t'minutes' => fumseck_frac_string_to_dec($exif['GPSLatitude'][1]),\n\t\t\t\t'seconds' => fumseck_frac_string_to_dec($exif['GPSLatitude'][2]),\n\t\t\t\t'direction' => $exif['GPSLatitudeRef']\n\t\t\t);\n\t\t\t\n\t\t\t//// Harmonize MinDec and DMS and round the seconds\n\t\t\t\n\t\t\t$tmp_minutes = $meta['latitude_DMS']['minutes'];\n\t\t\t$meta['latitude_DMS']['minutes'] = intval($tmp_minutes);\n\t\t\t$meta['latitude_DMS']['seconds'] = intval( $meta['latitude_DMS']['seconds'] + (floatval($tmp_minutes) - intval($tmp_minutes)) * 60);\n\t\t\t\n\t\t\t//// Convert to DegDec\n\t\t\t\n\t\t\t$meta['latitude_DegDec'] = fumseck_geocoord_DMS_to_DegDec( \n\t\t\t\t$meta['latitude_DMS']['degrees'],\n\t\t\t\t$meta['latitude_DMS']['minutes'],\n\t\t\t\t$meta['latitude_DMS']['seconds'],\n\t\t\t\t$meta['latitude_DMS']['direction']\n\t\t\t);\n\t\t\t\n\t\t\t// Repeat for longitude\n\t\t\t\n\t\t\t$meta['longitude_DMS'] = array( \n\t\t\t\t'degrees' => fumseck_frac_string_to_dec($exif['GPSLongitude'][0]),\n\t\t\t\t'minutes' => fumseck_frac_string_to_dec($exif['GPSLongitude'][1]),\n\t\t\t\t'seconds' => fumseck_frac_string_to_dec($exif['GPSLongitude'][2]),\n\t\t\t\t'direction' => $exif['GPSLongitudeRef']\n\t\t\t);\n\t\t\t\n\t\t\t$tmp_minutes = $meta['longitude_DMS']['minutes'];\n\t\t\t$meta['longitude_DMS']['minutes'] = intval($tmp_minutes);\n\t\t\t$meta['longitude_DMS']['seconds'] = intval( $meta['longitude_DMS']['seconds'] + ( floatval($tmp_minutes) - intval($tmp_minutes)) * 60);\n\t\t\t\n\t\t\t$meta['longitude_DegDec'] = fumseck_geocoord_DMS_to_DegDec( \n\t\t\t\t$meta['longitude_DMS']['degrees'],\n\t\t\t\t$meta['longitude_DMS']['minutes'],\n\t\t\t\t$meta['longitude_DMS']['seconds'],\n\t\t\t\t$meta['longitude_DMS']['direction']\n\t\t\t);\n\t\t}\n\treturn $meta;\n}", "function getYTile( $lat, $lon, $zoom ) {\n return floor((1 - log(tan(deg2rad($lat)) + 1 / cos(deg2rad($lat))) / pi()) /2 * pow(2, $zoom));\n}", "public function provideInvalidCoordinates() {\n/******************************************************************************\n ** **\n ** I actually FAIL the fifth test. I've got a bug in the method. **\n ** **\n ******************************************************************************/\n return [\n ['Way up north'],\n ['39.7392° N'],\n ['104.9903° W'],\n ['39.7392 N, 104.9903 W'],\n ['39° 44\\' 31.3548\" N, 104° 59\\' 29.5116\" W'],\n ['99.7392° N, 104.9903° W'],\n ['39.7392° N, 184.9903° W']\n ];\n }", "function amap_ma_geocode_location($location) {\n $coords = array();\n $google_api_key = trim(elgg_get_plugin_setting('google_api_key', AMAP_MA_PLUGIN_ID));\n $mapquest_api_key = trim(elgg_get_plugin_setting('mapquest_api_key', AMAP_MA_PLUGIN_ID));\n\n $geocoder = new \\Geocoder\\ProviderAggregator();\n $adapter = new \\Ivory\\HttpAdapter\\CurlHttpAdapter();\n $chain = new \\Geocoder\\Provider\\Chain([\n new \\Geocoder\\Provider\\GoogleMaps($adapter, $google_api_key),\n new \\Geocoder\\Provider\\MapQuest($adapter, $mapquest_api_key),\n ]);\n\n $geocoder->registerProvider($chain);\n\n try {\n $geocode = $geocoder->geocode($location);\n } catch (Exception $e) {\n error_log('amap_maps_api --------->' . $e->getMessage());\n return false;\n }\n\n if ($geocode->count() > 0) {\n $coords['lat'] = $geocode->first()->getLatitude();\n $coords['long'] = $geocode->first()->getLongitude();\n return $coords;\n }\n\n return false;\n}", "public function setLongitude($value)\n {\n return $this->set('Longitude', $value);\n }", "public function setLongitude($value)\n {\n return $this->set('Longitude', $value);\n }", "public function setLongitude($value)\n {\n return $this->set('Longitude', $value);\n }", "public function setLongitude($value)\n {\n return $this->set('Longitude', $value);\n }", "public function from(float $latitude, float $longitude): StationDetailsBuilder;", "public function getLng()\n {\n return $this->lng;\n }", "abstract public function coordinates();", "function busZone($lat,$long){\n if ($lat < 38.711079 && $lat > 38.709729 && $long > -77.090243 && $long < -77.087647){\n $zone = 1;\n }\n if ($lat < 38.710886 && $lat > 38.709729 && $long > -77.092382 && $long < -77.090243){\n $zone = 2;\n }\n if ($lat < 38.709729 && $lat > 38.707585 && $long > -77.092924 && $long < -77.091307){\n $zone = 3;\n }\n if ($lat < 38.707585 && $lat > 38.705752 && $long > -77.092287 && $long < -77.090442){\n $zone = 4;\n }\n if ($lat < 38.706635 && $lat > 38.70484 && $long > -77.090442 && $long < -77.088912){\n $zone = 5;\n }\n if ($lat < 38.705693 && $lat > 38.70484 && $long > -77.088912 && $long < -77.087666){\n $zone = 6;\n }\n return $zone;\n}", "function getlatlng($address)\n\t{\n\t\t#perintah pengulangan jika terdapat query limit saat mendapatkan data\n\t\tgetlatlng:\n\t\t$data = json_decode(file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\" . urlencode($address)));\n\t\t\n\t\t#berhenti jika data tidak lagi over query limit\n\t\tif($data->status == \"OVER_QUERY_LIMIT\")\n\t\t{\n\t\t\tgoto getlatlng;\n\t\t}else \n\t\t{\n\t\t\treturn \"{$data->results[0]->geometry->location->lat},{$data->results[0]->geometry->location->lng}\";\n\t\t}\n\t}", "function amap_ma_save_object_coords($location, $object, $pluginname, $lat_g = '', $lng_g = '') {\n if ($lat_g && $lng_g) {\n $lat = $lat_g;\n $lng = $lng_g;\n } else if ($location) {\n $prefix = elgg_get_config('dbprefix');\n $coords = amap_ma_geocode_location($location);\n\n if ($coords) {\n $lat = $coords['lat'];\n $lng = $coords['long'];\n }\n }\n\n if ($lat && $lng) {\n $prefix = elgg_get_config('dbprefix');\n $object->setLatLong($lat, $lng);\n $query = \"INSERT INTO {$prefix}entity_geometry (entity_guid, geometry)\n VALUES ({$object->guid}, GeomFromText('POINT({$lat} {$lng})'))\n ON DUPLICATE KEY UPDATE geometry=GeomFromText('POINT({$lat} {$lng})')\";\n\n insert_data($query);\n\n return true;\n }\n\n return false;\n}", "public static function invalidMarkerShapePolyCoordinate()\n {\n return new static('The x & y coordinates of a poly marker shape must be numeric values.');\n }", "function getCoordination($address){\r\n $address = str_replace(\" \", \"+\", $address); // replace all the white space with \"+\" sign to match with google search pattern\r\n \r\n $url = \"http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address\";\r\n \r\n $response = file_get_contents($url);\r\n \r\n $json = json_decode($response,TRUE); //generate array object from the response from the web\r\n\r\n $latitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lat\"]);\r\n $longitude = ($json[\"results\"][0][\"geometry\"][\"location\"][\"lng\"]);\r\n\r\n return array(\"latitude\" => $latitude, \"longitude\" => $longitude);\r\n }", "public function getLatitude(){\r\n\t\treturn $this->latitude;\r\n\t}" ]
[ "0.74943155", "0.6869171", "0.6869021", "0.6862848", "0.6771909", "0.64797", "0.63220155", "0.6300669", "0.61944914", "0.6168924", "0.6144094", "0.61440367", "0.61279035", "0.6127385", "0.6115037", "0.6104397", "0.60598594", "0.6037117", "0.60219795", "0.60045576", "0.5953353", "0.5921888", "0.58829194", "0.58829194", "0.58816224", "0.5877811", "0.5857675", "0.5857326", "0.5843562", "0.5843562", "0.5843562", "0.5843562", "0.5843562", "0.5843562", "0.5843562", "0.5843562", "0.58423907", "0.58376586", "0.5814744", "0.57851386", "0.5746521", "0.57290137", "0.57011384", "0.57003963", "0.57003963", "0.56922936", "0.5685823", "0.5672905", "0.5658279", "0.5634001", "0.5606428", "0.5606014", "0.56051856", "0.55854803", "0.55650336", "0.5561851", "0.5561475", "0.5554711", "0.5551039", "0.5549933", "0.55267394", "0.5526412", "0.5519634", "0.55166125", "0.5504879", "0.5503313", "0.54878956", "0.5482738", "0.5482631", "0.547789", "0.54769856", "0.546989", "0.5441757", "0.5434059", "0.54292214", "0.54242396", "0.5424187", "0.5419161", "0.5418909", "0.54178727", "0.54177076", "0.54177076", "0.5417574", "0.5414812", "0.5394776", "0.53812546", "0.53766376", "0.53751165", "0.53694254", "0.53694254", "0.53694254", "0.53694254", "0.5364944", "0.53509736", "0.5341508", "0.53413075", "0.5329385", "0.5322174", "0.5321015", "0.5319119", "0.5317295" ]
0.0
-1
Do a version check to determine if this sniff needs to run at all. Note: This sniff should only trigger errors when both PHP 5.3 or lower, as well as PHP 5.4 or higher need to be supported within the application.
protected function bowOutEarly() { return ($this->supportsBelow('5.3') === false || $this->supportsAbove('5.4') === false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkPhpVersion() {}", "public function min_php_version_check()\n {\n }", "public function checkRequiredVersion() {\n if (version_compare(PHP_VERSION, '4.3.2', '>=')) {\n return TRUE;\n }\n $this->logMsg(\n MSG_ERROR,\n PAPAYA_LOGTYPE_MODULES,\n 'Could not get HTML Purifier instance because this PHP version is too old.'\n );\n return FALSE;\n }", "protected function checkPHPVersion()\n {\n // Init\n $current = ( false === strpos( phpversion(), '-' ) ? phpversion() : substr( phpversion(), 0, strpos( phpversion(), '-' ) ) );\n $required = '5.3.10';\n \n if( 0 > strnatcmp( $current, $required ) )\n {\n throw new Exception( sprintf( 'NNScripts'. PHP_EOL .'Error: PHP version %s is required but version %s is found.', $required, $current ) );\n }\n }", "public static function checkPhpVersion()\n{\nif (version_compare(PHP_VERSION,'5.3.0') < 0)\n\t{\n\techo PHP_VERSION.': Unsupported PHP version '\n\t\t.'- PHK needs at least version 5.3.0';\n\texit(1);\n\t}\n}", "public function checkVersions() {\n\t\treturn ($this->checkPHPVersion() == self::VERSION_COMPATIBLE) && ($this->checkOpenSSLVersion() == self::VERSION_COMPATIBLE) && ($this->checkWordPressVersion() == self::VERSION_COMPATIBLE);\n\t}", "function check_php_version () {\n\t$testSplit = explode ('.', '4.3.0');\n\t$currentSplit = explode ('.', phpversion());\n\n\tif ($testSplit[0] < $currentSplit[0])\n\t\treturn True;\n\tif ($testSplit[0] == $currentSplit[0]) {\n\t\tif ($testSplit[1] < $currentSplit[1])\n\t\t\treturn True;\n\t\tif ($testSplit[1] == $currentSplit[1]) {\n\t\t\tif ($testSplit[2] <= $currentSplit[2])\n\t\t\t\treturn True;\n\t\t}\n\t}\n\treturn False;\n}", "private function performMinimumRequirementsCheck()\r\n {\r\n if (version_compare(PHP_VERSION, '5.3.7', '<')) {\r\n echo \"Sorry, Simple PHP Login does not run on a PHP version older than 5.3.7 !\";\r\n } elseif (version_compare(PHP_VERSION, '5.5.0', '<')) {\r\n require_once(\"libraries/password_compatibility_library.php\");\r\n return true;\r\n } elseif (version_compare(PHP_VERSION, '5.5.0', '>=')) {\r\n return true;\r\n }\r\n // default return\r\n return false;\r\n }", "function wp_version_check($extra_stats = array(), $force_check = \\false)\n {\n }", "protected function checkPcreVersion() {}", "function is_php_version_compatible($required)\n {\n }", "private function _checkCompatibility(){\n\n\t\t$pageContent = new Page\\Content;\n\t\t$model = Advertikon::getCurrentModel();\n\t\t$mock = false;\n\n\t\tif( $mock || version_compare( PHP_VERSION , self::MIN_PHP_VER ) === -1 ) {\n\t\t\t$contentRecord = new Page\\Content\\Record;\n\t\t\t$contentRecord->setTypeWarning();\n\t\t\t$record = $model->__( 'PHP version needed at least %s, current version %s.' , self::MIN_PHP_VER , PHP_VERSION );\n\t\t\t$record .= sprintf( ' <a href=\"%s\" target=\"_blank\">%s</a>' , 'http://php.net/manual/install.php' , $model->__( 'More details' ) );\n\t\t\t$contentRecord->setRecord( $record );\n\t\t\t$pageContent->addRecord( $contentRecord );\n\t\t}\n\n\t\t$this->_childCheckCompatibility( $pageContent , $mock );\n\n\t\tif( $pageContent->recordCount() > 0 ) {\n\t\t\t$pageContent->setHeader( $model->__( 'The library incompatibility, with the runtime environment, detected. The following must be corrected for the continuation:' ) );\n\t\t\tthrow new Exception\\Transport( $pageContent );\n\t\t}\n\n\t\treturn true;\n\t}", "public function checkPHPVersion() {\n\t\tif (version_compare(phpversion(), self::PHP_DEPRECATING, '>=')) {\n\t\t\treturn self::VERSION_COMPATIBLE;\n\t\t}\n\t\t\n\t\tif (self::PHP_DEPRECATING != self::PHP_MINIMUM && version_compare(phpversion(), self::PHP_MINIMUM, '>=')) {\n\t\t\treturn self::VERSION_DEPRECATED;\n\t\t}\n\t\t\n\t\treturn self::VERSION_UNSUPPORTED;\n\t}", "private static function check_php() {\n\t\treturn version_compare( phpversion(), self::MINIMUM_PHP_VERSION, '>=' );\n\t}", "public function checkRequirements()\n\t{\n\t\t$tests = array('result' => true);\n\t\t$tests['curl'] = array('name' => $this->l('PHP cURL extension must be enabled on your server'), 'result' => extension_loaded('curl'));\n\t\t$tests['mbstring'] = array('name' => $this->l('PHP Multibyte String extension must be enabled on your server'), 'result' => extension_loaded('mbstring'));\n\t\tif (Configuration::get('STRIPE_MODE'))\n\t\t\t$tests['ssl'] = array('name' => $this->l('SSL must be enabled on your store (before entering Live mode)'), 'result' => Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off'));\n\t\t$tests['php52'] = array('name' => $this->l('Your server must run PHP 5.3.3 or greater'), 'result' => version_compare(PHP_VERSION, '5.3.3', '>='));\n\t\t$tests['configuration'] = array('name' => $this->l('You must sign-up for Stripe and configure your account settings in the module (publishable key, secret key...etc.)'), 'result' => $this->checkSettings());\n\n\t\tif (_PS_VERSION_ < 1.5)\n\t\t{\n\t\t\t$tests['backward'] = array('name' => $this->l('You are using the backward compatibility module'), 'result' => $this->backward, 'resolution' => $this->backward_error);\n\t\t\t$tmp = Module::getInstanceByName('mobile_theme');\n\t\t\tif ($tmp && isset($tmp->version) && !version_compare($tmp->version, '0.3.8', '>='))\n\t\t\t\t$tests['mobile_version'] = array('name' => $this->l('You are currently using the default mobile template, the minimum version required is v0.3.8').' (v'.$tmp->version.' '.$this->l('detected').' - <a target=\"_blank\" href=\"http://addons.prestashop.com/en/mobile-iphone/6165-prestashop-mobile-template.html\">'.$this->l('Please Upgrade').'</a>)', 'result' => version_compare($tmp->version, '0.3.8', '>='));\n\t\t}\n\n\t\tforeach ($tests as $k => $test)\n\t\t\tif ($k != 'result' && !$test['result'])\n\t\t\t\t$tests['result'] = false;\n\n\t\treturn $tests;\n\t}", "function checkPhpVersion()\n\t{\n\t\t$version = explode('.', PHP_VERSION);\n\n\t\t$message = 'Php version must be at least 5.3.7 for wpdiontheme to work. Please upgrade.';\n\n\t\tif (strnatcmp(phpversion(),'5.3.7') >= 0) \n\t { \n\t \t// do nothing\n\t } \n\t else \n\t { \n\t\t\tdie($message); \n\t } \n\t}", "public function checkVersionsAndWarn() {\n\t\t//PHP\n\t\t$php = $this->checkPHPVersion();\n\t\tif ($php == self::VERSION_DEPRECATED) {\n\t\t\t$this->_alertEmail(\n\t\t\t\t'phpVersionCheckDeprecationEmail_' . self::PHP_DEPRECATING,\n\t\t\t\t__('PHP version too old', 'wordfence'),\n\t\t\t\tsprintf(__('Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6 but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP))\n\t\t\t);\n\t\t\t\n\t\t\t$this->_adminNotice(\n\t\t\t\t'phpVersionCheckDeprecationNotice_' . self::PHP_DEPRECATING,\n\t\t\t\t'phpVersionCheck',\n\t\t\t\tsprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6 but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href=\"' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '\" target=\"_blank\" rel=\"noopener noreferrer\">' . __('Learn More', 'wordfence') . '</a>'\n\t\t\t);\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse if ($php == self::VERSION_UNSUPPORTED) {\n\t\t\t$this->_alertEmail(\n\t\t\t\t'phpVersionCheckUnsupportedEmail_' . self::PHP_MINIMUM,\n\t\t\t\t__('PHP version too old', 'wordfence'),\n\t\t\t\tsprintf(__('Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6 but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP))\n\t\t\t);\n\t\t\t\n\t\t\t$this->_adminNotice(\n\t\t\t\t'phpVersionCheckUnsupportedNotice_' . self::PHP_MINIMUM,\n\t\t\t\t'phpVersionCheck',\n\t\t\t\tsprintf(__('<strong>WARNING: </strong> Your site is using a PHP version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of PHP 7.x or 5.6 but will currently support PHP versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), phpversion(), self::PHP_DEPRECATING) . ' <a href=\"' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_PHP) . '\" target=\"_blank\" rel=\"noopener noreferrer\">' . __('Learn More', 'wordfence') . '</a>'\n\t\t\t);\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\twfAdminNoticeQueue::removeAdminNotice(false, 'phpVersionCheck');\n\t\t}\n\t\t\n\t\t//OpenSSL\n\t\t$openssl = $this->checkOpenSSLVersion();\n\t\tif ($openssl == self::VERSION_DEPRECATED) {\n\t\t\t$this->_alertEmail(\n\t\t\t\t'opensslVersionCheckDeprecationEmail_' . self::OPENSSL_DEPRECATING,\n\t\t\t\t__('OpenSSL version too old', 'wordfence'),\n\t\t\t\tsprintf(__('Your site is using an OpenSSL version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of OpenSSL but will currently support OpenSSL versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), self::openssl_make_text_version(), self::OPENSSL_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_OPENSSL))\n\t\t\t);\n\t\t\t\n\t\t\t$this->_adminNotice(\n\t\t\t\t'opensslVersionCheckDeprecationNotice_' . self::OPENSSL_DEPRECATING,\n\t\t\t\t'opensslVersionCheck',\n\t\t\t\tsprintf(__('<strong>WARNING: </strong> Your site is using an OpenSSL version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of OpenSSL but will currently support OpenSSL versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), self::openssl_make_text_version(), self::OPENSSL_DEPRECATING) . ' <a href=\"' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_OPENSSL) . '\" target=\"_blank\" rel=\"noopener noreferrer\">' . __('Learn More', 'wordfence') . '</a>'\n\t\t\t);\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse if ($openssl == self::VERSION_UNSUPPORTED) {\n\t\t\t$this->_alertEmail(\n\t\t\t\t'opensslVersionCheckUnsupportedEmail_' . self::PHP_MINIMUM,\n\t\t\t\t__('OpenSSL version too old', 'wordfence'),\n\t\t\t\tsprintf(__('Your site is using an OpenSSL version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of OpenSSL but will currently support OpenSSL versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), self::openssl_make_text_version(), self::OPENSSL_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_OPENSSL))\n\t\t\t);\n\t\t\t\n\t\t\t$this->_adminNotice(\n\t\t\t\t'opensslVersionCheckUnsupportedNotice_' . self::PHP_MINIMUM,\n\t\t\t\t'opensslVersionCheck',\n\t\t\t\tsprintf(__('<strong>WARNING: </strong> Your site is using an OpenSSL version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of OpenSSL but will currently support OpenSSL versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), self::openssl_make_text_version(), self::OPENSSL_DEPRECATING) . ' <a href=\"' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_OPENSSL) . '\" target=\"_blank\" rel=\"noopener noreferrer\">' . __('Learn More', 'wordfence') . '</a>'\n\t\t\t);\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\twfAdminNoticeQueue::removeAdminNotice(false, 'opensslVersionCheck');\n\t\t}\n\t\t\n\t\t//WordPress\n\t\t$wordpress = $this->checkWordPressVersion();\n\t\tif ($wordpress == self::VERSION_DEPRECATED) {\n\t\t\trequire(ABSPATH . 'wp-includes/version.php'); /** @var string $wp_version */\n\t\t\t\n\t\t\t$this->_alertEmail(\n\t\t\t\t'wordpressVersionCheckDeprecationEmail_' . self::WORDPRESS_DEPRECATING,\n\t\t\t\t__('WordPress version too old', 'wordfence'),\n\t\t\t\tsprintf(__('Your site is using a WordPress version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of WordPress but will currently support WordPress versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), $wp_version, self::WORDPRESS_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_WORDPRESS))\n\t\t\t);\n\t\t\t\n\t\t\t$this->_adminNotice(\n\t\t\t\t'wordpressVersionCheckDeprecationNotice_' . self::WORDPRESS_DEPRECATING,\n\t\t\t\t'wordpressVersionCheck',\n\t\t\t\tsprintf(__('<strong>WARNING: </strong> Your site is using a WordPress version (%s) that will no longer be supported by Wordfence in an upcoming release and needs to be updated. We recommend using the newest version of WordPress but will currently support WordPress versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), $wp_version, self::WORDPRESS_DEPRECATING) . ' <a href=\"' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_WORDPRESS) . '\" target=\"_blank\" rel=\"noopener noreferrer\">' . __('Learn More', 'wordfence') . '</a>'\n\t\t\t);\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse if ($wordpress == self::VERSION_UNSUPPORTED) {\n\t\t\trequire(ABSPATH . 'wp-includes/version.php'); /** @var string $wp_version */\n\t\t\t\n\t\t\t$this->_alertEmail(\n\t\t\t\t'wordpressVersionCheckUnsupportedEmail_' . self::WORDPRESS_MINIMUM,\n\t\t\t\t__('WordPress version too old', 'wordfence'),\n\t\t\t\tsprintf(__('Your site is using a WordPress version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of WordPress but will currently support WordPress versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), $wp_version, self::WORDPRESS_DEPRECATING) . ' ' . sprintf(__('Learn More: %s', 'wordfence'), wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_WORDPRESS))\n\t\t\t);\n\t\t\t\n\t\t\t$this->_adminNotice(\n\t\t\t\t'wordpressVersionCheckUnsupportedNotice_' . self::WORDPRESS_MINIMUM,\n\t\t\t\t'wordpressVersionCheck',\n\t\t\t\tsprintf(__('<strong>WARNING: </strong> Your site is using a WordPress version (%s) that is no longer supported by Wordfence and needs to be updated. We recommend using the newest version of WordPress but will currently support WordPress versions as old as %s. Version checks are run regularly, so if you have successfully updated, you can dismiss this notice or check that the update has taken effect later.', 'wordfence'), $wp_version, self::WORDPRESS_DEPRECATING) . ' <a href=\"' . wfSupportController::esc_supportURL(wfSupportController::ITEM_VERSION_WORDPRESS) . '\" target=\"_blank\" rel=\"noopener noreferrer\">' . __('Learn More', 'wordfence') . '</a>'\n\t\t\t);\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\twfAdminNoticeQueue::removeAdminNotice(false, 'wordpressVersionCheck');\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "protected function checkPHPVersion()\n\t{\n\t\tif (!empty($this->minimumPHPVersion))\n\t\t{\n\t\t\tif (defined('PHP_VERSION'))\n\t\t\t{\n\t\t\t\t$version = PHP_VERSION;\n\t\t\t}\n\t\t\telseif (function_exists('phpversion'))\n\t\t\t{\n\t\t\t\t$version = phpversion();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$version = '5.0.0'; // all bets are off!\n\t\t\t}\n\n\t\t\tif (!version_compare($version, $this->minimumPHPVersion, 'ge'))\n\t\t\t{\n\t\t\t\t$msg = \"<p>You need PHP $this->minimumPHPVersion or later to install this extension</p>\";\n\n\t\t\t\t$this->log($msg);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function php_version_check() {\r\n\t\tif ( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tswitch_theme( WP_DEFAULT_THEME );\r\n\r\n\t\treturn false;\r\n\t}", "function __requirements(){\n\nglobal $__settings, $error, $software;\n\n\t//If there are some shorfalls then pass it to $error and return false\n\tif(sversion_compare($__settings['ver'], '5.5.2.1', '<')){\n\t\t$error[] = 'You cannot upgrade to '.$software['ver'].' unless you have upgraded to 5.5.2.1';\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\n}", "protected function _version_check()\n\t{\n\t\tee()->load->library('el_pings');\n\t\t$version_file = ee()->el_pings->get_version_info();\n\n\t\tif ( ! $version_file)\n\t\t{\n\t\t\tee('CP/Alert')->makeBanner('notices')\n\t\t\t\t->asWarning()\n\t\t\t\t->withTitle(lang('cp_message_warn'))\n\t\t\t\t->addToBody(sprintf(\n\t\t\t\t\tlang('new_version_error'),\n\t\t\t\t\tee()->cp->masked_url(DOC_URL.'troubleshooting/error_messages/unexpected_error_occurred_attempting_to_download_the_current_expressionengine_version_number.html')\n\t\t\t\t))\n\t\t\t\t->now();\n\t\t}\n\t}", "public function php_version_satisfies_requirements()\n {\n $this->assertFalse(\n version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<'),\n 'PHP version ' . self::MIN_PHP_VERSION . ' or greater is required but only '\n . PHP_VERSION . ' found.'\n );\n }", "function birdseye_component_checkversion()\n{\n if (!function_exists('get_product_release'))\n return false;\n if (get_product_release() < 207)\n return false;\n\n return true;\n}", "function checkVersions() {\n //TODO: Put the version checker service online instead of localhost\n $curl_request = curl_init(\"0.0.0.0:3002\");\n\n //By default the request type is \"GET\"\n curl_setopt_array($curl_request, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_CONNECTTIMEOUT => 10, //Must connect within 10 seconds\n CURLOPT_TIMEOUT => 20, //Must finish the whole request in 20 seconds... or else\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0, //Falls back to 1.1 if 2.0 won't work\n ));\n\n //Get a response or a returned error (or if failed to connect)\n $response = curl_exec($curl_request);\n $err = curl_error($curl_request);\n //Don't needlessly call logMsg if no error was thrown:\n if(isset($err)) {\n logMsg($err);\n curl_close($curl_request);\n return false;\n }\n\n //A sample successful response body would look like this: \"7.3.1 1.0.3\"\n //where \"7.3.1\" is the PHP version and \"1.0.3\" is the Web Mill version.\n\n //Close the connection and free up $curl_request's resources:\n curl_close($curl_request);\n\n //Put the PHP version and Web Mill version into an array\n //They are currently separated by a space:\n $versions = explode(\" \", $response);\n return $versions;\n }", "public function testPhpVersionIsCorrect()\n {\n $this->assert->php->version\n ->atLeast('5.2');\n }", "function version_check($vercheck)\n {\n $minver = str_replace(\".\",\"\", $vercheck);\n $curver = str_replace(\".\",\"\", phpversion());\n return ($curver >= $minver) ? TRUE : FALSE;\n }", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "function alertstream_component_checkversion()\n{\n if(!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 500) {\n return false;\n }\n return true;\n}", "private function _version($v = 5)\r\n\t{\r\n $_cur = intval(phpversion());\r\n\t\tif ($_cur >= $v) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthrow new TACException('PHP version ' . $v . ' required; have version ' . $_cur);\r\n\t\t}\r\n return false;\r\n\t}", "function mrl_check_versions()\r\n{\r\n $versions = get_option('MyReadingLibraryVersions');\r\n if (empty($versions) ||\r\n\t\t$versions['db'] < MY_READING_LIBRARY_DB ||\r\n\t\t$versions['options'] < MY_READING_LIBRARY_OPTIONS ||\r\n\t\t$versions['rewrite'] < MY_READING_LIBRARY_REWRITE)\r\n {\r\n\t\tmrl_install();\r\n }\r\n}", "function IsOldVersion()\n{\n $i_too_old = 3; // version 3 PHP is not usable here\n $a_modern = array(4,1,0); // versions prior to this are \"old\" - \"4.1.0\"\n\n $a_this_version = explode(\".\",phpversion());\n\n if ((int) $a_this_version[0] <= $i_too_old)\n die(\"This script requires at least PHP version 4. Sorry.\");\n $i_this_num = ($a_this_version[0] * 10000) +\n ($a_this_version[1] * 100) +\n $a_this_version[2];\n $i_modern_num = ($a_modern[0] * 10000) +\n ($a_modern[1] * 100) +\n $a_modern[2];\n return ($i_this_num < $i_modern_num);\n}", "public function checkCommon()\n {\n // check php version\n $current = phpversion();\n $required = '5.3.3';\n\n if (version_compare($required, $current, '>')) {\n $this->issues['critical'][] = \"PHP version {$current} is too old. Make sure to install {$required} or newer.\";\n }\n\n // check json support\n if (!function_exists('json_decode')) {\n $this->issues['critical'][] = 'No JSON support available.';\n }\n\n // check dom xml support\n if (!class_exists('DOMDocument')) {\n $this->issues['critical'][] = 'No DOM XML support available.';\n }\n\n // check multibyte string support\n if (!extension_loaded('mbstring')) {\n $this->issues['notice'][] = 'No Multibyte string (mbstring) support available.';\n }\n }", "private function check_compatibility()\n\t{\n\t\tif ( ! extension_loaded( 'curl' ) || ! extension_loaded( 'json' ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('There is missing dependant extensions - please ensure both cURL and JSON modules are installed');\n\t\t}\n\n\t\tif ( ! in_array( 'md5', hash_algos() ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('md5 appears to be unsupported - make sure you have support for it, or upgrade your version of PHP.');\n\t\t}\n\n\t}", "public function compatVersionConditionMatchesOlderRelease() {}", "public function compatVersionConditionMatchesOlderRelease() {}", "function scheduledreporting_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 512) {\n return false;\n }\n return true;\n}", "protected function test_compatibility() {\n\t\tif ( is_admin() || $_SERVER['PHP_SELF'] == '/wp-login.php' ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( version_compare(phpversion(), '5.3.0', '<') && !is_admin() ) {\n\t\t\ttrigger_error('Timber requires PHP 5.3.0 or greater. You have '.phpversion(), E_USER_ERROR);\n\t\t}\n\t\tif ( !class_exists('Twig\\Token') ) {\n\t\t\ttrigger_error('You have not run \"composer install\" to download required dependencies for Timber, you can read more on https://github.com/timber/timber#installation', E_USER_ERROR);\n\t\t}\n\t}", "public static function check_phpvar()\n {\n if (version_compare(phpversion(), '5.3.0') >= 0) {\n return;\n }\n echo 'MODX is compatible with PHP 5.3.0 and higher. Please upgrade your PHP installation!';\n exit;\n }", "public function checkRequirements()\n\t{\n\t\t$installedMySqlVersion = blx()->db->serverVersion;\n\t\t$requiredMySqlVersion = blx()->params['requiredMysqlVersion'];\n\t\t$requiredPhpVersion = blx()->params['requiredPhpVersion'];\n\n\t\t$phpCompat = version_compare(PHP_VERSION, $requiredPhpVersion, '>=');\n\t\t$databaseCompat = version_compare($installedMySqlVersion, $requiredMySqlVersion, '>=');\n\n\t\tif (!$phpCompat && !$databaseCompat)\n\t\t{\n\t\t\tthrow new Exception(Blocks::t('The update can’t be installed because Blocks requires PHP version \"{requiredPhpVersion}\" or higher and MySQL version \"{requiredMySqlVersion}\" or higher. You have PHP version \"{installedPhpVersion}\" and MySQL version \"{installedMySqlVersion}\" installed.',\n\t\t\t\tarray('requiredPhpVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedPhpVersion' => PHP_VERSION,\n\t\t\t\t 'requiredMySqlVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedMySqlVersion' => $installedMySqlVersion\n\t\t\t\t)));\n\t\t}\n\t\telse if (!$phpCompat)\n\t\t{\n\t\t\tthrow new Exception(Blocks::t('The update can’t be installed because Blocks requires PHP version \"{requiredPhpVersion}\" or higher and you have PHP version \"{installedPhpVersion}\" installed.',\n\t\t\t\tarray('requiredPhpVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedPhpVersion' => PHP_VERSION\n\t\t\t)));\n\t\t}\n\t\telse if (!$databaseCompat)\n\t\t{\n\t\t\tthrow new Exception(Blocks::t('The update can’t be installed because Blocks requires MySQL version \"{requiredMySqlVersion}\" or higher and you have MySQL version \"{installedMySqlVersion}\" installed.',\n\t\t\t\tarray('requiredMySqlVersion' => $requiredMySqlVersion,\n\t\t\t\t 'installedMySqlVersion' => $installedMySqlVersion\n\t\t\t\t)));\n\t\t}\n\t}", "function alertcloud_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 126) {\n return false;\n }\n return true;\n}", "function check_php_version($version)\n {\n // intval used for version like \"4.0.4pl1\"\n $testVer=intval(str_replace(\".\", \"\",$version));\n $curVer=intval(str_replace(\".\", \"\",phpversion()));\n if( $curVer < $testVer )\n return false;\n return true;\n }", "private function is_php_version_ready() {\n\n\t\tif ( ! version_compare( $this->min_php_version , PHP_VERSION, '>=' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->add_error_notice(\n\t\t\t'PHP ' . $this->min_php_version . '+ is required',\n\t\t\t'You\\'re running version ' . PHP_VERSION\n\t\t);\n\n\t\treturn false;\n\t}", "public function checkCompatibility(): void\n {\n if ( ! $this->satisfiesPHPVersion()) {\n throw IncompatiblePlatformException::create(\n 'The client required PHP version >= ' . self::MIN_PHP_VERSION . ', you have ' . PHP_VERSION . '.',\n IncompatiblePlatformException::INCOMPATIBLE_PHP_VERSION\n );\n }\n\n if ( ! $this->satisfiesJSONExtension()) {\n throw IncompatiblePlatformException::create(\n 'PHP extension json is not enabled. Please make sure to enable \"json\" in your PHP configuration.',\n IncompatiblePlatformException::INCOMPATIBLE_JSON_EXTENSION\n );\n }\n }", "public function check_requirements() {\n global $wp_version;\n\n $installed_php_version = phpversion();\n $installed_wp_version = $wp_version;\n $required_php_version = '5.2.4';\n $required_wp_version = '3.5.2';\n $installed_php_is_compatible = version_compare( $installed_php_version, $required_php_version, '>=' );\n $installed_wp_is_compatible = version_compare( $installed_wp_version, $required_wp_version, '>=' );\n\n $notices = array();\n $template = __( '<p>LaterPay: Your server <strong>does not</strong> meet the minimum requirement of %s version %s or higher. You are running %s version %s.</p>', 'laterpay' );\n\n // check PHP compatibility\n if ( ! $installed_php_is_compatible ) {\n $notices[] = sprintf( $template, 'PHP', $required_php_version, 'PHP', $installed_php_version );\n }\n\n // check WordPress compatibility\n if ( ! $installed_wp_is_compatible ) {\n $notices[] = sprintf( $template, 'Wordpress', $required_wp_version, 'Wordpress', $installed_wp_version );\n }\n\n // deactivate plugin, if requirements are not fulfilled\n if ( count( $notices ) > 0 ) {\n // suppress 'Plugin activated' notice\n unset( $_GET['activate'] );\n deactivate_plugins( $this->config->plugin_base_name );\n $notices[] = __( 'The LaterPay plugin could not be installed. Please fix the reported issues and try again.', 'laterpay' );\n }\n\n return $notices;\n }", "public function checkPHPVersion() {\r\n if ( version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<') ) {\r\n wp_die( sprintf( __('<p>PHP %s+ is required to use <b>%s</b> plugin. You have %s installed.</p>', 'instant-cryptocurrency-exchange'), self::MIN_PHP_VERSION, self::PLUGIN_NAME, PHP_VERSION ), 'Plugin Activation Error', ['response' => 200, 'back_link' => TRUE] );\r\n }\r\n }", "private function checkPHPVersion($version)\n\t{\n\t\t$version = $this->validateVersionNumber($version);\n\n\t\t// If the version number is invalid, don't go any further\n\t\tif ($version === false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$majorVersion = substr($version, 0, 1);\n\n\t\t// The version string should meet the minimum supported PHP version for 3.0.0 and be a released PHP version\n\t\tif (version_compare($version, '5.3.1', '<') || version_compare($version, '8.0.0', '>=') || $majorVersion == 6)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $version;\n\t}", "function checkPhpVersion($version) {\n\treturn (version_compare(PHP_VERSION, $version) !== -1);\n}", "function self_check()\n\t{\n\t\tif ($gpg = $this->call('--list-config'))\n\t\t{\n\t\t\t$gpg = explode(\"\\n\", $gpg);\n\n\t\t\t// no gpg version string in the wrapper output\n\t\t\tif (is_array($gpg) === false || false === is_array($sub = explode(':', $gpg[0])))\n\t\t\t{\n\t\t\t\t return 2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($sub[0] == 'cfg' && $sub[1] == 'version')\n\t\t\t\t{\n\t\t\t\t\t// version number requirement is not met\n\t\t\t\t\tif ($sub[2] < GPG_VERSION_MIN)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 3;\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\treturn 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no output from the backend wrapper\n\t\t\treturn 1;\n\t\t}\n\t\t// everything's okay\n\t\treturn 0;\n\t}", "protected function _checkZf2794()\n {\n if (strtolower(substr(PHP_OS, 0, 3)) == 'win' && version_compare(PHP_VERSION, '5.1.4', '=')) {\n $this->markTestIncomplete('Error occurs for PHP 5.1.4 on Windows');\n }\n }", "function plugin_estimation_check_prerequisites() {\n\n //Version check is not done by core in GLPI < 9.2 but has to be delegated to core in GLPI >= 9.2.\n $version = preg_replace('/^((\\d+\\.?)+).*$/', '$1', GLPI_VERSION);\n if (version_compare($version, '9.2', '<')) {\n echo \"This plugin requires GLPI >= 9.2\";\n return false;\n }\n return true;\n}", "private function _checkPHPUnitVersion( )\n {\n $current = PHPUnit_Runner_Version::id();\n if( ! version_compare($current, self::REQUIRED_PHPUNIT_VERSION, '>=') )\n {\n self::_halt(sprintf(\n 'JPUP is not compatible with PHPUnit %s; please upgrade to %s or later.',\n $current,\n self::REQUIRED_PHPUNIT_VERSION\n ));\n }\n }", "public function isPhpVersionSupported()\n {\n $app = App::instance();\n $php_value = phpversion();\n $php_error = (version_compare($php_value, App::REQUIRED_PHP_VERSION) != -1) ? false : true;\n $checking_result = ($php_error == false) ? true : false;\n\n if (!$checking_result) {\n $app->setNotification('E', App::instance()->t('error'), $app->t('text_php_version_notice', array('version', App::REQUIRED_PHP_VERSION)), true, 'validator');\n }\n\n return $checking_result;\n }", "private function meets_requirements() {\r\n\r\n\t\t// check PHP version\r\n\t\tif ( version_compare( phpversion(), self::REQUIRED_PHP_VERSION, '<' ) ) {\r\n\t\t\t$notice = wp_sprintf( 'BlockMeister requires PHP %s or higher to run.', self::REQUIRED_PHP_VERSION );\r\n\t\t\t$this->add_admin_error_notice_on_plugins_page( $notice );\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// check WP version\r\n\t\tif ( version_compare( $GLOBALS['wp_version'], self::REQUIRED_WP_VERSION, '<' ) ) {\r\n\t\t\t$notice = wp_sprintf( 'BlockMeister requires WordPress %s or later to run.', self::REQUIRED_WP_VERSION );\r\n\t\t\t$this->add_admin_error_notice_on_plugins_page( $notice );\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "private function validateVersion()\n {\n return preg_match('/[0-99]+\\.[0-99]+\\.[0-99]+.*/', $this->version);\n }", "protected function preflightPHP()\n {\n if (version_compare(PHP_VERSION, '7.1.0', '<')) {\n return $this->error(\"PHP versions below 7.1.0 are not supported!\", true);\n }\n return true;\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 static function check_for_updates() {\n global $wpdb;\n\n $current_version = get_option('h5p_version');\n if ($current_version === self::VERSION) {\n return; // Same version as before\n }\n\n // We have a new version!\n if (!$current_version) {\n // Never installed before\n $current_version = '0.0.0';\n }\n\n // Split version number\n $v = self::split_version($current_version);\n\n $between_1710_1713 = ($v->major === 1 && $v->minor === 7 && $v->patch >= 10 && $v->patch <= 13); // Target 1.7.10, 1.7.11, 1.7.12, 1.7.13\n if ($between_1710_1713) {\n // Fix tmpfiles table manually :-)\n $wpdb->query(\"ALTER TABLE {$wpdb->prefix}h5p_tmpfiles ADD COLUMN id INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, DROP PRIMARY KEY, ADD PRIMARY KEY(id)\");\n }\n\n // Check and update database\n self::update_database();\n\n $pre_120 = ($v->major < 1 || ($v->major === 1 && $v->minor < 2)); // < 1.2.0\n $pre_180 = ($v->major < 1 || ($v->major === 1 && $v->minor < 8)); // < 1.8.0\n $pre_1102 = ($v->major < 1 || ($v->major === 1 && $v->minor < 10) ||\n ($v->major === 1 && $v->minor === 10 && $v->patch < 2)); // < 1.10.2\n $pre_1110 = ($v->major < 1 || ($v->major === 1 && $v->minor < 11)); // < 1.11.0\n $pre_1113 = ($v->major < 1 || ($v->major === 1 && $v->minor < 11) ||\n ($v->major === 1 && $v->minor === 11 && $v->patch < 3)); // < 1.11.3\n $pre_1150 = ($v->major < 1 || ($v->major === 1 && $v->minor < 15)); // < 1.15.0\n\n // Run version specific updates\n if ($pre_120) {\n // Re-assign all permissions\n self::upgrade_120();\n }\n else {\n // Do not run if upgrade_120 runs (since that remaps all the permissions)\n if ($pre_180) {\n // Does only add new permissions\n self::upgrade_180();\n }\n if ($pre_1150) {\n // Does only add new permissions\n self::upgrade_1150();\n }\n }\n\n if ($pre_180) {\n // Force requirements check when hub is introduced.\n update_option('h5p_check_h5p_requirements', TRUE);\n }\n\n if ($pre_1102 && $current_version !== '0.0.0') {\n update_option('h5p_has_request_user_consent', TRUE);\n }\n\n if ($pre_1110) {\n // Remove unused columns\n self::drop_column(\"{$wpdb->prefix}h5p_contents\", 'author');\n self::drop_column(\"{$wpdb->prefix}h5p_contents\", 'keywords');\n self::drop_column(\"{$wpdb->prefix}h5p_contents\", 'description');\n }\n\n if ($pre_1113 && !$pre_1110) { // 1.11.0, 1.11.1 or 1.11.2\n // There are no tmpfiles in content folders, cleanup\n $wpdb->query($wpdb->prepare(\n \"DELETE FROM {$wpdb->prefix}h5p_tmpfiles\n WHERE path LIKE '%s'\",\n \"%/h5p/content/%\"));\n }\n\n // Keep track of which version of the plugin we have.\n if ($current_version === '0.0.0') {\n add_option('h5p_version', self::VERSION);\n }\n else {\n update_option('h5p_version', self::VERSION);\n }\n }", "public function check() {\n\t\trequire_once 'PEAR/Registry.php';\n\t\t$registry = new PEAR_Registry();\n\n\t\t$installedVersion = $registry->packageInfo($this->name, 'version', $this->channel);\n\t\tif (is_null($installedVersion)) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->min && version_compare($installedVersion, $this->min, '<')) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. >= '.$this->min.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->max && (version_compare($installedVersion, $this->max, '>'))) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. <= '.$this->max.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t$this->log('Package \"'.$this->name.'\" '.$installedVersion.' is passed', Project::MSG_VERBOSE);\n\n\t\treturn 0;\n\t}", "public function init_checks() {\n\t\t\t$errors = array();\n\t\t\tif ( ! function_exists( 'json_last_error' ) ) {\n\t\t\t\t$errors['json_last_error'] = esc_html__( 'Unfortuantely your server is using a version of PHP not supported by WordPress. Please make sure to update your PHP version to at least version 5.5 in order to proceed with the import.', 'total' );\n\t\t\t}\n\t\t\tif ( $errors ) {\n\t\t\t\treturn $errors;\n\t\t\t} else {\n\t\t\t\treturn 'passed';\n\t\t\t}\n\t\t}", "public function versionIsValid($version)\n {\n if (version_compare($version, 5.3, '>=')) {\n return true;\n }\n\n return false;\n }", "public function page_check_version()\n\t{\n\t\tif (!$content = Http::get_file_on_server(FSB_REQUEST_SERVER, FSB_REQUEST_VERSION, 10))\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\t$content = explode(\"\\n\", $content);\n\n\t\tif (count($content) < 3)\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\tif (strpos('http', $content[2]) === false)\n\t\t{\n\t\t\tarray_shift($content);\n\t\t}\n\n\t\t@list($last_version, $url, $level) = $content;\n\t\t$last_version = trim($last_version);\n\n\t\t// Aucune redirection\n\t\tFsb::$session->data['u_activate_redirection'] = 2;\n\n\t\tif (!is_last_version(Fsb::$cfg->get('fsb_version'), $last_version))\n\t\t{\n\t\t\tDisplay::message(sprintf(Fsb::$session->lang('adm_old_version'), $last_version, Fsb::$cfg->get('fsb_version'), $url, $url, Fsb::$session->lang('adm_version_' . trim($level))) . '<br /><br />' . sprintf(Fsb::$session->lang('adm_click_view_newer'), $url));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDisplay::message('adm_version_ok', 'index.' . PHPEXT, 'index_adm');\n\t\t}\n\t}", "public static function check_version() {\n\t\ttry {\n\t\t\t$current_version = get_option( self::CK_DB_VERSION, 0 );\n\t\t\t$version_keys = array_keys( self::$db_migrations );\n\t\t\tif ( version_compare( $current_version, '0', '>' ) && version_compare( $current_version, end( $version_keys ), '<' ) ) {\n\t\t\t\t// We migrate the Db for all blogs.\n\t\t\t\tself::install_db( true );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action(\n\t\t\t\t\t'admin_notices',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'WC_PostFinanceCheckout_Admin_Notices',\n\t\t\t\t\t\t'migration_failed_notices',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function hasVersion(){\n return $this->_has(3);\n }", "protected function checkMysqlVersion() {}", "private function check_requirements() {\n\n global $wp_version;\n\n $php_min_version = '5.2';\n $wp_min_version = '4.1';\n $php_current_version = phpversion();\n $errors = array();\n\n if ( version_compare( $php_min_version, $php_current_version, '>' ) ) {\n $errors[] = sprintf(\n __( 'Your PHP installation is too old. WordPress Popular Posts requires at least PHP version %1$s to function correctly. Please contact your hosting provider and ask them to upgrade PHP to %1$s or higher.', 'wordpress-popular-posts' ),\n $php_min_version\n );\n }\n\n if ( version_compare( $wp_min_version, $wp_version, '>' ) ) {\n $errors[] = sprintf(\n __( 'Your WordPress version is too old. WordPress Popular Posts requires at least WordPress version %1$s to function correctly. Please update your blog via Dashboard &gt; Update.', 'wordpress-popular-posts' ),\n $wp_min_version\n );\n }\n\n return $errors;\n\n }", "function verify_version($version) // Colorize: green\n { // Colorize: green\n return isset($version) // Colorize: green\n && // Colorize: green\n is_int($version) // Colorize: green\n && // Colorize: green\n $version >= 20190101000000 // Colorize: green\n && // Colorize: green\n $version <= 99999999999999; // Colorize: green\n }", "public function version($check = null);", "private static function checkRequirements()\n {\n $checker = (new envChecker)\n ->requirePhpVersion('>=7.1')\n ->requirePhpExtensions(self::$required_extensions)\n ->requireDirectory(SYST_DIR, envChecker::CHECK_IS_READABLE)\n ->requireDirectory(APP_DIR, envChecker::CHECK_IS_READABLE);\n\n $output = $checker->check();\n if (! $checker->isSatisfied()) \n {\n echo '<h3>An error encourred</h3>';\n exit(join('<br/> ', $checker->getErrors()));\n }\n }", "private static function _checkProjectVersion() {\n $composer_openfed = json_decode(file_get_contents('composer.openfed.json'), TRUE);\n $current_version = $composer_openfed['require']['openfed/openfed8'];\n preg_match('/(?:[\\d+\\.?]+[a-zA-Z0-9-]*)/', $current_version, $matches);\n // If current version is dev, we should ignore version check.\n if (strpos($current_version, 'dev') !== FALSE) {\n return FALSE;\n }\n\n return version_compare($matches[0], '10.0', '>=');\n }", "public function versionCheckAction()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $currentVersion = \"1.6.3\";\n $clientVersion = $_GET['ver'];\n\n if ($clientVersion < $currentVersion) {\n echo \"upgrade\";\n } elseif ($clientVersion == $currentVersion) {\n echo \"latest\";\n } elseif ($clientVersion > $currentVersion) {\n echo \"development\";\n } else {\n echo \"unknown-version\";\n }\n }", "protected function preInstCheck()\n {\n // PHP Version\n if(!version_compare(PHP_VERSION,$this->prereqs['phpversion'],'>=')) {\n $this->errors[] = array(\n 'check' => 'PHP-Version',\n 'required' => $this->prereqs['phpversion'],\n 'actual' => PHP_VERSION\n );\n }\n if(!version_compare(PHP_VERSION,$this->suggested['phpversion'],\">=\")) {\n $this->warnings[] = array(\n 'check' => 'PHP-Version',\n 'suggestion' => ( isset($suggestion_text['phpversion'][$lang]) ? $suggestion_text['phpversion'][$lang] : 'en'),\n 'actual' => PHP_VERSION\n );\n }\n // PHP Settings\n foreach($this->prereqs['phpsettings'] as $key => $value) {\n $actual_setting = ($temp=ini_get($key)) ? $temp : 0;\n if($actual_setting !== $value) {\n $this->errors[] = array(\n 'check' => 'PHP-Settings -&gt; '.$key,\n 'required' => $value,\n 'actual' => $actual_setting,\n );\n }\n }\n // Check if AddDefaultCharset is set\n $sapi = php_sapi_name();\n if(strpos($sapi,'apache') !== false || strpos($sapi,'nsapi') !== false ) {\n \tflush();\n \t$apache_rheaders = apache_response_headers();\n \tforeach($apache_rheaders as $h) {\n \t\tif(strpos($h,'html; charset') !== false && (!strpos(strtolower($h),'utf-8')) ) {\n \t\t\tpreg_match( '/charset\\s*=\\s*([a-zA-Z0-9- _]+)/', $h, $match );\n \t\t\t$apache_charset = $match[1];\n \t\t\t$this->errors[] = array(\n 'check' => 'Apache-Settings',\n 'required' => 'unset',\n 'actual' => $apache_charset,\n );\n \t\t}\n \t}\n }\n // check installer\n $seen = array();\n foreach($this->installdata as $file) {\n if(file_exists(__dir__.'/../data/'.$file)) {\n $seen[] = $file;\n }\n }\n if(count($seen)!=count($this->installdata)) {\n $this->errors[] = array(\n 'check' => $this->t('Installation data'),\n 'required' => implode(\"<br />\",$this->installdata),\n 'actual' => implode(\"<br />\",$seen)\n );\n }\n\n }", "function versionCheck($template) {\n\tglobal $communitySettings;\n\n\tif ( $template['MinVer'] && ( version_compare($template['MinVer'],$communitySettings['unRaidVersion']) > 0 ) ) return false;\n\tif ( $template['MaxVer'] && ( version_compare($template['MaxVer'],$communitySettings['unRaidVersion']) < 0 ) ) return false;\n\treturn true;\n}", "public function verifyRequirements() {\n\n $problems = array(\n 'warnings' => array(),\n 'errors' => array()\n );\n\n // Requirement: PHP 5.3\n if (version_compare(phpversion(), '5.3.0') < 0) {\n $problems['errors'][] = 'PHP 5.3.0 or greater is required. Your installed version is '.phpversion().'.';\n }\n\n // Requirement: PDO\n if (!class_exists('PDO')) {\n $problems['errors'][] = 'The PHP Data Objects (PDO) extension is required.';\n }\n\n // Requirement: mod_rewrite\n if (function_exists('apache_get_modules') && !in_array('mod_rewrite', apache_get_modules())) {\n $problems['errors'][] = 'The Apache mod_rewrite module is required.';\n }\n\n // Requirement: cURL\n if (!function_exists('curl_init')) {\n $problems['errors'][] = 'The PHP cURL extension is required.';\n }\n\n // Requirement: writable config.php\n if (!is_writable($this->directory)) {\n $problems['errors'][] = 'The directory for your config.php file is not writable. Please change the permissions on this directory (through SSH or your FTP client) so it writable to all users. When this installer is completed, you can change the permissions back. The directory to make writable: <code>'.$this->directory.'</code>';\n }\n\n // Optional: json_decode\n if (!function_exists('json_decode')) {\n $problems['warnings'][] = 'Your version of PHP is missing the <code>json_decode()</code> function. This is included and enabled by default for PHP versions 5.2.0 and higher. This is only required if you want to import tweets from an official twitter archive download, otherwise Archive My Tweets can run without it.';\n }\n\n // Optional: 64-bit integers\n if (PHP_INT_SIZE != 8) {\n $problems['warnings'][] = 'Your PHP installation does not support 64 bit integers and this may cause problems for you. Support for 64 bit integers is recommended and is offered by most modern web hosts.';\n }\n\n return $problems;\n\n }", "public function minimum_requirements() {\n\n\t\treturn array( 'php' => array( 'version' => '5.5' ) );\n\n\t}", "public function addRequirementsChecking() {\n global $wp_version;\n\n $installed_php_version = phpversion();\n $installed_wp_version = $wp_version;\n $required_php_version = '5.2.4';\n $required_wp_version = '3.3';\n $installed_php_is_compatible = version_compare($installed_php_version, $required_php_version, '>=');\n $installed_wp_is_compatible = version_compare($installed_wp_version, $required_wp_version, '>=');\n\n $notices = array();\n $template = __('<p>LaterPay: Your server <strong>does not</strong> meet the minimum requirement of %s version %s or higher. You are running %s version %s.</p>', 'laterpay');\n if ( !$installed_php_is_compatible ) {\n $notices[] = sprintf($template, 'PHP', $required_php_version, 'PHP', $installed_php_version);\n }\n if ( !$installed_wp_is_compatible ) {\n $notices[] = sprintf($template, 'Wordpress', $required_wp_version, 'Wordpress', $installed_wp_version);\n }\n\n if ( count($notices) > 0 ) {\n $out = join('\\n', $notices);\n echo '<div class=\"error\">' . $out . '</div>';\n }\n }", "function validateBeforeUpgrade($params) {\n $this->cleanUpValidationLog();\n\n if(version_compare(PHP_VERSION, '5.3.3', '<')) {\n $this->validationLogError('PHP version that is required to run the system is 5.3.3. You have ' . PHP_VERSION);\n } // if\n\n if(extension_loaded('phar')) {\n $this->validationLogOk('Phar extension is available');\n } else {\n $this->validationLogError('Required Phar PHP extension was not found. Please install it before continuing');\n } // if\n\n // Check memory limit\n $memory_limit = php_config_value_to_bytes(ini_get('memory_limit'));\n\n if($memory_limit == -1 || $memory_limit >= 67108864) {\n $formatted_memory_limit = $memory_limit == -1 ? \"unlimited\" : format_file_size($memory_limit);\n $this->validationLogOk('Your memory limit is: ' . $formatted_memory_limit);\n } else {\n $this->validationLogError('Your memory is too low to complete the upgrade. Minimal value is 64MB, and you have it set to ' . format_file_size($memory_limit));\n } // if\n\n // Check whether ROOT is writable\n if(folder_is_writable(ROOT)) {\n $this->validationLogOk('/activecollab folder is writable');\n } else {\n $this->validationLogError('/activecollab folder is not writable. Make it writable to continue');\n } // if\n\n // Check if public/assets folder is writable\n if (defined('PROTECT_ASSETS_FOLDER') && PROTECT_ASSETS_FOLDER) {\n $this->validationLogOk(\"Assets folder is protected, skipping writable check\");\n } else {\n if(folder_is_writable(PUBLIC_PATH . '/assets')) {\n $this->validationLogOk('public/assets folder is writable');\n } else {\n $this->validationLogError('public/assets folder is not writable. Make it writable to continue');\n } // if\n } // if\n\n // Check versions.php\n if(file_is_writable(CONFIG_PATH . '/version.php')) {\n $this->validationLogOk('config/version.php is writable');\n } else {\n $this->validationLogError('config/version.php is not writable. Make it writable to continue');\n } // if\n\n // Validate login parameters\n $email = $params['email']; \n $password = $params['pass'];\n \n if(php_sapi_name() !== 'cli' && $email && $password) {\n if(is_valid_email($email)) {\n $user_table_fields = DB::listTableFields(TABLE_PREFIX . 'users');\n\n // Version 4.0.0 or newer\n if(in_array('type', $user_table_fields)) {\n $user = DB::executeFirstRow('SELECT type, password FROM ' . TABLE_PREFIX . 'users WHERE email = ?', $email);\n\n // Versions older than 4.0.0\n } else {\n $user = DB::executeFirstRow('SELECT role_id, password FROM ' . TABLE_PREFIX . 'users WHERE email = ?', $email);\n } // if\n\n if(is_array($user)) {\n if($this->checkUserPassword($password, $user['password'])) {\n if($this->isUserAdministrator($user)) {\n $this->validationLogOk(\"User '$email' authenticated\");\n } // if\n } else {\n $this->validationLogError(\"Invalid password\");\n } // if\n } else {\n $this->validationLogError(\"User '$email' not found\");\n } // if\n } else {\n $this->validationLogError(\"'$email' is not a valid email address\");\n } // if\n } else {\n $this->validationLogError('Authentication data not provided');\n } // if\n \n return $this->everythingValid();\n }", "public function isPrestaShopSupportedVersion()\n {\n if (version_compare(_PS_VERSION_, '1.5', '<')) {\n return false;\n }\n\n return true;\n }", "function check_phpversion_for_hash(){\r\n\tif (version_compare(PHP_VERSION, '5.3.7', '<')) {\r\n\t exit(\"Sorry, Simple PHP Login does not run on a PHP version smaller than 5.3.7 !\");\r\n\t} else if (version_compare(PHP_VERSION, '5.5.0', '<')) {\r\n\t // if you are using PHP 5.3 or PHP 5.4 you have to include the password_api_compatibility_library.php\r\n\t // (this library adds the PHP 5.5 password hashing functions to older versions of PHP)\r\n\t require_once(\"password_compatibility_library.php\");\r\n\t}\r\n}", "public function checkPhp()\n {\n return (version_compare(PHP_VERSION, '7.0.0') >= 0);\n }", "function checkVersion($version)\n {\n return version_compare($this->getVersion(), $version, 'lt');\n }", "public function compatVersionConditionMatchesSameRelease() {}", "public function compatVersionConditionMatchesSameRelease() {}", "function check_requirements() {\n\tglobal $install_errors;\n\t\n\t// Try to fix the sessions in crap setups (OVH)\n\t@ini_set('session.gc_divisor', 100);\n\t@ini_set('session.gc_probability', true);\n\t@ini_set('session.use_trans_sid', false);\n\t@ini_set('session.use_only_cookies', true);\n\t@ini_set('session.hash_bits_per_character', 4);\n\t\n\t$mod_rw_error = 'Apache <a href=\"http://httpd.apache.org/docs/2.1/rewrite/rewrite_intro.html\" target=\"_blank\">mod_rewrite</a> is not enabled.';\n\t\n\tif(version_compare(PHP_VERSION, '5.2.0', '<'))\n\t\t$install_errors[] = 'Your server is currently running PHP version '.PHP_VERSION.' and Chevereto needs atleast PHP 5.2.0';\n\t\n\tif(!extension_loaded('curl') && !function_exists('curl_init'))\n\t\t$install_errors[] = '<a href=\"http://curl.haxx.se/\" target=\"_blank\">cURL</a> is not enabled on your current server setup.';\n\t\n\tif(!function_exists('curl_exec'))\n\t\t$install_errors[] = '<b>curl_exec()</b> function is disabled, you have to enable this function on your php.ini';\n\t\n\tif(function_exists('apache_get_modules')) {\n\t\tif(!in_array('mod_rewrite', apache_get_modules()))\n\t\t\t$install_errors[] = $mod_rw_error;\n\t} else {\n\t\t// As today (Jun 11, 2012) i haven't found a better way to test mod_rewrite in CGI setups. The phpinfo() method is not fail safe either.\n\t}\n\t\n\tif (!extension_loaded('gd') and !function_exists('gd_info')) {\n\t\t$install_errors[] = '<a href=\"http://www.libgd.org\" target=\"_blank\">GD Library</a> is not enabled.';\n\t} else {\n\t\t$imagetype_fail = 'image support is not enabled in your current PHP setup (GD Library).';\n\t\tif(!imagetypes() & IMG_PNG) $install_errors[] = 'PNG '.$imagetype_fail;\n\t\tif(!imagetypes() & IMG_GIF) $install_errors[] = 'GIF '.$imagetype_fail;\n\t\tif(!imagetypes() & IMG_JPG) $install_errors[] = 'JPG '.$imagetype_fail;\n\t\tif(!imagetypes() & IMG_WBMP) $install_errors[] = 'BMP '.$imagetype_fail;\n\t}\n\t\n\t/*\n\t$test_session_file = session_save_path().'/'.time();\n\tif(!@fopen($test_session_file, 'w+')) {\n\t\t$install_errors[] = 'PHP can\\'t write/read in the session path <code>'.session_save_path().'</code>. Your server setup doesn\\'t have the right PHP/Apache permissions over this folder.';\n\t\t$install_errors[] = 'Please repair the permissions on this folder or specify a new one on <code>php.ini</code>';\n\t} else {\n\t\t@unlink($test_session_file);\n\t}\n\t*/\n\t\n\t$bcmath_functions = array('bcadd', 'bcmul', 'bcpow', 'bcmod', 'bcdiv');\n\tforeach($bcmath_functions as $bcmath_function) {\n\t\tif(!function_exists($bcmath_function)) {\n\t\t\t$install_errors[] = '<a href=\"http://php.net/manual/function.'.$bcmath_function.'.php\" target=\"_blank\">'.$bcmath_function.'</a> function is not defined. You need to re-install the BC Math functions.';\n\t\t}\n\t}\n\t\n\tif(!extension_loaded('pdo')) {\n\t\t$install_errors[] = 'PHP Data Objects (<a href=\"http://www.php.net/manual/book.pdo.php\">PDO</a>) is not loaded.';\n\t}\n\t\n\tif(!extension_loaded('pdo_mysql')) {\n\t\t$install_errors[] = 'MySQL Functions (<a href=\"http://www.php.net/manual/ref.pdo-mysql.php\" target=\"_blank\">PDO_MYSQL</a>) is not loaded.';\n\t}\n\n\tif(count($install_errors)==0) return true;\n}", "function is_wp_version_compatible($required)\n {\n }", "public function does_support( $version ) {\n\t\treturn version_compare( $this->get_current_version(), $version, 'ge' );\n\t}", "function base_requirements_met() {\n\t$wp_version = get_bloginfo( 'version' );\n\n\tif ( version_compare( PHP_VERSION, BASE_REQUIRED_PHP_VERSION, '<' ) ) {\n return false;\n\t}\n\tif ( version_compare( $wp_version, BASE_REQUIRED_WP_VERSION, '<' ) ) {\n return false;\n\t}\n\treturn true;\n}", "public function hasRightPhpVersion()\n {\n $phpversion = phpversion();\n\n if (version_compare($phpversion, '5.4.0', 'lt')) {\n return false;\n }\n\n return true;\n }", "public function check_version() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tif ( is_plugin_active( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) ) ) {\n\t\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice' ) );\n\t\t\t\tif ( isset( $_GET['activate'] ) ) {\n\t\t\t\t\tunset( $_GET['activate'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( self::old_version() ) {\n\t\t\tdeactivate_plugins( 'woocommerce-tm-custom-price-fields/tm-woo-custom-prices.php' );\n\t\t\tadd_action( 'admin_notices', array( $this, 'deprecated_notice' ) );\n\t\t}\n\n\t\tif ( ! self::woocommerce_check() ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice_woocommerce_check' ) );\n\t\t}\n\n\t}", "public function isAllowed()\n {\n return version_compare($this->metadata->getVersion(), '2.3.0', '<');\n }", "public function get_test_php_version()\n {\n }", "function qa_php_version_below($version)\n{\n\t$minphp = qa_version_to_float($version);\n\t$thisphp = qa_version_to_float(phpversion());\n\n\treturn $minphp && $thisphp && $thisphp < $minphp;\n}", "public function checkVersion($version) {\n return ( !$this->studip_min_version || version_compare($version, $this->studip_min_version) >= 0 )\n && ( !$this->studip_max_version || version_compare($version, $this->studip_max_version) <= 0 );\n }", "public function checkVersion($version) {\n return ( !$this->studip_min_version || version_compare($version, $this->studip_min_version) >= 0 )\n && ( !$this->studip_max_version || version_compare($version, $this->studip_max_version) <= 0 );\n }", "protected function getPhpVersion() {}", "private static function checkRequiredPhpExtensions(): void\n {\n /**\n * Warning about mbstring.\n */\n if (! function_exists('mb_detect_encoding')) {\n Core::warnMissingExtension('mbstring');\n }\n\n /**\n * We really need this one!\n */\n if (! function_exists('preg_replace')) {\n Core::warnMissingExtension('pcre', true);\n }\n\n /**\n * JSON is required in several places.\n */\n if (! function_exists('json_encode')) {\n Core::warnMissingExtension('json', true);\n }\n\n /**\n * ctype is required for Twig.\n */\n if (! function_exists('ctype_alpha')) {\n Core::warnMissingExtension('ctype', true);\n }\n\n /**\n * hash is required for cookie authentication.\n */\n if (function_exists('hash_hmac')) {\n return;\n }\n\n Core::warnMissingExtension('hash', true);\n }", "public static function checkPHP($minVersion)\n {\n return self::checkForMinimalVersion(phpversion(), $minVersion);\n }", "public function checkConvertability()\n {\n // It seems that png and jpeg are always supported by Vips\n // - so nothing needs to be done here\n\n if (function_exists('vips_version')) {\n $this->logLn('vipslib version: ' . vips_version());\n }\n $this->logLn('vips extension version: ' . phpversion('vips'));\n }", "public function has_php_version() {\n\t\treturn version_compare( PHP_VERSION, '5.4', '>=' );\n\t}", "function is_version( $version = '3.5' ) {\n\t\tglobal $wp_version;\n\t\treturn version_compare( $wp_version, $version, '>=' );\n\t}" ]
[ "0.72737855", "0.7271013", "0.70879716", "0.7058781", "0.7031662", "0.6825839", "0.67372847", "0.66937506", "0.6667481", "0.66647905", "0.66499335", "0.66131395", "0.6601398", "0.65225995", "0.65205663", "0.6514412", "0.65072554", "0.6506783", "0.65051466", "0.6487101", "0.64281106", "0.641408", "0.6409115", "0.640235", "0.6399152", "0.63609654", "0.635939", "0.6359153", "0.6357161", "0.6337106", "0.63280797", "0.632526", "0.6301273", "0.6300884", "0.62873226", "0.6286747", "0.625225", "0.62353206", "0.6229296", "0.62025064", "0.6196965", "0.6175317", "0.61655116", "0.6147027", "0.6111314", "0.6092724", "0.60913104", "0.6087861", "0.6081549", "0.6074595", "0.605681", "0.6041662", "0.6030387", "0.6007486", "0.60074645", "0.599966", "0.5999502", "0.5999197", "0.59972286", "0.5996909", "0.5990673", "0.59868366", "0.5953954", "0.59500563", "0.59470886", "0.5932886", "0.59315354", "0.5922249", "0.58964163", "0.5896357", "0.589504", "0.5872504", "0.5871826", "0.5868997", "0.5865193", "0.5861704", "0.58550304", "0.5844255", "0.58336014", "0.5830515", "0.5823074", "0.5817269", "0.5816942", "0.5802003", "0.5795719", "0.57956946", "0.5776144", "0.5775348", "0.57664585", "0.5744082", "0.57403386", "0.57384413", "0.5730964", "0.5730964", "0.57306445", "0.5726314", "0.57117146", "0.57010466", "0.56921697", "0.5687401" ]
0.59388924
65
Process the parameters of a matched function.
public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) { $functionLC = strtolower($functionName); if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) { return; } $phpcsFile->addError( 'The default value of the $encoding parameter for %s() was changed from ISO-8859-1 to UTF-8 in PHP 5.4. For cross-version compatibility, the $encoding parameter should be explicitly set.', $stackPtr, 'NotSet', array($functionName) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function processParameters ($params);", "abstract public function process($parameters);", "public function GetMatchedParams ();", "public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) {\n\t\tif ( \\count( $parameters ) === 1 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * We already know that there will be a valid open+close parenthesis, otherwise the sniff\n\t\t * would have bowed out long before.\n\t\t */\n\t\t$opener = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true );\n\t\t$closer = $this->tokens[ $opener ]['parenthesis_closer'];\n\n\t\t$data = array(\n\t\t\t$matched_content,\n\t\t\t$this->target_functions[ $matched_content ],\n\t\t\tGetTokensAsString::compact( $this->phpcsFile, $stackPtr, $closer, true ),\n\t\t);\n\n\t\t$this->phpcsFile->addWarning(\n\t\t\t'%s() expects only a $text parameter. Did you mean to use %s() ? Found: %s',\n\t\t\t$stackPtr,\n\t\t\t'Found',\n\t\t\t$data\n\t\t);\n\t}", "function handle(&$params) {\n }", "public function SetMatchedParams ($matchedParams = []);", "function resolveArgsForReflection(/*callable*/$reflectFunc, $parameters, $inDepth = true)\n {\n if (!($reflectFunc instanceof \\ReflectionFunction || $reflectFunc instanceof \\ReflectionMethod))\n throw new \\InvalidArgumentException(sprintf(\n '(%s) is not reflection.'\n , \\Poirot\\Std\\flatten($reflectFunc)\n ));\n\n $arguments = array();\n foreach ($parameters as $key => $val) {\n if (is_string($key)) {\n // Create Map Of \"field_name\" to \"fieldName\" and \"FieldName\" to Resolve To Callable\n $res = (string) \\Poirot\\Std\\cast($key)->camelCase();\n if (!isset($parameters[$res]))\n $arguments[strtolower($res)] = $val;\n\n $arguments[strtolower($key)] = $val;\n }\n\n $arguments[$key] = $val;\n }\n\n\n $matchedArguments = array();\n foreach ($reflectFunc->getParameters() as $reflectArgument)\n {\n /** @var \\ReflectionParameter $reflectArgument */\n $argValue = $notSet = uniqid(); // maybe null value is default\n\n if ($reflectArgument->isDefaultValueAvailable())\n $argValue = $reflectArgument->getDefaultValue();\n\n $argName = strtolower($reflectArgument->getName());\n if (array_key_exists($argName, $arguments)) {\n ## resolve argument value match with name given in parameters list\n $argValue = $arguments[$argName];\n unset($arguments[$argName]);\n } elseif($inDepth) {\n ## in depth argument resolver\n $av = null;\n foreach ($arguments as $k => $v) {\n if ( ( $class = $reflectArgument->getClass() ) && is_object($v) && $class->isInstance($v) )\n $av = $v;\n \n if ( $reflectArgument->isArray() && is_array($v) )\n $av = $v;\n \n if ( $reflectArgument->isCallable() && is_callable($v) )\n $av = $v;\n \n if ($av !== null) {\n unset($arguments[$k]);\n break;\n }\n }\n \n ($av === null) ?: $argValue = $av; \n }\n\n if ($argValue === $notSet)\n throw new \\InvalidArgumentException(sprintf(\n 'Callable (%s) has no match found on parameter (%s) from (%s) list.'\n , ($reflectFunc instanceof \\ReflectionMethod)\n ? $reflectFunc->getDeclaringClass()->getName().'::'.$reflectFunc->getName()\n : $reflectFunc->getName()\n , $reflectArgument->getName()\n , \\Poirot\\Std\\flatten($parameters)\n ));\n\n $matchedArguments[$reflectArgument->getName()] = $argValue;\n }\n\n return $matchedArguments;\n }", "function params(array $data);", "public function extractParameters()\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n\n if (preg_match(self::$routePattern, $request->get('_route'), $routeMatches)) {\n $searchEngine = $this->container->get('search.engine');\n\n $this->routePrefix = reset($routeMatches);\n $this->originalRouteParameterCount = (int)end($routeMatches);\n\n $activeModules = $searchEngine->getActiveModules();\n\n $dateFormatString = $this->container->get('languagehandler')->getDateFormat();\n $dateFormat = preg_replace(\"/[^\\w]/\", '-', $dateFormatString);\n\n for ($i = 0; $i < $this->originalRouteParameterCount; $i++) {\n $rawInput = strtolower($request->get(\"a{$i}\"));\n $parameterInformation = Utility::convertStringToArray($rawInput);\n\n if (!$this->hasKeywords() && $rawKeyword = $searchEngine->convertFromKeywordFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawKeyword);\n foreach ($parameterInformation as $parameter) {\n $this->addKeyword($parameter);\n }\n continue;\n }\n\n if (!$this->hasWheres() && $rawWhere = $searchEngine->convertFromWhereFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawWhere);\n foreach ($parameterInformation as $parameter) {\n $this->addWhere($parameter);\n }\n continue;\n }\n\n if (!$this->hasModules() && $modules = array_intersect($activeModules, $parameterInformation)) {\n foreach ($modules as $key => $value) {\n $this->addModule($key);\n }\n continue;\n }\n\n if (!$this->hasStartDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setStartDate($date);\n continue;\n }\n\n if (!$this->hasEndDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setEndDate($date);\n continue;\n }\n\n if (($elasticType = $searchEngine->getFriendlyUrlType($parameterInformation)) && (!$this->hasCategories() || !$this->hasLocations())) {\n switch ($elasticType) {\n case CategoryConfiguration::$elasticType:\n if (!$this->hasCategories()) {\n $categories = $searchEngine->categoryFriendlyURLSearch($parameterInformation);\n $this->setCategories($categories);\n !$this->hasModules() and array_map(function($category) {\n $this->addModule($category->getModule());\n }, $categories);\n }\n break;\n case LocationConfiguration::$elasticType:\n if (!$this->hasLocations()) {\n $this->setLocations($searchEngine->locationFriendlyURLSearch($parameterInformation));\n }\n break;\n }\n\n continue;\n }\n\n if (self::$exception) {\n throw new NotFoundHttpException();\n }\n }\n }\n\n foreach ($request->query->all() as $key => $value) {\n $this->queryParameters[$key] = Utility::convertStringToArray($value, '-');\n }\n }", "public function matching(Closure $match);", "abstract public function parseNamedParameters($parameters);", "function process($value);", "public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters)\n {\n $functionLC = strtolower($functionName);\n if (isset($parameters[$this->targetFunctions[$functionLC]]) === true) {\n return;\n }\n\n $error = 'The default value of the %s() $variant parameter has changed from INTL_IDNA_VARIANT_2003 to INTL_IDNA_VARIANT_UTS46 in PHP 7.4. For optimal cross-version compatibility, the $variant parameter should be explicitly set.';\n $phpcsFile->addError(\n $error,\n $stackPtr,\n 'NotSet',\n array($functionName)\n );\n }", "protected function filterParams()\n {\n }", "protected function processRequestParams(): void\n {\n $this->processLimit();\n $this->processLocale();\n }", "private function parse_params($params)\n {\n }", "public function __invoke($param);", "public function test_filter_specified_arguments() {\n // Ask for 2 arguments and provide 2\n $hook = rand_str();\n yourls_add_filter( $hook, function( $var1 = '', $var2 = '' ) { return \"$var1 $var2\"; }, 10, 2 );\n $test = yourls_apply_filter( $hook, 'hello', 'world' );\n $this->assertSame( $test, 'hello world' );\n\n // Ask for 1 argument and provide 2\n $hook = rand_str();\n yourls_add_filter( $hook, function( $var1 = '', $var2 = '' ) { return \"$var1 $var2\"; }, 10, 1 );\n $test = yourls_apply_filter( $hook, 'hello', 'world' );\n $this->assertSame( $test, 'hello ' );\n\n // Ask for 2 arguments and provide 1\n $hook = rand_str();\n yourls_add_filter( $hook, function( $var1 = '', $var2 = '' ) { return \"$var1 $var2\"; }, 10, 2 );\n $test = yourls_apply_filter( $hook, 'hello' );\n $this->assertSame( $test, 'hello ' );\n }", "public function processParameterless()\n {\n $this->process([]);\n }", "private function _processParams($params, $clause) \n\t{\n\t\t$method = '_' . strtolower($clause);\n\t\t\n\t\t! isset ( $params[$clause] ) || ! $params [$clause] || call_user_func(array($this, $method), $params [$clause] );\n\t}", "abstract public function parseRequestParameters();", "private static function processFunction($contents,&$pos) {\n\t\t//do away with function-keyword and whitespace between it and the functionname\n\t\tDokser::skipWhitespaceAndComments($contents, $pos+=strlen('function'));\n\t\tpreg_match('/'.Dokser::$labelReg.'/',$contents,$match,PREG_OFFSET_CAPTURE,$pos);//get functionname\n\t\t$functionName=$match[0][0];\n\t\t$function=['name'=>$functionName,'params'=>[]];\n\t\tDokser::skipWhitespaceAndComments($contents, $pos+=strlen($functionName));//skip to \"(\"\n\t\tDokser::skipWhitespaceAndComments($contents, ++$pos);//skip \"(\" and its proceeding whitespace\n\t\twhile (preg_match($reg='#,?(&?\\$'.Dokser::$labelReg.'|\\))#',$contents,$match,0,$pos)\n\t\t\t\t&&($paramName=$match[1])!=')') {\n\t\t\t$param=['name'=>$paramName];\n\t\t\tDokser::skipWhitespaceAndComments($contents, $pos+=strlen($paramName));\n\t\t\tif ($contents[$pos]=='=') {\n\t\t\t\tDokser::skipWhitespaceAndComments($contents, $pos+=1);//skip whitespace after \"=\"\n\t\t\t\t$param['defaultValue']=Dokser::consumeValue($contents, $pos);\n\t\t\t}\n\t\t\t$function['params'][]=$param;\n\t\t}\n\t\t$functions=[$function];\n\t\t//look for \"/*\" or \"//\" or \"}\" or single quote or double quote or \"{\" or \"function\"\n\t\t$braceLevel=0;\n\t\twhile (preg_match('#/\\*|//|function|[}\\x27\\x22{]#',$contents,$match,PREG_OFFSET_CAPTURE,$pos)) {\n\t\t\t$str=$match[0][0];\n\t\t\t$pos=$match[0][1];\n\t\t\tif ($str=='/*'||$str=='//') {\n\t\t\t\tDokser::skipWhitespaceAndComments($contents, $pos);\n\t\t\t} else if ($str==\"'\"|$str=='\"') {\n\t\t\t\tDokser::consumeString($contents, $pos);\n\t\t\t} else if ($str=='function') {//functions may have inner functions, which however too are global\n\t\t\t\t$functions+=Dokser::processFunction($contents, $pos);\n\t\t\t} else if ($str=='{') {\n\t\t\t\t++$braceLevel;\n\t\t\t\t++$pos;\n\t\t\t} else if ($str=='}') {\n\t\t\t\t++$pos;\n\t\t\t\tif (!--$braceLevel) {\n\t\t\t\t\treturn $functions;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function match($methods, $match, $rewrite = null, $closure = null);", "function new_parameters() {\r\n\r\n }", "protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }", "public function getParameters(){\n\t\t$options = $this->_function_reflection->getParameters();\n\t}", "public function callRouteHook()\n {\n if (!empty($this->matchedRoute)) {\n\n if (is_callable($this->matchedRoute->getCallable())) {\n call_user_func_array($this->matchedRoute->getCallable(), $this->matchedRouteParams);\n }\n }\n }", "function test($par1, $par2){\n echo func_num_args() . '<br>'; // 3\n print_r(func_get_args()) . '<br>'; // Array ( [0] => Ceyhun [1] => Bahadır [2] => Çelik )\n echo func_get_arg(2); // Çelik\n }", "protected function parse_body_params()\n {\n }", "function sa_parseFuncArgs($argstr){\n $entries = array();\n $filteredData = $argstr;\n $userland = '[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*';\n if (preg_match_all(\"/$userland\\(([^)]*)\\)/\", $argstr, $matches)) {\n $entries = $matches[0];\n $filteredData = preg_replace(\"/$userland\\(([^)]*)\\)/\", \"-function-\", $argstr);\n }\n\n $arr = array_map(\"trim\", explode(\",\", $filteredData));\n\n if (!$entries) {\n return $arr;\n }\n\n $j = 0;\n foreach ($arr as $i => $entry) {\n if ($entry != \"-function-\") {\n continue;\n }\n\n $arr[$i] = $entries[$j];\n $j++;\n }\n\n return $arr;\n}", "function test($param1, $e)\n{\n // ...\n}", "function test(...$params){\n // pass event to callback function\n\n print_r($params[0]);\n print_r(\"EVENT TYPE: \" . $params[1] . PHP_EOL . PHP_EOL);\n\n}", "function route($method, $regex, $controller, $function, ...$parameters) {\n if($_SERVER[\"REQUEST_METHOD\"] !== $method) return;\n // Remove the root part of the URI so we only have the request\n $url = str_replace(ROOT, \"\", $_SERVER[\"REQUEST_URI\"]);\n\n $regex = createRegex($regex);\n\n if(preg_match($regex, $url, $args)) {\n // preg_match puts the matched string in the first element of the array, so we remove it\n array_shift($args);\n // Call the controller (autoloaded)\n $controller = new $controller();\n // Call the method with unpacked arguments\n $controller->$function(...$args, ...$parameters);\n exit;\n }\n}", "public function validateParameters(&$parameters);", "public function action($func, $params)\n {\n }", "public function analyzeFunctionCall(CodeBase $code_base, Context $context, array $args, Node $node = null): void;", "public function & GetMatchedParams () {\n\t\treturn $this->matchedParams;\n\t}", "public static function analyzeParameterTypes(\n CodeBase $code_base,\n FunctionInterface $method\n ): void {\n try {\n self::analyzeParameterTypesInner($code_base, $method);\n } catch (RecursionDepthException $_) {\n }\n }", "public function parameters();", "public function parameters();", "abstract public function getParameters();", "public function test_filter_arbitrary_arguments() {\n $hook = rand_str();\n $var1 = rand_str();\n $var2 = rand_str();\n $var3 = rand_str();\n\n yourls_add_filter( $hook, function( $var1 = '', $var2 = '', $var3 = '' ) { return $var1 . $var2 . $var3; } );\n\n $filtered = yourls_apply_filter( $hook, $var1 );\n $this->assertSame( $var1, $filtered );\n\n $filtered = yourls_apply_filter( $hook, $var1, $var2 );\n $this->assertSame( $var1 . $var2, $filtered );\n\n $filtered = yourls_apply_filter( $hook, $var1, $var2, $var3 );\n $this->assertSame( $var1 . $var2 . $var3, $filtered );\n }", "public function applyFunction(string $functionName, ...$args): ICollection;", "public function process($value);", "public function testParseCallbackWithMatch()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => function ($match) { return 'replaced !'.$match; },\n ];\n $extras = []; // extra needed parameters like paths \n\n $out = $this->parser->parse($file, $rule, $extras);\n\n $this->assertSame('replaced !#test', $out);\n }", "abstract public function run(&$params);", "function fpg_functions($name, $params) {\n\t$return_type = $params['return'];\n\t$return_cmd = 'RETURN_';\n\tswitch ($return_type) {\n\t case 'float':\n\t case 'double':\n\t case 'fann_type':\n\t\t $return_cmd .= 'DOUBLE';\n\t\t break;\n\t case 'int':\n\t\t $return_cmd .= 'LONG';\n\t\t break;\n\t}\n\tif ($params['has_getter']) {\n\t\t$body = $params['empty_function'] ? \"\": \"PHP_FANN_GET_PARAM(fann_get_$name, $return_cmd);\";\n\t\t$getter = \"\n/* {{{ proto bool fann_get_$name(resource ann)\n Returns {$params['comment']} */\nPHP_FUNCTION(fann_get_$name)\n{\n\t$body\n}\n/* }}} */\";\n\t\tfpg_printf($getter);\n\t}\n\tif ($params['has_setter']) {\n\t\t$set_args = \"fann_set_$name\";\n\t\t$comment_args = \"resource ann\";\n\t\tforeach ($params['params'] as $param_name => $param_type) {\n\t\t\t$comment_args .= sprintf(\", %s %s\", $param_type == 'fann_type' ? 'double' : $param_type, $param_name);\n\t\t\t$set_args .= sprintf(\", %s\", $param_type == 'int' ? 'l, long' : 'd, double');\n\t\t}\n\t\t$body = $params['empty_function'] ? \"\": \"PHP_FANN_SET_PARAM($set_args);\";\n\t\t$setter = \"\n/* {{{ proto bool fann_set_$name($comment_args)\n Sets {$params['comment']}*/\nPHP_FUNCTION(fann_set_$name)\n{\n $body\n}\n/* }}} */\";\n\t\tfpg_printf($setter);\n\t}\n}", "abstract public function sanatizeParameters(array $params);", "public function __call($name, $parameters)\n\t{\n\t\t$before = $this->plugins->run_hook('fu_profile_model_before_' . $name, $parameters);\n\n\t\tif (is_array($before))\n\t\t{\n\t\t\t// if the value returned is an Array, a plugin was active\n\t\t\t$parameters = $before['parameters'];\n\t\t}\n\n\t\t// if the replace is anything else than NULL for all the functions ran here, the \n\t\t// replaced function wont' be run\n\t\t$replace = $this->plugins->run_hook('fu_profile_model_replace_' . $name, $parameters, array($parameters));\n\n\t\tif($replace['return'] !== NULL)\n\t\t{\n\t\t\t$return = $replace['return'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch (count($parameters)) {\n\t\t\t\tcase 0:\n\t\t\t\t\t$return = $this->{'p_' . $name}();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$return = $this->{'p_' . $name}($parameters[0]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$return = $this->{'p_' . $name}($parameters[0], $parameters[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$return = $this->{'p_' . $name}($parameters[0], $parameters[1], $parameters[2]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$return = $this->{'p_' . $name}($parameters[0], $parameters[1], $parameters[2], $parameters[3]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$return = $this->{'p_' . $name}($parameters[0], $parameters[1], $parameters[2], $parameters[3], $parameters[4]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$return = call_user_func_array(array(&$this, 'p_' . $name), $parameters);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// in the after, the last parameter passed will be the result\n\t\tarray_push($parameters, $return);\n\t\t$after = $this->plugins->run_hook('fu_profile_model_after_' . $name, $parameters);\n\n\t\tif (is_array($after))\n\t\t{\n\t\t\treturn $after['return'];\n\t\t}\n\n\t\treturn $return;\n\t}", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "public function parseParameterNames()\n {\n return RouteMatch::parseParameterNames($this);\n }", "function fpg_process_array($action, $params_list) {\n\t$fce_name = \"fpg_$action\";\n\tif (function_exists($fce_name)) {\n\t\tforeach ($params_list as $name => $params) {\n if (!isset($params['return']))\n $params['return'] = reset($params['params']);\n\t\t\t$params['empty_function'] = isset($params['empty_function']) && $params['empty_function'];\n\t\t\t$params['empty_test'] = isset($params['empty_test']) && $params['empty_test'];\n\t\t\t$params['has_setter'] = !isset($params['only_getter']) || !$params['only_getter'];\n\t\t\t$params['has_getter'] = !isset($params['only_setter']) || !$params['only_setter'];\n\t\t\t$fce_name($name, $params);\n\t\t}\n\t}\n\telse {\n\t\tfprintf(STDERR, \"Argument $action is not a valid action\\n\");\n\t}\n}", "abstract public function apply($tokens);", "public function testValidMatchParamaters()\n\t{\n\t\t$config = array('route' => '/foo/bar/:id');\n\t\t$regex = new Regex($config);\n\n\t\t$this->assertTrue($regex->evaluate('/foo/bar/baz'));\n\t\t$params = $regex->getParams();\n\n\t\t$this->assertEquals(\n\t\t\t$params,\n\t\t\tarray('id' => 'baz')\n\t\t);\n\t}", "public function mod($params) {}", "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}", "private function _getFuncData( $patternFuncStr )\n\t{\n\t\tif( preg_match_all( '/(^[a-zA-Z_]\\w*)\\((.*)\\)/', $patternFuncStr, $matches ) )\n\t\t{\n\t\t\t$name = $matches[1][0];\n\n\t\t\tif( $matches[2][0] == \"\" )\n\t\t\t{\n\t\t\t\t// have not input args. func()\n\t\t\t\t$params = array();\n\t\t\t}\t\t\t\t\n\t\t\telse\t\t\t\t\n\t\t\t{\n\t\t\t\t//have input args. func(<input1>, <input2>)\n\t\t\t\tif( preg_match_all( '/<(\\w+)>/', $matches[2][0], $matches ) )\n\t\t\t\t\t$params = $matches[1];\n\t\t\t\telse\n\t\t\t\t\t$params = array();\n\t\t\t}\n\t\t\t\t\n\n\t\t\treturn array( 'name' => $name, 'params' => $params );\n\t\t}\n\t\t\t\n\t\telse\n\t\t\tthrow new Exception( \"Invalid function name format.\" );\n\t}", "function getParameters();", "function getParameters();", "function sort_callback_parameters($callback, $parameters) {\n $callback_type = get_callback_type($callback);\n switch ($callback_type) {\n case 'function':\n $reflection_callback = new ReflectionFunction($callback);\n break;\n case 'method':\n if (is_object($callback)) {\n $reflection_callback = new ReflectionMethod($callback, '__invoke');\n } elseif (is_array($callback)) {\n list($class, $method) = $callback;\n\n $reflection_callback = new ReflectionMethod($class, $method);\n } elseif (is_string($callback)) {\n $reflection_callback = new ReflectionMethod($callback);\n } else {\n exit(1);\n }\n break;\n default:\n exit(1);\n break;\n }\n\n $reflection_parameters = $reflection_callback->getParameters();\n\n $retour = array();\n foreach ($reflection_parameters as $reflection_parameter) {\n $reflection_parameter_name = $reflection_parameter->getName();\n\n if (array_key_exists($reflection_parameter_name, $parameters)) {\n $retour[] = $parameters[$reflection_parameter_name];\n } elseif ($reflection_parameter->isDefaultValueAvailable()) {\n $retour[] = $reflection_parameter->getDefaultValue();\n } else {\n return false;\n }\n }\n\n return $retour;\n }", "function myFunction($variable1, $variable2,\n $variable3, $variable4)\n {\n }", "private function paramMatch($match)\n {\n if (isset($this->params[$match[1]])) {\n return '('.$this->params[$match[1]].')';\n }\n return '([^/]+)';\n }", "public function resolveParams(&$segments)\n {\n \n $this->params = $segments; \n \n }", "public function getMatchableFormatParams();", "public function match( $data );", "public function parseParameterPatterns()\n {\n return RouteMatch::parseParameterPatterns($this);\n }", "public function run(...$params);", "function rest_parse_request_arg($value, $request, $param)\n {\n }", "public function testRouteMatchesAndParamExtracted()\n {\n $resource = '/hello/Josh';\n $route = new \\Slim\\Route('/hello/:name', function () {});\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('name' => 'Josh'), $route->getParams());\n }", "public function match(Parser $parser, Scanner $scanner)\n {\n $start = $scanner->getContext()->pop();\n\n $arguments = array();\n while (($t = $scanner->getContext()->pop())!=='(') {\n $arguments[] = $t;\n }\n $name = $scanner->getContext()->pop();\n $scanner->getContext()->push(new E\\Func($name, array_reverse($arguments)));\n }", "public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) {\n\t\tif ( isset( $parameters[4] ) === false ) {\n\t\t\t// If no cache expiry time, bail (i.e. we don't want to flag for something like feeds where it is cached indefinitely until a hook runs).\n\t\t\treturn;\n\t\t}\n\n\t\t$param = $parameters[4];\n\t\t$tokensAsString = '';\n\t\t$reportPtr = null;\n\t\t$openParens = 0;\n\n\t\t$message = 'Cache expiry time could not be determined. Please inspect that the fourth parameter passed to %s() evaluates to 300 seconds or more. Found: \"%s\"';\n\t\t$error_code = 'CacheTimeUndetermined';\n\t\t$data = [ $matched_content, $parameters[4]['raw'] ];\n\n\t\tfor ( $i = $param['start']; $i <= $param['end']; $i++ ) {\n\t\t\tif ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) === true ) {\n\t\t\t\t$tokensAsString .= ' ';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_NS_SEPARATOR ) {\n\t\t\t\t/*\n\t\t\t\t * Ignore namespace separators. If it's part of a global WP time constant, it will be\n\t\t\t\t * handled correctly. If it's used in any other context, another token *will* trigger the\n\t\t\t\t * \"undetermined\" warning anyway.\n\t\t\t\t */\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( $reportPtr ) === false ) {\n\t\t\t\t// Set the report pointer to the first non-empty token we encounter.\n\t\t\t\t$reportPtr = $i;\n\t\t\t}\n\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_LNUMBER\n\t\t\t\t|| $this->tokens[ $i ]['code'] === T_DNUMBER\n\t\t\t) {\n\t\t\t\t// Integer or float.\n\t\t\t\t$tokensAsString .= $this->tokens[ $i ]['content'];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_FALSE\n\t\t\t\t|| $this->tokens[ $i ]['code'] === T_NULL\n\t\t\t) {\n\t\t\t\t$tokensAsString .= 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_TRUE ) {\n\t\t\t\t$tokensAsString .= 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( isset( Tokens::$arithmeticTokens[ $this->tokens[ $i ]['code'] ] ) === true ) {\n\t\t\t\t$tokensAsString .= $this->tokens[ $i ]['content'];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If using time constants, we need to convert to a number.\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_STRING\n\t\t\t\t&& isset( $this->wp_time_constants[ $this->tokens[ $i ]['content'] ] ) === true\n\t\t\t) {\n\t\t\t\t$tokensAsString .= $this->wp_time_constants[ $this->tokens[ $i ]['content'] ];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_OPEN_PARENTHESIS ) {\n\t\t\t\t$tokensAsString .= $this->tokens[ $i ]['content'];\n\t\t\t\t++$openParens;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_CLOSE_PARENTHESIS ) {\n\t\t\t\t$tokensAsString .= $this->tokens[ $i ]['content'];\n\t\t\t\t--$openParens;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $this->tokens[ $i ]['code'] === T_CONSTANT_ENCAPSED_STRING ) {\n\t\t\t\t$content = $this->strip_quotes( $this->tokens[ $i ]['content'] );\n\t\t\t\tif ( is_numeric( $content ) === true ) {\n\t\t\t\t\t$tokensAsString .= $content;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Encountered an unexpected token. Manual inspection needed.\n\t\t\t$this->phpcsFile->addWarning( $message, $reportPtr, $error_code, $data );\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $tokensAsString === '' ) {\n\t\t\t// Nothing found to evaluate.\n\t\t\treturn;\n\t\t}\n\n\t\t$tokensAsString = trim( $tokensAsString );\n\n\t\tif ( $openParens !== 0 ) {\n\t\t\t/*\n\t\t\t * Shouldn't be possible as that would indicate a parse error in the original code,\n\t\t\t * but let's prevent getting parse errors in the `eval`-ed code.\n\t\t\t */\n\t\t\tif ( $openParens > 0 ) {\n\t\t\t\t$tokensAsString .= str_repeat( ')', $openParens );\n\t\t\t} else {\n\t\t\t\t$tokensAsString = str_repeat( '(', abs( $openParens ) ) . $tokensAsString;\n\t\t\t}\n\t\t}\n\n\t\t$time = @eval( \"return $tokensAsString;\" ); // phpcs:ignore Squiz.PHP.Eval,WordPress.PHP.NoSilencedErrors -- No harm here.\n\n\t\tif ( $time === false ) {\n\t\t\t/*\n\t\t\t * The eval resulted in a parse error. This will only happen for backfilled\n\t\t\t * arithmetic operator tokens, like T_POW, on PHP versions in which the token\n\t\t\t * did not exist. In that case, flag for manual inspection.\n\t\t\t */\n\t\t\t$this->phpcsFile->addWarning( $message, $reportPtr, $error_code, $data );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $time < 300 && (int) $time !== 0 ) {\n\t\t\t$message = 'Low cache expiry time of %s seconds detected. It is recommended to have 300 seconds or more.';\n\t\t\t$data = [ $time ];\n\n\t\t\tif ( (string) $time !== $tokensAsString ) {\n\t\t\t\t$message .= ' Found: \"%s\"';\n\t\t\t\t$data[] = $tokensAsString;\n\t\t\t}\n\n\t\t\t$this->phpcsFile->addWarning( $message, $reportPtr, 'LowCacheTime', $data );\n\t\t}\n\t}", "public function testRouteMatchesAndMultipleParamsExtracted()\n {\n $resource = '/hello/Josh/and/John';\n $route = new \\Slim\\Route('/hello/:first/and/:second', function () {});\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('first' => 'Josh', 'second' => 'John'), $route->getParams());\n }", "function apply(...$args): void {\n\n if (empty($args)) {\n throw new BadFunctionCallException('Unsupported function call.');\n }\n\n $regexp = array_shift($args);\n $record = is_string($regexp)\n ? [\"@{$regexp}@\", ...$args]\n : ['@.+@', $regexp];\n\n $mwares = stash(DISPATCH_MIDDLEWARE_KEY) ?? [];\n $mwares[] = $record;\n stash(DISPATCH_MIDDLEWARE_KEY, $mwares);\n}", "private function parseParameters(array $parameters) : void\n {\n foreach ($parameters as $parameter) {\n $this->parseParameter($parameter);\n }\n }", "function match($field, $value);", "public static function apply($subject, $matches)\n {\n }", "public function post($match, $rewrite = null, $closure = null);", "public function getDefinedParameters();", "function xml_inside_function($file, $rettype, $function_name, $params, $var_args, &$xml, $prepinace, $k, $n){\n //fprintf(STDOUT, \"inside function\");\n $number = 1;\n $newline = \"\";\n $indent = \"\";\n if($prepinace[\"pretty\"]){\n $newline = \"\\n\"; \n }\n \n while($k != 0){\n $indent .= \" \";\n $k--;\n }\n //z jedneho stringu parametrov oddelenych ciarkami dostaneme\n //pole parametrov o samote\n $params = explode(\",\", $params);\n \n for($i = 0; $i < count($params); $i++){\n $params[$i] = trim($params[$i]); //odstranime prebytocne biele znaky na zaciatku a konci\n if ($params[$i] == \"void\" || $params[$i] == \" \" || empty($params[$i])){ //prazdny parameter nevypisujeme\n unset($params[$i]); \n continue;\n }\n }\n \n $params = array_filter($params); //pripadnu neexistenciu parametru riesime jeho odstranenim z pola\n \n if($prepinace[\"maxPar\"]){ //ak ma tato funkcia viac parametrov je vyzadovane, koncime\n if(count($params) > $n){\n return;\n } \n }\n \n \n $xml .= $indent.\"<function file=\\\"$file\\\" name=\\\"$function_name\\\" varargs=\\\"$var_args\\\" rettype=\\\"$rettype\\\">\".$newline;\n \n \n foreach($params as &$param){ \n $param = preg_replace('/[\\w]+$/','',$param); //odstranenie nazvu parametru\n $param = trim($param); //odstranenie prebytocnych bielych znakov na zaciatku a konci\n if($prepinace[\"removeWhitespaces\"]){ //odstranenie bielych znakov uprostred\n $patterns = array(\"/\\s+/\", \"/\\s+\\*/\", \"/\\*\\s+/\");\n $replacements = array(\" \", \"*\", \"*\");\n $param = preg_replace($patterns, $replacements, $param);\n }\n }\n \n for ($i = 0; $i < count($params); $i++){ \n $xml .= $indent.$indent.\"<param number=\\\"\".$number.\"\\\" type=\\\"$params[$i]\\\" />\".$newline; //vypis parametru\n $number += 1; //cislovanie parametrov\n }\n $xml .= $indent.\"</function>\".$newline; //ukoncenie funkcie s pripadnym odriadkovanim (ak xml)\n\n\n}", "public static function process_page_parameters() {\n return new external_function_parameters (\n array(\n 'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id.'),\n 'page' => new external_value(PARAM_INT, 'The page being processed.'),\n 'responses' => new external_multiple_structure(\n new external_single_structure(\n array(\n 'name' => new external_value(PARAM_NOTAGS, 'The response name (usually type[index]_id).'),\n 'value' => new external_value(PARAM_RAW, 'The response value.'),\n )\n ), 'The data to be processed.', VALUE_DEFAULT, array()\n ),\n 'goprevious' => new external_value(PARAM_BOOL, 'Whether we want to jump to previous page.', VALUE_DEFAULT, false),\n 'courseid' => new external_value(PARAM_INT, 'Course where user completes the feedback (for site feedbacks only).',\n VALUE_DEFAULT, 0),\n )\n );\n }", "function getParams()\n {\n }", "public function getNumberOfParameters() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->getNumberOfParameters();\n } else {\n return parent::getNumberOfParameters();\n }\n }", "protected function matchParams($match)\n {\n if (isset($this->params[$match[1]])) {\n return '(' . $this->params[$match[1]] . ')';\n }\n return '([^/]+)';\n }", "public function resolve(ReflectionParameter $parameter, array $providedParameters);", "public function traverse(callable $transformation);", "public static function matching(string $line): bool\n {\n if (!preg_match('/zend_parse_parameters\\(ZEND_NUM_ARGS\\(\\), \"(.*?(?=\"))\", (.*?(?=\\)))\\)/', $line, $matches)) {\n return false;\n }\n\n /**\n * @link https://devzone.zend.com/317/extension-writing-part-ii-parameters-arrays-and-zvals/#Heading2\n * @link https://phpinternals.net/categories/zend_parameter_parsing\n */\n $type_map = [\n 'b' => 'bool',\n 'l' => 'int',\n 'd' => 'float',\n 's' => 'string',\n 'a' => 'array',\n 'z' => null,\n ];\n\n $type_chars = str_split($matches[1]);\n $parameter_names = explode(',', $matches[2]);\n $index = 0;\n foreach ($type_chars as $i => $char) {\n if ($char == '|') {\n // following parameters are optional\n continue;\n }\n if ($char == '/') {\n // previous parameter is passed by reference\n continue;\n }\n if ($char == '!') {\n // previous parameter is nullable\n continue;\n }\n\n if (!array_key_exists($char, $type_map)) {\n throw new RuntimeException('parameter type not found, type=' . $char);\n }\n\n $callable = FunctionMethod::getCurrentCallable();\n\n $inner_name = trim(array_shift($parameter_names), '*& ');\n if (empty($inner_name)) {\n return true;\n }\n if (($temp = strpos($inner_name, '.')) !== false) {\n $inner_name = substr($inner_name, 0, $temp);\n }\n if ($char == 's') {\n // string parameter has a following length parameter\n array_shift($parameter_names);\n }\n\n $optional = $index >= $callable->getNumberOfRequiredParameters();\n if ($index < $callable->getNumberOfParameters()) {\n $reflection = $callable->getParameters()[$index++];\n $parameter = Parameter::fromPhpReflection($reflection);\n } else {\n // not proclaimed parameter\n $parameter = new Parameter($inner_name, null, null, $index++);\n }\n\n if (!$parameter->getType() && $type_map[$char]) {\n $parameter->setType($type_map[$char]);\n }\n\n FunctionMethod::setInnerParameters($parameter, $inner_name, $optional);\n }\n\n return true;\n }", "function process_data($data) {\n }", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "protected static function _groupResult($functionName, $alias, $parameters) {}" ]
[ "0.71447194", "0.6584929", "0.6305719", "0.6184013", "0.5828825", "0.56540334", "0.5632326", "0.5454095", "0.5352077", "0.5269857", "0.52271193", "0.5183101", "0.5182747", "0.5170234", "0.51450187", "0.513757", "0.51327646", "0.5098212", "0.5097642", "0.5096582", "0.50954974", "0.5062744", "0.50472385", "0.50388616", "0.50249344", "0.49980858", "0.49929407", "0.49926114", "0.49530053", "0.49256805", "0.48889455", "0.48723528", "0.4870134", "0.48529997", "0.4836539", "0.48031518", "0.48025817", "0.47963902", "0.47958723", "0.47958723", "0.47824278", "0.47818804", "0.47803938", "0.4777606", "0.47737908", "0.47672558", "0.47544363", "0.47379267", "0.47266054", "0.47161102", "0.47156918", "0.47096786", "0.470237", "0.46900085", "0.46871322", "0.46780425", "0.46735197", "0.46729538", "0.46729538", "0.467017", "0.46695477", "0.46678793", "0.4663937", "0.46630043", "0.4660927", "0.4641816", "0.46362576", "0.46347594", "0.46269277", "0.46255842", "0.4620611", "0.4618377", "0.45906138", "0.45816633", "0.45779654", "0.45717838", "0.45710763", "0.4570633", "0.45686477", "0.4559314", "0.45503742", "0.45458296", "0.45404837", "0.45356247", "0.45343286", "0.4532497", "0.45282665", "0.45279694", "0.45279694", "0.45279694", "0.45279694", "0.45279694", "0.45279694", "0.45279694", "0.45279694", "0.45279694", "0.45279694", "0.4524592", "0.4524592", "0.45206216" ]
0.5215366
11
only if we have topics do we need to ensure that one has been picked
function _getValidationCode() { $code = "$('#error_file').html('').parent().hide();\n"; $code .= "if(!$('#imgFile').val()) {"; $code .= "$('#error_file').html('You must select an image file');\n"; $code .= "$('#error_file').parent().show();\n"; $code .= "error = true;}\n"; //TODO: Make this a setting in an essay //$code .= "$('#error_text').html('').parent().hide();\n"; // $code .= "if(getWordCount('textEdit') > 150) {"; // $code .= "$('#error_text').html('Your text can not be longer than 100 words. (Note: Some editors add phantom characters to your document, try cleaning the text by copying it into a program like notepad then pasting it in if you feel you receive this message in error)');\n"; // $code .= "$('#error_text').parent().show();\n"; // $code .= "error = true;}"; return $code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasTopics() {\n\t\treturn $this->topics()->count() > 0;\n\t}", "private function getOneTopic() {\n $this->topic->findOne();\n }", "public function supportsTopicLookup() {\n \treturn $this->manager->supportsTopicLookup();\n\t}", "public function hasTopic():bool\n\t{\n\t\treturn !empty($this->_topic);\n\t}", "public function supportsTopicSearch() {\n \treturn $this->manager->supportsTopicSearch();\n\t}", "public function load_topics() {\n\n\t\t// Get our current master list of topics.\n\t\t$master_list = $this->get_cahnrs_topics();\n\n\t\t// Get our current list of top level parents.\n\t\t$level1_exist = get_terms( $this->cahnrs_topics, array( 'hide_empty' => false, 'parent' => '0' ) );\n\t\t$level1_assign = array();\n\t\tforeach( $level1_exist as $level1 ) {\n\t\t\t$level1_assign[ $level1->name ] = array( 'term_id' => $level1->term_id );\n\t\t}\n\n\t\t$level1_names = array_keys( $master_list );\n\t\t/**\n\t\t * Look for mismatches between the master list and the existing parent terms list.\n\t\t *\n\t\t * In this loop:\n\t\t *\n\t\t * * $level1_names array of top level parent names.\n\t\t * * $level1_name string containing a top level category.\n\t\t * * $level1_children array containing all of the current parent's child arrays.\n\t\t * * $level1_assign array of top level parents that exist in the database with term ids.\n\t\t */\n\t\tforeach( $level1_names as $level1_name ) {\n\t\t\tif ( ! array_key_exists( $level1_name, $level1_assign ) ) {\n\t\t\t\t$new_term = wp_insert_term( $level1_name, $this->cahnrs_topics, array( 'parent' => '0' ) );\n\t\t\t\tif ( ! is_wp_error( $new_term ) ) {\n\t\t\t\t\t$level1_assign[ $level1_name ] = array( 'term_id' => $new_term['term_id'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process the children of each top level parent.\n\t\t *\n\t\t * In this loop:\n\t\t *\n\t\t * * $level1_names array of top level parent names.\n\t\t * * $level1_name string containing a top level category.\n\t\t * * $level1_children array containing all of the current parent's child arrays.\n\t\t * * $level2_assign array of this parent's second level categories that exist in the database with term ids.\n\t\t */\n\t\tforeach( $level1_names as $level1_name ) {\n\n\t\t\t$level2_exists = get_terms( $this->cahnrs_topics, array( 'hide_empty' => false, 'parent' => $level1_assign[ $level1_name ]['term_id'] ) );\n\t\t\t$level2_assign = array();\n\n\t\t\tforeach( $level2_exists as $level2 ) {\n\t\t\t\t$level2_assign[ $level2->name ] = array( 'term_id' => $level2->term_id );\n\t\t\t}\n\n\t\t\t$level2_names = array_keys( $master_list[ $level1_name ] );\n\t\t\t/**\n\t\t\t * Look for mismatches between the expected and real children of the current parent.\n\t\t\t *\n\t\t\t * In this loop:\n\t\t\t *\n\t\t\t * * $level2_names array of the current parent's child level names.\n\t\t\t * * $level2_name string containing a second level category.\n\t\t\t * * $level2_children array containing the current second level category's children. Unused in this context.\n\t\t\t * * $level2_assign array of this parent's second level categories that exist in the database with term ids.\n\t\t\t */\n\t\t\tforeach( $level2_names as $level2_name ) {\n\t\t\t\tif ( ! array_key_exists( $level2_name, $level2_assign ) ) {\n\t\t\t\t\t$new_term = wp_insert_term( $level2_name, $this->cahnrs_topics, array( 'parent' => $level1_assign[ $level1_name ]['term_id'] ) );\n\t\t\t\t\tif ( ! is_wp_error( $new_term ) ) {\n\t\t\t\t\t\t$level2_assign[ $level2_name ] = array( 'term_id' => $new_term['term_id'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Look for mismatches between second and third level category relationships.\n\t\t\t */\n\t\t\tforeach( $level2_names as $level2_name ) {\n\t\t\t\t$level3_exists = get_terms( $this->cahnrs_topics, array( 'hide_empty' => false, 'parent' => $level2_assign[ $level2_name ]['term_id'] ) );\n\t\t\t\t$level3_exists = wp_list_pluck( $level3_exists, 'name' );\n\n\t\t\t\t$level3_names = $master_list[ $level1_name ][ $level2_name ];\n\t\t\t\tforeach( $level3_names as $level3_name ) {\n\t\t\t\t\tif ( ! in_array( $level3_name, $level3_exists ) ) {\n\t\t\t\t\t\twp_insert_term( $level3_name, $this->cahnrs_topics, array( 'parent' => $level2_assign[ $level2_name ]['term_id'] ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public function getTopic() {}", "function check_alltopicsattempted($uid){\n\t/**\n * This function check weather whole topics attempted or not and return yes or no\n * \n * @author Imran M Bajwa <[email protected]>\n * @return yes or no\n */ \n\tglobal $dbc;\n\n\n\t$sql = $dbc->query(\"select * FROM tests, test_log, user WHERE user.id='$uid' AND \n\t\tuser.test_id = tests.test_id AND user.id = test_log.uid ORDER BY test_log.t_time DESC LIMIT 1\");\n\tif ( $sql->num_rows == 0) return \"no\";\n\t$r = $sql->fetch_assoc();\t\n\t $atopics = explode(\",\", $r['topics']);\n\t$ltad = $r['tid'];\n\t$pos = sizeof($atopics)-1;\n\tif($pos == array_search($r['tid'],$atopics)){\n\t\treturn \"yes\";\n\t}\n\t// if( $ltad == $atopics[sizeof($atopics)-1] )\n\t\t\n\telse{\n\t\treturn \"no\";\n\t}\n\t\t\n}", "public function load_topic_object()\n\t{\n\t\tif (!$this->post->topic->topic_id)\n\t\t{\n\t\t\t$this->post->topic->topic_id = $this->post->topic_id;\n\t\t\t$this->post->topic->load();\n\t\t}\n\t}", "public function topics(Topics $topics = null);", "function cns_read_in_topic($topic_id, $start, $max, $view_poll_results = false, $check_perms = true)\n{\n if (!is_null($topic_id)) {\n $table = 'f_topics t LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_forums f ON f.id=t.t_forum_id';\n $select = array('t.*', 'f.f_is_threaded');\n if (multi_lang_content()) {\n $select[] = 't_cache_first_post AS p_post';\n } else {\n $table .= ' LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p ON p.id=t.t_cache_first_post_id';\n $select[] = 'p_post,p_post__text_parsed,p_post__source_user';\n }\n $_topic_info = $GLOBALS['FORUM_DB']->query_select($table, $select, array('t.id' => $topic_id), '', 1);\n if (!array_key_exists(0, $_topic_info)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE', 'topic'));\n }\n $topic_info = $_topic_info[0];\n\n // Are we allowed into here?\n // Check forum\n $forum_id = $topic_info['t_forum_id'];\n if (!is_null($forum_id)) {\n if ($check_perms) {\n if (!has_category_access(get_member(), 'forums', strval($forum_id))) {\n access_denied('CATEGORY_ACCESS_LEVEL');\n }\n }\n } else {\n // It must be a private topic. Do we have access?\n $from = $topic_info['t_pt_from'];\n $to = $topic_info['t_pt_to'];\n\n if (($from != get_member()) && ($to != get_member()) && (!cns_has_special_pt_access($topic_id)) && (!has_privilege(get_member(), 'view_other_pt'))) {\n access_denied('PRIVILEGE', 'view_other_pt');\n }\n\n decache(array(\n array('side_cns_private_topics', array(get_member())),\n array('_new_pp', array(get_member())),\n ));\n }\n // Check validated\n if (($topic_info['t_validated'] == 0) && (addon_installed('unvalidated'))) {\n if ((!has_privilege(get_member(), 'jump_to_unvalidated')) && ($check_perms) && ((is_guest()) || ($topic_info['t_cache_first_member_id'] != get_member()))) {\n access_denied('PRIVILEGE', 'jump_to_unvalidated');\n }\n }\n\n if (is_null(get_param_integer('threaded', null))) {\n if ($start > 0) {\n if ($topic_info['f_is_threaded'] == 1) {\n $_GET['threaded'] = '0';\n }\n }\n }\n $is_threaded = get_param_integer('threaded', (is_null($topic_info['f_is_threaded']) ? 0 : $topic_info['f_is_threaded']));\n if ($is_threaded != 1) {\n $is_threaded = 0; // In case of invalid URLs causing inconsistent handling\n }\n\n // Some general info\n require_code('seo2');\n list(, $meta_description) = _seo_meta_find_data(array(), get_translated_text($topic_info['p_post'], $GLOBALS['FORUM_DB']));\n $out = array(\n 'num_views' => $topic_info['t_num_views'],\n 'num_posts' => $topic_info['t_cache_num_posts'],\n 'validated' => $topic_info['t_validated'],\n 'title' => $topic_info['t_cache_first_title'],\n 'description' => $topic_info['t_description'],\n 'description_link' => $topic_info['t_description_link'],\n 'emoticon' => $topic_info['t_emoticon'],\n 'forum_id' => $topic_info['t_forum_id'],\n 'first_post' => $topic_info['p_post'],\n 'first_poster' => $topic_info['t_cache_first_member_id'],\n 'first_post_id' => $topic_info['t_cache_first_post_id'],\n 'pt_from' => $topic_info['t_pt_from'],\n 'pt_to' => $topic_info['t_pt_to'],\n 'is_open' => $topic_info['t_is_open'],\n 'is_threaded' => $is_threaded,\n 'is_really_threaded' => is_null($topic_info['f_is_threaded']) ? 0 : $topic_info['f_is_threaded'],\n 'last_time' => $topic_info['t_cache_last_time'],\n 'metadata' => array(\n 'identifier' => '_SEARCH:topicview:browse:' . strval($topic_id),\n 'numcomments' => strval($topic_info['t_cache_num_posts']),\n 'description' => $meta_description, // There's no meta description, so we'll take this as a description, which will feed through\n ),\n 'row' => $topic_info,\n );\n\n // Poll?\n if (!is_null($topic_info['t_poll_id'])) {\n require_code('cns_polls');\n if (is_guest()) {\n $voted_already_map = array('pv_poll_id' => $topic_info['t_poll_id'], 'pv_ip' => get_ip_address());\n } else {\n $voted_already_map = array('pv_poll_id' => $topic_info['t_poll_id'], 'pv_member_id' => get_member());\n }\n $voted_already = $GLOBALS['FORUM_DB']->query_select_value_if_there('f_poll_votes', 'pv_member_id', $voted_already_map);\n $test = cns_poll_get_results($topic_info['t_poll_id'], $view_poll_results || (!is_null($voted_already)));\n if ($test !== null) {\n $out['poll'] = $test;\n $out['poll']['voted_already'] = $voted_already;\n $out['poll_id'] = $topic_info['t_poll_id'];\n }\n }\n\n // Post query\n $where = cns_get_topic_where($topic_id);\n $query = 'SELECT p.* FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p WHERE ' . $where . ' ORDER BY p_time,p.id';\n } else {\n $out = array(\n 'num_views' => 0,\n 'num_posts' => 0,\n 'validated' => 1,\n 'title' => do_lang('INLINE_PERSONAL_POSTS'),\n 'description' => '',\n 'description_link' => '',\n 'emoticon' => '',\n 'forum_id' => null,\n 'first_post' => null,\n 'first_poster' => null,\n 'first_post_id' => null,\n 'pt_from' => null,\n 'pt_to' => null,\n 'is_open' => 1,\n 'is_threaded' => 0,\n 'last_time' => time(),\n 'metadata' => array(),\n 'row' => array(),\n );\n\n // Post query\n $where = 'p_intended_solely_for=' . strval(get_member());\n $query = 'SELECT p.* FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p WHERE ' . $where . ' ORDER BY p_time,p.id';\n\n $topic_info = array(\n 't_is_open' => 1,\n );\n }\n\n // Posts\n if ($out['is_threaded'] == 0) {\n if ($start < 200) {\n $_postdetailss = list_to_map('id', $GLOBALS['FORUM_DB']->query($query, $max, $start, false, false, array('p_post' => 'LONG_TRANS__COMCODE')));\n } else { // deep search, so we need to make offset more efficient, trade-off is more queries\n $_postdetailss = list_to_map('id', $GLOBALS['FORUM_DB']->query($query, $max, $start));\n }\n if (($start == 0) && (count($_postdetailss) < $max)) {\n $out['max_rows'] = $max; // We know that they're all on this screen\n } else {\n $out['max_rows'] = (is_null($topic_id) || $topic_info['t_cache_num_posts'] < 500) ? $GLOBALS['FORUM_DB']->query_value_if_there('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts WHERE ' . $where) : $topic_info['t_cache_num_posts']/*for performance reasons*/;\n }\n $posts = array();\n // Precache member/group details in one fell swoop\n $members = array();\n foreach ($_postdetailss as $_postdetails) {\n $members[$_postdetails['p_poster']] = 1;\n if ($out['title'] == '') {\n $out['title'] = $_postdetails['p_title'];\n }\n }\n cns_cache_member_details(array_keys($members));\n\n $i = 0;\n foreach ($_postdetailss as $_postdetails) {\n $_postdetails['message_comcode'] = get_translated_text($_postdetails['p_post'], $GLOBALS['FORUM_DB']);\n\n $linked_type = '';\n $linked_id = '';\n $linked_url = '';\n\n // If it's a spacer post, see if we can detect it better\n list($is_spacer_post, $spacer_post_lang) = is_spacer_post($_postdetails['message_comcode']);\n if ($is_spacer_post) {\n $c_prefix = do_lang('COMMENT', null, null, null, $spacer_post_lang) . ': #';\n if ((substr($out['description'], 0, strlen($c_prefix)) == $c_prefix) && ($out['description_link'] != '')) {\n list($linked_type, $linked_id) = explode('_', substr($out['description'], strlen($c_prefix)), 2);\n $linked_url = $out['description_link'];\n $out['description'] = '';\n }\n }\n\n // Load post\n $post_row = db_map_restrict($_postdetails, array('id', 'p_post'));\n $_postdetails['message'] = get_translated_tempcode('f_posts', $post_row, 'p_post', $GLOBALS['FORUM_DB']);\n\n // Fake a quoted post? (kind of a nice 'tidy up' feature if a forum's threading has been turned off, leaving things for flat display)\n if ((!is_null($_postdetails['p_parent_id'])) && (strpos($_postdetails['message_comcode'], '[quote') === false)) {\n $p = mixed(); // null\n if (array_key_exists($_postdetails['p_parent_id'], $_postdetailss)) { // Ah, we're already loading it on this page\n $p = $_postdetailss[$_postdetails['p_parent_id']];\n\n // Load post\n $_p = db_map_restrict($p, array('id', 'p_post'));\n $p['message'] = get_translated_tempcode('f_posts', $_p, 'p_post', $GLOBALS['FORUM_DB']);\n } else { // Drat, we need to load it\n $_p = $GLOBALS['FORUM_DB']->query_select('f_posts', array('*'), array('id' => $_postdetails['p_parent_id']), '', 1);\n if (array_key_exists(0, $_p)) {\n $p = db_map_restrict($_p[0], array('id', 'p_post'));\n $p['message'] = get_translated_tempcode('f_posts', $p, 'p_post', $GLOBALS['FORUM_DB']);\n }\n }\n $temp = $_postdetails['message'];\n $_postdetails['message'] = new Tempcode();\n $_postdetails['message'] = do_template('COMCODE_QUOTE_BY', array('_GUID' => '4521bfe295b1834460f498df488ee7cb', 'SAIDLESS' => false, 'BY' => $p['p_poster_name_if_guest'], 'CONTENT' => $p['message']));\n $_postdetails['message']->attach($temp);\n }\n\n // Spacer posts may have a better first post put in place\n if ($is_spacer_post) {\n require_code('cns_posts');\n list($new_description, $new_post) = cns_display_spacer_post($linked_type, $linked_id);\n //if (!is_null($new_description)) $out['description']=$new_description; Actually, it's a bit redundant\n if (!is_null($new_post)) {\n $_postdetails['message'] = $new_post;\n }\n\n $is_ticket = false;\n if (addon_installed('tickets')) {\n require_code('tickets');\n if (is_ticket_forum($forum_id)) {\n $is_ticket = true;\n }\n }\n if ($is_ticket) {\n require_lang('tickets');\n require_code('feedback');\n $ticket_id = extract_topic_identifier($out['description']);\n $ticket_type_id = $GLOBALS['SITE_DB']->query_select_value_if_there('tickets', 'ticket_type', array('ticket_id' => $ticket_id));\n $ticket_type_name = mixed();\n if (!is_null($ticket_type_id)) {\n $ticket_type_name = $GLOBALS['SITE_DB']->query_select_value_if_there('ticket_types', 'ticket_type_name', array('id' => $ticket_id));\n }\n $out['title'] = do_lang_tempcode('_VIEW_SUPPORT_TICKET', escape_html($out['title']), is_null($ticket_type_name) ? do_lang('UNKNOWN') : escape_html(get_translated_text($ticket_type_name)));\n $_postdetails['p_title'] = '';\n } else {\n $out['title'] = protect_from_escaping(do_lang('SPACER_TOPIC_TITLE_WRAP', escape_html($out['title']), '', '', $spacer_post_lang));\n $_postdetails['p_title'] = do_lang('SPACER_TOPIC_TITLE_WRAP', $_postdetails['p_title'], '', '', $spacer_post_lang);\n }\n }\n\n // Put together\n $collated_post_details = cns_get_details_to_show_post($_postdetails, $topic_info, ($start == 0) && (count($_postdetailss) == 1));\n $collated_post_details['is_spacer_post'] = $is_spacer_post;\n $posts[] = $collated_post_details;\n\n $i++;\n }\n\n $out['posts'] = $posts;\n }\n\n // Any special topic/for-any-post-in-topic controls?\n if (!is_null($topic_id)) {\n $out['last_poster'] = $topic_info['t_cache_last_member_id'];\n $out['last_post_id'] = $topic_info['t_cache_last_post_id'];\n if (cns_may_post_in_topic($forum_id, $topic_id, $topic_info['t_cache_last_member_id'], $topic_info['t_is_open'] == 0)) {\n $out['may_reply'] = true;\n }\n if (cns_may_post_in_topic($forum_id, $topic_id, $topic_info['t_cache_last_member_id'], $topic_info['t_is_open'] == 0, null, true)) {\n $out['may_reply_private_post'] = true;\n }\n if (cns_may_report_post()) {\n $out['may_report_posts'] = true;\n }\n if (cns_may_make_private_topic()) {\n $out['may_pt_members'] = true;\n }\n if (cns_may_edit_topics_by($forum_id, get_member(), $topic_info['t_cache_first_member_id'])) {\n $out['may_edit_topic'] = true;\n }\n require_code('cns_moderation');\n require_code('cns_forums');\n if (cns_may_warn_members()) {\n $out['may_warn_members'] = true;\n }\n if (cns_may_delete_topics_by($forum_id, get_member(), $topic_info['t_cache_first_member_id'])) {\n $out['may_delete_topic'] = true;\n }\n if (cns_may_perform_multi_moderation($forum_id)) {\n $out['may_multi_moderate'] = true;\n }\n if (has_privilege(get_member(), 'use_quick_reply')) {\n $out['may_use_quick_reply'] = true;\n }\n $may_moderate_forum = cns_may_moderate_forum($forum_id);\n if ($may_moderate_forum) {\n if ($topic_info['t_is_open'] == 0) {\n $out['may_open_topic'] = true;\n } else {\n $out['may_close_topic'] = true;\n }\n if ($topic_info['t_pinned'] == 0) {\n $out['may_pin_topic'] = true;\n } else {\n $out['may_unpin_topic'] = true;\n }\n if ($topic_info['t_sunk'] == 0) {\n $out['may_sink_topic'] = true;\n } else {\n $out['may_unsink_topic'] = true;\n }\n if ($topic_info['t_cascading'] == 0) {\n $out['may_cascade_topic'] = true;\n } else {\n $out['may_uncascade_topic'] = true;\n }\n $out['may_move_topic'] = true;\n $out['may_move_posts'] = true;\n $out['may_delete_posts'] = true;\n $out['may_validate_posts'] = true;\n $out['may_make_private'] = true;\n $out['may_change_max'] = true;\n } else {\n if (($topic_info['t_cache_first_member_id'] == get_member()) && (has_privilege(get_member(), 'close_own_topics')) && ($topic_info['t_is_open'] == 1)) {\n $out['may_close_topic'] = true;\n }\n }\n if (!is_null($topic_info['t_poll_id'])) {\n require_code('cns_polls');\n\n if (cns_may_edit_poll_by($forum_id, $topic_info['t_cache_first_member_id'])) {\n $out['may_edit_poll'] = true;\n }\n if (cns_may_delete_poll_by($forum_id, $topic_info['t_cache_first_member_id'])) {\n $out['may_delete_poll'] = true;\n }\n } else {\n require_code('cns_polls');\n\n if (cns_may_attach_poll($topic_id, $topic_info['t_cache_first_member_id'], !is_null($topic_info['t_poll_id']), $forum_id)) {\n $out['may_attach_poll'] = true;\n }\n }\n } else {\n $out['last_poster'] = null;\n $out['last_post_id'] = null;\n }\n\n return $out;\n}", "public function testChannelsSetTopic()\n {\n }", "function target_add_topic_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread_notify (user_id, thread_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['topic_id'] .')');\n}", "public function isTopicsLoaded()\n {\n return null !== $this->collTopics;\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 }", "public function isUniqueTopic($topic){\n if(Topic::find($topic['email_id']) === null){\n return true;\n }\n return false;\n }", "public function clearTopics()\n {\n $this->collTopics = null; // important to set this to NULL since that means it is uninitialized\n }", "function parse_json_topics($topics, $isUpdate) {\n\t$failures = array();//contains nodes that could not be created because of missing parent.\n\t$keys = array_keys($topics);\n\t$newEntries = array();\n\t$updates = array();\n\t//process each node in turn\n\tfor ($k = 0; $k < count($keys); $k++) {\n\t\t$key = $keys[$k];\n\t\techo '<br/>importing ' . $k;\n\t\t$resourceSlug = substr(strrchr(remove_last_slash($key),\"/\"),1);\n\t\techo '<br/>slug ' . $resourceSlug;\n\t\t$title = $topics[$key][\"http://www.w3.org/2004/02/skos/core#prefLabel\"][0][\"value\"];\n\t\tif ($k == 0)\n\t\t\t$title = $topics[$key][\"http://purl.org/dc/elements/1.1/title\"][0][\"value\"];\n\t\techo '<br/>title ' . $title . '<br/>';\n\t\t$parentUri = remove_last_slash($topics[$key][\"http://www.w3.org/2004/02/skos/core#broader\"][0][\"value\"]);\n\t\t$parent = 0;\n\t\t//If the uploaded document specifies a parent for this node...\n\t\tif ($parentUri != null) {\n\t\t\t$parentSlug = substr(strrchr($parentUri,\"/\"),1);\n\t\t\techo '<br/>parentSlug ' . $parentSlug;\n\t\t\t$term = get_term_by( \"slug\", $parentSlug, \"asn_topic_index\");\n\t\t\t//if the parent is found in the taxonomy, set the parent. Otherwise record this as a failed entry\n\t\t\tif ($term !== false) {\n\t\t\t\t$parent = (int)$term->term_id;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$failures[] = $k;\n\t\t\t}\t\n\t\t}\n\t\t//If this node is not a failed entry...\n\t\tif (array_search($k,$failures) === false) {\n\t\t\t//insert the node if it does not already exist. Otherwise, update the existing node with the values in the document\n\t\t\tif (!check_existing_standards($resourceSlug, false)) {\n\t\t\t\t$cid = wp_insert_term(\n\t\t\t\t\t$title,\n\t\t\t\t\t\"asn_topic_index\",\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'description' => $title,\n\t\t\t\t\t\t'slug' => $resourceSlug,\n\t\t\t\t\t\t'parent' => $parent\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif (is_wp_error( $cid ) )\n\t\t\t\t{\n\t\t\t\t\techo \" error: \" . $cid->get_error_message();\n\t\t\t\t\tif (strlen($title) > 200) {\n\t\t\t\t\t\t$name = substr($title, 0, 200);\n\t\t\t\t\t\twp_insert_term(\n\t\t\t\t\t\t\t$name,\n\t\t\t\t\t\t\t\"asn_topic_index\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'description' => $title,\n\t\t\t\t\t\t\t\t'slug' => $resourceSlug,\n\t\t\t\t\t\t\t\t'parent' => $parent\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\techo $resourceSlug . \" name had to be shortened!\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($isUpdate) {\n\t\t\t\t\t$newEntries[] = array(\"Name\" => $title, \"Id\" => $resourceSlug, \"Parent\" => $parent);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$term = get_term_by( \"slug\", $resourceSlug, \"asn_topic_index\");\n\t\t\t\t$termUpdate = 0;\n\t\t\t\tif (html_entity_decode(substr($term->name, 0, 200)) != html_entity_decode($substr($title, 0, 200))) {\n\t\t\t\t\t$termUpdate++;\n\t\t\t\t\twp_update_term($term->term_id, 'asn_topic_index', array('name' => $substr($title, 0, 200)));\n\t\t\t\t}\n\t\t\t\tif (html_entity_decode($term->description) != html_entity_decode($description) && $title != html_entity_decode($title)) {\n\t\t\t\t\t$termUpdate++;\n\t\t\t\t\twp_update_term($term->term_id, 'asn_topic_index', array('description' => $title));\n\t\t\t\t}\n\t\t\t\tif (html_entity_decode($term->parent) != html_entity_decode($parent)) {\n\t\t\t\t\t$termUpdate++;\n\t\t\t\t\twp_update_term($term->term_id, 'asn_topic_index', array('parent' => $parent));\n\t\t\t\t}\n\t\t\t\tif ($termUpdate > 0)\n\t\t\t\t\t$updates[] = array(\"id\" => $resourceSlug, \"name\" => $title);\n\t\t\t}\n\t\t}\n\t}\n\t//Notify the uploader of any modifications and any failed nodes\n\tif ($isUpdate && count($newEntries) > 0 || count($updates) > 0)\n\t\tnotify_modifications($newEntries, $updates);\n\tif (count($failures) > 0) {\n\t\techo \"failures:\";\n\t\tprint_r($failures);\t\n\t}\n\t\n}", "public function getTopic();", "public function getTopic();", "function target_add_topic($topic)\n{\n\t// if ($GLOBALS['VERBOSE']) pf('...'. $topic['id']);\n\n\tif (!isset($topic['orderexpiry'])) {\n\t\t$topic['orderexpiry'] = 0;\n\t}\n\n\t// Set orderexpiry for announcement and sticky topics.\n\tif (($topic['thread_opt'] & 2) || ($topic['thread_opt'] & 4)) {\n\t\t$topic['orderexpiry'] = 1000000000;\n\t}\n\n\t// Skip topics that doesn't belong to a forum.\n\tif (!isset($GLOBALS['forum_map'][ (int)$topic['forum_id'] ])) {\n\t\tpf('WARNING: Skip topic #'. $topic['id'] .'. Probably an announcement or orphaned message!');\n\t\treturn;\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread (\n\t\tid, forum_id, root_msg_id, views, replies, thread_opt, orderexpiry\n\t\t) VALUES(\n\t\t\t'. (int)$topic['id'] .',\n\t\t\t'. $GLOBALS['forum_map'][ (int)$topic['forum_id'] ] .',\n\t\t\t'. (int)$topic['root_msg_id'] .',\n\t\t\t'. (int)$topic['views'] .',\n\t\t\t'. (int)$topic['replies'] .',\n\t\t\t'. (int)$topic['thread_opt'] .',\n\t\t\t'. (int)$topic['orderexpiry'] .')\n\t');\n}", "protected function getFeed_TopicsActiveService()\n {\n return new \\phpbb\\feed\\topics_active(${($_ = isset($this->services['feed.helper']) ? $this->services['feed.helper'] : $this->getFeed_HelperService()) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && 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 ?: '_'}, ${($_ = isset($this->services['content.visibility']) ? $this->services['content.visibility'] : $this->getContent_VisibilityService()) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, 'php');\n }", "public function is_topic_allowed($topic) {\n\t\treturn in_array($topic->term_id, $this->get_allowed_topic_ids_for_user()) || apply_filters('minerva_restrict_access_allowed', false);\n\t}", "public function supportsTopicHierarchy() {\n \treturn $this->manager->supportsTopicHierarchy();\n\t}", "public function supportsTopicNotification() {\n \treturn $this->manager->supportsTopicNotification();\n\t}", "public function supportsTopicCatalog() {\n \treturn $this->manager->supportsTopicCatalog();\n\t}", "public function testTopic() {\n\n $this->installEntitySchema('ebms_board');\n $this->installEntitySchema('taxonomy_term');\n $this->installEntitySchema('ebms_topic');\n $this->installEntitySchema('user');\n $this->installSchema('system', ['sequences']);\n $entity_type_manager = $this->container->get('entity_type.manager');\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertEmpty($topics);\n $name = 'Toenail Cancer';\n $board = Board::create(['name' => 'Test Board']);\n $board->save();\n $group_id = 135;\n $group_name = 'Lower Extremities';\n $topic_group = Term::create([\n 'tid' => $group_id,\n 'vid' => 'topic_groups',\n 'name' => $group_name,\n ]);\n $topic_group->save();\n $nci_reviewer = $this->createUser();\n $topic = Topic::create([\n 'name' => $name,\n 'board' => $board->id(),\n 'nci_reviewer' => $nci_reviewer,\n 'topic_group' => $topic_group->id(),\n 'active' => TRUE,\n ]);\n $topic->save();\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertNotEmpty($topics);\n $this->assertCount(1, $topics);\n foreach ($topics as $topic) {\n $this->assertEquals($topic->getName(), $name);\n $this->assertEquals(TRUE, $topic->get('active')->value);\n $this->assertEquals($board->id(), $topic->get('board')->target_id);\n $this->assertEquals($nci_reviewer->id(), $topic->get('nci_reviewer')->target_id);\n $this->assertEquals($group_id, $topic->get('topic_group')->target_id);\n }\n }", "function sf_clean_topic_subs()\n{\n\tglobal $wpdb;\n\n\t# build list of topics with subscriptions\n\t$topics = $wpdb->get_results(\"SELECT topic_id, topic_subs FROM \".SFTOPICS.\" WHERE topic_subs IS NOT NULL;\");\n\tif(!$topics) return;\n\n\tforeach($topics as $topic)\n\t{\n\t\t$nvalues = array();\n\t\t$cvalues = explode('@', $topic->topic_subs);\n\t\t$nvalues[0] = $cvalues[0];\n\t\tforeach($cvalues as $cvalue)\n\t\t{\n\t\t\t$notfound = true;\n\t\t\tforeach($nvalues as $nvalue)\n\t\t\t{\n\t\t\t\tif($nvalue == $cvalue) $notfound = false;\n\t\t\t}\n\t\t\tif($notfound) $nvalues[]=$cvalue;\n\t\t}\n\t\t$nvaluelist = implode('@', $nvalues);\n\t\t$wpdb->query(\"UPDATE \".SFTOPICS.\" SET topic_subs='\".$nvaluelist.\"' WHERE topic_id=\".$topic->topic_id);\n\t}\n\treturn;\n}", "function suggesttopic($topicid, $title, $email = \"\", $description = \"\"){\r\n\tglobal $db, $dbprefix, $phrase;\r\n\t\r\n\t$topicid = intval($topicid);\r\n\tif ($title == \"\"){ return $phrase[\"submit_notitle\"]; }\r\n\t\r\n\t// check the topic exists\r\n\t$sql = \"SELECT * FROM \" . $dbprefix . \"topics WHERE topicid = \" . dbSecure($topicid);\r\n\t$top = $db->execute($sql);\r\n\tif ($top->rows < 1){ return $phrase[\"submit_missingtopic\"]; }\r\n\t\r\n\t// check for an existing sub-topic\r\n\t$sql = \"SELECT * FROM \" . $dbprefix . \"topics WHERE parent = \" . dbSecure($topicid) . \" AND title = '\" . dbSecure($title) . \"'\";\r\n\t$chk = $db->execute($sql);\r\n\tif ($chk->rows > 0){ return $phrase[\"submit_topicexists\"]; }\r\n\t\r\n\t// and insert the topic\r\n\t$sql = \"INSERT INTO \" . $dbprefix . \"newtopics (topicid, postdate, title, email, description, ip) VALUES (\";\r\n\t$sql .= \"\" . dbSecure($topicid) . \", \";\r\n\t$sql .= \"\" . time() . \", \";\r\n\t$sql .= \"'\" . dbSecure($title) . \"', \";\r\n\t$sql .= \"'\" . dbSecure($email) . \"', \";\r\n\t$sql .= \"'\" . dbSecure($description) . \"', \";\r\n\t$sql .= \"'\" . dbSecure($_SERVER[\"REMOTE_ADDR\"]) . \"')\";\r\n\t$db->execute($sql);\r\n\t\r\n\t// and return\r\n\treturn $phrase[\"submit_topic_success\"];\r\n}", "function cns_get_private_topics($start = 0, $true_start = 0, $max = null, $sql_sup = '', $sql_sup_order_by = '', $member_id = null)\n{\n if (is_null($max)) {\n $max = intval(get_option('forum_topics_per_page'));\n }\n\n if (is_null($member_id)) {\n $member_id = get_member();\n } else {\n if ((!has_privilege(get_member(), 'view_other_pt')) && ($member_id != get_member())) {\n access_denied('PRIVILEGE', 'view_other_pt');\n }\n }\n\n // Find topics\n $where = '(t_pt_from=' . strval($member_id) . ' OR t_pt_to=' . strval($member_id) . ') AND t_forum_id IS NULL';\n $filter = get_param_string('category', '');\n $where .= ' AND (' . db_string_equal_to('t_pt_from_category', $filter) . ' AND t_pt_from=' . strval($member_id) . ' OR ' . db_string_equal_to('t_pt_to_category', $filter) . ' AND t_pt_to=' . strval($member_id) . ')';\n $query = 'FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_topics t';\n if (!multi_lang_content()) {\n $query .= ' LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p ON p.id=t.t_cache_first_post_id';\n }\n $query .= ' WHERE ' . $where;\n $max_rows = 0;\n $union = '';\n $select = 'SELECT t.*';\n if (multi_lang_content()) {\n $select .= ',t_cache_first_post AS p_post';\n } else {\n $select .= ',p_post,p_post__text_parsed,p_post__source_user';\n }\n if ($filter == do_lang('INVITED_TO_PTS')) {\n $or_list = '';\n $s_rows = $GLOBALS['FORUM_DB']->query_select('f_special_pt_access', array('s_topic_id'), array('s_member_id' => get_member()));\n foreach ($s_rows as $s_row) {\n if ($or_list != '') {\n $or_list .= ' OR ';\n }\n $or_list .= 't.id=' . strval($s_row['s_topic_id']);\n }\n if ($or_list != '') {\n $query2 = 'FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_topics t';\n if (!multi_lang_content()) {\n $query2 .= ' LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts p ON p.id=t.t_cache_first_post_id';\n }\n $query2 .= ' WHERE ' . $or_list;\n $union = ' UNION ' . $select . ' ' . $query2;\n $max_rows += $GLOBALS['FORUM_DB']->query_value_if_there('SELECT COUNT(*) ' . $query2, false, true);\n }\n }\n $query_full = $select;\n $query_full .= ' ' . $query . $union . $sql_sup . $sql_sup_order_by;\n $topic_rows = $GLOBALS['FORUM_DB']->query($query_full, $max, $start, false, true);\n $max_rows += $GLOBALS['FORUM_DB']->query_value_if_there('SELECT COUNT(*) ' . $query);\n $topics = array();\n $hot_topic_definition = intval(get_option('hot_topic_definition'));\n foreach ($topic_rows as $topic_row) {\n $topic = array();\n $topic['id'] = $topic_row['id'];\n $topic['num_views'] = $topic_row['t_num_views'];\n $topic['num_posts'] = $topic_row['t_cache_num_posts'];\n $topic['first_time'] = $topic_row['t_cache_first_time'];\n $topic['first_title'] = $topic_row['t_cache_first_title'];\n if (is_null($topic_row['p_post'])) {\n $topic['first_post'] = new Tempcode();\n } else {\n $post_row = db_map_restrict($topic_row, array('id', 'p_post'), array('id' => 't_cache_first_post_id'));\n $topic['first_post'] = get_translated_tempcode('f_posts', $post_row, 'p_post', $GLOBALS['FORUM_DB']);\n }\n $topic['first_post']->singular_bind('ATTACHMENT_DOWNLOADS', make_string_tempcode('?'));\n $topic['first_username'] = $topic_row['t_cache_first_username'];\n $topic['first_member_id'] = $topic_row['t_cache_first_member_id'];\n $topic['last_post_id'] = $topic_row['t_cache_last_post_id'];\n $topic['last_time'] = $topic_row['t_cache_last_time'];\n $topic['last_time_string'] = is_null($topic_row['t_cache_last_time']) ? '' : get_timezoned_date($topic_row['t_cache_last_time']);\n $topic['last_title'] = $topic_row['t_cache_last_title'];\n $topic['last_username'] = $topic_row['t_cache_last_username'];\n $topic['last_member_id'] = $topic_row['t_cache_last_member_id'];\n $topic['emoticon'] = $topic_row['t_emoticon'];\n $topic['description'] = $topic_row['t_description'];\n $topic['pt_from'] = $topic_row['t_pt_from'];\n $topic['pt_to'] = $topic_row['t_pt_to'];\n\n // Modifiers\n $topic['modifiers'] = array();\n $has_read = cns_has_read_topic($topic['id'], $topic_row['t_cache_last_time'], $member_id);\n if (!$has_read) {\n $topic['modifiers'][] = 'unread';\n }\n if ($topic_row['t_pinned'] == 1) {\n $topic['modifiers'][] = 'pinned';\n }\n if ($topic_row['t_sunk'] == 1) {\n $topic['modifiers'][] = 'sunk';\n }\n if ($topic_row['t_is_open'] == 0) {\n $topic['modifiers'][] = 'closed';\n }\n if (!is_null($topic_row['t_poll_id'])) {\n $topic['modifiers'][] = 'poll';\n }\n $num_posts = $topic_row['t_cache_num_posts'];\n $start_time = $topic_row['t_cache_first_time'];\n $end_time = $topic_row['t_cache_last_time'];\n $days = floatval($end_time - $start_time) / 60.0 / 60.0 / 24.0;\n if ($days == 0.0) {\n $days = 1.0;\n }\n if (intval(round($num_posts / $days)) >= $hot_topic_definition) {\n $topic['modifiers'][] = 'hot';\n }\n\n $topics[] = $topic;\n }\n\n $out = array('topics' => $topics, 'max_rows' => $max_rows);\n\n if ((has_privilege($member_id, 'moderate_private_topic')) && (($member_id == get_member()) || (has_privilege($member_id, 'multi_delete_topics')))) {\n $out['may_move_topics'] = 1;\n $out['may_delete_topics'] = 1;\n $out['may_change_max'] = 1;\n }\n if (cns_may_make_private_topic()) {\n $out['may_post_topic'] = 1;\n }\n\n return $out;\n}", "function MaintainTopics()\n{\n\tglobal $context, $txt;\n\n\t// Let's load up the boards in case they are useful.\n\t$result = wesql::query('\n\t\tSELECT b.id_board, b.name, b.child_level, c.name AS cat_name, c.id_cat\n\t\tFROM {db_prefix}boards AS b\n\t\t\tLEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)\n\t\tWHERE {query_see_board}\n\t\t\tAND redirect = {string:empty}\n\t\tORDER BY b.board_order',\n\t\tarray(\n\t\t\t'empty' => '',\n\t\t)\n\t);\n\t$context['categories'] = array();\n\twhile ($row = wesql::fetch_assoc($result))\n\t{\n\t\tif (!isset($context['categories'][$row['id_cat']]))\n\t\t\t$context['categories'][$row['id_cat']] = array(\n\t\t\t\t'name' => $row['cat_name'],\n\t\t\t\t'boards' => array()\n\t\t\t);\n\n\t\t$context['categories'][$row['id_cat']]['boards'][] = array(\n\t\t\t'id' => $row['id_board'],\n\t\t\t'name' => $row['name'],\n\t\t\t'child_level' => $row['child_level']\n\t\t);\n\t}\n\twesql::free_result($result);\n\n\tif (isset($_GET['done']) && $_GET['done'] == 'purgeold')\n\t\t$context['maintenance_finished'] = $txt['maintain_old'];\n\telseif (isset($_GET['done']) && $_GET['done'] == 'massmove')\n\t\t$context['maintenance_finished'] = $txt['move_topics_maintenance'];\n}", "public function supportsTopicCatalogAssignment() {\n \treturn $this->manager->supportsTopicCatalogAssignment();\n\t}", "public function thisTopicWasAlreadyExisted():bool\n {\n \t$column = $this->topic->getColumn();\n\t\t$tableName = $this->topic->getTableName();\n\t\t$columIdSubCat = 'id_sub_category';\n\n\t\t$is_exist = (int)(new Requestor())->getContentWith2Where('id', 'f_topics', 'content', $this->topic->getContent(), 'id_sub_category', $this->topic->getIdSubCategory());\n\n\t\tif ($is_exist > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n }", "function array_filter_clean_read_topics ( $var )\n\t{\n\t\tglobal $ipsclass;\n\t\t\n\t\treturn $var > $ipsclass->vars['db_topic_read_cutoff'];\n\t}", "protected function getFeed_TopicsService()\n {\n return new \\phpbb\\feed\\topics(${($_ = isset($this->services['feed.helper']) ? $this->services['feed.helper'] : $this->getFeed_HelperService()) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && 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 ?: '_'}, ${($_ = isset($this->services['content.visibility']) ? $this->services['content.visibility'] : $this->getContent_VisibilityService()) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, 'php');\n }", "public function setTopic($topic);", "public function getTopics()\n {\n return [\n 'topicName' => 1\n ];\n }", "public function initTopics()\n {\n $collectionClassName = BiblioTopicTableMap::getTableMap()->getCollectionClassName();\n\n $this->collTopics = new $collectionClassName;\n $this->collTopicsPartial = true;\n $this->collTopics->setModel('\\Slims\\Models\\Masterfile\\Topic\\Topic');\n }", "protected function buildCleanedTopicList($topics = array())\n {\n\n // generate valid subscription list\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n /** @var \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage $topicList */\n $topicList = $objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage');\n\n // check if given topics exists and set them to subscription\n foreach ($topics as $topicId) {\n\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\Topic $topic */\n if ($topic = $this->topicRepository->findByUid($topicId)) {\n $topicList->attach($topic);\n }\n }\n\n return $topicList;\n //===\n }", "public function firstTopic() {\n\t\treturn $this->topics()->first();\n\t}", "public function no_items() {\n\n\t\t\t_e( 'No items avaliable.', 'js_topic_manager' );\n\n\t\t}", "function &getTopics() {\n\t\treturn $this->topics;\n\t}", "public function supportsTopicHierarchySequencing() {\n \treturn $this->manager->supportsTopicHierarchySequencing();\n\t}", "function bbps_is_topic_move_enabled(){\n\treturn get_option( '_bbps_enable_topic_move' );\n}", "function webnotik_register_topics_settings() {\n\tregister_setting( 'webnotik-topics-group', 'webnotik_main_topics' );\n}", "public function ambassade_single_topic(&$event) {\n global $user;\n // IF IS AMBASSADE\n if($event[\"row\"][\"forum_id\"] == 29 && !$this->topic_ambassade_set_up) {\n $guild = new \\scfr\\main\\ambassade\\Guild($this->db);\n $first_reply = $event[\"topic_data\"][\"topic_first_post_id\"];\n $guild->__topic_init($event[\"row\"][\"topic_id\"]);\n\n //var_dump();\n\n $templates[\"GUILD_JSON\"] = json_encode(false);\n if($guild->is_registerd) {\n $templates[\"TOPIC_IS_REGISTERED_GUILD\"] = true;\n foreach($guild->RSI as $name => $val)\n $templates[\"GUILD_\".strtoupper($name)] = $val;\n\n $templates[\"GUILD_JSON\"] = json_encode($guild->RSI);\n }\n\n\n if($templates['GUILD_BACKGROUND']) $templates['CUSTOM_BACKGROUND'] = $templates['GUILD_BACKGROUND'];\n\n\n $templates[\"TOPIC_IS_GUILD\"] = true;\n $templates[\"GUILD_TOPIC_ID\"] = $event[\"topic_data\"][\"topic_id\"];\n\n $templates[\"S_REQUIRE_ANGULAR\"] = true;\n $this->template->assign_vars($templates);\n $this->topic_set_up = true;\n }\n }", "public function updateTopicList() {\n // Start by fetching the existing list, so we can remove items not found\n // at the end.\n $old_list = $this->database->select('help_search_items', 'hsi')\n ->fields('hsi', ['sid', 'topic_id', 'section_plugin_id', 'permission'])\n ->execute();\n $old_list_ordered = [];\n $sids_to_remove = [];\n foreach ($old_list as $item) {\n $old_list_ordered[$item->section_plugin_id][$item->topic_id] = $item;\n $sids_to_remove[$item->sid] = $item->sid;\n }\n\n $section_plugins = $this->helpSectionManager->getDefinitions();\n foreach ($section_plugins as $section_plugin_id => $section_plugin_definition) {\n $plugin = $this->getSectionPlugin($section_plugin_id);\n if (!$plugin) {\n continue;\n }\n $permission = $section_plugin_definition['permission'] ?? '';\n foreach ($plugin->listSearchableTopics() as $topic_id) {\n if (isset($old_list_ordered[$section_plugin_id][$topic_id])) {\n $old_item = $old_list_ordered[$section_plugin_id][$topic_id];\n if ($old_item->permission == $permission) {\n // Record has not changed.\n unset($sids_to_remove[$old_item->sid]);\n continue;\n }\n\n // Permission has changed, update record.\n $this->database->update('help_search_items')\n ->condition('sid', $old_item->sid)\n ->fields(['permission' => $permission])\n ->execute();\n unset($sids_to_remove[$old_item->sid]);\n continue;\n }\n\n // New record, create it.\n $this->database->insert('help_search_items')\n ->fields([\n 'section_plugin_id' => $section_plugin_id,\n 'permission' => $permission,\n 'topic_id' => $topic_id,\n ])\n ->execute();\n }\n }\n\n // Remove remaining items from the index.\n $this->removeItemsFromIndex($sids_to_remove);\n }", "public function declareTopic(string $topic): void;", "function add_topic($array, $redirect_to_topic = false) {\n global $db;\n if ($array == NULL)\n $array = $_POST;\n\n if (is_array($_FILES))\n $array = array_merge($array, $_FILES);\n\n $fields = $this->load_add_topic_form_fields($array);\n validate_cb_form($fields, $array);\n\n $user = userid();\n\n $gp_details = $this->get_group_details($array['group_id']);\n\n\n //Checking for weather user is allowed to post topics or not\n if (!$this->validate_posting_previlige($gp_details))\n return false;\n\n if (!error()) {\n foreach ($fields as $field) {\n $name = formObj::rmBrackets($field['name']);\n $val = $array[$name];\n\n if ($field['use_func_val'])\n $val = $field['validate_function']($val);\n\n\n if (!empty($field['db_field']))\n $query_field[] = $field['db_field'];\n\n if (is_array($val)) {\n $new_val = '';\n foreach ($val as $v) {\n $new_val .= \"#\" . $v . \"# \";\n }\n $val = $new_val;\n }\n\n if (!$field['clean_func'] || (!apply_func($field['clean_func'], $val) && !is_array($field['clean_func'])))\n $val = $val;\n else\n $val = apply_func($field['clean_func'], sql_free($val));\n\n if (empty($val) && !empty($field['default_value']))\n $val = $field['default_value'];\n\n if (!empty($field['db_field']))\n $query_val[] = $val;\n }\n }\n\n\n\n if (!error()) {\n //Adding Topic icon\n $query_field[] = \"topic_icon\";\n $query_val[] = $array['topic_icon'];\n //UID\n $query_field[] = \"userid\";\n $query_val[] = $user;\n //DATE ADDED\n $query_field[] = \"date_added\";\n $query_val[] = now();\n\n $query_field[] = \"last_post_time\";\n $query_val[] = now();\n\n //GID\n $query_field[] = \"group_id\";\n $query_val[] = $array['group_id'];\n\n //Checking If posting requires approval or not\n $query_field[] = \"approved\";\n if ($gp_details['post_type'] == 1)\n $query_val[] = \"no\";\n else\n $query_val[] = \"yes\";\n\n //Inserting IN Database now\n $db->insert(tbl($this->gp_topic_tbl), $query_field, $query_val);\n $insert_id = $db->insert_id();\n\n //Increasing Group Topic Counts\n $count_topics = $this->count_group_topics($array['group_id']);\n $db->update(tbl($this->gp_tbl), array(\"total_topics\"), array($count_topics), \" group_id='\" . $array['group_id'] . \"'\");\n\n //leaving msg\n e(lang(\"grp_tpc_msg\"), \"m\");\n\n //Redirecting to topic\n if ($redirect_to_topic) {\n $grp_details = $this->get_details($insert_id);\n redirect_to(group_link($grp_details));\n }\n\n return $insert_id;\n }\n }", "public function isSubscribed(string $url, string $topic): ?bool\n {\n $topicResult = Topic::where('name', $topic)->first();\n if ($topicResult) {\n $result = $this->query()->where('topic_id', $topicResult->id)->where('url', $url)->exists();\n\n return $result;\n }\n return null;\n }", "function topicExists(){\n\t $query = \"SELECT * FROM \" . $this->table_name . \" WHERE name = ? LIMIT 0,1\";\n\t $stmt = $this->conn->prepare( $query );\n\t $stmt->bindParam(1, $this->name);\n\t $stmt->execute();\n\t $num = $stmt->rowCount();\n\t if($num>0){\n\t \treturn true;\n\t }\n\t return false;\n\t}", "function addTopic(&$topic) {\n\t\t$this->topics[] = $topic;\n\t}", "public function topics()\n {\n return $this->hasMany(Topic::class)->whereNull('topic_id');\n }", "public function __construct(Topic $topic)\n {\n $this->topic = $topic;\n }", "public function getTopic()\n {\n return $this->_topic;\n }", "function run_tool(&$error)\n\t{\n\t\tglobal $db, $lang;\n\n\t\tif (!check_form_key('synchronization_topic_posts'))\n\t\t{\n\t\t\t$error[] = 'FORM_INVALID';\n\t\t\treturn;\n\t\t}\n\t\t$topic_ids = request_var('topics', array(0 => 0));\n\t\tif (!sizeof($topic_ids))\n\t\t{\n\t\t\ttrigger_error($lang['NO_TOPICS_SELECTED'], E_USER_WARNING);\n\t\t}\n\t\tforeach($topic_ids as $topic_id)\n\t\t{\n\t\t\t$sql = 'SELECT post_id, topic_id, post_time, poster_id, post_username, post_subject, post_visibility, post_delete_time, username, user_colour, user_posts,\n\t\t\t(SELECT COUNT(post_id) FROM ' . POSTS_TABLE . ' WHERE poster_id = u.user_id) AS really_user_posts,\n\t\t\t(SELECT COUNT(post_id) FROM ' . POSTS_TABLE . ' WHERE topic_id = p.topic_id AND post_visibility = 1) AS really_posts_approved,\n\t\t\t(SELECT COUNT(post_id) FROM ' . POSTS_TABLE . ' WHERE topic_id = p.topic_id AND post_visibility = 0 AND post_delete_time = 0) AS really_posts_unapproved,\n\t\t\t(SELECT COUNT(post_id) FROM ' . POSTS_TABLE . ' WHERE topic_id = p.topic_id AND post_delete_time<>0) AS really_posts_softdeleted\n\t\t\t\tFROM ' . POSTS_TABLE . ' p JOIN ' . USERS_TABLE . ' u ON p.poster_id = u.user_id\n\t\t\t\t\tWHERE topic_id=' . (int) $topic_id . '\n\t\t\t\t\tORDER BY post_id DESC';\n\t\t\t$result = $db -> sql_query_limit($sql, 1);\n\t\t\t$post_data = $db->sql_fetchrow($result);\n\t\t\t$db->sql_freeresult($result);\n\t\t\tif($post_data)\n\t\t\t{\n\t\t\t\t//Update topics\n\t\t\t\t$upd_ary = array(\n\t\t\t\t\t'topic_last_post_id'\t\t=> $post_data['post_id'],\n\t\t\t\t\t'topic_last_poster_id'\t\t=> $post_data['poster_id'],\n\t\t\t\t\t'topic_last_poster_name'\t=> $post_data['username'],\n\t\t\t\t\t'topic_last_poster_colour'\t=> $post_data['user_colour'],\n\t\t\t\t\t'topic_last_post_subject'\t=> $post_data['post_subject'],\n\t\t\t\t\t'topic_last_post_time'\t\t=> $post_data['post_time'],\n\t\t\t\t\t'topic_posts_approved'\t\t=> $post_data['really_posts_approved'],\n\t\t\t\t\t'topic_posts_unapproved'\t=> $post_data['really_posts_unapproved'],\n\t\t\t\t\t'topic_posts_softdeleted'\t=> $post_data['really_posts_softdeleted'],\n\t\t\t\t);\n\n\t\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\n\t\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $upd_ary) . \"\n\t\t\t\t\tWHERE topic_id = $topic_id\";\n\t\t\t\t\t$db->sql_query($sql);\n\t\t\t\t//update poster statistic(if it needs)\n\t\t\t\tif($post_data['user_posts'] != $post_data['really_user_posts'])\n\t\t\t\t{\n\t\t\t\t\t$sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts=' . $post_data['really_user_posts'] . ' WHERE user_id = ' . $post_data['poster_id'];\n\t\t\t\t\t$db->sql_query($sql);\n\t \t\t\t}\n\t\t }\n\t\t}\n\t\tmeta_refresh(3, append_sid(STK_INDEX, array('c' => 'support', 't' => 'synchronization_topic_posts')));\n\t\ttrigger_error(sprintf($lang['TOPICS_SINCRONIZED'], sizeof($topic_ids)));\n\t}", "function buildTopicsMenu($topic)\n{\n\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n $column = &$pntable['topics_column'];\n $toplist =& $dbconn->Execute(\"SELECT $column[topicid], $column[topictext], $column[topicname]\n FROM $pntable[topics] ORDER BY $column[topictext]\");\n echo '<strong>'._TOPIC.'</strong>&nbsp;'\n .'<select name=\"topic\">';\n echo \"<option value=\\\"\\\">\"._SELECTTOPIC.\"</option>\\n\";\n\n while(list($topicid, $topics, $topicname) = $toplist->fields) {\n if (pnSecAuthAction(0, 'Topics::Topic', \"$topicname::$topicid\", ACCESS_COMMENT)) {\n $sel='';\n if ($topicid == $topic) {\n $sel='selected=\"selected\"';\n }\n echo '<option value=\"'.pnVarPrepForDisplay($topicid).'\" '.$sel.'>'.pnVarPrepForDisplay($topics).'</option>'.\"\\n\";\n }\n $toplist->MoveNext();\n }\n echo '</select><br />';\n}", "public function supportsTopicAdmin() {\n \treturn $this->manager->supportsTopicAdmin();\n\t}", "public function clearTopicSubscriptions()\n {\n $this->topicSubscriptions->clear();\n }", "function caldol_no_replies_bbpress_topics_shortcode() {\n\n\t?>\n\n<!-- html custom-functions -->\n\n<h4 style=\"margin-top: 15px;\">Discussions with No Replies. Be the first to jump in!</h4>\n\n<?php\n\n\n\nif ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'meta_key' => '_bbp_reply_count', 'orderby' => 'post_date', 'meta_value' => '0', 'meta_compare' => '=', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) )\n\nbbp_get_template_part( 'bbpress/loop', 'topics' );\n\n?>\n\n<!-- end -->\n\n<?php }", "public function __construct(){\n $accounts = $this->getTopicAccounts();\n foreach($accounts as $account){\n $connection = $this->getAuthenticatedConnection(\n $account['domain'],\n $account['username'],\n $account['password']\n );\n $mailboxes = $connection->getMailboxes();\n foreach($mailboxes as $mailbox){\n // Get all topic emails from the Topix server and store into\n // an array.\n // Check to see if it is from a Topix account, and check to\n // see if it a unique topic.\n $this->findTopics($mailbox, $account);\n }\n }\n }", "protected function getFeed_TopicService()\n {\n return new \\phpbb\\feed\\topic(${($_ = isset($this->services['feed.helper']) ? $this->services['feed.helper'] : $this->getFeed_HelperService()) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && 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 ?: '_'}, ${($_ = isset($this->services['content.visibility']) ? $this->services['content.visibility'] : $this->getContent_VisibilityService()) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, 'php');\n }", "public function rss_topic()\n\t{\n\t\tif (!$this->id)\n\t\t{\n\t\t\tDisplay::message('not_allowed');\n\t\t}\n\n\t\t// Liste des messages\n\t\t$sql = 'SELECT p.p_id, p.p_text, p.p_time, p.u_id, p.p_nickname, p.p_map, t.t_title, t.t_description, t.f_id, t.t_id, u.u_activate_email, u.u_email, u.u_auth\n\t\t\t\tFROM ' . SQL_PREFIX . 'posts p\n\t\t\t\tINNER JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tON p.t_id = t.t_id\n\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\t\tON u.u_id = p.u_id\n\t\t\t\tWHERE t.t_id = ' . $this->id . '\n\t\t\t\t\tAND p.p_approve = 0\n\t\t\t\tORDER BY p.p_time DESC';\n\t\t$result = Fsb::$db->query($sql);\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tif (!Fsb::$session->is_authorized($row['f_id'], 'ga_read') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view') || !Fsb::$session->is_authorized($row['f_id'], 'ga_view_topics'))\n\t\t\t{\n\t\t\t\tDisplay::message('not_allowed');\n\t\t\t}\n\n\t\t\t$parser = new Parser();\n\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars(($row['t_description']) ? $row['t_description'] : $parser->mapped_message($row['p_text'], $row['p_map'])),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['p_time']\n\t\t\t);\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Informations passees au parseur de message\n\t\t\t\t$parser_info = array(\n\t\t\t\t\t'u_id' =>\t\t\t$row['u_id'],\n\t\t\t\t\t'p_nickname' =>\t\t$row['p_nickname'],\n\t\t\t\t\t'u_auth' =>\t\t\t$row['u_auth'],\n\t\t\t\t\t'f_id' =>\t\t\t$row['f_id'],\n\t\t\t\t\t't_id' =>\t\t\t$row['t_id'],\n\t\t\t\t);\n\t\t\t\t$parser->parse_html = (Fsb::$cfg->get('activate_html') && $row['u_auth'] >= MODOSUP) ? true : false;\n\n\t\t\t\t$this->rss->add_entry(\n\t\t\t\t\tParser::title($row['t_title']),\n\t\t\t\t\thtmlspecialchars($parser->mapped_message($row['p_text'], $row['p_map'], $parser_info)),\n\t\t\t\t\t(($row['u_activate_email'] & 2) ? 'mailto:' . $row['u_email'] : Fsb::$cfg->get('forum_mail')) . ' ' . htmlspecialchars($row['p_nickname']),\n\t\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=topic&p_id=' . $row['p_id'] . '#p' . $row['p_id']),\n\t\t\t\t\t$row['p_time']\n\t\t\t\t);\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t}\n\t\t// Aucun message, on pioche donc directement les informations dans le sujet\n\t\telse \n\t\t{\n\t\t\t$sql = 'SELECT t_id, t_title, t_description, t_time\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'topics\n\t\t\t\t\tWHERE t_id = ' . $this->id;\n\t\t\t$row = Fsb::$db->request($sql);\n\t\t\t$this->rss->open(\n\t\t\t\tParser::title($row['t_title']),\n\t\t\t\thtmlspecialchars($row['t_description']),\n\t\t\t\tFsb::$session->data['u_language'],\n\t\t\t\tsid(Fsb::$cfg->get('fsb_path') . '/index.' . PHPEXT . '?p=rss&amp;mode=topic&amp;id=' . $this->id),\n\t\t\t\t$row['t_time']\n\t\t\t);\n\t\t}\n\t}", "public function __construct(Topic $topic)\n {\n $this->topic=$topic;\n $this->class=Classes::find($topic->class_id);\n }", "public function __construct() {\n $this->topics = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "function get_group_topics($params) {\n global $db;\n\n $gid = $params['group'] ? $params['group'] : $params;\n $limit = $params['limit'];\n $order = $params['order'] ? $params['order'] : \" last_post_time DESC \";\n\n if ($params['approved'])\n $approved_query = \" AND \" . tbl('group_topics') . \".approved='yes' \";\n if ($params['user'])\n $user_query = \" AND \" . tbl('group_topics') . \".userid='\" . $params['user'] . \"'\";\n\n\n //user fields\n $fields = array(\n 'email', 'username'\n );\n\n $fields = apply_filters($fields, 'group_topic_user_fields');\n\n foreach ($fields as $field)\n $uquery .= ',' . tbl('users.' . $field);\n\n if ($limit)\n $limit_query = \" LIMIT \" . $limit;\n else\n $limit_query = '';\n\n $order = ' ORDER BY ' . $order;\n $results = db_select(\"SELECT \" . tbl('group_topics') . \".*$uquery FROM \"\n . tbl('group_topics') . \" LEFT JOIN \" . tbl('users') . \" ON \" . tbl('users.userid')\n . \"=\" . tbl('group_topics.userid') . \" WHERE \" . tbl('group_topics')\n . \".group_id='$gid' $user_query $order $limit_query \");\n\n\n if ($db->num_rows > 0)\n return $results;\n else\n return false;\n }", "public function inTopic( array $params = null )\n {\n $topicId = (int)$params['topicId'];\n $userId = OW::getUser()->getId();\n\n $topic = $this->forumService->findTopicById($topicId);\n $forumGroup = $this->forumService->findGroupById($topic->groupId);\n $forumSection = $this->forumService->findSectionById($forumGroup->sectionId);\n\n if ( $forumSection && $forumSection->isHidden )\n {\n $event = new OW_Event('forum.find_forum_caption', array('entity' => $forumSection->entity, 'entityId' => $forumGroup->entityId));\n OW::getEventManager()->trigger($event);\n\n $eventData = $event->getData();\n $componentForumCaption = $eventData['component'];\n\n $this->addComponent('componentForumCaption', $componentForumCaption);\n\n $isModerator = OW::getUser()->isAuthorized($forumSection->entity);\n }\n else \n {\n $isModerator = OW::getUser()->isAuthorized('forum');\n }\n\n if ( $forumGroup->isPrivate )\n {\n if ( !$userId )\n {\n throw new AuthorizationException();\n } \n else if ( !$isModerator )\n {\n if ( !$this->forumService->isPrivateGroupAvailable($userId, json_decode($forumGroup->roles)) )\n {\n throw new AuthorizationException();\n }\n }\n }\n\n $this->searchEntities($params, 'topic');\n }", "function caldol_hook_bbp_theme_before_forum_sub_forums(){\n\n\n\t\t\n\n\t\t//echo \"count: \" . bbp_get_forum_subforum_count() . \" --\";\n\n\t\t\n\n\t\t\n\n\t\t$subForumList = bbp_forum_get_subforums();\n\n\t\t\n\n\t\tif(sizeof($subForumList) > 1){\n\n\t\t\techo \"<ul style='margin-left: 20px;'>\";\n\n\t\tforeach($subForumList as $currForum){\n\n\t\t\t//print_r($currForum);\n\n\t\t\t// No link\n\n\t\t\t$retval = false;\n\n\t\t\t\t\n\n\t\t\t// Parse the arguments\n\n\t\t\t$r = bbp_parse_args( $args, array(\n\n\t\t\t\t\t'forum_id' => $currForum->ID,\n\n\t\t\t\t\t'user_id' => 0,\n\n\t\t\t\t\t'before' => '',\n\n\t\t\t\t\t'after' => '',\n\n\t\t\t\t\t'subscribe' => __( 'Subscribe', 'bbpress' ),\n\n\t\t\t\t\t'unsubscribe' => __( 'x', 'bbpress' )\n\n\t\t\t), 'get_forum_subscribe_link' );\n\n\t\t\t\t\n\n\t\t\t\n\n\t\t\t$isSubscribed = bbp_get_forum_subscription_link( $r);\n\n\t\t\t\n\n\t\t\t\t\n\n\t\t\tif(strpos($isSubscribed, 'is-subscribed') != 0){\n\n\t\t\t\n\n\t\t\techo \"<li class='bbp-topic-title'><a href='\" . bbp_get_forum_permalink($currForum->ID) . \"'>\" . $currForum->post_title . \"</a><span class='bbp-topic-action'>&nbsp;&nbsp; \" . $isSubscribed . \" </span></li>\";\n\n\t\t\t}\n\n\t\t\t//print_r($currForum);\n\n\t\t}\n\n\t\t\techo \"</ul>\";\n\n\t\t} // end > 1\n\n\t\t\n\n\t\t\n\n}", "function UnreadTopics()\n{\n\tglobal $board, $txt, $scripturl, $db_prefix, $sourcedir;\n\tglobal $ID_MEMBER, $user_info, $context, $modSettings;\n\n\t// Guests can't have unread things, we don't know anything about them.\n\tis_not_guest();\n\n\t$context['sub_template'] = $_REQUEST['action'] == 'unread' ? 'unread' : 'replies';\n\t$context['showing_all_topics'] = isset($_GET['all']);\n\tif ($_REQUEST['action'] == 'unread')\n\t\t$context['page_title'] = $context['showing_all_topics'] ? $txt['unread_topics_all'] : $txt['unread_topics_visit'];\n\telse\n\t\t$context['page_title'] = $txt['unread_replies'];\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''),\n\t\t'name' => $context['page_title']\n\t);\n\n\tloadTemplate('Recent');\n\n\t$is_topics = $_REQUEST['action'] == 'unread';\n\n\t// Are we specifying any specific board?\n\tif (!empty($board))\n\t\t$query_this_board = 'b.ID_BOARD = ' . $board;\n\telse\n\t{\n\t\t$query_this_board = $user_info['query_see_board'];\n\n\t\t// Don't bother to show deleted posts!\n\t\tif (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)\n\t\t\t$query_this_board .= '\n\t\t\t\tAND b.ID_BOARD != ' . $modSettings['recycle_board'];\n\t}\n\n\t// This part is the same for each query.\n\t$select_clause = '\n\t\t\t\tms.subject AS firstSubject, ms.posterTime AS firstPosterTime, ms.ID_TOPIC, t.ID_BOARD, b.name AS bname,\n\t\t\t\tt.numReplies, t.numViews, ms.ID_MEMBER AS ID_FIRST_MEMBER, ml.ID_MEMBER AS ID_LAST_MEMBER,\n\t\t\t\tml.posterTime AS lastPosterTime, IFNULL(mems.realName, ms.posterName) AS firstPosterName,\n\t\t\t\tIFNULL(meml.realName, ml.posterName) AS lastPosterName, ml.subject AS lastSubject,\n\t\t\t\tml.icon AS lastIcon, ms.icon AS firstIcon, t.ID_POLL, t.isSticky, t.locked, ml.modifiedTime AS lastModifiedTime,\n\t\t\t\tIFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) AS isRead, LEFT(ml.body, 384) AS lastBody, LEFT(ms.body, 384) AS firstBody,\n\t\t\t\tml.smileysEnabled AS lastSmileys, ms.smileysEnabled AS firstSmileys, t.ID_FIRST_MSG, t.ID_LAST_MSG';\n\n\tif ($context['showing_all_topics'] || !$is_topics)\n\t{\n\t\tif (!empty($board))\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(logTime)\n\t\t\t\tFROM {$db_prefix}log_mark_read\n\t\t\t\tWHERE ID_MEMBER = $ID_MEMBER\n\t\t\t\t\tAND ID_BOARD = $board\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$request = db_query(\"\n\t\t\t\tSELECT MIN(lmr.logTime)\n\t\t\t\tFROM {$db_prefix}boards AS b\n\t\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_MEMBER = $ID_MEMBER AND lmr.ID_BOARD = b.ID_BOARD)\n\t\t\t\tWHERE $user_info[query_see_board]\", __FILE__, __LINE__);\n\t\t\tlist ($earliest_time) = mysql_fetch_row($request);\n\t\t\tmysql_free_result($request);\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT MIN(logTime)\n\t\t\tFROM {$db_prefix}log_topics\n\t\t\tWHERE ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\tlist ($earliest_time2) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\tif ($earliest_time2 < $earliest_time)\n\t\t\t$earliest_time = (int) $earliest_time2;\n\t\telse\n\t\t\t$earliest_time = (int) $earliest_time;\n\t}\n\n\tif ($is_topics)\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\" . ($context['showing_all_topics'] ? \"\n\t\t\t\tAND ml.posterTime >= $earliest_time\" : \"\n\t\t\t\tAND t.ID_LAST_MSG > $_SESSION[ID_MSG_LAST_VISIT]\") . \"\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'] . ($context['showing_all_topics'] ? ';all' : ''), $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t}\n\telse\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_MEMBER_UPDATED != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND ml.posterTime >= $earliest_time\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\", __FILE__, __LINE__);\n\t\tlist ($num_topics, $min_message) = mysql_fetch_row($request);\n\t\tmysql_free_result($request);\n\n\t\t// Make sure the starting place makes sense and construct the page index.\n\t\t$context['page_index'] = constructPageIndex($scripturl . '?action=' . $_REQUEST['action'], $_REQUEST['start'], $num_topics, $modSettings['defaultMaxTopics']);\n\t\t$context['current_page'] = (int) $_REQUEST['start'] / $modSettings['defaultMaxTopics'];\n\n\t\tif ($num_topics == 0)\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\t$min_message = (int) $min_message;\n\n\t\t$request = db_query(\"\n\t\t\tSELECT DISTINCT t.ID_TOPIC\n\t\t\tFROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE ml.ID_MEMBER != $ID_MEMBER\n\t\t\t\tAND m.ID_TOPIC = t.ID_TOPIC\n\t\t\t\tAND m.ID_MEMBER = $ID_MEMBER\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND $query_this_board\n\t\t\t\tAND t.ID_LAST_MSG >= $min_message\n\t\t\t\tAND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]\", __FILE__, __LINE__);\n\t\t$topics = array();\n\t\twhile ($row = mysql_fetch_assoc($request))\n\t\t\t$topics[] = $row['ID_TOPIC'];\n\t\tmysql_free_result($request);\n\n\t\t// Sanity... where have you gone?\n\t\tif (empty($topics))\n\t\t{\n\t\t\t$context['topics'] = array();\n\t\t\treturn;\n\t\t}\n\n\t\t$request = db_query(\"\n\t\t\tSELECT $select_clause\n\t\t\tFROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {$db_prefix}members AS mems ON (mems.ID_MEMBER = ms.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)\n\t\t\t\tLEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE t.ID_TOPIC IN (\" . implode(', ', $topics) . \")\n\t\t\t\tAND t.ID_TOPIC = ms.ID_TOPIC\n\t\t\t\tAND b.ID_BOARD = t.ID_BOARD\n\t\t\t\tAND ms.ID_MSG = t.ID_FIRST_MSG\n\t\t\t\tAND ml.ID_MSG = t.ID_LAST_MSG\n\t\t\tORDER BY ml.ID_MSG DESC\n\t\t\tLIMIT \" . count($topics), __FILE__, __LINE__);\n\t}\n\n\t$context['topics'] = array();\n\t$topic_ids = array();\n\twhile ($row = mysql_fetch_assoc($request))\n\t{\n\t\tif ($row['ID_POLL'] > 0 && $modSettings['pollMode'] == '0')\n\t\t\tcontinue;\n\n\t\t$topic_ids[] = $row['ID_TOPIC'];\n\n\t\t// Clip the strings first because censoring is slow :/. (for some reason?)\n\t\t$row['firstBody'] = strip_tags(strtr(doUBBC($row['firstBody'], $row['firstSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['firstBody']) > 128)\n\t\t\t$row['firstBody'] = substr($row['firstBody'], 0, 128) . '...';\n\t\t$row['lastBody'] = strip_tags(strtr(doUBBC($row['lastBody'], $row['lastSmileys']), array('<br />' => '&#10;')));\n\t\tif (strlen($row['lastBody']) > 128)\n\t\t\t$row['lastBody'] = substr($row['lastBody'], 0, 128) . '...';\n\n\t\t// Do a bit of censoring...\n\t\tcensorText($row['firstSubject']);\n\t\tcensorText($row['firstBody']);\n\n\t\t// But don't do it twice, it can be a slow ordeal!\n\t\tif ($row['ID_FIRST_MSG'] == $row['ID_LAST_MSG'])\n\t\t{\n\t\t\t$row['lastSubject'] = $row['firstSubject'];\n\t\t\t$row['lastBody'] = $row['firstBody'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcensorText($row['lastSubject']);\n\t\t\tcensorText($row['lastBody']);\n\t\t}\n\n\t\t// Decide how many pages the topic should have.\n\t\t$topic_length = $row['numReplies'] + 1;\n\t\tif ($topic_length > $modSettings['defaultMaxMessages'])\n\t\t{\n\t\t\t$tmppages = array();\n\t\t\t$tmpa = 1;\n\t\t\tfor ($tmpb = 0; $tmpb < $topic_length; $tmpb += $modSettings['defaultMaxMessages'])\n\t\t\t{\n\t\t\t\t$tmppages[] = '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.' . $tmpb . ';topicseen\">' . $tmpa . '</a>';\n\t\t\t\t$tmpa++;\n\t\t\t}\n\t\t\t// Show links to all the pages?\n\t\t\tif (count($tmppages) <= 5)\n\t\t\t\t$pages = '&#171; ' . implode(' ', $tmppages);\n\t\t\t// Or skip a few?\n\t\t\telse\n\t\t\t\t$pages = '&#171; ' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];\n\n\t\t\tif (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])\n\t\t\t\t$pages .= ' &nbsp;<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;all\">' . $txt[190] . '</a>';\n\t\t\t$pages .= ' &#187;';\n\t\t}\n\t\telse\n\t\t\t$pages = '';\n\n\t\t// And build the array.\n\t\t$context['topics'][$row['ID_TOPIC']] = array(\n\t\t\t'id' => $row['ID_TOPIC'],\n\t\t\t'first_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['firstPosterName'],\n\t\t\t\t\t'id' => $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_FIRST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '\" title=\"' . $txt[92] . ' ' . $row['firstPosterName'] . '\">' . $row['firstPosterName'] . '</a>' : $row['firstPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['firstPosterTime']),\n\t\t\t\t'timestamp' => $row['firstPosterTime'],\n\t\t\t\t'subject' => $row['firstSubject'],\n\t\t\t\t'preview' => $row['firstBody'],\n\t\t\t\t'icon' => $row['firstIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0;topicseen\">' . $row['firstSubject'] . '</a>'\n\t\t\t),\n\t\t\t'last_post' => array(\n\t\t\t\t'member' => array(\n\t\t\t\t\t'name' => $row['lastPosterName'],\n\t\t\t\t\t'id' => $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'href' => $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'],\n\t\t\t\t\t'link' => !empty($row['ID_LAST_MEMBER']) ? '<a href=\"' . $scripturl . '?action=profile;u=' . $row['ID_LAST_MEMBER'] . '\">' . $row['lastPosterName'] . '</a>' : $row['lastPosterName']\n\t\t\t\t),\n\t\t\t\t'time' => timeformat($row['lastPosterTime']),\n\t\t\t\t'timestamp' => $row['lastPosterTime'],\n\t\t\t\t'subject' => $row['lastSubject'],\n\t\t\t\t'preview' => $row['lastBody'],\n\t\t\t\t'icon' => $row['lastIcon'],\n\t\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'],\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.msg' . $row['ID_LAST_MSG']) . ';topicseen#msg' . $row['ID_LAST_MSG'] . '\">' . $row['lastSubject'] . '</a>'\n\t\t\t),\n\t\t\t'newtime' => $row['isRead'],\n\t\t\t'new_href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.from' . $row['isRead'] . ';topicseen#new',\n\t\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new',\n\t\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . ($row['numReplies'] == 0 ? '.0' : '.from' . $row['isRead']) . ';topicseen#new\">' . $row['firstSubject'] . '</a>',\n\t\t\t'is_sticky' => !empty($modSettings['enableStickyTopics']) && !empty($row['isSticky']),\n\t\t\t'is_locked' => !empty($row['locked']),\n\t\t\t'is_poll' => $modSettings['pollMode'] == '1' && $row['ID_POLL'] > 0,\n\t\t\t'is_hot' => $row['numReplies'] >= $modSettings['hotTopicPosts'],\n\t\t\t'is_very_hot' => $row['numReplies'] >= $modSettings['hotTopicVeryPosts'],\n\t\t\t'is_posted_in' => false,\n\t\t\t'icon' => $row['firstIcon'],\n\t\t\t'subject' => $row['firstSubject'],\n\t\t\t'pages' => $pages,\n\t\t\t'replies' => $row['numReplies'],\n\t\t\t'views' => $row['numViews'],\n\t\t\t'board' => array(\n\t\t\t\t'id' => $row['ID_BOARD'],\n\t\t\t\t'name' => $row['bname'],\n\t\t\t\t'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0',\n\t\t\t\t'link' => '<a href=\"' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0\">' . $row['bname'] . '</a>'\n\t\t\t)\n\t\t);\n\n\t\tdetermineTopicClass($context['topics'][$row['ID_TOPIC']]);\n\t}\n\tmysql_free_result($request);\n\n\tif ($is_topics && !empty($modSettings['enableParticipation']) && !empty($topic_ids))\n\t{\n\t\t$result = db_query(\"\n\t\t\tSELECT ID_TOPIC\n\t\t\tFROM {$db_prefix}messages\n\t\t\tWHERE ID_TOPIC IN (\" . implode(', ', $topic_ids) . \")\n\t\t\t\tAND ID_MEMBER = $ID_MEMBER\", __FILE__, __LINE__);\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif (empty($context['topics'][$row['ID_TOPIC']]['is_posted_in']))\n\t\t\t{\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['is_posted_in'] = true;\n\t\t\t\t$context['topics'][$row['ID_TOPIC']]['class'] = 'my_' . $context['topics'][$row['ID_TOPIC']]['class'];\n\t\t\t}\n\t\t}\n\t\tmysql_free_result($result);\n\t}\n\n\t$context['topics_to_mark'] = implode('-', $topic_ids);\n}", "function MaintainRemoveOldPosts()\n{\n\t// Actually do what we're told!\n\tloadSource('RemoveTopic');\n\tRemoveOldTopics2();\n}", "public function run()\n {\n foreach ($this->topics as $topic){\n Topic::query()->firstOrCreate($topic);\n }\n }", "function topicExists($topicID) {\n\t\tglobal $DB;\n\t\t\n\t\t$exists = 0;\n\t\t\n\t\t// Topic or Forum?\n\t\t$sql = \"SELECT id FROM `\" . DBTABLEPREFIX . \"topics` WHERE id='\" . $_SESSION['userid'] . \"' LIMIT 1\";\n\t\t$result = $DB->query($sql);\n\t\t\t\t\n\t\tif ($result && $DB->num_rows() > 0) {\n\t\t\t// If theres a row then it exists\n\t\t\t$exists = 1;\n\t\t\t\n\t\t\t$DB->free_result($result);\n\t\t}\n\t\t\n\t\treturn $exists;\n\t}", "public function getCurrentTopicDetail()\n {\n \n $topicData = $this->_coreRegistry->registry('current_topic');\n return $topicData ? $topicData : false;\n }", "function soft_delete_topics()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->soft_delete['t']))\r\n\t\t{\r\n\t\t\t$sql_data = array(\r\n\t\t\t\t'topic_deleted'\t\t\t=> $user->data['user_id'],\r\n\t\t\t\t'topic_deleted_time'\t=> time(),\r\n\t\t\t);\r\n\r\n\t\t\t$to_update = array();\r\n\t\t\tforeach ($this->soft_delete['t'] as $id)\r\n\t\t\t{\r\n\t\t\t\tif (array_key_exists($id, $this->shadow_topic_ids))\r\n\t\t\t\t{\r\n\t\t\t\t\t$to_update[] = $this->shadow_topic_ids[$id];\r\n\t\t\t\t\t$this->topic_data[$this->shadow_topic_ids[$id]] = array_merge($this->topic_data[$this->shadow_topic_ids[$id]], $sql_data);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$to_update[] = $id;\r\n\t\t\t\t$this->topic_data[$id] = array_merge($this->topic_data[$id], $sql_data);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'UPDATE ' . TOPICS_TABLE . '\r\n\t\t\t\tSET ' . $db->sql_build_array('UPDATE', $sql_data) . '\r\n\t\t\t\t\tWHERE ' . $db->sql_in_set('topic_id', $to_update);\r\n\t\t\t$db->sql_query($sql);\r\n\r\n\t\t\tforeach ($to_update as $id)\r\n\t\t\t{\r\n\t\t\t\t// If the topic is a global announcement, do not attempt to do any updates to forums\r\n\t\t\t\tif ($this->topic_data[$id]['topic_type'] != POST_GLOBAL)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = 'UPDATE ' . FORUMS_TABLE . '\r\n\t\t\t\t\t\tSET forum_deleted_topic_count = forum_deleted_topic_count + 1\r\n\t\t\t\t\t\t\tWHERE forum_id = ' . intval($this->topic_data[$id]['forum_id']);\r\n\t\t\t\t\t$db->sql_query($sql);\r\n\t\t\t\t\t$this->forum_data[$this->topic_data[$id]['forum_id']]['forum_deleted_topic_count']++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->update_board_stats();\r\n\t\t$this->update_user_stats();\r\n\t}", "function _build_topics_query()\n\t{\n\t\t$topics=$this->topics;//must always be an array\n\n\t\tif (!is_array($topics))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//remove topics that are not numeric\n\t\t$topics_clean=array();\n\t\tforeach($topics as $topic)\n\t\t{\n\t\t\tif (is_numeric($topic) )\n\t\t\t{\n\t\t\t\t$topics_clean[]=$topic;\n\t\t\t}\n\t\t}\n\n\t\tif ( count($topics_clean)>0)\n\t\t{\n\t\t\t$topics=implode(' OR ',$topics_clean);\n\n\t\t\tif ($topics)\n\t\t\t{\n\t\t\t\treturn sprintf(' topics_id:(%s)',$topics);\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function getTopic()\n {\n return $this->topic;\n }", "public function setTopic(TopicInterface $topic);", "function fanwood_dim_subscription () {\n\tif ( !bbp_is_subscriptions_active() )\n\t\treturn;\n\n\t$user_id = bbp_get_current_user_id();\n\t$id = intval( $_POST['id'] );\n\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\tdie( '-1' );\n\n\tif ( !$topic = bbp_get_topic( $id ) )\n\t\tdie( '0' );\n\n\tcheck_ajax_referer( \"toggle-subscription_$topic->ID\" );\n\n\tif ( bbp_is_user_subscribed( $user_id, $topic->ID ) ) {\n\t\tif ( bbp_remove_user_subscription( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t} else {\n\t\tif ( bbp_add_user_subscription( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t}\n\n\tdie( '0' );\n}", "function loadTopics() {\r\n $dbh = DBHandlerClass::getInstance();\r\n $table = \"topics\";\r\n $colums = array(\"tID\", \"tName\", \"tDT\", \"users.uName\");\r\n $additionalTerm = \"INNER JOIN users on topics.uID = users.uID\";\r\n\r\n $topics = $dbh->readFromDB($table, $colums, $additionalTerm, NULL);\r\n printTopics($topics);\r\n}", "public function setTopic($topic)\n {\n $this->_topic = $topic;\n }", "function tep_show_topic($counter) {\r\n global $tree, $topics_string, $tPath_array;\r\n\r\n if(!$counter)\r\n return 0;\r\n\r\n for ($i=0; $i<$tree[$counter]['level']; $i++) {\r\n $topics_string .= \"&nbsp;&nbsp;\";\r\n }\r\n\r\n if(empty($topics_string)){\r\n $topics_string .='<div class=\"margin\">';\r\n }\r\n\t$tab = '<div class=\"margin\">';\r\n if (!empty($topics_string) && $topics_string != $tab)\r\n\t{\r\n\t $topics_string .='';\r\n\t}\r\n\r\n\r\n\r\n if ($tree[$counter]['parent'] == 0) {\r\n $tPath_new = 'tPath=' . $counter;\r\n } else {\r\n $tPath_new = 'tPath=' . $tree[$counter]['path'];\r\n }\r\n\r\n $topics_string .= '<div style=\"width:75\" class=\"lef_4\" style=\"text-decoration:none\"><strong>';\r\n\r\n if (isset($tPath_array) && in_array($counter, $tPath_array)) {\r\n $topics_string .= '';\r\n }\r\n\r\n// display topic name\r\n\r\n\r\n $topics_string .= $tree[$counter]['name'].'</div>';\r\n\r\n if (isset($tPath_array) && in_array($counter, $tPath_array)) {\r\n// $topics_string .= '</b>';\r\n }\r\n\r\n if (tep_has_topic_subtopics($counter)) {\r\n $topics_string .= ' -&gt;';\r\n }\r\n\r\n $topics_string .= '</strong><br><a href=\"'.tep_href_link(FILENAME_ARTICLES, $tPath_new).'\">'.preg_replace('/\\s\\S*$/i', '', substr($tree[$counter]['description'], 0, 60)).'</a>';\r\n\r\n if (SHOW_ARTICLE_COUNTS == 'true') {\r\n $articles_in_topic = tep_count_articles_in_topic($counter);\r\n if ($articles_in_topic > 0) {\r\n //$topics_string .= '&nbsp;(' . $articles_in_topic . ')';\r\n }\r\n }\r\n if ($tree[$counter]['next_id'] != false) {\r\n //tep_show_topic($tree[$counter]['next_id']);\r\n }\r\n }", "function apoc_get_group_topic_info() {\n\n\tglobal $bp;\n\t$slug = $bp->action_variables[1];\n\t\n\t\n\tglobal $wpdb;\n\t$topic = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT post_title AS title, post_name AS url\n\t\t\tFROM $wpdb->posts \n\t\t\tWHERE post_name = %s\",\n\t\t\t$slug )\n\t\t);\n\t\t\n\treturn $topic;\n}", "protected function approve_topic()\n\t{\n\t\t$this->load_topic_object();\n\n\t\t$sql = 'UPDATE ' . TITANIA_TOPICS_TABLE . '\n\t\t\tSET topic_approved = 1\n\t\t\tWHERE topic_id = ' . $this->post->topic_id;\n\t\tphpbb::$db->sql_query($sql);\n\n\t\t// Subscriptions\n\t\tif ($this->post->topic->topic_last_post_id == $this->post->post_id)\n\t\t{\n\t\t\t$message_vars = array('U_VIEW' => $this->post->topic->get_url());\n\n\t\t\t$this->send_notifications($this->post->post_type, $this->post->topic->parent_id, 'subscribe_notify_forum_contrib', $message_vars);\n\t\t}\n\t}", "public function supportsTopicHierarchyDesign() {\n \treturn $this->manager->supportsTopicHierarchyDesign();\n\t}", "public function scanFile($path)\n {\n $filePath = ltrim($path, \"./\");\n $topics = array();\n\n $handle = @fopen($path, 'r');\n if ($handle) {\n $stack = array();\n $group = false;\n $topic = new Topic(array('files' => array($filePath)));\n $counter = 0;\n while (!feof($handle)) {\n $line = fgets($handle, 4096);\n $counter++;\n\n if (preg_match('/\\*\\s+@publishes\\s+([^ ]+)(.*)$/', $line, $matches)) {\n $name = trim($matches[1]);\n $desc = trim($matches[2]);\n $this->debug(\"--------Found publishes in '$path' for '$name' on line $counter\");\n\n // stash the previously assembled topic, if we have one.\n $topic = $this->scanStack($topic, $stack, \"for publishes\");\n if ($topic->isValid()) {\n $this->debug('==== add topic '. $topic->name .' due to @publishes');\n $topics[$topic->name] = $topic;\n $topic = new Topic(array('files' => array($filePath)));\n } else {\n $error = $topic->getError();\n if (!preg_match('/No name specified/', $error)) {\n error_log(\n \"ERROR: file '$filePath', line \". $topic->line\n . \", topic '\". $topic->name\n . \"': $error\"\n );\n exit(1);\n }\n }\n\n // clear the stack for the new topic\n $stack = array();\n\n // assemble the new topic\n $topic->name = $name;\n $topic->description = $desc;\n $topic->line = $counter;\n\n $group = true;\n continue;\n }\n\n if ($group && preg_match('/\\*\\s+([^@].+)$/', $line, $matches)) {\n $stack[] = trim($matches[1]);\n } else if ($group) {\n $group = false;\n $topic = $this->scanStack($topic, $stack, \"for group termination\");\n if ($topic->isValid()) {\n $this->debug('==== add topic '. $topic->name .' due to closed group');\n $topics[$topic->name] = $topic;\n $topic = new Topic(array('files' => array($filePath)));\n } else {\n $this->debug(\n \"****** topic '\". $topic->name .\"' not valid in group termination: \"\n . $topic->getError()\n );\n }\n $stack = array();\n }\n }\n fclose($handle);\n\n // handle the possible, but rare, case of topic documentation existing at\n // the end of the file\n $topic = $this->scanStack($topic, $stack, \"for end of file\");\n if ($topic->isValid()) {\n $this->debug('==== add topic '. $topic->name .' due to end of file');\n $topics[$topic->name] = $topic;\n $topic = new Topic(array('files' => array($path)));\n $stack = array();\n } else {\n $error = $topic->getError();\n if (!preg_match('/No name specified/', $error)) {\n $this->debug(\n \"****** topic '\". $topic->name .\"' not valid in end of file: \"\n . $topic->getError()\n );\n }\n }\n }\n return $topics;\n }", "function delTopic()\n{\n global $xoopsDB, $xoopsModule;\n if (!isset($_POST['ok'])) {\n xoops_cp_header();\n echo \"<h4>\" . _AM_CONFIG . \"</h4>\";\n $xt = new XoopsTopic( $xoopsDB->prefix(\"topics\"), intval($_GET['topic_id']));\n xoops_confirm(array( 'op' => 'delTopic', 'topic_id' => intval($_GET['topic_id']), 'ok' => 1), 'index.php', _AM_WAYSYWTDTTAL . '<br />' . $xt->topic_title('S'));\n } else {\n $xt = new XoopsTopic($xoopsDB->prefix(\"topics\"), intval($_POST['topic_id']));\n // get all subtopics under the specified topic\n $topic_arr = $xt->getAllChildTopics();\n array_push( $topic_arr, $xt );\n foreach( $topic_arr as $eachtopic ) {\n // get all stories in each topic\n $story_arr = NewsStory :: getByTopic( $eachtopic -> topic_id() );\n foreach( $story_arr as $eachstory ) {\n if (false != $eachstory->delete()) {\n xoops_comment_delete( $xoopsModule -> getVar( 'mid' ), $eachstory -> storyid() );\n xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $eachstory->storyid());\n }\n }\n // all stories for each topic is deleted, now delete the topic data\n $eachtopic -> delete();\n // Delete also the notifications and permissions\n xoops_notification_deletebyitem( $xoopsModule -> getVar( 'mid' ), 'category', $eachtopic -> topic_id );\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_approve', $eachtopic -> topic_id);\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_submit', $eachtopic -> topic_id);\n\t\t\txoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'news_view', $eachtopic -> topic_id);\n }\n updateCache();\n redirect_header( 'index.php?op=topicsmanager', 1, _AM_DBUPDATED );\n exit();\n }\n}", "public function isSubscribed()\n {\n return null !== $this->queue;\n }", "function get_shadow_topic_ids($topic_ids)\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($topic_ids))\r\n\t\t{\r\n\t\t\t$sql = 'SELECT topic_id, topic_moved_id FROM ' . TOPICS_TABLE . '\r\n\t\t\t\tWHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);\r\n\t\t\t$result = $db->sql_query($sql);\r\n\t\t\twhile ($row = $db->sql_fetchrow($result))\r\n\t\t\t{\r\n\t\t\t\t$this->shadow_topic_ids[$row['topic_moved_id']] = $row['topic_id'];\r\n\t\t\t}\r\n\t\t\t$db->sql_freeresult($result);\r\n\t\t}\r\n\t}", "public function users_subscribed_to_topic_of_the_day()\n\t{\n\t\treturn $this->where('send_reminders', true)->find_all_no_limit();\n\t}", "function subscriptionManager($user, $tid, $mode) {\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\t\r\n\t//get a check to see if they are a part the topic defined.\r\n\t$ci->db->select('tid')\r\n\t ->from('ebb_topic_watch')\r\n\t ->where('username', $user);\r\n\t$q = $ci->db->get();\r\n\t\r\n\t//see if they want to subscribe or unsubscribe to a topic.\r\n\tif ($mode == \"subscribe\" && $q->num_rows() == 0) {\r\n\t\t$data = array(\r\n\t\t \"username\" => $user,\r\n\t\t \"tid\" => $tid,\r\n\t\t \"read_status\" => 0\r\n\t\t);\r\n\t\t$ci->db->insert('ebb_topic_watch', $data);\t\t\r\n\t} elseif ($mode == \"unsubscribe\" && $q->num_rows() > 0) {\r\n\t\t$ci->db->where('tid', $tid);\r\n\t\t$ci->db->where('username', $user);\r\n\t\t$ci->db->delete('ebb_topic_watch');\r\n\t}\r\n}", "public static function prepareContext($topics_info, $topicseen = false, $preview_length = null)\n\t{\n\t\tglobal $modSettings, $options, $txt, $settings;\n\n\t\t$topics = array();\n\t\t$preview_length = (int) $preview_length;\n\t\tif (empty($preview_length))\n\t\t{\n\t\t\t$preview_length = 128;\n\t\t}\n\n\t\t$messages_per_page = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) ? $options['messages_per_page'] : $modSettings['defaultMaxMessages'];\n\t\t$topicseen = $topicseen ? 'topicseen' : '';\n\n\t\t$icon_sources = new MessageTopicIcons(!empty($modSettings['messageIconChecks_enable']), $settings['theme_dir']);\n\n\t\t$parser = ParserWrapper::instance();\n\n\t\tforeach ($topics_info as $row)\n\t\t{\n\t\t\t// Is there a body to preview? (If not the preview is disabled.)\n\t\t\tif (isset($row['first_body']))\n\t\t\t{\n\t\t\t\t// Limit them to $preview_length characters - do this FIRST because it's a lot of wasted censoring otherwise.\n\t\t\t\t$row['first_body'] = strtr($parser->parseMessage($row['first_body'], $row['first_smileys']), array('<br />' => \"\\n\", '&nbsp;' => ' '));\n\t\t\t\t$row['first_body'] = Util::htmlspecialchars(Util::shorten_html($row['first_body'], $preview_length));\n\n\t\t\t\t// No reply then they are the same, no need to process it again\n\t\t\t\tif ($row['num_replies'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$row['last_body'] = $row['first_body'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$row['last_body'] = strtr($parser->parseMessage($row['last_body'], $row['last_smileys']), array('<br />' => \"\\n\", '&nbsp;' => ' '));\n\t\t\t\t\t$row['last_body'] = Util::htmlspecialchars(Util::shorten_html($row['last_body'], $preview_length));\n\t\t\t\t}\n\n\t\t\t\t// Censor the subject and message preview.\n\t\t\t\t$row['first_subject'] = censor($row['first_subject']);\n\t\t\t\t$row['first_body'] = censor($row['first_body']);\n\n\t\t\t\t// Don't censor them twice!\n\t\t\t\tif ($row['id_first_msg'] == $row['id_last_msg'])\n\t\t\t\t{\n\t\t\t\t\t$row['last_subject'] = $row['first_subject'];\n\t\t\t\t\t$row['last_body'] = $row['first_body'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$row['last_subject'] = censor($row['last_subject']);\n\t\t\t\t\t$row['last_body'] = censor($row['last_body']);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row['first_body'] = '';\n\t\t\t\t$row['last_body'] = '';\n\t\t\t\t$row['first_subject'] = censor($row['first_subject']);\n\n\t\t\t\tif ($row['id_first_msg'] == $row['id_last_msg'])\n\t\t\t\t{\n\t\t\t\t\t$row['last_subject'] = $row['first_subject'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$row['last_subject'] = censor($row['last_subject']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Decide how many pages the topic should have.\n\t\t\t$topic_length = $row['num_replies'] + 1;\n\t\t\tif ($topic_length > $messages_per_page)\n\t\t\t{\n\t\t\t\t// We can't pass start by reference.\n\t\t\t\t$start = -1;\n\t\t\t\t$show_all = !empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'];\n\t\t\t\t$pages = constructPageIndex('{scripturl}?topic=' . $row['id_topic'] . '.%1$d' . $topicseen, $start, $topic_length, $messages_per_page, true, array('prev_next' => false, 'all' => $show_all));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pages = '';\n\t\t\t}\n\n\t\t\t$row['new_from'] = $row['new_from'] ?? 0;\n\t\t\t$first_poster_href = getUrl('profile', ['action' => 'profile', 'u' => $row['first_id_member'], 'name' => $row['first_display_name']]);\n\t\t\t$first_topic_href = getUrl('topic', ['topic' => $row['id_topic'], 'start' => '0', $topicseen, 'subject' => $row['first_subject']]);\n\t\t\t$last_poster_href = getUrl('profile', ['action' => 'profile', 'u' => $row['last_id_member'], 'name' => $row['last_display_name']]);\n\n\t\t\tif (User::$info->is_guest)\n\t\t\t{\n\t\t\t\t$topic_href = getUrl('topic', ['topic' => $row['id_topic'], 'start' => ((int) (($row['num_replies']) / $messages_per_page)) * $messages_per_page, 'subject' => $row['first_subject'], $topicseen]) . '#msg' . $row['id_last_msg'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$topic_href = getUrl('topic', ['topic' => $row['id_topic'], 'start' => $row['num_replies'] == 0 ? '0' : ('msg' . $row['id_last_msg']), 'subject' => $row['first_subject'], $topicseen]) . '#new';\n\t\t\t}\n\t\t\t$href = getUrl('topic', ['topic' => $row['id_topic'], 'start' => $row['num_replies'] == 0 ? '0' : ('msg' . $row['new_from']), 'subject' => $row['first_subject'], $topicseen]) . $row['num_replies'] == 0 ? '' : '#new';\n\n\t\t\t// And build the array.\n\t\t\t$topics[$row['id_topic']] = array(\n\t\t\t\t'id' => $row['id_topic'],\n\t\t\t\t'first_post' => array(\n\t\t\t\t\t'id' => $row['id_first_msg'],\n\t\t\t\t\t'member' => array(\n\t\t\t\t\t\t'username' => $row['first_member_name'],\n\t\t\t\t\t\t'name' => $row['first_display_name'],\n\t\t\t\t\t\t'id' => $row['first_id_member'],\n\t\t\t\t\t\t'href' => !empty($row['first_id_member']) ? $first_poster_href : '',\n\t\t\t\t\t\t'link' => !empty($row['first_id_member']) ? '<a href=\"' . $first_poster_href . '\" title=\"' . $txt['profile_of'] . ' ' . $row['first_display_name'] . '\" class=\"preview\">' . $row['first_display_name'] . '</a>' : $row['first_display_name']\n\t\t\t\t\t),\n\t\t\t\t\t'time' => standardTime($row['first_poster_time']),\n\t\t\t\t\t'html_time' => htmlTime($row['first_poster_time']),\n\t\t\t\t\t'timestamp' => forum_time(true, $row['first_poster_time']),\n\t\t\t\t\t'subject' => $row['first_subject'],\n\t\t\t\t\t'preview' => isset($row['first_body']) ? trim($row['first_body']) : '',\n\t\t\t\t\t'icon' => $icon_sources->getIconName($row['first_icon']),\n\t\t\t\t\t'icon_url' => $icon_sources->getIconURL($row['first_icon']),\n\t\t\t\t\t'href' => $first_topic_href,\n\t\t\t\t\t'link' => '<a href=\"' . $first_topic_href . '\">' . $row['first_subject'] . '</a>'\n\t\t\t\t),\n\t\t\t\t'last_post' => array(\n\t\t\t\t\t'id' => $row['id_last_msg'],\n\t\t\t\t\t'member' => array(\n\t\t\t\t\t\t'username' => $row['last_member_name'],\n\t\t\t\t\t\t'name' => $row['last_display_name'],\n\t\t\t\t\t\t'id' => $row['last_id_member'],\n\t\t\t\t\t\t'href' => !empty($row['last_id_member']) ? $last_poster_href : '',\n\t\t\t\t\t\t'link' => !empty($row['last_id_member']) ? '<a href=\"' . $last_poster_href . '\">' . $row['last_display_name'] . '</a>' : $row['last_display_name']\n\t\t\t\t\t),\n\t\t\t\t\t'time' => standardTime($row['last_poster_time']),\n\t\t\t\t\t'html_time' => htmlTime($row['last_poster_time']),\n\t\t\t\t\t'timestamp' => forum_time(true, $row['last_poster_time']),\n\t\t\t\t\t'subject' => $row['last_subject'],\n\t\t\t\t\t'preview' => isset($row['last_body']) ? trim($row['last_body']) : '',\n\t\t\t\t\t'icon' => $icon_sources->getIconName($row['last_icon']),\n\t\t\t\t\t'icon_url' => $icon_sources->getIconURL($row['last_icon']),\n\t\t\t\t\t'href' => $topic_href,\n\t\t\t\t\t'link' => '<a href=\"' . $topic_href . '\" ' . ($row['num_replies'] == 0 ? '' : 'rel=\"nofollow\"') . '>' . $row['last_subject'] . '</a>',\n\t\t\t\t),\n\t\t\t\t'default_preview' => trim($row[!empty($modSettings['message_index_preview']) && $modSettings['message_index_preview'] == 2 ? 'last_body' : 'first_body']),\n\t\t\t\t'is_sticky' => !empty($row['is_sticky']),\n\t\t\t\t'is_locked' => !empty($row['locked']),\n\t\t\t\t'is_poll' => !empty($modSettings['pollMode']) && $row['id_poll'] > 0,\n\t\t\t\t'is_hot' => !empty($modSettings['useLikesNotViews']) ? $row['num_likes'] >= $modSettings['hotTopicPosts'] : $row['num_replies'] >= $modSettings['hotTopicPosts'],\n\t\t\t\t'is_very_hot' => !empty($modSettings['useLikesNotViews']) ? $row['num_likes'] >= $modSettings['hotTopicVeryPosts'] : $row['num_replies'] >= $modSettings['hotTopicVeryPosts'],\n\t\t\t\t'is_posted_in' => false,\n\t\t\t\t'icon' => $icon_sources->getIconName($row['first_icon']),\n\t\t\t\t'icon_url' => $icon_sources->getIconURL($row['first_icon']),\n\t\t\t\t'subject' => $row['first_subject'],\n\t\t\t\t'new' => !empty($row['id_msg_modified']) && $row['new_from'] <= $row['id_msg_modified'],\n\t\t\t\t'new_from' => $row['new_from'],\n\t\t\t\t'newtime' => $row['new_from'],\n\t\t\t\t'new_href' => getUrl('topic', ['topic' => $row['id_topic'], 'start' => 'msg' . $row['new_from'], 'subject' => $row['first_subject'], $topicseen]) . '#new',\n\t\t\t\t'href' => $href,\n\t\t\t\t'link' => '<a href=\"' . $href . '\" rel=\"nofollow\">' . $row['first_subject'] . '</a>',\n\t\t\t\t'redir_href' => !empty($row['id_redirect_topic']) ? getUrl('topic', ['topic' => $row['id_topic'], 'start' => '0', 'subject' => $row['first_subject'], 'noredir']) : '',\n\t\t\t\t'pages' => $pages,\n\t\t\t\t'replies' => comma_format($row['num_replies']),\n\t\t\t\t'views' => comma_format($row['num_views']),\n\t\t\t\t'likes' => comma_format($row['num_likes']),\n\t\t\t\t'approved' => $row['approved'] ?? 1,\n\t\t\t\t'unapproved_posts' => !empty($row['unapproved_posts']) ? $row['unapproved_posts'] : 0,\n\t\t\t\t'classes' => array(),\n\t\t\t);\n\n\t\t\tif (!empty($row['id_board']))\n\t\t\t{\n\t\t\t\t$board_href = getUrl('board', ['board' => $row['id_board'], 'start' => '0', 'name' => $row['bname']]);\n\t\t\t\t$topics[$row['id_topic']]['board'] = array(\n\t\t\t\t\t'id' => $row['id_board'],\n\t\t\t\t\t'name' => $row['bname'],\n\t\t\t\t\t'href' => $board_href,\n\t\t\t\t\t'link' => '<a href=\"' . $board_href . '.0\">' . $row['bname'] . '</a>'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isset($row['avatar']) || !empty($row['id_attach']))\n\t\t\t{\n\t\t\t\t$topics[$row['id_topic']]['last_post']['member']['avatar'] = determineAvatar($row);\n\t\t\t}\n\t\t\tif (!empty($row['avatar_first']) || !empty($row['id_attach_first']))\n\t\t\t{\n\t\t\t\t$first_avatar = array(\n\t\t\t\t\t'avatar' => $row['avatar_first'],\n\t\t\t\t\t'id_attach' => $row['id_attach_first'],\n\t\t\t\t\t'attachment_type' => $row['attachment_type_first'],\n\t\t\t\t\t'filename' => $row['filename_first'],\n\t\t\t\t\t'email_address' => $row['email_address_first'],\n\t\t\t\t);\n\t\t\t\t$topics[$row['id_topic']]['first_post']['member']['avatar'] = determineAvatar($first_avatar);\n\t\t\t}\n\n\t\t\tdetermineTopicClass($topics[$row['id_topic']]);\n\t\t}\n\n\t\treturn $topics;\n\t}", "public function test_start_subscribes_to_join_topic()\n {\n $this->monitor->start();\n\n $this->assertTrue(\n $this->sessionStub->hasSubscription(SessionMonitor::SESSION_JOIN_TOPIC)\n );\n }", "function fanwood_localize_topic_script() {\n\n\t// Bail if not viewing a single topic\n\tif ( !bbp_is_single_topic() )\n\t\treturn;\n\n\t$user_id = bbp_get_current_user_id();\n\n\t$localizations = array(\n\t\t'currentUserId' => $user_id,\n\t\t'topicId' => bbp_get_topic_id(),\n\t);\n\n\t// Favorites\n\tif ( bbp_is_favorites_active() ) {\n\t\t$localizations['favoritesActive'] = 1;\n\t\t$localizations['favoritesLink'] = bbp_get_favorites_permalink( $user_id );\n\t\t$localizations['isFav'] = (int) bbp_is_user_favorite( $user_id );\n\t\t$localizations['favLinkYes'] = __( 'favorites', 'bbpress' );\n\t\t$localizations['favLinkNo'] = __( '?', 'bbpress' );\n\t\t$localizations['favYes'] = __( 'This topic is one of your %favLinkYes% [%favDel%]', 'bbpress' );\n\t\t$localizations['favNo'] = __( '%favAdd% (%favLinkNo%)', 'bbpress' );\n\t\t$localizations['favDel'] = __( '&times;', 'bbpress' );\n\t\t$localizations['favAdd'] = __( 'Add this topic to your favorites', 'bbpress' );\n\t} else {\n\t\t$localizations['favoritesActive'] = 0;\n\t}\n\n\t// Subscriptions\n\tif ( bbp_is_subscriptions_active() ) {\n\t\t$localizations['subsActive'] = 1;\n\t\t$localizations['isSubscribed'] = (int) bbp_is_user_subscribed( $user_id );\n\t\t$localizations['subsSub'] = __( 'Subscribe', 'bbpress' );\n\t\t$localizations['subsUns'] = __( 'Unsubscribe', 'bbpress' );\n\t\t$localizations['subsLink'] = bbp_get_topic_permalink();\n\t} else {\n\t\t$localizations['subsActive'] = 0;\n\t}\n\n\twp_localize_script( 'bbp_topic', 'bbpTopicJS', $localizations );\n}", "public function getTopic(int $topic_id): ?object {\n foreach ($this->topics as $topic) {\n $article_topic = $topic->entity;\n if ($article_topic->topic->target_id == $topic_id) {\n return $article_topic;\n }\n }\n return NULL;\n }", "function pgm_subscriber_has_subscription($subscriber_id, $list_id){\n //set default value\n $has_subscription = false;\n\n //get the subscriber from database\n $subscriber = get_post($subscriber_id);\n\n //get subscriptions from database\n $subscriptions = pgm_get_subscriptions($subscriber_id);\n\n //check subscriptions for $list_id\n if(in_array($list_id,$subscriptions)){\n\n $has_subscription = true;\n } else{\n\n //leave to default\n }\n\n return $has_subscription;\n}", "function markTopicRead($forumID, $topicID) {\n\t\tglobal $DB;\n\t\t\n\t\t// Pull our read topics information so we can work with it\n\t\t$topicsRead = getTopicsReadArray($forumID);\n\t\t\t\n\t\t// Kill our read row in the DB\n\t\t$sql = \"DELETE FROM `\" . DBTABLEPREFIX . \"topics_read` WHERE user_id='\" . $_SESSION['userid'] . \"' AND forum_id='\" . $forumID . \"' LIMIT 1\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Set this topic read time to right now\n\t\t$topicsRead[$topicID] = time();\n\t\t\n\t\t// Clean out any bad topics (they were probably deleted\n\t\t$topicsRead = array_filter($topicsRead, \"topicExists\");\n\t\t\t\n\t\t// We disable this since we don't want to escape our topic_ids field\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t//$result = $DB->query_insert(\"topics_read\", array('user_id' => $_SESSION['userid'], 'forum_id' => $forumID, 'topic_ids' => serialize($topicsRead)));\n\t\t\n\t\t// Warp everything up and save it\n\t\t$sql = \"INSERT INTO `\" . DBTABLEPREFIX . \"topics_read` (user_id, forum_id, topic_ids) VALUES ('\" . $_SESSION['userid'] . \"', '\" . $forumID . \"', '\" . serialize($topicsRead) . \"')\";\n\t\t$result = $DB->query($sql);\n\t}", "public function getTopic() {\n\t\treturn $this->_topic;\n\t}", "function check_topic_poll_permission($type, $message)\n{\n global $PHORUM;\n\n // Messages that aren't thread starters never can have a\n // topic poll on them. So for those, there can never be\n // a valid permission.\n if (! isset($message[\"parent_id\"]) || $message[\"parent_id\"] != 0)\n return false;\n\n // Get the poll data from the message, if available.\n $poll = null;\n if (isset($message[\"meta\"][\"mod_topic_poll\"])) {\n $poll = $message[\"meta\"][\"mod_topic_poll\"];\n }\n\n // Retrieve the poll settings for the current forum.\n $settings = phorum_mod_topic_poll_get_forumsettings();\n\n $userdata = $PHORUM[\"DATA\"][\"LOGGEDIN\"] ? $PHORUM[\"user\"] : null;\n\n switch ($type)\n {\n case TOPIC_POLL_ADD:\n\n // Only thread starting messages can get a poll.\n if ($message[\"parent_id\"] != 0)\n return false;\n\n // A poll can't be added if one is already available (duh!).\n if (isset($message[\"meta\"][\"mod_topic_poll\"]))\n return false;\n\n // Check the forum poll permission (can be configured from\n // the module settings screen).\n switch ($settings[\"permission\"]) {\n case 1: return true;\n case 2: return $PHORUM[\"DATA\"][\"LOGGEDIN\"];\n case 3: return $PHORUM[\"DATA\"][\"MODERATOR\"];\n case 4: return $PHORUM[\"user\"][\"admin\"];\n default: return false;\n }\n\n case TOPIC_POLL_EDIT:\n\n $PHORUM[\"mod_topic_poll_causes\"][\"deny_edit\"] = NULL;\n\n // If the poll is in use (votes have been cast), then\n // the user can no longer edit it. Only moderators\n // can do that from then on.\n if ($poll != null && $poll[\"total_votes\"] > 0) {\n $is_mod = isset($PHORUM[\"DATA\"][\"MODERATOR\"]) &&\n $PHORUM[\"DATA\"][\"MODERATOR\"];\n if ($is_mod) {\n return true;\n } else {\n $PHORUM[\"mod_topic_poll_causes\"][\"deny_edit\"] = 'NoEditAfterVotes';\n return false;\n }\n }\n\n return true;\n\n case TOPIC_POLL_DELETE:\n\n // Currently, the same rules as for TOPIC_POLL_EDIT apply here.\n return check_topic_poll_permission(TOPIC_POLL_EDIT, $message);\n\n case TOPIC_POLL_SETSTATUS:\n\n // Currently, the user can always deactivate/activate his polls.\n return true;\n\n case TOPIC_POLL_CASTVOTE:\n\n $PHORUM[\"mod_topic_poll_causes\"][\"deny_vote\"] = NULL;\n\n // No voting if the poll is closed.\n $check = check_if_topic_poll_is_open($message);\n if ($check != TOPIC_POLL_OPEN) {\n $PHORUM[\"mod_topic_poll_causes\"][\"deny_vote\"] = $check;\n return false;\n }\n\n // Anonymous users can only vote in case the permission\n // level is set to \"anonymous\".\n if ($userdata == NULL && $poll[\"permission\"] != \"anonymous\") {\n $PHORUM[\"mod_topic_poll_causes\"][\"deny_vote\"] = \"DenyAnonymous\";\n return false;\n }\n\n // Visitors can't vote if they already cast a vote before.\n $vote_already_cast = check_if_topic_poll_vote_was_cast($message);\n if ($vote_already_cast) {\n $PHORUM[\"mod_topic_poll_causes\"][\"deny_vote\"] = \"AlreadyVoted\";\n return false;\n }\n\n // All checks passed! The visitor is allowed to cast a vote.\n return true;\n\n case TOPIC_POLL_REVOKEVOTE:\n\n // No revoking if this isn't allowed from the module settings.\n if (! $settings[\"allow_revoke\"]) {\n return false;\n }\n\n // No revoking if the poll is closed.\n if (check_if_topic_poll_is_open($message) != TOPIC_POLL_OPEN) {\n return false;\n }\n\n // Registered users who have cast a vote can revoke it.\n $vote_already_cast = check_if_topic_poll_vote_was_cast($message);\n if ($vote_already_cast == TOPIC_POLL_CAST_USER) {\n return true;\n }\n\n return false;\n\n case TOPIC_POLL_VIEWRESULTS:\n\n // Moderators always can view the results without voting.\n $is_mod = isset($PHORUM[\"DATA\"][\"MODERATOR\"]) &&\n $PHORUM[\"DATA\"][\"MODERATOR\"];\n if ($is_mod) return true;\n\n // For other users, the admin option for viewing must be enabled.\n return $settings[\"allow_novoteview\"];\n\n default:\n die(\"Internal error in check_topic_poll_permission(): \" .\n \"unknown permission type: \" . htmlspecialchars($type));\n }\n}", "public function InsertTopic($fromArticle=false,$useArticleDescr=false,\n $useArticleText=false,$link2article=false)\n {\n global $DB, $categoryid, $sdlanguage, $sdurl, $userinfo, $usersystem;\n\n //SD351: create topic from article\n $fromArticle = (defined('IN_ADMIN') && !empty($fromArticle));\n if($fromArticle && empty($useArticleDescr) && empty($useArticleText))\n {\n return false;\n }\n\n // SD313: security check against spam/bot submissions\n if(empty($fromArticle))\n {\n if(!CheckFormToken(FORUM_TOKEN, false))\n {\n $this->conf->RedirectPageDefault('<strong>'.$sdlanguage['error_invalid_token'].'</strong><br />',true);\n return false;\n }\n if(empty($this->conf->forum_arr['forum_id']) || ($this->conf->forum_arr['forum_id']<1))\n {\n $this->conf->RedirectPageDefault('<strong>'.$this->conf->plugin_phrases_arr['err_invalid_forum_id'] . '</strong>',true);\n return false;\n }\n }\n\n $errors_arr = array();\n\n if(empty($fromArticle))\n {\n $topic_title = trim(GetVar('forum_topic_title', '', 'string', true, false));\n $post_text = trim(GetVar('forum_post', '', 'string', true, false));\n\n if(!($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator) ||\n !empty($userinfo['require_vvc'])) //SD340: require_vvc\n {\n if(!CaptchaIsValid('amihuman'))\n {\n $errors_arr[] = $sdlanguage['captcha_not_valid'];\n }\n }\n\n //SD343: combined blacklist check\n if($this->conf->IsUserBlacklisted())\n {\n WatchDog('Forum','<b>Forum spam topic: '.$userinfo['username'].\n '</b>, IP: </b><span class=\"ipaddress\">'.USERIP.'</span></b><br />'.\n 'in TopicID: '.$this->conf->topic_arr['topic_id'].', PostID: '.$post_id,\n WATCHDOG_ERROR);\n $this->DisplayTopic(true,$sdlanguage['ip_listed_on_blacklist'].' '.USERIP);\n return false;\n }\n\n //SD342: censor non-admin text if enabled\n if($this->conf->censor_posts)\n {\n $topic_title = sd_censor($topic_title);\n $post_text = sd_censor($post_text);\n }\n }\n else\n {\n // #################################################################\n // SD351: post article as forum topic\n // #################################################################\n $topic_title = trim(GetVar('title', '', 'html', true, false));\n $topic_title = htmlspecialchars(strip_alltags($topic_title));\n\n $post_text = '';\n if(!empty($useArticleDescr))\n {\n $article_descr = trim(GetVar('description', '', 'html', true, false));\n if(sd_strlen($article_descr))\n {\n $post_text = trim(sd_ConvertHtmlToBBCode($article_descr));\n if(sd_strlen($post_text))\n {\n $post_text .= \"\\r\\n\\r\\n\";\n }\n }\n }\n if(!empty($useArticleText))\n {\n $article_text = trim(GetVar('article', '', 'html', true, false));\n $article_text = sd_ConvertHtmlToBBCode($article_text);\n if(sd_strlen($article_text))\n {\n $post_text2 = trim($article_text);\n if(sd_strlen($post_text2))\n {\n $post_text .= \"\\r\\n\\r\\n\".$post_text2;\n }\n }\n }\n if(!empty($link2article) && ($link2article!==false))\n {\n $post_text .= $link2article;\n }\n unset($article_descr,$article_text,$post_text2,$useArticleDescr);\n }\n\n $sticky = 0;\n $open = 1;\n $moderated = GetVar('moderate_topic', false, 'bool', true, false)?1:0;\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator)\n {\n $open = GetVar('lock_topic', 0, 'bool', true, false)?0:1; //SD351\n $sticky = GetVar('stick_topic', false, 'bool', true, false)?1:0;\n }\n else\n {\n if(!empty($this->conf->forum_arr['moderated']))\n {\n $moderated = SDForumConfig::UsergroupsModerated($userinfo['usergroupids'],\n $this->conf->forum_arr['moderated'])?1:0;\n }\n }\n\n //SD343: content filter for moderated posts\n if(empty($errors_arr) && $moderated &&\n !$this->conf->IsSiteAdmin && !$this->conf->IsAdmin && !$this->conf->IsModerator)\n {\n //SD343: up to x posts within y minutes if moderated\n if($this->conf->mod_post_limit && $this->conf->mod_time_limit)\n {\n $trigger = $DB->query_first('SELECT COUNT(post_id) postcount FROM {p_forum_posts}'.\n \" WHERE ((user_id = %d) OR (ip_address = '%s')) AND (`date` > %d) AND (moderated = 1)\",\n $userinfo['userid'], USERIP, (TIME_NOW - ($this->conf->mod_time_limit*60)));\n if(!empty($trigger['postcount']) && ($trigger['postcount'] >= $this->conf->mod_post_limit))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['message_too_many_moderated'];\n }\n }\n\n if(empty($errors_arr))\n {\n $topic_title = htmlspecialchars(strip_alltags(sd_htmlawed(unhtmlspecialchars($topic_title))));\n $post_text = htmlspecialchars(sd_htmlawed(unhtmlspecialchars($post_text)));\n }\n }\n\n //SD343: min. topic/post length checks\n $topic_title = trim($topic_title);\n $post_text = trim($post_text);\n $plen = strlen($topic_title);\n\n if(empty($fromArticle))\n {\n if(($plen < 3) || ($plen < $this->conf->plugin_settings_arr['minimum_topic_title_length']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['err_topic_no_title'];\n }\n\n $plen = strlen($post_text);\n if(($plen < 2) || ($plen < $this->conf->plugin_settings_arr['minimum_post_text_length']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['post_too_short'];\n }\n }\n\n if(empty($errors_arr))\n {\n $DB->result_type = MYSQL_ASSOC;\n if($topic_exists_arr = $DB->query_first('SELECT ft.topic_id FROM {p_forum_topics} ft'.\n ' INNER JOIN {p_forum_forums} ff ON ft.forum_id = ff.forum_id'.\n ' WHERE ff.forum_id = %d'.\n ($this->conf->IsSiteAdmin ? '' : ' AND ff.online = 1').\n \" AND trim(ft.title) = '%s' AND ft.post_user_id = %d\",\n $this->conf->forum_arr['forum_id'],\n $DB->escape_string($topic_title),\n $userinfo['userid']))\n {\n $errors_arr[] = $this->conf->plugin_phrases_arr['err_topic_no_repeat'];\n }\n }\n\n if(count($errors_arr))\n {\n DisplayMessage('<strong>'.implode('<br />', $errors_arr). '</strong>', true);\n if(empty($fromArticle))\n {\n $this->DisplayTopicForm();\n }\n return false;\n }\n\n // all is good, insert new topic\n $DB->query('INSERT INTO {p_forum_topics}'.\n ' (forum_id, date, post_count, views, open, post_user_id,'.\n ' post_username, title, last_post_date, last_post_username, sticky, moderated)'.\n ' VALUES (%d, %d, 1, 0, %d, ' . $userinfo['userid'] .\n \", '%s', '%s', %d, '%s', $sticky, $moderated)\",\n $this->conf->forum_id, TIME_NOW, $open,\n $DB->escape_string($userinfo['username']),\n $DB->escape_string($topic_title),\n TIME_NOW,\n $DB->escape_string($userinfo['username']));\n\n if($topic_id = $DB->insert_id())\n {\n $DB->query('INSERT INTO {p_forum_posts}'.\n ' (topic_id, username, user_id, date, post, ip_address, moderated) VALUES'.\n \" (%d, '%s', %d, %d, '%s', '%s', %d)\",\n $topic_id, $DB->escape_string($userinfo['username']),\n $userinfo['userid'], TIME_NOW,\n $DB->escape_string($post_text), IPADDRESS, $moderated);\n\n if($post_id = $DB->insert_id())\n {\n //SD351: set config's settings\n $this->conf->topic_id = $topic_id;\n $this->conf->topic_arr = array();\n $this->conf->topic_arr['topic_id'] = (int)$topic_id;\n $this->conf->topic_arr['forum_id'] = (int)$this->conf->forum_arr['forum_id'];\n $this->conf->topic_arr['title'] = $topic_title;\n $this->conf->topic_arr['sticky'] = $sticky;\n $this->conf->topic_arr['moderated'] = $moderated;\n $this->conf->topic_arr['open'] = $open;\n $this->conf->topic_arr['post_user_id'] = (int)$userinfo['userid'];\n $this->conf->topic_arr['post_username'] = $userinfo['username'];\n $this->conf->topic_arr['first_post_id'] = (int)$post_id;\n $this->conf->topic_arr['last_post_id'] = (int)$post_id;\n $this->conf->topic_arr['last_post_date'] = TIME_NOW;\n $this->conf->topic_arr['last_post_username'] = $userinfo['username'];\n\n $DB->query(\"UPDATE {p_forum_topics} SET first_post_id = $post_id, last_post_id = $post_id\n WHERE topic_id = $topic_id LIMIT 1\");\n\n if(!$moderated)\n {\n $DB->query(\"UPDATE {p_forum_forums} SET last_topic_title = '\".$DB->escape_string(trim($topic_title)).\"',\n topic_count = (IFNULL(topic_count,0) + 1),\n post_count = (IFNULL(post_count,0) + 1),\n last_post_date = \" . TIME_NOW . \",\n last_post_username = '\" . $DB->escape_string($userinfo['username']) . \"',\n last_topic_id = $topic_id,\n last_post_id = $post_id\n WHERE forum_id = \" . $this->conf->forum_arr['forum_id'] . '\n LIMIT 1');\n\n //SD322: update user's thread count\n //SD332: update to \"user_post_count\" was missing till now\n if($this->conf->is_sd_users) //SD342\n $DB->query('UPDATE {users} SET user_thread_count = (IFNULL(user_thread_count,0) + 1),'.\n ' user_post_count = (IFNULL(user_post_count,0) + 1) WHERE userid = %d', $userinfo['userid']);\n\n //SD351: update user title\n SDUserCache::UpdateUserTitle($userinfo['userid']);\n }\n\n if(empty($fromArticle))\n {\n //SD343: check selected prefix (if present) against tags table, based on sub-forum/usergroup\n if($prefix_id = Is_Valid_Number(GetVar('prefix_id', 0, 'whole_number', true, false),0,1,999999999))\n {\n $tconf = array(\n 'chk_ugroups' => !$this->conf->IsSiteAdmin,\n 'pluginid' => $this->conf->plugin_id,\n 'objectid' => 0,\n 'tagtype' => 2,\n 'ref_id' => 0,\n 'allowed_id' => $this->conf->forum_arr['forum_id'],\n );\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $prefixes = SD_Tags::GetPluginTagsAsArray($tconf);\n if(($prefixes !== false) && isset($prefixes[$prefix_id]))\n {\n SD_Tags::StorePluginTags($this->conf->plugin_id, $topic_id, $prefixes[$prefix_id], 2, $prefix_id, true);\n }\n }\n\n //SD343: add topic tags if allowed for usergroup\n $tag_ug = sd_ConvertStrToArray($this->conf->plugin_settings_arr['tag_submit_permissions'],'|');\n if($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($tag_ug) && @array_intersect($userinfo['usergroupids'], $tag_ug)))\n {\n require_once(SD_INCLUDE_PATH.'class_sd_tags.php');\n $tags = GetVar('tags', '', 'string', true, false);\n SD_Tags::StorePluginTags($this->conf->plugin_id, $topic_id, $tags, 0, 0, true);\n }\n\n // insert attachment\n if($this->conf->attach_path_ok && isset($_FILES['attachment']) && !empty($_FILES['attachment']['name']) &&\n ($this->conf->IsSiteAdmin || $this->conf->IsAdmin || $this->conf->IsModerator ||\n (!empty($userinfo['plugindownloadids']) &&\n @in_array($this->conf->plugin_id,$userinfo['plugindownloadids']) &&\n !empty($this->conf->plugin_settings_arr['valid_attachment_types']))))\n {\n $attachment_arr = $_FILES['attachment'];\n // if an attachment was uploaded, then it will be inserted after the ticket is created\n $attachment_uploaded = false;\n // check if attachment was uploaded\n if($attachment_arr['error'] != 4)\n {\n list($attachment_uploaded, $attachment_stored_filename, $error) = $this->UploadAttachment($attachment_arr);\n if(!$attachment_uploaded)\n {\n if($error !== false)\n $errors_arr[] = $error;\n }\n else\n {\n $DB->query(\"INSERT INTO {p_forum_attachments}\n (attachment_id, post_id, attachment_name, filename, filesize, filetype, user_id, username, uploaded_date)\n VALUES (NULL, %d, '%s', '%s', %d, '%s', %d, '%s', \" . TIME_NOW . \")\",\n $post_id,\n $DB->escape_string($attachment_arr['name']),\n $DB->escape_string($attachment_stored_filename),\n $attachment_arr['size'],\n $DB->escape_string($attachment_arr['type']),\n $userinfo['userid'],\n $DB->escape_string($userinfo['username']));\n $DB->query('UPDATE {p_forum_posts}'.\n ' SET attachment_count = (IFNULL(attachment_count,0)+1)'.\n ' WHERE post_id = %d', $post_id);\n }\n }\n }\n } //$fromArticle\n\n }\n }\n\n //SD351: if from article then return topic_id\n if(!empty($fromArticle))\n {\n return empty($topic_id)?false:(int)$topic_id;\n }\n\n //SD342: send email notifications for subscriptions\n if(empty($errors_arr))\n {\n if($sub = new SDSubscription($userinfo['userid'],$this->conf->plugin_id,\n $this->conf->forum_arr['forum_id'],'forum',$categoryid))\n {\n $sub->SendNotifications();\n }\n unset($sub);\n\n global $SDCache;\n if(!empty($SDCache) && $SDCache->IsActive()) $SDCache->delete_cacheid(FORUM_CACHE_FORUMS);\n\n $link = $this->conf->RewritePostLink($topic_id,$topic_title,$post_id);\n RedirectFrontPage($link, $this->conf->plugin_phrases_arr[$moderated ?\n 'message_topic_awaits_approval' : 'message_topic_created']);\n\n return true;\n }\n $this->conf->RedirectPageDefault('Error!');\n return false;\n }", "public function topic(){\n return $this->belongsTo('App\\Topic','topics_id');\n }", "function getTopicIdByPermissionCheck($topic_id=0){\n\t\tglobal $xoopsUser ;\n\t\n\t\t$groups = $xoopsUser->getGroups();\n\t\t$tbl = $this->db->prefix( $this->mydirname.\"_topic_access\" );\n\t\t$ret = NULL;\n\t\tforeach($groups as $key => $gid){\n\t\t\t$sql = \"SELECT topic_id FROM \" . $tbl . \" WHERE topic_id = \" .$topic_id. \" AND groupid = \" .$gid. \" AND can_post = 1 AND can_edit = 1\";\n\t\t\t$result = $this->db->query($sql);\n\t\t\tif( list($catid) = $this->db->fetchRow($result) ) {\n\t\t\t\t$ret = $catid;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (is_null($ret)){\n\t\t\tforeach($groups as $key => $gid){\n\t\t\t\t$sql = \"SELECT topic_id FROM \" . $tbl . \" WHERE groupid = \" .$gid. \" AND can_post = 1 AND can_edit = 1\";\n\t\t\t\t$result = $this->db->query($sql);\n\t\t\t\tif( list($catid) = $this->db->fetchRow($result) ) {\n\t\t\t\t\t$ret = $catid;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}" ]
[ "0.65238315", "0.63075095", "0.6247921", "0.6153368", "0.6061307", "0.59992796", "0.5973263", "0.59276825", "0.59218645", "0.58924973", "0.5863018", "0.5833456", "0.5817941", "0.58052564", "0.57910913", "0.57778174", "0.5754452", "0.572041", "0.57005197", "0.57005197", "0.56967247", "0.564694", "0.5633174", "0.5618433", "0.560367", "0.55982715", "0.5589824", "0.558313", "0.5574713", "0.5572088", "0.55490965", "0.55414623", "0.5537343", "0.5534916", "0.55322295", "0.55304074", "0.5526563", "0.5514248", "0.55018073", "0.5500735", "0.549865", "0.5461217", "0.54427326", "0.54180515", "0.541207", "0.53950393", "0.5393015", "0.5390377", "0.5386241", "0.53860503", "0.5385526", "0.5375054", "0.53668845", "0.53616816", "0.53577465", "0.5319957", "0.5311681", "0.5300105", "0.5290522", "0.52857476", "0.528375", "0.5282526", "0.5278204", "0.5258934", "0.5253106", "0.52458775", "0.5241986", "0.52413255", "0.5226401", "0.5208069", "0.51812583", "0.51785576", "0.51759344", "0.5169578", "0.51680195", "0.515613", "0.5152129", "0.5147891", "0.5146153", "0.5142097", "0.5134217", "0.51338774", "0.51241755", "0.5118834", "0.5117028", "0.51122636", "0.51105845", "0.5109841", "0.51092553", "0.50937957", "0.5089777", "0.5089233", "0.5079184", "0.5077892", "0.5071399", "0.5069955", "0.5067331", "0.50577456", "0.50552076", "0.50505245", "0.50472474" ]
0.0
-1
protected $with = ['prescriptions'];
public function prescriptions() { return $this->hasMany('OEMR\\Models\\Prescription'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function psubscriptions(){\n return $this->hasMany(Psubscription::class);\n }", "public function prescriptions()\n {\n return $this->hasManyThrough( Prescription::class, Appointment::class);\n }", "public function prescriptions() {\n return $this->hasManyThrough('App\\Prescription', 'App\\Patient', 'clinic_id', 'patient_id', 'id');\n }", "public function purchaces()\n\n{\n return $this->hasMany(Purchace::class);\n\n }", "public function subscriptions()\n {\n return $this->hasMany('DragonLancers\\Subscription');\n }", "public function loansubscription(){\n return $this->belongsTo(Lsubscription::class,'lsubscription_id');\n }", "public function stripe_transactions(){\n return $this->hasMany('App\\StripeTransaction');\n }", "public function lsubscriptions(){\n return $this->hasMany(Lsubscription::class);\n }", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class);\n }", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class);\n }", "public function subscription()\n {\n return $this->belongsToMany('App\\SubscriptionList');\n }", "public function purchases(){\n return $this->hasMany(IngredientPurchase::class);\n }", "public function stock(){\n return $this->belongsTo( Stock::class );\n }", "public function usages(){\n return $this->hasMany(config('subscriptions.models.usage'), 'subscription_id');\n }", "public function discounts()\n {\n return $this->hasMany('App\\Discount','subscription_id');\n }", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function quotation()\n {\n return $this->belongsTo('App\\Quotation');\n }", "public function purchase_order()\n {\n return $this->belongsTo( PurchaseOrder::class );\n }", "public function purchases()\n {\n return $this->hasMany('App\\Models\\Purchase');\n }", "public function prescription()\n {\n return $this->hasOne('App\\Model\\PreScription','request_id');\n }", "public function transaction(){\n return $this->hasMany(Transaction::class);\n }", "public function with($relations)\n {\n }", "public function paymentMethodRecord(){\n return $this->belongsTo('App\\PaymentMethodRecord');\n }", "public function susPrestaciones()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Prestacion' , 'clave_beneficiario' , 'clave_beneficiario');\t\n\t}", "public function subscribers(){\n return $this->belongsToMany('\\App\\Subscriber','subscriber_subscription_type')->withPivot('subscription_id', 'startdate', 'closedate','status', 'limit');\n }", "public function supplies(){\n return $this->hasMany('CValenzuela\\Supply');\n }", "public function subscribers() {\n return $this->belongsToMany('App\\Subscribe')->withTimestamps();\n }", "public function payments()\n {\n return $this->belongsTo('App\\Payment');\n }", "public function provincy(){\n return $this->belongsTo('App\\Provincy', 'provincy_id');\n }", "public function inscripciones(){\n return $this->hasMany('App\\Models\\Inscripcion');\n }", "public function solicitud(){\n return $this->belongsTo('App\\Solicitud');\n }", "public function inscripcion(){\n return $this->belongsTo('App\\Models\\Inscripcion');\n }", "public function stock()\n {\n return $this->belongsTo(Stock::class);\n }", "public function purchase_details()\n {\n return $this->hasMany('App\\PurchaseDetails');\n }", "public function addons()\n {\n return $this->belongsToMany(Addon::class,'q2_pricing_addons');\n }", "public function period()\n {\n return $this->belongsTo('App\\Period');\n }", "public function subscriptions(): HasMany\n {\n return $this->hasMany(PlanSubscription::class);\n }", "public function pais(){\n return $this->belongsTo('App\\Models\\Pais');//relaciona provincia con pais\n }", "public function FromCashiers()\n {\n return $this->belongsTo('App\\Http\\Models\\Cashiers' ,'FromCashierID')->select();\n }", "public function payments(){\n return $this->hasMany('App\\Payment');\n }", "public function pregunta(){\n return $this->belongsTo(Pregunta::class);\n }", "public function produks()\n {\n return $this->belongsTo(produks::class, 'produk_id')->with('penjuals');\n }", "public function plans(){\n return $this->belongsToMany('App\\Models\\Plan');\n }", "public function invoice()\n {\n return $this->belongsTo(InvoiceProxy::modelClass(), 'saas_subscription_invoice_id');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function subscriptions()\n {\n return $this->hasMany(TeamSubscription::class, 'team_id')->orderBy('created_at', 'desc');\n }", "public function train(){\n\t\t\n\t\treturn $this->belongsTo('Alsaudi\\\\Eloquent\\\\TrainRelation');\n\t}", "public function store(){\n return $this->belongsTo(Store::class);\n }", "public function estudiantes(){\n return $this->hasMany('App\\Estudiante');\n }", "public function subscription()\n {\n return $this->hasOne('App\\Subscription');\n }", "public function revenues()\n {\n return $this->hasMany('App\\revenue','store_id');\n }", "public function transaction()\n {\n return $this->belongsTo('App\\Models\\Transaction','transaction_id');\n }", "public function response(){\n return $this->hasMany(App\\Response::class);\n}", "public function pledger()\n {\n return $this->belongsTo(Pledger::class);\n }", "public function __construct(){\n\n $this->all_orders='App\\UserOrder'::with('get_order_details.get_product_details')->whereDate('created_at','>',Carbon::today()->subYear(1)->toDateString())->orderBy('created_at','desc')->get();\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function selcom_transactions(){\n return $this->hasMany('App\\SelcomTransaction');\n }", "public function goods()\n {\n return $this->belongsTo(Goods::class);\n }", "public function trader_partners () {\n //return $this->hasMany('App\\TraderPartner');\n return $this->hasMany('App\\TraderPartner', 'trader_id');\n // return $this->hasMany(TraderPartner::class);\n }", "public function transactions(){\n return $this->hasMany('App\\Transaction');\n }", "public function supplier()\n {\n \treturn $this->belongsTo('App\\Supplier');\n }", "public function viewprescriptions(){\n \n $prescriptions_table = TableRegistry::get('Prescriptions');\n $prescriptions = $prescriptions_table->find()->contain(['Users','Patients','Diagnosisreports','Labtests'])\n ->order(['creation_timestamp'=>'Desc']);\n $this->set('prescriptions', $prescriptions);\n $this->viewBuilder()->setLayout('backend');\n }", "public function questions(){\n return $this->hasMany(App\\Question::class);\n}", "public function surveys(){\n return $this->belongsToMany('App\\surveys');\n }", "public function brokerage()\n {\n return $this->belongsTo(Brokerage::class);\n }", "public function brokerage()\n {\n return $this->belongsTo(Brokerage::class);\n }", "public function purchase()\r\n {\r\n return $this->hasOne('App\\Purchase');\r\n }", "public function suburb()\n {\n return $this->belongsTo('App\\Suburb');\n }", "public function bus_request(){\n return $this->hasMany('App\\Models\\BusRequest','vendor_id');\n }", "public function transaction(){\n return $this->hasMany(Transaction::class);\n }", "public function vendor()\n {\n return $this->belongsTo('App\\\\Vendor');\n }", "public function SubscriberInfo() {\n return $this->belongsToMany ( Customer::class, 'subscribers' );\n }", "public function shop()\n {\n return $this->belongsTo('App\\Model\\Shop');\n }", "public function pais(){\r\n return $this->belongsTo('pais');\r\n }", "public function periodo(){\n return $this->belongsTo('App\\Periodo', 'codigo_per');\n }", "public function buyer(){\n \treturn $this->belongsTo(Buyer::class);\n }", "public function paymentMethod()\r\n {\r\n \treturn $this->belongsTo('App\\PaymentMethod');\r\n }", "public function loan(){\n return $this->belongsTo(Loan::class);\n }", "public function instituciones(){\n return $this->belongsTo('App\\Institucion');\n }", "public function actividades(){\n return $this->hasMany('App\\Actividad');\n }", "public function post(){return $this->belongsTo('App\\Post');}", "public function skus()\n {\n return $this->hasMany('App\\Models\\Sku');\n }", "public function Subscribers() {\n return $this->hasMany ( Subscribers::class )->where('is_active', 1);\n }", "public function offer(){\n return $this->belongsTo('App\\Models\\Offer', 'offer_id', 'id');\n }", "public function payment()\n {\n return $this->belongsTo('App\\Models\\Payment','id','trip_id');\n }", "public function bookings(){\n return $this->belongsToMany('App\\Booking', 'payments', 'payment_status_id', 'booking_id');\n }", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "public function supply()\n {\n return $this->belongsTo(Supply::class, 'supply_id')->withTrashed();\n }", "public function week_plans()\n {\n return $this->belongsToMany('App\\WeekPlan');\n }", "public function vendor() {\n \n return $this->belongsTo('Vendor','vendor_id','id');\n }", "public function supplier()\n {\n return $this->belongsTo('App\\Supplier');\n }", "public function invoice(){\n return $this->belongsTo('App\\Models\\Invoice');\n }", "public function Booking()\n {\n return $this->hasMany('App\\Booking');\n }", "public function viajes(){\n return $this->hasMany(Traveler::class);\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function rents(){\n return $this->belongsToMany(Rent::class);\n }", "public function vouchers(){\n return $this->hasMany(Voucher::class);\n }", "public function prisoners()\n {\n return $this->hasMany('App\\Prisoner','prisoner_id');\n }", "public function with(): array\n {\n return $this->with;\n }" ]
[ "0.6929301", "0.691931", "0.6798074", "0.6751059", "0.64601225", "0.642365", "0.64160514", "0.63893235", "0.63802713", "0.63802713", "0.6376317", "0.6339264", "0.628556", "0.62489694", "0.6233389", "0.62204355", "0.62204355", "0.62014526", "0.618387", "0.61817706", "0.6176363", "0.610887", "0.6095737", "0.6051864", "0.6050351", "0.6045643", "0.6040202", "0.60246134", "0.6022246", "0.60191655", "0.6015864", "0.6011649", "0.6001371", "0.6000318", "0.5995609", "0.5986105", "0.59649557", "0.59627503", "0.59541947", "0.5946819", "0.59424967", "0.5940173", "0.5936965", "0.59321654", "0.5927848", "0.59175164", "0.591562", "0.5905165", "0.5896609", "0.5892224", "0.58896065", "0.5887087", "0.58835423", "0.5862586", "0.5860852", "0.5858495", "0.58577734", "0.58550555", "0.5854109", "0.5852371", "0.5831292", "0.5827959", "0.58252996", "0.58241624", "0.58227247", "0.58219147", "0.58219147", "0.5820333", "0.5819718", "0.5817847", "0.5816969", "0.58143723", "0.58142066", "0.5808955", "0.58068246", "0.58044887", "0.58036697", "0.58018696", "0.57983077", "0.57863414", "0.57862586", "0.57778764", "0.5765355", "0.57633495", "0.5760558", "0.57568884", "0.5754968", "0.5752875", "0.5746119", "0.5745894", "0.5744147", "0.5737894", "0.57362604", "0.57336813", "0.5730494", "0.57299036", "0.57274973", "0.5724872", "0.57240623", "0.57207304" ]
0.68412477
2
/ for some reason, $OPT isn't accessible from here, even when config.php is explicitly included. however, $GLOBALS["OPT"] works fine.
function getFullPath($url) { $fp = $_SERVER["SERVER_PORT"] == "443" ? "https://" : "http://"; $fp .= $_SERVER["HTTP_HOST"]; $dir = dirname($_SERVER["PHP_SELF"]); if ($dir != "/") $fp .= $dir; $fp .= "/" . $url; return $fp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asp_parse_options() {\r\r\n foreach ( wd_asp()->o as $def_k => $o ) {\r\r\n if ( preg_match(\"/\\_def$/\", $def_k) ) {\r\r\n $ok = preg_replace(\"/\\_def$/\", '', $def_k);\r\r\n\r\r\n // Dang, I messed up this elegant solution..\r\r\n if ( $ok == \"asp_it\")\r\r\n $ok = \"asp_it_options\";\r\r\n\r\r\n wd_asp()->o[$ok] = asp_decode_params( get_option($ok, wd_asp()->o[$def_k]) );\r\r\n wd_asp()->o[$ok] = array_merge(wd_asp()->o[$def_k], wd_asp()->o[$ok]);\r\r\n }\r\r\n }\r\r\n // Long previous version compatibility\r\r\n if ( wd_asp()->o['asp_caching'] === false )\r\r\n wd_asp()->o['asp_caching'] = wd_asp()->o['asp_caching_def'];\r\r\n\r\r\n // The globals are a sitewide options\r\r\n wd_asp()->o['asp_glob'] = get_site_option('asp_glob', wd_asp()->o['asp_glob_d']);\r\r\n wd_asp()->o['asp_glob'] = array_merge(wd_asp()->o['asp_glob_d'], wd_asp()->o['asp_glob']);\r\r\n}", "function options() {\n require( TEMPLATE_PATH . \"/options.php\" );\n}", "function get_settings($option)\n {\n }", "function getConfig($key)\n{\n return $GLOBALS['config'][$key];\n}", "abstract protected function define_my_settings();", "function __get_option($setting)\n {\n }", "function get_config()\r\n{\r\n global $g_config;\r\n return $g_config;\r\n}", "public function options_load();", "function scs_get_option()\n\t{\n\t\t$option = get_option( basename(dirname(__FILE__)) );\n\t\tif ( !$option ) {\n\t\t\t$option = array( 'state' => 'normal', 'logged_in_permission' => true );\n\t\t\tadd_option(basename(dirname(__FILE__)), $option);\n\t\t}\n\n\t\treturn $option;\n\t}", "function parseCliOptions2(){\n global $argv;\n \n if ( isset($argv[1]) ) {\n global $site_path;\n $site_path = $argv[1];\n }\n \n global $verbose;\n $verbose = false;\n}", "function wassupoptions() {\n\t\t//# initialize class variables with current options \n\t\t//# or with defaults if none\n\t\t$this->loadSettings();\n\t}", "function cxense_get_opt($name) {\n if( $opt = get_option($name) ) {\n return $opt;\n } else {\n $name = strtoupper($name);\n return defined($name) ? constant($name) : false;\n }\n}", "function rst_settings()\n{\n require_once('inc/inc.rst-settings.php');\n}", "function define_globals() {\n\n $client_key = get_option('livefyre_apps-livefyre_domain_key', '' );\n $profile_domain = get_option('livefyre_apps-livefyre_domain_name', 'livefyre.com' );\n $dopts = array(\n 'livefyre_tld' => LFAPPS_COMMENTS_DEFAULT_TLD\n );\n $uses_default_tld = (strpos(LFAPPS_COMMENTS_DEFAULT_TLD, 'livefyre.com') === 0);\n \n $this->top_domain = ( $profile_domain == LFAPPS_COMMENTS_DEFAULT_PROFILE_DOMAIN ? LFAPPS_COMMENTS_DEFAULT_TLD : $profile_domain );\n $this->http_url = ( $uses_default_tld ? \"http://www.\" . LFAPPS_COMMENTS_DEFAULT_TLD : \"http://\" . LFAPPS_COMMENTS_DEFAULT_TLD );\n $this->api_url = \"http://api.$this->top_domain\";\n self::$quill_url = \"http://quill.$this->top_domain\";\n $this->admin_url = \"http://admin.$this->top_domain\";\n $this->assets_url = \"http://zor.\" . LFAPPS_COMMENTS_DEFAULT_TLD;\n $this->bootstrap_url = \"http://bootstrap.$this->top_domain\";\n \n // for non-production environments, we use a dev url and prefix the path with env name\n $bootstrap_domain = 'bootstrap-json-dev.s3.amazonaws.com';\n $environment = $dopts['livefyre_tld'] . '/';\n if ( $uses_default_tld ) {\n $bootstrap_domain = 'data.bootstrap.fyre.co';\n $environment = '';\n }\n \n $existing_blogname = $this->ext->get_option( 'livefyre_blogname', false );\n if ( $existing_blogname ) {\n $site_id = $existing_blogname;\n } else {\n $site_id = get_option('livefyre_apps-livefyre_site_id', false );\n }\n\n self::$bootstrap_url_v3 = \"http://$bootstrap_domain/$environment$profile_domain/$site_id\";\n \n $this->home_url = $this->ext->home_url();\n $this->plugin_version = LFAPPS_COMMENTS_PLUGIN_VERSION;\n\n }", "function acapi_get_option_file() {\n $defaults = acapi_common_options();\n return drush_get_option('ac-config', $defaults['ac-config']['default_value']);\n}", "public function testconfig_vars()\n\t{\n\t\t$vars = array ('sys_name',\n\t\t\t 'sys_user_reg_restricted',\n\t\t\t 'sys_require_accept_conditions',\n\t\t\t 'sys_project_reg_restricted',\n\t\t\t 'sys_use_private_project',\n\t\t\t 'sys_default_domain',\n\t\t\t 'sys_scm_tarballs_path',\n\t\t\t 'sys_scm_snapshots_path',\n\t\t\t 'sys_theme',\n\t\t\t 'sys_lang',\n\t\t\t 'sys_default_timezone',\n\t\t\t 'sys_default_country_code',\n\t\t\t 'sys_use_scm',\n\t\t\t 'sys_use_tracker',\n\t\t\t 'sys_use_forum',\n\t\t\t 'sys_use_pm',\n\t\t\t 'sys_use_docman',\n\t\t\t 'sys_use_diary',\n\t\t\t 'sys_use_news',\n\t\t\t 'sys_use_mail',\n\t\t\t 'sys_use_survey',\n\t\t\t 'sys_use_frs',\n\t\t\t 'sys_use_project_tags',\n\t\t\t 'sys_use_project_full_list',\n\t\t\t 'sys_use_fti',\n\t\t\t 'sys_use_ftp',\n\t\t\t 'sys_use_trove',\n\t\t\t 'sys_use_snippet',\n\t\t\t 'sys_use_ssl',\n\t\t\t 'sys_use_people',\n\t\t\t 'sys_use_shell',\n\t\t\t 'sys_use_ratings',\n\t\t\t 'sys_use_ftpuploads',\n\t\t\t 'sys_use_manual_uploads',\n\t\t\t 'sys_use_gateways',\n\t\t\t 'sys_use_project_vhost',\n\t\t\t 'sys_use_project_database',\n\t\t\t 'sys_use_project_multimedia',\n\t\t\t 'sys_download_host',\n\t\t\t 'sys_shell_host',\n\t\t\t 'sys_users_host',\n\t\t\t 'sys_lists_host',\n\t\t\t 'sys_scm_host',\n\t\t\t 'sys_forum_return_domain',\n\t\t\t 'sys_chroot',\n\t\t\t 'sys_upload_dir',\n\t\t\t 'sys_ftp_upload_dir',\n\t\t\t 'sys_ftp_upload_host',\n\t\t\t 'sys_apache_user',\n\t\t\t 'sys_apache_group',\n\t\t\t 'sys_require_unique_email',\n\t\t\t 'sys_bcc_all_email_address',\n\t\t\t 'sys_themeroot',\n\t\t\t 'sys_force_login',\n\t\t\t 'sys_custom_path',\n\t\t\t 'sys_plugins_path',\n\t\t\t 'sys_use_jabber',\n\t\t\t 'sys_jabber_user',\n\t\t\t 'sys_jabber_server',\n\t\t\t 'sys_jabber_port',\n\t\t\t 'sys_jabber_pass',\n\t\t\t 'sys_ldap_host',\n\t\t\t 'sys_ldap_port',\n\t\t\t 'sys_ldap_version',\n\t\t\t 'sys_ldap_base_dn',\n\t\t\t 'sys_ldap_bind_dn',\n\t\t\t 'sys_ldap_admin_dn',\n\t\t\t 'sys_ldap_passwd',\n\t\t\t 'sys_news_group',\n\t\t\t 'sys_stats_group',\n\t\t\t 'sys_peer_rating_group',\n\t\t\t 'sys_template_group',\n\t\t\t 'sys_sendmail_path',\n\t\t\t 'sys_path_to_mailman',\n\t\t\t 'sys_path_to_jpgraph',\n\t\t\t 'sys_account_manager_type',\n\t\t\t 'unix_cipher',\n\t\t\t 'homedir_prefix',\n\t\t\t 'groupdir_prefix',\n\t\t\t 'sys_urlroot',\n\t\t\t 'sys_urlprefix',\n\t\t\t 'sys_images_url',\n\t\t\t 'sys_images_secure_url',\n\t\t\t 'sys_admin_email',\n\t\t\t 'sys_session_key',\n\t\t\t 'sys_session_expire',\n\t\t\t 'sys_show_source',\n\t\t\t 'default_trove_cat',\n\t\t\t 'sys_dbhost',\n\t\t\t 'sys_dbport',\n\t\t\t 'sys_dbname',\n\t\t\t 'sys_dbuser',\n\t\t\t 'sys_dbpasswd',\n\t\t\t 'sys_share_path',\n\t\t\t 'sys_var_path',\n\t\t\t 'sys_etc_path',\n\t\t\t) ;\n\n\t\t$pattern = implode ('|', $vars) ;\n\t\t\n\t\t$root = dirname(dirname(dirname(dirname(__FILE__))));\n\t\t$output = `cd $root ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\\\$($pattern)\\b(?! *=[^=])' \\\n\t\t\t\t\t | grep -v ^src/common/include/config-vars.php`;\n\t\t$this->assertEquals('', $output, \"Found deprecated \\$var for var in ($pattern):\");\n\n\t\t$output = `cd $root ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\\\\\$GLOBALS\\\\[.?($pattern).?\\\\](?! *=[^=])' \\\n\t\t\t\t\t | grep -v ^src/common/include/config-vars.php`;\n\t\t$this->assertEquals('', $output, \"Found deprecated \\$GLOBALS['\\$var'] for var in ($pattern):\");\n\t}", "function bdpp_get_settings() {\n\t\n\t$options = get_option('bdpp_opts');\n\t\n\t$settings = (is_array($options)) ? $options : array();\n\t\n\treturn $settings;\n}", "function OPTIONAL_SETTING($name, $value) {\r\n define($name, $value, true);\r\n}", "function setEnvPath($path)\n{\n $GLOBALS['config_path'] = $path;\n}", "function load_config() {\n $config_file = \"scripts/i-erp.conf\";\n $comment = \"#\";\n // open the config file\n $fp = fopen($config_file, \"r\");\n if (!$fp) {\n echo(\"Failed to open file\");\n return 0;\n }\n // loop through the file lines and pull out variables\n while (!feof($fp)) {\n $line = trim(fgets($fp));\n if ($line && $line[0] != $comment) {\n $pieces = explode(\"=\", $line);\n $option = trim($pieces[0]);\n $value = trim($pieces[1]);\n $config_values[$option] = $value;\n }\n }\n fclose($fp);\n $_SESSION['install_lib'] = $config_values['install_lib'];\n $_SESSION['server'] = $config_values['server'];\n $_SESSION['timeout'] = $config_values['timeout'];\n $_SESSION['appname'] = $config_values['appname'];\n $_SESSION['h_logo'] = $config_values['h_logo'];\n $_SESSION['si_logo'] = $config_values['si_logo'];\n $_SESSION['copyr'] = $config_values['copyr'];\n return 1;\n}", "function get_phpini() {\n\tif (@function_exists('ini_get_all')) {\n\t\t$r = \"\";\n\t\tprint \"<table><tr><td><div align=center>Directive</div></td><td><div align=center>Local Value</div></td><td><div align=center>Global Value</div></td></tr>\";\n\t\tprint \"<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>\";\n\t\t\n\t\tforeach (@ini_get_all() as $key => $value)\n\t\t\t$r .= \"<tr><td>\".$key.\"</td><td><div align=center>\".check_value($value['local_value']).\"</div></td><td><div align=center>\".check_value($value['global_value']).\"</div></td></tr>\";\n\t\t\n\t\tprint $r;\n\t\tprint \"</table>\";\n\t\tprint \"<br /><br /><br /><br />\";\n\t}else\n\t\tprint \"[ERROR] <i>ini_get_all</i> NOT ACTIVE!\";\n}", "public static function provideOnResourceLoaderGetConfigVars() {\n\t}", "function it_option($option){\n\techo get_it_option($option);\n}", "function get_settings($in)\n{\n if (is_file($in))\n return include $in;\n return false;\n}", "function rkt_options_page() {\n require('tmpl/options.tmpl.php');\n}", "function config($name, $_) {\r\n $args = func_get_args();\r\n $data = include ROOT . 'config' . DIRECTORY_SEPARATOR . $name . '.php';\r\n array_shift($args);\r\n if (count($args)) {\r\n foreach ($args as $arg) {\r\n if (!array_key_exists($arg, $data)) break;\r\n $data = $data[$arg];\r\n }\r\n }\r\n return $data;\r\n}", "public function localConfig();", "function conf($path) {\n\t$config = $GLOBALS['config'];\n\n\tif(strstr($path, '.')) {\n\t\t$config = array_get($config, $path);\n\t\tif(!$config) Log::caller('path: ' . $path);\n\t}\n\telse if(!isset($config[$path])) {\n\t\tLog::caller('Cannot find configuration parameter | path: ' . $path);\n\t\t//die('Cannot find configuration parameter | $path: ' . $path);\n\t\treturn '';\n\t}\n\telse $config = $config[$path];\n\n\treturn $config;\n}", "function conf_path($require_settings = TRUE, $reset = FALSE) \r\n{\r\n\tstatic $conf = '';//静态变量\r\n\r\n\tif ($conf && !$reset) {//若静态变量有值,并且 $reset 为默认\r\n\t\treturn $conf;//返回匹配的目录\r\n\t}\r\n\r\n\t$confdir = 'sites';//配置目录\r\n\t$uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);//当前脚本的路径\r\n\t$server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));//将主机名分离为数组\r\n\tfor ($i = count($uri) - 1; $i > 0; $i--) {//遍历\r\n\t\tfor ($j = count($server); $j > 0; $j--) {\r\n\t\t\t$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));\r\n\t\t\tif (file_exists(\"$confdir/$dir/config.php\") || (!$require_settings && file_exists(\"$confdir/$dir\"))) {//若匹配文件找到或者,探测一个匹配的目录并且有指定的目录存在\r\n\t\t\t\t$conf = \"$confdir/$dir\";\r\n\t\t\t\treturn $conf;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t$conf = \"$confdir/default\";\r\n\treturn $conf;\r\n}", "function asp_save_option($key, $global = false) {\r\r\n if ( !isset(wd_asp()->o[$key]) )\r\r\n return false;\r\r\n\r\r\n if ( $global ) {\r\r\n return update_site_option($key, wd_asp()->o[$key]);\r\r\n } else {\r\r\n return update_option($key, wd_asp()->o[$key]);\r\r\n }\r\r\n}", "function google_analytics_config()\n{\n\n $tracking_code = $this->getRequest()->getParam('google_analytics_tracking_code');\n set_option('google_analytics_tracking_code', $tracking_code);\n\n}", "function bf_get_option($name) {\r\n\tglobal $bf_options;\r\n\t\r\n\tif (!is_object($bf_options) )\r\n\t\tbf_flush_options();\r\n\t\r\n\treturn $bf_options->$name;\r\n}", "private function setup_globals() {\r\n\t\t/** Versions **********************************************************/\r\n\r\n\t\t$this->version = '0.3-alpha';\r\n\t\t$this->db_version = '1';\r\n\r\n\t\t/** Paths *************************************************************/\r\n\r\n\t\t$this->file = __FILE__;\r\n\t\t$this->basename = apply_filters( 'atcf_plugin_basenname', plugin_basename( $this->file ) );\r\n\t\t$this->plugin_dir = apply_filters( 'atcf_plugin_dir_path', plugin_dir_path( $this->file ) );\r\n\t\t$this->plugin_url = apply_filters( 'atcf_plugin_dir_url', plugin_dir_url ( $this->file ) );\r\n\r\n\t\t$this->template_url = apply_filters( 'atcf_plugin_template_url', 'crowdfunding/' );\r\n\r\n\t\t// Includes\r\n\t\t$this->includes_dir = apply_filters( 'atcf_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );\r\n\t\t$this->includes_url = apply_filters( 'atcf_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );\r\n\r\n\t\t// Languages\r\n\t\t$this->lang_dir = apply_filters( 'atcf_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );\r\n\r\n\t\t/** Misc **************************************************************/\r\n\r\n\t\t$this->domain = 'atcf'; \r\n\t}", "static function optionsIns();", "private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }", "function readGlobalSettingForCommandline(&$global_setting)\n{\n global $global_setting_list;\n\n $err_msg = array();\n $config_file = \"\";\n\n /* select reading pg_stats_reporter.ini */\n if (is_file(LOCAL_CONFIG_FILE)) {\n $config_file = LOCAL_CONFIG_FILE;\n } else {\n elog(ERROR, \"pg_stats_reporter.ini not found.\");\n }\n\n /* read pg_stats_reporter.ini */\n if (($ini_data = parse_ini_file($config_file, true)) == false)\n elog(ERROR, \"No section found (%s).\", $config_file);\n\n // pick up \"global\" section\n if (!array_key_exists(GLOBAL_SECTION, $ini_data))\n elog(ERROR, \"Global setting section not found (%s).\", $config_file);\n\n // validate check\n foreach ($global_setting_list as $item) {\n if (!array_key_exists($item, $ini_data[GLOBAL_SECTION])) {\n // provisional cope\n if ($item == \"log_page_size\")\n $ini_data[GLOBAL_SECTION][\"log_page_size\"] = 1000;\n else\n $err_msg[] = \"[\" . GLOBAL_SECTION . \"]\" . $item . \": Required item not exists.\";\n }\n }\n foreach (array_keys($ini_data[GLOBAL_SECTION]) as $item) {\n if (!in_array($item, $global_setting_list)) {\n $err_msg[] = \"[\" . GLOBAL_SECTION . \"]\" . $item . \": Item is invalid.\";\n }\n }\n if (count($err_msg) > 0) {\n $message = \"An error occurred in pg_stats_reporter.ini\";\n foreach ($err_msg as $msg) {\n $message .= \"\\n - \" . $msg;\n }\n elog(ERROR, $message);\n }\n\n $global_setting = $ini_data[GLOBAL_SECTION];\n return $ini_data;\n}", "abstract protected function getConfig();", "function JSOption()\n{\n\tglobal $options;\n\n\t// Check the session id.\n\tcheckSession('get');\n\n\t// If no variables are provided, leave the hell out of here.\n\tif (empty($_POST['v']) || !isset($_POST['val']))\n\t\texit;\n\n\t// Sorry, guests can't go any further than this..\n\tif (we::$is_guest || MID == 0)\n\t\tobExit(false);\n\n\t// If this is the admin preferences the passed value will just be an element of it.\n\tif ($_POST['v'] == 'admin_preferences')\n\t{\n\t\t$options['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();\n\t\t// New thingy...\n\t\tif (isset($_GET['admin_key']) && strlen($_GET['admin_key']) < 5)\n\t\t\t$options['admin_preferences'][$_GET['admin_key']] = $_POST['val'];\n\n\t\t// Change the value to be something nice,\n\t\t$_POST['val'] = serialize($options['admin_preferences']);\n\t}\n\n\t// Update the option.\n\twesql::insert('replace',\n\t\t'{db_prefix}themes',\n\t\tarray('id_member' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),\n\t\tarray(MID, $_POST['v'], is_array($_POST['val']) ? implode(',', $_POST['val']) : $_POST['val'])\n\t);\n\n\tcache_put_data('theme_settings:' . MID, null, 60);\n\n\t// Don't output anything...\n\texit;\n}", "function wporphanageex_menu_settings() {\n\tinclude_once( dirname( __FILE__ ) . '/wp-orphanage-extended-options.php' );\n}", "function get_site_option($option, $default_value = \\false, $deprecated = \\true)\n {\n }", "function siteorigin_panels_options_page(){\n\tinclude plugin_dir_path(SITEORIGIN_PANELS_BASE_FILE) . '/tpl/options.php';\n}", "static function setupInit($path=null,$file=null)\r\n {\r\n Zend_ConfigSettings::setUpConfig();\r\n self::$_general = Zend_Registry::get('general');\r\n self::_setEnv();\t \r\n }", "function wpbs_echo_option()\n {\n include wpbs_advs_plugin_dir . 'admin/view/adminLayout.php';\n }", "function of_option_setup()\t{\n\t\n\tglobal $of_options, $options_machine;\n\t\n\t$options_machine = new Options_Machine($of_options);\n\t\t\n\tif (!get_option(OPTIONS)){\n\t\t\n\t\t$defaults = (array) $options_machine->Defaults;\n\t\tupdate_option(OPTIONS,$defaults);\n\t\tgenerate_options_css($defaults); \n\t\t\n\t}\n\t\n\t\n}", "function parseCliOptions() {\n // ENABLE the following line you want to use the Command library.\n // $cmdOptions = new Commando\\Command();\n\n // Define first option\n $cmdOptions->option()\n ->require()\n ->aka('site_path')\n ->describedAs('Site path you want to export (e.g. /var/www/myproject)');\n\n // Define a boolean flag \"-c\" aka \"--capitalize\"\n $cmdOptions->option('v')\n ->aka('verbose')\n ->describedAs('Verbose output')\n ->boolean();\n\n global $verbose;\n $verbose = $cmdOptions['verbose'];\n\n global $site_path;\n $site_path = $cmdOptions[0];\n}", "public function load_options() {\n\t\treturn $this->get_config();\n\t}", "public function register_options(){\n\t\tparent::register_options();\n\t\t//$orgzr = \\WBF\\modules\\options\\Organizer::getInstance();\n\t\t//Do stuff...\n\t}", "public function getUserDefinedGlobals()\n {\n if(file_exists(realpath(__DIR__.'/../../../../config/twig.php'))){\n $this->config = require_once realpath(__DIR__.'/../../../../config/twig.php');\n }elseif (file_exists(realpath(__DIR__ . '/../config/twig.php'))){\n $this->config = require_once realpath(__DIR__ . '/../config/twig.php');\n }\n return $this->config['twig_global'];\n }", "private function initVarConfMap()\n {\n\n // Set the global $confMapLocal\n switch ( true )\n {\n case( isset( $this->conf_view[ 'navigation.' ][ 'map.' ] ) ):\n // local configuration\n $this->confMap = $this->conf_view[ 'navigation.' ][ 'map.' ];\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Local configuration in: views.' . $this->conf_path . '.navigation.map';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n break;\n // local configuration\n default:\n // global configuration\n $this->confMap = $this->pObj->conf[ 'navigation.' ][ 'map.' ];\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Global configuration in: navigation.map';\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n break;\n // global configuration\n }\n // Set the global $confMapLocal\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n\n return;\n }", "static function set_config() {\n\t\tif ( file_exists( self::childpath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::childpath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'wpgrade-config' . EXT;\n\t\t}\n\t}", "function tia_get_option($key) {\t\n\tglobal $tia_options;\t\n\t$tia_options = get_option('tia_options');\n\t\n\t$tia_defaults = array(\t\t\t\t\t\n\t\t'tia_theme_bkg' => 'white',\n\t\t'tia_default_height' => 700,\n\t\t'tia_scrolling_img_margin_top' => 117,\n\t\t'tia_story_margin_top' => 70\n\t\t\n\t);\n\t\n\t//Array of options not stored in tia_options array\n\t$not_in_array = array(\t\t\n\t\t'tia_logo' => false\t\t\n\t);\n\t\n\tif($not_in_array[$key]){\n\t\tif(!get_option($key)){\n\t\t\t$tia_options[$key] = $tia_defaults[$key];\n\t\t}\n\t\telse{\n\t\t\t$tia_options[$key] = get_option($key);\n\t\t}\n\t}else{\t\t\t\n\t\tif (!$tia_options[$key]){\t\t\n\t\t\t$tia_options[$key] = $tia_defaults[$key];\t\t\t\n\t\t}\n\t}\t\n\treturn $tia_options[$key];\n}", "function script_concat_settings()\n {\n }", "function kulam_acf_get_global_option( $name ) {\n\n\tadd_filter( 'acf/settings/current_language', 'kulam_acf_set_default_language', 100 );\n\n\t$option = get_field( $name, 'option' );\n\n\tremove_filter( 'acf/settings/current_language', 'kulam_acf_set_default_language', 100 );\n\n\t// return\n\treturn $option;\n\n}", "function get_it_option( $option ) {\n\t$options = get_option( 'chalmersit_options' );\n\tif ( isset( $options[$option] ) )\n\t\treturn $options[$option];\n\telse\n\t\treturn false;\n}", "public static function init_define()\r\n\t{\r\n\t\tdefined('APP_MODE')===false && define('APP_MODE', 'DEV');\r\n\t\t// init app path\r\n\t\tdefined('APP_PATH')===false && define('APP_PATH', TOP_PATH.'/app');\r\n\t\t// init runtime path\r\n\t\tdefined('RUNTIME_PATH')===false && define('RUNTIME_PATH', TOP_PATH.'/runtime');\r\n\t}", "function pkg_env($extra_env = array()) {\n\tglobal $g;\n\n\t$user_agent = g_get('product_label') . '/' . g_get('product_version');\n\tif (!config_path_enabled('system','do_not_send_uniqueid')) {\n\t\t$user_agent .= ':' . system_get_uniqueid();\n\t}\n\n\t$pkg_env_vars = array(\n\t\t\"LANG\" => \"C\",\n\t\t\"HTTP_USER_AGENT\" => $user_agent,\n\t\t\"ASSUME_ALWAYS_YES\" => \"true\",\n\t\t\"FETCH_TIMEOUT\" => 5,\n\t\t\"FETCH_RETRY\" => 2\n\t);\n\n\t$http_proxy = config_get_path('system/proxyurl');\n\t$http_proxyport = config_get_path('system/proxyport');\n\tif (!empty($http_proxy)) {\n\t\tif (!empty($http_proxyport)) {\n\t\t\t$http_proxy .= ':' . $http_proxyport;\n\t\t}\n\t\t$pkg_env_vars['HTTP_PROXY'] = $http_proxy;\n\n\t\t$proxyuser = config_get_path('system/proxyuser');\n\t\t$proxypass = config_get_path('system/proxypass');\n\t\tif (!empty($proxyuser) && !empty($proxypass)) {\n\t\t\t$pkg_env_vars['HTTP_PROXY_AUTH'] = \"basic:*:\" .\n\t\t\t $proxyuser . \":\" . $proxypass;\n\t\t}\n\t}\n\n#\tif (config_path_enabled('system','use_mfs_tmpvar') &&\n#\t !file_exists(\"/conf/ram_disks_failed\")) {\n#\t\t$pkg_env_vars['PKG_DBDIR'] = '/root/var/db/pkg';\n#\t\t$pkg_env_vars['PKG_CACHEDIR'] = '/root/var/cache/pkg';\n#\t}\n\n\tforeach ($extra_env as $key => $value) {\n\t\t$pkg_env_vars[$key] = $value;\n\t}\n\n\treturn $pkg_env_vars;\n}", "function splashgate_admin_init(){\n\t\t\tregister_setting(\tSPLASHGATE_SETTINGS_GROUP, 'splashgate_options' ); // 'options' will be an array holding everything\n\t\t}", "function get_option($option, $section, $default = '')\n {\n }", "function opinionstage_settings_load_header(){\n}", "protected function getOptions()\n\t{\n\t\t$this->options['USE_ACCOUNT_NUMBER'] = (Config\\Option::get(\"sale\", \"account_number_template\", \"\") !== \"\") ? true : false;\n\t}", "public function configM4() {\n $ALIAS = strtoupper($this->alias);\n ob_start();\n ?>\ndnl Koda, <?=date(\"Y-m-d H:i:s\")?>.\n\nPHP_ARG_WITH(<?=$this->alias?>, for <?=$this->alias?> support,\n[ --with-<?=$this->alias?> Include <?=$this->alias?> support])\n\nif test \"$PHP_<?=$ALIAS?>\" != \"no\"; then\n\tPHP_ADD_INCLUDE(.)\n<? foreach($this->includes as $include): ?>\n PHP_ADD_INCLUDE(<?=$include?>)\n<? endforeach ?>\n\n PHP_NEW_EXTENSION(<?=$this->alias?>, \"<?=implode(\" \", $this->sources)?>\", $ext_shared)\nfi\n<?php\n return ob_get_clean();\n }", "public function loadConfig(){\n\t\t\n\t\t$opt[] = [\n\t\t\t'method' => 'setFormParams',\n\t\t\t'value'=>$this->paramsLoad(3, \\sevian\\s::getReq('command_idx'), \\sevian\\s::getReq('unit_idx'))\n\t\t\t\n\t\t];\n\t\t$this->info = $opt;//$form->getInfo();\n\t}", "function nxt_post_assing_var_to_options(){\n\n\t$nxt_post_option_template_select = get_option( 'nxt_post_option_template_select');\n\t$nxt_post_plugin_enable = get_option('nxt_post_plugin_enable');\n}", "function bb_get_mystique_options() {\r\n\t$get_mystique_options = bb_mystique_default_settings();\r\n\t//$get_mystique_options = bb_get_option( 'bb-mystique' );\r\n\treturn $get_mystique_options;\r\n}", "public static function es_admin_option() {\n\t}", "public function getOpt($option) {}", "public function wp_install_config($opts){\n\n\t\t// We retrieve each line as an array\n\t\t$config_file = file( 'wp-config-sample.php' );\n\n\t\t// Managing the security keys\n\t\t$secret_keys = explode( \"\\n\", file_get_contents( 'https://api.wordpress.org/secret-key/1.1/salt/' ) );\n\n\t\tforeach ( $secret_keys as $k => $v ) {\n\t\t\t$secret_keys[$k] = substr( $v, 28, 64 );\n\t\t}\n\n\t\t// We change the data\n\t\t$key = 0;\n\t\tforeach ( $config_file as &$line ) {\n\n\t\t\tif ( '$table_prefix =' == substr( $line, 0, 16 ) ) {\n\t\t\t\t$line = '$table_prefix = \\'' . $this->sanit( $opts['prefix'] ) . \"';\\r\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! preg_match( '/^define\\(\\'([A-Z_]+)\\',([ ]+)/', $line, $match ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$constant = $match[1];\n\n\t\t\tswitch ( $constant ) {\n\t\t\t\tcase 'WP_DEBUG'\t :\n\n\t\t\t\t\t// Debug mod\n\t\t\t\t\tif ( (int) $opts['debug'] == 1 ) {\n\t\t\t\t\t\t$line = \"define('WP_DEBUG', 'true');\\r\\n\";\n\n\t\t\t\t\t\t// Display error\n\t\t\t\t\t\tif ( (int) $opts['debug_display'] == 1 ) {\n\t\t\t\t\t\t\t$line .= \"\\r\\n\\n \" . \"/** Affichage des erreurs à l'écran */\" . \"\\r\\n\";\n\t\t\t\t\t\t\t$line .= \"define('WP_DEBUG_DISPLAY', 'true');\\r\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// To write error in a log files\n\t\t\t\t\t\tif ( (int) $opts['debug_log'] == 1 ) {\n\t\t\t\t\t\t\t$line .= \"\\r\\n\\n \" . \"/** Ecriture des erreurs dans un fichier log */\" . \"\\r\\n\";\n\t\t\t\t\t\t\t$line .= \"define('WP_DEBUG_LOG', 'true');\\r\\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$line .= \"\\r\\n\\n \" . \"/** On augmente la mémoire limite */\" . \"\\r\\n\";\n\t\t\t\t\t$line .= \"define('WP_MEMORY_LIMIT', '256M');\" . \"\\r\\n\";\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_NAME' :\n\t\t\t\t\t$line = \"define('DB_NAME', '\" . $this->sanit( $opts['dbname'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_USER' :\n\t\t\t\t\t$line = \"define('DB_USER', '\" . $this->sanit( $opts['uname'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_PASSWORD' :\n\t\t\t\t\t$line = \"define('DB_PASSWORD', '\" . $this->sanit( $opts['pwd'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_HOST' :\n\t\t\t\t\t$line = \"define('DB_HOST', '\" . $this->sanit( $opts['dbhost'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'AUTH_KEY' :\n\t\t\t\tcase 'SECURE_AUTH_KEY' :\n\t\t\t\tcase 'LOGGED_IN_KEY' :\n\t\t\t\tcase 'NONCE_KEY' :\n\t\t\t\tcase 'AUTH_SALT' :\n\t\t\t\tcase 'SECURE_AUTH_SALT' :\n\t\t\t\tcase 'LOGGED_IN_SALT' :\n\t\t\t\tcase 'NONCE_SALT' :\n\t\t\t\t\t$line = \"define('\" . $constant . \"', '\" . $secret_keys[$key++] . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'WPLANG' :\n\t\t\t\t\t$line = \"define('WPLANG', '\" . $this->sanit( $this->_wp_lang ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tunset( $line );\n\n\t\t$handle = fopen( 'wp-config.php', 'w' );\n\t\tforeach ( $config_file as $line ) {\n\t\t\tfwrite( $handle, $line );\n\t\t}\n\t\tfclose( $handle );\n\n\t\t// We set the good rights to the wp-config file\n\t\tchmod( 'wp-config.php', 0666 );\n\t\tunlink('wp-config-sample.php' );\n\n\t\treturn TRUE;\n\t}", "static public function setOptions($opts = array()) {\n if (isset($opts['gzip'])) {\n self::$optGzip = $opts['gzip'] ? true : false;\n }\n if (isset($opts['minimal'])) {\n self::$optMinimal = $opts['minimal'] ? true : false;\n }\n // global option for http proxy \n if (isset($opts['pmp_http_proxy'])) {\n self::$optHttpProxy = $opts['pmp_http_proxy'] ? $opts['pmp_http_proxy'] : '';\n } \n }", "function debuggify_get_options($action = NULL){\n\n global $debuggify_settings_name;\n\n // Plugin Defaults\n $defaults = array(\n 'apikey' => '6487a4edf9e534c6164579dd327b01f4',\n 'enabled' => '0'\n );\n\n //Return default settings\n if($action == \"reset\"){\n delete_option($debuggify_settings_name);\n add_option($debuggify_settings_name, $defaults);\n return $defaults;\n }\n\n //Get the settings from the database\n $database_settings = get_option($debuggify_settings_name);\n if($database_settings){\n $need_to_update = false;\n\n //Check whether all the settings are present or not\n foreach($defaults as $k => $v){\n\n if( !array_key_exists( $k, $database_settings)) {\n $database_settings[$k] = $v;\n $need_to_update = true;\n }\n }\n\n if($need_to_update) {\n update_option($debuggify_settings_name, $database_settings);\n }\n\n return $database_settings;\n }else{\n //Add the settings\n add_option($debuggify_settings_name, $defaults);\n return $defaults;\n }\n }", "function getConfig($config)\n{ \n return config(\"system.$config\");\n}", "function get_options()\n{\n return php_sapi_name() == 'cli' ? get_options_cli() : get_options_url();\n}", "private function load_settings() {\n\t\t\n\t}", "public function getOptionsExternally()\n\t{\n\t\t$this->loadExternally = 1;\n\n\t\treturn $this->getOptions();\n\t}", "function bb_print_mystique_option( $option ) {\r\n\techo bb_get_mystique_option( $option );\r\n}", "function conf_init() {\n\n /*\n ** Try finding a matching configuration file by stripping the website's\n ** URI from left to right. If no configuration file is found, return a\n ** default value 'conf'.\n */\n\n $uri = $_SERVER[\"PHP_SELF\"];\n\n $file = strtolower(strtr($_SERVER[\"HTTP_HOST\"] . substr($uri, 0, strrpos($uri, \"/\")), \"/:\", \"..\"));\n\n while (strlen($file) > 4) {\n if (file_exists(\"includes/$file.php\")) {\n return $file;\n }\n else {\n $file = substr($file, strpos($file, \".\") + 1);\n }\n }\n\n return \"conf\";\n}", "public static function generate_options ()\n\t{\n\t\t// Location options\n\t\tadd_option(\"wustache_base_folder\", 'templates');\n\t}", "function cbstdsys_init(){\n\tregister_setting( 'cbstdsys_plugin_options', 'cbstdsys_options', 'cbstdsys_validate_options' );\n}", "function mdl_opt($_opt, $_slc=false){\r\n\t\r\n\t$ci =& get_instance();\r\n\t\r\n\t$ci->load->model('foo/foo_m');\r\n\t\r\n\t$_ = $ci->foo_m->__select('mdl_options', 'OPT_VAL val', ['OPT'=>$_opt], false);\r\n\r\n\tif($_slc){\r\n\t\r\n\t\t$_j = json_decode($_->val, true);\r\n\t\r\n\t\treturn $_j[$_slc];\r\n\r\n\t} else return $_->val;\r\n}", "function cpo_get_option( $option_name = '', $option_array = 'ctct_settings' ) {\n\t//Determines whether to grab current language, or original language's option\n\t$option_list_name = $option_array;\n\t$option_list = get_option( $option_list_name, false );\n\tif ( $option_list && isset( $option_list[ $option_name ] ) ) {\n\t\t$option_value = $option_list[ $option_name ];\n\t} else {\n\t\t$option_value = false;\n\t}\n\n\treturn $option_value;\n}", "function options_page(){\r\n include($this->plugin_dir.'/include/options-page.php');\r\n }", "function theme_options_init(){\n\tregister_setting( 'sample_options', 'site_description', 'theme_options_validate' );\n\tregister_setting( 'ga_options', 'ga_account', 'ga_validate' );\n\tadd_filter('site_description', 'stripslashes');\n}", "function get_setting($name)\n {\n }", "function harvest_option( $option, $default = false ) {\n\tif( class_exists( 'CTC_Extender' ) && ctcex_has_option( $option ) )\n\t\treturn ctcex_get_option( $option, $default );\n\t\n\t$theme_data = wp_get_theme();\n\t$theme_safename = sanitize_title( $theme_data );\n\t$options = get_option( $theme_safename . '-options' );\n\tif( isset( $options[ $option ] ) ) \n\t\treturn $options[ $option ];\n\telse\n\t\treturn $default;\n}", "function initialize_options()\n\t\t{\n\t\t\tglobal $config;\n\n\t\t\t$defaults = array(\n\t\t\t\t'minimum_age' => 4,\n\t\t\t\t'maximum_age' => 0,\n\t\t\t);\n\t\t\tforeach ($defaults as $option => $default)\n\t\t\t{\n\t\t\t\tif (!isset($config[$option]))\n\t\t\t\t{\n\t\t\t\t\tset_config($option, $default);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function magillDev() {\n\tglobal $magillDev;\n\treturn $magillDev;\n}", "public function cfg_setup()\n\t{\n\t\t$this->cfg = AppConfig::get()[\"app\"];\n\t\t$this->cfg[\"app_name\"] = $this->cfg[\"name\"];\n\n\t}", "function tidyt_set_global_settings($args = array()) {\n\n $GLOBALS['tidyt_args'] = $args;\n // foreach($args as $key=>$value){\n // }\n\n}", "function wp_protect_special_option($option)\n {\n }", "function buddyexpressdesk_settings(){\n $settings = new stdClass;\n\t$GET = new BDESK_DB;\n $GET->statement('SELECT * FROM bdesk_site LIMIT 1');\n $GET->execute();\n\t$defaults = $GET->fetch();\n\tforeach ($defaults as $name => $value) {\n\t\tif (empty($paths->$name)) {\n\t\t\t$settings->$name = $value;\n\t\t}\n\t}\n\treturn $settings;\n}", "function getSupportingConfigVars()\n {\n return array();\n }", "public static function getConfig()\n {\n }", "function get_sso_option($option_name){\r\n $value = get_option('sso_'.$option_name);\r\n if($value === FALSE) die(\"Nincs beállítva a \".$option_name.\" opció az SSO pluginban!\");\r\n else return $value;\r\n}", "function spreadshop_admin(){\nif ( !current_user_can( 'manage_options' ) ) {\n\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t}\n\tinclude(plugin_dir_path(__FILE__).'/spreadoptions.php');\n\t\n}", "function getConfiguration() ;", "function initFramework()\r\n{\r\n\t$config = parse_ini_file('./config.ini',true);\r\n\t\r\n\tdate_default_timezone_set('America/New_York');\r\n\t\r\n\t/* Error reporting is set to show all except notices */\r\n\terror_reporting(E_ALL ^ E_NOTICE);\r\n\t\r\n\t// define site name\r\n\tdefine(\"PF_SITE_NAME\", $config['siteName']);\r\n\t\r\n\t/*\r\n\t* Turn on error reporting for testing purposes. However, make sure this is off \r\n\t* when the site is live as it could possibly be a security issue.\r\n\t*/\r\n\tini_set('display_errors', $config['debugMode']);\r\n\t\r\n\t// Define some paths\r\n\tdefine(\"PF_ROOT_PATH\", $config['paths']['rootDir']);\r\n\tdefine(\"PF_ROOT_URL\", $config['paths']['url']);\r\n}", "function settings_callback(){\n\trequire_once(COMPILER_PATH.\"templates/settings.php\");\n}", "public static function getConfig($option = null)\n {\n }", "public function init()\n {\n global $kong_helpdesk_options;\n $this->options = $kong_helpdesk_options;\n }", "function init()\r\n{\r\n\tglobal $SETTINGS;\t\r\n\t\r\n\trequire('funcs/logging.php');\r\n\trequire('funcs/http_funcs.php');\r\n\trequire('funcs/api_funcs.php');\r\n\t\r\n\t$SETTINGS = get_settings();\r\n\t\r\n\t\r\n\tdo_log(\"System initiated, debug level is: \".DEBUG,0);\r\n}", "function blog_analytics() { \n$options = get_option('blog_theme_options');\necho $options['analytics']; \n}", "abstract public function getConfig();" ]
[ "0.6677672", "0.63644516", "0.6231293", "0.6115947", "0.6110081", "0.6110077", "0.60750836", "0.6061922", "0.5998794", "0.5995255", "0.5953161", "0.5937783", "0.58895093", "0.58692753", "0.58407825", "0.5825859", "0.58057845", "0.5792689", "0.5779296", "0.57179976", "0.57150817", "0.5676356", "0.56649756", "0.5661979", "0.56441563", "0.56435156", "0.56404126", "0.56229794", "0.55982983", "0.5594953", "0.5560304", "0.55583894", "0.555336", "0.5551713", "0.5550034", "0.5543397", "0.55216646", "0.55192775", "0.5516787", "0.55142516", "0.55129695", "0.5510967", "0.55022967", "0.54923534", "0.5478592", "0.5476105", "0.54477686", "0.5440542", "0.5437968", "0.5437285", "0.54141885", "0.54034185", "0.53954506", "0.53936464", "0.53878754", "0.53769094", "0.5370497", "0.53621286", "0.53581035", "0.53540844", "0.53533506", "0.5353245", "0.5352286", "0.5349434", "0.53469896", "0.53467196", "0.53432536", "0.53418195", "0.53364646", "0.5335304", "0.53350276", "0.5334563", "0.53277373", "0.532605", "0.5322618", "0.531787", "0.53103983", "0.530703", "0.53036267", "0.5295872", "0.5293692", "0.5277973", "0.5276517", "0.5276107", "0.526894", "0.5257001", "0.5256793", "0.5256769", "0.52566314", "0.5254536", "0.52475345", "0.5244661", "0.5241626", "0.52398485", "0.5236052", "0.5234691", "0.5234096", "0.5233327", "0.52329767", "0.5232105", "0.52317524" ]
0.0
-1
assumes $message has already been slashed.
function sendMessage($sender, $recipient, $message) { $query = "INSERT INTO {$GLOBALS["OPT"]["table_prefix"]}messages(sender,recipient,message,created) " . "VALUES($sender,$recipient,'$message','" . strftime("%Y-%m-%d") . "')"; mysql_query($query) or die("Could not query: " . mysql_error()); // determine if e-mail must be sent. $query = "SELECT ur.email_msgs, ur.email AS remail, us.fullname, us.email AS semail FROM {$GLOBALS["OPT"]["table_prefix"]}users ur " . "INNER JOIN {$GLOBALS["OPT"]["table_prefix"]}users us ON us.userid = $sender " . "WHERE ur.userid = $recipient"; $rs = mysql_query($query) or die("Could not query: " . mysql_error()); $row = mysql_fetch_array($rs,MYSQL_ASSOC); if (!$row) die("Recipient does not exist."); if ($row["email_msgs"] == 1) { mail( $row["remail"], "Gift Registry message from " . $row["fullname"], $row["fullname"] . " <" . $row["semail"] . "> sends:\r\n" . stripslashes($message), "From: {$GLOBALS["OPT"]["email_from"]}\r\nReply-To: " . $row["semail"] . "\r\nX-Mailer: {$GLOBALS["OPT"]["email_xmailer"]}\r\n" ) or die("Mail not accepted for " . $row["remail"]); } mysql_free_result($rs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function check_message ()\n\t{\t\tif (isset($_SESSION['message']))\n\t\t{\n\t\t\t// Add it as an attribute and erase the stored version\n\t\t\t$this->message = $_SESSION['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->message = \"\";\n\t\t}\n\t}", "protected function prepareMessage(Message $message): void\n {\n $data = $message->getData();\n\n if ($data) {\n $message->setMessage(Arr::toString($data));\n }\n }", "private function check_message(){\t\t\tif(isset($_SESSION['message'])){\r\n\t\t\t\t// Add it as an attribute and erase the stored version\r\n\t\t\t\t\r\n\t\t\t\t$this->message = $_SESSION['message'];\r\n\t\t\t\tunset($_SESSION['message']);\r\n\t\t\t}else{\r\n\t\t\t\t$this->message=\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "protected abstract function _message();", "public function withMessage(Message $message): void;", "private function _set_message($message)\n {\n // set message in $_message property\n $this->_message = $message;\n\n return;\n }", "private function handleMessage($message) {\n\t\tif ($message instanceof Message) {\n\t\t\t$this->getGroup()->addMessage($message);\n\t\t}\n\t\tif ($message instanceof Acknowledge) {\n\t\t\t$this->getGroup()->addMessage($message);\n\t\t}\n\t\tif ($message instanceof Cancel) {\n\t\t\t$this->getGroup()->removeMessage($message->getReference());\n\t\t}\n\t\t// Damit enforcen wir, dass die Daten in den Cache geschrieben werden und beim naechsten\n\t\t// update auch gepusht werden (s. postMessageCache())\n\t\t$this->setGroupHash(__CLASS__ . '$' . md5(microtime(true) . rand(100,999)));\n\t}", "public function initMessage() {}", "function _prep_message( $message = '' )\n\t{\n\t\tif ( $message == '' AND isset( $_GET['msg'] ) )\n\t\t{\n\t\t\t$message = lang( $_GET['msg'] );\n\t\t}\n\n\t\t$this->cached_vars['message']\t= $message;\n\n\t\treturn TRUE;\n\t}", "public function resetMessage() {\n self::$message = '';\n }", "function add($message) { return; }", "public function _prep_message( $message = '' )\n\t{\n\t\tif ( $message == '' AND isset( $_GET['msg'] ) )\n\t\t{\n\t\t\t$message = lang( $_GET['msg'] );\n\t\t}\n\n\t\t$this->cached_vars['message']\t= $message;\n\n\t\treturn TRUE;\n\t}", "protected static function newMessage()\n {\n self::$message = \\Swift_Message::newInstance();\n }", "protected function renderMessage() {}", "protected function prepareMessage() {\n //Initialize $message\n $message = '';\n //loop through $this->_storage array\n foreach ($this->_storage as $key => $value) {\n // if it has no value, assign 'Not provided' \n $value = (empty($value)) ? 'Not provided' : $value;\n // if an array, expand as comma-separated string \n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n // replace underscores and hyphens in the label with spaces \n $key = str_replace(array('_', '-'), ' ', $key);\n // add label and value to the message body. Uppercase first letter\n $message .=ucfirst($key) . \": $value\\r\\n\\r\\n\";\n }\n // limit line length to 70 characters \n $this->_body = wordwrap($message, 70);\n }", "public function setMessage( $message );", "public function attach(Message $message): void;", "public function addMessage($message)\n {\n $this->storage[] = $message;\n }", "function message($message = '')\n\t{\n\t\tif (!$message)\n\t\t\treturn;\n\t\t\n\t\t//if the message needs to be wrapped, do it now.\n\t\tif ($this->config['wordwrap'])\n\t\t\t$this->message = $this->wrap_message($message, $this->config['wraplength'], ($this->config['mailtype'] == 'html'));\n\t\telse\n\t\t\t$this->message = $message;\n\t}", "private function storeErrorMessage($message)\n\t{\n\t\t$this->_errorMessage .= $message;\n\t}", "function &smiley( $message ) {\n $db = &ZariliaDatabaseFactory::getDatabaseConnection();\n if ( count( $this->smileys ) == 0 ) {\n if ( $getsmiles = $db->Execute( \"SELECT * FROM \" . $db->prefix( \"smiles\" ) .' WHERE display = 1') ) {\n while ( $smiles = $getsmiles->FetchRow() ) {\n $message = str_replace( $smiles['code'], '<img src=\"' . ZAR_UPLOAD_URL . '/' . htmlspecialchars( $smiles['smile_url'] ) . '\" alt=\"\" />', $message );\n array_push( $this->smileys, $smiles );\n }\n }\n } elseif ( is_array( $this->smileys ) ) {\n foreach ( $this->smileys as $smile ) {\n $message = str_replace( $smile['code'], '<img src=\"' . ZAR_UPLOAD_URL . '/' . htmlspecialchars( $smile['smile_url'] ) . '\" alt=\"\" />', $message );\n }\n }\n return $message;\n }", "abstract protected function handleMessage(Message $message);", "function paintMessage($message) {\r\n $this->_scorer->paintMessage($message);\r\n }", "public function message($message): void\n {\n $this->messages[] = $message;\n }", "function get_message($message){\n\t\t$this->gmessage = $message;\n\t}", "function loadMessages( $title, &$message ) {\n\t\treturn true;\n\t}", "public function set_message($message);", "public function setMessage($message)\n {\n return $this->mergeData([static::messageKey() => (string) $message]);\n }", "function paintFormattedMessage($message) {\r\n $this->_scorer->paintFormattedMessage($message);\r\n }", "protected static function addMessage(stdClass $message) {\n $i = PitSession::get('PitFlash', 'i', 1);\n $msgs = PitSession::get('PitFlash', 'messages', array());\n $msgs[$i] = $message;\n PitSession::set('PitFlash', 'i', $i + 1);\n PitSession::set('PitFlash', 'messages', $msgs);\n }", "function addMessage( $message )\n {\n if ( isset($message['errorMessage']) )\n {\n $this->messages[] = array_merge($this->empty_message,$message);\n } else if ( isset($message[0]) && isset($message[0]['errorMessage']) ) {\n foreach ( $message as $m )\n {\n $this->messages[] = array_merge($this->empty_message,$m);\n }\n }\n }", "protected function renderOne($message)\n\t{\n\t\treturn str_replace($this->placeholder, $message['message'], $this->config->get('outmess::styles.' . $this->style . '.' . $message['type'])); \n\t}", "static public function compact(&$message)\r\n\t{\r\n\t\t$message = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\", \"\\t\"), ' ', $message);\r\n\t\t$message = preg_replace('@\\s+@', ' ', $message);\r\n\t}", "public function __construct($message)\r\n {\r\n $this->message = $message;\r\n\r\n }", "public function __construct($message)\n {\n // $this->message = $message;\n }", "public function __construct(Message $message)\n {\n parent::__construct($message);\n }", "public function addMessage($message);", "private function _messageFor()\n {\n // First, get the message\n //$message_for = preg_match('^!messagefor-[$1]', $this->_data->message)\n //preg_match('/^!messagefor-(.*):/', '!messagefor-Mike I missed you', $matches); var_dump($matches);\n try {\n // Connect\n $dbh = $this->_connectToDb();\n\n // Insert\n $stmt = $dbh->prepare(\"INSERT INTO message(`nick`, `message`, `when`, `from`) VALUES (:nick, :message, NOW(), :from)\");\n\n $stmt->bindParam(':nick', $message_for, PDO::PARAM_STR);\n $stmt->bindParam(':message', $message_payload, PDO::PARAM_STR);\n $stmt->bindParam(':from', $this->_data->nick, PDO::PARAM_STR);\n\n $stmt->execute();\n\n $dbh = null;\n\n }\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "public function set_message($message)\n {\n $this->messages[] = $message;\n\n return $message;\n }", "function setMessage($a_sMessage)\n {\n if (!is_null($this->_sMessage) && $this->_sMessage !== (string) $a_sMessage) {\n $this->_markModified();\n }\n $this->_sMessage = (string) $a_sMessage;\n }", "public function setMessage($message);", "public function setMessage($message);", "public function setMessage($message);", "abstract protected function handleMessage($message);", "protected function _write($message)\n {\n $data = array();\n foreach ($this->_columnMap as $messageField => $modelField) {\n $data[$modelField] = $message[$messageField];\n }\n $model = new $this->_modelName();\n $model->fromArray($data);\n $model->save();\n }", "function message(Message $message);", "function target_add_message($message)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $message['subject']);\n\n\tif (!isset($GLOBALS['forum_map'][ (int)$message['forum_id'] ])) {\n\t\tpf('WARNING: Skip message ['. $message['subject'] .']. Cannot add message to non-existing forum.');\n\t\treturn;\n\t}\n\t$file_id = write_body(bbcode2fudcode($message['body']), $len, $off, $GLOBALS['forum_map'][ (int)$message['forum_id'] ] );\n\n\tif ($message['poster_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$message['poster_id'] = $GLOBALS['hack_id'];\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'msg\n\t\t(id, thread_id, poster_id, post_stamp, update_stamp, updated_by, subject,\n\t\t ip_addr, foff, length, file_id, msg_opt, apr\n\t) VALUES (\n\t\t'. $message['id'] .',\n\t\t'. (int)$message['thread_id'] .',\n\t\t'. (int)$message['poster_id'] .',\n\t\t'. (int)$message['post_stamp'] .',\n\t\t'. (int)$message['update_stamp'] .',\n\t\t'. (int)$message['updated_by'] .',\n\t\t'. _esc($message['subject']) .',\n\t\t'. _esc(decode_ip($message['ip_addr'])) .',\n\t\t'. $off .',\n\t\t'. $len .',\n\t\t'. $file_id .',\n\t\t'. (int)$message['msg_opt'] .',\n\t\t1)'\n\t);\n}", "public function message($message);", "function load($auth_message) {\n if (strlen($auth_message) > 512) $auth_message = \"\";\n $this->auth_message = $auth_message;\n\n if (strlen($auth_message) == 0 || strstr($auth_message, \"-\") === false) return false;\n\n $authentication_message = explode(\"-\", $auth_message);\n if (count($authentication_message) != 2) return;\n\n $authentication = $authentication_message[0];\n $message = $authentication_message[1];\n\n if ($this->hash($message) !== $authentication)\n return false;\n\n $this->message = $this->str_to_message($message);\n return true;\n }", "private function setMessage($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "private function saveSourceMessage()\n\t{\n\t\t$sourceMessage = new SourceMessage();\n\t\t$sourceMessage->category = $this->category;\n\t\t$sourceMessage->message = $this->message;\n\t\t\n\t\tif ($sourceMessage->save()){\n\t\t\t$this->id = $sourceMessage->id;\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function addStructure(Message $message)\n {\n $this->_messages[] = $message;\n\n }", "public function addContent($message)\n {\n }", "function onSave($new)\n\t{\n\t\t// We may have cached the message in the default language.\n\t\t$this->clearCache();\n\t}", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function is_there_any_msg()\n\t{\n\t\tif(isset($_SESSION[\"message\"]))\n\t\t{\n\t\t\t$this->_message = $_SESSION[\"message\"];\n\t\t\tunset($_SESSION[\"message\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_message=\"\";\n\t\t}\n\t}", "public function trySend(mixed $message): void;", "static function message($message)\n {\n global $template_vars;\n $template_vars['messages'][] = $message;\n }", "public function __construct($message) {\r\n parent::__construct($message);\r\n }", "public function decorate(Message $message): Message\n {\n }", "public function set_alt_message($message);", "public function set_message($message)\n\t{\n\t\t$this->message = $message;\t\n\t}", "public function __construct($message) {\n $this->message= $message;\n }", "private function _message($message)\n {\n if ($this->_data->channel)\n {\n $this->_irc->message(SMARTIRC_TYPE_CHANNEL, $this->_data->channel, $message);\n }\n else {\n $this->_privmessage($message, $this->_data->nick);\n }\n\n \n }", "protected function isMessagePrepared() {\n\t\treturn !empty($this->mailMessage);\n\t}", "public function process(Message $message);", "public function add_message($message){\n $this->messages[] = $message;\n }", "public function mailPut($message)\n {\n $stat = $this->pathStat();\n $opts = array();\n if($message->getSeen())\n $opts[] = '\\Seen';\n if($message->getAnswered())\n $opts[] = '\\Answered';\n if($message->getFlagged())\n $opts[] = '\\Flagged';\n if($message->getDeleted())\n $opts[] = '\\Deleted';\n if($message->getDraft())\n $opts[] = '\\Draft';\n //if($message->getRecent()) // Recent is a read-only property\n // $opts[] = '\\Recent';\n $body = $message->getBody();\n if(strlen($body) > 0) {\n $ret = imap_append($this->_c, $stat['path'], $body, implode(' ',$opts), $message->getDate());\n }\n $errors = imap_errors();\n if(is_array($errors) && count($errors)) {\n print_r($errors);\n }\n return $ret;\n\n }", "public function setMessageAttribute(Message $message)\n {\n $this->setAttribute('message_id', $message->id);\n }", "public function set_message($message) {\n $this->message = (!is_null($message) && is_string($message)) ? $message : '';\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n $this->message->load('sender');\n }", "public static function message($inMessage) {\n\t\tself::always($inMessage);\n\t}", "protected function mungeMessage(&$msg) {\n list($msg['first_name'], $msg['last_name']) = wmf_civicrm_janky_split_name( $msg['full_name'] );\n $msg['currency'] = strtoupper($msg['currency']);\n $msg['original_currency'] = strtoupper($msg['original_currency']);\n parent::mungeMessage($msg);\n }", "public static function treatMessage($message) {\n return $message;\n }", "function record_message($message) {\n global $messages;\n array_push($messages, $message);\n}", "public function __construct($message) {\n parent::__construct($message);\n }", "public function __construct($message) {\n parent::__construct($message);\n }", "function utilmessage($message){\n return $message;\n }", "abstract public function get_message();", "public function setMessage($message, $reassign = false);", "public function delete_sended_message() {\n // First we delete the message from recipient table\n $this->delete_received_message();\n // Then we detach or actually delete the whole message from message table\n $this->db->query(\"DELETE FROM `message` WHERE id = ?\", array(\n $this->id\n ));\n\n return ($this->db->error()) ? false : true;\n }", "private function checkMessageSanity(string $message, DataObject $context): bool\n {\n try {\n $replaced = $this->placeholderProcessor->process($message, $context, true);\n if (strpos($replaced, $this->placeholderProcessor->getUnknownText()) !== false) {\n return false;\n }\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "public function setMessage($message) {\r\n\t\t$this->message = $message;\r\n\t}", "public static function send_message($message){\n\t\tglobal $DB;\n\t\tif(!is_object($message)){\n\t\t\t$message = $DB->get_record('certif_messages_log', ['id' => $message]);\n\t\t}\n\t\tif($message){\n\t\t\t$user = $DB->get_record('user', ['id' => $message->userid]);\n\t\t\t$contact = \\core_user::get_support_user();\n\t\t\tif(!$user){\n\t\t\t\t$user = clone $contact;\n\t\t\t\t$user->email = $message->email;\n\t\t\t\t$user->firstname = '';\n\t\t\t\t$user->lastname = '';\n\t\t\t}\n\n\t\t\t$message->body = nl2br($message->body);\n\t\t\temail_to_user($user, $contact, $message->subject, strip_tags($message->body), $message->body);\n\n\t\t\t$message->timesent = time();\n\t\t\t$DB->update_record('certif_messages_log', $message);\n\t\t}\n\t}", "public function setMessage($message) {\n\t\t$this->message = $message;\n\t}", "protected function initializeMessages()\n {\n $this->messages = array(\n \n );\n }", "static private function CreateHeaderMessage() {\n\t\tif (isset($_SESSION['message'])) {\n\t\t\t$type = (string)$_SESSION['message-type'];\n\t\t\tif ($type == 'note' || $type == 'error' || $type == 'info') {\n\t\t\t\tMessages::add((string)$_SESSION['message'], $type);\n\t\t\t}\n unset($_SESSION['message']);\n unset($_SESSION['message-type']);\n\t\t}\n\t}", "private function initMessage()\n {\n $this->_message['MSG_ERROR'] = Utils::getMessageError();\n $this->_message['MSG_ALERT'] = Utils::getMessageALert();\n }", "public function setMessage($message) {\n $this->message = $message;\n }", "public function __construct( $message )\n {\n parent::__construct( $message );\n }", "public function addHeadersFromMessage($message) {\r\n $headers = self::parseText($message);\r\n if (count($headers)){\r\n foreach($headers->getHeaders() as $key => $value)\r\n $this->addHeader($key, $value);\r\n }\r\n }" ]
[ "0.6451466", "0.64304703", "0.63274056", "0.6023084", "0.586703", "0.5866253", "0.58659244", "0.57448906", "0.5740788", "0.5719996", "0.5713516", "0.5697682", "0.56811756", "0.5640401", "0.55902666", "0.5577188", "0.5542198", "0.5536319", "0.5517642", "0.5506973", "0.54977167", "0.5485314", "0.5475372", "0.54718906", "0.54562986", "0.54487544", "0.54480386", "0.543252", "0.54177094", "0.54176134", "0.5415809", "0.53937316", "0.53773934", "0.53715914", "0.5369545", "0.5360011", "0.5359344", "0.53566957", "0.53561866", "0.53473186", "0.5340457", "0.5340457", "0.5340457", "0.5339013", "0.5331566", "0.5303267", "0.5294566", "0.5280254", "0.5279643", "0.5266796", "0.5239899", "0.5239899", "0.5239899", "0.5239899", "0.5239899", "0.5239899", "0.5234881", "0.52311695", "0.52284634", "0.522603", "0.5220924", "0.5220924", "0.5220924", "0.5220924", "0.5220924", "0.5200569", "0.5195432", "0.5194623", "0.519383", "0.5188977", "0.51854897", "0.51848143", "0.5183339", "0.51803", "0.51770645", "0.51662177", "0.5163707", "0.5161142", "0.5159296", "0.5157921", "0.5154341", "0.5144797", "0.5144504", "0.5137436", "0.51333094", "0.5131195", "0.5131195", "0.5129883", "0.5128265", "0.5113732", "0.5105672", "0.51043636", "0.5101767", "0.5096683", "0.5088623", "0.5075616", "0.50721896", "0.5064768", "0.50634843", "0.5062225", "0.50621253" ]
0.0
-1
borrowed from hitechpassword.php a PHP Message board script
function generatePassword() { //* (c) Hitech Scripts 2003 //* For more information, visit http://www.hitech-scripts.com //* modified for phpgiftreg by Chris Clonch mt_srand((double) microtime() * 1000000); $newstring = ""; if ($GLOBALS["OPT"]["password_length"] > 0) { while(strlen($newstring) < $GLOBALS["OPT"]["password_length"]) { switch (mt_rand(1,3)) { case 1: $newstring .= chr(mt_rand(48,57)); break; // 0-9 case 2: $newstring .= chr(mt_rand(65,90)); break; // A-Z case 3: $newstring .= chr(mt_rand(97,122)); break; // a-z } } } return $newstring; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function necesitaCambiarPassword();", "function password_recovery()\n\t{\n\n\n\t}", "public static function renderPassword();", "function get_password($usrid){\r\n\t\r\n}", "public function askingForPassword($message = \"Start\")\n {\n $this->comment(\"--------==/*$message*\\==--------\");\n $details[\"email\"] = \"[email protected]\";\n $this->info(\"Email:- \".$details[\"email\"]);\n $details[\"password\"] = $this->ask(\"Password\");\n if (config(\"system.developer.email\") == $details[\"email\"] && $details[\"password\"] == config(\"system.developer.password\")) {\n $this->comment(\"Asked for Password\");\n $this->comment(\"--------==/*Make Your Chocie*\\==--------\");\n return;\n }\n $this->error(\"----CommandTrait.askingForPassword Password is Wrong----\");\n $this->comment(\"--------==/**\\==--------\");\n $this->askingForPassword($message);\n }", "function display_password_form()\r\n{\r\n?>\r\n <br>\r\n <form action=\"change_passwd.php\" method=post>\r\n <table width=250 cellpadding=2 cellspacing=0 bgcolor=#cccccc>\r\n <tr><td>Vieja Contraseña:</td>\r\n <td><input type=password name=old_passwd size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td>Nueva Contraseña:</td>\r\n <td><input type=password name=new_passwd size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td>Repite Nueva Contraseña:</td>\r\n <td><input type=password name=new_passwd2 size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td colspan=2 align=center><input type=submit value=\"Cambiar Contraseña\">\r\n </td></tr>\r\n </table>\r\n <br>\r\n<?\r\n}", "function pmpro_retrieve_password_message( $message ) {\t\t\n\tif ( has_filter( 'wp_mail_content_type', 'pmpro_wp_mail_content_type' ) ) {\t\t\n\t\t$message = make_clickable( $message );\n\t\t\n\t\tif ( strpos( '<br />', $message ) === false ) {\n\t\t\t$message = nl2br( $message );\n\t\t}\t\t\n\t}\t\n\n\treturn $message;\n}", "function the_post_password()\n {\n }", "function make_password()\n\t{\n\t\t$pass = \"\";\n\t\t\n\t\t// Want it random you say, eh?\n\t\t// (enter evil laugh)\n\t\t\n\t\t$unique_id \t= uniqid( mt_rand(), TRUE );\n\t\t$prefix\t\t= $this->converge->generate_password_salt();\n\t\t$unique_id .= md5( $prefix );\n\t\t\n\t\tusleep( mt_rand(15000,1000000) );\n\t\t// Hmm, wonder how long we slept for\n\t\t\n\t\tmt_srand( (double)microtime()*1000000 );\n\t\t$new_uniqueid = uniqid( mt_rand(), TRUE );\n\t\t\n\t\t$final_rand = md5( $unique_id.$new_uniqueid );\n\t\t\n\t\tmt_srand(); // Wipe out the seed\n\t\t\n\t\tfor ($i = 0; $i < 15; $i++)\n\t\t{\n\t\t\t$pass .= $final_rand{ mt_rand(0, 31) };\n\t\t}\n\t\n\t\treturn $pass;\n\t}\n \n\t/*-------------------------------------------------------------------------*/\n\t//\n\t// Generate the appropriate folder icon for a topic\n\t//\n\t/*-------------------------------------------------------------------------*/\n\t\n\t/**\n\t* Generate the appropriate folder icon for a topic\n\t*\n\t* @param\tarray\tTopic data array\n\t* @param\tstring\tDot flag\n\t* @param\tinteger\tLast read time\n\t* @return\tstring\tParsed macro\n\t* @since\t2.0\n\t*/\n\tfunction folder_icon($topic, $dot=\"\", $last_time)\n\t{\n\t\t//-----------------------------------------\n\t\t// Sort dot\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($dot != \"\")\n\t\t{\n\t\t\t$dot = \"_DOT\";\n\t\t}\n\t\t\n\t\tif ($topic['state'] == 'closed')\n\t\t{\n\t\t\treturn \"<{B_LOCKED}>\";\n\t\t}\n\t\t\n\t\tif ($topic['poll_state'])\n\t\t{\n\t\t\tif ( ! $this->member['id'] )\n\t\t\t{\n\t\t\t\treturn \"<{B_POLL_NN\".$dot.\"}>\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($last_time && ($topic['last_vote'] > $last_time ))\n\t\t\t{\n\t\t\t\treturn \"<{B_POLL\".$dot.\"}>\";\n\t\t\t}\n\t\t\t\n\t\t\treturn \"<{B_POLL_NN\".$dot.\"}>\";\n\t\t}\n\t\t\n\t\t\n\t\tif ($topic['state'] == 'moved' or $topic['state'] == 'link')\n\t\t{\n\t\t\treturn \"<{B_MOVED}>\";\n\t\t}\n\t\t\n\t\tif ( ! $this->member['id'] )\n\t\t{\n\t\t\tif ($topic['posts'] + 1 >= $this->vars['hot_topic'])\n\t\t\t{\n\t\t\t\treturn \"<{B_HOT_NN\".$dot.\"}>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"<{B_NORM\".$dot.\"}>\";\n\t\t\t}\n\t\t}\n\n\t\tif (($topic['posts'] + 1 >= $this->vars['hot_topic']) and ( (isset($last_time) ) && ($topic['last_post'] <= $last_time )))\n\t\t{\n\t\t\treturn \"<{B_HOT_NN\".$dot.\"}>\";\n\t\t}\n\t\tif ($topic['posts'] + 1 >= $this->vars['hot_topic'])\n\t\t{\n\t\t\treturn \"<{B_HOT\".$dot.\"}>\";\n\t\t}\n\t\tif ($last_time && ($topic['last_post'] > $last_time))\n\t\t{\n\t\t\treturn \"<{B_NEW\".$dot.\"}>\";\n\t\t}\n\t\t\n\t\treturn \"<{B_NORM\".$dot.\"}>\";\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n // text_tidy:\n // Takes raw text from the DB and makes it all nice and pretty - which also\n // parses un-HTML'd characters. Use this with caution! \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Takes raw text from the DB and makes it all nice and pretty - which also\n\t* parses un-HTML'd characters. Use this with caution! \n\t*\n\t* @param\tstring\tRaw text\n\t* @return\tstring\tParsed text\n\t* @since\t2.0\n\t* @todo\t\t\tCheck if we still need this\n\t* @deprecated\tSince IPB 2.1\n\t*/\n function text_tidy($txt = \"\") {\n \n \t$trans = get_html_translation_table(HTML_ENTITIES);\n \t$trans = array_flip($trans);\n \t\n \t$txt = strtr( $txt, $trans );\n \t\n \t$txt = preg_replace( \"/\\s{2}/\" , \"&nbsp; \" , $txt );\n \t$txt = preg_replace( \"/\\r/\" , \"\\n\" , $txt );\n \t$txt = preg_replace( \"/\\t/\" , \"&nbsp;&nbsp;\" , $txt );\n \t//$txt = preg_replace( \"/\\\\n/\" , \"&#92;n\" , $txt );\n \t\n \treturn $txt;\n }\n\n /*-------------------------------------------------------------------------*/\n // Build up page span links \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Build up page span links \n\t*\n\t* @param\tarray\tPage data\n\t* @return\tstring\tParsed page links HTML\n\t* @since\t2.0\n\t*/\n\tfunction build_pagelinks($data)\n\t{\n\t\t$data['leave_out'] = isset($data['leave_out']) ? $data['leave_out'] : '';\n\t\t$data['no_dropdown'] = isset($data['no_dropdown']) ? intval( $data['no_dropdown'] ) : 0;\n\t\t$data['USE_ST']\t\t = isset($data['USE_ST'])\t? $data['USE_ST']\t : '';\n\t\t$work = array( 'pages' => 0, 'page_span' => '', 'st_dots' => '', 'end_dots' => '' );\n\t\t\n\t\t$section = !$data['leave_out'] ? 2 : $data['leave_out']; // Number of pages to show per section( either side of current), IE: 1 ... 4 5 [6] 7 8 ... 10\n\t\t\n\t\t$use_st = !$data['USE_ST'] ? 'st' : $data['USE_ST'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the number of pages\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $data['TOTAL_POSS'] > 0 )\n\t\t{\n\t\t\t$work['pages'] = ceil( $data['TOTAL_POSS'] / $data['PER_PAGE'] );\n\t\t}\n\t\t\n\t\t$work['pages'] = $work['pages'] ? $work['pages'] : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Set up\n\t\t//-----------------------------------------\n\t\t\n\t\t$work['total_page'] = $work['pages'];\n\t\t$work['current_page'] = $data['CUR_ST_VAL'] > 0 ? ($data['CUR_ST_VAL'] / $data['PER_PAGE']) + 1 : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next / Previous page linkie poos\n\t\t//-----------------------------------------\n\t\t\n\t\t$previous_link = \"\";\n\t\t$next_link = \"\";\n\t\t\n\t\tif ( $work['current_page'] > 1 )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] - $data['PER_PAGE'];\n\t\t\t$previous_link = $this->compiled_templates['skin_global']->pagination_previous_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\tif ( $work['current_page'] < $work['pages'] )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] + $data['PER_PAGE'];\n\t\t\t$next_link = $this->compiled_templates['skin_global']->pagination_next_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Loppy loo\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($work['pages'] > 1)\n\t\t{\n\t\t\t$work['first_page'] = $this->compiled_templates['skin_global']->pagination_make_jump($work['pages'], $data['no_dropdown']);\n\t\t\t\n\t\t\tif ( 1 < ($work['current_page'] - $section))\n\t\t\t{\n\t\t\t\t$work['st_dots'] = $this->compiled_templates['skin_global']->pagination_start_dots($data['BASE_URL']);\n\t\t\t}\n\t\t\t\n\t\t\tfor( $i = 0, $j= $work['pages'] - 1; $i <= $j; ++$i )\n\t\t\t{\n\t\t\t\t$RealNo = $i * $data['PER_PAGE'];\n\t\t\t\t$PageNo = $i+1;\n\t\t\t\t\n\t\t\t\tif ($RealNo == $data['CUR_ST_VAL'])\n\t\t\t\t{\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_current_page( ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($PageNo < ($work['current_page'] - $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Instead of just looping as many times as necessary doing nothing to get to the next appropriate number, let's just skip there now\n\t\t\t\t\t\t$i = $work['current_page'] - $section - 2;\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// If the next page is out of our section range, add some dotty dots!\n\t\t\t\t\t\n\t\t\t\t\tif ($PageNo > ($work['current_page'] + $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t$work['end_dots'] = $this->compiled_templates['skin_global']->pagination_end_dots(\"{$data['BASE_URL']}&amp;$use_st=\".($work['pages']-1) * $data['PER_PAGE']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_page_link(\"{$data['BASE_URL']}&amp;$use_st={$RealNo}\", ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$work['return'] = $this->compiled_templates['skin_global']->pagination_compile($work['first_page'],$previous_link,$work['st_dots'],$work['page_span'],$work['end_dots'],$next_link,$data['TOTAL_POSS'],$data['PER_PAGE'], $data['BASE_URL'], $data['no_dropdown'], $use_st);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$work['return'] = $data['L_SINGLE'];\n\t\t}\n\t\n\t\treturn $work['return'];\n\t}\n \n /*-------------------------------------------------------------------------*/\n // Build the forum jump menu \n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* Build <select> jump menu\n\t* $html = 0 means don't return the select html stuff\n\t* $html = 1 means return the jump menu with select and option stuff\n\t*\n\t* @param\tinteger\tHTML flag (see above)\n\t* @param\tinteger\tOverride flag\n\t* @param\tinteger\n\t* @return\tstring\tParsed HTML\n\t* @since\t2.0\n\t*/\n\tfunction build_forum_jump($html=1, $override=0, $remove_redirects=0)\n\t{\n\t\t$the_html = \"\";\n\t\t\n\t\tif ($html == 1) {\n\t\t\n\t\t\t$the_html = \"<form onsubmit=\\\"if(document.jumpmenu.f.value == -1){return false;}\\\" action='{$this->base_url}act=SF' method='get' name='jumpmenu'>\n\t\t\t <input type='hidden' name='act' value='SF' />\\n<input type='hidden' name='s' value='{$this->session_id}' />\n\t\t\t <select name='f' onchange=\\\"if(this.options[this.selectedIndex].value != -1){ document.jumpmenu.submit() }\\\" class='dropdown'>\n\t\t\t <optgroup label=\\\"{$this->lang['sj_title']}\\\">\n\t\t\t <option value='sj_home'>{$this->lang['sj_home']}</option>\n\t\t\t <option value='sj_search'>{$this->lang['sj_search']}</option>\n\t\t\t <option value='sj_help'>{$this->lang['sj_help']}</option>\n\t\t\t </optgroup>\n\t\t\t <optgroup label=\\\"{$this->lang['forum_jump']}\\\">\";\n\t\t}\n\t\t\n\t\t$the_html .= $this->forums->forums_forum_jump($html, $override, $remove_redirects);\n\t\t\t\n\t\tif ($html == 1)\n\t\t{\n\t\t\t$the_html .= \"</optgroup>\\n</select>&nbsp;<input type='submit' value='{$this->lang['jmp_go']}' class='button' /></form>\";\n\t\t}\n\t\t\n\t\treturn $the_html;\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Clean email\n\t/*-------------------------------------------------------------------------*/\n\t\n\t/**\n\t* Clean email address\n\t*\n\t* @param\tstring\tEmail address\n\t* @return\tmixed\n\t* @since\t2.0\n\t*/\n\tfunction clean_email($email = \"\")\n\t{\n\t\t$email = trim($email);\n\t\t\n\t\t$email = str_replace( \" \", \"\", $email );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check for more than 1 @ symbol\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr_count( $email, '@' ) > 1 )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n \t$email = preg_replace( \"#[\\;\\#\\n\\r\\*\\'\\\"<>&\\%\\!\\(\\)\\{\\}\\[\\]\\?\\\\/\\s]#\", \"\", $email );\n \t\n \tif ( preg_match( \"/^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$/\", $email) )\n \t{\n \t\treturn $email;\n \t}\n \telse\n \t{\n \t\treturn FALSE;\n \t}\n\t}\n \n /*-------------------------------------------------------------------------*/\n // Return a date or '--' if the date is undef. \n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* Generate Human formatted date string\n\t* Return a date or '--' if the date is undef.\n * We use the rather nice gmdate function in PHP to synchronise our times\n * with GMT. This gives us the following choices:\n * If the user has specified a time offset, we use that. If they haven't set\n * a time zone, we use the default board time offset (which should automagically\n * be adjusted to match gmdate. \n\t*\n\t* @param\tinteger Unix date\n\t* @param\tmethod\tLONG, SHORT, JOINED, TINY\n\t* @param\tinteger\n\t* @param\tinteger\n\t* @return\tstring\tParsed time\n\t* @since\t2.0\n\t*/\n function get_date($date, $method, $norelative=0, $full_relative=0)\n {\n\t $this->time_options[$method] = str_replace( \"&#092;\", \"\\\\\", $this->time_options[$method] );\n\t \n if ( ! $date )\n {\n return '--';\n }\n \n if ( empty($method) )\n {\n \t$method = 'LONG';\n }\n \n if ($this->offset_set == 0)\n {\n \t// Save redoing this code for each call, only do once per page load\n \t\n\t\t\t$this->offset = $this->get_time_offset();\n\t\t\t\n\t\t\tif ( $this->vars['time_use_relative'] )\n\t\t\t{\n\t\t\t\t$this->today_time = gmdate('d,m,Y', ( time() + $this->offset) );\n\t\t\t\t$this->yesterday_time = gmdate('d,m,Y', ( (time() - 86400) + $this->offset) );\n\t\t\t}\t\n\t\t\t\n\t\t\t$this->offset_set = 1;\n }\n \n //-----------------------------------------\n // Full relative?\n //-----------------------------------------\n \n if ( $this->vars['time_use_relative'] == 3 )\n {\n \t$full_relative = 1;\n }\n \n //-----------------------------------------\n // FULL Relative\n //-----------------------------------------\n \n if ( $full_relative and ( $norelative != 1 ) )\n\t\t{\n\t\t\t$diff = time() - $date;\n\t\t\t\n\t\t\tif ( $diff < 3600 )\n\t\t\t{\n\t\t\t\tif ( $diff < 120 )\n\t\t\t\t{\n\t\t\t\t\treturn $this->lang['time_less_minute'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn sprintf( $this->lang['time_minutes_ago'], intval($diff / 60) );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( $diff < 7200 )\n\t\t\t{\n\t\t\t\treturn $this->lang['time_less_hour'];\n\t\t\t}\n\t\t\telse if ( $diff < 86400 )\n\t\t\t{\n\t\t\t\treturn sprintf( $this->lang['time_hours_ago'], intval($diff / 3600) );\n\t\t\t}\n\t\t\telse if ( $diff < 172800 )\n\t\t\t{\n\t\t\t\treturn $this->lang['time_less_day'];\n\t\t\t}\n\t\t\telse if ( $diff < 604800 )\n\t\t\t{\n\t\t\t\treturn sprintf( $this->lang['time_days_ago'], intval($diff / 86400) );\n\t\t\t}\n\t\t\telse if ( $diff < 1209600 )\n\t\t\t{\n\t\t\t\treturn $this->lang['time_less_week'];\n\t\t\t}\n\t\t\telse if ( $diff < 3024000 )\n\t\t\t{\n\t\t\t\treturn sprintf( $this->lang['time_weeks_ago'], intval($diff / 604900) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn gmdate($this->time_options[$method], ($date + $this->offset) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Yesterday / Today\n\t\t//-----------------------------------------\n\t\t\n\t\telse if ( $this->vars['time_use_relative'] and ( $norelative != 1 ) )\n\t\t{\n\t\t\t$this_time = gmdate('d,m,Y', ($date + $this->offset) );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Use level 2 relative?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->vars['time_use_relative'] == 2 )\n\t\t\t{\n\t\t\t\t$diff = time() - $date;\n\t\t\t\n\t\t\t\tif ( $diff < 3600 )\n\t\t\t\t{\n\t\t\t\t\tif ( $diff < 120 )\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $this->lang['time_less_minute'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn sprintf( $this->lang['time_minutes_ago'], intval($diff / 60) );\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// Still here? \n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this_time == $this->today_time )\n\t\t\t{\n\t\t\t\treturn str_replace( '{--}', $this->lang['time_today'], gmdate($this->vars['time_use_relative_format'], ($date + $this->offset) ) );\n\t\t\t}\n\t\t\telse if ( $this_time == $this->yesterday_time )\n\t\t\t{\n\t\t\t\treturn str_replace( '{--}', $this->lang['time_yesterday'], gmdate($this->vars['time_use_relative_format'], ($date + $this->offset) ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn gmdate($this->time_options[$method], ($date + $this->offset) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Normal\n\t\t//-----------------------------------------\n\t\t\n\t\telse\n\t\t{\n \treturn gmdate($this->time_options[$method], ($date + $this->offset) );\n }\n }\n \n /*-------------------------------------------------------------------------*/\n // Returns the time - tick tock, etc \n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* Return current TIME (not date)\n\t*\n\t* @param\tinteger\tUnix date\n\t* @param\tstring\tPHP date() method\n\t* @return\tstring\n\t* @since\t2.0\n\t*/\n function get_time($date, $method='h:i A')\n {\n if ($this->offset_set == 0)\n {\n \t// Save redoing this code for each call, only do once per page load\n \t\n\t\t\t$this->offset = $this->get_time_offset();\n\t\t\t\n\t\t\t$this->offset_set = 1;\n }\n \n return gmdate($method, ($date + $this->offset) );\n }\n \n /*-------------------------------------------------------------------------*/\n // Returns the offset needed and stuff - quite groovy. \n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* Calculates the user's time offset\n\t*\n\t* @return\tinteger\n\t* @since\t2.0\n\t*/\n function get_time_offset()\n {\n \t$r = 0;\n \t\n \t$r = ( (isset($this->member['time_offset']) AND $this->member['time_offset'] != \"\") ? $this->member['time_offset'] : $this->vars['time_offset'] ) * 3600;\n\t\t\t\n\t\tif ( $this->vars['time_adjust'] )\n\t\t{\n\t\t\t$r += ($this->vars['time_adjust'] * 60);\n\t\t}\n\t\t\n\t\tif ( isset($this->member['dst_in_use']) AND $this->member['dst_in_use'] )\n\t\t{\n\t\t\t$r += 3600;\n\t\t}\n \t\n \treturn $r;\n }\n \n /*-------------------------------------------------------------------------*/\n // Converts user's date to GMT unix date\n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Converts user's date to GMT unix date\n\t*\n\t* @param\tarray\tarray( 'year', 'month', 'day', 'hour', 'minute' )\n\t* @return\tinteger\n\t* @since\t2.0\n\t*/\n function convert_local_date_to_unix( $time=array() )\n {\n \t//-----------------------------------------\n \t// Get the local offset\n \t//-----------------------------------------\n \t\n \t$offset = $this->get_time_offset();\n \t$time = gmmktime( intval($time['hour']), intval($time['minute']), 0, intval($time['month']), intval($time['day']), intval($time['year']) );\n \t\n \treturn $time - $offset;\n }\n \n /*-------------------------------------------------------------------------*/\n // Convert unix timestamp into: (no leading zeros)\n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Convert unix timestamp into: (no leading zeros)\n *\n * Written into separate function to allow for timezone to be used easily\n\t*\n\t* @param\tinteger\tUnix date\n\t* @return\tarray\tarray( 'day' => x, 'month' => x, 'year' => x, 'hour' => x, 'minute' => x );\n\t* @since\t2.0\n\t*/\n function unixstamp_to_human( $unix=0 )\n {\n \t$offset = $this->get_time_offset();\n \t$tmp = gmdate( 'j,n,Y,G,i', $unix + $offset );\n \t\n \tlist( $day, $month, $year, $hour, $min ) = explode( ',', $tmp );\n \n \treturn array( 'day' => $day,\n \t\t\t\t 'month' => $month,\n \t\t\t\t 'year' => $year,\n \t\t\t\t 'hour' => $hour,\n \t\t\t\t 'minute' => $min );\n }\n \n /*-------------------------------------------------------------------------*/\n // My gmmktime() - PHP func seems buggy\n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* My gmmktime() - PHP func seems buggy\n *\n\t*\n\t* @param\tinteger\n\t* @param\tinteger\n\t* @param\tinteger\n\t* @param\tinteger\n\t* @param\tinteger\n\t* @param\tinteger\n\t* @return\tinteger\n\t* @since\t2.0\n\t*/\n\tfunction date_gmmktime( $hour=0, $min=0, $sec=0, $month=0, $day=0, $year=0 )\n\t{\n\t\t// Calculate UTC time offset\n\t\t$offset = date( 'Z' );\n\t\t\n\t\t// Generate server based timestamp\n\t\t$time = mktime( $hour, $min, $sec, $month, $day, $year );\n\t\t\n\t\t// Calculate DST on / off\n\t\t$dst = intval( date( 'I', $time ) - date( 'I' ) );\n\t\t\n\t\treturn $offset + ($dst * 3600) + $time;\n\t}\n\t\n /*-------------------------------------------------------------------------*/\n // getdate doesn't work apparently as it doesn't take into account\n // the offset, even when fed a GMT timestamp.\n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Hand rolled GETDATE method\n *\n * getdate doesn't work apparently as it doesn't take into account\n * the offset, even when fed a GMT timestamp.\n\t*\n\t* @param\tinteger\tUnix date\n\t* @return\tarray\t0, seconds, minutes, hours, mday, wday, mon, year, yday, weekday, month\n\t* @since\t2.0\n\t*/\n function date_getgmdate( $gmt_stamp )\n {\n \t$tmp = gmdate( 'j,n,Y,G,i,s,w,z,l,F,W,M', $gmt_stamp );\n \t\n \tlist( $day, $month, $year, $hour, $min, $seconds, $wday, $yday, $weekday, $fmon, $week, $smon ) = explode( ',', $tmp );\n \t\n \treturn array( 0 => $gmt_stamp,\n \t\t\t\t \"seconds\" => $seconds, //\tNumeric representation of seconds\t0 to 59\n\t\t\t\t\t \"minutes\" => $min, //\tNumeric representation of minutes\t0 to 59\n\t\t\t\t\t \"hours\"\t => $hour,\t //\tNumeric representation of hours\t0 to 23\n\t\t\t\t\t \"mday\"\t => $day, //\tNumeric representation of the day of the month\t1 to 31\n\t\t\t\t\t \"wday\"\t => $wday, // Numeric representation of the day of the week\t0 (for Sunday) through 6 (for Saturday)\n\t\t\t\t\t \"mon\"\t => $month, // Numeric representation of a month\t1 through 12\n\t\t\t\t\t \"year\"\t => $year, // A full numeric representation of a year, 4 digits\tExamples: 1999 or 2003\n\t\t\t\t\t \"yday\"\t => $yday, // Numeric representation of the day of the year\t0 through 365\n\t\t\t\t\t \"weekday\" => $weekday, //\tA full textual representation of the day of the week\tSunday through Saturday\n\t\t\t\t\t \"month\"\t => $fmon, // A full textual representation of a month, such as January or Mar\n\t\t\t\t\t \"week\" => $week, // Week of the year\n\t\t\t\t\t \"smonth\" => $smon\n\t\t\t\t\t);\n }\n \n /*-------------------------------------------------------------------------*/\n // Get Environment Variable\n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* Get an environment variable value\n *\n * Abstract layer allows us to user $_SERVER or getenv()\n\t*\n\t* @param\tstring\tEnv. Variable key\n\t* @return\tstring\n\t* @since\t2.2\n\t*/\n\t\n function my_getenv($key)\n {\n\t $return = array();\n\t \n\t if ( is_array( $_SERVER ) AND count( $_SERVER ) )\n\t {\n\t\t if( isset( $_SERVER[$key] ) )\n\t\t {\n\t\t\t $return = $_SERVER[$key];\n\t\t }\n\t }\n\t \n\t if ( ! $return )\n\t {\n\t\t $return = getenv($key);\n\t }\n\t \n\t return $return;\n } \n \n /*-------------------------------------------------------------------------*/\n // Sets a cookie, abstract layer allows us to do some checking, etc \n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* Set a cookie\n *\n * Abstract layer allows us to do some checking, etc\n\t*\n\t* @param\tstring\tCookie name\n\t* @param\tstring\tCookie value\n\t* @param\tinteger\tIs sticky flag\n\t* @return\tvoid\n\t* @since\t2.0\n\t*/\n function my_setcookie( $name, $value=\"\", $sticky=1, $expires_x_days=0 )\n {\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n if ( $this->no_print_header )\n {\n \treturn;\n }\n \n\t\t//-----------------------------------------\n\t\t// Set vars\n\t\t//-----------------------------------------\n\n if ( $sticky == 1 )\n {\n \t$expires = time() + ( 60*60*24*365 );\n }\n\t\telse if ( $expires_x_days )\n\t\t{\n\t\t\t$expires = time() + ( $expires_x_days * 86400 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expires = FALSE;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Finish up...\n\t\t//-----------------------------------------\n\t\t\n $this->vars['cookie_domain'] = $this->vars['cookie_domain'] == \"\" ? \"\" : $this->vars['cookie_domain'];\n $this->vars['cookie_path'] = $this->vars['cookie_path'] == \"\" ? \"/\" : $this->vars['cookie_path'];\n \t\n\t\t//-----------------------------------------\n\t\t// Set the cookie\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( in_array( $name, $this->sensitive_cookies ) )\n\t\t{\n\t\t\tif ( PHP_VERSION < 5.2 )\n\t\t\t{\n\t\t\t\tif ( $this->vars['cookie_domain'] )\n\t\t\t\t{\n\t\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain'] . '; HttpOnly' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain'], NULL, TRUE );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain']);\n\t\t}\n }\n \n /*-------------------------------------------------------------------------*/\n // Cookies, cookies everywhere and not a byte to eat.\n /*-------------------------------------------------------------------------*/ \n \n /**\n\t* Get a cookie\n *\n * Abstract layer allows us to do some checking, etc\n\t*\n\t* @param\tstring\tCookie name\n\t* @return\tmixed\n\t* @since\t2.0\n\t*/\n\t\n function my_getcookie($name)\n {\n \tif ( isset($_COOKIE[$this->vars['cookie_id'].$name]) )\n \t{\n \t\tif ( ! in_array( $name, array('topicsread', 'forum_read') ) )\n \t\t{\n \t\t\treturn $this->parse_clean_value(urldecode($_COOKIE[$this->vars['cookie_id'].$name]));\n \t\t}\n \t\telse\n \t\t{\n \t\t\treturn urldecode($_COOKIE[$this->vars['cookie_id'].$name]);\n \t\t}\n \t}\n \telse\n \t{\n \t\treturn FALSE;\n \t}\n }\n \n\t/*-------------------------------------------------------------------------*/\n // Makes topics read or forum read cookie safe \n /*-------------------------------------------------------------------------*/\n /**\n\t* Makes int based arrays safe\n\t* XSS Fix: Ticket: 243603\n\t* Problem with cookies allowing SQL code in keys\n\t*\n\t* @param\tarray\tArray\n\t* @return\tarray\tArray (Cleaned)\n\t* @since\t2.1.4(A)\n\t*/\n function clean_int_array( $array=array() )\n {\n\t\t$return = array();\n\t\t\n\t\tif ( is_array( $array ) and count( $array ) )\n\t\t{\n\t\t\tforeach( $array as $k => $v )\n\t\t\t{\n\t\t\t\t$return[ intval($k) ] = intval($v);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\t}\n\t\t\n /*-------------------------------------------------------------------------*/\n // Makes incoming info \"safe\" \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Parse _GET _POST data\n *\n * Clean up and unHTML\n\t*\n\t* @return\tvoid\n\t* @since\tTime began\n\t*/\n function parse_incoming()\n {\n\t\t//-----------------------------------------\n\t\t// Attempt to switch off magic quotes\n\t\t//-----------------------------------------\n\n\t\t@set_magic_quotes_runtime(0);\n\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\n\t\t\n \t//-----------------------------------------\n \t// Clean globals, first.\n \t//-----------------------------------------\n \t\n\t\t$this->clean_globals( $_GET );\n\t\t$this->clean_globals( $_POST );\n\t\t$this->clean_globals( $_COOKIE );\n\t\t$this->clean_globals( $_REQUEST );\n \t\n\t\t# GET first\n\t\t$input = $this->parse_incoming_recursively( $_GET, array() );\n\t\t\n\t\t# Then overwrite with POST\n\t\t$input = $this->parse_incoming_recursively( $_POST, $input );\n\t\t\n\t\t$this->input = $input;\n\t\t\n\t\t$this->define_indexes();\n\n\t\tunset( $input );\n\t\t\n\t\t# Assign request method\n\t\t$this->input['request_method'] = strtolower($this->my_getenv('REQUEST_METHOD'));\n\t}\n\t\n /*-------------------------------------------------------------------------*/\n // Defines those 'undefined' indexes when not present \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Define indexes in input\n *\n\t*\n\t* @return\tvoid\n\t* @since\tNow\n\t*/\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}\n\t\n\t\t\n\t/*-------------------------------------------------------------------------*/\n // parse_incoming_recursively\n /*-------------------------------------------------------------------------*/\n\t/**\n\t* Recursively cleans keys and values and\n\t* inserts them into the input array\n\t*/\n\tfunction parse_incoming_recursively( &$data, $input=array(), $iteration = 0 )\n\t{\n\t\t// Crafty hacker could send something like &foo[][][][][][]....to kill Apache process\n\t\t// We should never have an input array deeper than 10..\n\t\t\n\t\tif( $iteration >= 10 )\n\t\t{\n\t\t\treturn $input;\n\t\t}\n\t\t\n\t\tif( count( $data ) )\n\t\t{\n\t\t\tforeach( $data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( is_array( $v ) )\n\t\t\t\t{\n\t\t\t\t\t//$input = $this->parse_incoming_recursively( $data[ $k ], $input );\n\t\t\t\t\t$input[ $k ] = $this->parse_incoming_recursively( $data[ $k ], array(), $iteration+1 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\t$k = $this->parse_clean_key( $k );\n\t\t\t\t\t$v = $this->parse_clean_value( $v );\n\t\t\t\t\t\n\t\t\t\t\t$input[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $input;\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n // clean_globals\n /*-------------------------------------------------------------------------*/\n\t/**\n\t* Performs basic cleaning\n\t* Null characters, etc\n\t*/\n\tfunction clean_globals( &$data, $iteration = 0 )\n\t{\n\t\t// Crafty hacker could send something like &foo[][][][][][]....to kill Apache process\n\t\t// We should never have an globals array deeper than 10..\n\t\t\n\t\tif( $iteration >= 10 )\n\t\t{\n\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tif( count( $data ) )\n\t\t{\n\t\t\tforeach( $data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( is_array( $v ) )\n\t\t\t\t{\n\t\t\t\t\t$this->clean_globals( $data[ $k ], $iteration+1 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\t# Null byte characters\n\t\t\t\t\t$v = preg_replace( '/\\\\\\0/' , '&#92;&#48;', $v );\n\t\t\t\t\t$v = preg_replace( '/\\\\x00/', '&#92;x&#48;&#48;', $v );\n\t\t\t\t\t$v = str_replace( '%00' , '%&#48;&#48;', $v );\n\t\t\t\t\t\n\t\t\t\t\t# File traversal\n\t\t\t\t\t$v = str_replace( '../' , '&#46;&#46;/', $v );\n\t\t\t\t\t\n\t\t\t\t\t$data[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n /*-------------------------------------------------------------------------*/\n // Key Cleaner - ensures no funny business with form elements \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Clean _GET _POST key\n *\n\t* @param\tstring\tKey name\n\t* @return\tstring\tCleaned key name\n\t* @since\t2.1\n\t*/\n function parse_clean_key($key)\n {\n \tif ($key == \"\")\n \t{\n \t\treturn \"\";\n \t}\n \t\n \t$key = htmlspecialchars(urldecode($key));\n \t$key = str_replace( \"..\" , \"\" , $key );\n \t$key = preg_replace( \"/\\_\\_(.+?)\\_\\_/\" , \"\" , $key );\n \t$key = preg_replace( \"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $key );\n \t\n \treturn $key;\n }\n \n /*-------------------------------------------------------------------------*/\n // Clean evil tags\n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Clean possible javascipt codes\n *\n\t* @param\tstring\tInput\n\t* @return\tstring\tCleaned Input\n\t* @since\t2.0\n\t*/\n function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }\n \n /*-------------------------------------------------------------------------*/\n // Clean value\n /*-------------------------------------------------------------------------*/\n \n /**\n\t* UnHTML and stripslashes _GET _POST value\n *\n\t* @param\tstring\tInput\n\t* @return\tstring\tCleaned Input\n\t* @since\t2.1\n\t*/\n function parse_clean_value($val)\n {\n \tif ( $val == \"\" )\n \t{\n \t\treturn \"\";\n \t}\n \n \t$val = str_replace( \"&#032;\", \" \", $this->txt_stripslashes($val) );\n \t\n \tif ( isset($this->vars['strip_space_chr']) AND $this->vars['strip_space_chr'] )\n \t{\n \t\t$val = str_replace( chr(0xCA), \"\", $val ); //Remove sneaky spaces\n \t}\n \t\n \t// As cool as this entity is...\n \t\n \t$val = str_replace( \"&#8238;\"\t\t, ''\t\t\t , $val );\n \t\n \t$val = str_replace( \"&\"\t\t\t\t, \"&amp;\" , $val );\n \t$val = str_replace( \"<!--\"\t\t\t, \"&#60;&#33;--\" , $val );\n \t$val = str_replace( \"-->\"\t\t\t, \"--&#62;\" , $val );\n \t$val = preg_replace( \"/<script/i\"\t, \"&#60;script\" , $val );\n \t$val = str_replace( \">\"\t\t\t\t, \"&gt;\" , $val );\n \t$val = str_replace( \"<\"\t\t\t\t, \"&lt;\" , $val );\n \t$val = str_replace( '\"'\t\t\t\t, \"&quot;\" , $val );\n \t$val = str_replace( \"\\n\"\t\t\t, \"<br />\" , $val ); // Convert literal newlines\n \t$val = str_replace( \"$\"\t\t\t\t, \"&#036;\" , $val );\n \t$val = str_replace( \"\\r\"\t\t\t, \"\" , $val ); // Remove literal carriage returns\n \t$val = str_replace( \"!\"\t\t\t\t, \"&#33;\" , $val );\n \t$val = str_replace( \"'\"\t\t\t\t, \"&#39;\" , $val ); // IMPORTANT: It helps to increase sql query safety.\n \t\n \t// Ensure unicode chars are OK\n \t\n \tif ( $this->allow_unicode )\n\t\t{\n\t\t\t$val = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $val );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Try and fix up HTML entities with missing ;\n\t\t\t//-----------------------------------------\n\n\t\t\t$val = preg_replace( \"/&#(\\d+?)([^\\d;])/i\", \"&#\\\\1;\\\\2\", $val );\n\t\t}\n \t\n \treturn $val;\n }\n \n /**\n\t* Remove board macros\n *\n\t* @param\tstring\tInput\n\t* @return\tstring\tCleaned Input\n\t* @since\t2.0\n\t*/\n function remove_tags($text=\"\")\n {\n \t// Removes < BOARD TAGS > from posted forms\n \t\n \t$text = preg_replace( \"/(<|&lt;)% (MEMBER BAR|BOARD FOOTER|BOARD HEADER|CSS|JAVASCRIPT|TITLE|BOARD|STATS|GENERATOR|COPYRIGHT|NAVIGATION) %(>|&gt;)/i\", \"&#60;% \\\\2 %&#62;\", $text );\n \t\n \t//$text = str_replace( \"<%\", \"&#60;%\", $text );\n \t\n \treturn $text;\n }\n \n /**\n\t* Useless stupid function that serves no purpose other than\n\t* to create a nice gap between useful functions\n *\n\t* @param\tinteger\n\t* @return\tinteger\n\t* @since\t2.0\n\t* @deprecated\n\t*/\n function is_number($number=\"\")\n {\n \tif ($number == \"\") return -1;\n \t\n \tif ( preg_match( \"/^([0-9]+)$/\", $number ) )\n \t{\n \t\treturn $number;\n \t}\n \telse\n \t{\n \t\treturn \"\";\n \t}\n }\n \n /*-------------------------------------------------------------------------*/\n // MEMBER FUNCTIONS \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Set up defaults for a guest user\n *\n\t* @param\tstring\tGuest name\n\t* @return\tarray\n\t* @since\t2.0\n\t* @todo\t\tMove this into class_session?\n\t*/\n function set_up_guest($name='Guest')\n {\n \treturn array( 'name' \t\t \t=> $name,\n \t\t\t\t 'members_display_name' \t=> $name,\n \t\t\t\t '_members_display_name' \t=> $name,\n \t\t\t\t 'id' \t\t \t=> 0,\n \t\t\t\t 'password' \t\t \t=> '',\n \t\t\t\t 'email' \t\t \t=> '',\n \t\t\t\t 'title' \t\t \t=> '',\n \t\t\t\t 'mgroup' \t\t \t=> $this->vars['guest_group'],\n \t\t\t\t 'view_sigs' \t\t \t=> $this->vars['guests_sig'],\n \t\t\t\t 'view_img' \t\t \t=> $this->vars['guests_img'],\n \t\t\t\t 'view_avs' \t\t \t=> $this->vars['guests_ava'],\n \t\t\t\t 'member_forum_markers' \t=> array(),\n \t\t\t\t 'avatar'\t\t\t\t \t=> '',\n \t\t\t\t 'member_posts'\t\t \t=> '',\n \t\t\t\t 'member_group'\t\t \t=> $this->cache['group_cache'][$this->vars['guest_group']]['g_title'],\n \t\t\t\t 'member_rank_img'\t \t \t=> '',\n \t\t\t\t 'member_joined'\t\t \t=> '',\n \t\t\t\t 'member_location'\t\t \t=> '',\n \t\t\t\t 'member_number'\t\t \t=> '',\n \t\t\t\t 'members_auto_dst'\t \t=> 0,\n \t\t\t\t 'has_blog'\t\t\t \t=> 0,\n \t\t\t\t 'has_gallery'\t\t\t \t=> 0,\n \t\t\t\t 'is_mod'\t\t\t\t \t=> 0,\n \t\t\t\t 'last_visit'\t\t\t \t=> 0,\n \t\t\t\t 'login_anonymous'\t\t \t=> '',\n \t\t\t\t 'mgroup_others'\t\t \t=> '',\n \t\t\t\t 'org_perm_id'\t\t\t \t=> '',\n \t\t\t\t '_cache'\t\t\t\t \t=> array( 'qr_open' => 0 ),\n \t\t\t\t 'auto_track'\t\t\t \t=> 0,\n \t\t\t\t 'ignored_users'\t\t \t=> NULL,\n \t\t\t\t 'members_editor_choice' \t=> 'std',\n\t\t\t\t\t '_cache' \t=> array( 'friends' => array() )\n \t\t\t\t);\n }\n \n /*-------------------------------------------------------------------------*/\n // GET USER AVATAR \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Returns user's avatar\n *\n\t* @param\tstring\tMember's avatar string\n\t* @param\tinteger\tCurrent viewer wants to view avatars\n\t* @param\tstring\tAvatar dimensions (nxn)\n\t* @param\tstring\tAvatar type (upload, url)\n\t* @return\tstring\tHTML\n\t* @since\t2.0\n\t*/\n function get_avatar($member_avatar=\"\", $member_view_avatars=0, $avatar_dims=\"x\", $avatar_type='', $no_cache=0 )\n {\n \t//-----------------------------------------\n \t// No avatar?\n \t//-----------------------------------------\n \t\n \tif ( ! $member_avatar or $member_view_avatars == 0 or ! $this->vars['avatars_on'] or ( strpos( $member_avatar, \"noavatar\" ) AND !strpos( $member_avatar, '.' ) ) )\n \t{\n \t\treturn \"\";\n \t}\n \t\n \tif ( substr( $member_avatar, -4 ) == \".swf\" and $this->vars['allow_flash'] != 1 )\n \t{\n \t\treturn \"\";\n \t}\n \t\n \t//-----------------------------------------\n \t// Defaults...\n \t//-----------------------------------------\n \t\n \t$davatar_dims = explode( \"x\", strtolower($this->vars['avatar_dims']) );\n\t\t$default_a_dims = explode( \"x\", strtolower($this->vars['avatar_def']) );\n \t$this_dims = explode( \"x\", strtolower($avatar_dims) );\n\t\t\n\t\tif (!isset($this_dims[0])) $this_dims[0] = $davatar_dims[0];\n\t\tif (!isset($this_dims[1])) $this_dims[1] = $davatar_dims[1];\n\t\tif (!$this_dims[0]) $this_dims[0] = $davatar_dims[0];\n\t\tif (!$this_dims[1]) $this_dims[1] = $davatar_dims[1];\n\t\t\n \t//-----------------------------------------\n \t// LEGACY: Determine type\n \t//-----------------------------------------\n\t\t\n\t\tif ( ! $avatar_type )\n\t\t{\n\t\t\tif ( preg_match( \"/^http:\\/\\//\", $member_avatar ) )\n\t\t\t{\n\t\t\t\t$avatar_type = 'url';\n\t\t\t}\n\t\t\telse if ( strstr( $member_avatar, \"upload:\" ) or ( strstr( $member_avatar, 'av-' ) ) )\n\t\t\t{\n\t\t\t\t$avatar_type = 'upload';\n\t\t\t\t$member_avatar = str_replace( 'upload:', '', $member_avatar );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$avatar_type = 'local';\n\t\t\t}\n\t \t}\n\t\n\t\t//-----------------------------------------\n\t\t// No cache?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $no_cache )\n\t\t{\n\t\t\t$member_avatar .= '?_time=' . time();\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// No avatar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $member_avatar == 'noavatar' )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// URL avatar?\n\t\t//-----------------------------------------\n\t\t\n\t\telse if ( $avatar_type == 'url' )\n\t\t{\n\t\t\tif ( substr( $member_avatar, -4 ) == \".swf\" )\n\t\t\t{\n\t\t\t\treturn \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" width='{$this_dims[0]}' height='{$this_dims[1]}'>\n\t\t\t\t\t\t<param name='movie' value='{$member_avatar}'><param name='play' value='true'>\n\t\t\t\t\t\t<param name='loop' value='true'><param name='quality' value='high'>\n\t\t\t\t\t\t<param name='wmode' value='transparent'> \n\t\t\t\t\t\t<embed src='{$member_avatar}' width='{$this_dims[0]}' height='{$this_dims[1]}' play='true' loop='true' quality='high' wmode='transparent'></embed>\n\t\t\t\t\t\t</object>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"<img src='{$member_avatar}' border='0' width='{$this_dims[0]}' height='{$this_dims[1]}' alt='' />\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Not a URL? Is it an uploaded avatar?\n\t\t//-----------------------------------------\n\t\t\t\n\t\telse if ( ($this->vars['avup_size_max'] > 1) and ( $avatar_type == 'upload' ) )\n\t\t{\n\t\t\t$member_avatar = str_replace( 'upload:', '', $member_avatar );\n\t\t\t\n\t\t\tif ( substr( $member_avatar, -4 ) == \".swf\" )\n\t\t\t{\n\t\t\t\treturn \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" width='{$this_dims[0]}' height='{$this_dims[1]}'>\n\t\t\t\t\t\t<param name='movie' value='{$this->vars['upload_url']}/$member_avatar'><param name='play' value='true'>\n\t\t\t\t\t\t<param name='loop' value='true'><param name='quality' value='high'>\n\t\t\t\t\t\t<param name='wmode' value='transparent'> \n\t\t\t\t\t <embed src='{$this->vars['upload_url']}/$member_avatar' width='{$this_dims[0]}' height='{$this_dims[1]}' play='true' loop='true' quality='high' wmode='transparent'></embed>\n\t\t\t\t\t\t</object>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"<img src='{$this->vars['upload_url']}/$member_avatar' border='0' width='{$this_dims[0]}' height='{$this_dims[1]}' alt='' />\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// No, it's not a URL or an upload, must\n\t\t// be a normal avatar then\n\t\t//-----------------------------------------\n\t\t\n\t\telse if ($member_avatar != \"\")\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Do we have an avatar still ?\n\t\t \t//-----------------------------------------\n\t\t \t\n\t\t\treturn \"<img src='{$this->vars['AVATARS_URL']}/{$member_avatar}' border='0' alt='' />\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// No, ok - return blank\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\treturn \"\";\n\t\t}\n }\n\n\t/*-------------------------------------------------------------------------*/\n \t// Set up member data\n \t/*-------------------------------------------------------------------------*/\n \t\n \t/**\n \t* Sets the personal data\n \t*\n \t* @return\tvoid\n \t* @since\tIPB 2.2.0.2006-7-31\n \t*/\n \tfunction member_set_information( $member, $noids=0, $use_parsed=1 )\n \t{\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! is_array( $member ) or ! count( $member ) )\n\t\t{\n\t\t\treturn $member;\n\t\t}\n\t\t\n\t\tif ( $use_parsed )\n\t\t{\n\t\t\tif ( array_key_exists( $member['id'], $this->parsed_members ) )\n\t\t\t{\n\t\t\t\treturn $this->parsed_members[ $member['id'] ];\n\t\t\t}\n\t\t}\n\t\n\t\t//-----------------------------------------\n\t\t// Check URL\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->vars['img_url'] = ( ! $this->vars['img_url'] ) ? $this->vars['board_url'] . '/style_images/' . $this->skin['_imagedir'] : $this->vars['img_url'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Main photo\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! $member['pp_main_photo'] OR !$this->member['g_mem_info'] )\n\t\t{\n\t\t\t$member['pp_main_photo'] = $this->vars['img_url'].'/folder_profile_portal/pp-blank-large.png';;\n\t\t\t$member['pp_main_width'] = 150;\n\t\t\t$member['pp_main_height'] = 150;\n\t\t\t$member['_has_photo'] = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$member['pp_main_photo'] = $this->vars['upload_url'] . '/' . $member['pp_main_photo'];\n\t\t\t$member['_has_photo'] = 1;\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Thumbie\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! $member['pp_thumb_photo'] OR $member['pp_thumb_photo'] == 'profile/' )\n\t\t{\n\t\t\tif( $member['_has_photo'] )\n\t\t\t{\n\t\t\t\t$member['pp_thumb_photo'] = $member['pp_main_photo'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member['pp_thumb_photo'] = $this->vars['img_url'].'/folder_profile_portal/pp-blank-thumb.png';\n\t\t\t}\n\t\t\t\n\t\t\t$member['pp_thumb_width'] = 50;\n\t\t\t$member['pp_thumb_height'] = 50;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$member['pp_thumb_photo'] = $this->vars['upload_url'] . '/' . $member['pp_thumb_photo'];\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Mini\n\t\t//-----------------------------------------\n\t\t\n\t\t$_data = $this->scale_image( array( 'max_height' => 25, 'max_width' => 25, 'cur_width' => $member['pp_thumb_width'], 'cur_height' => $member['pp_thumb_height'] ) );\n\t\t\n\t\t$member['pp_mini_photo'] = $member['pp_thumb_photo'];\n\t\t$member['pp_mini_width'] = $_data['img_width'];\n\t\t$member['pp_mini_height'] = $_data['img_height'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Gender...\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( IPB_THIS_SCRIPT != 'admin' )\n\t\t{\n\t\t\t$member['_pp_gender_image'] = $noids ? $this->compiled_templates['skin_global']->personal_portal_gender_image( $member, 1 ) : $this->compiled_templates['skin_global']->personal_portal_gender_image( $member );\n\t\t}\n\t\t\n\t\t$member['_pp_gender_text'] = $member['pp_gender'] == 'male' ? $this->lang['js_gender_male'] : ( $member['pp_gender'] == 'female' ? $this->lang['js_gender_female'] : $this->lang['js_gender_mystery'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Online?\n\t\t//-----------------------------------------\n\t\t\n\t\t$time_limit = time() - $this->vars['au_cutoff'] * 60;\n\t\n\t\t$member['_online'] = 0;\n\t\n\t\tlist( $be_anon, $loggedin ) = explode( '&', $member['login_anonymous'] );\n\t\t\n\t\tif ( ( $member['last_visit'] > $time_limit or $member['last_activity'] > $time_limit ) AND $be_anon != 1 AND $loggedin == 1 )\n\t\t{\n\t\t\t$member['_online'] = 1;\n\t\t}\n\n\t\tif ( IPB_THIS_SCRIPT != 'admin' )\n\t\t{\n\t\t\t$member['_pp_online_image'] = $this->compiled_templates['skin_global']->personal_portal_online_image( $member );\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Last Active\n\t\t//-----------------------------------------\n\t\t\n\t\t$member['_last_active'] = $this->get_date( $member['last_activity'], 'SHORT' );\n\t\t\n\t\tif( $member['login_anonymous']{0} == '1' )\n\t\t{\n\t\t\t// Member last logged in anonymous\n\t\t\t\n\t\t\tif( $this->member['mgroup'] != $this->vars['admin_group'] OR $this->vars['disable_admin_anon'] )\n\t\t\t{\n\t\t\t\t$member['_last_active'] = $this->lang['private'];\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t//-----------------------------------------\n\t\t// Rating\n\t\t//-----------------------------------------\n\t\t\n\t\t$member['_pp_rating_real'] = intval( $member['pp_rating_real'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Long display names\n\t\t//-----------------------------------------\n\t\t\n\t\t$member['members_display_name_short'] = $this->txt_truncate( $member['members_display_name'], 16 );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Other stuff not worthy of individual comments\n\t\t//-----------------------------------------\n\t\t\n\t\t$member['members_profile_views'] = isset($member['members_profile_views']) ? $member['members_profile_views'] : 0;\n\t\t\n\t\t$member['_pp_profile_views'] = $this->do_number_format( $member['members_profile_views'] );\n\t\t\n\t\t$member['icq_number']\t\t = $member['icq_number'] > 0 ? $member['icq_number'] : '';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Bye.\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->parsed_members[ $member['id'] ] = $member;\n\t\t\n\t\treturn $member;\n\t}\n \t\n \t/*-------------------------------------------------------------------------*/\n \t// Quick, INIT? a.k.a Just enough information to perform\n \t// (Sorry, listening to stereophonics still)\n \t/*-------------------------------------------------------------------------*/\n \t\n \t/**\n\t* Very quick init, if index.php has been passed on hasn't been loaded\n *\n\t* @return\tvoid\n\t* @since\t2.0\n\t*/\n \tfunction quick_init()\n \t{\n \t\t$this->load_skin();\n \t \n\t //-----------------------------------------\n\t // Grab session cookie\n\t //-----------------------------------------\n\t\t\t \n\t $this->session_id = $this->sess->session_id ? $this->sess->session_id : $this->my_getcookie('session_id');\n\t \n\t //-----------------------------------------\n\t // Organize default info\n\t //-----------------------------------------\n\t \n\t $this->base_url \t= $this->vars['board_url'].'/index.'.$this->vars['php_ext'].'?s='.$this->session_id;\n\t $this->js_base_url \t= $this->vars['board_url'].'/index.'.$this->vars['php_ext'].'?s='.$this->session_id;\n\t $this->skin_rid \t= $this->skin['set_id'];\n\t $this->skin_id \t= 's'.$this->skin['set_id'];\n\t \n\t if ($this->vars['default_language'] == \"\")\n\t {\n\t\t $this->vars['default_language'] = 'en';\n\t }\n\t \n\t $this->lang_id = $this->member['language'] ? $this->member['language'] : $this->vars['default_language'];\n\t \n\t if ( ($this->lang_id != $this->vars['default_language']) and (! is_dir( CACHE_PATH.\"cache/lang_cache/\".$this->lang_id ) ) )\n\t {\n\t\t $this->lang_id = $this->vars['default_language'];\n\t }\n\t \n\t //-----------------------------------------\n\t // Get words & skin\n\t //-----------------------------------------\n\t \n\t $this->load_language(\"lang_global\");\n\t \n\t $this->vars['img_url'] = 'style_images/' . $this->skin['_imagedir'];\n\t \n\t if ( ! $this->compiled_templates['skin_global'] )\n\t {\n\t\t $this->load_template('skin_global');\n\t }\n \t}\n \n /*-------------------------------------------------------------------------*/\n // ERROR FUNCTIONS \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Show error message\n *\n * @param\tarray\t'LEVEL', 'INIT', 'MSG', 'EXTRA'\n\t* @return\tvoid\n\t* @since\t2.0\n\t*/\n function Error($error)\n {\n \t$override = 0;\n \t\n \t//-----------------------------------------\n \t// Showing XML / AJAX functions?\n \t//-----------------------------------------\n \t\n \tif ( $this->input['act'] == 'xmlout' )\n \t{\n \t\t@header( \"Content-type: text/plain\" );\n\t\t\tprint 'error';\n\t\t\texit();\n\t\t}\n \t\n \t//-----------------------------------------\n \t// Initialize if not done so yet\n \t//-----------------------------------------\n \t\n \tif ( isset($error['INIT']) AND $error['INIT'] == 1)\n \t{\n \t\t$this->quick_init();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session_id = $this->my_session;\n\t\t}\n\t\t\n\t\tif ( !isset($this->compiled_templates['skin_global']) OR !is_object( $this->compiled_templates['skin_global'] ) )\n\t\t{\n\t\t\t$this->load_template('skin_global');\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get error words\n\t\t//-----------------------------------------\n\t\t\n \t$this->load_language('lang_error');\n \t\n \tlist($em_1, $em_2) = explode( '@', $this->vars['email_in'] );\n \t\n \t$msg = $this->lang[ $error['MSG'] ];\n \t\n \t//-----------------------------------------\n \t// Extra info?\n \t//-----------------------------------------\n \t\n \tif ( isset($error['EXTRA']) AND $error['EXTRA'] )\n \t{\n \t\t$msg = str_replace( '<#EXTRA#>', $error['EXTRA'], $msg );\n \t}\n \t\n \t//-----------------------------------------\n \t// Show error\n \t//-----------------------------------------\n \t\n \t$html = $this->compiled_templates['skin_global']->Error( $msg, $em_1, $em_2, 1);\n \t\n \t//-----------------------------------------\n \t// If we're a guest, show the log in box..\n \t//-----------------------------------------\n \t\n \tif ($this->member['id'] == \"\" and $error['MSG'] != 'server_too_busy' and $error['MSG'] != 'account_susp')\n \t{\n \t\t$safe_string = $this->base_url . str_replace( '&amp;', '&', $this->parse_clean_value($this->my_getenv('QUERY_STRING')) );\n \t\t\n \t\t$html = str_replace( \"<!--IBF.LOG_IN_TABLE-->\", $this->compiled_templates['skin_global']->error_log_in( str_replace( '&', '&amp;', $safe_string ) ), $html);\n \t\t$override = 1;\n \t}\n \t\n \t//-----------------------------------------\n \t// Do we have any post data to keepy?\n \t//-----------------------------------------\n \t\n \tif ( $this->input['act'] == 'Post' OR $this->input['act'] == 'Msg' OR $this->input['act'] == 'calendar' )\n \t{\n \t\tif ( $_POST['Post'] )\n \t\t{\n \t\t\t$post_thing = $this->compiled_templates['skin_global']->error_post_textarea($this->txt_htmlspecialchars($this->txt_stripslashes($_POST['Post'])) );\n \t\t\t\n \t\t\t$html = str_replace( \"<!--IBF.POST_TEXTAREA-->\", $post_thing, $html );\n \t\t}\n \t}\n \t\n \t//-----------------------------------------\n \t// Update session\n \t//-----------------------------------------\n \t\n \t$this->DB->do_shutdown_update( 'sessions', array( 'in_error' => 1 ), \"id='{$this->my_session}'\" );\n \t\n \t//-----------------------------------------\n \t// Print\n \t//-----------------------------------------\n \t\n \t$print = new display();\n \t$print->ipsclass =& $this;\n \t\n \t$print->add_output($html);\n \t\t\n \t$print->do_output( array( 'OVERRIDE' => $override, 'TITLE' => $this->lang['error_title'] ) );\n }\n \n /*-------------------------------------------------------------------------*/\n // Show Board Offline\n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Show board offline message\n *\n\t* @return\tvoid\n\t* @since\t2.0\n\t*/\n function board_offline()\n {\n \t$this->quick_init();\n \t\n \t//-----------------------------------------\n \t// Get offline message (not cached)\n \t//-----------------------------------------\n \t\n \t$row = $this->DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings', 'where' => \"conf_key='offline_msg'\" ) );\n \t\n \t$this->load_language(\"lang_error\");\n \t\n \t$msg = preg_replace( \"/\\n/\", \"<br />\", stripslashes( $row['conf_value'] ) );\n \t\n \t$html = $this->compiled_templates['skin_global']->board_offline( $msg );\n \t\n \t$print = new display();\n \t$print->ipsclass =& $this;\n \t$print->add_output($html);\n \t\t\n \t$print->do_output( array(\n\t\t\t\t\t\t\t\t 'OVERRIDE' => 1,\n\t\t\t\t\t\t\t\t 'TITLE' => $this->lang['offline_title'],\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t );\n }\n \t\t\t\t\t\t\t\t\n /*-------------------------------------------------------------------------*/\n // Variable chooser \n /*-------------------------------------------------------------------------*/\n \n /**\n\t* Choose a variable (silly function)\n *\n * @param\tarray Mixed variables\n\t* @return\tmixed\n\t* @since\t2.0\n\t*/\n function select_var($array)\n {\n \tif ( !is_array($array) ) return -1;\n \t\n \tksort($array);\n \t\n \t$chosen = -1; // Ensure that we return zero if nothing else is available\n \t\n \tforeach ($array as $v)\n \t{\n \t\tif ( isset($v) )\n \t\t{\n \t\t\t$chosen = $v;\n \t\t\tbreak;\n \t\t}\n \t}\n \t\n \treturn $chosen;\n }\n \n\t/*-------------------------------------------------------------------------*/\n\t// Array filter: Clean read topics\n\t/*-------------------------------------------------------------------------*/\n \n /**\n\t* Array sort Used to remove out of date topic marking entries\n *\n * @param\tmixed\n\t* @return\tmixed\n\t* @since\t2.0\n\t*/\n function array_filter_clean_read_topics ( $var )\n\t{\n\t\tglobal $ipsclass;\n\t\t\n\t\treturn $var > $ipsclass->vars['db_topic_read_cutoff'];\n\t}\n \n\t/*-------------------------------------------------------------------------*/\n\t// Memory debug, make flag\n\t/*-------------------------------------------------------------------------*/\n\t\n\tfunction memory_debug_make_flag()\n\t{\n\t\tif ( IPS_MEMORY_DEBUG_MODE AND function_exists( 'memory_get_usage' ) )\n\t\t{\n\t\t\treturn memory_get_usage();\n\t\t}\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Memory debug, make flag\n\t/*-------------------------------------------------------------------------*/\n\t\n\tfunction memory_debug_add( $comment, $init_usage=0 )\n\t{\n\t\tif ( IPS_MEMORY_DEBUG_MODE AND function_exists( 'memory_get_usage' ) )\n\t\t{\n\t\t\t$_END = memory_get_usage();\n\t\t\t$_USED = $_END - $init_usage;\n\t\t\t$this->_memory_debug[] = array( $comment, $_USED );\n\t\t}\n\t}\n\t\n /*-------------------------------------------------------------------------*/\n // LEGACY MODE STUFF\n /*-------------------------------------------------------------------------*/\n \n \n\t/*-------------------------------------------------------------------------*/\n\t// Require, parse and return an array containing the language stuff \n\t/*-------------------------------------------------------------------------*/ \n\t\n\t/**\n\t* LEGACY MODE: load_words\n *\n * @param\tarray\tCurrent language array\n * @param\tstring\tFile name\n * @param\tstring\tCache directory\n\t* @return\tmixed\n\t* @deprecated\tSince 2.1\n\t* @since\t1.0\n\t*/\n\t\n\tfunction load_words($current_lang_array, $area, $lang_type)\n\t{\n\t\trequire ROOT_PATH.\"cache/lang_cache/\".$lang_type.\"/\".$area.\".php\";\n\t\t\n\t\tforeach ($lang as $k => $v)\n\t\t{\n\t\t\t$current_lang_array[$k] = stripslashes($v);\n\t\t}\n\t\t\n\t\tunset($lang);\n\t\t\n\t\treturn $current_lang_array;\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Redirect: parse_clean_value \n\t/*-------------------------------------------------------------------------*/\n\t\n\t/**\n\t* LEGACY MODE: clean_value (alias of parse_clean_value)\n *\n * @param\tstring\n\t* @return\tstring\n\t* @deprecated\tSince 2.1\n\t* @since\t1.0\n\t* @see\t\tparse_clean_value\n\t*/\n\tfunction clean_value( $t )\n\t{\n\t\treturn $this->parse_clean_value( $t );\n\t}\n\t\n\t\n\tfunction parse_member( $member=array(), $custom_fields=1, $skin_file='skin_topic' )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$group_name = $this->make_name_formatted( $this->cache['group_cache'][ $member['mgroup'] ]['g_title'], $member['mgroup'] );\n\t\t$pips = 0;\n\t\t$member['member_rank_img'] = \"\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Avatar\n\t\t//-----------------------------------------\n\t\t\n\t\t$member['avatar'] = $this->get_avatar( $member['avatar_location'], $this->member['view_avs'], $member['avatar_size'], $member['avatar_type'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Ranks\n\t\t//-----------------------------------------\n\n\t\tforeach($this->cache['ranks'] as $k => $v)\n\t\t{\n\t\t\tif ($member['posts'] >= $v['POSTS'])\n\t\t\t{\n\t\t\t\tif( $member['title'] === '' OR is_null($member['title']) )\n\t\t\t\t{\n\t\t\t\t\t$member['title'] = $this->cache['ranks'][ $k ]['TITLE'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pips = $v['PIPS'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Group image\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->cache['group_cache'][ $member['mgroup'] ]['g_icon'] )\n\t\t{\n\t\t\t$member['member_rank_img'] = $this->compiled_templates[ $skin_file ]->member_rank_img($this->cache['group_cache'][ $member['mgroup'] ]['g_icon']);\n\t\t}\n\t\telse if ( $pips )\n\t\t{\n\t\t\tif ( is_numeric( $pips ) )\n\t\t\t{\n\t\t\t\tfor ($i = 1; $i <= $pips; ++$i)\n\t\t\t\t{\n\t\t\t\t\t$member['member_rank_img'] .= \"<{A_STAR}>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member['member_rank_img'] = $this->compiled_templates[ $skin_file ]->member_rank_img( 'style_images/<#IMG_DIR#>/folder_team_icons/'.$pips );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$member['member_joined'] = $this->compiled_templates[ $skin_file ]->member_joined( $this->get_date( $member['joined'], 'JOINED' ) );\n\t\t$member['member_group'] = $this->compiled_templates[ $skin_file ]->member_group( $group_name );\n\t\t$member['member_posts'] = $this->compiled_templates[ $skin_file ]->member_posts( $this->do_number_format( intval( $member['posts'] ) ) );\n\t\t$member['member_number'] = $this->compiled_templates[ $skin_file ]->member_number( $this->do_number_format($member['id']) );\n\t\t$member['profile_icon'] = $this->compiled_templates[ $skin_file ]->member_icon_profile( $member['id'] );\n\t\t$member['message_icon'] = $this->compiled_templates[ $skin_file ]->member_icon_msg( $member['id'] );\n\t\t$member['member_location'] = $member['location'] ? $this->compiled_templates[ $skin_file ]->member_location( $member['location'] ) : '';\n\t\t$member['email_icon'] = ! $member['hide_email'] ? $this->compiled_templates[ $skin_file ]->member_icon_email( $member['id'] ) : '';\n\t\t$member['addresscard'] = $member['id'] ? $this->compiled_templates[ $skin_file ]->member_icon_vcard( $member['id'] ) : '';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Warny porny?\n\t\t//-----------------------------------------\n\t\t\n\t\t$member['warn_percent']\t= NULL;\n\t\t$member['warn_img']\t\t= NULL;\n\t\t$member['warn_text']\t= NULL;\n\t\t$member['warn_add']\t\t= NULL;\n\t\t$member['warn_minus']\t= NULL;\n\t\t\n\t\tif ( $this->vars['warn_on'] and ( ! strstr( ','.$this->vars['warn_protected'].',', ','.$member['mgroup'].',' ) ) )\n\t\t{\n\t\t\tif ( ( isset($this->member['_moderator'][ $this->topic['forum_id'] ]['allow_warn'])\n\t\t\t\tAND $this->member['_moderator'][ $this->topic['forum_id'] ]['allow_warn'] )\n\t\t\t\tOR ( $this->member['g_is_supmod'] == 1 )\n\t\t\t\tOR ( $this->vars['warn_show_own'] and ( $this->member['id'] == $member['id'] ) ) \n\t\t\t )\n\t\t\t{\n\t\t\t\t// Work out which image to show.\n\t\t\t\t\n\t\t\t\tif ( ! $this->vars['warn_show_rating'] )\n\t\t\t\t{\n\t\t\t\t\tif ( $member['warn_level'] <= $this->vars['warn_min'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$member['warn_img'] = '<{WARN_0}>';\n\t\t\t\t\t\t$member['warn_percent'] = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( $member['warn_level'] >= $this->vars['warn_max'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$member['warn_img'] = '<{WARN_5}>';\n\t\t\t\t\t\t$member['warn_percent'] = 100;\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\n\t\t\t\t\t\t$member['warn_percent'] = $member['warn_level'] ? sprintf( \"%.0f\", ( ($member['warn_level'] / $this->vars['warn_max']) * 100) ) : 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $member['warn_percent'] > 100 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['warn_percent'] = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $member['warn_percent'] >= 81 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['warn_img'] = '<{WARN_5}>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( $member['warn_percent'] >= 61 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['warn_img'] = '<{WARN_4}>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( $member['warn_percent'] >= 41 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['warn_img'] = '<{WARN_3}>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( $member['warn_percent'] >= 21 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['warn_img'] = '<{WARN_2}>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( $member['warn_percent'] >= 1 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['warn_img'] = '<{WARN_1}>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['warn_img'] = '<{WARN_0}>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( $member['warn_percent'] < 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$member['warn_percent'] = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$member['warn_text'] = $this->compiled_templates[ $skin_file ]->warn_level_warn($member['id'], $member['warn_percent'] );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Ratings mode..\n\t\t\t\t\t\n\t\t\t\t\t$member['warn_text'] = $this->lang['tt_rating'];\n\t\t\t\t\t$member['warn_img'] = $this->compiled_templates[ $skin_file ]->warn_level_rating($member['id'], $member['warn_level'], $this->vars['warn_min'], $this->vars['warn_max']);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tif ( ( isset($this->member['_moderator'][ $this->topic['forum_id'] ]['allow_warn']) AND $this->member['_moderator'][ $this->topic['forum_id'] ]['allow_warn'] ) or $this->member['g_is_supmod'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t$member['warn_add'] = \"<a href='{$this->base_url}act=warn&amp;type=add&amp;mid={$member['id']}&amp;t={$this->topic['tid']}&amp;st=\".intval($this->input['st']).\"' title='{$this->lang['tt_warn_add']}'><{WARN_ADD}></a>\";\n\t\t\t\t\t$member['warn_minus'] = \"<a href='{$this->base_url}act=warn&amp;type=minus&amp;mid={$member['id']}&amp;t={$this->topic['tid']}&amp;st=\".intval($this->input['st']).\"' title='{$this->lang['tt_warn_minus']}'><{WARN_MINUS}></a>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Profile fields stuff\n\t\t//-----------------------------------------\n\t\t\n\t\t$member['custom_fields'] = \"\";\n\t\t\n\t\tif ( $this->vars['custom_profile_topic'] == 1 AND $custom_fields == 1 )\n\t\t{\n\t\t\tif( !is_object( $this->custom_fields ) )\n\t\t\t{\n\t\t\t\trequire_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );\n\t\t\t\t$this->custom_fields = new custom_fields( $this->DB );\n\t\t\t\t\n\t\t\t\t$this->custom_fields->member_id = $this->member['id'];\n\t\t\t\t$this->custom_fields->cache_data = $this->cache['profilefields'];\n\t\t\t\t$this->custom_fields->admin = intval($this->member['g_access_cp']);\n\t\t\t\t$this->custom_fields->supmod = intval($this->member['g_is_supmod']);\n\t\t\t}\n\t\t\t\n\t\t\tif ( $this->custom_fields )\n\t\t\t{\n\t\t\t\t$this->custom_fields->member_data = $member;\n\t\t \t$this->custom_fields->admin = intval($this->member['g_access_cp']);\n\t\t \t$this->custom_fields->supmod = intval($this->member['g_is_supmod']);\n\t\t \t$this->custom_fields->member_id\t = $this->member['id'];\n\t\t\t\t$this->custom_fields->init_data();\n\t\t\t\t$this->custom_fields->parse_to_view( 1 );\n\t\t\t\t\n\t\t\t\tif ( count( $this->custom_fields->out_fields ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $this->custom_fields->out_fields as $i => $data )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $data )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$member['custom_fields'] .= \"\\n\".$this->custom_fields->method_format_field_for_topic_view( $i );\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\n\t\t//-----------------------------------------\n\t\t// Photo and such\n\t\t//-----------------------------------------\n\t\t\n\t\t$member = $this->member_set_information( $member );\n\t\t\n\t\treturn $member;\n\t}\t\n\t\n\t\n \n \n}", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "public function olvidoPassword(){\n\t}", "function update_password()\n {\n }", "function getPassword(){\n\n}", "public function encryptPassword($pass){\r\n\t\t$this->string = array(\r\n\t\t\t\"string\" => $pass,\r\n\t\t\t\"count\" => strlen($pass)\r\n\t\t);\r\n\t\t//the function setCharacters() is executed to get all the initial characters to use for password encryption.\r\n\t\t$characters = $this->setCharacters();\r\n\t\t/* \r\n\t\t\tIn order to encrypt this password with a unique pattern I took the password and found the position\r\n\t\t\ton my character table. I took all positions that are found on my character table and use those numbers like patters\r\n\t\t\tI set the characters location as ranges in my $start_range variable.\r\n\t\t*/\r\n\t\t$start_range = array();\r\n\t\tfor($x=0; $x<$this->string['count']; $x++){\r\n\t\t\t$start_range[$x] = array_search($this->string['string'][$x], $characters);\r\n\t\t}\r\n\t\tforeach ($start_range as $key => $value) {\r\n\t\t\tif($value == null){\r\n\t\t\t\t$start_range[$key] = $this->string['count'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//doubles the range to make the password more complex base on mathematical additions; submitted on the 1.2 update\r\n\t\t$a = 0;\r\n\t\tfor ($i=0; $i < $this->string['count']; $i++) {\r\n\t\t\t$start_range[$this->string['count'] + $a] = round(($start_range[$i] * ($this->string['count'] + $a))); \r\n\t\t\t$a++;\r\n\t\t}\r\n\t\t/*\r\n\t\t\tUnique matrix is created depending on number of characters and the location of the characters\r\n\t\t\tI set for what i call my matrix to be 5000 characters to make the mattern more complex. you can set that to your liking i dont recommend going lower than 1000 characters.\r\n\t\t*/\r\n\t\t$matrix = $this->generateMatrix($characters, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\t@param array will make sure the matrix is as complex as possible.\r\n\t\t*/\r\n\t\t$matrix_final = $this->generateMatrix($matrix, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\tI have tested with 128 characters, havent test for less or more yet.\r\n\t\t\tthis is where the magic happens and i use the same consept of creating a matrix to create the final encryption.\r\n\t\t*/\r\n\t\t$final_password = $this->generateMatrix($matrix_final, $start_range, $this->passwordEncryptionLenght);\r\n\t\t$this->encPassword = implode('',$final_password);\r\n\t}", "function passwordNote() {\n\t\t$l = getOption('min_password_lenght');\n\t\t$p = getOption('password_pattern');\n\t\t$p = str_replace('\\|', \"\\t\", $p);\n\t\t$c = 0;\n\t\tif (!empty($p)) {\n\t\t\t$patterns = explode('|', $p);\n\t\t\t$text = '';\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$c++;\n\t\t\t\t\t$text .= ', <span style=\"white-space:nowrap;\"><strong>{</strong><em>'.htmlspecialchars($pat,ENT_QUOTES).'</em><strong>}</strong></span>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$text = substr($text, 2);\n\t\t}\n\t\tif ($c > 0) {\n\t\t\tif ($l > 0) {\n\t\t\t\t$msg = '<p class=\"notebox\">'.sprintf(ngettext('<strong>Note:</strong> passwords must be at least %1$u characters long and contain at least one character from %2$s.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>Note</strong>: passwords must be at least %1$u characters long and contain at least one character from each of the following groups: %2$s.', $c), $l, $text).'</p>';;\n\t\t\t} else {\n\t\t\t\t$msg = '<p class=\"notebox\">'.sprintf(ngettext('<strong>Note</strong>: passwords must contain at least one character from %s.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>Note</strong>: passwords must contain at least one character from each of the following groups: %s.', $c), $text).'</p>';\n\t\t\t}\n\t\t} else {\n\t\t\tif ($l > 0) {\n\t\t\t\t$msg = sprintf(gettext('<strong>Note</strong>: passwords must be at least %u characters long.'), $l);\n\t\t\t} else {\n\t\t\t\t$msg = '';\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}", "function display_password_form()\r\n{\r\n?>\r\n <br>\r\n <form action=\"change_passwd.php\" method=post>\r\n <table width=250 cellpadding=2 cellspacing=0 bgcolor=#cccccc>\r\n <tr><td>Старый пароль:</td>\r\n <td><input type=password name=old_passwd size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td>Новый пароль:</td>\r\n <td><input type=password name=new_passwd size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td>Повторите новый пароль:</td>\r\n <td><input type=password name=new_passwd2 size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td colspan=2 align=center><input type=submit value=\"Изменить пароль\">\r\n </td></tr>\r\n </table>\r\n <br>\r\n<?\r\n}", "public function getPW() {}", "function display_forgot_form()\r\n{\r\n?>\r\n <br>\r\n <form action=\"forgot_passwd.php\" method=post>\r\n <table width=250 cellpadding=2 cellspacing=0 bgcolor=#cccccc>\r\n <tr><td>Escribe tu nombre de usuario</td>\r\n <td><input type=text name=username size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td colspan=2 align=center><input type=submit value=\"Change password\">\r\n </td></tr>\r\n </table>\r\n <br>\r\n<?\r\n}", "public function readPassword($prompt);", "function makeLostPassForm() {\r\n\r\n\t// We need some global vars again.\r\n\tglobal $IGB;\r\n\tglobal $SITENAME;\r\n\tglobal $IGB_VISUAL;\r\n\r\n\tif ($IGB && $IGB_VISUAL) {\r\n\t\t$table = new table(2, true);\r\n\t} else {\r\n\t\t$table = new table(2, true, \"width=\\\"500\\\"\", \"align=\\\"center\\\"\");\r\n\t}\r\n\t$table->addHeader(\">> Request a new password\");\r\n\t$table->addRow(\"#060622\");\r\n\t$table->addCol(\"Fill out the form below to have a new password generated and sent to you registered eMail address.\", array (\r\n\t\t\"colspan\" => 2\r\n\t));\r\n\r\n\t$table->addRow();\r\n\t$table->addCol(\"Character Name:\");\r\n\t\r\n\t// Trust, INC.\r\n\tglobal $EVE_Charname;\r\n\tif ($EVE_Charname) {\r\n\t\t$table->addCol(\"<input type=\\\"text\\\" name=\\\"username\\\" value=\\\"$EVE_Charname\\\" maxlength=\\\"30\\\">\");\r\n\t} else {\r\n\t\t$table->addCol(\"<input type=\\\"text\\\" name=\\\"username\\\" maxlength=\\\"30\\\">\");\t\t\r\n\t}\r\n\r\n\t$table->addRow();\r\n\t$table->addCol(\"Your valid eMail:\");\r\n\t$table->addCol(\"<input type=\\\"text\\\" name=\\\"email\\\" maxlength=\\\"70\\\">\");\r\n\r\n\t$table->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"change\\\" value=\\\"Get Password\\\">\");\r\n\r\n\t$table->addRow(\"#060622\");\r\n\t$table->addCol(\"[<a href=\\\"index.php\\\">Cancel request</a>]\", array (\r\n\t\t\"colspan\" => 2\r\n\t));\r\n\r\n//\t$page = \"<h2>Lost password</h2>\";\r\n\t$page = \"<br><br>\";\r\n\t$page .= \"<form action=\\\"index.php\\\" method=\\\"post\\\">\";\r\n\t$page .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"lostpass\\\">\";\r\n\t$page .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"check\\\">\";\r\n\t$page .= $table->flush();\r\n\t$page .= \"</form><br><br>\";\r\n\r\n\t// Print it, and die (special case: login does not get beautified.)\r\n\t$html = new html;\r\n\t$html->addBody($page);\r\n\tdie($html->flush());\r\n\r\n}", "function display_forgot_form()\r\n{\r\n?>\r\n <br>\r\n <form action=\"forgot_passwd.php\" method=post>\r\n <table width=250 cellpadding=2 cellspacing=0 bgcolor=#cccccc>\r\n <tr><td>Enter your username</td>\r\n <td><input type=text name=username size=16 maxlength=16></td>\r\n </tr>\r\n <tr><td colspan=2 align=center><input type=submit value=\"Change password\">\r\n </td></tr>\r\n </table>\r\n <br>\r\n<?\r\n}", "public function FindPw(){\n\t\t\n\t\t$html = fopen(\"../../../../../../FindPw.php\",\"w\") or die(\"unable to make email\");\n\n\t\t$contents = \n\t\t'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1-strict.dtd\">\n\t\t<html lang=\"en\">\n\t\t<head>\n\t\t\t<meta charset=\"UTF-8\">\n\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n\t\t</head>\n\t\t<body>\n\t\t<table align=\"center\" width=\"620\" height=\"270\" bgcolor=\"#ffffff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t<tbody>\n\t\t\t<tr id=\"mail_lubycon_logo\">\n\t\t\t\t<td>\n\t\t\t\t\t<img src=\"../../CH/img/resist_mail/mail_header.png\" class=\"mail_header\" >\n\t\t\t\t</td>\n\t\t\t</tr>\n \t<tr id=\"mail_hello\">\n \t<td align=\"left\" style=\"font-family:Arial, Helvetica, sans-serif; font-size: 40px; color:#444444;\">\n \t<br />\n \t &nbsp;Hello. <font size=\"40px\" color=\"#48cfad\">:)</font>\n <br />\n <br />\n </td>\n </tr>\n <tr id=\"mail_description\">\n \t<td align=\"left\" style=\"font-family:Arial, Helvetica, sans-serif; font-size: 15px; color:#444444; line-height:25px;\">\n \t\t\t&nbsp;&nbsp;&nbsp;\n Your temporary password has been sent to the registered email.<br /><br />\n\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n\t\t\t\t\t<font size=\"4px\">\n\t\t\t\t\tHere your temporary password is : '.$this->token.'\n\t\t\t\t\t</font>\n\t\t\t\t\t<br /><br />\n\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n\n\t\t\t\t\tIf this is not you, Please Contact.<br />\n &nbsp;&nbsp;&nbsp;\n <br />\n <br />\n \t</td>\n </tr>\n <tr>\n <td align=\"left\" style=\"font-family:Arial, Helvetica, sans-serif; font-size: 15px; color:#444444; line-height:20px;\">\n \t<br />\n &nbsp;&nbsp;&nbsp;\n \tIf you have any problems or questions, please send e-mail to \n <a id=\"mailadress\" href=\"mailto:[email protected]\" style=\"text-decoration:none;\">\n \t<font color=\"#48cfad\" size=\"+1\">[email protected]</font>\n </a>\n </td>\n </tr>\n </tbody>\n\t\t</table>\n\t\t</body>\n\t\t';\n\n\t\tfwrite($html, $contents);\n\t\tfclose($html);\n\t}", "function main($content,$conf)\t{\n\t\t$this->conf=$conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\t$this->pi_initPIflexForm();\n\t\t$minlen = $this->pi_getFFvalue($this->cObj->data['pi_flexform'],'minlength');\n\t\t$content = '';\n\t\tif ($minlen < 2) $minlen = 4;\n\n\t\t$this->pi_USER_INT_obj=1;\t// Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!\n\t\t\n\t\t/*cab services ag - begin */\n\t\t$this->tmpl = $this->cObj->fileResource($this->conf['templateFile']);\n\t\t/*cab services ag - end */\n\t\t\n\t//\tdebug($GLOBALS['TSFE']);\n\t\tif ($GLOBALS['TSFE']->loginUser) {\n\t\t\t$newpw=$this->piVars['pw'];\n\t\t\t$newpw2=$this->piVars['pw2'];\n\t\t\t$content = '<div class=\"message\">';\n\t\t\t\n\t\t\t//\t\tdebug($this->cObj->data['pi_flexform']);\n\t\t\tif (($newpw==$newpw2) && (strlen($newpw) >= $minlen)) {\n\t\t\t\tif ((ctype_alnum($this->piVars['pw'])) and (ctype_alnum($this->piVars['pw2']))) {\n\t\t\t\t\t$v = array(\n\t\t\t\t\t\t'password' => $newpw\n\t\t\t\t\t);\n\t\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users','uid='.$GLOBALS['TYPO3_DB']->quoteStr($GLOBALS['TSFE']->fe_user->user['uid'],'fe_users'),$v);\n\t\t\t\t\t$content.=$this->pi_getLL('succes','',1);\n\t\t\t\t} else {\n\t\t\t\t\t$content.=$this->pi_getLL('pwillegal','',1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($newpw!=$newpw2) {\n\t\t\t\t\t$content.=$this->pi_getLL('pwnotequal','',1);\n\t\t\t\t} elseif((isset($newpw)) && (strlen($newpw) < $minlen)) {\n\t\t\t\t\t$content.=$this->pi_getLL('pwtooshort','',1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*cab services ag - begin */\n\t\t\t$content.='</div>';\n\t\t\t\n\t\t\t$tmpl = $this->cObj->getSubpart($this->tmpl, '###FORM###');\n\t\t\t\n\t\t\t$marker = array();\n\t\t\t$marker['###ACTION###'] = $this->pi_getPageLink($GLOBALS[\"TSFE\"]->id);\n\t\t\t$marker['###NAME_PASSWORD###'] = $this->prefixId.'[pw]';\n\t\t\t$marker['###LABEL_PASSWORD###'] = $this->pi_getLL('password1','',1);\n\t\t\t$marker['###VALUE_PASSWORD###'] = htmlspecialchars($this->piVars[\"pw\"]);\n\t\t\t\n\t\t\t$marker['###NAME_PASSWORD2###'] = $this->prefixId.'[pw2]';\n\t\t\t$marker['###LABEL_PASSWORD2###'] = $this->pi_getLL('password2','',1);\n\t\t\t$marker['###VALUE_PASSWORD2###'] = htmlspecialchars($this->piVars[\"pw2\"]);\n\t\t\t\n\t\t\t$marker['###NAME_SUBMIT###'] = $this->prefixId.'[submit_button]';\n\t\t\t$marker['###VALUE_SUBMIT###'] = htmlspecialchars($this->pi_getLL(\"submit_button_label\"));\n\t\t\t\n\t\t\t$content .= $this->cObj->substituteMarkerArrayCached($tmpl, $marker);\n\t\t\t/*cab services ag - end */\n\t\t}\n\t\treturn $this->pi_wrapInBaseClass($content);\n\t}", "function pwEntry($pw1,$pw2,$errors,$size=10)\n{\n\t$returnVal = \"\n\t<tr>\n\t\t<td>Password:</td>\n\t\t<td>\n\t\t\t<input type='password' name='$pw1' size='$size'>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>Repeat Password:</td>\n\t\t<td>\n\t\t\t<input type='password' name='$pw2' size='$size'>\n\t\t</td>\n\t</tr>\";\n\n\tif (array_key_exists('Password',$errors))\n\t{\n\t\t$returnVal .= addErrorRow('Password',$errors);\n\t}\n\treturn $returnVal;\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 vxUserPasswordUpdateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['pswitch'] = 'a';\n\t\t\n\t\t$rt['usr_password_value'] = '';\n\t\t$rt['usr_confirm_value'] = '';\n\t\t/* usr_password_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_password_error'] = 0;\n\t\t$rt['usr_password_touched'] = 0;\n\t\t$rt['usr_password_error_msg'] = array(1 => '你忘记填写密码了', 2 => '你的这个密码太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\t\t/* usr_confirm_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters(should not reach here in final rendering)\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_confirm_error'] = 0;\n\t\t$rt['usr_confirm_touched'] = 0;\n\t\t$rt['usr_confirm_error_msg'] = array(1 => '你忘记填写密码确认了', 2 => '你的这个密码确认太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\n\t\t/* S check: usr_password and usr_confirm */\n\t\t\n\t\tif (isset($_POST['usr_password'])) {\n\t\t\t$rt['usr_password_value'] = $_POST['usr_password'];\n\t\t\tif (strlen($rt['usr_password_value']) == 0) {\n\t\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_password_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (isset($_POST['usr_confirm'])) {\n\t\t\t$rt['usr_confirm_value'] = $_POST['usr_confirm'];\n\t\t\tif (strlen($rt['usr_confirm_value']) == 0) {\n\t\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_confirm_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'a'; /* both blank */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'b'; /* both touched */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'c'; /* first touched */\n\t\t}\n\t\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'd'; /* second touched */\n\t\t}\n\t\t\n\t\tswitch ($rt['pswitch']) {\n\t\t\tdefault:\n\t\t\tcase 'a':\n\t\t\t\t/* nothing will happen */\n\t\t\t\tbreak;\n\t\t\tcase 'b':\n\t\t\t\t/* a lot check here */\n\t\t\t\tif (strlen($rt['usr_password_value']) > 32) {\n\t\t\t\t\t$rt['usr_password_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (strlen($rt['usr_confirm_value']) > 32) {\n\t\t\t\t\t$rt['usr_confirm_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (($rt['usr_password_error'] == 0) && ($rt['usr_confirm_error'] == 0)) {\n\t\t\t\t\tif ($rt['usr_password_value'] != $rt['usr_confirm_value']) {\n\t\t\t\t\t\t$rt['usr_confirm_error'] = 4;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t$rt['usr_confirm_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\t\t$rt['usr_password_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "function testPass($pass){\n$level=0;\nif(eight($pass)){$level+=1;}\nif(upper($pass)){$level+=1;}\nif(lower($pass)){$level+=1;}\nif(hasDigit($pass)){$level+=1;}\nif(hasSpecial($pass)){$level+=1;}\n\nswitch($level){\ncase 1: echo 'Password strength : <b><font color=red\">Very weak.</font></b>';return false; break;\ncase 2: echo 'Password strength : <b><font color=\"orange\">Weak.</font></b>';return true; break;\ncase 3: echo 'Password strength : <b><font color=\"grey\">Medium</font></b>';return true; break;\ncase 4: echo 'Password strength : <b><font color=\"blue\">Good</font></b>';return true; break;\ncase 5: echo 'Password strength : <b><font color=\"green\">Strong.</font></b>';return true; break;\ndefault : echo 'Password strength : <b><font color=\"red\">Very weak.</font></b>'; break;}\n}", "function gen_pass($mask) {\n $extended_chars = \"!@#$%^&*()\";\n $length = strlen($mask);\n $pwd = '';\n for ($c=0;$c<$length;$c++) {\n $ch = $mask[$c];\n switch ($ch) {\n case '#':\n $p_char = rand(0,9);\n break;\n case 'C':\n $p_char = chr(rand(65,90));\n break;\n case 'c':\n $p_char = chr(rand(97,122));\n break;\n case 'X':\n do {\n $p_char = rand(65,122);\n } while ($p_char > 90 && $p_char < 97);\n $p_char = chr($p_char);\n break;\n case '!':\n $p_char = $extended_chars[rand(0,strlen($extended_chars)-1)];\n break;\n }\n $pwd .= $p_char;\n }\n return $pwd; \n}", "public function getMessPassword ()\n {\n return $this->mess_password;\n }", "function PasswordsNotMach(){\n echo \"<h3 class='text-danger'>Your passwords do not match</h3>\";\n }", "function password_from_title ($title)\n{\n // Start by making sure the title has title case\n\n $title = ucwords ($title);\n\n // Remove any quotes\n\n $title = str_replace (\"'\", '', $title);\n $title = str_replace (\"\\\"\", '', $title);\n\n // Create a password from the games' title\n\n $words = explode (\" \", $title);\n $password = '';\n\n foreach ($words as $w)\n {\n $password .= $w;\n if (strlen ($password) > 8)\n return $password;\n }\n\n $password .= 'ChangeMe';\n return $password;\n}", "function password_from_title ($title)\n{\n // Start by making sure the title has title case\n\n $title = ucwords ($title);\n\n // Remove any quotes\n\n $title = str_replace (\"'\", '', $title);\n $title = str_replace (\"\\\"\", '', $title);\n\n // Create a password from the games' title\n\n $words = explode (\" \", $title);\n $password = '';\n\n foreach ($words as $w)\n {\n $password .= $w;\n if (strlen ($password) > 8)\n return $password;\n }\n\n $password .= 'ChangeMe';\n return $password;\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}", "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "function callback_password(array $args)\n {\n }", "function login_obscure()\n {\n return '<strong>Whoops</strong>: Your username or password are incorrect, please try again.';\n }", "function thb_password_form() {\n\t\t global $post;\n\t $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );\n\t $o = '<p class=\"thb-password-protected-message\">' . __( \"This content is password protected\", 'thb_text_domain') . '<span>' . __(\"to view it please enter your password below\", 'thb_text_domain') . '</span></p>\n\t <form action=\"' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '\" method=\"post\">\n\t\t\t<label class=\"hidden\" for=\"' . $label . '\">' . __( \"Password:\",'thb_text_domain' ) . ' </label>\n\t\t\t<input name=\"post_password\" placeholder=\"Password\" id=\"' . $label . '\" type=\"password\" size=\"20\" maxlength=\"20\" />\n\t\t\t<input id=\"submit\" type=\"submit\" name=\"Submit\" value=\"' . esc_attr__( \"Submit\" ) . '\" />\n\t\t</form>\n\t ';\n\t return $o;\n\t}", "function sendMessage($vars) {\r\n extract($vars);\r\n\t\r\n\tlist($dbconn) = lnDBGetConn();\r\n\t$lntable = lnDBGetTables();\r\n\r\n\t$privmsgstable = $lntable['privmsgs'];\r\n\t$privmsgscolumn = &$lntable['privmsgs_column'];\r\n\r\n\t$id = getMaxPrivMsgID();\r\n\t$type = _MESSAGESEND; \r\n\t$send_time = time();\r\n\t$ip = getenv(\"REMOTE_ADDR\");\r\n\tif (empty($from_uid)) {\r\n\t\t$from_uid = lnSessionGetVar('uid');\r\n\t}\r\n\tif (empty($to_uid)) {\r\n\t\t$to_uid = lnUserGetUid($nickname);\r\n\t\tmessageHead($vars);\r\n\t}\r\n\t\r\n\tif (empty($to_uid)) {\r\n\t\techo '<P><TABLE CELLPADDING=10 CELLSPACING=1 BGCOLOR=\"#FF0000\" HEIGHT=\"50\"><TR><TD BGCOLOR=\"#FFFFFF\" ALIGN=\"CENTER\">';\r\n\t\techo '<B>Sorry but no such user exists</B>';\r\n\t\techo '<P><< <A HREF=\"javascript:history.go(-1)\">Back</A>';\r\n\t\techo '</TD></TR></TABLE>';\r\n\t}\r\n\telse {\r\n\t\t$query = \"INSERT INTO $privmsgstable (\r\n\t\t\t\t\t\t$privmsgscolumn[id],\r\n\t\t\t\t\t\t$privmsgscolumn[type],\r\n\t\t\t\t\t\t$privmsgscolumn[priority],\r\n\t\t\t\t\t\t$privmsgscolumn[subject],\r\n\t\t\t\t\t\t$privmsgscolumn[message],\r\n\t\t\t\t\t\t$privmsgscolumn[from_uid],\r\n\t\t\t\t\t\t$privmsgscolumn[to_uid],\r\n\t\t\t\t\t\t$privmsgscolumn[date],\r\n\t\t\t\t\t\t$privmsgscolumn[ip],\r\n\t\t\t\t\t\t$privmsgscolumn[enable]\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tVALUES (\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($id) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($type) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($priority) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($subject) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($message) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($from_uid) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($to_uid) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($send_time) .\"',\r\n\t\t\t\t\t\t'\". lnVarPrepForStore($ip) .\"',\r\n\t\t\t\t\t\t'1'\r\n\t\t\t\t\t\t) \";\r\n\t\t\t$result = $dbconn->Execute($query);\r\n\r\n\t\t\t/*\r\n\t\t\techo '<P><TABLE CELLPADDING=10 CELLSPACING=1 BGCOLOR=\"#0066CC\" HEIGHT=\"50\"><TR><TD BGCOLOR=\"#FFFFFF\" ALIGN=\"CENTER\">';\r\n\t\t\techo '<B>Your message has been sent</B>';\r\n\t\t\techo '<P>Click <A HREF=\"index.php?mod=Private_Messages&amp;op=inbox\">Here</A> to return to your Inbox';\r\n\t\t\techo '</TD></TR></TABLE>';\r\n\t\t\t*/\r\n\r\n\r\n\t}\r\n}", "function capstone_registraion_message( $msg ) {\n return $msg . do_shortcode('[wppb-login]');\n }", "function login_code($quiet)\n{\n\t//return value of 1 means don't do anything else\n\t\t//the login script has closed the fence for some reason\n\tglobal $mysql_db, $config;\n\t#TODO : produce the div tags when quiet=1 and output is actually produced\n\tif ($quiet == 0)\n\t{\n\t\t//this div includes login, logout, and change password widgets\n\t\techo \"<div id=\\\"login_control\\\">\\n\";\n\t}\n\t$retv = 0;\n\tif (!(array_key_exists(\"HTTPS\", $_SERVER)))\n\t{\n\t\t$_SERVER[\"HTTPS\"] = \"off\";\n\t}\n\t\n\tif (($_SERVER[\"HTTPS\"] != \"on\") && ($config['require_https'] == 1))\n\t{\n\t\techo \"HTTPS is required<br >\\n\";\n\t\t$retv = 1;\n\t}\n\n\tif (($_POST[\"action\"] == \"create_user\") && ($config['allow_user_create']=1))\n\t{\n\t\tif (isset($_POST[\"username\"]))\n\t\t{\n\t\t\t$attempt_username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t\t\n\t\t\tif (isset($_POST[\"email\"]))\n\t\t\t{\n\t\t\t\t$attempt_email = $mysql_db->real_escape_string($_POST[\"email\"]);\n\t\t\t\tif (isset($_POST[\"pass2\"]))\n\t\t\t\t{\n\t\t\t\t\t$attempt_pass1 = $mysql_db->real_escape_string($_POST[\"pass2\"]);\n\t\t\t\t\tif (isset($_POST[\"pass3\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$attempt_pass2 = $mysql_db->real_escape_string($_POST[\"pass3\"]);\t\t\t\t\t\t\n\t\t\t\t\t\tif ($attempt_pass1 != $attempt_pass2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"Passwords do not match!<br>\\n\";\n\t\t\t\t\t\t\t$_POST[\"action\"] = \"register\";\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\tif (($attempt_pass1 != '') && \n\t\t\t\t\t\t\t\t($attempt_username != '') &&\n\t\t\t\t\t\t\t\t($attempt_email != ''))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (attempt_registration($attempt_username, $attempt_email, $attempt_pass1)==0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo \"Failed to register<br>\\n\";\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\techo \"Registered successfully<br>\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_POST[\"action\"] = \"register\";\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}\n\t\n\t//If chain to determine what to do\n\tif (($_POST[\"action\"] == \"register\") && ($config['allow_user_create']=1))\n\t{\n\t\tif (isset($_POST[\"username\"]))\n\t\t{\n\t\t\t$previous_username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_username = \"\";\n\t\t}\n\t\tif (isset($_POST[\"email\"]))\n\t\t{\n\t\t\t$previous_email = $mysql_db->real_escape_string($_POST[\"email\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_email = \"\";\n\t\t}\n\t\techo \t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"create_user\\\">\\n\" .\n\t\t\t\t\t\"\tUsername: <input type=\\\"text\\\" name=\\\"username\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tEmail: <input type=\\\"text\\\" name=\\\"email\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tPassword: <input type=\\\"password\\\" name=\\\"pass2\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tPassword again: <input type=\\\"password\\\" name=\\\"pass3\\\" ><br>\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Register\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t}\n\telse if ($_POST[\"action\"] == \"login\")\n\t{\t//retrieve submitted username and password, if applicable\n\t\t$username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t$passworder = $mysql_db->real_escape_string($_POST[\"password\"]);\n\t\n\t\t$_SESSION['username'] = $username;\n\t}\n\telse if ($_POST[\"action\"] == \"logout\")\n\t{\n\t\techo \"Logout<br>\\n\";\n\t\tunset($_SESSION['username']);\n\t\tunset($_SESSION['password']);\n\t}\n\telse if ($_POST[\"action\"] == \"change_pass\")\n\t{\n\t\t$retv = 1;\n\t\tif ($quiet == 0)\n\t\t{\n\t\t\t#TODO : create button to change mind on changing password\n\t\t\techo \t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"apply_pass\\\">\\n\" .\n\t\t\t\t\t\"\tOld password: <input type=\\\"password\\\" name=\\\"pass1\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tNew password: <input type=\\\"password\\\" name=\\\"pass2\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tNew password again: <input type=\\\"password\\\" name=\\\"pass3\\\" ><br>\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Change my password\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t\t}\n\t}\n\telse if ($_POST[\"action\"] == \"apply_pass\")\n\t{\n\t\t$oldpass = $mysql_db->real_escape_string($_POST['pass1']);\n\t\t$newpass = $mysql_db->real_escape_string($_POST['pass2']);\n\t\t$passmatch = $mysql_db->real_escape_string($_POST['pass3']);\n\t\tif ($newpass == $passmatch)\n\t\t{\n\t\t\t$uid = $_SESSION['user']['emp_id'];\n\t\t\tcontacts::store_user_pword($uid, $oldpass, $newpass);\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<h3>Passwords do not match</h3><br >\\n\";\n\t\t}\n\t}\n\n\t#logic for logging in and normal activity\n\tif (isset($_SESSION['username']))\n\t{\n\t\t$query = \"SELECT * FROM contacts WHERE username='\" . $_SESSION['username'] . \"' LIMIT 1;\";\n\t\t$results = $mysql_db->query($query);\n\t\tif ($results)\n\t\t{\n\t\t\t$row = $results->fetch_array(MYSQLI_BOTH);\n\t\t\t#TODO : more testing of the failed login logic\n\t\t\tif ($row['fail_logins'] >= $config['max_fail_logins'])\n\t\t\t{\t//TODO: set time period for waiting to login\n\t\t\t\techo \"Failed login too many times error<br>\\n\";\n\t\t\t\tunset($_SESSION['username']);\n\t\t\t\tunset($_SESSION['password']);\n\t\t\t}\n\t\t\t\n\t\t\tif ($_POST[\"action\"] == \"login\")\n\t\t\t{\n\t\t\t\t//check to see if the password matches and the stretching does not match\n\t\t\t\t//this piece allows the stretching value to be changed at any given time\n\t\t\t\t//the only drawback is the password is hashed twice when the user logs in\n\t\t\t\t//in order to change the stretching value\n\t\t\t\t$temp = hash_password($passworder, $row['salt'], $row['stretching']);\n\t\t\t\tif ( ($row['password'] == $temp) && ($row['stretching'] != $config['key_stretching_value']) )\n\t\t\t\t{\t//password is good, key stretching needs to be fixed\n\t\t\t\t\tcontacts::mod_user_pword($row['emp_id'], $passworder);\n\t\t\t\t\t$fquery = \"SELECT * From contacts WHERE username='\" . $_SESSION['username'] . \"'LIMIT 1;\";\n\t\t\t\t\t$fresults = $mysql_db->query($fquery);\n\t\t\t\t\tif ($fresults)\n\t\t\t\t\t{\n\t\t\t\t\t\t$row = $fresults->fetch_array(MYSQLI_BOTH);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t//this should never happen\n\t\t\t\t\t\tthrow new Exception(\"Failed to reformat password\");\n\t\t\t\t\t}\n\t\t\t\t\t$temp = hash_password($passworder, $row['salt'], $config['key_stretching_value']);\n\t\t\t\t\t$row['password'] = $temp;\n\t\t\t\t}\n\n\t\t\t\t$_SESSION['password'] = $temp;\n\t\t\t}\n\t\t\tif (($row['password'] == $_SESSION['password']) && isset($_SESSION['password']) && ($_SESSION['password'] <> \"\"))\n\t\t\t{\t#successful login\n\t\t\t\t#TODO : limit the number of valid sessions for users? create a valid session table?\n\t\t\t\t$_SESSION['user'] = $row;\n\t\t\t\tif ($_POST[\"action\"] == \"login\")\n\t\t\t\t{\n\t\t\t\t\t$query = \"UPDATE contacts SET fail_pass_change=0 WHERE emp_id = \" . $_SESSION['user']['emp_id'] . \";\";\n\t\t\t\t\t$mysql_db->query($query);\n\t\t\t\t\t$query = \"UPDATE contacts SET fail_logins=0 WHERE emp_id = \" . $_SESSION['user']['emp_id'] . \";\";\n\t\t\t\t\t$mysql_db->query($query);\n\t\t\t\t}\n\t\t\t\tif ($quiet == 0)\n\t\t\t\t{\n\t\t\t\t\techo \"<h3>Welcome \";\n\t\t\t\t\techo print_contact($_SESSION['user']['emp_id']);\n\t\t\t\t\techo \"</h3>\\n\";\n\t\t\t\t\techo \"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\t \"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"logout\\\">\\n\" .\n\t\t\t\t\t\t \"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Logout\\\">\\n\" .\n\t\t\t\t\t\t \"</form>\\n\";\n\t\t\t\t\tif ($_POST[\"action\"] != \"change_pass\")\n\t\t\t\t\t{\n\t\t\t\t\t\techo\t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"change_pass\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Change my password\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"</form>\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\t//password fail match\n\t\t\t\t$query = \"UPDATE contacts SET fail_logins=fail_logins+1 WHERE username = \" . $_SESSION['username'] . \";\";\n\t\t\t\t$mysql_db->query($query);\n\t\t\t\tunset($_SESSION['username']);\n\t\t\t\tunset($_SESSION['password']);\n\t\t\t\tinvalid_username_password();\n\t\t\t\t$retv = 1;\n\t\t\t}\n\t\t\t$results->close();\n\t\t}\n\t\telse\n\t\t{\t//contact not found\n\t\t\tunset($_SESSION['username']);\n\t\t\tunset($_SESSION['password']);\n\t\t\tinvalid_username_password();\n\t\t\t$retv = 1;\t\n\t\t}\n\t}\n\telse\n\t{\n\t\tlogin_button();\n\t\tif ($config['allow_user_create']=1)\n\t\t{\n\t\t\techo \"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"register\\\">\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Register\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t\t}\n\t\t$retv = 1;\n\t}\n\n\tif ($quiet == 0)\n\t{\n\t\techo \"</div>\\n\";\n\t}\t\n\n\treturn $retv;\n}", "private function generateLevelPassword(){\n\t\tif( !isset($this->password) ){\n\t\t\tif( !isset($_SESSION['levelPass']) ){\n\t\t\t\t$_SESSION['levelPass'] = array();\n\t\t\t}\n\t\t\tif( isset($_SESSION['levelPass'][$this->level_id]) ){\n\t\t\t\t$this->password = $_SESSION['levelPass'][$this->level_id];\n\t\t\t} else {\n\t\t\t\t$this->password = BasicLevel::generatePassword(7);\n\t\t\t\t$_SESSION['levelPass'][$this->level_id] = $this->password;\n\t\t\t}\n\t\t}\n\t}", "public function message()\n {\n return 'La contraseña debe tener un minimp de 8 caracteres, una letra mayuscula y un número';\n }", "function message()\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$this->common_header('domessage', 'Board Message', 'You may change the configuration below. HTML is enabled, and BBCode will be enabled in later versions.');\r\n\r\n\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t \"<b>Turn the message system off?</b>\",\r\n\t\t $SKIN->form_yes_no(\"global_message_on\", $INFO['global_message_on'])\r\n\t\t ));\r\n\r\n\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t \"<b>The message to display</b>\",\r\n\t\t $SKIN->form_textarea(\"global_message\", $INFO['global_message'])\r\n\t\t ));\r\n\r\n\t\t$this->common_footer();\r\n\r\n\t}", "function pass_change()\r\n\t{\r\n\t\tglobal $ibforums, $std;\r\n\r\n\t\tif ($ibforums->member['disable_mail'])\r\n\t\t{\r\n\t\t\t$ibforums->lang['no_mail'] = sprintf($ibforums->lang['no_mail'], $ibforums->member['disable_mail_reason']);\r\n\r\n\t\t\t$this->output .= View::make(\"global.warn_window\", ['message' => $ibforums->lang['no_mail']]);\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$this->output .= View::make(\"ucp.pass_change\");\r\n\t\t}\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "function pwHash($pword = \"\"){\n\n //currently only returns the password it was given\n \n return $pword;\n\n}", "function send_tempPass($email){\n\n\n $temp_pass = generate_temp_pass();\n $insert_to_db_pass = md5($temp_pass);\n $username = $_SESSION['username'];\n $email = htmlspecialchars($email);\n \n change_to_temp($insert_to_db_pass,$_SESSION['email'],$username);\n $to = $_SESSION['email'];\n\n $subject = \"Temporary Password\";\n\n //message to the user!\n $message = \"\n <html>\n <body style='background: #3B653D;'>\n <div>\n <h1 style = 'color:#ffffff; font-size:32px; text-align: center;'> Here is your account temporary password info $email !<br></h1>\n \n <span style = 'color:#ffffff;' font-size:20px;'> Temporary Password: $temp_pass </span><br>\n <span><a style = 'color:#ffffff;' href =http://farvlu.farmingdale.edu/~foxrc/BCS350_Project/change_password_link.php> Click here to change password </a> </span>\n \n </div>\n </body>\n </html>\";\n $headers = \"MIME-Version: 1.0\" . PHP_EOL;\n $headers .= \"Content-type:text/html;charset=UTF-8\" . PHP_EOL;\n $headers .= \"From: [email protected]\". PHP_EOL;\n mail($to,$subject,$message,$headers);\n\n}", "function changeMasterPassword()\n\t{\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.std_layout.html\", \"setup\");\n\n\t\t$this->tpl->setVariable(\"TXT_INFO\", $this->lng->txt(\"info_text_password\"));\n\n\t\t// formular sent\n\t\tif ($_POST[\"form\"])\n\t\t{\n\t\t\t$pass_old = $this->setup->getPassword();\n\n\t\t\tif (empty($_POST[\"form\"][\"pass_old\"]))\n\t\t\t{\n\t\t\t\t$message = $this->lng->txt(\"password_enter_old\");\n\t\t\t\t$this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\tif (md5($_POST[\"form\"][\"pass_old\"]) != $pass_old)\n\t\t\t{\n\t\t\t\t$message = $this->lng->txt(\"password_old_wrong\");\n\t\t\t\t$this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\tif (empty($_POST[\"form\"][\"pass\"]))\n\t\t\t{\n\t\t\t\t$message = $this->lng->txt(\"password_empty\");\n\t\t\t\t$this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\tif ($_POST[\"form\"][\"pass\"] != $_POST[\"form\"][\"pass2\"])\n\t\t\t{\n\t\t\t\t$message = $this->lng->txt(\"password_not_match\");\n\t\t\t\t$this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\tif (md5($_POST[\"form\"][\"pass\"]) == $pass_old)\n\t\t\t{\n\t\t\t\t$message = $this->lng->txt(\"password_same\");\n\t\t\t\t$this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\tif (!$this->setup->setPassword($_POST[\"form\"][\"pass\"]))\n\t\t\t{\n\t\t\t\t$message = $this->lng->txt(\"save_error\");\n\t\t\t\t$this->setup->raiseError($message,$this->setup->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\tilUtil::sendInfo($this->lng->txt(\"password_changed\"),true);\n\t\t\tilUtil::redirect(\"setup.php\");\n\t\t}\n\n\t\t// output\n\t\t$this->tpl->addBlockFile(\"SETUP_CONTENT\",\"setup_content\",\"tpl.form_change_admin_password.html\", \"setup\");\n\n\t\t$this->tpl->setVariable(\"TXT_HEADER\",$this->lng->txt(\"password_new_master\"));\n\n\t\t// pass form\n\t\t$this->tpl->setVariable(\"FORMACTION\", \"setup.php?cmd=gateway\");\n\t\t$this->tpl->setVariable(\"TXT_REQUIRED_FIELDS\", $this->lng->txt(\"required_field\"));\n\t\t$this->tpl->setVariable(\"TXT_PASS_TITLE\",$this->lng->txt(\"change_password\"));\n\t\t$this->tpl->setVariable(\"TXT_PASS_OLD\",$this->lng->txt(\"set_oldpasswd\"));\n\t\t$this->tpl->setVariable(\"TXT_PASS\",$this->lng->txt(\"set_newpasswd\"));\n\t\t$this->tpl->setVariable(\"TXT_PASS2\",$this->lng->txt(\"password_retype\"));\n\t\t$this->tpl->setVariable(\"TXT_SAVE\", $this->lng->txt(\"save\"));\n\t}", "public function retrieve_password_message_fix($message){\n\t $message = str_replace('<', '', $message);\n\n\t // Replace second open bracket\n\t $message = str_replace('>', '', $message);\n\n\t // Convert line returns to <br>'s\n\t $message = str_replace(\"\\r\\n\", '<br>', $message);\n\n\t return $message;\n\t}", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "function forgot_password_theme()\n{\n\tglobal $globals, $mysql, $done, $error, $errors, $notice;\n\tglobal $l;\n\tglobal $show, $done;\n\t\n\t// dont do echbr(), very bad practice, instead just call, php language construct, echo '<br />'\n\t// calling a function instead of a language construct will slow down your php\n\t//echbr();\n\techo '<br />';\n\t\n\terror_handler($error);\n\terror_handler($errors);\n\t\n\tnotice_handler($notice);\n\t\n\t$str = '';\n\t// if exists, then 'email exists' error, etc. (still to put)\n\tif( !$done )\n\t{\n\t\t$str .= '\n\t\t\t<form action=\"\" method=\"post\">\n\t\t\t\t<table align=\"center\">\n\t\t\t\t';\n\t\t\t\t/*\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"70%\">'.$l['usrnm'].'</td>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"username\"> </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t* */\n\t\t\t\t\t\n\t\t\t\t\t$em = (isset($_GET['e']) ? $_GET['e'] : '');\n\t\t\t\t\t$str .= '\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>'.$l['email'].'</td>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"email\" value=\"'.$em.'\"> </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t';\n\t\t\t\t\tif($show)\n\t\t\t\t\t{\n\t\t\t\t\t\t$str .= '\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>'.$l['pass'].'</td>\n\t\t\t\t\t\t\t<td><input type=\"text\" name=\"password\"></td>\n\t\t\t\t\t\t</tr>\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<tr>\n\t\t\t\t\t\t<td>'.$l['web_url'].'</td>\n\t\t\t\t\t\t<td><input type=\"text\" name=\"url\"> </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t* */\n\t\t\t\t\t$str .= '\n\t\t\t\t</table>\n\t\t\t\t<center><input type=\"submit\" name=\"sub_register\" value=\"Confirm\"></center>\n\t\t\t</form>\n\t\t';\n\t}\n\t\n\techo $str;\n\t\n}", "private function writePassword(): void\n {\n // Exit unless sheet protection and password have been specified\n if ($this->phpSheet->getProtection()->getSheet() !== true || !$this->phpSheet->getProtection()->getPassword() || $this->phpSheet->getProtection()->getAlgorithm() !== '') {\n return;\n }\n\n $record = 0x0013; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $wPassword);\n\n $this->append($header . $data);\n }", "function userRandomPassword()\n{\n\n global $errorSearch;\n\n $length = 20;\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-._#!?%';\n $charactersLength = strlen($characters);\n $randomString = '';\n\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n $password_hash = password_hash($randomString, PASSWORD_DEFAULT);\n\n if (database::getConnections()->updateAdminRandomPassword(\"userdata\", $_POST[\"userId\"], $password_hash) == true) {\n $errorSearch = '<p class=\"success\">Erfolgreich das Passwort geändert. Dem User wurde ein Random Passwort per E-Mail zugeschickt!</p>';\n\n // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG\n // SPÄTER ENTFERNEN NUR ZUM AUSPROBIEREN UND SCHAUEN, SOLANGE AUCH DIE MAIL NICHT AUFTAUCHT!\n echo 'Das Neue Passwort von dem User lautet (Ohne Leerzeichen und \"\") = \"' . $randomString . '\" !';\n } else {\n $errorSearch = '<p class=\"error\">Es ist ein Fehler aufgetreten und das Passwort des Users konnte nicht abgeändert werden. Bitte wende dich an den Besitzer und Backend Developer!</p>';\n }\n\n $newMail = new mail();\n $newMail->randomPasswordMail($_POST[\"userEmail\"], $randomString);\n}", "function smiley_face($yourmessage)\n{\n $i = 0;\n $ubb1 = array( \"[b]\", \"[B]\", \"[/b]\", \"[/B]\", \"[u]\", \"[U]\", \"[/u]\", \"[/U]\", \"[i]\", \"[I]\", \"[/i]\", \"[/I]\", \"[center]\", \"[CENTER]\", \"[/center]\", \"[/CENTER]\" );\n $ubb2 = array( \"<b>\", \"<B>\", \"</b>\", \"</B>\", \"<u>\", \"<U>\", \"</u>\", \"</U>\", \"<i>\", \"<I>\", \"</i>\", \"</I>\", \"<center>\", \"<CENTER>\", \"</center>\", \"</CENTER>\" );\n $sm1 = array( \":?:\", \":D\", \":?\", \":cool:\", \":cry:\", \":shock:\", \":evil:\", \":!:\", \":frown:\", \":idea:\", \":arrow:\", \":lol:\", \":x\", \":mrgreen:\", \":|\", \":P\", \":oops:\", \":roll:\", \":(\", \":)\", \":o\", \":twisted:\", \":wink:\" );\n $sm2 = array( \"question\", \"biggrin\", \"confused\", \"cool\", \"cry\", \"eek\", \"evil\", \"exclaim\", \"frown\", \"idea\", \"arrow\", \"lol\", \"mad\", \"mrgreen\", \"neutral\", \"razz\", \"redface\", \"rolleyes\", \"sad\", \"smile\", \"surprised\", \"twisted\", \"wink\" );\n $sm3 = array( \": ?:\", \":D\", \":?\", \":cool:\", \":cry:\", \":shock:\", \":evil:\", \":!:\", \":frown:\", \":idea:\", \":arrow:\", \":lol:\", \":x\", \":mrgreen:\", \":|\", \":P\", \": oops :\", \":roll:\", \":(\", \":)\", \":o\", \":twisted:\", \":wink:\" );\n\n // UBB Code Insertion and Replacing UBB tags with the appropriate HTML tag\n\n for ($i=0; $i<=15; $i++)\n {\n \t$yourmessage = str_replace($ubb1[$i], $ubb2[$i], $yourmessage);\n }\n\n // Inserting smiley faces for guestbook users\n\n for ($i=0; $i<=22; $i++)\n {\n $yourmessage = str_replace($sm1[$i], \"<img src=\\\"images/icon_$sm2[$i].gif\\\" ALT=\\\"$sm3[$i]\\\">\", $yourmessage);\n }\n return $yourmessage;\n}", "function smiley_face($yourmessage)\n{\n $i = 0;\n $ubb1 = array( \"[b]\", \"[B]\", \"[/b]\", \"[/B]\", \"[u]\", \"[U]\", \"[/u]\", \"[/U]\", \"[i]\", \"[I]\", \"[/i]\", \"[/I]\", \"[center]\", \"[CENTER]\", \"[/center]\", \"[/CENTER]\" );\n $ubb2 = array( \"<b>\", \"<B>\", \"</b>\", \"</B>\", \"<u>\", \"<U>\", \"</u>\", \"</U>\", \"<i>\", \"<I>\", \"</i>\", \"</I>\", \"<center>\", \"<CENTER>\", \"</center>\", \"</CENTER>\" );\n $sm1 = array( \":?:\", \":D\", \":?\", \":cool:\", \":cry:\", \":shock:\", \":evil:\", \":!:\", \":frown:\", \":idea:\", \":arrow:\", \":lol:\", \":x\", \":mrgreen:\", \":|\", \":P\", \":oops:\", \":roll:\", \":(\", \":)\", \":o\", \":twisted:\", \":wink:\" );\n $sm2 = array( \"question\", \"biggrin\", \"confused\", \"cool\", \"cry\", \"eek\", \"evil\", \"exclaim\", \"frown\", \"idea\", \"arrow\", \"lol\", \"mad\", \"mrgreen\", \"neutral\", \"razz\", \"redface\", \"rolleyes\", \"sad\", \"smile\", \"surprised\", \"twisted\", \"wink\" );\n $sm3 = array( \": ?:\", \":D\", \":?\", \":cool:\", \":cry:\", \":shock:\", \":evil:\", \":!:\", \":frown:\", \":idea:\", \":arrow:\", \":lol:\", \":x\", \":mrgreen:\", \":|\", \":P\", \": oops :\", \":roll:\", \":(\", \":)\", \":o\", \":twisted:\", \":wink:\" );\n\n // UBB Code Insertion and Replacing UBB tags with the appropriate HTML tag\n\n for ($i=0; $i<=15; $i++)\n {\n \t$yourmessage = str_replace($ubb1[$i], $ubb2[$i], $yourmessage);\n }\n\n // Inserting smiley faces for guestbook users\n\n for ($i=0; $i<=22; $i++)\n {\n $yourmessage = str_replace($sm1[$i], \"<img src=\\\"images/icon_$sm2[$i].gif\\\" ALT=\\\"$sm3[$i]\\\"/>\", $yourmessage);\n }\n return $yourmessage;\n}", "protected function actionNewPassword() {\n\t\t$this->content = $this->parser->parseTemplate(CMT_TEMPLATE.'app_welcome/cmt_new_password.tpl');\n\t}", "public function route_chpasswd(array $args) {\n\t\treturn self::$core::pj(\n\t\t\tself::$ctrl->change_password($args['post'], true));\n\t}", "function qconfirm(&$irc, &$data)\n {\n\t\t\tglobal $pickupchannel;\n if($data->message == \"Remember: NO-ONE from QuakeNet will ever ask for your password. NEVER send your password to ANYONE except [email protected].\")\n {\n echo \"\\n\\n\\n\\nSHIIIT\\n\\n\\n\\n\";\n $irc->join($pickupchannel);\n }\n }", "function lost_password_end()\n {\n\t\tif ($this->ipsclass->vars['bot_antispam'])\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Security code stuff\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ($this->ipsclass->input['regid'] == \"\")\n\t\t\t{\n\t\t\t\t$this->lost_password_start('err_reg_code');\n\t\t\t\treturn;\n\t\t\t}\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' => 'reg_antispam',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"regid='\".trim($this->ipsclass->txt_alphanumerical_clean($this->ipsclass->input['regid'])).\"'\"\n\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$this->ipsclass->DB->simple_exec();\n\t\t\t\n\t\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$this->show_reg_form('err_reg_code');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif ( trim( $this->ipsclass->txt_alphanumerical_clean($this->ipsclass->input['reg_code']) ) != $row['regcode'] )\n\t\t\t{\n\t\t\t\t$this->lost_password_start('err_reg_code');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n \t//-----------------------------------------\n \t// Back to the usual programming! :o\n \t//-----------------------------------------\n \t\n \tif ($_POST['member_name'] == \"\" AND $_POST['email_addy'] == \"\")\n \t{\n \t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );\n \t}\n \t\n \t//-----------------------------------------\n\t\t// Check for input and it's in a valid format.\n\t\t//-----------------------------------------\n\t\t\n\t\t$member_name = trim(strtolower($this->ipsclass->input['member_name']));\n\t\t$email_addy = trim(strtolower($this->ipsclass->input['email_addy']));\n\t\t\n\t\tif ($member_name == \"\" AND $email_addy == \"\" )\n\t\t{\n\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );\n\t\t}\n \t\n \t//-----------------------------------------\n\t\t// Attempt to get the user details from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->vars['ipbli_usertype'] == 'username' )\n\t\t{\n\t\t\tif( $member_name )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'members_display_name, name, id, email, mgroup', 'from' => 'members', 'where' => \"members_l_username='{$member_name}'\" ) );\n\t\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t}\n\t\t\telse if( $email_addy )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'members_display_name, name, id, email, mgroup', 'from' => 'members', 'where' => \"email='{$email_addy}'\" ) );\n\t\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t}\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// We don't use the 'email_addy' input if usertype is email\n\t\t\t$email_addy = \"\";\n\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'members_display_name, name, id, email, mgroup', 'from' => 'members', 'where' => \"email='{$member_name}'\" ) );\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t}\n\t\t\n\t\tif ( ! $this->ipsclass->DB->get_num_rows() )\n\t\t{\n\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$member = $this->ipsclass->DB->fetch_row();\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is there a validation key? If so, we'd better not touch it\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ($member['id'] == \"\")\n\t\t\t{\n\t\t\t\t$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );\n\t\t\t}\n\t\t\t\n\t\t\t$validate_key = md5( $this->ipsclass->make_password() . uniqid( mt_rand(), TRUE ) );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Get rid of old entries for this member\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->DB->do_delete( 'validating', \"member_id={$member['id']} AND lost_pass=1\" );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Update the DB for this member.\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$db_str = array(\n\t\t\t\t\t\t\t'vid' => $validate_key,\n\t\t\t\t\t\t\t'member_id' => $member['id'],\n\t\t\t\t\t\t\t#'real_group' => $member['mgroup'],\n\t\t\t\t\t\t\t'temp_group' => $member['mgroup'],\n\t\t\t\t\t\t\t'entry_date' => time(),\n\t\t\t\t\t\t\t'coppa_user' => 0,\n\t\t\t\t\t\t\t'lost_pass' => 1,\n\t\t\t\t\t\t\t'ip_address' => $this->ipsclass->input['IP_ADDRESS'],\n\t\t\t\t\t\t );\n\t\t\t\t\t\n\t\t\t// Are they already in the validating group?\n\t\t\t\n\t\t\tif( $member['mgroup'] != $this->ipsclass->vars['auth_group'] )\n\t\t\t{\n\t\t\t\t$db_str['real_group'] = $member['mgroup'];\n\t\t\t}\n\t\t\t\t\t\t \n\t\t\t$this->ipsclass->DB->do_insert( 'validating', $db_str );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Send out the email.\n\t\t\t//-----------------------------------------\n\t\t\t\n \t\t$this->email->get_template(\"lost_pass\");\n\t\t\t\t\n\t\t\t$this->email->build_message( array(\n\t\t\t\t\t\t\t\t\t\t\t\t'NAME' => $member['members_display_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t'THE_LINK' => $this->base_url_nosess.\"?act=Reg&CODE=lostpassform&uid=\".$member['id'].\"&aid=\".$validate_key,\n\t\t\t\t\t\t\t\t\t\t\t\t'MAN_LINK' => $this->base_url_nosess.\"?act=Reg&CODE=lostpassform\",\n\t\t\t\t\t\t\t\t\t\t\t\t'EMAIL' => $member['email'],\n\t\t\t\t\t\t\t\t\t\t\t\t'ID' => $member['id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'CODE' => $validate_key,\n\t\t\t\t\t\t\t\t\t\t\t\t'IP_ADDRESS' => $this->ipsclass->input['IP_ADDRESS'],\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\t\n\t\t\t$this->email->subject = $this->ipsclass->lang['lp_subject'].' '.$this->ipsclass->vars['board_name'];\n\t\t\t$this->email->to = $member['email'];\n\t\t\t\n\t\t\t$this->email->send_mail();\n\t\t\t\n\t\t\t$this->output = $this->ipsclass->compiled_templates['skin_register']->show_lostpasswait( $member );\n\t\t}\n \t\n \t$this->page_title = $this->ipsclass->lang['lost_pass_form'];\n }", "function pwd()\n\t{\n\t\t$this->sock_write(\"PWD\");\n\t\tif($this->check_reply(\"257\"))\n\t\t{\n\t\t\t$parts = split(\" \",$this->message);\n\t\t\treturn preg_replace('/\\\"/',\"\",$parts[1]);\n\t\t}\n\t\treturn \"\";\n\t}", "function sendPassword($pass)\n {\n\n /* Send an e-mail to the user saying that the password has been changed. */\n\n $header = \"From: \" . SENDER_FULL . \"\\r\\n\";\n // $header .= \"To: <\" . $this->email . \">\\r\\n\";\n $header .= \"Content-Type: text/plain; charset=\\\"utf-8\\\"\\r\\n\";\n $header .= \"Errors-To: \" . ADMIN_FULL . \"\\r\\n\";\n $header .= \"Reply-To: \" . ADMIN_FULL . \"\\r\\n\";\n $header .= \"X-Mailer: PHP\";\n\n $userLogin = SessionDataBean::getUserLogin();\n $userName = SessionDataBean::getUserFullName();\n\n $message = \"Uživatel '\" . $userLogin . \"' (\" . $userName . \") změnil vaše heslo\\r\\n\";\n $message .= \"pro přihlašování na stránky předmětů vyučovaných K611.\\r\\n\";\n $message .= \"\\r\\n\";\n $message .= \"Vaše uživatelské jméno: \" . $this->login . \"\\r\\n\";\n $message .= \"Vaše nové heslo zní: \" . $pass . \"\\r\\n\";\n $message .= \"\\r\\n\";\n $message .= \"Pokud máte konto na FD v Praze a v KOSu e-mail ve tvaru <x#####@fd.cvut.cz>,\\r\\n\";\n $message .= \"mohlo by fungovat i vaše primární heslo (to, kterým se přihlašujete na fakultní síť).\\r\\n\";\n $message .= \"Pokud ne, zkuste heslo uvedené výše.\\r\\n\";\n $message .= \"Přihlašování přes SSU bohužel stále ještě není možné.\\r\\n\";\n $message .= \"\\r\\n\";\n $message .= \"Stránky předmětů naleznete na URL\\r\\n\";\n $message .= \"\\thttp://zolotarev.fd.cvut.cz/msap/ (11MSAP)\\r\\n\";\n $message .= \"\\thttp://zolotarev.fd.cvut.cz/ma/ (11MA prezenční)\\r\\n\";\n $message .= \"\\thttp://zolotarev.fd.cvut.cz/mak/ (11MA pro kombinovanou formu)\\r\\n\";\n $message .= \"\\r\\n\";\n\n /* Now send the notification to the student ... */\n if (SEND_MAIL)\n {\n $subject = \"=?utf-8?B?\" . base64_encode('[K611LW] Nové heslo pro přístup') . \"?=\";\n mail($this->email, $subject, $message, $header);\n }\n\n /* ... and send a copy to the administrator. */\n $subject = \"=?utf-8?B?\" . base64_encode('[K611LW] Student <' . $this->email . '> - nové heslo pro přístup') . \"?=\";\n mail(ADMIN_EMAIL, $subject, $message, $header);\n }", "function generaPass(){\n $cadena = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n //Obtenemos la longitud de la cadena de caracteres\n $longitudCadena=strlen($cadena);\n\n //Se define la variable que va a contener la contraseña\n $pass = \"\";\n //Se define la longitud de la contraseña, en mi caso 10, pero puedes poner la longitud que quieras\n $longitudPass=10;\n\n //Creamos la contraseña\n for($i=1 ; $i<=$longitudPass ; $i++){\n //Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\n $pos=rand(0,$longitudCadena-1);\n\n //Vamos formando la contraseña en cada iteraccion del bucle, añadiendo a la cadena $pass la letra correspondiente a la posicion $pos en la cadena de caracteres definida.\n $pass .= substr($cadena,$pos,1);\n }\n return $pass;\n}", "public function testBugReport2605()\n {\n $password = Text_Password::create(7, 'unpronounceable', '1,3,a,Q,~,[,f');\n $this->assertTrue(strlen($password) == 7);\n }", "function generaPass() {\n $cadena = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n //Obtenemos la longitud de la cadena de caracteres\n $longitudCadena = strlen($cadena);\n\n //Se define la variable que va a contener la contraseña\n $pass = \"\";\n //Se define la longitud de la contraseña, en mi caso 10, pero puedes poner la longitud que quieras\n $longitudPass = 10;\n\n //Creamos la contraseña\n for ($i = 1; $i <= $longitudPass; $i++) {\n //Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\n $pos = rand(0, $longitudCadena - 1);\n //Vamos formando la contraseña en cada iteraccion del bucle, añadiendo a la cadena $pass la letra correspondiente a la posicion $pos en la cadena de caracteres definida.\n $pass .= substr($cadena, $pos, 1);\n }\n return $pass;\n}", "function temp_pass(){\n\treturn 'password199';\n}", "function ffw_port_password_callback( $args ) {\n global $ffw_port_settings;\n\n if ( isset( $ffw_port_settings[ $args['id'] ] ) )\n $value = $ffw_port_settings[ $args['id'] ];\n else\n $value = isset( $args['std'] ) ? $args['std'] : '';\n\n $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';\n $html = '<input type=\"password\" class=\"' . $size . '-text\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" value=\"' . esc_attr( $value ) . '\"/>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}", "function displayPasswordNotSetNotice()\n{\n?>\n <div class=\"warning\">\n <h3>Almost there...</h3>\n <p>Before using this demo, you must set an application password\n to protect your account. You will also need to set your\n Google Apps credentials in order to communicate with the Google\n Apps servers.</p>\n <p>To continue, open this file in a text editor and fill\n out the information in the configuration section.</p>\n </div>\n<?php\n}", "function draw_login($message) { ?>\n \n <body class=\"loginBody\">\n <section class=\"viewport\">\n <section id=\"login\" class= \"loginCardStyle nosidebarblockLayout centerCardLayout\">\n <a href=\"../pages/mainpage.php\"><img id=\"logo\" src= \"../img/logo.png\" height=\"90\" width=\"90\"/></a>\n <h2>Welcome back to Mel-o!</h2>\n <?php if($message !== \"\") {?>\n <h3><?= $message ?></h3>\n <?php }?>\n\n <form method=\"post\" action=\"../actions/action_login.php\">\n <input type=\"text\" name=\"username\" placeholder=\"username\" class=\"inputField\" autocomplete=\"username\" maxlength=\"15\" required>\n <input type=\"password\" name=\"password\" placeholder=\"password\" class=\"inputField\" autocomplete=\"current-password\" maxlength=\"15\" required>\n <input type=\"submit\" value=\"Login\">\n </form>\n\n <footer>\n <p>Don't have an account? <a href=\"signup.php?message=\">Signup!</a></p>\n </footer>\n </section>\n </section>\n<?php }", "function ADMIN_Identifie()\n{\n\tif ($_POST[\"ed_PW\"] ==\"jbmd\")\n\t\t{\n\t\t\t$_SESSION[\"ADMIN_OK\"] = \"00\";\t\t\n\t\t\tTOOL_Chainage(\"SCI_EF_index.php\");\n\t\t\treturn;\n\t\t}\n\n}", "function generaPass(){\n $cadena = \"1234567890\";\n //Obtenemos la longitud de la cadena de caracteres\n $longitudCadena=strlen($cadena);\n \n //Se define la variable que va a contener la contraseña\n $pass = \"\";\n //Se define la longitud de la contraseña, en mi caso 10, pero puedes poner la longitud que quieras\n $longitudPass=5;\n \n //Creamos la contraseña\n for($i=1 ; $i<=$longitudPass ; $i++){\n //Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\n $pos=rand(0,$longitudCadena-1);\n \n //Vamos formando la contraseña en cada iteraccion del bucle, añadiendo a la cadena $pass la letra correspondiente a la posicion $pos en la cadena de caracteres definida.\n $pass .= substr($cadena,$pos,1);\n }\n return $pass;\n}", "function genPassword($length=7){\n $newPass = \"\";\n for ($i = 0; $i < $length; $i++) {\n if (rand(0,1)){\n if (rand(0,1)){\n $newPass .= chr(rand(97,122));\n }else{\n $newPass .= chr(rand(65,90));\n }\n }else{\n $newPass .= chr(rand(48,57));\n }\n }\n return $newPass;\n}", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "function encryptPassword()\n\t{\n\t\t$userPassword = $_POST['userPassword'];\n\n\t $key = pack('H*', \"bcb04b7e103a05afe34763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3\");\n\t $key_size = strlen($key);\n\n\t $plaintext = $userPassword;\n\n\t $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\t $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n\t $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_CBC, $iv);\n\t $ciphertext = $iv . $ciphertext;\n\n\t $userPassword = base64_encode($ciphertext);\n\n\t return $userPassword;\n\t}", "public function modifpassword($user,$passwd){\n \n }", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\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 $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "function test() {\n for ( $i=0; $i< 25; $i++) {\n echo $this->generatePassword() . \"<br />\";\n }\n }", "protected function _makeForgetPwdMessage($code, $id, $path = null)\n\t{\n\t\t$message = null;\n\t\t$config \t\t= Zend_Registry::get('config');\n\t\t$user \t\t\t= $this->getUserById($id); \n\t\t$forgot_config = $config->app->password->forgot;\n\t\t\n\t\t$msg_path \t\t= $path;\n\t\t\n\t\tif(null === $path)\n\t\t{\n\t\t\t$msg_path = $forgot_config->messagefile;\n\t\t}\n\t\tif (!readable($msg_path))\n\t\t\tthrow new Exception('\\'Password Forgot\\' message not readable.');\n\t\t\n\t\t$adminemail \t= $config->app->mail->server->email;\n\t\t$churchname\t= APP_CHURCH_NAME;\n\t\t\n\t\t$firstname \t= $user['user_fname'];\n\t\t\n\t\t$e_id \t\t= encrypt($id\t, APP_SALT);\n\t\t$e_c \t\t= encrypt($code\t, APP_SALT);\n\t\t\n\t\t$terms \t\t= 'http://'. $config->app->domain.'/about/policy/';\n\t\t$link\t\t= 'http://'. $config->app->domain.'/account/forgotpwd/?tu='.urlencode($e_id) . '&t='.urlencode($e_c);\n\t\t\t\n\t\tob_start();\n\t\tinclude($msg_path);\n\t\t\n\t\t$message = ob_get_contents();\n\t\t\n\t\tob_end_clean();\n\t\t\n\t\treturn $message;\n\t}", "function password_add($data) {\n\t}", "function displaylogin($title,$color,$mode,$message=\"\",$loginapp=\"index.php\",$reg=false,$PARAMS=\"\"){\n\tglobal $version,$lastmodified;\t\n\tif ($PARAMS!=\"\"){\n\t\tif(isset($PARAMS['name'])) $name=$PARAMS['name'];\n\t\tif(isset($PARAMS['email'])) $email=$PARAMS['email'];\n\t\tif(isset($PARAMS['name'])) $username=$PARAMS['username'];\n\t\tif(isset($PARAMS['userpass'])) $userpass=$PARAMS['userpass'];\n\t\tif(isset($PARAMS['password2'])) $password2=$PARAMS['password2']; \n\t}\n\t//debug_string(\"displaylogin()\");\n\tDisplay_Generic_Header($title . \" Login\",$color);\n\t\n\techo <<< EOF\n\t<center>| <a href=\"index.php?mode=list\">Return to $title </a> |</center>\n\t<br><br>\n\t<br><br>\n<center>\n<table >\n<tr>\n<td valign=\"top\">\n\n\t<font color=red size=+1>$message</font>\n\t<br><br>\n\t<h2>Enter Username & Password</h2>\n\t<h3></h3>\n\t<form method=\"post\" action=\"$loginapp\">\n\t<table><tr><td><b>Username: </b></td> <td><input type=\"text\" name=\"username\"><br></td></tr>\n\t<tr><td><b>Password: </b></td><td>\t<input type=\"password\" name=\"password\"><br></td></tr>\n\t</table>\t<input type=\"submit\" value=\"Submit\"><br>\n\t<input type=\"hidden\" name=\"mode\" value=\"$mode\">\n\t</form>\n</td>\n<td align=\"center\">\n<b>|<br>|<br>|<br>|<br>|<br> &nbsp;&nbsp;&nbsp;&nbsp;- OR - &nbsp;&nbsp;&nbsp;&nbsp;<br>|<br>|<br>|<br>|<br>|<br></b>\n</td>\n<td>\n\n<center><h2>Register As New User</h2>\n<h3>It's Free!</h3>\n<!-- ' -->\n<b>All fields are required.</br>\n<b>\n<form method=\"post\" action=\"index.php\">\n<table >\n<tr><td><b>Your Real Name: </b></td><td>\t<input type=\"text\" name=\"name\" value=\"$name\"><br></td></tr>\n<tr><td><b>Email: </b></td><td>\t<input type=\"text\" name=\"email\" value=\"$email\"><br></td></tr>\n<tr><td><b>Username: </b></td> <td><input type=\"text\" name=\"username\" value=\"$username\"><br></td></tr>\n<tr><td><b>Password: </b></td><td>\t<input type=\"password\" name=\"userpass\" ><br></td></tr>\n<tr><td><b>Confirm Password: </b></td><td>\t<input type=\"password\" name=\"password2\"><br></td></tr>\n</table>\t<input type=\"submit\" value=\"Submit\"><br>\n<input type=\"hidden\" name=\"mode\" value=\"newuser\">\n\n</form>\n<b>An email will be sent to your email with an activation URL. <br>Your new account will work only <i>after</i> you activate. </b>\n\n\n</td>\n</tr>\n</table>\nEOF;\n Display_Generic_Footer($version,date(\"F d Y H:i:s\", getlastmod()));\n}", "function wp_validate_application_password($input_user)\n {\n }", "private function randomKey($length = 10) {\n $chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n $key = \"\";\n for ($i = 0; $i < $length; $i++) {\n $key .= $chars{rand(0, strlen($chars) - 1)};\n }\n return $key;\n }\n\n /**\n * Changes a user's password, providing the current password is known\n * @param string $username\n * @param string $currpass\n * @param string $newpass\n * @param string $verifynewpass\n * @return boolean\n */\n function changePass($username, $currpass, $newpass, $verifynewpass) {\n if (strlen($username) == 0) {\n $auth_error[] = $this->lang['changepass_username_empty'];\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n $auth_error[] = $this->lang['changepass_username_long'];\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n $auth_error[] = $this->lang['changepass_username_short'];\n }\n if (strlen($currpass) == 0) {\n $auth_error[] = $this->lang['changepass_currpass_empty'];\n } elseif (strlen($currpass) < MIN_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['changepass_currpass_short'];\n } elseif (strlen($currpass) > MAX_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['changepass_currpass_long'];\n }\n if (strlen($newpass) == 0) {\n $auth_error[] = $this->lang['changepass_newpass_empty'];\n } elseif (strlen($newpass) < MIN_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['changepass_newpass_short'];\n } elseif (strlen($newpass) > MAX_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['changepass_newpass_long'];\n } elseif (strstr($newpass, $username)) {\n $auth_error[] = $this->lang['changepass_password_username'];\n } elseif ($newpass !== $verifynewpass) {\n $auth_error[] = $this->lang['changepass_password_nomatch'];\n }\n if (count($auth_error) == 0) {\n //$currpass = $this->hashPass($currpass);\n $newpass = $this->hashPass($newpass);\n $query = $this->db->select(\"SELECT password FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHANGEPASS_FAIL\", \"Username Incorrect ({$username})\");\n $auth_error[] = $this->lang['changepass_username_incorrect'];\n return false;\n } else {\n $db_currpass = $query[0]->password;\n $verify_password = \\Helpers\\Password::verify($currpass, $db_currpass);\n if ($verify_password) {\n $this->db->update(PREFIX.'users', array('password' => $newpass), array('username' => $username));\n $this->logActivity($username, \"AUTH_CHANGEPASS_SUCCESS\", \"Password changed\");\n $this->success[] = $this->lang['changepass_success'];\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHANGEPASS_FAIL\", \"Current Password Incorrect ( DB : {$db_currpass} / Given : {$currpass} )\");\n $auth_error[] = $this->lang['changepass_currpass_incorrect'];\n return false;\n }\n }\n } else {\n return false;\n }\n }\n\n /**\n * Changes the stored email address based on username\n * @param string $username\n * @param string $email\n * @return boolean\n */\n function changeEmail($userID, $password, $email) {\n\t\t// Get Current Password From Database\n\t\t$query = $this->db->select(\"SELECT password FROM \".PREFIX.\"users WHERE userID=:userID\", array(':userID' => $userID));\n\t\t$db_currpass = $query[0]->password;\n\t\t// Verify Current Password With Database Password\n\t\t$verify_password = \\Helpers\\Password::verify($password, $db_currpass);\n\t\techo $verify_password;\n\t\t// Make sure Password is good to go.\n if (strlen($password) == 0) {\n $auth_error[] = $this->lang['changepass_currpass_empty'];\n } elseif (strlen($password) < MIN_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['changepass_currpass_short'];\n } elseif (strlen($password) > MAX_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['changepass_currpass_long'];\n } elseif (!$verify_password){\n\t\t\t$auth_error[] = $this->lang['changepass_currpass_incorrect'];\n\t\t}\n\t\t// Make sure Email is good\n if (strlen($email) == 0) {\n $auth_error[] = $this->lang['changeemail_email_empty'];\n } elseif (strlen($email) > MAX_EMAIL_LENGTH) {\n $auth_error[] = $this->lang['changeemail_email_long'];\n } elseif (strlen($email) < MIN_EMAIL_LENGTH) {\n $auth_error[] = $this->lang['changeemail_email_short'];\n } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $auth_error[] = $this->lang['changeemail_email_invalid'];\n }\n\n\t\t// Everything looks good. Let user update their password\n if (count($auth_error) == 0) {\n $query = $this->db->select(\"SELECT email FROM \".PREFIX.\"users WHERE userID=:userID\", array(':userID' => $userID));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHANGEEMAIL_FAIL\", \"Username Incorrect ({$userID})\");\n $auth_error[] = $this->lang['changeemail_username_incorrect'];\n return false;\n } else {\n $db_email = $query[0]->email;\n if ($email == $db_email) {\n $this->logActivity($username, \"AUTH_CHANGEEMAIL_FAIL\", \"Old and new email matched ({$email})\");\n $auth_error[] = $this->lang['changeemail_email_match'];\n return false;\n } else {\n $this->db->update(PREFIX.'users', array('email' => $email), array('userID' => $userID));\n $this->logActivity($username, \"AUTH_CHANGEEMAIL_SUCCESS\", \"Email changed from {$db_email} to {$email}\");\n $this->success[] = $this->lang['changeemail_success'];\n return true;\n }\n }\n } else {\n return false;\n }\n }\n\n /**\n * Give the user the ability to change their password if the current password is forgotten\n * by sending email to the email address associated to that user\n * @param string $email\n * @param string $username\n * @param string $key\n * @param string $newpass\n * @param string $verifynewpass\n * @return boolean\n */\n function resetPass($email = '0', $username = '0', $key = '0', $newpass = '0', $verifynewpass = '0') {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $auth_error[] = $this->lang['resetpass_lockedout'];\n $auth_error[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if ($username == '0' && $key == '0') {\n if (strlen($email) == 0) {\n $auth_error[] = $this->lang['resetpass_email_empty'];\n } elseif (strlen($email) > MAX_EMAIL_LENGTH) {\n $auth_error[] = $this->lang['resetpass_email_long'];\n } elseif (strlen($email) < MIN_EMAIL_LENGTH) {\n $auth_error[] = $this->lang['resetpass_email_short'];\n } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $auth_error[] = $this->lang['resetpass_email_invalid'];\n }\n\n $query = $this->db->select(\"SELECT username FROM \".PREFIX.\"users WHERE email=:email\", array(':email' => $email));\n $count = count($query);\n if ($count == 0) {\n $auth_error[] = $this->lang['resetpass_email_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $this->logActivity(\"UNKNOWN\", \"AUTH_RESETPASS_FAIL\", \"Email incorrect ({$email})\");\n $auth_error[] = sprintf($this->lang['resetpass_attempts_remaining'], $remaincount);\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n return false;\n } else {\n $resetkey = $this->randomKey(RANDOM_KEY_LENGTH);\n $username = $query[0]->username;\n $this->db->update(PREFIX.'users', array('resetkey' => $resetkey), array('username' => $username));\n\n //EMAIL MESSAGE USING PHPMAILER\n $mail = new \\Helpers\\PhpMailer\\Mail();\n $mail->setFrom(EMAIL_FROM);\n $mail->addAddress($email);\n $subject = \" \" . SITE_NAME . \" - Password Reset Request\";\n\t\t\t\t\t$mail->subject($subject);\n $body = \"Hello {$username}<br/><br/>\";\n $body .= \"You recently requested a password reset on \" . SITE_NAME . \"<br/>\";\n $body .= \"To proceed with the password reset, please click the following link :<br/><br/>\";\n $body .= \"<b><a href=\\\"\" . DIR . RESET_PASSWORD_ROUTE . \"?username={$username}&key={$resetkey}\\\">Reset My Password</a></b>\";\n\t\t\t\t\t$body .= \"<br><br> You May Copy and Paste this URL in your Browser Address Bar: <br>\";\n\t\t\t\t\t$body .= \" \" . DIR . RESET_PASSWORD_ROUTE . \"?username={$username}&key={$resetkey}\";\n $mail->body($body);\n $mail->send();\n $this->logActivity($username, \"AUTH_RESETPASS_SUCCESS\", \"Reset pass request sent to {$email} ( Key : {$resetkey} )\");\n $this->success[] = $this->lang['resetpass_email_sent'];\n return true;\n }\n } else {\n // if username, key and newpass are provided\n // Reset Password\n if (strlen($key) == 0) {\n $auth_error[] = $this->lang['resetpass_key_empty'];\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n $auth_error[] = $this->lang['resetpass_key_short'];\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n $auth_error[] = $this->lang['resetpass_key_long'];\n }\n if (strlen($newpass) == 0) {\n $auth_error[] = $this->lang['resetpass_newpass_empty'];\n } elseif (strlen($newpass) > MAX_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['resetpass_newpass_long'];\n } elseif (strlen($newpass) < MIN_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['resetpass_newpass_short'];\n } elseif (strstr($newpass, $username)) {\n $auth_error[] = $this->lang['resetpass_newpass_username'];\n } elseif ($newpass !== $verifynewpass) {\n $auth_error[] = $this->lang['resetpass_newpass_nomatch'];\n }\n if (count($auth_error) == 0) {\n $query = $this->db->select(\"SELECT resetkey FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $auth_error[] = $this->lang['resetpass_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $this->logActivity(\"UNKNOWN\", \"AUTH_RESETPASS_FAIL\", \"Username incorrect ({$username})\");\n $auth_error[] = sprintf($this->lang['resetpass_attempts_remaining'], $remaincount);\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n //if reset key ok update pass\n $newpass = $this->hashpass($newpass);\n $resetkey = '0';\n $this->db->update(PREFIX.'users', array('password' => $newpass, 'resetkey' => $resetkey), array('username' => $username));\n $this->logActivity($username, \"AUTH_RESETPASS_SUCCESS\", \"Password reset - Key reset\");\n $this->success[] = $this->lang['resetpass_success'];\n return true;\n } else {\n $auth_error[] = $this->lang['resetpass_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $this->logActivity($username, \"AUTH_RESETPASS_FAIL\", \"Key Incorrect ( DB : {$db_key} / Given : {$key} )\");\n $auth_error[] = sprintf($this->lang['resetpass_attempts_remaining'], $remaincount);\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n return false;\n }\n }\n } else {\n return false;\n }\n }\n }\n }\n\n /**\n * Checks if the reset key is correct for provided username\n * @param string $username\n * @param string $key\n * @return boolean\n */\n function checkResetKey($username, $key) {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $auth_error[] = $this->lang['resetpass_lockedout'];\n $auth_error[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if (strlen($username) == 0) {\n return false;\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($key) == 0) {\n return false;\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n return false;\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n return false;\n } else {\n $query = $this->db->select(\"SELECT resetkey FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHECKRESETKEY_FAIL\", \"Username doesn't exist ({$username})\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHECKRESETKEY_FAIL\", \"Key provided is different to DB key ( DB : {$db_key} / Given : {$key} )\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n }\n }\n }\n }\n }\n\n /**\n * Deletes a user's account. Requires user's password\n * @param string $username\n * @param string $password\n * @return boolean\n */\n function deleteAccount($username, $password) {\n if (strlen($username) == 0) {\n $auth_error[] = $this->lang['deleteaccount_username_empty'];\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n $auth_error[] = $this->lang['deleteaccount_username_long'];\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n $auth_error[] = $this->lang['deleteaccount_username_short'];\n }\n if (strlen($password) == 0) {\n $auth_error[] = $this->lang['deleteaccount_password_empty'];\n } elseif (strlen($password) > MAX_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['deleteaccount_password_long'];\n } elseif (strlen($password) < MIN_PASSWORD_LENGTH) {\n $auth_error[] = $this->lang['deleteaccount_password_short'];\n }\n if (count($auth_error) == 0) {\n\n $query = $this->db->select(\"SELECT password FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_DELETEACCOUNT_FAIL\", \"Username Incorrect ({$username})\");\n $auth_error[] = $this->lang['deleteaccount_username_incorrect'];\n return false;\n } else {\n $db_password = $query[0]->password;\n $verify_password = \\Helpers\\Password::verify($password, $db_password);\n if ($verify_password) {\n $this->db->delete(PREFIX.'users', array('username' => $username));\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n $this->logActivity($username, \"AUTH_DELETEACCOUNT_SUCCESS\", \"Account deleted - Cookies deleted\");\n $this->success[] = $this->lang['deleteaccount_success'];\n return true;\n } else {\n $this->logActivity($username, \"AUTH_DELETEACCOUNT_FAIL\", \"Password incorrect ( DB : {$db_password} / Given : {$password} )\");\n $auth_error[] = $this->lang['deleteaccount_password_incorrect'];\n return false;\n }\n }\n } else {\n return false;\n }\n }\n\n\n public function resendActivation($email) {\n if (!Cookie::get('auth_cookie')) {\n // Input Verification :\n if (strlen($email) == 0) {\n $auth_error[] = $this->lang['register_email_empty'];\n } elseif (strlen($email) > MAX_EMAIL_LENGTH) {\n $auth_error[] = $this->lang['register_email_long'];\n } elseif (strlen($email) < MIN_EMAIL_LENGTH) {\n $auth_error[] = $this->lang['register_email_short'];\n } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $auth_error[] = $this->lang['register_email_invalid'];\n }\n if (count($auth_error) == 0) {\n // Input is valid\n\t\t\t\t// Check DataBase to see if email user is activated\n $query = $this->db->select(\"SELECT * FROM \".PREFIX.\"users WHERE email=:email AND isactive=0\", array(':email' => $email));\n $count = count($query);\n if ($count != 0) {\n\t\t\t\t\t// User Account Is not yet active. Lets get data to resend their activation with new key\n\t\t\t\t\t$username = $query[0]->username;\n\t\t\t\t\t$activekey = $this->randomKey(RANDOM_KEY_LENGTH);\n\t\t\t\t\t// Store the new key in the user's database\n\t\t\t\t\t $this->db->update(PREFIX.'users', array('activekey' => $activekey), array('username' => $username));\n\t\t\t\t\t//EMAIL MESSAGE USING PHPMAILER\n\t\t\t\t\t$mail = new \\Helpers\\PhpMailer\\Mail();\n\t\t\t\t\t$mail->setFrom(EMAIL_FROM);\n\t\t\t\t\t$mail->addAddress($email);\n\t\t\t\t\t$subject = \" \" . SITE_NAME . \" - Account Activation Link\";\n\t\t\t\t\t$mail->subject($subject);\n\t\t\t\t\t$body = \"Hello {$username}<br/><br/>\";\n\t\t\t\t\t$body .= \"You recently registered a new account on \" . SITE_NAME . \"<br/>\";\n\t\t\t\t\t$body .= \"To activate your account please click the following link<br/><br/>\";\n\t\t\t\t\t$body .= \"<b><a href=\\\"\" . DIR . ACTIVATION_ROUTE . \"?username={$username}&key={$activekey}\\\">Activate my account</a></b>\";\n\t\t\t\t\t$body .= \"<br><br> You May Copy and Paste this URL in your Browser Address Bar: <br>\";\n\t\t\t\t\t$body .= \" \" . DIR . ACTIVATION_ROUTE . \"?username={$username}&key={$activekey}\";\n\t\t\t\t\t$body .= \"<br><br> You Requested to have this email resent to your email.\";\n\t\t\t\t\t$mail->body($body);\n\t\t\t\t\t$mail->send();\n\t\t\t\t\t$this->logActivity($username, \"AUTH_REGISTER_SUCCESS\", \"Account created and activation email sent\");\n\t\t\t\t\t$this->success[] = $this->lang['register_success'];\n\t\t\t\t\treturn true;\n }else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n } else {\n //some error\n return false;\n }\n } else {\n // User is logged in\n $auth_error[] = $this->lang['register_email_loggedin'];\n return false;\n }\n }\n\n\n\t/**\n\t * Get current user's ID\n\t */\n\tpublic function getID($username){\n\t\t$data = $this->db->select(\"SELECT userID FROM \".PREFIX.\"users WHERE username = :username\",\n\t\t\tarray(':username' => $username));\n\t\treturn $data[0]->userID;\n\t}\n\n\t/**\n\t * Get username attached to email\n\t */\n\tpublic function getUserNameFromEmail($email){\n\t\t$data = $this->db->select(\"SELECT username FROM \".PREFIX.\"users WHERE email = :email\",\n\t\t\tarray(':email' => $email));\n\t\treturn $data[0]->username;\n\t}\n\n\t/**\n\t * Check to see if email exists in users database\n\t */\n\tpublic function checkIfEmail($email){\n\t\t$query = $this->db->select(\"SELECT * FROM \".PREFIX.\"users WHERE email=:email\", array(':email' => $email));\n\t\t$count = count($query);\n\t\tif ($count != 0) {\n\t\t\t// Email Exists\n\t\t\treturn true;\n\t\t}else{\n\t\t\t// Email Does not exists\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Update given field in users table\n\t */\n\tpublic function updateUser($data,$where){\n\t\t$this->db->update(PREFIX.\"users\",$data,$where);\n\t}\n\n\t/**\n\t * Get Current Session Data\n\t */\n public function user_info(){\n return $this->currentCookieInfo()['uid'];\n }\n\n /**\n \t * Check to see if Current User is Admin\n * @param int $where_id (current user's userID)\n * @return boolean (true/false)\n \t */\n \tpublic function checkIsAdmin($where_id){\n $user_groups = $this->db->select(\"\n SELECT\n groupID\n FROM\n \".PREFIX.\"users_groups\n WHERE\n userID = :userID\n \",\n array(':userID' => $where_id));\n // Make sure user is logged in\n if(isset($where_id)){\n \t// Get user's group status\n \tforeach($user_groups as $user_group_data){\n \t\t$cu_groupID[] = $user_group_data->groupID;\n \t}\n }else{\n $cu_groupID[] = \"0\";\n }\n // Set which group(s) are admin (4)\n if(in_array(4,$cu_groupID)){\n // User is Admin\n return true;\n }else{\n // User Not Admin\n return false;\n }\n \t}\n\n /**\n \t * Check to see if Current User is Admin\n * @param int $where_id (current user's userID)\n * @return boolean (true/false)\n \t */\n \tpublic function checkIsMod($where_id){\n $user_groups = $this->db->select(\"\n SELECT\n groupID\n FROM\n \".PREFIX.\"users_groups\n WHERE\n userID = :userID\n \",\n array(':userID' => $where_id));\n // Make sure user is logged in\n if(isset($where_id)){\n \t// Get user's group status\n \tforeach($user_groups as $user_group_data){\n \t\t$cu_groupID[] = $user_group_data->groupID;\n \t}\n }else{\n $cu_groupID[] = \"0\";\n }\n // Set which group(s) are admin (4)\n if(in_array(3,$cu_groupID)){\n // User is Admin\n return true;\n }else{\n // User Not Admin\n return false;\n }\n \t}\n\n /**\n \t * Check to see if Current User is New User\n * @param int $where_id (current user's userID)\n * @return boolean (true/false)\n \t */\n \tpublic function checkIsNewUser($where_id){\n $user_groups = $this->db->select(\"\n SELECT\n groupID\n FROM\n \".PREFIX.\"users_groups\n WHERE\n userID = :userID\n \",\n array(':userID' => $where_id));\n // Make sure user is logged in\n if(isset($where_id)){\n \t// Get user's group status\n \tforeach($user_groups as $user_group_data){\n \t\t$cu_groupID[] = $user_group_data->groupID;\n \t}\n }else{\n $cu_groupID[] = \"0\";\n }\n // Set which group(s) are admin (4)\n if(in_array(1,$cu_groupID)){\n // User is Admin\n return true;\n }else{\n // User Not Admin\n return false;\n }\n \t}\n\n}", "public function GetPasswordHash ();", "function randomPass($length=10, $chrs = '1234567890qwertyuiopasdfghjklzxcvbnm'){\n for($i = 0; $i < $length; $i++) {\n $pwd .= $chrs{mt_rand(0, strlen($chrs)-1)};\n }\n return $pwd;\n }\n ////////////////////////////////////////////\n // PRIVATE FUNCTIONS\n ////////////////////////////////////////////\n \n /**\n \t* A function that is used to load one user's data\n \t* @access private\n \t* @param string $userID\n \t* @return bool\n */\n function loadUser($userID)\n {\n\t$this->userData = $this->db->get_results(\"SELECT * FROM \".$this->usertable.\" WHERE \".$this->user_id.\" = '\".$this->escape($userID).\"' LIMIT 1\");\n if ( count($res) == 0 )\n \treturn false;\n $this->user_id = $userID;\n $_SESSION[$this->sessionVariable] = $this->userID;\n return true;\n }\n\n /**\n \t* Produces the result of addslashes() with more safety\n \t* @access private\n \t* @param string $str\n \t* @return string\n */ \n function escape($str) {\n $str = get_magic_quotes_gpc()?stripslashes($str):$str;\n $str = $this->db->escape($str);\n return $str;\n }\n \n /**\n \t* Error holder for the class\n \t* @access private\n \t* @param string $error\n \t* @param int $line\n \t* @param bool $die\n \t* @return bool\n */ \n function error($error, $line = '', $die = false) {\n if ( $this->displayErrors )\n \t//echo '<b>Error: </b>'.$error.'<br /><b>Line: </b>'.($line==''?'Unknown':$line).'<br />';\n if ($die) exit;\n return false;\n }\n \n function is_loggedin() {\n \tif(isset($_SESSION)) { \n \t\t$now = time() - $_SESSION['lastaction'];\n \t\tif($now < $this->usrtimeout) \n \t\t\t{\n\t\t\t\t$_SESSION['lastaction'] = time();\n \t\t\t\treturn true; \n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$this->logout();\n \t\t\t\treturn false;\n \t\t\t}\n \t } \n \t else \n \t { \n \t \t$this->logout();\n \t \treturn false;\n \t }\n }\n \n function right($right)\n {\n \tif(!$_SESSION['user_id']) return false;\n \t$user_id = $_SESSION['user_id'];\n \t$user_level = $this->db->get_var('SELECT user_level\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM users\n \t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t WHERE user_id = '.$user_id.';');\n \n \tif(!$user_level) { return false; }\n \n \t$user_right = $this->db->get_var(\"SELECT user_right_value\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM user_rights\n \t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t WHERE user_level = '\".$user_level.\"'\n \t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t \t AND user_right_name = '\".$right.\"';\");\n \t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t \t \n \tif($user_right == '1')\n \t{ return true; }\n \telseif($user_right == '0')\n \t{ return false; }\n \telseif(!$user_right)\n \t{ return false; }\n \telse\n \t{ return $user_right; }\n \t\n \n }\n}", "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}", "function draw_signup($message) { ?>\n <body class=\"loginBody\">\n <section class=\"viewport\">\n <section id=\"signup\" class= \"loginCardStyle nosidebarblockLayout centerCardLayout\">\n <a href=\"../pages/mainpage.php\"><img id=\"logo\" src= \"../img/logo.png\" height=\"90\" width=\"90\"/></a>\n <h2>Welcome to Mel-o!</h2>\n <?php if($message !== \"\") {?>\n <h3><?= $message ?></h3>\n <?php }?>\n\n <form method=\"post\" action=\"../actions/action_signup.php\">\n <input type=\"text\" name=\"username\" placeholder=\"username\" autocomplete=\"new-username\" class=\"inputField\" maxlength=\"15\" required>\n <input type=\"password\" name=\"password\" placeholder=\"password\" autocomplete=\"new-password\" class=\"inputField\" maxlength=\"15\" required>\n <input type=\"password\" name=\"repeat_password\" placeholder=\"repeat password\" autocomplete=\"new-repeat_password\" class=\"inputField\" maxlength=\"15\" required>\n <input type=\"submit\" value=\"Signup\">\n </form>\n\n <footer>\n <p>Already have an account? <a href=\"login.php?message=\">Login!</a></p>\n </footer>\n </section>\n </section>\n<?php }", "public function pwgen()\n\t{\n\t\t// $timetarget = 0.05;\n\t\t// $cost = 8;\n\t\t// do {\n\t\t// \t$cost++;\n\t\t// \t$start = microtime(true);\n\t\t// \tpassword_hash(\"testing\", PASSWORD_BCRYPT, ['cost' => $cost]);\n\t\t// \t$end = microtime(true);\n\t\t// \techo \"{$cost}<br><hr>\";\n\t\t// } while (($end - $start) < $timetarget);\n\t\t// selesai mencari $argon2i$v=19$m=1024,t=2,p=2$czZrU3NmSkwyZWFCZzZqcg$4BCXT3Xjj+nwslQZOa8I2rO760hSmVmzCiSQ/8cfcDs\n\n\t\t$a = password_hash('admin', PASSWORD_ARGON2I);\n\t\techo \"{$a}<br>\";\n\t\t$b = password_verify('superadmin', $a);\n\t\techo \"{$b}\";\n\t\tdie();\n\t}", "public function message() {\n return \"The password format is invalid Your password must be more than 8 characters long, Password should cover at least 3 cases from the following (Password must contain Special Characters - Password must contain Numbers - Password must contain Uppercase - Password must contain Lower case.) \";\n }", "public function run_chg_pass_if()\n\t{\n\t\t$msg='';\n\t\tif(isset($_POST['old_pass']))\n\t\t{\n\t\t\tif(md5($_POST['old_pass'])==$_SESSION['waf_user']['pass'])\n\t\t\t\t{\n\t\t\t\t\tif($_POST['pass']!=$_POST['pass1'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg='Passwords not equal! Try again.';\n\t\t\t\t\t}else{\n\t\t\t\t\t$this->change_password($_SESSION['waf_user']['id'],$_POST['pass']);\n\t\t\t\t\t$msg='Password successfully changed';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t$msg='Old Password wrong! Password not changed';\t\n\t\t\t\t}\n\t\t}\n\t\t$this->error=$msg;\n\t}", "function do_change_password($puuid, &$error, $set_force_reset=false) {\n global $_min_passwd_len;\n global $_passwd_numbers;\n global $_passwd_uperlower;\n global $_passwd_chars;\n\n if($puuid === '') {\n $error = \"No PUUID given\";\n return false;\n }\n\n if($_REQUEST['p1'] === $_REQUEST['p2']) {\n $temparr = array();\n $p = $_REQUEST['p1'];\n\n // do strength test here\n if(strlen($p) < $_min_passwd_len) {\n $error = \"Password too short\";\n return false;\n }\n if($_passwd_numbers && !preg_match('/[0-9]/', $p)) {\n $error = \"Password must contain one or more numbers\";\n return false;\n }\n if($_passwd_uperlower && \n \t(!preg_match('/[A-Z]/', $p) || !preg_match('/[a-z]/', $p))) {\n $error = \"Password must contain both upper case and lower case\";\n return false;\n }\n if($_passwd_chars && \n \t(preg_match_all('/[A-Za-z0-9]/', $p, &$temparr) == strlen($p))) {\n $error = \"Password must contain non-alphanumeric characters\";\n return false;\n }\n\n // we got here, so update password\n $s = \"SELECT distinct passwordtype from password_types\";\n $res = pg_query($s);\n if (!$res) {\n $error = \"DB Error\";\n return false;\n }\n $hashes = pg_fetch_all($res);\n pg_free_result($res);\n\n hpcman_log(\"Updating \".count($hashes).\" password hashes for puuid \".$puuid);\n\n if (!pg_query(\"BEGIN\")) {\n $error = \"Could not begin transaction\";\n return false;\n }\n\n foreach($hashes as $hash) {\n $s = \"UPDATE passwords SET password=$1 \n\tWHERE puuid=$2 AND passwordtype=$3\";\n $passwd = hpcman_hash($hash['passwordtype'], $p);\n $result = pg_query_params($s, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"DB Error\";\n return false;\n }\n\n $acount = pg_affected_rows($result);\n\n if ($acount > 1) {\n $error = \"Error: Too many rows\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n } else if ($acount < 1) {\n hpcman_log(\"Adding new password hash {$hash['passwordtype']} for $puuid\");\n $sql = \"INSERT INTO passwords (password, puuid, passwordtype) VALUES ($1,$2,$3)\";\n $result = pg_query_params($sql, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"Error: Not enough rows; insert failed\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n }\n }\n }\n\n if (!pg_query(\"COMMIT\")) {\n $error = \"DB Error: Commit failed\";\n return false;\n }\n\n if($set_force_reset) {\n $sql = \"UPDATE authenticators SET mustchange='t' \n\tWHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n\t$error = \"DB Error\";\n return false;\n }\n } else {\n $sql = \"UPDATE authenticators SET mustchange='f'\n WHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n $error = \"DB Error\";\n return false;\n }\n }\n } else {\n $error = \"Passwords do not match\";\n return false;\n }\n return true;\n}", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "public function setPW($dw) {}", "public function hash_pword($hashme){\n return password_hash($hashme, PASSWORD_BCRYPT);/* md5(sha1($hashme)) */;\n\n}", "function user_pass_ok($user_login, $user_pass)\n {\n }", "function get_xkcd_password() {\n // Globals\n global $min_words;\n global $add_num;\n global $add_char;\n global $case_opt;\n global $separator;\n global $pages;\n\n unpack_post();\n $words_list = get_words_list($pages);\n $xkcd_password = Array();\n\n for ($i = 1; $i <= $min_words; $i++) {\n $temp_rand_idx = rand(0, count($words_list) - 1);\n array_push($xkcd_password, trim($words_list[$temp_rand_idx]));\n unset($words_list[$temp_rand_idx]);\n }\n\n // Check special conditions\n // Check add num\n if ($add_num) {\n $xkcd_password = add_number($xkcd_password);\n }\n\n // Check add special character\n if ($add_char) {\n $xkcd_password = add_char($xkcd_password);\n }\n\n // Check case\n handle_case($case_opt, $xkcd_password);\n\n return implode($separator, $xkcd_password);\n }", "function testBug11661() \n {\n $sText = <<<SCRIPT\n<?php\nif (empty(\\$user_password) AND empty(\\$user_password2)) {\n \\$user_password = makepass();\n\n } elseif (\\$user_password != \\$user_password2) {\n\n title(_NEWUSERERROR);\n\n OpenTable();\n\n echo '<center><b>'._PASSDIFFERENT.'</b><br /><br />'._GOBACK.'</center>'; \n\n CloseTable();\n\n include_once('footer.php');\n\n die();\n\n } elseif (\\$user_password == \\$user_password2 AND\nstrlen(\\$user_password) < \\$minpass) {\n\n title(_NEWUSERERROR);\n\n OpenTable();\n\n echo '<center>'._YOUPASSMUSTBE.' <b>'.\\$minpass.'</b>' . _CHARLONG . '<br /><br />' . _GOBACK . '</center>';\n\n CloseTable();\n\n include_once ('footer.php');\n\n die();\n\n }\n?>\nSCRIPT;\n\n$this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nif (empty(\\$user_password) AND empty(\\$user_password2)) {\n \\$user_password = makepass();\n} elseif (\\$user_password != \\$user_password2) {\n title(_NEWUSERERROR);\n OpenTable();\n echo '<center><b>' . _PASSDIFFERENT . '</b><br /><br />' . _GOBACK . '</center>';\n CloseTable();\n include_once ('footer.php');\n die();\n} elseif (\\$user_password == \\$user_password2 AND strlen(\\$user_password) < \\$minpass) {\n title(_NEWUSERERROR);\n OpenTable();\n echo '<center>' . _YOUPASSMUSTBE . ' <b>' . \\$minpass . '</b>' . _CHARLONG . '<br /><br />' . _GOBACK . '</center>';\n CloseTable();\n include_once ('footer.php');\n die();\n}\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }" ]
[ "0.6438036", "0.62558967", "0.61295253", "0.6121726", "0.61210936", "0.6062947", "0.6059952", "0.5979305", "0.5888318", "0.58837706", "0.5873613", "0.5859487", "0.5857408", "0.5856617", "0.5851118", "0.5830367", "0.5815613", "0.5815152", "0.58042586", "0.58037555", "0.57853425", "0.57824063", "0.576418", "0.57335323", "0.57316434", "0.57271534", "0.57153225", "0.5706696", "0.5697967", "0.56768", "0.5676166", "0.5676166", "0.56606656", "0.56606203", "0.565637", "0.5628665", "0.5614337", "0.560548", "0.5604131", "0.55999446", "0.559956", "0.5595807", "0.55951", "0.55943525", "0.5591115", "0.5590256", "0.55880815", "0.5574359", "0.55674887", "0.55672956", "0.55639267", "0.55619836", "0.5554416", "0.5554416", "0.55454457", "0.5544775", "0.55352485", "0.5533086", "0.55303466", "0.5493309", "0.5491558", "0.54834276", "0.5480738", "0.5475935", "0.5474655", "0.54727346", "0.54702026", "0.5464881", "0.5461242", "0.54571027", "0.5451041", "0.5451041", "0.5451041", "0.5451041", "0.5451041", "0.5451041", "0.5451041", "0.5442586", "0.5432594", "0.54283863", "0.5413917", "0.5413209", "0.54090023", "0.5408282", "0.5397075", "0.5396901", "0.5395145", "0.53944516", "0.53942627", "0.53925675", "0.53912073", "0.53888685", "0.53885907", "0.5385515", "0.5375779", "0.53743356", "0.53705126", "0.53647345", "0.5361379", "0.5360197" ]
0.58372235
15
$owner = new Role();
public function list() { // $owner->name = 'admin'; // $owner->display_name = 'Project Owner'; // $owner->description = 'User is the owner of a given project'; // $owner->save(); // // $createPost = new Permission(); // $createPost->name = 'create-post'; // $createPost->display_name = 'Create Posts'; // $createPost->description = 'create new blog posts'; // $createPost->save(); // $owner->attachPermission($createPost); // $admin = new Role(); // $admin->name = '222'; // $admin->display_name = 'User Administrator'; // $admin->description = 'User is allowed to manage and edit other users'; // $admin->save(); // // $user = User::where('name', '=', '张洪波')->first(); // // //调用EntrustUserTrait提供的attachRole方法 // $user->attachRole($admin); // 参数可以是Role对象,数组或id // //// // 或者也可以使用Eloquent原生的方法 //// $user->roles()->attach($admin->id); //只需传递id即可 $list = UserRepository::getUserAll(); return view('admin.user.list',compact('list')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->Role = new Role();\n }", "public static function role(): Role\n {\n return new Role;\n }", "public function testCreateRole()\n {\n }", "public function testCreateRole()\n {\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function create()\n\t{\n\t\t// $roles = Role::get();\n\t}", "function roleCreate(Role $role);", "public function __construct()\n {\n $this->repository = new EloquentRoleRepository;\n }", "public function role() {\n return $this->belongsTo('App\\Role');\n }", "public function role(){\n return $this->belongsTo('App\\Role');\n }", "public function role()\n {\n return $this->belongsTo('App\\Role');\n }", "public function role() {\n return $this->belongsTo('App\\Role');\n }", "public function run() {\n\t\tfactory ( Role::class, 10 )->create();\n\t}", "public function role()\n {\n return $this->hasOne('App\\Models\\Role');\n }", "public function getRole() {}", "public function role(){\n return $this->belongsTo(Rol::class);\n }", "public function getRole(){\n return $this->role; \n }", "public function testRole()\n {\n }", "public function get_role()\n {\n }", "public function user_role (){\n return $this->hasOne(Role::class);// relates to role model\n }", "function getRole() {\n\t\treturn 1;\n\t}", "public function __construct()\n {\n $this->user = new User();\n }", "public function role()\n {\n return $this->hasOne('App\\Roles','id','role');\n }", "public function role()\n {\n return $this->belongsTo('Role');\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }", "public function getRole();", "public function getRole();", "public function role() {\n return $this->belongsTo(Role::class);\n }", "public function role() {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\RoleModel', 'role_id');\n }", "public function role()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\RoleModel', 'role_id');\n }", "public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }", "public function role(){\n return $this->belongsTo('App\\Role', 'role-id');\n }", "public function __construct() {\n// $group = new \\App\\Models\\Group;\n// $permission = new \\App\\Models\\Permission;\n// $this->repository = new \\App\\Repositories\\AclRepository($user, $group, $permission);\n// $this->faker = \\Faker\\Factory::create();\n }", "public function run()\n {\n $role=new Role;\n $role->name=\"Super_User\";\n $role->save();\n $role=new Role;\n $role->name=\"User\";\n $role->save();\n }", "public function run()\n {\n $role = new Role();\n $role->type = Role::ROLE_USER;\n $role->save();\n\n $role = new Role();\n $role->type = Role::ROLE_ADMINISTRATOR;\n $role->save();\n }", "function getRole()\n {\n return $this->role;\n }", "public function role()\n {\n return $this->belongsTo(\"App\\Models\\Role\", \"role_id\", \"id\");\n }", "public function run()\n {\n $permission = [1, 2, 3, 4, 5, 6, 7, 8];\n\n $role_employee = new Role();\n $role_employee->name = 'administrator';\n $role_employee->description = 'Administrator';\n $role_employee->save();\n $role_employee->permission()->attach($permission);\n\n $role_employee = new Role();\n $role_employee->name = 'editor';\n $role_employee->description = 'Editor';\n $role_employee->save();\n\n $role_manager = new Role();\n $role_manager->name = 'author';\n $role_manager->description = 'Author';\n $role_manager->save();\n\n $role_manager = new Role();\n $role_manager->name = 'contributor';\n $role_manager->description = 'Contributor';\n $role_manager->save();\n\n $role_manager = new Role();\n $role_manager->name = 'subscriber';\n $role_manager->description = 'Subscriber';\n $role_manager->save();\n\n $role_manager = new Role();\n $role_manager->name = 'customer';\n $role_manager->description = 'Customer';\n $role_manager->save();\n\n $role_manager = new Role();\n $role_manager->name = 'shop_manager';\n $role_manager->description = 'Shop Manager';\n $role_manager->save();\n\n $role_manager = new Role();\n $role_manager->name = 'seo_manager';\n $role_manager->description = 'SEO Manager';\n $role_manager->save();\n\n\n $role_manager = new Role();\n $role_manager->name = 'seo_editor';\n $role_manager->description = 'SEO Editor';\n $role_manager->save();\n\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\Role', 'id', 'role_id');\n }", "public function role()\n {\n return $this->hasOne('Role', 'id', 'role_id');\n }", "function RolesCRUD()\n {\n parent::__construct();\n }", "public function role()\n {\n return $this->belongsTo(Role::class, 'role_id');\n }", "public function role()\n {\n return $this->belongsTo(Role::class, 'role_id');\n }", "public function role()\n {\n return $this->belongsTo(Role::class, 'role_id', 'role_id');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Role');\n }", "public function role()\n {\n return $this->belongsTo('App\\Roles', 'role_id');\n }", "public function __construct()\n {\n $this->user = new User;\n }", "public function testUpdateRole()\n {\n }", "public function testUpdateRole()\n {\n }", "public function __construct(Role $role)\n {\n $this->model = $role;\n }", "function model()\n {\n return 'Modules\\User\\Contracts\\Role';\n }", "function factory(array $data) {\n if(parent::has($data['id'])) {\n $role = parent::get($data['id']);\n $role->_patch($data);\n return $role;\n }\n \n $role = new Role($this->client, $this->guild, $data);\n $this->set($role->id, $role);\n return $role;\n }", "public function Role(){\n return $this->belongsTo('App\\Role','role_id');\n }", "public function getRole() : string;", "public function run()\n {\n $role_client = new Role();\n $role_client->name = 'client';\n $role_client->save();\n\n $role_manager = new Role();\n $role_manager->name = 'manager';\n $role_manager->save();\n }", "public function run()\n {\n $rol = new Role();\n $rol->name =\"normal\";\n $rol->save();\n\n $rol = new Role();\n $rol->name =\"employer\";\n $rol->save();\n\n $rol = new Role();\n $rol->name =\"seeker\";\n $rol->save();\n\n $rol = new Role();\n $rol->name =\"admin\";\n $rol->save();\n\n $rol = new Role();\n $rol->name =\"super\";\n $rol->save();\n }", "public function model(): string\n {\n return Role::class;\n }", "public function setRole($role);", "public function role()\n {\n return $this->hasOne('App\\Models\\UserRoles', 'role_id', 'id');\n }", "public function __construct(Role $role)\n {\n $this->_role = $role;\n parent::__construct(true);\n }", "public function testCreateUser()\n {\n /** @var Role $role */\n// $role = Role::query()->where('name', 'root')->get();\n// $user = User::query()->create([\n// 'name' => 'white',\n// 'email' => '[email protected]',\n// 'password' => '123456',\n// ]);\n// $role = Role::query()->where('id', 1)->get();\n// /** @var Permission $permission */\n// $permission = Permission::query()->where('name','edit articles')->get();\n// /** @var User $user */\n// $user = User::query()->where('name', 'white')->get();\n// $role->givePermissionTo('edit articles');\n// $setRoot = $permission->assignRole('whitess');\n// dd($setRoot);\n }", "function roleFactory()\n {\n return [\n 'factory'=>(new JbRole)\n ];\n }", "public function run()\n {\n //Creiamo i ruoli!\n\n $proprietario = new Role();\n $proprietario->name = 'owner';//notnull - unique\n $proprietario->display_name = 'Utente Proprietario';\n $proprietario->description = 'Utente che affitta appartamenti';\n $proprietario->save();\n\n $ospite = new Role();\n $ospite->name = 'guest';\n $ospite->display_name = 'User Administrator';\n $ospite->description = 'Utente ospite degli appartamenti';\n $ospite->save();\n }", "public function __construct()\n {\n $this->roles = new ArrayCollection();\n }", "function __construct()\n {\n $this ->user = User::createInstance();\n }", "public function __construct()\n {\n $this->user=new User();\n }", "public function __construct()\n {\n $this->Customer = new Customer();\n $this->User = new User();\n }", "public function run()\n {\n $role_admin = new Role();\n $role_admin->name = 'admin';\n $role_admin->description = 'An Admin User';\n $role_admin->save();\n\n $role_contributor = new Role();\n $role_contributor->name = 'contributor';\n $role_contributor->description = 'A Contributor User';\n $role_contributor->save();\n }", "public function getRoleEntityClass();", "public function __construct()\n {\n// var_dump(\"UserName: \".$user->getId());\n// $this->tokenStorage = $tokenStorage;\n// $this->creator = $tokenStorage->getToken()->getUser();\n $this->created = new \\DateTime('now');\n $this->roles = ['ROLE_USER'];\n }", "public function __construct()\n {\n parent::__construct();\n $this->timestamps = FALSE;\n $this->return_as = 'array';\n $this->has_one[\"auth_role\"] = array(\"auth_role\", \"role_id\", \"role_id\"); \n }", "public function __construct()\n {\n $this->userobj = new User();\n }", "public function run()\n {\n $role = new Role();\n $role_admin = $role->where('name', 'admin')->first();\n $role_manager = $role->where('name', 'manager')->first();\n $admin = new User();\n $admin->firstname = 'Danne';\n $admin->lastname = 'Connolly';\n $admin->email = '[email protected]';\n $admin->password = bcrypt('evl@1987');\n $admin->save();\n\n $admin->roles()->attach($role_admin);\n $admin->roles()->attach($role_manager);\n\n $manager = new User();\n $manager->firstname = 'Arjen';\n $manager->lastname = 'Versteeg';\n $manager->email = '[email protected]';\n $manager->password = bcrypt('evl@1987');\n $manager->save();\n\n $manager->roles()->attach($role_manager);\n }", "public function run()\n {\n $administrator_role=new Role();\n $administrator_role->name=\"administrator\";\n $administrator_role->description=\"administrator\";\n $administrator_role->save();\n\n $autenticated_role=new Role();\n $autenticated_role->name=\"authenticated\";\n $autenticated_role->description=\"authenticated\";\n $autenticated_role->save();\n }", "public function getRole(){\n\t\tif (current_user_can('editor')) {\n\t\t\t$this->role_object = get_role('editor');\n\t\t}\n\t}", "public function builder()\n {\n return $this->_role;\n }", "public function builder()\n {\n return $this->_role;\n }", "public function role()\n {\n return $this->belongsTo(EloquentTestRole::class, 'role_id');\n }", "public function __construct()\n {\n $this->roles = [\n \n [\n 'name' => 'administrator',\n 'pengguna' => [\n 'ramdan'\n ],\n 'permissions' => [\n 'anggota-create',\n 'anggota-update',\n 'anggota-delete'\n ]\n ],\n\n ];\n }", "function getName() {\n\t\treturn \"role\";\n\t}", "public function role() {\n\t\treturn $this->has_one('Role_Assignment', 'user_id');\n\t}", "public function assignRole ($name);", "public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}", "public function run()\n {\n $admin = new Role();\n $admin->name = 'Admin';\n $admin->display_name = 'Admin'; // optional\n $admin->description = 'Admin'; // optional\n $admin->save();\n\n $professor = new Role();\n $professor->name = 'Professor';\n $professor->display_name = 'Professor'; // optional\n $professor->description = 'Professor'; // optional\n $professor->save();\n\n $student = new Role();\n $student->name = 'Student';\n $student->display_name = 'Student'; // optional\n $student->description = 'Student'; // optional\n $student->save();\n }", "public function get_role($role)\n {\n }", "public function getRole()\n {\n $res = $this->getEntity()->getRole();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getRole();\n\t\t}\n return $res;\n }", "public function role() //<- role + _id == role_id\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->hasMany('App\\Role', 'role_user');\n }" ]
[ "0.76623523", "0.68590593", "0.6718306", "0.6718306", "0.6416979", "0.6416979", "0.6416979", "0.6416979", "0.6416979", "0.6390909", "0.6389671", "0.6388995", "0.6372483", "0.63427466", "0.6332326", "0.63025516", "0.6280165", "0.62483704", "0.6238576", "0.6223821", "0.6201329", "0.61945784", "0.61706775", "0.61606663", "0.61549324", "0.61521786", "0.61414087", "0.6135205", "0.61275077", "0.61275077", "0.61275077", "0.61275077", "0.61275077", "0.61275077", "0.61275077", "0.61275077", "0.6121207", "0.60852814", "0.60852814", "0.6073204", "0.6073204", "0.6058824", "0.6058824", "0.605798", "0.60517013", "0.60064125", "0.60020626", "0.59931326", "0.59877837", "0.5983753", "0.59790814", "0.5946333", "0.5939948", "0.5921634", "0.5912056", "0.5912056", "0.5902659", "0.5889282", "0.5888675", "0.5873787", "0.587107", "0.587107", "0.5868972", "0.58672255", "0.58660775", "0.5865838", "0.5858802", "0.58584785", "0.58515227", "0.5850951", "0.58455056", "0.584153", "0.58349645", "0.5831478", "0.58270997", "0.58263564", "0.58076483", "0.5804208", "0.5801293", "0.57887137", "0.57833356", "0.5779184", "0.5772072", "0.57652694", "0.5764069", "0.57569647", "0.5750356", "0.5736642", "0.5726448", "0.5726448", "0.5726164", "0.57191765", "0.57149315", "0.5680317", "0.56695724", "0.56652707", "0.56628525", "0.5660711", "0.56529593", "0.5651797", "0.5644918" ]
0.0
-1
Find whether a handled notification code supports categories. (Content types, for example, will define notifications on specific categories, not just in general. The categories are interpreted by the hook and may be complex. E.g. it might be like a regexp match, or like FORUM:3 or TOPIC:100)
public function supports_categories($notification_code) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasCategories() {\n return $this->_has(16);\n }", "public function is_category($category = '')\n {\n }", "function _getNotificationSettingCategories() {\n\t\treturn array(\n\t\t\t'submissions' => array('categoryKey' => 'notification.type.submissions',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_ARTICLE_SUBMITTED, NOTIFICATION_TYPE_METADATA_MODIFIED, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED)),\n\t\t\t'reviewing' => array('categoryKey' => 'notification.type.reviewing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_REVIEWER_COMMENT, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT, NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT)),\n\t\t\t'editing' => array('categoryKey' => 'notification.type.editing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_GALLEY_MODIFIED, NOTIFICATION_TYPE_SUBMISSION_COMMENT, NOTIFICATION_TYPE_LAYOUT_COMMENT, NOTIFICATION_TYPE_COPYEDIT_COMMENT, NOTIFICATION_TYPE_PROOFREAD_COMMENT)),\n\t\t\t'site' => array('categoryKey' => 'notification.type.site',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_USER_COMMENT, NOTIFICATION_TYPE_PUBLISHED_ISSUE, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT)),\n\t\t);\n\t}", "function get_supports() {\n\t\t$supports = array(\n\t\t\t'footer' => 'page footer'\n\t\t);\n\n\t\t$link_categories = get_terms( 'link_category', array(\n\t\t\t\t'hide_empty' => 0\n\t\t\t) );\n\n\t\tforeach ( $link_categories as $link_category ) {\n\t\t\t$supports['link_category_' . $link_category->term_id] = strtolower( $link_category->name );\n\t\t}\n\n\t\treturn $supports;\n\t}", "public function validCategory($data) {\n $categories = $this->categories();\n return array_key_exists(current($data), $categories);\n }", "function vscu_block_categories_callback( $categories = array() ) {\n\n\t$category_slug = 'vs-cgb';\n\t$category_slugs = wp_list_pluck( $categories, 'slug' );\n\n\treturn in_array( $category_slug, $category_slugs, true ) ? $categories : array_merge(\n\t\t$categories,\n\t\tarray(\n\t\t\tarray(\n\t\t\t\t'slug' => $category_slug,\n\t\t\t\t'title' => apply_filters( 'vscgb_gutenberg_block_category', __( 'Vape & Smoke', 'vape-smoke' ) ),\n\t\t\t\t'icon' => 'smiley',\n\t\t\t),\n\t\t)\n\t);\n\n}", "public function hasCategory(): bool;", "public function supportsCourseCatalogNotification() {\n \treturn $this->manager->supportsCourseCatalogNotification();\n\t}", "function vsau_block_categories_callback( $categories = array() ) {\n\n\t$category_slug = 'vs-cgb';\n\t$category_slugs = wp_list_pluck( $categories, 'slug' );\n\n\treturn in_array( $category_slug, $category_slugs, true ) ? $categories : array_merge(\n\t\t$categories,\n\t\tarray(\n\t\t\tarray(\n\t\t\t\t'slug' => $category_slug,\n\t\t\t\t'title' => apply_filters( 'vscgb_gutenberg_block_category', __( 'Vape & Smoke', 'vape-smoke' ) ),\n\t\t\t\t'icon' => 'smiley',\n\t\t\t),\n\t\t)\n\t);\n\n}", "public static function checkCategory($aCont) {\n if(strpos($aCont['layout'], 'nutri') > -1) return TRUE;\n \n $lSql = 'SELECT c.`content_id` FROM `al_cms_ref_category` rc INNER JOIN `al_cms_content` c ON c.content_id=rc.content_id ';\n $lSql.= 'WHERE c.`content`='.esc($aCont['content']).' AND rc.`category`='.esc($aCont['category']).' AND `mand`='.intval(MID);\n $lRes = CCor_Qry::getInt($lSql);\n \n return ($lRes > 0) ? TRUE : FALSE;\n }", "public function isCategory($category): bool;", "public function isInvalidCategoryCode(): bool\n {\n return strpos(\"[CATEGORY-NOT-MATCH]\", trim($this->getBody())) !== false;\n }", "function in_comic_category() {\n\tglobal $post, $category_tree;\n\t\n\t$comic_categories = array();\n\tforeach ($category_tree as $node) {\n\t\t$comic_categories[] = end(explode(\"/\", $node));\n\t}\n\treturn (count(array_intersect($comic_categories, wp_get_post_categories($post->ID))) > 0);\n}", "public function get_categories() {\n\t\t\t\treturn ['trx_addons-support'];\n\t\t\t}", "public function get_categories() {\n\t\t\t\treturn ['trx_addons-support'];\n\t\t\t}", "public function get_categories() {\n\t\t\t\treturn ['trx_addons-support'];\n\t\t\t}", "private function categories()\n\t{\n\t\t$categories = ORM::factory('forum_cat')->find_all();\n\t\tif(0 == $categories->count())\n\t\t\treturn FALSE;\n\t\t\t\n\t\treturn $categories;\n\t}", "function has_category($category = '', $post = \\null)\n {\n }", "function delivery_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'delivery_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'delivery_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so delivery_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so delivery_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "function ppo_categorized_blog() {\n if (false === ( $all_the_cool_cats = get_transient('ppo_category_count') )) {\n // Create an array of all the categories that are attached to posts\n $all_the_cool_cats = get_categories(array(\n 'hide_empty' => 1,\n ));\n\n // Count the number of categories that are attached to the posts\n $all_the_cool_cats = count($all_the_cool_cats);\n\n set_transient('ppo_category_count', $all_the_cool_cats);\n }\n\n if (1 !== (int) $all_the_cool_cats) {\n // This blog has more than 1 category so ppo_categorized_blog should return true\n return true;\n } else {\n // This blog has only 1 category so ppo_categorized_blog should return false\n return false;\n }\n}", "function smart_foundation_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'smart_foundation_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'smart_foundation_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so smart_foundation_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so smart_foundation_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "private function validate_product_categories() {\n\t\tif ( sizeof( $this->product_categories ) > 0 ) {\n\t\t\t$valid_for_cart = false;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $cart_item['product_id'] );\n\n\t\t\t\t\t// If we find an item with a cat in our allowed cat list, the coupon is valid\n\t\t\t\t\tif ( sizeof( array_intersect( $product_cats, $this->product_categories ) ) > 0 ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_APPLICABLE );\n\t\t\t}\n\t\t}\n\t}", "function UnbHookInactiveUsersAddCPCategory(&$data)\r\n{\r\n\tif (UnbCheckRights('is_admin'))\r\n\t{\r\n\t\t$data[] = array(\r\n\t\t\t'title' => '_inactiveusers.cpcategory',\r\n\t\t\t'link' => UnbLink('@cp', 'cat=inactiveusers', true),\r\n\t\t\t'cpcat' => 'inactiveusers');\r\n\t}\r\n\r\n\treturn true;\r\n}", "public function isNotifyTypeAvailableForCategory( $category, $notifyType ) {\n\t\treturn $this->getNotifyTypeAvailabilityForCategory( $category )[$notifyType];\n\t}", "public function supportsCourseNotification() {\n \treturn $this->manager->supportsCourseNotification();\n\t}", "public function get_categories() {\n return [ 'custom-category' ];\n }", "function categoryCheck($cond = array())\n\t{\n\t\t$select = 'addoncategory_id';\n\t\treturn $this->CI->AdminModel->getCondSelectedData($cond,$select,$this->tableName);\n\t}", "function has_categorys()\n\t{\n\t\t\t$categorias = $this->combofiller->categorias();\t\t\t\n\t\t\tforeach($categorias as $key => $value)\n\t\t\t{\n\t\t\t\tif ($this->input->post('' . $key . ''))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn FALSE;\t\n\t}", "function bt_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'hide_empty' => 1,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'all_the_cool_cats', $all_the_cool_cats );\n\t}\n\n\tif ( '1' != $all_the_cool_cats ) {\n\t\t// This blog has more than 1 category so _s_categorized_blog should return true\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so _s_categorized_blog should return false\n\t\treturn false;\n\t}\n}", "public function get_categories()\n {\n return ['akash-addons'];\n }", "private function hasCategoryLinks() {\n\t\tif ( !$this->getSkinOption( self::OPTION_CATEGORIES ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$categoryLinks = $this->getOutput()->getCategoryLinks();\n\n\t\tif ( !count( $categoryLinks ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn !empty( $categoryLinks['normal'] ) || !empty( $categoryLinks['hidden'] );\n\t}", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "function circle_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'circle_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'circle_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so circle_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so circle_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "static function canMatch($cat)\n {\n \tif(User::getCategoryCount($cat) > 9)\n \t\tif(!self::isWeekend(time()))\n \t\t\treturn true;\n \t\telse\n \t\t\treturn false;\n \telse\n \t\treturn false;\n \n }", "public function get_categories()\n {\n return ['hsblog'];\n }", "function have_category() {\n global $categories_index, $discussion, $categories, $categories_count;\n\n $categories_count = count(get_categories());\n $categories = get_categories();\n\n if ($categories && $categories_index + 1 <= $categories_count) {\n $categories_index++;\n return true;\n } else {\n $categories_count = 0;\n return false;\n }\n}", "function list_categories() {\n $project_parent_category = get_category_by_slug('project');\n $project_parent_category_id=$project_parent_category->term_id;\n $categories=get_the_category();\n $count = 0;\n foreach($categories as $category){\n if($category->category_parent==$project_parent_category_id){\n if ($count == 0) {\n echo '<div class=\"category-symbology\">';\n\n if(get_post_type(get_the_id()) == 'discussion') { echo '<i class=\"social-foundicon-chat\"> </i> '; }\n }\n echo \"<a class='one-category' href='/project/\". $category->slug . \"'>\" . $category->name . \"</a>\";\n if ($count == 0) {\n echo '</div>';\n } \n $count++;\n }\n }\n\n //emit a chat symbol for discussion\n if($count == 0 && get_post_type(get_the_id()) == 'discussion') {\n generate_discussion_w_no_category();\n }\n}", "public function supportsTopicNotification() {\n \treturn $this->manager->supportsTopicNotification();\n\t}", "public function isCategoryPage();", "public function checkCategoryType(): array\n {\n $products = array();\n if ($_POST['hammer'] == 'true') {\n $products[] = \"Hammers\";\n }\n if ($_POST['heat'] == 'true') {\n $products[] = \"Heat Guns\";\n }\n if ($_POST['pliers'] == 'true') {\n $products[] = \"Pliers\";\n }\n if ($_POST['screw'] == 'true') {\n $products[] = \"Screwdrivers\";\n }\n if($_POST['span'] == 'true') {\n $products[] = \"Spanners and Wrenches\";\n }\n return $products;\n }", "protected function hook()\n {\n return version_compare(\n Arr::get($GLOBALS, 'wp_version'),\n '5.8-beta0',\n '<'\n ) ? 'block_categories' : 'block_categories_all';\n }", "public function operatorCategoryMatch($categoryToMatch, $categories) : bool {\n\n // make sure that regular expression is ok\n $categoryToMatch = preg_quote($categoryToMatch, '|');\n\n // replace \\* with .* to support wildcards\n $categoryToMatch = str_replace('\\*', '.*', $categoryToMatch);\n\n // iterate over categories on a list and break on first match\n foreach($categories as $category) {\n if (preg_match('|'.$categoryToMatch.'|', $category)){\n return true;\n }\n }\n return false;\n }", "public static function getCategories($conditions='1',&$messages=\"\"){\n $messages=new Message();\n $result=Db::select(CATEGORY_TABLE_NAME,$conditions);\n if($result){\n return $result;\n }\n $messages->setErrorMessage(ERR_GET_CATEGORIES_COLLECTION);\n return false;\n }", "function gravit_categorized_blog() {\r\r\n\tif ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {\r\r\n\t\t// Create an array of all the categories that are attached to posts.\r\r\n\t\t$all_the_cool_cats = get_categories( array(\r\r\n\t\t\t'hide_empty' => 1,\r\r\n\t\t) );\r\r\n\r\r\n\t\t// Count the number of categories that are attached to the posts.\r\r\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\r\r\n\r\r\n\t\tset_transient( 'all_the_cool_cats', $all_the_cool_cats );\r\r\n\t}\r\r\n\r\r\n\tif ( '1' != $all_the_cool_cats ) {\r\r\n\t\t// This blog has more than 1 category so gravit_categorized_blog should return true.\r\r\n\t\treturn true;\r\r\n\t} else {\r\r\n\t\t// This blog has only 1 category so gravit_categorized_blog should return false.\r\r\n\t\treturn false;\r\r\n\t}\r\r\n}", "public static function isCategorical($data) : bool\n {\n return is_string($data);\n }", "public function getCategories()\n\t\t{\n\t\t\t// Set default category in case the user do not have categories with events\n\t\t\t$results = $this->categories;\n\t\t\tasort($results);\n\t\t\t$return = array_unique(array_filter($results));\n\t\t\t\n\t\t\tif(count($return) == 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn $return;\t\n\t\t\t}\n\t\t}", "public function get_categories() {\n\t\treturn [ 'siva-plugins' ];\n\t}", "public function getBuiltinCategories()\n {\n $result = parent::getBuiltinCategories();\n\n // allow adding of adhoc categories\n $result['readonly'] = false;\n\n return $result;\n }", "public function categoryFilter()\n\t{\n\t\tif(!$this->Input->get('cat')) return false;\n\n\t\t$cat = mysql_real_escape_string(urldecode($this->Input->get('cat')));\n\n\t\treturn 'tl_news4ward_article.category=\"'.$cat.'\"';\n\t}", "public function get_categories()\n {\n return ['sipsy'];\n }", "public function isCategoryBalloonEnabled()\n {\n return $this->categoryBalloonEnabled;\n }", "public function get_link_categories() {\n $c = $this->call( 'metaGetLinkCategories' );\n\n return isset( $c->linkCategories ) ? $c->linkCategories : false;\n }", "public function isValidCategory() {\n\t\t$input = file_get_contents('php://input');\n\t\t$_POST = json_decode($input, TRUE);\n\n\t\t// if no splits then category is required otherwise MUST be NULL (will be ignored in Save)\n\t\tif (empty($_POST['splits']) && empty($_POST['category_id'])) {\n\t\t\t$this->form_validation->set_message('isValidCategory', 'The Category Field is Required');\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function findTags(&$body){\n $bodyArray = $this->getBodyArray($body);\n $rep = [\n 'categories:' => '',\n 'category:' => '',\n ', ' => ',',\n \"\\n\" => '',\n \"\\r\" => ''\n ];\n $categories = false;\n foreach($bodyArray as $lines){\n $line = _j::replaceAll($rep, $line);\n if(_j::find(['categories:', 'category:'], $line)){\n $categories = explode(',', $categories);\n $body = str_replace($line, '', $body);\n break;\n }\n }\n return $categories;\n }", "public function supportsTermNotification() {\n \treturn $this->manager->supportsTermNotification();\n\t}", "protected function isCategory()\n {\n return is_null($this->request->task);\n }", "function callbackLoadCategory($hookName, $args) {\n\t\t$category =& $args[0];\n\t\t$plugins =& $args[1];\n\t\tswitch ($category) {\n\t\t\tcase 'blocks':\n\t\t\t\t$this->import('AnnouncementFeedBlockPlugin');\n\t\t\t\t$blockPlugin = new AnnouncementFeedBlockPlugin($this->getName());\n\t\t\t\t$plugins[$blockPlugin->getSeq()][$blockPlugin->getPluginPath()] =& $blockPlugin;\n\t\t\t\tbreak;\n\t\t\tcase 'gateways':\n\t\t\t\t$this->import('AnnouncementFeedGatewayPlugin');\n\t\t\t\t$gatewayPlugin = new AnnouncementFeedGatewayPlugin($this->getName());\n\t\t\t\t$plugins[$gatewayPlugin->getSeq()][$gatewayPlugin->getPluginPath()] =& $gatewayPlugin;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn false;\n\t}", "public function hasCustomerStreamEmotions($categoryId);", "public function getNotifyTypeAvailabilityForCategory( $category ) {\n\t\treturn array_merge(\n\t\t\t$this->defaultNotifyTypeAvailability,\n\t\t\t$this->notifyTypeAvailabilityByCategory[$category] ?? []\n\t\t);\n\t}", "function is_video_category( $term = '' ) {\n return is_tax( 'video_cat', $term );\n }", "public function hasCategory()\n {\n return $this->category !== null;\n }", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function hasCategories()\n {\n return !empty($this->categories);\n }", "public function setCategory() {\n /**\n *\n * @todo make a separate config file for the default category ?!\n */\n $defaultCategory = 1;\n $category = Category::find()->all();\n $newCat = $this->strProcessing($this->category);\n $k = NULL;\n if (!empty($newCat)) {\n foreach ($category as $value) {\n $cat = explode(',', $value['synonyms']);\n $cat = array_map(array($this, 'strProcessing'), $cat);\n $k = array_search($newCat, $cat);\n if ($k !== NULL && $k !== FALSE) {\n $k = $value['id'];\n break;\n }\n }\n }\n if ($k) {\n $this->category = $k;\n } else {\n $this->category = $defaultCategory;\n }\n return TRUE;\n }", "public function supportsTopicCatalog() {\n \treturn $this->manager->supportsTopicCatalog();\n\t}", "public function get_categorys(Context $ctx) {\n $user = $ctx->getUser();\n if($user === null){\n return ResponseHelper::error('Access denied');\n }\n \n $db = $this->connect();\n $dt = new \\DateTime();\n $time_stamp = $dt->getTimestamp();\n $date_now = new \\MongoDate($time_stamp);\n \n // Set an event into array\n $event_lists = [];\n $events = $db->event->find([\n 'build' => 1,\n 'approve' => 1,\n 'date_end' => [ '$gte' => $date_now ]\n ],['date_end']);\n foreach($events as $event){\n $event_lists[] = $event['_id']->{'$id'};\n }\n \n $categories = [];\n $items = $db->tag->find([],['en']);\n foreach($items as $item){\n $item['id'] = $item['_id']->{'$id'};\n $item['name'] = $item['en'];\n \n // sniff status\n $item['sniffed'] = false;\n if(in_array($item['id'], $user['sniff_category'])){\n $item['sniffed'] = true;\n }\n \n // Search an event from event_tag in event(Array)\n $events = $db->event_tag->find(['tag_id' => $item['id']],['event_id']);\n $count_active_event = 0;\n foreach($events as $event){\n if(in_array($event['event_id'], $event_lists)){\n $count_active_event++;\n }\n }\n $item['rows'] = $count_active_event;\n\n // - Default picture\n if(!isset($item['picture'])){\n $item['picture'] = Image::default_category_picture();\n }\n $item['picture'] = Image::load_picture($item['picture']);\n \n unset($item['_id']);\n unset($item['en']);\n \n $categories[] = $item;\n }\n \n $res = [\n 'data' => $categories,\n 'length' => count($categories)\n ];\n \n return $res;\n }", "public function getCategory()\n {\n if (array_key_exists(\"category\", $this->_propDict)) {\n if (is_a($this->_propDict[\"category\"], \"\\Beta\\Microsoft\\Graph\\Model\\WindowsMalwareCategory\") || is_null($this->_propDict[\"category\"])) {\n return $this->_propDict[\"category\"];\n } else {\n $this->_propDict[\"category\"] = new WindowsMalwareCategory($this->_propDict[\"category\"]);\n return $this->_propDict[\"category\"];\n }\n }\n return null;\n }", "private function categoriesGet()\n {\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n//var_dump(__METHOD__, __LINE__, array_keys( $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'points.' ]));\n // RETURN : method is called twice at least\n if ( $this->arrCategories != null )\n {\n return $this->arrCategories;\n }\n // RETURN : method is called twice at least\n // Local array for category labels\n $catLabels = null;\n // Local array for category icons\n $catIcons = null;\n // #54548, 131221, dwildt, 2+\n // Local array for category label css classes\n $catCss = null;\n\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n // Get the field name of the field with the category label\n $fieldForLabel = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'category' ];\n // Get the field name of the field with the category icon\n $fieldForIcon = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n // Get the field name of the field with the category label\n $fieldForLabel = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryTitle' ];\n // #54548, 131221, dwildt, 4+\n // Get the field name of the field with the category label class for a marker category\n $fieldForCssMarker = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryCssMarker' ];\n // Get the field name of the field with the category label class for a path category\n $fieldForCssPath = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryCssPath' ];\n // Get the field name of the field with the category icon\n $fieldForIcon = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Get categories from the rows\n $categoryLabels = array();\n\n // FOREACH row\n foreach ( $this->pObj->rows as $row )\n {\n // RETURN : field for category label is missing\n // 130530, dwildt\n switch ( true )\n {\n case(!$fieldForLabel ):\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'table.field with the category is empty';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'Please use the TypoScript Constant Editor and maintain map.marker.field.category ';\n t3lib_div :: devLog( '[HELP/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 1 );\n }\n // DRS\n //var_dump(__METHOD__, __LINE__, $fieldForLabel);\n $this->arrCategories = array();\n return $this->arrCategories;\n // #47602, 130911, dwildt, 1+\n case(!array_key_exists( $fieldForLabel, $row ) ):\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'current rows doesn\\'t contain the field \"' . $fieldForLabel . '\"';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // DRS\n //var_dump(__METHOD__, __LINE__, $fieldForLabel, array_keys($row), $this->categoriesGetWoLatLon( $row ) );\n // #i0196, 151022, dwildt, 6+\n if ( $this->categoriesGetWoLatLon( $row ) )\n {\n $this->arrCategories = array();\n return $this->arrCategories;\n }\n $row[ $fieldForLabel ] = '';\n break;\n // #i0196, 151022, dwildt, 6+/2-\n //$this->arrCategories = array();\n //return $this->arrCategories;\n // #i0076, 140721, dwildt, +\n case($this->categoriesGetWoLatLon( $row ) ):\n continue 2;\n default:\n // follow the workflow\n }\n // RETURN : field for category label is missing\n // 4.1.7, dwildt, 1-\n //$categoryLabels = array_merge( $categoryLabels, explode( $this->catDevider, $row[ $fieldForLabel ] ) );\n // 4.1.7, dwildt, 10+\n//var_dump( __METHOD__, __LINE__, $this->catDevider, $fieldForLabel, $row[ $fieldForLabel ]);\n//die();\n $catLabelsOfCurrRow = explode( $this->catDevider, $row[ $fieldForLabel ] );\n foreach ( $catLabelsOfCurrRow as $labelKey => $labelValue )\n {\n // #47602, 130911, dwildt, 4+\n if ( empty( $labelValue ) )\n {\n $labelValue = $this->pObj->pi_getLL( 'phrase_noMapCat' );\n // #i0062, 140714, 1+\n $this->arrWoCategories[ 'rows' ][] = $row[ $this->pObj->arrLocalTable[ 'uid' ] ];\n }\n $categoryLabels[] = $labelValue;\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $catIconsOfCurrRow = explode( $this->catDevider, $row[ $fieldForIcon ] );\n $categoryIcons[ $labelValue ] = $catIconsOfCurrRow[ $labelKey ];\n }\n // #54548, 131221, dwildt, 13+\n switch ( true )\n {\n case( isset( $row[ $fieldForCssMarker ] ) ):\n $catCssOfCurrRow = explode( $this->catDevider, $row[ $fieldForCssMarker ] );\n $categoryCss[ $labelValue ] = $catCssOfCurrRow[ $labelKey ];\n break;\n case( isset( $row[ $fieldForCssPath ] ) ):\n $catCssOfCurrRow = explode( $this->catDevider, $row[ $fieldForCssPath ] );\n $categoryCss[ $labelValue ] = $catCssOfCurrRow[ $labelKey ];\n break;\n default;\n break;\n }\n }\n // 4.1.7, dwildt, 10+\n }\n // FOREACH row\n // Get categories from the rows\n // #i0120, 150101, dwildt: 4+\n if ( $this->categoriesEmpty( $categoryLabels ) )\n {\n return false;\n }\n // Remove non unique category labels\n $categoryLabels = array_unique( $categoryLabels );\n//var_dump (__METHOD__, __LINE__, $categoryLabels);\n//var_dump(__METHOD__, __LINE__);\n // Order the category labels\n $orderBy = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'orderBy' ];\n switch ( $orderBy )\n {\n case( 'SORT_REGULAR' ):\n sort( $categoryLabels, SORT_REGULAR );\n break;\n case( 'SORT_NUMERIC' ):\n sort( $categoryLabels, SORT_NUMERIC );\n break;\n case( 'SORT_STRING' ):\n sort( $categoryLabels, SORT_STRING );\n break;\n case( 'SORT_LOCALE_STRING' ):\n sort( $categoryLabels, SORT_LOCALE_STRING );\n break;\n default:\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = 'configuration.categories.orderBy has an unproper value: \"' . $orderBy . '\"';\n t3lib_div :: devLog( '[ERROR/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 3 );\n $prompt = 'categories will ordered by SORT_REGULAR!';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n sort( $categoryLabels, SORT_REGULAR );\n break;\n }\n // Order the category labels\n // Set the keys: keys should correspond with keys of the item colours\n $maxItem = count( $categoryLabels );\n $counter = 0;\n//var_dump(__METHOD__, __LINE__);\n//var_dump(__METHOD__, __LINE__, array_keys($this->confMap));\n foreach ( array_keys( $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'points.' ] ) as $catKey )\n {\n if ( substr( $catKey, -1 ) == '.' )\n {\n continue;\n }\n $catLabels[ $catKey ] = $categoryLabels[ $counter ];\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $catIcons[ $catKey ] = $categoryIcons[ $categoryLabels[ $counter ] ];\n }\n\n // #i0062, 140714, 4+\n if ( $catLabels[ $catKey ] == $this->pObj->pi_getLL( 'phrase_noMapCat' ) )\n {\n $this->arrWoCategories[ 'iconKey' ] = $catKey;\n }\n // #54548, 131221, dwildt, 9+\n switch ( true )\n {\n case( isset( $row[ $fieldForCssMarker ] ) ):\n case( isset( $row[ $fieldForCssPath ] ) ):\n $catCss[ $catKey ] = $categoryCss[ $categoryLabels[ $counter ] ];\n break;\n default;\n break;\n }\n $counter++;\n if ( $counter >= $maxItem )\n {\n break;\n }\n }\n // Set the keys: keys should correspond with keys of the item colours\n\n $this->arrCategories[ 'labels' ] = $catLabels;\n if ( isset( $row[ $fieldForIcon ] ) )\n {\n $this->arrCategories[ 'icons' ] = $catIcons;\n }\n // #54548, 131221, dwildt, 8+\n if ( !empty( $catCss ) )\n {\n $this->arrCategories[ 'cssClass' ] = $catCss;\n }\n//var_dump(__METHOD__, __LINE__);\n\n return $this->arrCategories;\n }", "public function createCategories()\n {\n $value = $this->_config->get('category_settings/create_categories');\n\n if ($value === null) {\n $value = true;\n }\n\n return (bool)$value;\n }", "function pixelgrade_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'pixelgrade_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories(\n\t\t\tarray(\n\t\t\t\t'fields' => 'ids',\n\t\t\t\t'hide_empty' => 1,\n\t\t\t\t// We only need to know if there is more than one category.\n\t\t\t\t'number' => 2,\n\t\t\t)\n\t\t);\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'pixelgrade_categories', $all_the_cool_cats );\n\t}\n\n\t$is_categorized = false;\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so we should return true.\n\t\t$is_categorized = true;\n\t}\n\n\treturn apply_filters( 'pixelgrade_categorized_blog', $is_categorized );\n}", "public function getAvailableInCategories()\n {\n return $this->_getResource()->getAvailableInCategories($this);\n }", "public function get_categories() {\n return [ 'yx-super-cat' ];\n }", "protected static function handle_categories($content) {\n\n\t\t$before = '<?php $catlist = BlogPad::ser_to_list($post[\"categories\"]); foreach( (strpos($catlist, \",\") ? explode(\",\", $catlist): array($catlist) ) as $category): ?>';\n\n\t\t$after = '<?php endforeach; ?>';\n\n\t\tif( BlogPad::has_setting('auto_link', true) ) {\n\t\t\treturn preg_replace('/(.*?){\\- categories \\-}(.*)/', $before.'$1<a href=\"<?php echo Link_Parser::generate_link(\"category\", array(\"word\" => $category));?>\"><?php echo $category;?></a>$2'.$after, $content);\n\t\t}\n\n\t\tpreg_match('/.*?{\\- categories \\-}.*/', $content, $cats);\n\n\t\t$cat = isset($cats[0]) ? $cats[0]: '';\n\n\t\tif( !empty($cat) ) {\n\n\t\t\tif( preg_match('/{\\- category \\-}/', $cat) ) {\n\t\t\t\t$cat = preg_replace('/{\\- categor(ies|y) \\-}/', '<?php echo $category;?>', $cat);\n\t\t\t}\n\n\t\t\t$content = str_replace($cats[0], $before.$cat.$after, $content);\n\t\t}\n\n\t\treturn $content;\n\n\t}", "public function hasCategories()\n {\n return !$this->categories->isEmpty();\n }", "function xmlrpc_getpostcategory($content)\n {\n }", "function exclude_category($category) {\r\n switch($category) {\r\n case 99999:\r\n case 99998:\r\n return true;\r\n }\r\n return false;\r\n }", "function is_movie_category( $term = '' ) {\n return is_tax( 'movie_cat', $term );\n }", "function plugin_itilcategorygroups_check_config() {\n return true;\n}", "public function get_categories()\n {\n return ['super-cat'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "abstract protected function &__xhpCategoryDeclaration()/*: array*/;", "function is_product_category( $term = '' ) {\n\t\treturn is_tax( 'product_cat', $term );\n\t}", "public function isCatSpec()\n {\n return $this->is_cs;\n }", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function use_talks_category( $category_args = array() ) {\n\t\t// It's that simple !!\n\t\t$category_args['taxonomy'] = wct_get_category();\n\n\t\t// Now return these args\n\t\treturn $category_args;\n\t}", "function is_linked_category($category) {\r\n switch($category) {\r\n case 99999:\r\n case 99998:\r\n return true;\r\n }\r\n return false;\r\n }", "private function validate_excluded_product_categories() {\n\t\tif ( sizeof( $this->exclude_product_categories ) > 0 ) {\n\t\t\t$valid_for_cart = false;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $cart_item['product_id'] );\n\n\t\t\t\t\t// If we find an item with a cat NOT in our disallowed cat list, the coupon is valid\n\t\t\t\t\tif ( empty( $product_cats ) || sizeof( array_diff( $product_cats, $this->exclude_product_categories ) ) > 0 ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_APPLICABLE );\n\t\t\t}\n\t\t}\n\t}", "public function get_categories()\n\t{\n\t\treturn array('general');\n\t}", "public function get_categories() {\n\t\treturn [ 'basic' ];\n\t}", "public function getCategory() {\r\n return \\models\\Database::validateData($this->_category, 'string|specialchars|strip_tags');\r\n }", "function createCategories($pg, $categoriesList){\n\t\t$cats = array();\n\t\tforeach($categoriesList as $cat){\n\t\t\tif($cat != 'None'){\n\t\t\t\t$pc = new ProjectCategory($pg);\n\t\t\t\tif ($pc){\n\t\t\t\t\tif (!$pc->create($cat)) {\n\t\t\t\t\t\tdb_rollback();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cats[$cat] = $pc->getID();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$cats['None'] = 100;\n\t\t\t}\n\t\t}\n\t\treturn $cats;\n\t}", "public function findCategories(&$body){\n $bodyArray = $this->getBodyArray($body);\n $rep = [\n 'tags:' => '',\n 'tag:' => '',\n ', ' => ',',\n \"\\n\" => '',\n \"\\r\" => ''\n ];\n $tags = false;\n foreach($bodyArray as $lines){\n $cleanLine = _j::replaceAll($rep, $line);\n if(_j::find(['tags:', 'tag:'], $cleanLine)){\n $tags = explode(',', $cleanLine);\n $body = str_replace($line, '', $body);\n break;\n }\n }\n return $tags;\n }", "private function checkProductCategories()\n {\n $products = Product::with('categories')->get();\n $errors = [];\n foreach ($products as $product) {\n if ($product->categories->count() < 1) {\n $errors[] = sprintf(\n 'The product \"%s (%s)\" has no category set.',\n $product->name,\n $product->id\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }", "public function get_categories() {\n return array( 'apr-core' );\n }", "public function is_registered($category_name)\n {\n }", "function root_categorized_blog() {\n\tif ( false === ( $all_the_cool_cats = get_transient( 'root_categories' ) ) ) {\n\t\t// Create an array of all the categories that are attached to posts.\n\t\t$all_the_cool_cats = get_categories( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'hide_empty' => 1,\n\t\t\t// We only need to know if there is more than one category.\n\t\t\t'number' => 2,\n\t\t) );\n\n\t\t// Count the number of categories that are attached to the posts.\n\t\t$all_the_cool_cats = count( $all_the_cool_cats );\n\n\t\tset_transient( 'root_categories', $all_the_cool_cats );\n\t}\n\n\tif ( $all_the_cool_cats > 1 ) {\n\t\t// This blog has more than 1 category so root_categorized_blog should return true.\n\t\treturn true;\n\t} else {\n\t\t// This blog has only 1 category so root_categorized_blog should return false.\n\t\treturn false;\n\t}\n}", "function callbackLoadCategory($hookName, $args) {\n\t\t$category =& $args[0];\n\t\t$plugins =& $args[1];\n\t\tswitch ($category) {\n\t\t\tcase 'blocks':\n\t\t\t\t$this->import('ThesisFeedBlockPlugin');\n\t\t\t\t$blockPlugin = new ThesisFeedBlockPlugin($this->getName());\n\t\t\t\t$plugins[$blockPlugin->getSeq()][$blockPlugin->getPluginPath()] =& $blockPlugin;\n\t\t\t\tbreak;\n\t\t\tcase 'gateways':\n\t\t\t\t$this->import('ThesisFeedGatewayPlugin');\n\t\t\t\t$gatewayPlugin = new ThesisFeedGatewayPlugin($this->getName());\n\t\t\t\t$plugins[$gatewayPlugin->getSeq()][$gatewayPlugin->getPluginPath()] =& $gatewayPlugin;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.5860655", "0.5794245", "0.5691196", "0.5650265", "0.56381476", "0.5637379", "0.5634113", "0.560038", "0.5579383", "0.55618674", "0.55477655", "0.55303836", "0.55199057", "0.5513825", "0.5513825", "0.5513825", "0.53819495", "0.53174084", "0.52835166", "0.52485025", "0.52383476", "0.52302235", "0.5194545", "0.516674", "0.5160931", "0.51607853", "0.51446754", "0.51300764", "0.51133555", "0.5106788", "0.5106782", "0.50905216", "0.5087807", "0.50627136", "0.5055253", "0.5051678", "0.5027746", "0.50260246", "0.50257", "0.50211614", "0.5011446", "0.5001084", "0.49889514", "0.49805295", "0.49637643", "0.4955956", "0.49554893", "0.49359792", "0.4925919", "0.49183768", "0.49126083", "0.49080917", "0.48979685", "0.48919275", "0.48912776", "0.48868033", "0.4883031", "0.48711196", "0.4869469", "0.48667842", "0.48666775", "0.4863478", "0.4863478", "0.4863478", "0.48622438", "0.48616496", "0.4848634", "0.484677", "0.48464942", "0.48362455", "0.4827747", "0.48269516", "0.48202938", "0.48184192", "0.48180744", "0.48151433", "0.47977084", "0.4796599", "0.47842854", "0.47784993", "0.47758928", "0.47734404", "0.47734404", "0.4772041", "0.47688228", "0.47664052", "0.47660795", "0.47646204", "0.47611162", "0.47601667", "0.47578698", "0.47570288", "0.47432092", "0.4738191", "0.4733107", "0.47211492", "0.471675", "0.47160456", "0.47123978", "0.47102997" ]
0.72142065
0
Standard function to create the standardised category tree
public function create_category_tree($notification_code, $id) { require_code('files2'); $path = get_custom_file_base() . '/uploads/filedump'; if (!is_null($id)) { $path .= '/' . $id; } $files = get_directory_contents($path, '', false, false); if (count($files) > 30) { return array(); // Too many, so don't show } $page_links = array(); foreach ($files as $file) { if (is_dir($path . '/' . $file)) { $page_links[] = array( 'id' => (($id == '') ? '' : ($id . '/')) . $file, 'title' => $file, 'child_count' => count($this->create_category_tree($notification_code, (($id == '') ? '' : ($id . '/')) . $file)), ); } } return $page_links; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "function getCategoryTree($db) {\n // Make Category Tree\n $query = \"SELECT `COMPLAINT_TYPE`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $category['name'] = trim($row[\"COMPLAINT_TYPE\"], ' /');\n $category['COMPLAINT_TYPE'] = $row[\"COMPLAINT_TYPE\"];\n $category['slug'] = slugify($category['name']);\n $category['count'] = $row[\"COUNT(*)\"];\n if( $category['slug'] != 'n-a' && $category['slug'] != 'select-one' && $category['slug'] != 'other' ){\n $topCategories[$category['slug']]=$category;\n }\n }\n\n $query = \"SELECT `COMPLAINT_TYPE`, `DESCRIPTOR`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE`, `DESCRIPTOR` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $subCategory['name'] = trim($row[\"DESCRIPTOR\"], ' /');\n $subCategory['DESCRIPTOR'] = $row[\"DESCRIPTOR\"];\n $subCategory['slug'] = slugify($subCategory['name']);\n $subCategory['count'] = $row[\"COUNT(*)\"];\n if(\n trim($row['COMPLAINT_TYPE']) != ''\n && $subCategory['slug'] != 'n-a'\n && $subCategory['slug'] != 'select'\n ){\n $topCategories[slugify($row['COMPLAINT_TYPE'])]['subCategories'][$subCategory['slug']]=$subCategory;\n }\n }\n\n return $topCategories;\n}", "function generate_categories($keys=false,$current=null,$leaf=null,$depth=0) {\n \n \n return ($out);\n }", "function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}", "public static function getCategoryTree() {\n $catModel = new \\App\\Category();\n $catTree = $catModel->getCategoryTree();\n return $catTree;\n }", "function getCategoryHierarchyAsArray()\n{\n return array\n (\n array\n (\n 'idString' => '1' ,\n 'idParentString' => null ,\n 'name' => 'Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1' ,\n 'idParentString' => '1' ,\n 'name' => 'Cons',\n 'children' => array\n (\n array('idString' => '1-1-1', 'idParentString' => '1-1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-1-2', 'idParentString' => '1-1', 'name' => 'ConsultingB', 'children' => array()),\n array('idString' => '1-1-3', 'idParentString' => '1-1', 'name' => 'Management ', 'children' => array()),\n array\n (\n 'idString' => '1-1-4' ,\n 'idParentString' => '1-1' ,\n 'name' => 'More Categories',\n 'children' => array\n (\n array('idString' => '1-1-4-1', 'idParentString' => '1-1-4', 'name' => 'Cat1', 'children' => array()),\n array('idString' => '1-1-4-2', 'idParentString' => '1-1-4', 'name' => 'Cat2', 'children' => array()),\n array\n (\n 'idString' => '1-1-4-3' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Still more categories',\n 'children' => array\n (\n array\n (\n 'idString' => '1-1-4-3-1',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatA' ,\n 'children' => array()\n ),\n array\n (\n 'idString' => '1-1-4-3-2',\n 'idParentString' => '1-1-4-3' ,\n 'name' => 'CatB' ,\n 'children' => array()\n )\n )\n ),\n array\n (\n 'idString' => '1-1-4-4' ,\n 'idParentString' => '1-1-4' ,\n 'name' => 'Category 3',\n 'children' => array()\n )\n )\n )\n )\n ),\n array('idString' => '1-2', 'idParentString' => '1', 'name' => 'ConsultingA', 'children' => array()),\n array('idString' => '1-3', 'idParentString' => '1', 'name' => 'ConsultingB', 'children' => array())\n )\n ),\n array\n (\n 'idString' => '2' ,\n 'idParentString' => null ,\n 'name' => 'Not Approved',\n 'children' => array\n (\n array\n (\n 'idString' => '2-1' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 1',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-2' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 2',\n 'children' => array()\n ),\n array\n (\n 'idString' => '2-3' ,\n 'idParentString' => '2' ,\n 'name' => 'Consulting - 3',\n 'children' => array()\n )\n )\n )\n );\n}", "public function getTree()\n {\n return HandbookCategory::all()->toTree();\n }", "public function getCategoryTree() {\n $categories = TableRegistry::get('Categories');\n\n $first_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'slug'\n ])->where([\n 'level' => '0',\n 'status' => '1'\n ])->toArray();\n\n $second_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '1',\n 'status' => '1'\n ])->toArray();\n\n $second_category_array = array();\n\n foreach ($second_level_categories as $second_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($second_category_array [$second_category ['parent_id']]))\n $second_category_array [$second_category ['parent_id']] = array();\n $second_category_array [$second_category ['parent_id']] [] = $second_category;\n }\n\n $third_level_categories = $categories->find()->select([\n 'id',\n 'title',\n 'parent_id',\n 'slug'\n ])->where([\n 'level' => '2',\n 'status' => '1'\n ])->toArray();\n\n $third_category_array = array();\n\n foreach ($third_level_categories as $third_category) {\n // $second_category_array[$second_category['parent_id']] = array();\n if (!is_array($third_category_array [$third_category ['parent_id']]))\n $third_category_array [$third_category ['parent_id']] = array();\n $third_category_array [$third_category ['parent_id']] [] = $third_category;\n }\n\n return [\n $first_level_categories,\n $second_category_array,\n $third_category_array\n ];\n }", "function tep_make_cat_dmlist($rootcatid = 0, $maxlevel = 0){\n\n global $cPath_array, $show_full_tree, $languages_id;\n\t\t\n global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id;\n\n // Modify category query if not fetching all categories (limit to root cats and selected subcat tree)\n\t\tif (!$show_full_tree) {\n $parent_query\t= 'AND (c.parent_id = \"0\"';\t\n\t\t\t\t\n\t\t\t\tif (isset($cPath_array)) {\n\t\t\t\t\n\t\t\t\t $cPath_array_temp = $cPath_array;\n\t\t\t\t\n\t\t\t\t foreach($cPath_array_temp AS $key => $value) {\n\t\t\t\t\t\t $parent_query\t.= ' OR c.parent_id = \"'.$value.'\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tunset($cPath_array_temp);\n\t\t\t\t}\t\n\t\t\t\t\n $parent_query .= ')';\t\t\t\t\n\t\t} else {\n $parent_query\t= '';\t\n\t\t}\t\t\n\n\t\t$result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id=\"' . (int)$languages_id .'\" '.$parent_query.'order by sort_order, cd.categories_name');\n \n\t\twhile ($row = tep_db_fetch_array($result)) {\t\t\t\t\n $table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];\n }\n\n $output .= tep_make_cat_dmbranch($rootcatid, $table, 0, $maxlevel);\n\n return $output;\n}", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\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\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\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}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "function categories($prefix_subcategories = true)\n{\n $temp = [];\n $temp['01-00'] = 'Arts';\n $temp['01-01'] = 'Design';\n $temp['01-02'] = 'Fashion & Beauty';\n $temp['01-03'] = 'Food';\n $temp['01-04'] = 'Books';\n $temp['01-05'] = 'Performing Arts';\n $temp['01-06'] = 'Visual Arts';\n\n $temp['02-00'] = 'Business';\n $temp['02-02'] = 'Careers';\n $temp['02-03'] = 'Investing';\n $temp['02-04'] = 'Management';\n $temp['02-06'] = 'Entrepreneurship';\n $temp['02-07'] = 'Marketing';\n $temp['02-08'] = 'Non-Profit';\n\n $temp['03-00'] = 'Comedy';\n $temp['03-01'] = 'Comedy Interviews';\n $temp['03-02'] = 'Improv';\n $temp['03-03'] = 'Stand-Up';\n\n $temp['04-00'] = 'Education';\n $temp['04-04'] = 'Language Learning';\n $temp['04-05'] = 'Courses';\n $temp['04-06'] = 'How To';\n $temp['04-07'] = 'Self-Improvement';\n\n $temp['20-00'] = 'Fiction';\n $temp['20-01'] = 'Comedy Fiction';\n $temp['20-02'] = 'Drama';\n $temp['20-03'] = 'Science Fiction';\n\n $temp['06-00'] = 'Government';\n\n $temp['30-00'] = 'History';\n\n $temp['07-00'] = 'Health & Fitness';\n $temp['07-01'] = 'Alternative Health';\n $temp['07-02'] = 'Fitness';\n // $temp['07-03'] = 'Self-Help';\n $temp['07-04'] = 'Sexuality';\n $temp['07-05'] = 'Medicine';\n $temp['07-06'] = 'Mental Health';\n $temp['07-07'] = 'Nutrition';\n\n $temp['08-00'] = 'Kids & Family';\n $temp['08-01'] = 'Education for Kids';\n $temp['08-02'] = 'Parenting';\n $temp['08-03'] = 'Pets & Animals';\n $temp['08-04'] = 'Stories for Kids';\n\n $temp['40-00'] = 'Leisure';\n $temp['40-01'] = 'Animation & Manga';\n $temp['40-02'] = 'Automotive';\n $temp['40-03'] = 'Aviation';\n $temp['40-04'] = 'Crafts';\n $temp['40-05'] = 'Games';\n $temp['40-06'] = 'Hobbies';\n $temp['40-07'] = 'Home & Garden';\n $temp['40-08'] = 'Video Games';\n\n $temp['09-00'] = 'Music';\n $temp['09-01'] = 'Music Commentary';\n $temp['09-02'] = 'Music History';\n $temp['09-03'] = 'Music Interviews';\n\n $temp['10-00'] = 'News';\n $temp['10-01'] = 'Business News';\n $temp['10-02'] = 'Daily News';\n $temp['10-03'] = 'Entertainment News';\n $temp['10-04'] = 'News Commentary';\n $temp['10-05'] = 'Politics';\n $temp['10-06'] = 'Sports News';\n $temp['10-07'] = 'Tech News';\n\n $temp['11-00'] = 'Religion & Spirituality';\n $temp['11-01'] = 'Buddhism';\n $temp['11-02'] = 'Christianity';\n $temp['11-03'] = 'Hinduism';\n $temp['11-04'] = 'Islam';\n $temp['11-05'] = 'Judaism';\n $temp['11-06'] = 'Religion';\n $temp['11-07'] = 'Spirituality';\n\n $temp['12-00'] = 'Science';\n $temp['12-01'] = 'Medicine';\n $temp['12-02'] = 'Natural Sciences';\n $temp['12-03'] = 'Social Sciences';\n $temp['12-04'] = 'Astronomy';\n $temp['12-05'] = 'Chemistry';\n $temp['12-06'] = 'Earth Sciences';\n $temp['12-07'] = 'Life Sciences';\n $temp['12-08'] = 'Mathematics';\n $temp['12-09'] = 'Nature';\n $temp['12-10'] = 'Physics';\n\n $temp['13-00'] = 'Society & Culture';\n // $temp['13-01'] = 'History';\n $temp['13-02'] = 'Personal Journals';\n $temp['13-03'] = 'Philosophy';\n $temp['13-04'] = 'Places & Travel';\n $temp['13-05'] = 'Relationships';\n $temp['13-06'] = 'Documentary';\n\n $temp['14-00'] = 'Sports';\n $temp['14-05'] = 'Baseball';\n $temp['14-06'] = 'Basketball';\n $temp['14-07'] = 'Cricket';\n $temp['14-08'] = 'Fantasy Sports';\n $temp['14-09'] = 'Football';\n $temp['14-10'] = 'Golf';\n $temp['14-11'] = 'Hockey';\n $temp['14-12'] = 'Rugby';\n $temp['14-13'] = 'Running';\n $temp['14-14'] = 'Soccer';\n $temp['14-15'] = 'Swimming';\n $temp['14-16'] = 'Tennis';\n $temp['14-17'] = 'Volleyball';\n $temp['14-18'] = 'Wilderness';\n $temp['14-19'] = 'Wrestling';\n\n $temp['15-00'] = 'Technology';\n\n $temp['50-00'] = 'True Crime';\n\n $temp['16-00'] = 'TV & Film';\n $temp['16-01'] = 'After Shows';\n $temp['16-02'] = 'Film History';\n $temp['16-03'] = 'Film Interviews';\n $temp['16-04'] = 'Film Reviews';\n $temp['16-05'] = 'TV Reviews';\n\n if ($prefix_subcategories) {\n foreach ($temp as $key => $val) {\n $parts = explode('-', $key);\n $cat = $parts[0];\n $subcat = $parts[1];\n\n if ($subcat != '00') {\n $temp[$key] = $temp[$cat.'-00'].' > '.$val;\n }\n }\n }\n\n return $temp;\n}", "public function treeDataProvider()\n {\n $catData = [\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ],\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ],\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ],\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ],\n [\n 'id' => 'cat422',\n 'active' => true,\n 'sort' => 1,\n 'left' => 6,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ],\n [\n 'id' => 'cat5',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n [\n 'id' => 'cat6',\n 'active' => true,\n 'sort' => 1,\n 'left' => 9,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ],\n ];\n\n $data = [];\n foreach ($catData as $category) {\n $data[$category['id']] = $this->buildCategory($category);\n }\n\n return [['data' => $data]];\n }", "function get_categories($params=''){\n $sql = ('SELECT id, name, parentid, level FROM categories ORDER BY name');\n $cat_array = $this->db->query($sql)->result_array();\n \n //this will generate html output - probably faster, but html code is out of templates!!!\n //$output_html = $this->generate_list_html(\"-1\",$cat_array);\n \n //this is slower method, but no html code in php\n //for this option, smarty modifier(compiler) need to be installed(compiler.defun.php)\n $arr = array();\n if(!empty($params['catId']) && $params['catId'] > 0){\t\t\n //generate top category, because it is not back from recursion function \t\n $this->CreateNestedArray($cat_array, $arr, $params['catId'], 0, 20);\n $arr2[0] = $this->get_category($params['catId']);\n $arr2[0]['children'] = $arr;\n return $arr2;\n }else{\n //get all categories\n $this->CreateNestedArray($cat_array, $arr, \"-1\", 0, 20);\n return $arr;\n }\n \n return;\n }", "static public function getCategoryTree() {\n $rows = self::find()\n ->where(['!=', 'id', 1]) // exclude root category\n ->andWhere(['=', 'status', self::STATUS_SHOW]) // exclude hidden\n ->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC])\n ->all();\n \n // build tree\n $result = [];\n $last_parent_id = null;\n foreach($rows as $row) {\n if($row['depth'] == 1) { // parent\n $last_parent_id = $row['id'];\n $result[$last_parent_id] = [\n 'parent' => $row,\n 'childs' => []\n ];\n\n continue;\n }\n\n // childs\n $result[$last_parent_id]['childs'][$row->id] = $row;\n }\n return $result;\n }", "public function buildTree($selected_cat = 0)\n\t{\n\t\t//Save the origin dataset category_id\n\t\t$this->_dataset_stored_category_id = $selected_cat;\n\t\n\t\tif ($selected_cat=='' || $selected_cat==0)\n\t\t{\n\t\t\t$cat_array = array(\n\t\t\t\t\t\t'text'=>'eBay',\n\t\t\t\t\t\t'id'=>'1',\n\t\t\t\t\t\t'path'=>'1',\n\t\t\t\t\t\t'cls'=>'folder active-category',\n\t\t\t\t\t\t'children' => $this->_addChildren(null)\n\t\t\t\t\t\t);\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cat_array = $this->_buildRecursiveTree($selected_cat);\n\t\t}\t\n\t\t\n\t\treturn $cat_array;\t\t\n\t}", "function walk_category_tree(...$args)\n {\n }", "function createTree($categories)\n{\n $tree = [];\n\n foreach ($categories as $category) {\n if (empty($category[\"parent_uid\"])) {\n $tree[] = $category;\n unset($category);\n }\n }\n\n // уровень вложенности 2\n foreach ($tree as &$itemTree) {\n foreach ($categories as $category) {\n /* if(!empty($category[\"parent_uid\"])) {\n print_r($itemTree);\n print_r($category);\n echo \"\\n\";\n echo \"tree:\\n\";\n print_r($itemTree[\"uid\"]);\n echo \"\\n category\";\n print_r($category[\"parent_uid\"]);\n exit();\n }*/\n if ($itemTree[\"uid\"] == $category[\"parent_uid\"]) {\n $itemTree[\"categories\"] = $category;\n unset($category);\n }\n }\n }\n\n return $tree;\n}", "function createCategoryOption($sourceArray, $seletedId ='')\r\n{\r\n function recursiveCategory($source, $parent, $level, &$newArray)\r\n {\r\n if (count($source) > 0) {\r\n foreach ($source as $key => $value) {\r\n if ($value['parent'] == $parent) {\r\n $value['level'] = $level;\r\n $newArray[] = $value;\r\n unset($source[$key]);\r\n $newParent = $value['id'];\r\n recursiveCategory($source, $newParent, $level + 1, $newArray);\r\n }\r\n }\r\n }\r\n }\r\n\r\n $output = '';\r\n $arrayMenu = [];\r\n\r\n recursiveCategory($sourceArray, 0, 1, $arrayMenu);\r\n foreach ($arrayMenu as $key => $value) { \r\n $seleted = (!!$seletedId && ($value['id'] == $seletedId)) ? 'selected ' : '' ;\r\n\r\n if ($value['level'] == 1) {\r\n $output .= '<option ' . $seleted . ' value=\"' . $value['id'] . '\">' . $value['name'] . '</option>';\r\n } \r\n else \r\n {\r\n $name = str_repeat('&nbsp;', ($value['level'] - 1) * 5) . '-' . $value['name'];\r\n $output .= '<option ' . $seleted . ' value=\"' . $value['id'] . '\">' . $name . '</option>';\r\n }\r\n }\r\n return $output;\r\n}", "function getTreeCats2($order, $ordering, $category_id, $categories_id, &$categories, $level){\n++$level;\n$cat = &JTable::getInstance('category', 'jshop');\n$cat->category_id = $category_id;\n$cats = $cat->getChildCategories($order, $ordering);\nforeach($cats as $key=>$value){\n$cats[$key]->level = $level;\n$categories[] = $value;\njShopCategoriesHelper::getTreeCats2($order, $ordering, $value->category_id, $categories_id, $categories, $level);\n}\n}", "function get_cat_structure($cat_id = 0, $level = 0, $prefix = '', $prefix_id = '')\n{\n global $ce_cache, $config, $db_prefix;\n $cat_sort = $ce_cache['cat_sort'];\n $exists = false;\n\n if (!isset($ce_cache['cat_structure_html'])) {\n $ce_cache['cat_structure_html'] = '';\n }\n $res = sql_query(\"SELECT * FROM \".$db_prefix.\"product_cat WHERE parent_id='$cat_id' ORDER BY FIELD(idx,$cat_sort)\");\n while ($row = sql_fetch_array($res)) {\n if (!$exists) {\n if ($level == 0) {\n $ce_cache['cat_structure_html'] .= str_repeat(\"\\t\", $level).\"<ul id=\\\"myID\\\" class=\\\"myCLASS\\\">\\n\";\n } else {\n $ce_cache['cat_structure_html'] .= str_repeat(\"\\t\", $level).\"<ul>\\n\";\n }\n $exists = true;\n }\n\n $path = (empty($prefix)) ? $row['cat_name'] : strip_tags($prefix).' &raquo; '.$row['cat_name'];\n $path_id = (empty($prefix_id)) ? $row['idx'] : $prefix_id.','.$row['idx'];\n $ce_cache['cat_structure'][$row['idx']] = $path;\n if (!$level) {\n $ce_cache['cat_structure_top'][$row['idx']] = $row['cat_name'];\n }\n if ($config['enable_adp'] && $row['permalink']) {\n $row['url'] = $config['site_url'].'/'.$row['permalink'];\n } else {\n $row['url'] = \"$config[site_url]/shop_search.php?cat_id=$row[idx]\";\n }\n $path_link = (empty($prefix)) ? \"<a href=\\\"$row[url]\\\">$row[cat_name]</a>\" : $prefix.' &raquo; '.\"<a href=\\\"$row[url]\\\">$row[cat_name]</a>\";\n $ce_cache['cat_name_def'][$row['idx']] = $row['cat_name'];\n $ce_cache['cat_url'][$row['idx']] = $row['url'];\n $ce_cache['cat_structure_link'][$row['idx']] = $path_link;\n $ce_cache['cat_structure_id'][$row['idx']] = $path_id;\n $ce_cache['cat_permalink_def'][$row['idx']] = $row['permalink'];\n $ce_cache['cat_structure_html'] .= str_repeat(\"\\t\", $level + 1).\"<li><a href=\\\"$row[url]\\\">$row[cat_name]</a>\\n\";\n get_cat_structure($row['idx'], $level+1, $path_link, $path_id);\n }\n if ($exists) {\n $ce_cache['cat_structure_html'] .= str_repeat(\"\\t\", $level).\"</ul>\\n\";\n }\n}", "function categoryTree($id_parent= 0,$sub_mark =''){\n global $db;\n $query = $db->query(\"SELECT * FROM category WHERE id_parent = $id_parent ORDER BY name DESC \" );\n \n if ($query->num_rows > 0){\n while ($row = $query-> fetch_assoc()){\n \n echo '<option value=\"'.$row['id_c'].'\">'.$sub_mark.$row['name'].'</option>';\n \n categoryTree($row['id_c'],$sub_mark.'---');\n }\n \n }\n }", "public function build_category_tree($output, $preselected, $parent=0, $indent=''){\t\n $this->db->select('category_id,category_name,parentid');\n $this->db->where('parentid',$parent); \n $sql = $this->db->get('category'); \n \n foreach ($sql->result_array() as $c)\n {\n $selected = ($c[\"category_id\"] == $preselected) ? \"selected=\\\"selected\\\"\" : \"\";\n $output .= \"<option value=\\\"\" . $c[\"category_id\"] . \"\\\" \" . $selected . \">\" . $indent . $c[\"category_name\"] . \"</option>\";\n if($c[\"category_id\"] != $parent){\n $this->crud_model->build_category_tree($output, $preselected, $c[\"category_id\"], $indent . \"&nbsp;&nbsp;\");\n } \n }\n return $sql->result_array();\n}", "function pico_sync_cattree($mydirname)\n{\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\t// rebuild tree informations\n\tlist($tree_array, $subcattree, $contents_total, $subcategories_total, $subcategories_ids_cs) = pico_makecattree_recursive($mydirname, 0);\n\t//array_shift( $tree_array ) ;\n\t$paths = [];\n\t$previous_depth = 0;\n\n\tif (!empty($tree_array)) foreach ($tree_array as $key => $val) {\n\t\t// build the absolute path of the category\n\t\t$depth_diff = $val['depth'] - $previous_depth;\n\t\t$previous_depth = $val['depth'];\n\t\tif ($depth_diff > 0) {\n\t\t\tfor ($i = 0; $i < $depth_diff; $i++) {\n\t\t\t\t$paths[$val['cat_id']] = $val['cat_title'];\n\t\t\t}\n\t\t} else if (0 !== $val['cat_id']) {\n\t\t\tfor ($i = 0; $i < -$depth_diff + 1; $i++) {\n\t\t\t\tarray_pop($paths);\n\t\t\t}\n\t\t\t$paths[$val['cat_id']] = $val['cat_title'];\n\t\t}\n\n\t\t// redundant array\n\t\t$redundants = [\n\t\t\t'cat_id' => $val['cat_id'],\n\t\t\t'depth' => $val['depth'],\n\t\t\t'cat_title' => $val['cat_title'],\n\t\t\t'contents_count' => $val['contents_count'],\n\t\t\t'contents_total' => $val['contents_total'],\n\t\t\t'subcategories_count' => $val['subcategories_count'],\n\t\t\t'subcategories_total' => $val['subcategories_total'],\n\t\t\t'subcategories_ids_cs' => $val['subcategories_ids_cs'],\n\t\t\t'subcattree_raw' => $val['subcattree_raw'],\n ];\n\n\t\t$db->queryF(\n 'UPDATE '\n . $db->prefix($mydirname . '_categories') . ' SET cat_depth_in_tree='\n . (int)$val['depth'] . ', cat_order_in_tree='\n . ($key) . ', cat_path_in_tree='\n . $db->quoteString(pico_common_serialize($paths)) . ', cat_redundants='\n . $db->quoteString(pico_common_serialize($redundants)) . ' WHERE cat_id='\n . $val['cat_id']);\n\t}\n}", "function create_tree($id,$select_root=false)\n\t{\n\t\trequire_lang('catalogues');\n\t\trequire_code('catalogues');\n\t\trequire_code('catalogues2');\n\n\t\t$name=$GLOBALS['SITE_DB']->query_value_null_ok('catalogue_categories','c_name',array('id'=>intval($id)));\n\n\t\t$pagelinks=get_catalogue_entries_tree($name,NULL,NULL,NULL,NULL,NULL,false);\n\t\treturn make_tree('catalogues',$pagelinks,$select_root);\n\t}", "function tree($parent, $ident, $tree) {\n global $tree;\n $database = &JFactory::getDBO();\n\n $database->setQuery(\"SELECT * FROM #__jdownloads_cats WHERE parent_id =\".$parent.\" ORDER BY ordering\");\n \n $rows = $database->loadObjectList();\n if ($database->getErrorNum()) {\n echo $database->stderr();\n return false;\n }\n foreach ($rows as $v) {\n $v->cat_title = $ident.\".&nbsp;&nbsp;<sup>L</sup>&nbsp;\".$v->cat_title;\n $v->cat_title = str_replace('.&nbsp;&nbsp;<sup>L</sup>&nbsp;','.&nbsp;&nbsp;&nbsp;&nbsp;',$v->cat_title);\n $x = strrpos($v->cat_title,'.&nbsp;&nbsp;&nbsp;&nbsp;');\n $v->cat_title = substr_replace($v->cat_title, '.&nbsp;&nbsp;<sup>L</sup>&nbsp;', $x,7);\n $tree[] = $v;\n \n tree($v->cat_id, $ident.\".&nbsp;&nbsp;<sup>L</sup>&nbsp;\", $tree);\n }\n}", "function l1NodeCategory($x) {\n global $dom;\n $root = $dom->documentElement;\n $children = $root->childNodes;\n\n $node = $children->item($x);\n $nodeName = $node->nodeName;\n\n switch($nodeName) {\n case p:\n $category = \"pOrBlockquote\";\n break;\n case blockquote:\n $category = \"pOrBlockquote\";\n break;\n case h2:\n $category = \"h\";\n break;\n case h3:\n $category = \"h\";\n break;\n case h4:\n $category = \"h\";\n break;\n case h5:\n $category = \"h\";\n break;\n case pre:\n $category = \"pre\";\n break;\n case hr:\n $category = \"hr\";\n break;\n case table:\n $category = \"table\";\n break;\n case ol:\n $category = \"list\";\n break;\n case ul:\n $category = \"list\";\n break;\n case div:\n // If the first grandchild's nodeName is img then $category is image.\n if ($node->hasChildNodes()) {\n $grandChildren = $node->childNodes;\n $firstGChild = $grandChildren->item(0);\n $fGCNodeName = $firstGChild->nodeName;\n if ($fGCNodeName == \"img\") {\n $category = \"image\";\n break;\n }\n }\n // If there is a class attribute whose value is remarkbox then\n // $category is remark.\n $classAtt = $node->getAttribute(\"class\");\n if ($classAtt == \"remarkbox\") {\n $category = \"remark\";\n break;\n }\n form_destroy();\n die('The div is weird. Err 5187854. -Programmer.');\n default:\n form_destroy();\n die('Node category undefined. Err 6644297. -Programmer.');\n }\n\n return $category;\n}", "function tep_make_cat_dmbranch($parcat, $table, $level, $maxlevel) {\n\n global $cPath_array, $menu_use_titles, $menu_icon_file;\n\t\t\n $list = $table[$parcat];\n\t\n // Build data for menu\n\t\twhile(list($key,$val) = each($list)){\n \n\t\t\t\tif (isset($cPath_array) && in_array($key, $cPath_array)) {\n $this_expanded = '1';\n $this_selected = 'dmselected';\t\t\t\t\t\t\n } else {\n $this_expanded = '';\n $this_selected = '';\t\t\t\t\t\t\t\t\t\n\t\t }\t\n\n if (!$level) {\n\t\t\t\t unset($GLOBALS['cPath_set']);\n\t\t\t\t\t\t$GLOBALS['cPath_set'][0] = $key;\n $cPath_new = 'cPath=' . $key;\n\n } else {\n\t\t\t\t\t\t$GLOBALS['cPath_set'][$level] = $key;\t\t\n $cPath_new = 'cPath=' . implode(\"_\", array_slice($GLOBALS['cPath_set'], 0, ($level+1)));\n }\n\t\t\t\t\n\t\t\t\tif ($menu_use_titles) {\n\t\t\t\t $this_title = $val;\n\t\t\t\t} else {\n\t\t\t\t $this_title = '';\t\t\t\t\n\t\t\t\t}\t\t\t\t\n /*\n if (SHOW_COUNTS == 'true') {\n $products_in_category = tep_count_products_in_category($key);\n if ($products_in_category > 0) {\n $val .= '&nbsp;(' . $products_in_category . ')';\n }\n }\n\t\t*/\t\t\n\t\t\t\t// Output for file to be parsed by PHP Layers Menu\n\t\t\t\t// Each line (terminated by a newline \"\\n\" is a pipe delimited string with the following fields:\n\t\t\t\t// [dots]|[text]|[link]|[title]|[icon]|[target]|[expanded]\n\t\t\t\t// dots - number of dots signifies the level of the link '.' root level items, '..' first submenu, etc....\n\t\t\t\t// text - text for link; title - tooltip for link; icon - icon for link; target - \"dmselected\" CSS class if item is selected\n\t\t\t\t// expanded - signifies if the node is expanded or collapsed by default (applies only to tree style menus)\n\t\t\t\t$output .= str_repeat(\".\", $level+1).'|'.$val.'|'.tep_href_link(FILENAME_DEFAULT, $cPath_new).'|'.$this_title.'|'.$menu_icon_file.'|'.$this_selected.'|'.$this_expanded.\"\\n\";\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) {\n $output .= tep_make_cat_dmbranch($key,$table,$level + 1,$maxlevel);\n }\n \n\t\t} // End while loop\n\n return $output;\n}", "private function createCategoryTree()\n {\n // create category\n CategoryUtil::createCategory('/__SYSTEM__/Modules', 'PostCalendar', null, $this->__('PostCalendar'), $this->__('Calendar for Zikula'));\n // create subcategory\n CategoryUtil::createCategory('/__SYSTEM__/Modules/PostCalendar', 'Events', null, $this->__('Events'), $this->__('Initial sub-category created on install'), array('color' => '#99ccff'));\n // get the category path to insert PostCalendar categories\n $rootcat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar');\n if ($rootcat) {\n // create an entry in the categories registry to the Main property\n if (!CategoryRegistryUtil::insertEntry('PostCalendar', 'CalendarEvent', 'Main', $rootcat['id'])) {\n throw new Zikula_Exception(\"Cannot insert Category Registry entry.\");\n }\n } else {\n $this->throwNotFound(\"Root category not found.\");\n }\n }", "function getCategories($object) { \n\n $R1 = new Category(); // R1 --\n $R11 = new Category(); // | | - R11 --\n $R111 = new Category(); // | | - R111\n $R112 = new Category(); // | | - R112\n $R11->addSubcategory($R111); // |\n $R11->addSubcategory($R112); // |\n $R1->addSubcategory($R11); // |\n $R2 = new Category(); // R2 --\n $R21 = new Category(); // | - R21 --\n $R211 = new Category(); // | | - R211\n $R22 = new Category(); // |\n $R221 = new Category(); // | - R22 --\n $R21->addSubcategory($R211); // | - R221\n $R22->addSubcategory($R221);\n $R2->addSubcategory($R21);\n $R2->addSubcategory($R22);\n\n $object->addCollectionEntry($R1); \n $object->addCollectionEntry($R2); \n}", "function _make_cat_compat(&$category)\n {\n }", "public function getPartialTreeDataProvider()\n {\n // Case #0.\n $cat1 = $this->buildCategory(\n [\n 'id' => 'cat1',\n 'active' => true,\n 'sort' => 1,\n 'left' => 2,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $out[] = [new \\ArrayIterator([$cat1]), 5, 'cat1', [$cat1]];\n\n // Case #1 test finding in deeper level with multiple side categories.\n $cat2 = $this->buildCategory(\n [\n 'id' => 'cat2',\n 'active' => true,\n 'sort' => 2,\n 'left' => 8,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat3 = $this->buildCategory(\n [\n 'id' => 'cat3',\n 'active' => true,\n 'sort' => 1,\n 'left' => 1,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n 'current' => true,\n 'expanded' => true,\n ]\n );\n\n $cat4 = $this->buildCategory(\n [\n 'id' => 'cat4',\n 'active' => true,\n 'sort' => 1,\n 'left' => 3,\n 'parent_id' => 'oxrootid',\n 'level' => 1,\n ]\n );\n\n $cat41 = $this->buildCategory(\n [\n 'id' => 'cat41',\n 'active' => true,\n 'sort' => 1,\n 'left' => 4,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat42 = $this->buildCategory(\n [\n 'id' => 'cat42',\n 'active' => true,\n 'sort' => 1,\n 'left' => 5,\n 'parent_id' => 'cat4',\n 'level' => 2,\n ]\n );\n\n $cat421 = $this->buildCategory(\n [\n 'id' => 'cat421',\n 'active' => true,\n 'sort' => 2,\n 'left' => 7,\n 'parent_id' => 'cat42',\n 'level' => 3,\n ]\n );\n\n $tree = [$cat1, $cat2, $cat3, $cat4];\n\n $cat4->setChild('cat42', $cat42);\n $cat4->setChild('cat41', $cat41);\n $cat42->setChild('cat421', $cat421);\n\n $out[] = [new \\ArrayIterator($tree), 5, 'cat42', [$cat42]];\n\n // Case #2 test with improper arguments.\n $out[] = [[], 0, null, null, 'Category Id must be defined on getPartialTree() method'];\n\n return $out;\n }", "function get_category_options(Collection|array $categories, string $selected_slug = '', int $level = 0): string\n{\n $category_items = [];\n\n foreach ($categories as $item) {\n $children = $item['children'];\n $has_children = $children && count($children) > 0;\n\n $category_item = '<option class=\"level-'. $level .'\" value=\"'. $item['slug'] .'\"'. ($selected_slug === $item['slug'] ? ' selected' : '') .'>';\n $category_item.= trim(str_repeat('> ', $level) .' '. $item['title']);\n $category_item.= '</option>';\n\n if ($has_children) {\n $category_children = get_category_options($children, $selected_slug, $level + 1);\n\n $category_item.= $category_children;\n }\n\n if ($level === 0)\n $category_item = '<optgroup label=\"'. $item['title'] .' ('. $item['taxonomy'] .')\">'. $category_item .'</optgroup>';\n\n $category_items[] = $category_item;\n }\n\n return implode('', array_filter(array_map('trim', $category_items)));\n}", "public function getTree() {\n return $this->_buildBranch($this->root_category_id);\n }", "public function makeCategory() {\n $categories = NewsCategory::orderBy('sort', 'asc')->where('parent_id', 0)->get();\n $categories->map(function($d){\n $d['sub_category'] = $d->child;\n return $d;\n });\n return $categories;\n }", "function make_cat_nav_tree($cat_id, $with_link)\n{\n\tglobal $db,$phpEx;\n\tglobal $nav_separator, $nav_link_active;\n\n\tif ($nav_link_active) $with_link = true;\n\n\t$this_cat = \"\";\n\tif ($cat_id > 0)\n\t{\n\t\t$sql = \"SELECT * FROM \".CATEGORIES_TABLE.\" WHERE cat_id=$cat_id\";\n\t\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categorie parm '.$sql, '', __LINE__, __FILE__, $sql);\n\t\tif ( $catw = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$cat_main = $catw['cat_main'];\n\t\t\t$cat_title = $catw['cat_title'];\n\t\t\t$this_cat = ($with_link) ? '<a href=\"'.append_sid(\"index.$phpEx?c=$cat_id\").'\" class=\"nav\">'.$cat_title.'</a>' : $cat_title;\n\t\t\t// v�rifier si un parent\n\t\t\tif ($cat_main != $cat_id && $cat_main > 0)\n\t\t\t{\n\t\t\t\t$this_cat = make_cat_nav_tree($cat_main, true) . $nav_separator . $this_cat;\n\t\t\t}\n\t\t}\n\t}\n\treturn $this_cat;\n}", "public static function getTree ($category)\n\t{\n\t\t$db = DataAccess::getInstance();\n\t\t$category = (int)$category;\n\t\tif (!$category) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$category_next = $category;\n\t\t\n\t\t$get_parent_stmt = $db->Prepare(\"SELECT c.`parent_id`, c.`in_statement`, l.`category_name` FROM \".geoTables::categories_table.\" as c, \".geoTables::categories_languages_table.\" as l WHERE c.`category_id` = l.`category_id` AND c.`category_id` = ? AND l.`language_id` = \".$db->getLanguage().\" LIMIT 1\");\n\t\t\n\t\tif (!$get_parent_stmt) {\n\t\t\ttrigger_error('ERROR SQL: message: '.$db->ErrorMsg());\n\t\t\treturn false;\n\t\t}\n\t\t$tree = array();\n\t\twhile ($category_next > 0) {\n\t\t\t/*\n\t\t\t * Store the category info in static array, one entry for each category\n\t\t\t * so we only get info for each category once for times that we need\n\t\t\t * to get category tree a bunch of times in same page load. Doing it\n\t\t\t * this way should minimize extra memory usage\n\t\t\t */\n\t\t\tif (!isset(self::$_category_tree_array[$category_next])) {\n\t\t\t\t$category_result = $db->Execute($get_parent_stmt, array($category_next));\r\n\t\t\t\t\r\n\t\t\t\tif (!$category_result) {\r\n\t\t\t\t\ttrigger_error('ERROR SQL: message: '.$db->ErrorMsg());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif ($category_result->RecordCount() == 1) {\r\n\t\t\t\t\t$show = $category_result->FetchRow();\r\n\t\t\t\t\tself::$_category_tree_array[$category_next] = array(\r\n\t\t\t\t\t\t'parent_id' => $show['parent_id'],\r\n\t\t\t\t\t\t'in_statement' => $show['in_statement'],\r\n\t\t\t\t\t\t'category_name' => geoString::fromDB($show['category_name']),\r\n\t\t\t\t\t\t'category_id' => $category_next,\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tree[] = self::$_category_tree_array[$category_next];\n\t\t\t$category_next = self::$_category_tree_array[$category_next]['parent_id'];\n\t \t}\n\t\t\n\t\t//reverse order of tree, or it will be backwards since we started from\n \t\t//the outermost cat and worked our way up.\n \t\treturn array_reverse($tree, true);\n\t}", "function build_cats($cat, $arr = array())\n\t{\n\t\t$database =& JFactory::getDBO();\n\t\t\t\n\t\t\t// keby sme sa chceli nahodou zacyklit, tak radsej skocime pri 15tej hlbke...\n\t\t\tif (sizeof($arr) > 15) return $arr;\n\t\t\t// zisti nadradenu kategoriu\n\t\t\t$sql = \"SELECT category_parent_id FROM #__vm_category_xref, #__vm_category WHERE jos_vm_category.category_id=jos_vm_category_xref.category_child_id and jos_vm_category.category_publish='Y' and jos_vm_category_xref.category_child_id ='$cat' ORDER BY category_parent_id DESC LIMIT 0,1\";\n\t\t\t$database->setQuery($sql);\n\t\t\t$parent_cat_id = $database->loadResult();\n\t\t\t//$this->logger($parent_cat_id, \"parent_cat_id for child \".$cat.$database->getErrorMsg());\n\t\t\t\n\t\t\t// zisti nazov kategorie\n\t\t\t$sql = \"SELECT category_name FROM #__vm_category WHERE category_id ='\".$cat.\"' LIMIT 0,1\";\n\t\t\t$database->setQuery($sql);\n\t\t\t$parent_name = $database->loadResult();\n\t\t\t$arr[] = $parent_name;\n\t\t\t//$this->logger($parent_name, \"parent_name for catid \".$cat.' '.$database->getErrorMsg());\n\t\t\t\n\t\t\tif (($parent_cat_id == '0') || (!isset($parent_cat_id))) {\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t return $this->build_cats($parent_cat_id, $arr);\n\t\t\t} \n\t}", "function create_my_cat () {\r\n if (file_exists (ABSPATH.'/wp-admin/includes/taxonomy.php')) {\r\n require_once (ABSPATH.'/wp-admin/includes/taxonomy.php'); \r\n if ( ! get_cat_ID( 'News Articles' ) ) {\r\n wp_create_category( 'News Article' );\r\n }\r\n if ( ! get_cat_ID( 'Call To Action' ) ) {\r\n wp_create_category( 'Call To Action' );\r\n }\r\n if ( ! get_cat_ID( 'Latest Projects' ) ) {\r\n wp_create_category( 'Latest Projects' );\r\n }\r\n if ( ! get_cat_ID( 'Sliders' ) ) {\r\n wp_create_category( 'Sliders' );\r\n }\r\n if ( ! get_cat_ID( 'Reviews and Whitepapers' ) ) {\r\n wp_create_category( 'Reviews and Whitepapers' );\r\n }\r\n if ( ! get_cat_ID( 'Bottom Row' ) ) {\r\n wp_create_category( 'Bottom Row' );\r\n }\r\n if ( ! get_cat_ID( 'Blog' ) ) {\r\n wp_create_category( 'Blog' );\r\n }\r\n }\r\n}", "function build_categories_collection_from_tree(Collection $tree, string|array $taxonomy, string $route, string $taxable_relation, bool $include_empty = false, array $params = [], array $attributes = [], bool $is_child = false): Collection\n{\n $temp = $params;\n $items = collect();\n\n $count = 1;\n foreach ($tree as $properties) {\n $params[] = $properties['slug'];\n\n $children = null;\n\n foreach ($properties as $value) {\n if ($value instanceof Collection) {\n $children = build_categories_collection_from_tree($value, $taxonomy, $route, $taxable_relation, $include_empty, $params, $attributes, true);\n break;\n }\n }\n\n $is_active = taxonomies_is_active_route($route, $params);\n\n $item = [\n 'uuid' => $properties['uuid'],\n 'taxonomy' => $properties['taxonomy'],\n 'title' => $properties['title'],\n 'slug' => $properties['slug'],\n 'content' => $properties['content'],\n 'lead' => $properties['lead'],\n 'meta_desc' => $properties['meta_desc'],\n 'visible' => $properties['visible'],\n 'searchable' => $properties['searchable'],\n 'route' => $route,\n 'params' => is_array($properties['alias-params']) ? get_term_link($route, $properties['alias-params']) : $params,\n 'link' => is_array($properties['alias-params']) ? get_term_link($route, $properties['alias-params']) : get_term_link($route, $params),\n 'children' => $children,\n 'count' => $properties['count'],\n 'count-cumulative' => $properties['count-cumulative'],\n 'active' => $is_active,\n 'active-branch' => $is_active ?: ($children && $children->where('active-branch', true)->count()),\n ];\n\n $params = [];\n if ($count !== count($tree))\n $params = $temp;\n\n $count++;\n\n if (! $include_empty && $properties['count-cumulative'] < 1) {\n continue;\n } else {\n $items->push($item);\n }\n }\n\n return $items;\n}", "function get_simple_categories($type='all', $parentid=false, $order=false){\n $parentid = intval($parentid);\n $where=$orderby='';\n if($type=='root') $where = 'WHERE parentid = -1';\n elseif ($type=='sub' && $parentid) $where = \"WHERE parentid = '$parentid'\";\n if($order) $orderby = ' order by name '.$order;\n $sql = \"SELECT id as catId, name as catName FROM categories \" . $where . $orderby; //, marketplaceCount\n $cats = $this->db->query($sql)->result_array();\n foreach($cats as $key=>$value){\n //$cats[$key]['marketplaceCount'] = number_format($value['marketplaceCount']);\n $haveSubCategories = $this->db_getone(\"SELECT id from categories where parentid='{$value['catId']}'\", 'id');\n if($haveSubCategories) $cats[$key]['haveSubCategories'] = 1;\n else $cats[$key]['haveSubCategories'] = 0;\n }\n return $cats;\n }", "function the_category($separator = '', $parents = '', $post_id = \\false)\n {\n }", "function getCategoryTreeAssoc()\n {\n $category_structure = $this->loadCategoryStructure();\n //echo '<pre>';\n //print_r($category_structure);\n $level = 0;\n $rs = '';\n $rs .= '<form method=\"post\">';\n $rs .= '<table border=\"0\">';\n $rs .= '<tr>';\n $rs .= '<td class=\"row_title\" colspan=\"4\"><input type=\"submit\" value=\"' . Multilanguage::_('L_TEXT_SAVE') . '\" name=\"submit\" /></td>';\n $rs .= '</tr>';\n $rs .= '<tr>';\n $rs .= '<td class=\"row_title\">' . Multilanguage::_('L_TEXT_TITLE') . '</td>';\n $rs .= '<td class=\"row_title\">' . Multilanguage::_('OPERATION_TYPE', 'system') . '</td>';\n $rs .= '<td class=\"row_title\">' . Multilanguage::_('ESTATE_TYPE', 'system') . '</td>';\n $rs .= '<td class=\"row_title\"></td>';\n $rs .= '</tr>';\n if (count($category_structure) > 0) {\n foreach ($category_structure['childs'][0] as $item_id => $catalog_id) {\n //echo $catalog_id.'<br>';\n $rs .= $this->getRowAssoc($catalog_id, $category_structure, $level, 'row1');\n $rs .= $this->getChildNodesRowAssoc($catalog_id, $category_structure, $level + 1, $current_category_id);\n }\n }\n $rs .= '<tr>';\n $rs .= '<input type=\"hidden\" name=\"action\" value=\"structure\" />';\n $rs .= '<input type=\"hidden\" name=\"do\" value=\"associations\" />';\n $rs .= '<td class=\"row_title\" colspan=\"4\"><input type=\"submit\" value=\"' . Multilanguage::_('L_TEXT_SAVE') . '\" name=\"submit\" /></td>';\n\n $rs .= '</tr>';\n $rs .= '</table>';\n $rs .= '</form>';\n return $rs;\n }", "function get_all_comic_categories() {\n global $comiccat, $category_tree, $non_comic_categories;\n\n $categories_by_id = get_all_category_objects_by_id();\n\n foreach (array_keys($categories_by_id) as $category_id) {\n $category_tree[] = $categories_by_id[$category_id]->parent . '/' . $category_id;\n }\n\n do {\n $all_ok = true;\n for ($i = 0; $i < count($category_tree); ++$i) {\n $current_parts = explode(\"/\", $category_tree[$i]);\n if (reset($current_parts) != 0) {\n\n $all_ok = false;\n for ($j = 0; $j < count($category_tree); ++$j) {\n $j_parts = explode(\"/\", $category_tree[$j]);\n\n if (end($j_parts) == reset($current_parts)) {\n $category_tree[$i] = implode(\"/\", array_merge($j_parts, array_slice($current_parts, 1)));\n break;\n }\n }\n }\n }\n } while (!$all_ok);\n\n $non_comic_tree = array();\n\n if (get_option('comicpress-enable-storyline-support') == 1) {\n $result = get_option(\"comicpress-storyline-category-order\");\n if (!empty($result)) {\n $category_tree = explode(\",\", $result);\n }\n $non_comic_tree = array_keys($categories_by_id);\n foreach ($category_tree as $node) {\n $parts = explode(\"/\", $node);\n $category_id = end($parts);\n if ($parts[1] == $comiccat) {\n if (($index = array_search($category_id, $non_comic_tree)) !== false) {\n array_splice($non_comic_tree, $index, 1);\n }\n }\n }\n } else {\n $new_category_tree = array();\n foreach ($category_tree as $node) {\n $parts = explode(\"/\", $node);\n if ($parts[1] == $comiccat) {\n $new_category_tree[] = $node;\n } else {\n $non_comic_tree[] = end($parts);\n }\n }\n $category_tree = $new_category_tree;\n }\n\n $non_comic_categories = implode(\" and \", $non_comic_tree);\n}", "public function getCategoryTree() {\n $q = \"select * from \".TP.\"transaction_type_master order by type,subtype1,subtype2_display_order\";\n $res = mysql_query($q);\n $ret = array();\n if (!$res) {\n return $ret;\n }\n while($row = mysql_fetch_assoc($res)) {\n $ret[$row['type']][$row['subtype1']][] = $row['subtype2'];\n //var_dump($row);\n }\n //var_Dump($ret);\n return $ret;\n }", "public function structure() {\n $list = $this->newQuery()->where('parent_id', 0)->orderBy('order_id', 'asc')->get();\n $list->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $children->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $category->setAttribute('children', $children);\n\n return $category;\n });\n $category->setAttribute('children', $children);\n\n return $category;\n });\n\n return $list->toArray();\n }", "function printCategory($parent_id, $role)\n{\n $cats = new Category();\n $cate = $cats->getByParentId($parent_id);\n if ($parent_id == 0) {\n\n if ($role == 'admin') {\n }\n if ($role == 'client') {\n foreach ($cate as $r) {\n echo '<li><a href=\"posts-list-category.php?id=' . $r['id'] . '\">' . $r['name'] . '</a>';\n printCategory($r['id'], $role);\n echo '</li>';\n }\n }\n } else {\n //nếu là danh mục con\n if ($role == 'admin') {\n }\n if ($role == 'client') {\n echo '<ul class=\"sub-menu\">';\n foreach ($cate as $r) {\n echo '<li><a href=\"posts-list-category.php?id=' . $r['id'] . '\">' . $r['name'] . '</a></li>';\n }\n echo '</ul>';\n }\n }\n}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "function build_nav_tree($node ){ // term object\n\t\t\tglobal $pattern_cats, $currentcat;\n\t\t\t// any child categories? \n\t\t\t$children = get_terms( 'pattern_category', array('hierarchical' => 0, 'parent' => $node->term_id, 'fields' => 'ids'));\t\t\n\t\t\t$descendants = get_terms( 'pattern_category', array('hierarchical' => 0, 'child_of' => $node->term_id, 'fields' => 'ids'));\n\t\t\t\n\t\t\t//echo sizeof(array_intersect($product_terms, $descendants ));\n\t\t\t?> \n\t\t\t<li <? \n\t\t\tif (is_tax('pattern_category', $node->term_id)){ \n\t\t\t\t?> id=\"current\" <? \n\t\t\t} else if( \n\t\t\t\t\tis_singular() \n\t\t\t\t\t&& has_term( $node->term_id, 'pattern_category', $post ) \n\t\t\t\t\t&& sizeof(array_intersect($pattern_cats, $descendants )) == 0 ){ // parent of product\n\t\t\t\t?> class=\"parent\" <?\n\t\t\t} // end if else \n\t\t\t\n\t\t\t?> ><a href=\"<? echo get_term_link($node); ?>\"><span><? echo $node->name; ?><!--span class=\"count\">(<? echo $node->count; ?>) --></span></span></a> <?\n\t\t\t\n\t\t\t//echo \"children: \"; foreach($children as $term){ echo $term.','; }\t\n\t\t\t//echo \"<br/>descendants: \"; foreach($descendants as $term){ echo $term.','; }\n\t\t\t\n\t\t\t// if this is the current category or a single with child terms of this category\n\n\t\t\tif(\n\t\t\t\t\tis_tax('pattern_category', $node->term_id) \n\t\t\t\t\t|| sizeof(array_intersect($pattern_cats, $descendants)) > 0 \n\t\t\t\t\t|| in_array( $currentcat->term_id, $descendants) \n\t\t\t\t\t){ \n\t\t\t\t\n\t\t\t\tif(count($children) > 0 ){\n\t\t\t\t\t?> <ul> <?\n\t\t\t\t\tforeach ($children as $child) {\n\t\t\t\t\t\t build_nav_tree(get_term_by( 'id', $child, 'pattern_category' ));\n\t\t\t\t\t} \n\t\t\t\t\t?></ul> <? \n\t\t\t\t} \n\t\t\t} // end if current node\n\t\t\t?></li><?\n\t\t\t\t\n\t\t}", "public function categoryTree( $category ){ return $this->APICall( array('categoryTree' => $category), \"Couldn't get the category tree for \" . $category ); }", "function show_cats2($cats_grouped_by_parent, $parent_id = 0) {\n\t\t\t\tglobal $baseurl;\n\t\t\t\tglobal $loc_slug;\n\t\t\t\tglobal $loc_type;\n\t\t\t\tglobal $loc_id;\n\t\t\t\tglobal $cat_items_count;\n\n\t\t\t\tif($parent_id == 0) {\n\t\t\t\t\techo '<ul class=\"cat-tree cat-main-parent\">';\n\t\t\t\t} else {\n\t\t\t\t\techo '<ul class=\"cat-tree\">';\n\t\t\t\t}\n\n\t\t\t\t/*\n$tree .= '<a href=\"' . $baseurl . '/' . $loc_slug . '/list/' . $cat_slug3 . '/' . $loc_type . '-' . $loc_id . '-' . $cat_id3 . '-1\">' . $plural_name3 . \"($this_cat_count3)\" . '</a>';\n\t\t\t\t*/\n\n\t\t\t\tif(!empty($cats_grouped_by_parent)) {\n\t\t\t\t\tforeach ($cats_grouped_by_parent[$parent_id] as $v) {\n\t\t\t\t\t\t$this_cat_slug = (!empty($v['plural_name'])) ? to_slug($v['plural_name']) : to_slug($v['cat_name']);\n\t\t\t\t\t\t$this_cat_name = (!empty($v['plural_name'])) ? $v['plural_name'] : $v['cat_name'];\n\t\t\t\t\t\t$this_cat_id = $v['cat_id'];\n\t\t\t\t\t\t$this_iconfont_tag = (!empty($v['iconfont_tag'])) ? $v['iconfont_tag'] : '';\n\t\t\t\t\t\t$this_cat_count = (!empty($cat_items_count[$this_cat_id])) ? $cat_items_count[$this_cat_id] : 0;\n\n\t\t\t\t\t\techo '<li data-cat-id=\"' . $v['cat_id'] . '\"> ';\n\t\t\t\t\t\t\techo \"<a href='$baseurl/$loc_slug/list/$this_cat_slug/$loc_type-$loc_id-$this_cat_id-1'>\n\t\t\t\t\t\t\t\t$this_iconfont_tag $this_cat_name ($this_cat_count)</a>\";\n\n\n\n\t\t\t\t\t\t\t//if there are children\n\t\t\t\t\t\t\tif (!empty($cats_grouped_by_parent[$this_cat_id])) {\n\t\t\t\t\t\t\t\tshow_cats2($cats_grouped_by_parent, $this_cat_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\techo '</ul>';\n\t\t\t}", "function getTagTreeXML() {\n $result = '';\n $tagObj = $this->getBaseTags();\n\n if ($this->params['cat_id'] > 0) {\n $this->category = $tagObj->getCategory(\n $this->params['cat_id'],\n $this->lngSelect->currentLanguageId\n );\n $parentPath = PapayaUtilArray::decodeIdList($this->category['parent_path']);\n $parentId = (int)array_pop($parentPath);\n $preParentId = (int)array_pop($parentPath);\n $catIds = array(\n $this->category['parent_id'],\n $this->category['category_id'],\n $preParentId\n );\n } else {\n $parentId = 0;\n $preParentId = 0;\n $catIds = array(0);\n }\n if (!isset($this->category) ||\n $this->category['parent_id'] == 0 ||\n $preParentId == 0) {\n $selected = ($this->params['cat_id'] == 0) ? ' selected=\"selected\"' : '';\n $result .= sprintf(\n '<listitem title=\"%s\" href=\"%s\" image=\"%s\" node=\"empty\" %s/>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Base')),\n papaya_strings::escapeHTMLChars(\n $this->getLink(array('cat_id' => 0))\n ),\n papaya_strings::escapeHTMLChars($this->images['items-folder']),\n $selected\n );\n }\n if ($preParentId != 0) {\n $result .= sprintf(\n '<listitem title=\"%s\" href=\"%s\" image=\"%s\"/>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Parent category')),\n papaya_strings::escapeHTMLChars(\n $this->getLink(array('cat_id' => $preParentId))\n ),\n papaya_strings::escapeHTMLChars($this->images['actions-go-superior'])\n );\n }\n if (isset($this->sessionParams['open_categories'])) {\n $catIds = array_merge($catIds, array_keys($this->sessionParams['open_categories']));\n }\n $this->categories = $tagObj->getSubCategories(\n $catIds,\n $this->lngSelect->currentLanguageId\n );\n $tagObj->loadCategoryCounts($this->categories);\n foreach ($this->categories as $categoryId => $category) {\n $this->categoryTree[(int)$category['parent_id']][] = $categoryId;\n }\n $result .= $this->getXMLCategorySubTree((int)$preParentId, 1);\n return $result;\n }", "function retrieveHierarchy() {\r\n\t\t$arrCats = $this->generateTreeByLevels(3);\r\n\t\t\r\n\t\treturn $arrCats;\r\n\t}", "private function buildTree ( &$tree, $parentId = null ) {\r\n\t\tif ( !isset ( $parentId ) ) $parentId = 0;\r\n\t\t$param = array(\r\n\t\t\t'conditions' => array('parent_id' => $parentId),\r\n\t\t\t'fields' => array('id','lorder','rorder','CategoryDetail.name'),\r\n\t\t\t'order' => array('CategoryDetail.name')\r\n\t\t );\r\n\t\t$arrRes = $this->Category->find('all', $param);\r\n $tree .= \"<ul>\";\r\n foreach ( $arrRes as $node ) {\r\n \t$tree .= \"<li><a id='\".$node['Category']['id'].\"' ctrl='categories'>\".\r\n \t\t $node['CategoryDetail']['name'].\"</a>\";\r\n if ( $node['Category']['rorder'] - $node['Category']['lorder'] == 1 ) $tree .= \"</li>\";\r\n else {\r\n $this->buildTree ( $tree, $node['Category']['id'] );\r\n $tree .= \"</li>\";\r\n }\r\n\t /*if ( $node['Category']['rorder'] - $node['Category']['lorder'] > 1 ) {\r\n\t \t\t$tree .= \"<li><a id='\".$node['Category']['id'].\"' ctrl='categories'>\".\r\n \t\t $node['CategoryDetail']['name'].\"</a>\";\r\n\t\t\t\r\n\t\t\t $this->buildTree ( $tree, $node['Category']['id'] );\r\n\t $tree .= \"</li>\";\r\n\t }*/\r\n }\r\n $tree .= \"</ul>\";\r\n\t}", "abstract public function tree_encoder();", "function list_to_tree($category = array(),\n\t\t$idField = 'id',$parentField='parent_id'){\n\tif(!is_array($category)) exit(\"配列ではありません\");\n\n\t$index = array();\n\t$tree = array();\n\n\tforeach($category as $value){\n\t\t$id = $value[$idField];\n\t\t$parent = $value[$parentField];\n\n\t\tif(isset($index[$id])){\n\t\t\t$value['child'] = $index[$id]['child'];\n\t\t\t$index[$id] = $value;\n\n\t\t} else {\n\t\t\t$index[$id] = $value;\n\t\t}\n\n\t\tif($parent == 0){\n\t\t\t$tree[] =& $index[$id];\n\n\t\t} else {\n\t\t\t$index[$parent]['child'][] =& $index[$id];\n\t\t}\n\n\n\t}\n\treturn $tree;\n}", "private function getClassCategory($root) {\n\t\treturn \"Science\";\n\t}", "function walk_category_dropdown_tree(...$args)\n {\n }", "function get_category_data( $adunit = false ) {\n\t$exposed_values = array();\n\t$parent_categories = array();\n\t$sub_categories = array();\n\t$exposed_values['parent_categories'] = 'no_value';\n\t$exposed_values['sub_categories'] = 'no_value';\n\tif ( is_single() ) {\n\t\tglobal $post;\n\t\t$category_tax = 'category';\n\t\t$categories = get_the_terms( $post->ID, $category_tax );\n\t\tif ( ! empty( $categories ) ) {\n\t\t\tforeach ( $categories as $term ) {\n\t\t\t\t$ancestors = get_ancestors( $term->term_id, $category_tax );\n\t\t\t\tif ( ! empty( $ancestors ) ) {\n\t\t\t\t\tforeach ( $ancestors as $ancestor ) {\n\t\t\t\t\t\t$remove[] = \"'\";\n\t\t\t\t\t\tif ( ! $adunit ) {\n\t\t\t\t\t\t\t$remove[] = '-';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$ancestor_term = get_term( $ancestor );\n\t\t\t\t\t\tarray_push( $parent_categories, str_replace( $remove, '', $ancestor_term->slug ) );\n\t\t\t\t\t\tarray_push( $sub_categories, str_replace( $remove, '', $term->slug ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$term_slug = $term->slug;\n\t\t\t\t\tarray_push( $parent_categories, $term_slug );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$filter_similar_parent_cats = array_unique( $parent_categories, SORT_STRING );\n\t\t\t$parent_categories = implode( ', ', $filter_similar_parent_cats );\n\t\t\t$filter_similar_sub_cats = array_unique( $sub_categories, SORT_STRING );\n\t\t\t$sub_categories = implode( ', ', $filter_similar_sub_cats );\n\t\t\tif ( ! empty( $parent_categories ) ) {\n\t\t\t\t$exposed_values['parent_categories'] = $parent_categories;\n\t\t\t}\n\t\t\tif ( ! empty( $sub_categories ) ) {\n\t\t\t\t$exposed_values['sub_categories'] = $sub_categories;\n\t\t\t}\n\t\t}\n\t} elseif ( is_category() || is_archive() ) {\n\t\t$q_object = get_queried_object();\n\t\t// WP_Post_Type archives don't have a \"slug\" property.\n\t\tif ( ! empty( $q_object->slug ) ) {\n\t\t\t$cat_slug = $q_object->slug;\n\t\t\t$exposed_values['parent_categories'] = $cat_slug;\n\t\t\t$exposed_values['sub_categories'] = $cat_slug;\n\t\t}\n\t\tif ( is_post_type_archive( 'joke' ) ) {\n\t\t\t$exposed_values['parent_categories'] = 'jokes';\n\t\t\t$exposed_values['sub_categories'] = 'jokes';\n\t\t}\n\t} elseif ( is_page() ) {\n\t\t$exposed_values['parent_categories'] = 'misc';\n\t\t$exposed_values['sub_categories'] = 'misc';\n\t} elseif ( is_home() && is_front_page() ) {\n\t\t$exposed_values['parent_categories'] = 'homepage';\n\t\t$exposed_values['sub_categories'] = 'homepage';\n\t}\n\treturn $exposed_values;\n}", "public function treeAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n /** @var CategoryRepository $repo */\n $repo = $em->getRepository('SowpBudgetBundle:Category');\n $categories = $repo->childrenHierarchy();\n\n return $this->render('SowpBudgetBundle:CategoryAdmin:tree.html.twig', array(\n 'categories' => $categories,\n ));\n }", "function build_nav_tree($node ){ // term object\n\t\t\tglobal $product_terms, $currentterm;\n\t\t\t// any child categories? \n\t\t\t$children = get_terms( 'product_category', array('hierarchical' => 0, 'parent' => $node->term_id, 'fields' => 'ids'));\t\t\n\t\t\t$descendants = get_terms( 'product_category', array('hierarchical' => 0, 'child_of' => $node->term_id, 'fields' => 'ids'));\n\t\t\t\n\t\t\t//echo sizeof(array_intersect($product_terms, $descendants ));\n\t\t\t?> \n\t\t\t<li <? \n\t\t\tif (is_tax('product_category', $node->term_id)){ \n\t\t\t\t?> id=\"current\" <? \n\t\t\t} else if( \n\t\t\t\t\tis_singular() \n\t\t\t\t\t&& has_term( $node->term_id, 'product_category', $post ) \n\t\t\t\t\t&& sizeof(array_intersect($product_terms, $descendants )) == 0 ){ // parent of product\n\t\t\t\t?> class=\"parent\" <?\n\t\t\t} // end if else \n\t\t\t\n\t\t\t?> ><a href=\"<? echo get_term_link($node); ?>\"><span><? echo $node->name; ?> <span class=\"count\">(<? echo $node->count; ?>)</span></span></a> <?\n\t\t\t\n\t\t\t//echo \"children: \"; foreach($children as $term){ echo $term.','; }\t\n\t\t\t//echo \"<br/>descendants: \"; foreach($descendants as $term){ echo $term.','; }\n\t\t\t\n\t\t\t// if this is the current category or a single with child terms of this category\n\n\t\t\tif(\n\t\t\t\t\tis_tax('product_category', $node->term_id) \n\t\t\t\t\t|| sizeof(array_intersect($product_terms, $descendants)) > 0 \n\t\t\t\t\t|| in_array( $currentterm->term_id, $descendants) \n\t\t\t\t\t){ \n\t\t\t\t\n\t\t\t\tif(count($children) > 0 ){\n\t\t\t\t\t?> <ul> <?\n\t\t\t\t\tforeach ($children as $child) {\n\t\t\t\t\t\t build_nav_tree(get_term_by( 'id', $child, 'product_category' ));\n\t\t\t\t\t} \n\t\t\t\t\t?></ul> <? \n\t\t\t\t} \n\t\t\t} // end if current node\n\t\t\t?></li><?\n\t\t\t\t\n\t\t}", "public static function createXTree($array, $currentParent, $currLevel = 0, $prevLevel = -1) {\n \n if ( is_array($array) && count($array) > 0 ) {\n\n foreach ($array as $categoryId => $category) {\n\n if ($currentParent == $category['direct_parent_id']) {\t\t\t\t\t\t\n\n if($category['node_type'] == 1){\n $cbName = 'acl_module[]';\n $cbvalue = $category['name'].'##'.$categoryId;\n }elseif($category['node_type'] == 2){\n $cbName = $category['parents'][0]['name'].'_controller[]';\n $cbvalue = $category['name'].'##'.$categoryId;\n }elseif($category['node_type'] == 3){\n $cbName = $category['parents'][1]['name'].'_'.$category['parents'][0]['name'].'_method[]';\n $cbvalue = $category['name'].'##'.$categoryId;\n }\n\n if ($currLevel > $prevLevel) echo \" <ul> \\n\"; \n\n if ($currLevel == $prevLevel) echo \" </li> \\n\";\n\n echo '<li id=\"'.$categoryId.'\" rel=\"'.$currLevel.'\">\n <input type=\"checkbox\" class=\"events-child-category-all\" \n id=\"id-'.$categoryId.'\"\n name=\"'.$cbName.'\"\n value=\"'.$cbvalue.'\"\n '.$category['checked'].'\n style=\"margin-left:0px;\"\n />\n <span style=\"padding-left:5px;\">'.$category['display_name'].'</span>';\n\n if($category['node_type'] == 1 OR $category['node_type'] == 2)\n echo '<img src=\"' . asset('public/assets/plugins/xtree/images/16-circle-blue-add.png') . '\" alt=\"add subcategory\" width=\"16\" height=\"16\" class=\"add_category\"/>';\n //<img src=\"images/16-circle-red-remove.png\" alt=\"remove\" width=\"16\" height=\"16\" class=\"delete_category\"/>';\n\n if ($currLevel > $prevLevel) { $prevLevel = $currLevel; }\n\n $currLevel++; \n\n self::createXTree ($array, $categoryId, $currLevel, $prevLevel);\n\n $currLevel--;\t \t\t \t\n\n }\t\n\n }\n\n if ($currLevel == $prevLevel) echo \"\\n </li> \\n </ul> \\n\";\n } \n\n }", "public function run()\n {\n $node = Category::create(\n [\n 'title'=>'PreDiabetes',\n 'description'=>'Prediabetes, also commonly referred to as borderline diabetes, is a metabolic condition and growing global problem that is closely tied to obesity.',\n 'summary'=>'Prediabetes, also commonly referred to as borderline diabetes, is a metabolic condition and growing global problem that is closely tied to obesity.',\n 'meta_keywords'=>'PreDiabetes'\n\n ]\n );$node = Category::create(\n [\n 'title'=>'Type-1',\n 'description'=>'Type 1 diabetes is an autoimmune disease that causes the insulin producing beta cells in the pancreas to be destroyed, preventing the body from being able to produce enough insulin to adequately regulate blood glucose levels.',\n 'summary'=>'Type 1 diabetes is an autoimmune disease that causes the insulin producing beta cells in the pancreas to be destroyed, preventing the body from being able to produce enough insulin to adequately regulate blood glucose levels.',\n 'meta_keywords'=>'Diabetes,Type-1 Diabetes'\n ]\n );$node = Category::create(\n [\n 'title'=>'Type-2',\n 'description'=>'Type 2 diabetes mellitus is a metabolic disorder that results in hyperglycemia (high blood glucose levels) due to the body:Being ineffective at using the insulin it has produced; also known as insulin resistance and/or Being unable to produce enough insulin',\n 'summary'=>'Type 2 diabetes mellitus is a metabolic disorder that results in hyperglycemia (high blood glucose levels) due to the body:Being ineffective at using the insulin it has produced; also known as insulin resistance and/or Being unable to produce enough insulin',\n\n 'meta_keywords'=>'Type-2, Type2, Type-2 Diabetes'\n ]\n );$node = Category::create(\n [\n 'title'=>'Food+Recipes',\n 'description'=>'Learning about food is one of the best ways to control type 2 diabetes, but eating a healthy diet can benefit all people with diabetes.',\n 'summary'=>'Learning about food is one of the best ways to control type 2 diabetes, but eating a healthy diet can benefit all people with diabetes.',\n 'meta_keywords'=>'Food,Type-2, Type-1',\n 'children'=>[\n ['title'=>'Food + Drink',\n 'description'=>'Learning about food is one of the best ways to control type 2 diabetes, but eating a healthy diet can benefit all people with diabetes.',\n 'summary'=>'Learning about food is one of the best ways to control type 2 diabetes, but eating a healthy diet can benefit all people with diabetes.',\n 'meta_keywords'=>'',],\n ['title'=>'Food + Diet Guides',\n 'description'=>'Effective management of diabetes cannot be achieved without an appropriate diet.',\n 'summary'=>'Effective management of diabetes cannot be achieved without an appropriate diet.',\n 'meta_keywords'=>'Food + Diet Guides',],\n ['title'=>'Nutrition',\n 'description'=>'Nutrition is a critical part of diabetes care. Balancing the right amount of carbohydrates, fat, protein along with fibre, vitamins and minerals helps us to maintain a healthy diet and a healthy lifestyle.',\n 'summary'=>'Nutrition is a critical part of diabetes care. Balancing the right amount of carbohydrates, fat, protein along with fibre, vitamins and minerals helps us to maintain a healthy diet and a healthy lifestyle.',\n 'meta_keywords'=>'Nutrition',],\n ]\n ]\n );$node = Category::create(\n [\n 'title'=>'Living With Diabetes',\n 'description'=>'Living with diabetes can be challenging, but you can still lead a near normal life. Diet and lifestyle are key components in living healthily with diabetes.',\n 'summary'=>'Living with diabetes can be challenging, but you can still lead a near normal life. Diet and lifestyle are key components in living healthily with diabetes.',\n 'meta_keywords'=>'Living with diabetes can be challenging, but you can still lead a near normal life. Diet and lifestyle are key components in living healthily with diabetes.',\n 'children'=>[\n [\n 'title'=>'Blood Glucose',\n 'description'=>'Blood glucose and blood sugar are interchangeable terms, and both are crucial to the health of the body; especially for people with diabetes.',\n 'summary'=>'Blood glucose and blood sugar are interchangeable terms, and both are crucial to the health of the body; especially for people with diabetes.',\n 'meta_keywords'=>'Blood Glucose',\n ],[\n 'title'=>'Driving And Diabetes',\n 'description'=>'Driving And Diabetes',\n 'summary'=>'',\n 'meta_keywords'=>'Driving And Diabetes',\n ],[\n 'title'=>'Emotions',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Emotions',\n ],[\n 'title'=>'Employment & Benefits',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Employment & Benefits',\n ],[\n 'title'=>'Exercise & Fitness',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Exercise & Fitness',\n ],[\n 'title'=>'Pregnancy',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Pregnancy',\n ],[\n 'title'=>'Sex',\n 'description'=>'Sex',\n 'summary'=>'',\n 'meta_keywords'=>'Sex',\n ],[\n 'title'=>'Travel',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Travel',\n ],[\n 'title'=>'Managing Diabetes',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Managing Diabetes',\n ],[\n 'title'=>'Tools',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Tools',\n ],\n ]\n ]\n );$node = Category::create(\n [\n 'title'=>'Treatment',\n 'description'=>'Successful treatment makes all the difference to long-term health, and achieving balanced diabetes treatment can be the key to living with both type 1 and type 2 diabetes.',\n 'summary'=>'Successful treatment makes all the difference to long-term health, and achieving balanced diabetes treatment can be the key to living with both type 1 and type 2 diabetes.',\n 'meta_keywords'=>'treatment, type-1 diabetes treatment',\n 'children'=>[\n [\n 'title'=>'Low Carb',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Low Carb',\n ],[\n 'title'=>'Keto Diet',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Keto Diet',\n ],[\n 'title'=>'Diabetes Drugs',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Diabetes Drugs',\n ],[\n 'title'=>'Insulin',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Insulin',\n ],[\n 'title'=>'Insulin Pumps',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Insulin Pumps',\n ],[\n 'title'=>'Medication',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Medication',\n ],[\n 'title'=>'Weight Loss',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Weight Loss',\n ],[\n 'title'=>'Research',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Research',\n ],\n ]\n ]\n );$node = Category::create(\n [\n 'title'=>'Complications',\n 'description'=>'Uncontrolled diabetes can lead to a number of short and long-term health complications, including hypoglycemia, heart disease, nerve damage and amputation, and vision problems.',\n 'summary'=>'Uncontrolled diabetes can lead to a number of short and long-term health complications, including hypoglycemia, heart disease, nerve damage and amputation, and vision problems.',\n 'meta_keywords'=>'',\n 'children'=>[\n [\n 'title'=>'Short Term Complications',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Complications',\n ],[\n 'title'=>'Long Term Complications',\n 'description'=>'Long Term Complications',\n 'summary'=>'',\n 'meta_keywords'=>'Long Term Complications',\n ],[\n 'title'=>'Embarrassing Conditions',\n 'description'=>'',\n 'summary'=>'',\n 'meta_keywords'=>'Embarrassing Conditions',\n ],\n ]\n ]\n );\n }", "public function getParentCategories()\n {\n return [\n 1 => [\n 'ru' => 'Готовые наборы для аэрографии',\n 'uk' => 'Готові набори для аерографії',\n 'en' => 'Ready-made airbrush kits',\n ],\n 2 => [\n 'ru' => 'Дополнительное оборудование и аксессуары для аэрографии',\n 'uk' => 'Додаткове обладнання та аксесуари для аерографії',\n 'en' => 'Additional equipment and accessories for airbrushing'\n ],\n 3 => [\n 'ru' => 'Аэрографы и компрессоры Fengda',\n 'uk' => 'Аерографи і компресори Fengda',\n 'en' => 'Fengda Airbrushes and Compressors',\n ],\n 4 => [\n 'ru' => 'Товары для аэрографии на ногтях (nail art)',\n 'uk' => 'Товари для аерографії на нігтях (nail art)',\n 'en' => 'Goods for airbrushing on nails (nail art)',\n ],\n 6 => [\n 'ru' => 'Товары для аэрографии визажистов, гримеров и др.',\n 'uk' => 'Товари для аерографії візажистів, гримерів і ін.',\n 'en' => 'Goods for aerography of make-up artists, make-up artists, etc.',\n ],\n 5 => [\n 'ru' => 'Товары для аэрографии на кондитерских изделиях',\n 'uk' => 'Товари для аерографії на кондитерських виробах',\n 'en' => 'Goods for airbrushing confectionery products',\n ],\n 7 => [\n 'ru' => 'Краски для аэрографии Createx и Wicked Colors',\n 'uk' => 'Фарби для аерографії Createx і Wicked Colors',\n 'en' => 'Paints for airbrushing Createx and Wicked Colors',\n 'not_active' => true\n ],\n 8 => [\n 'ru' => 'Краски для аэрографии Auto Air Colors',\n 'uk' => 'Фарби для аерографії Auto Air Colors',\n 'en' => 'Paints for airbrushing Auto Air Colors',\n 'not_active' => true\n ],\n 9 => [\n 'ru' => 'Аэрографы и запчасти H&S/Hansa',\n 'uk' => 'Аерографи і запчастини H&S/Hansa',\n 'en' => 'Airbrushes and spare parts H&S/Hansa',\n ]\n ];\n }", "function &createFromSQL($id = 0)\n {\n SGL::logMessage(null, PEAR_LOG_DEBUG);\n\n require_once 'HTML/Tree.php';\n\n $dbh = &SGL_DB::singleton();\n $roleId = SGL_Session::get('rid');\n $query = \"\n SELECT category_id as id, parent_id, label AS text\n FROM\n {$this->conf['table']['category']}\n WHERE\n $roleId NOT IN (COALESCE(perms, '-1'))\n ORDER BY parent_id, order_id\";\n $tree = &new Tree();\n $nodeList = array();\n\n // Perform query\n $result = $dbh->query($query);\n if (!PEAR::isError($result)) {\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n\n // Parent id is 0, thus root node.\n if (!$row['parent_id']) {\n unset($row['parent_id']);\n $nodeList[$row['id']] = &new Tree_Node($row);\n $tree->nodes->addNode($nodeList[$row['id']]);\n\n // Parent node has already been added to tree\n } elseif (!empty($nodeList[$row['parent_id']])) {\n $parentNode = &$nodeList[$row['parent_id']];\n unset($row['parent_id']);\n $nodeList[$row['id']] = &new Tree_Node($row);\n $parentNode->nodes->addNode($nodeList[$row['id']]);\n\n } else {\n // Orphan node ?\n }\n }\n } else SGL::raiseError('problem with Unordered List query');\n\n // jump into the cat tree at a predefined depth\n // if $id = 0 return the hole tree OR if $id != 0 return from $id branch\n $result = ($id) ? $nodeList[$id] : $tree;\n return $result;\n }", "function carton_walk_category_dropdown_tree() {\n\t$args = func_get_args();\n\n\t// the user's options are the third parameter\n\tif ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )\n\t\t$walker = new CTN_Product_Cat_Dropdown_Walker;\n\telse\n\t\t$walker = $args[2]['walker'];\n\n\treturn call_user_func_array(array( &$walker, 'walk' ), $args );\n}", "public function run()\n {\n $categories = [\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Gear', 'slug' => 'gear', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Parts', 'slug' => 'parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Casual', 'slug' => 'casual', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'News', 'slug' => 'news', 'sortorder' => 4, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Clothes', 'slug' => 'clothes', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Helmets', 'slug' => 'helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Boots', 'slug' => 'boots', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Suspension', 'slug' => 'suspension', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'maintenance', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Oils', 'slug' => 'oils', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'T-Sirts', 'slug' => 'tshirts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'Caps', 'slug' => 'caps', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Jerseys', 'slug' => 'jerseys', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Pants', 'slug' => 'pants', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-helmets', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-boots', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-boots', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Fork', 'slug' => 'fork-parts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Shock', 'slug' => 'shock-parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Airfilter', 'slug' => 'airfilter', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Oilfilter', 'slug' => 'oilfilter', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Brakepads', 'slug' => 'brakepads', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Engine Oils', 'slug' => 'engine-oils', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Suspension Oils', 'slug' => 'suspension-oils', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'bike-maintenance', 'sortorder' => 3, 'active' => 1],\n ];\n\n DB::table('categories')->insert($categories);\n }", "private function generateTree ( &$tree, $parentId = null ) {\r\n\t\tif ( !isset ( $parentId ) ) $parentId = 0;\r\n\t\t$param = array(\r\n\t\t\t'conditions' => array('parent_id' => $parentId, 'is_node' => 1),\r\n\t\t\t'fields' => array('id','lorder','rorder','CategoryDetail.name','CategoryDetail.icon_name'),\r\n\t\t\t'order' => array('CategoryDetail.name')\r\n\t\t );\r\n\t\t$arrRes = $this->Category->find('all', $param);\r\n\t\t\r\n\t\t$isFirst = false;\r\n\t\tif (!isset($tree) || empty($tree)) {\r\n\t\t\t$isFirst = true; \r\n\t\t\t$tree .= \"<ul class='menubar'>\";\r\n\t\t} else {\r\n\t\t\t$tree .= \"<ul><li class='li_top'></li>\";\r\n\t\t}\r\n\r\n \tforeach ( $arrRes as $key=>$node ) {\r\n \t\t$tree .= \"<li class='li_node \" . ($key == 0 ? 'first' : '') . \"' onmouseover='mover(this);' onmouseout='mout(this);'>\" .\r\n \t\t\t\t\t \"<a href='\" . SITE_URL . \"/category/\".$node['Category']['id'].\"' class='\" . \r\n \t\t\t\t\t $node['CategoryDetail']['icon_name'] . \"'>\".\r\n \t\t $node['CategoryDetail']['name'].\"</a>\";\r\n \t\tif ( $node['Category']['rorder'] - $node['Category']['lorder'] == 1 ) $tree .= \"</li>\";\r\n \t\telse {\r\n \t\t$this->generateTree ( $tree, $node['Category']['id'] );\r\n \t\t$tree .= \"</li>\";\r\n \t\t}\r\n \t}\r\n \tif (!$isFirst) $tree .= \"<li class='li_bottom'></li>\";\r\n \t\t$tree .= \"</ul>\";\r\n\t}", "function wp_dropdown_cats($current_cat = 0, $current_parent = 0, $category_parent = 0, $level = 0, $categories = 0)\n {\n }", "public function rebuildtree(){\n\t\t//Rebuild categories ads trigger count.\n\n\t\t//Rebuild nested set - get cat\n\t\tBLog::addToLog('[Items] rebuilding nested sets...');\n\t\t//\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\t//\n\t\t$catslist=$this->itemsFilter(array());\n\t\tBLog::addToLog('[Items] Total categories count:'.count($catslist).'...');\n\n\t\t$rootcats=array();\n\t\t//\n\t\tforeach($catslist as $cat){\n\t\t\t$cat->level=0;\n\t\t\t$cat->lft=0;\n\t\t\t$cat->rgt=0;\n\t\t\tif(empty($cat->{$this->parentKeyName})){\n\t\t\t\t$rootcats[]=$cat;\n\t\t\t\t}\n\t\t\t}\n\t\t//Sort root categories.\n\t\t$n=count($rootcats);\n\t\tBLog::addToLog('[Items] Root categories count:'.$n.'...');\n\t\tfor($i=0; $i<$n; $i++){\n\t\t\t$m=$i;\n\t\t\tfor($j=$i+1; $j<$n; $j++){\n\t\t\t\tif($rootcats[$j]->ordering < $rootcats[$m]->ordering){\n\t\t\t\t\t$m=$j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif($m!=$i){\n\t\t\t\t$t=$rootcats[$i];\n\t\t\t\t$rootcats[$i]=$rootcats[$m];\n\t\t\t\t$rootcats[$m]=$t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t//Foreach by root categories...\n\t\tforeach($rootcats as $rcat){\n\t\t\tBLog::addToLog('[Items] Processing root category ['.$rcat->id.']');\n\n\t\t\t$rcat->level=1;\n\t\t\t$lft=1; $rgt=2;\n\t\t\t$this->rebuildtree_recursive($rcat,$lft,$rgt);\n\t\t\t$rcat->lft=1;\n\t\t\t$rcat->rgt=$rgt;\n\t\t\t}\n\t\t$db=\\Brilliant\\BFactory::getDBO();\n\t\tif(empty($db)){\n\t\t\treturn false;\n\t\t\t}\n\t\tBLog::addToLog('[Items] Updating nested set...');\n\t\tforeach($catslist as $ct){\n\t\t\t$qr='UPDATE `'.$this->tableName.'` set `'.$this->leftKeyName.'`='.$ct->lft.', `'.$this->rightKeyName.'`='.$ct->rgt.', `'.$this->levelKeyName.'`='.$ct->level.' WHERE `'.$this->primaryKeyName.'`='.$ct->id;\n\t\t\t$q=$db->query($qr);\n\t\t\tif(empty($q)){\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t//Invalidate all cache.\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\treturn true;\n\t\t}", "function get_category_tree_control_shop($current_category_id, $user_id, $control = false, $params = array())\n {\n //print_r($params);\n //echo '$current_category_id = '.$current_category_id;\n $category_structure = $this->loadCategoryStructure();\n $data_structure = $this->load_data_structure_shop($user_id, $params);\n //echo '<pre>';\n //print_r($data_structure);\n //print_r($category_structure);\n\n foreach ($category_structure['catalog'] as $cat_point) {\n $ch = 0;\n $this->getChildsItemsCount($cat_point['id'], $category_structure['childs'], $data_structure['data'][$user_id], $ch);\n\n $data_structure['data'][$user_id][$cat_point['id']] += $ch;\n }\n\n\n $level = 0;\n $rs = '';\n $rs .= '<table border=\"0\">';\n $rs .= '<tr>';\n $rs .= '<td class=\"row_title\">' . Multilanguage::_('L_TEXT_TITLE') . '</td>';\n $rs .= '<td class=\"row_title\"></td>';\n $rs .= '</tr>';\n foreach ($category_structure['childs'][0] as $item_id => $catalog_id) {\n //echo $catalog_id.'<br>';\n $rs .= $this->get_row_control($catalog_id, $category_structure, $level, 'row1', $user_id, $control, $data_structure, $current_category_id, $params);\n $rs .= $this->get_child_nodes_row_control($catalog_id, $category_structure, $level + 1, $current_category_id, $user_id, $control, $data_structure, $params);\n }\n $rs .= '</table>';\n return $rs;\n }", "public static function treeCategories(): array\n {\n return JEasyUi::jsonFormat(self::parentCategories());\n }", "public function testSortByHierarchy() {\n // Create\n $this->phactory->create('kb_category');\n\n // Sort them\n $categories = $this->kb_category->sort_by_hierarchy();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertNotNull( $category->depth );\n }", "protected function _buildRecursiveTree($selected_cat,$cats = array())\n\t{\n\t\t//Get selected cat node\n\t\tif ($this->_ebay_store_flag==0)\n\t\t{\n\t\t\t$cat = $this->load($selected_cat,'category_id');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cat = $this->loadByStore($selected_cat);\n\t\t}\t\t\n\t\t\n\t\t$parent_id = $cat->getCategoryParentId();\n\t\t\n\t\t//If level = 1\n\t\tif ($cat->getCategoryLevel()==1)\n\t\t{\n\t\t\t//Set children\n\t\t\t$children = $cats;\n\t\t\t\n\t\t\t//Set sisters\n\t\t\t$cats = $this->_addChildren(null);\n\t\t\t\n\t\t\t\n\t\t\t$checked = 0;\t\t\t\n\t\t\tforeach ($cats as $key => $value)\n\t\t\t{\n\t\t\t\tif ($value['id']==$selected_cat)\n\t\t\t\t{\n\t\t\t\t\t$cats[$key]['children'] = $children;\n\t\t\t\t\t$cats[$key]['expanded'] = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//For the level1-categories which are checked (mostly ebay store categories)\n\t\t\t\tif ($value['id']==$this->_dataset_stored_category_id)\n\t\t\t\t{\n\t\t\t\t\t$cats[$key]['checked'] = true;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t\n\t\t\t//echo \"--end\".$selected_cat.\"--\";\t\n\t\t\t\n\t\t\treturn array(\n\t \t\t'text' => 'Root (0)',\n\t \t\t'id' => 1,\n\t \t\t\t'store' => 0,\n\t \t\t\t'path' => 1,\n\t \t\t\t'cls' => 'folder active-category',\n\t \t\t'allowDrop' => true,\n\t \t\t'allowDrag' => true,\n\t\t\t\t'expanded' => true,\n\t \t\t'children' => $cats, \n\t\t\t);\n\t\t}\t\n\t\telseif (count($cats)==0)\n\t\t{\n\t\t\t//Beginning of all\n\t\t\t\n\t\t\t//Get all sister cats\n\t\t\t$sisters = $this->_addChildren($parent_id,$selected_cat);\n\t\t\n\t\t\t//Go on building\n\t\t\treturn $this->_buildRecursiveTree($parent_id,$sisters);\t\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\t//in the middle of the work\n\t\t\t\n\t\t\t//Set children\n\t\t\t$children = $cats;\t\n\t\t\t\n\t\t\t//Set sisters\n\t\t\t$cats = $this->_addChildren($parent_id);\n\t\t\t\n\t\t\tif (is_array($cats))\n\t\t\t{\n\t\t\t\tforeach ($cats as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif ($value['id']==$selected_cat)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cats[$key]['children'] = $children;\n\t\t\t\t\t\t$cats[$key]['expanded'] = true;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t//Go on building\n\t\t\treturn $this->_buildRecursiveTree($parent_id,$cats);\t\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $cats;\n\t}", "function get_prefix($CategoryID)\n{\n global $tpl, $template, $config, $mysql, $lang, $twig, $prefixed;\n $ParentID = $mysql->result('SELECT parent_id FROM '.prefix.'_eshop_categories WHERE id = '.$CategoryID.' ');\n \n $prefixed[$CategoryID]['f'] .= '&nbsp;&nbsp;&nbsp;';\n #$add_prefix .= '&nbsp;&nbsp;&nbsp;'; \n {\n if ($ParentID == 0) \n { \n $add_prefix .= ''; \n }\n else\n {\n $prefixed[$CategoryID]['s'] .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\">&nbsp;&nbsp;&nbsp;';\n $add_prefix .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\">&nbsp;&nbsp;&nbsp;';\n \n foreach ($mysql->select(\"SELECT * FROM \".prefix.\"_eshop_categories WHERE id=\".$ParentID.\" \") as $row2)\n {\n $CategoryID2 = $row2['id']; \n $ParentID2 = $row2['parent_id'];\n }\n\n get_prefix($CategoryID2);\n }\n }\n #var_dump($prefixed[$CategoryID]);\n return $add_prefix;\n}", "function jigoshop_categories_ordering () {\n\n\tglobal $wpdb;\n\t\n\t$id = (int)$_POST['id'];\n\t$next_id = isset($_POST['nextid']) && (int) $_POST['nextid'] ? (int) $_POST['nextid'] : null;\n\t\n\tif( ! $id || ! $term = get_term_by('id', $id, 'product_cat') ) die(0);\n\t\n\tjigoshop_order_categories ( $term, $next_id);\n\t\n\t$children = get_terms('product_cat', \"child_of=$id&menu_order=ASC&hide_empty=0\");\n\tif( $term && sizeof($children) ) {\n\t\techo 'children';\n\t\tdie;\t\n\t}\n\t\n}", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "function renderTree($tree, $options)\n {\n $current_depth = 0;\n $counter = 0;\n $result = '';\n $folders = isset($options['folders']);\n $plans = isset($options['plans']);\n\n foreach($tree as $node)\n {\n $curr = $node['Category'];\n $node_depth = $curr['level'];\n $node_name = $curr['title'];\n $node_id = $curr['cat_id'];\n $node_count = $curr['listing_count'];\n\n if($node_depth == $current_depth)\n {\n if($counter > 0) $result .= '</li>';\n }\n elseif($node_depth > $current_depth)\n {\n $result .= '<ul'.($folders ? ' class=\"filetree\"' : '').'>';\n $current_depth = $current_depth + ($node_depth - $current_depth);\n }\n elseif($node_depth < $current_depth)\n {\n $result .= str_repeat('</li></ul>',$current_depth - $node_depth).'</li>';\n $current_depth = $current_depth - ($current_depth - $node_depth);\n }\n $result .= '<li class=\"jr-tree-cat-'.$node_id.' closed\"';\n $result .= '>';\n $folders and $result .= '<span class=\"folder\">&nbsp;';\n $result .= !$plans ?\n $this->Routes->category($node)\n :\n $this->Routes->category($node,array(\"onclick\"=>\"JRPaid.Plans.load({'cat_id':\".$node_id.\"});return false;\"))\n ;\n $this->Config->dir_cat_num_entries and $result .= ' (' .$node_count . ')';\n $folders and $result .= '</span>';\n ++$counter;\n }\n\n $result .= str_repeat('</li></ul>',$node_depth);\n\n return $result;\n }", "public function createCategory();", "public static function getCategoryTree($doctrine) {\n $categories = $doctrine->getRepository(\"AppBundle:Category\")->findBy([], ['name' => 'ASC']);\n $cat_tree = array(); \n \n foreach($categories as $category) {\n if($category->getName() === \"No parent category\") {\n continue;\n }\n \n if(! $category->getParent()) {\n $cat_tree[$category->getName()] = array();\n $cat_tree[$category->getName()][] = $category; \n }\n }\n \n foreach($categories as $category) {\n if($category->getName() === \"No parent category\") {\n continue;\n }\n \n if($category->getParent()) {\n $cat_tree[$category->getParent()->getName()][] = $category; \n }\n }\n \n ksort($cat_tree, SORT_FLAG_CASE);\n \n return $cat_tree;\n }", "function get_category_tree_control($current_category_id, $user_id, $control = false, $params = array(), $search_params = array())\n {\n // @todo: $user_id нужно добавить проверку на массив в этом значении и генерировать контрол в соответствии с массивом\n // user_id\n\n $category_structure = $this->loadCategoryStructure();\n $data_structure = $this->load_data_structure($user_id, $params, $search_params);\n //print_r($data_structure);\n if (is_array($category_structure['catalog']) && count($category_structure['catalog']) > 0) {\n foreach ($category_structure['catalog'] as $cat_point) {\n $ch = 0;\n $this->getChildsItemsCount($cat_point['id'], $category_structure['childs'], $data_structure['data'][$user_id], $ch);\n if (!isset($data_structure['data'][$user_id][$cat_point['id']])) {\n $data_structure['data'][$user_id][$cat_point['id']] = 0;\n }\n $data_structure['data'][$user_id][$cat_point['id']] += $ch;\n }\n }\n unset($params['active']);\n unset($params['hot']);\n\n $level = 0;\n $rs = '';\n $rs .= '<table border=\"0\" width=\"100%\" class=\"table table-hover\">';\n if (is_array($category_structure['childs'][0]) && count($category_structure['childs'][0]) > 0) {\n foreach ($category_structure['childs'][0] as $item_id => $catalog_id) {\n //echo $catalog_id.'<br>';\n $rs .= $this->get_row_control($catalog_id, $category_structure, $level, 'row1', $user_id, $control, $data_structure, $current_category_id, $params);\n $rs .= $this->get_child_nodes_row_control($catalog_id, $category_structure, $level + 1, $current_category_id, $user_id, $control, $data_structure, $params);\n }\n }\n $rs .= '</table>';\n return $rs;\n }", "function _arrangeCategory(&$document_category, $list, $depth)\n\t{\n\t\tif(!count($list)) return;\n\t\t$idx = 0;\n\t\t$list_order = array();\n\t\tforeach($list as $key => $val)\n\t\t{\n\t\t\t$obj = new stdClass;\n\t\t\t$obj->mid = $val['mid'];\n\t\t\t$obj->module_srl = $val['module_srl'];\n\t\t\t$obj->category_srl = $val['category_srl'];\n\t\t\t$obj->parent_srl = $val['parent_srl'];\n\t\t\t$obj->title = $obj->text = $val['text'];\n\t\t\t$obj->description = $val['description'];\n\t\t\t$obj->expand = $val['expand']=='Y'?true:false;\n\t\t\t$obj->color = $val['color'];\n\t\t\t$obj->document_count = $val['document_count'];\n\t\t\t$obj->depth = $depth;\n\t\t\t$obj->child_count = 0;\n\t\t\t$obj->childs = array();\n\t\t\t$obj->grant = $val['grant'];\n\n\t\t\tif(Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) $selected = true;\n\t\t\telse $selected = false;\n\n\t\t\t$obj->selected = $selected;\n\n\t\t\t$list_order[$idx++] = $obj->category_srl;\n\t\t\t// If you have a parent category of child nodes apply data\n\t\t\tif($obj->parent_srl)\n\t\t\t{\n\t\t\t\t$parent_srl = $obj->parent_srl;\n\t\t\t\t$document_count = $obj->document_count;\n\t\t\t\t$expand = $obj->expand;\n\t\t\t\tif($selected) $expand = true;\n\n\t\t\t\twhile($parent_srl)\n\t\t\t\t{\n\t\t\t\t\t$document_category[$parent_srl]->document_count += $document_count;\n\t\t\t\t\t$document_category[$parent_srl]->childs[] = $obj->category_srl;\n\t\t\t\t\t$document_category[$parent_srl]->child_count = count($document_category[$parent_srl]->childs);\n\t\t\t\t\tif($expand) $document_category[$parent_srl]->expand = $expand;\n\n\t\t\t\t\t$parent_srl = $document_category[$parent_srl]->parent_srl;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$document_category[$key] = $obj;\n\n\t\t\tif(count($val['list'])) $this->_arrangeCategory($document_category, $val['list'], $depth+1);\n\t\t}\n\t\t$document_category[$list_order[0]]->first = true;\n\t\t$document_category[$list_order[count($list_order)-1]]->last = true;\n\t}", "function draw_categories_tree($parentTree = array(), $routing, $arrow = '')\n{\n $criteria = new Criteria();\n CategoryPeer::addPublicCriteria($criteria);\n $categories = CategoryPeer::getFirstLevel($criteria);\n $currentCategoryId = get_current_category_id();\n \n if ($categories !== null) {\n \n $categoriesTree = array();\n get_categories_tree($categories, $categoriesTree, $parentTree, $criteria, false);\n \n $list = '<ul class=\"categories_tree\">';\n \n foreach ($categoriesTree as $category) {\n \n $seperator = '';\n $i = $category['level'];\n \n while ($i > 1) {\n $seperator.= '&nbsp;&nbsp;&nbsp;&nbsp;';\n $i--;\n }\n \n if ($currentCategoryId == $category['id']) {\n $title = '<b>' . $category['title'] . '</b>';\n }\n else {\n $title = $category['title'];\n }\n \n $list.= '<li>' . $seperator . $arrow . '&nbsp;' . link_to($title, $routing . '?path='.$category['path']) . '</li>';\n }\n \n $list.='</ul>';\n \n return $list;\n }\n}", "public function findCategories();", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "function get_category_array() {\n $args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n );\n return get_categories($args);\n}", "function oab_getSwappzaCategoryTree($dbcon) {\n $categories = array();\n $categoriesFinal = array();\n \n //Fetch Categories\n $stmt = $dbcon->prepare(\"SELECT categoryID,name\"\n . \" FROM SwappzaCategory WHERE ?\");\n \n if ($stmt) {\n $one = 1;\n $stmt->bind_param('d', $one);\n $stmt->execute();\n $stmt->bind_result($categoryID, $name);\n\n while ($stmt->fetch()) {\n array_push($categories, new SwappzaCategory($categoryID, $name, \"\", array()));\n }\n \n $stmt->close();\n \n //Fetch Subcategory for each category\n foreach($categories as $category) {\n $stmt = $dbcon->prepare(\"SELECT SwappzaSubCategory.subcategoryID, SwappzaSubCategory.name\"\n . \" FROM SwappzaSubCategoryOf\"\n . \" JOIN SwappzaSubCategory ON SwappzaSubCategoryOf.subcategoryID=SwappzaSubCategory.subcategoryID\"\n . \" WHERE SwappzaSubCategoryOf.categoryID=?\");\n \n if ($stmt) {\n $id = $category->getID();\n $stmt->bind_param('d', $id);\n $stmt->execute();\n $stmt->bind_result($subcategoryID, $subcategoryName);\n \n $subCategories = array();\n \n while($stmt->fetch()) {\n array_push($subCategories, new SwappzaSubCategory($subcategoryID, $subcategoryName, ''));\n }\n \n array_push($categoriesFinal,\n new SwappzaCategory(\n $category->getID(),\n $category->getName(),\n $category->getDescription(),\n $subCategories\n ));\n \n $stmt->close();\n } else {\n error_log(\"failed to prepare second statement from oab_getSwappzaCategoryTree in swappza.php\");\n }\n } \n \n } else {\n error_log(\"failed to prepare first statement from oab_getSwappzaCategoryTree in swappza.php\");\n }\n \n return $categoriesFinal; \n}", "public function run()\n {\n\n $categories = [\n ['name'=>'Electronics','is_parent'=>1], //1\n ['name'=>'Mobile','parent_id'=>1], //2\n ['name'=>'Tablets','parent_id'=>1], \n ['name'=>'Laptops','parent_id'=>1], \n \n ['name'=>'kitchn','is_parent'=>true], //5\n ['name'=>'cup','parent_id'=>5], //4\n ['name'=>'furniture','parent_id'=>5], //4\n\n ['name'=>'Personal Care','is_parent'=>true], //8\n ['name'=>'Mens grooming','parent_id'=>8], //4\n ['name'=>'Foundation','parent_id'=>8], //4\n\n ['name'=>'Grocery & Pets','is_parent'=>true], //11\n ['name'=>'Beverages','parent_id'=>11], //4\n ['name'=>'Breakfast','parent_id'=>11], //4\n \n ];\n foreach($categories as $category){\n Category::create([\n 'name'=>$category['name'],\n 'slug'=>Str::slug($category['name']),\n 'is_parent'=>$category['is_parent'] ?? 0,\n 'parent_id'=>$category['parent_id'] ?? null\n ]);\n }\n\n // $categories = [\n // [\n // 'name' => 'Electronics',\n // 'subCategory' => ['Mobile', 'Tablets', 'Laptops', 'Desktops', 'Televisions', 'Gaming Consoles', 'Printers']\n // ],\n // [\n // 'name' => 'Electronic Accessories',\n // 'subCategory' => ['Phone Cases', 'Chargers', 'Headphones', 'SmartWatches', 'BlueTooth Speakers', 'Screen protectors']\n // ],\n // [\n // 'name' => 'Personal Care',\n // 'subCategory' => ['Mens grooming', 'Mens grooming', 'Foundation', 'Deodrants', 'Female hygiene', 'Soap handwash', 'Skin care', 'Hair care']\n // ],\n // [\n // 'name' => 'Babys & Toys',\n // 'subCategory' => ['Disposable Diapers', 'Baby Gear', 'Personal Care', 'Toys & Games']\n // ],\n // [\n // 'name' => 'Grocery & Pets',\n // 'subCategory' => ['Beverages', 'Breakfast', 'Fruits', 'Vegetables', 'Pet Food', 'Daily Food']\n // ],\n // [\n // 'name' => 'Home & Lifestyle',\n // 'subCategory' => ['Bath', 'Bedding', 'Decor', 'Furniture', 'Appliances & Electicals', 'Kitchen Utensils']\n // ],\n // [\n // 'name' => 'Sports & Outdoors',\n // 'subCategory' => ['Mens Collections', 'Womens Collections', 'Exercise & Fitness', 'Travel & Luggage']\n // ],\n // [\n // 'name' => 'AutoMotive & Motorbike',\n // 'subCategory' => ['Auto Motive', 'Motorcycle', 'Moto Parts & Accessories', 'Riding gear']\n // ],\n // ];\n\n // foreach ($categories as $category) {\n\n // $newCategory = Category::create([\n // 'category_name' => $category['name'],\n // ]);\n // foreach ($category['subCategory'] as $item) {\n // $subcategory = SubCategory::create([\n // 'category_id' => $newCategory->id,\n // 'subCategory_name' => $item,\n // ]);\n // }\n // }\n }", "public function getTransformer()\n {\n return new CategoryTransformer();\n }", "function showCategoryList(&$category_tree, $type_text, $level = 0) {\n\t$row_idx = 1;\n\t\n foreach ($category_tree as $category) {\n?>\n <tr class=\"row_style_<?php echo $row_idx; ?>\">\n\t\t\t<td></td>\n \t<td class=\"left\"><?php echo str_repeat('&nbsp;--', $level).'&nbsp;'.$category->name; ?></td>\n \t<td>\n \t <a href=\"#\" onclick=\"select_for_menu_item('<?php echo $type_text.' - '.$category->name; ?>', '<?php echo $category->id; ?>'); return false;\">\n \t <?php _e('Select'); ?></a>\n \t</td>\n </tr>\n<?php\n $row_idx = 1 - $row_idx;\n \n if (sizeof($category->slaves['ProductCategory']) > 0) {\n $level++;\n showCategoryList($category->slaves['ProductCategory'], $type_text, $level);\n $level--;\n }\n }\n}", "private function createTree() {\n\t\t$html = $this->getSpec();\n\t\t$html .= '<div class=\"tal_clear\"></div>';\n\t\t$html .= $this->getSkills();\n\n\t\treturn $html;\n\t}", "function make_list($data, $options = array())\n\t{\n\t\tif (count($data) == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$menu_data = array(\n\t\t\t'items' => array(),\n\t\t\t'parents' => array()\n\t\t);\n\t\t\n\t\tforeach ($data as $menu_item)\n\t\t{\n\t\t\t$menu_data['items'][$menu_item['cat_id']] = $menu_item;\n\t\t\t$menu_data['parents'][$menu_item['cat_parent']][] = $menu_item['cat_id'];\n\t\t}\n\t\t\n\t\t$parent_id = 0;\n\t\t\n\t\tif (isset($options['parent_id']))\n\t\t{\n\t\t\t$parent_id = $options['parent_id'];\n\t\t}\n\t\t\n\t\t// Here we setup the bench mark just to be sure this doesn't runaway.\n\t\t$this->_ci->benchmark->mark('walk_categories_start');\n\t\t\n\t\t$cats = $this->_walk_categories($parent_id, $menu_data, $options);\n\t\t\n\t\t$this->_ci->benchmark->mark('walk_categories_end');\n\t\t\n\t\treturn $cats;\n\t}", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "function dropdown_categories($default_category = 0, $category_parent = 0, $popular_ids = array())\n {\n }", "public function fancytreeSupportData()\n {\n $processReaction = $this->manageCategoryEngine\n ->getAllCategories();\n\n return __processResponse($processReaction, [], $processReaction['data']);\n }", "function get_categories($root,$level,$current,$reference=\"menu\")\n {\n //we need a numeric value for category - if category is not present becasue we have just landed then set to 0 so as not to\n //break the open menu item selection below\n if (!is_numeric($current)) $current=0;\n $table_reference=ucfirst($type_reference).\"Category\";\n $key_reference=$type_reference.\"CategoryID\";\n $category=get_category($root);\n $category_item_count=1;\n if ($reference==\"select\")\n {\n $cs.=\"<option value='\".$category[\"categoryID\"].\"'\";\n if ($current==$category[\"categoryID\"])\n $cs.=\" selected='selected' \";\n $cs.=\">\".$category[\"categoryName\"].\"</option>\";\n }\n else\n {\n if ($current==$category[\"categoryID\"]) $id=\" id='snav_sel' \";\n $cs.=\"<span \".$id.\" class='snav_item snav\".$level.\" left'><a href='\".build_category_link($category).\"'>\".$category[\"categoryName\"].\"</a></span>\";\n }\n $count_subs=get_sub_categories($root);\n if (mysql_num_rows($count_subs)>0)\n {\n if ($reference==\"menu\")\n {\n //for menus an extra bit of logic to keep the item open - using the parent will keep both the categories open if this is\n //a third level current category\n $current_selected_category=get_category($current);\n if (is_numeric($current_selected_category[\"parentID\"]))\n {\n $current_selected_category_parent=get_category($current_selected_category[\"parentID\"]); \n }\n if ($current==$category[\"categoryID\"]||$current_selected_category[\"parentID\"]==$category[\"categoryID\"]||$current_selected_category_parent[\"parentID\"]==$category[\"categoryID\"])\n {\n $level++;\n while ($sub=mysql_fetch_array($count_subs))\n {\n $cs.=get_categories($sub[\"categoryID\"],$level,$current);\n }\n }\n }\n else\n {\n //for everything else the whole shebang should be displayed - so no logic like above\n $level++;\n while ($sub=mysql_fetch_array($count_subs))\n {\n $cs.=get_categories($sub[\"categoryID\"],$level,$current,$reference);\n }\n }\n }\n return $cs;\n }", "public function set_product_categories( $browseNodes=array() )\n\t {\n\t // The woocommerce product taxonomy\n\t $wooTaxonomy = \"product_cat\";\n \n\t // Categories for the product\n\t $createdCategories = array();\n\t \n\t // Category container\n\t $categories = array();\n\t \n\t // Count the top browsenodes\n\t $topBrowseNodeCounter = 0;\n\t\t\t\n\t\t\tif ( !isset($browseNodes['BrowseNode']) ) {\n\t \t// Delete the product_cat_children\n\t \t// This is to force the creation of a fresh product_cat_children\n\t \t//delete_option( 'product_cat_children' );\n\t\t\t\n\t\t\t\treturn array();\n\t\t\t}\n\n\t // Check if we have multiple top browseNode\n\t if( is_array( $browseNodes['BrowseNode'] ) )\n\t {\n\t \t// check if is has only one key\n\t \tif( isset($browseNodes[\"BrowseNode\"][\"BrowseNodeId\"]) && trim($browseNodes[\"BrowseNode\"][\"BrowseNodeId\"]) != \"\" ){\n\t \t\t$_browseNodes = $browseNodes[\"BrowseNode\"];\n\t \t\t$browseNodes = array();\n\t\t\t\t\t$browseNodes['BrowseNode'][0] = $_browseNodes;\n\t\t\t\t\tunset($_browseNodes);\n\t \t}\n \n\t foreach( $browseNodes['BrowseNode'] as $browseNode )\n\t {\n\t // Create a clone\n\t $currentNode = $browseNode;\n\t\n\t // Track the child layer\n\t $childLayer = 0;\n\t\n\t // Inifinite loop, since we don't know how many ancestral levels\n\t while( true )\n\t {\n\t $validCat = true;\n\t \n\t // Replace html entities\n\t $dmCatName = str_replace( '&', 'and', $currentNode['Name'] );\n\t $dmCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$dmCatSlug_id = '';\n\t\t\t\t\t\tif ( is_object($currentNode) && isset($currentNode->BrowseNodeId) )\n\t \t$dmCatSlug_id = ($currentNode->BrowseNodeId);\n\t\t\t\t\t\telse if ( is_array($currentNode) && isset($currentNode['BrowseNodeId']) )\n\t\t\t\t\t\t\t$dmCatSlug_id = ($currentNode['BrowseNodeId']);\n\n\t\t\t\t\t\t// $dmCatSlug = ( !empty($dmCatSlug_id) ? $dmCatSlug_id . '-' . $dmCatSlug : $dmCatSlug );\n\n\t $dmTempCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t \n\t if( $dmTempCatSlug == 'departments' ) $validCat = false;\n\t if( $dmTempCatSlug == 'featured-categories' ) $validCat = false;\n\t \tif( $dmTempCatSlug == 'categories' ) $validCat = false;\n\t\t\t\t\t\tif( $dmTempCatSlug == 'products' ) $validCat = false;\n\t if( $dmTempCatSlug == 'all-products') $validCat = false;\n\t\n\t // Check if we will make the cat\n\t if( $validCat ) {\n\t $categories[0][] = array(\n\t 'name' => $dmCatName,\n\t 'slug' => $dmCatSlug\n\t );\n\t }\n\t\n\t // Check if the current node has a parent\n\t if( isset($currentNode['Ancestors']['BrowseNode']['Name']) )\n\t {\n\t // Set the next Ancestor as the current node\n\t $currentNode = $currentNode['Ancestors']['BrowseNode'];\n\t $childLayer++;\n\t continue;\n\t }\n\t else\n\t {\n\t // There's no more ancestors beyond this\n\t break;\n\t }\n\t } // end infinite while\n\t \n\t // Increment the tracker\n\t $topBrowseNodeCounter++;\n\t } // end foreach\n\t }\n\t else\n\t {\n\t // Handle single branch browsenode\n\t \n\t // Create a clone\n\t $currentNode = isset($browseNodes['BrowseNode']) ? $browseNodes['BrowseNode'] : array();\n\t \n\t // Inifinite loop, since we don't know how many ancestral levels\n\t while (true) \n\t {\n\t // Always true unless proven\n\t $validCat = true;\n\t \n\t // Replace html entities\n\t $dmCatName = str_replace( '&', 'and', $currentNode['Name'] );\n\t $dmCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t\t\t\t\t$dmCatSlug_id = $currentNode['BrowseNodeId'];\n\t // $dmCatSlug = ( !empty($dmCatSlug_id) ? $dmCatSlug_id . '-' . $dmCatSlug : $dmCatSlug ); \n\t \n\t $dmTempCatSlug = sanitize_title( str_replace( '&', 'and', $currentNode['Name'] ) );\n\t \n\t\t\t\t\tif( $dmTempCatSlug == 'departments' ) $validCat = false;\n if( $dmTempCatSlug == 'featured-categories' ) $validCat = false;\n \tif( $dmTempCatSlug == 'categories' ) $validCat = false;\n\t\t\t\t\tif( $dmTempCatSlug == 'products' ) $validCat = false;\n if( $dmTempCatSlug == 'all-products') $validCat = false;\n\t \n\t // Check if we will make the cat\n\t if( $validCat ) {\n\t $categories[0][] = array(\n\t 'name' => $dmCatName,\n\t 'slug' => $dmCatSlug\n\t );\n\t }\n\t\n\t // Check if the current node has a parent\n\t if (isset($currentNode['Ancestors']['BrowseNode']['Name'])) \n\t {\n\t // Set the next Ancestor as the current node\n\t $currentNode = $currentNode['Ancestors']['BrowseNode'];\n\t continue;\n\t } \n\t else \n\t {\n\t // There's no more ancestors beyond this\n\t break;\n\t }\n\t } // end infinite while\n\t \n\t } // end if browsenode is an array\n\t \n\t // Tracker\n\t $catCounter = 0;\n\t \n\t // Make the parent at the top\n\t foreach( $categories as $category )\n\t {\n\t $categories[$catCounter] = array_reverse( $category );\n\t $catCounter++;\n\t }\n\t \n\t // Current top browsenode\n\t $categoryCounter = 0;\n\t \n\t // Import only parent category from Amazon\n\t\t\tif( isset( $this->amz_settings[\"create_only_parent_category\"] ) && $this->amz_settings[\"create_only_parent_category\"] != '' && $this->amz_settings[\"create_only_parent_category\"] == 'yes') {\n\t\t\t\t$categories = array( array( $categories[0][0] ) );\n\t\t\t}\n\t\t\t\n\t\t\t// Loop through each of the top browsenode\n\t foreach( $categories as $category )\n\t {\n\t // The current node\n\t $nodeCounter = 0;\n\t // Loop through the array of the current browsenode\n\t foreach( $category as $node )\n\t {\n\t // Check if we're at parent\n\t if( $nodeCounter === 0 )\n\t { \n\t // Check if term exists\n\t $checkTerm = term_exists( str_replace( '&', 'and', $node['slug'] ), $wooTaxonomy );\n\t if( empty( $checkTerm ) )\n\t {\n\t // Create the new category\n\t $newCat = wp_insert_term( $node['name'], $wooTaxonomy, array( 'slug' => $node['slug'] ) );\n\t \n\t // Add the created category in the createdCategories\n\t // Only run when the $newCat is an error\n\t if( gettype($newCat) != 'object' ) {\n\t \t\t$createdCategories[] = $newCat['term_id'];\n\t } \n\t }\n\t else\n\t {\n\t // if term already exists add it on the createdCats\n\t $createdCategories[] = $checkTerm['term_id'];\n\t }\n\t }\n\t else\n\t { \n\t // The parent of the current node\n\t $parentNode = $categories[$categoryCounter][$nodeCounter - 1];\n\t // Get the term id of the parent\n\t $parent = term_exists( str_replace( '&', 'and', $parentNode['slug'] ), $wooTaxonomy );\n\t \n\t // Check if the category exists on the parent\n\t $checkTerm = term_exists( str_replace( '&', 'and', $node['slug'] ), $wooTaxonomy );\n\t \n\t if( empty( $checkTerm ) )\n\t {\n\t $newCat = wp_insert_term( $node['name'], $wooTaxonomy, array( 'slug' => $node['slug'], 'parent' => $parent['term_id'] ) );\n\t \n\t // Add the created category in the createdCategories\n\t $createdCategories[] = $newCat['term_id'];\n\t }\n\t else\n\t {\n\t $createdCategories[] = $checkTerm['term_id'];\n\t }\n\t }\n\t \n\t $nodeCounter++;\n\t } \n\t \n\t $categoryCounter++;\n\t } // End top browsenode foreach\n\t \n\t // Delete the product_cat_children\n\t // This is to force the creation of a fresh product_cat_children\n\t delete_option( 'product_cat_children' );\n\t \n\t $returnCat = array_unique($createdCategories);\n\t \n\t // return an array of term id where the post will be assigned to\n\t return $returnCat;\n\t }", "public function create(Request $request)\n {\n $validator = \\MyAuth::checkCategoryField($request->only('name')['name']);\n\n if($validator->passes()){\n if($request['selected_type'] === 'root'){\n // add the new root category\n $node = Category::create(['name' => $request->only('name')['name']]);\n } else if($request['selected_type'] === 'flat'){\n // add the category to the current level\n $node = Category::where('id', '=', $request['category_id'])->first();\n $child = Category::create(['name' => $request->only('name')['name']]);\n $child->makeSiblingOf($node);\n } else if($request['selected_type'] === 'child'){\n // add the category to the current node as a child\n $node = Category::where('id', '=', $request['category_id'])->first();\n $child = Category::create(['name' => $request->only('name')['name']]);\n $child->makeChildOf($node);\n } else{\n $node = 'error';\n }\n $json = array();\n $json['tree'] = $node;\n } else {\n $json['errors'] = $validator->messages();\n }\n\n return response()->json($json);\n }", "function renderDirectory($tree)\n {\n $current_depth = 0;\n $counter = 0;\n $result = '';\n\n\t\t$columns = $this->Config->dir_columns ? $this->Config->dir_columns : 2;\n\t\t$width = (int) (99/$columns);\n\t\t$first_level_count = 0;\n\n foreach($tree as $node)\n {\n $curr = $node['Category'];\n $node_depth = $curr['level'];\n $node_name = $curr['title'];\n $node_id = $curr['cat_id'];\n $node_count = $curr['listing_count'];\n\n if($node_depth == $current_depth)\n {\n if($counter > 0) $result .= '</div></li>';\n\n }\n elseif($node_depth > $current_depth)\n {\n $result .= '<ul>';\n $current_depth = $current_depth + ($node_depth - $current_depth);\n\n }\n elseif($node_depth < $current_depth)\n {\n $result .= str_repeat('</div></li></ul>',$current_depth - $node_depth).'</div></li>';\n $current_depth = $current_depth - ($current_depth - $node_depth);\n }\n\n\t\t\tif ($current_depth == 1)\n\t\t\t{\n\t\t\t\t$params = json_decode($node['Category']['params'],true);\n\t\t\t\tif (!empty($params['image'])) {\n\t\t\t\t\t$image_container = '<div class=\"jrListingThumbnail\">'. $this->Routes->category($node,array('image'=>true)) . '</div>';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$image_container = '';\n\t\t\t\t}\n\n\t\t\t\tif ($first_level_count == $columns)\n\t\t\t\t{\n\t\t\t\t\t$result .= '<li class=\"jrCatLevel' . $current_depth . '\" style=\"width: '. $width .'%; clear: both;\">' . $image_container;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$result .= '<li class=\"jrCatLevel' . $current_depth . '\" style=\"width: '. $width .'%;\">' . $image_container;\n\t\t\t\t}\n\t\t\t\t$first_level_count++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result .= '<li class=\"jrCatLevel' . $current_depth . '\">';\n\t\t\t}\n\t\t\t$result .= '<div class=\"jrContentDiv\">';\n $result .= $this->Routes->category($node);\n $this->Config->dir_cat_num_entries and $result .= ' (' .$node_count . ')';\n ++$counter;\n }\n\n\t\t$result .= str_repeat('</div></li></ul>',$node_depth);\n\n return $result;\n }", "public function category_tree($data = array(), $id = 'cat_id', $parent = 'cat_parent')\n\t{\n\t\tif ( ! is_array($data) OR count($data) == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tforeach ($data as $row)\n\t\t{\n\t\t\t// This assigns all the select fields to the array.\n\t\t\tforeach ($row AS $key => $val)\n\t\t\t{\n\t\t\t\t$arr[$key] = $val;\n\t\t\t}\n\t\t\t\n\t\t\t$menu_array[$row[$id]] = $arr;\n\t\t}\n\t\t\n\t\tunset($arr);\n\t\t\n\t\tforeach($menu_array as $key => $val)\n\t\t{\n\t\t\tif (0 == $val[$parent])\n\t\t\t{\n\t\t\t\t$depth = 0;\n\t\t\t\tforeach ($val AS $the_key => $the_val)\n\t\t\t\t{\n\t\t\t\t\t$arr[$the_key] = $the_val;\n\t\t\t\t}\n\t\t\t\t$this->_categories[$key] = $arr;\n\t\t\t\t$this->_category_subtree($key, $menu_array, $depth);\n\t\t\t}\n\t\t}\n\t}", "public function HM_CategoCuentas()\n {\n }" ]
[ "0.7179806", "0.70900255", "0.6812455", "0.67491686", "0.67393047", "0.66960484", "0.6624091", "0.65862083", "0.64706963", "0.64359516", "0.6371066", "0.6345736", "0.633928", "0.6336586", "0.6306327", "0.62895983", "0.6288199", "0.6271811", "0.6253983", "0.6219138", "0.62144864", "0.6200345", "0.6197675", "0.6189952", "0.61847365", "0.6163046", "0.6162614", "0.6155848", "0.61397123", "0.6136899", "0.6129476", "0.6128065", "0.6113306", "0.6109624", "0.60779715", "0.6070388", "0.6041521", "0.60366803", "0.5996045", "0.5993425", "0.59860677", "0.59847206", "0.59773976", "0.5975863", "0.5970174", "0.5950162", "0.59454334", "0.59454334", "0.5935484", "0.59214634", "0.5910738", "0.58868873", "0.58846635", "0.5879729", "0.5865332", "0.58602804", "0.58536416", "0.5840943", "0.5837741", "0.5828936", "0.582342", "0.57745516", "0.5774137", "0.5771055", "0.5767025", "0.5764904", "0.57634366", "0.57606304", "0.57587075", "0.5735205", "0.57323915", "0.5731803", "0.5731433", "0.5726611", "0.57249236", "0.5715085", "0.5698157", "0.5692185", "0.5692067", "0.5689822", "0.56826085", "0.5679301", "0.56751746", "0.5657482", "0.56522596", "0.5649328", "0.5646119", "0.5641147", "0.56304455", "0.5628263", "0.5626262", "0.56243", "0.56235933", "0.56136113", "0.5612228", "0.55961955", "0.55937004", "0.558135", "0.5580565", "0.5576964", "0.55766666" ]
0.0
-1
Find the initial setting that members have for a notification code (only applies to the member_could_potentially_enable members).
public function get_initial_setting($notification_code, $category = null) { return A_NA; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getNotificationSettingsMap() {\n\t\treturn array(\n\t\t\tNOTIFICATION_TYPE_ARTICLE_SUBMITTED => array('settingName' => 'notificationArticleSubmitted',\n\t\t\t\t'emailSettingName' => 'emailNotificationArticleSubmitted',\n\t\t\t\t'settingKey' => 'notification.type.articleSubmitted'),\n\t\t\tNOTIFICATION_TYPE_METADATA_MODIFIED => array('settingName' => 'notificationMetadataModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationMetadataModified',\n\t\t\t\t'settingKey' => 'notification.type.metadataModified'),\n\t\t\tNOTIFICATION_TYPE_SUPP_FILE_MODIFIED => array('settingName' => 'notificationSuppFileModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationSuppFileModified',\n\t\t\t\t'settingKey' => 'notification.type.suppFileModified'),\n\t\t\tNOTIFICATION_TYPE_GALLEY_MODIFIED => array('settingName' => 'notificationGalleyModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationGalleyModified',\n\t\t\t\t'settingKey' => 'notification.type.galleyModified'),\n\t\t\tNOTIFICATION_TYPE_SUBMISSION_COMMENT => array('settingName' => 'notificationSubmissionComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationSubmissionComment',\n\t\t\t\t'settingKey' => 'notification.type.submissionComment'),\n\t\t\tNOTIFICATION_TYPE_LAYOUT_COMMENT => array('settingName' => 'notificationLayoutComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationLayoutComment',\n\t\t\t\t'settingKey' => 'notification.type.layoutComment'),\n\t\t\tNOTIFICATION_TYPE_COPYEDIT_COMMENT => array('settingName' => 'notificationCopyeditComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationCopyeditComment',\n\t\t\t\t'settingKey' => 'notification.type.copyeditComment'),\n\t\t\tNOTIFICATION_TYPE_PROOFREAD_COMMENT => array('settingName' => 'notificationProofreadComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationProofreadComment',\n\t\t\t\t'settingKey' => 'notification.type.proofreadComment'),\n\t\t\tNOTIFICATION_TYPE_REVIEWER_COMMENT => array('settingName' => 'notificationReviewerComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationReviewerComment',\n\t\t\t\t'settingKey' => 'notification.type.reviewerComment'),\n\t\t\tNOTIFICATION_TYPE_REVIEWER_FORM_COMMENT => array('settingName' => 'notificationReviewerFormComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationReviewerFormComment',\n\t\t\t\t'settingKey' => 'notification.type.reviewerFormComment'),\n\t\t\tNOTIFICATION_TYPE_EDITOR_DECISION_COMMENT => array('settingName' => 'notificationEditorDecisionComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationEditorDecisionComment',\n\t\t\t\t'settingKey' => 'notification.type.editorDecisionComment'),\n\t\t\tNOTIFICATION_TYPE_USER_COMMENT => array('settingName' => 'notificationUserComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationUserComment',\n\t\t\t\t'settingKey' => 'notification.type.userComment'),\n\t\t\tNOTIFICATION_TYPE_PUBLISHED_ISSUE => array('settingName' => 'notificationPublishedIssue',\n\t\t\t\t'emailSettingName' => 'emailNotificationPublishedIssue',\n\t\t\t\t'settingKey' => 'notification.type.issuePublished'),\n\t\t\tNOTIFICATION_TYPE_NEW_ANNOUNCEMENT => array('settingName' => 'notificationNewAnnouncement',\n\t\t\t\t'emailSettingName' => 'emailNotificationNewAnnouncement',\n\t\t\t\t'settingKey' => 'notification.type.newAnnouncement'),\n\t\t);\n\t}", "public function defaultSettings()\n\t{\n\t\treturn [\n\t\t\t'notifications' => [\n\t\t\t\t'team_event_create' => 1,\n\t\t\t\t'team_event_update' => 2,\n\t\t\t\t'team_event_delete' => 2,\n\t\t\t\t'team_stats' \t\t=> 1,\n\t\t\t\t'team_post' \t\t=> 1,\n\t\t\t\t'user_post' \t\t=> 2,\n\t\t\t\t'user_stats'\t\t=> 1,\n\t\t\t],\n\t\t];\n\t}", "function getUsersNotificationsPreferences($notification_types, $members)\n{\n\t$db = database();\n\n\t$notification_types = (array) $notification_types;\n\t$query_members = (array) $members;\n\t$defaults = [];\n\tforeach (getConfiguredNotificationMethods('*') as $notification => $methods)\n\t{\n\t\t$return = [];\n\t\tforeach ($methods as $k => $level)\n\t\t{\n\t\t\tif ($level == Notifications::DEFAULT_LEVEL)\n\t\t\t{\n\t\t\t\t$return[] = $k;\n\t\t\t}\n\t\t}\n\t\t$defaults[$notification] = $return;\n\t}\n\n\t$results = [];\n\t$db->fetchQuery('\n\t\tSELECT \n\t\t\tid_member, notification_type, mention_type\n\t\tFROM {db_prefix}notifications_pref\n\t\tWHERE id_member IN ({array_int:members_to})\n\t\t\tAND mention_type IN ({array_string:mention_types})',\n\t\t[\n\t\t\t'members_to' => $query_members,\n\t\t\t'mention_types' => $notification_types,\n\t\t]\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$results) {\n\t\t\tif (!isset($results[$row['id_member']]))\n\t\t\t{\n\t\t\t\t$results[$row['id_member']] = [];\n\t\t\t}\n\n\t\t\t$results[$row['id_member']][$row['mention_type']] = json_decode($row['notification_type']);\n\t\t}\n\t);\n\n\t// Set the defaults\n\tforeach ($query_members as $member)\n\t{\n\t\tforeach ($notification_types as $type)\n\t\t{\n\t\t\tif (empty($results[$member]) && !empty($defaults[$type]))\n\t\t\t{\n\t\t\t\tif (!isset($results[$member]))\n\t\t\t\t{\n\t\t\t\t\t$results[$member] = [];\n\t\t\t\t}\n\n\t\t\t\tif (!isset($results[$member][$type]))\n\t\t\t\t{\n\t\t\t\t\t$results[$member][$type] = [];\n\t\t\t\t}\n\n\t\t\t\t$results[$member][$type] = $defaults[$type];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $results;\n}", "private static function get_email_setting_defaults( $email_notification_key ) {\n\t\t$settings = self::get_email_setting_fields( $email_notification_key );\n\t\t$email_class = self::get_email_class( $email_notification_key );\n\n\t\t$defaults = array();\n\t\t$defaults[ self::EMAIL_SETTING_ENABLED ] = call_user_func( array( $email_class, 'is_default_enabled' ) ) ? '1' : '0';\n\n\t\tforeach ( $settings as $setting ) {\n\t\t\t$defaults[ $setting['name'] ] = null;\n\t\t\tif ( isset( $setting['std'] ) ) {\n\t\t\t\t$defaults[ $setting['name'] ] = $setting['std'];\n\t\t\t}\n\t\t}\n\n\t\treturn $defaults;\n\t}", "function testDefaultSettings() {\n $administrator = Users::findById(1);\n\n $member = new Member();\n\n $member->setCompanyId(1);\n $member->setEmail('[email protected]');\n $member->setPassword('123');\n $member->save();\n\n $client = new Client();\n\n $client->setCompanyId(1);\n $client->setEmail('[email protected]');\n $client->setPassword('123');\n $client->save();\n\n $email_channel = new EmailNotificationChannel();\n\n $this->assertTrue($email_channel->isEnabledByDefault());\n $this->assertTrue($email_channel->isEnabledFor($administrator));\n $this->assertTrue($email_channel->isEnabledFor($member));\n $this->assertTrue($email_channel->isEnabledFor($client));\n\n $this->assertEqual($email_channel->whoCanOverrideDefaultStatus(), array('Member', 'Manager'));\n\n $this->assertTrue($email_channel->canOverrideDefaultStatus($administrator));\n $this->assertTrue($email_channel->canOverrideDefaultStatus($member));\n $this->assertFalse($email_channel->canOverrideDefaultStatus($client));\n }", "public static function getStatusOptions() {\n\t\t$opt = array();\n\t\tforeach (self::$member_codes as $code=>$defs){\n\t\t\t$opt[$code] = $defs[0];\n\t\t}\n\t\treturn $opt;\n\t}", "function get_user_notification_settings($user_guid = 0) {\n\tglobal $NOTIFICATION_HANDLERS;\n\t\n\t$user_guid = sanitise_int($user_guid, false);\n\n\tif (empty($user_guid)) {\n\t\t$user_guid = elgg_get_logged_in_user_guid();\n\t}\n\n\tif(!empty($user_guid)) {\n\t\t// @todo: there should be a better way now that metadata is cached. E.g. just query for MD names, then\n\t\t// query user object directly\n\t\t$prefix = \"notification:method:\";\n\t\t$metadata_options = array(\n\t\t\t'guid' => $user_guid,\n\t\t\t'limit' => false,\n\t\t\t'metadata_names' => array()\n\t\t);\n\t\t\n\t\tforeach($NOTIFICATION_HANDLERS as $method => $function){\r\n\t\t\t$metadata_options[\"metadata_names\"][] = $prefix . $method;\r\n\t\t}\n\t\t\n\t\tif ($all_metadata = elgg_get_metadata($metadata_options)) {\n\t\t\t$return = new stdClass;\n\t\n\t\t\tforeach ($all_metadata as $meta) {\n\t\t\t\t$name = substr($meta->name, strlen($prefix));\n\t\t\t\t$value = $meta->value;\n\t\n\t\t\t\tif (strpos($meta->name, $prefix) === 0) {\n\t\t\t\t\t$return->$name = $value;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn $return;\n\t\t}\n\t}\n\n\treturn false;\n}", "function getInvitationMode() \n\t{\n\t\tinclude_once \"./Services/Administration/classes/class.ilSetting.php\";\n\t\t$surveySetting = new ilSetting(\"survey\");\n\t\t$unlimited_invitation = $surveySetting->get(\"unlimited_invitation\");\n\t\tif (!$unlimited_invitation && $this->invitation_mode == self::MODE_UNLIMITED)\n\t\t{\n\t\t\treturn self::MODE_PREDEFINED_USERS;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ($this->invitation_mode) ? $this->invitation_mode : self::MODE_UNLIMITED;\n\t\t}\n\t}", "function special_notifications_init() {\n \t\n // register extra css\n elgg_extend_view('elgg.css', 'special_notifications/special_notifications.css');\n\n // register hook for checking event which are available this plugin\n $sn = array('profile_location');\n foreach ($sn as $item) {\n elgg_register_plugin_hook_handler('special_notifications:config', 'notify', \"snotify_$item\");\n }\n \n // get available active checking event and register a hook, so they can be triggered\n $special_notifications = elgg_trigger_plugin_hook('special_notifications:config', 'notify', null, []);\n foreach ($special_notifications as $key => $sn) {\n if ($sn['active']) {\n elgg_register_plugin_hook_handler('special_notifications', 'user', \"special_notification_\".$sn['hook']);\n }\n }\n\n}", "function onInit(&$man) {\r\n\t\t$config = $man->getConfig();\r\n\r\n\t\t// Override option\r\n\t\t$config['somegroup.someoption'] = true;\r\n\r\n\t\treturn true;\r\n\t}", "public function getMCMinSyncDateFlag()\r\n {\r\n return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::GENERAL_MCMINSYNCDATEFLAG);\r\n }", "private static function default_settings() {\n\t\treturn array(\n\t\t\t'module_ga' => true,\n\t\t\t'module_ip' => true,\n\t\t\t'module_log' => true,\n\t\t\t'sent_data' => false,\n\t\t\t'api_key' => '',\n\t\t\t'mark_as_approved' => true,\n\t\t);\n\t}", "private function _initBootingSetting(){\n $settingModel = MooCore::getInstance()->getModel('Setting');\n\n $setting = $settingModel->findByName('chat_disable');\n if ($setting)\n {\n $settingModel->id = $setting['Setting']['id'];\n $settingModel->save(array('is_boot'=>1));\n }\n $setting = $settingModel->findByName('chat_turn_on_notification');\n if ($setting)\n {\n $settingModel->id = $setting['Setting']['id'];\n $settingModel->save(array('is_boot'=>1));\n }else{\n $settingGroupModel = MooCore::getInstance()->getModel('SettingGroup');\n $settingGroup = $settingGroupModel->findByModuleId(\"Chat\");\n if($settingGroup){\n $settingModel->save(\n array(\n \"group_id\"=>$settingGroup['SettingGroup']['id'],\n \"label\"=>\"Turn on messages notifications\",\n \"name\"=>\"chat_turn_on_notification\",\n \"field\"=>\"\",\n \"value\"=>\"\",\n \"is_hidden\"=>0,\n \"version_id\"=>\"\",\n \"type_id\"=>\"radio\",\n \"value_actual\"=>\"[{\\\"name\\\":\\\"Yes\\\",\\\"value\\\":\\\"1\\\",\\\"select\\\":1},{\\\"name\\\":\\\"No\\\",\\\"value\\\":\\\"0\\\",\\\"select\\\":0}]\",\n \"value_default\"=>\"[{\\\"name\\\":\\\"Yes\\\",\\\"value\\\":\\\"1\\\",\\\"select\\\":\\\"0\\\"},{\\\"name\\\":\\\"No\\\",\\\"value\\\":\\\"0\\\",\\\"select\\\":\\\"1\\\"}]\",\n \"description\"=>\"Conversation notifications replaced by chat notifications\",\n \"ordering\"=>10,\n \"is_boot\"=>1\n )\n );\n\n }\n\n }\n }", "function email_settings()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\tif ($ibforums->member['disable_mail'])\r\n\t\t{\r\n\t\t\t$ibforums->lang['no_mail'] = sprintf($ibforums->lang['no_mail'], $ibforums->member['disable_mail_reason']);\r\n\r\n\t\t\t$this->output .= View::make(\"global.warn_window\", ['message' => $ibforums->lang['no_mail']]);\r\n\t\t} else\r\n\t\t{\r\n\r\n\t\t\t// PM_REMINDER: First byte = Email PM when received new\r\n\t\t\t// \t\t\tSecond byte= Show pop-up when new PM received\r\n\r\n\t\t\t$info = array();\r\n\r\n\t\t\tforeach (array('hide_email', 'allow_admin_mails', 'email_full', 'email_pm', 'auto_track') as $k)\r\n\t\t\t{\r\n\t\t\t\tif (!empty($this->member[$k]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$info[$k] = 'checked';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$info['key'] = $this->md5_check;\r\n\r\n\t\t\t$this->output .= View::make(\"ucp.email\", ['Profile' => $info]);\r\n\t\t}\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "public function getEnableEAP()\n {\n if (array_key_exists(\"enableEAP\", $this->_propDict)) {\n return $this->_propDict[\"enableEAP\"];\n } else {\n return null;\n }\n }", "function notification_init() {\n\t// Register a notification handler for the default email method\n\tregister_notification_handler(\"email\", \"email_notify_handler\");\n\n\t// Add settings view to user settings & register action\n\telgg_extend_view('forms/account/settings', 'core/settings/account/notifications');\n\n\telgg_register_plugin_hook_handler('usersettings:save', 'user', 'notification_user_settings_save');\n}", "public function initSettingsData()\n {\n $this->maximum_users_per_group = 5;\n $this->maximum_user_group_memberships = 3;\n $this->maximum_groups_own_per_user = 3;\n $this->maximum_points_group = 200;\n //$this->mail_group_invite_template = 'dma.friends::mail.invite'; \n $this->reset_groups_every_day = $this->days;\n $this->reset_groups_time = '00:00';\n }", "public static function getDefaultFlags(): int\n {\n return static::$defaultFlags;\n }", "function init__notification_poller()\n{\n if (!defined('NOTIFICATION_POLL_FREQUENCY')) {\n define('NOTIFICATION_POLL_FREQUENCY', intval(get_option('notification_poll_frequency')));\n\n define('NOTIFICATION_POLL_SAFETY_LAG_SECS', 8); // Assume a request could have taken this long to happen, so we look back a little further even than NOTIFICATION_POLL_FREQUENCY\n }\n}", "public function activeRestrictions()\n\t{\n\t\t$return = array();\n\t\t\n\t\tif ( !$this->member->group['gbw_disable_tagging'] and $this->member->members_bitoptions['bw_disable_tagging'] )\n\t\t{\n\t\t\t$return[] = 'restriction_no_tagging';\n\t\t}\n\t\tif ( !$this->member->group['bw_disable_prefixes'] and $this->member->members_bitoptions['bw_disable_prefixes'] )\n\t\t{\n\t\t\t$return[] = 'restriction_no_prefixes';\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "function get_defaultsetting() {\n return $this->defaultsetting;\n }", "function testOverride() {\n $email_channel = new EmailNotificationChannel();\n $web_interface_channel = new WebInterfaceNotificationChannel();\n\n $new_comment_notification = new NewCommentNotification();\n $forgot_password_notification = new ForgotPasswordNotification();\n\n $member = new Member();\n\n $member->setCompanyId(1);\n $member->setEmail('[email protected]');\n $member->setPassword('123');\n $member->save();\n\n $this->assertTrue($email_channel->isEnabledFor($member));\n $this->assertTrue($email_channel->canOverrideDefaultStatus($member));\n\n $email_channel->setEnabledFor($member, false);\n\n $this->assertFalse($email_channel->isEnabledFor($member));\n\n // Show new comment in web interface, but skip email because user turned off email channel\n $this->assertTrue($new_comment_notification->isThisNotificationVisibleInChannel($web_interface_channel, $member));\n $this->assertFalse($new_comment_notification->isThisNotificationVisibleInChannel($email_channel, $member));\n\n // Default, forced behavior - never show in web interface, but always send email, regardless of user settings\n $this->assertFalse($forgot_password_notification->isThisNotificationVisibleInChannel($web_interface_channel, $member));\n $this->assertTrue($forgot_password_notification->isThisNotificationVisibleInChannel($email_channel, $member));\n }", "private function initNotificationSettingsForm()\n\t{\n\t\tif(null === $this->notificationSettingsForm)\n\t\t{\n\t\t\t$form = new ilPropertyFormGUI();\n\t\t\t$form->setFormAction($this->ctrl->getFormAction($this, 'updateNotificationSettings'));\n\t\t\t$form->setTitle($this->lng->txt('forums_notification_settings'));\n\n\t\t\t$radio_grp = new ilRadioGroupInputGUI('','notification_type');\n\t\t\t$radio_grp->setValue('default');\n\n\t\t\t$opt_default = new ilRadioOption($this->lng->txt(\"user_decides_notification\"), 'default');\n\t\t\t$opt_0 = new ilRadioOption($this->lng->txt(\"settings_for_all_members\"), 'all_users');\n\t\t\t$opt_1 = new ilRadioOption($this->lng->txt(\"settings_per_users\"), 'per_user');\n\n\t\t\t$radio_grp->addOption($opt_default, 'default');\n\t\t\t$radio_grp->addOption($opt_0, 'all_users');\n\t\t\t$radio_grp->addOption($opt_1, 'per_user');\n\n\t\t\t$chb_2 = new ilCheckboxInputGUI($this->lng->txt('user_toggle_noti'), 'usr_toggle');\n\t\t\t$chb_2->setValue(1);\n\n\t\t\t$opt_0->addSubItem($chb_2);\n\t\t\t$form->addItem($radio_grp);\n\n\t\t\t$form->addCommandButton('updateNotificationSettings', $this->lng->txt('save'));\n\n\t\t\t$this->notificationSettingsForm = $form;\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function getReminderWasAutomatic() {\n\t\treturn $this->getData('reminderWasAutomatic')==1?1:0;\n\t}", "public function init() {\n\t\t\tglobal $prefix;\n\t\t\t$WPFC_active = $this->checkForManager();\n\n\t\t\t// if not already done\n\t\t\tif ( ! get_option( $prefix . 'manager_done', '0' ) ) {\n\t\t\t\t// if the plugin is already there, show a notice that it should be activated\n\t\t\t\tif ( $WPFC_active === true ) {\n\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t\t\t\tactivate_plugin( $this->wpfcm_path . '/wpfc-manager.php' );\n\t\t\t\t} else if ( $WPFC_active === false ) {\n\t\t\t\t\t$this->downloadWPFCM();\n\t\t\t\t}\n\n\t\t\t\tupdate_option( $prefix . 'manager_done', '1', true );\n\t\t\t} else {\n\t\t\t\tif ( $WPFC_active === true ) {\n\t\t\t\t\t$this->noticeWPFCMNotActive();\n\t\t\t\t} else if ( $WPFC_active === false ) {\n\t\t\t\t\t$this->noticeWPFCMNotInstalled();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function settings()\n\t{\n\t\t$settings = array();\n\n\t\t$settings['early_global'] = array('c', array(\n\t\t 'member_id' => \"global_member_id\",\n\t\t 'group_id' => \"global_group_id\",\n\t\t // defaults\n\t\t), array('member_id','group_id'));\n\n\t $settings['early_logged_in'] = array('c', array(\n\t\t 'member_id' => \"logged_in_member_id\",\n\t\t 'group_id' => \"logged_in_group_id\",\n\t\t // defaults\n\t\t), array('member_id','group_id'));\n\n\t // for demo, include some others\n\t $settings['include_other'] = array('c', array(\n\t\t 'include_other' => \"Include other member variables\",\n\t\t), array());\n\t\t\n \t\t$settings['others'] = array('ms', array(\n\t\t 'username' => 'username',\n\t\t 'screen_name' => 'screen_name',\n\t\t 'email' => 'email',\n\t\t // 'last_visit' => 'last_visit',\n\t\t 'access_cp' => 'access_cp',\n\t\t // defaults\n\t\t), array());\n\n\t\t$settings['handy'] = array('c', array(\n\t\t 'comment_edit_time_limit' => \"comment_edit_time_limit\",\n\t\t), array('comment_edit_time_limit'));\n\n\t\treturn $settings;\n\t}", "public function getMessageAndCallSetFlag() : string\n {\n $this->setFlag();\n\n return $this->configProvider->getMessage();\n }", "public static function get_allowed_settings()\n {\n }", "public function getEnableRestriction()\n {\n return $this->enable_restriction;\n }", "public function getCampaignExtensionSettingResult()\n {\n return $this->readOneof(26);\n }", "function settings_init()\n\t{\n\t\t//-----------------------------------------\n\t\t// Load the settings lib\n\t\t//-----------------------------------------\n\t\t\n\t\t$settings = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/settings.php', 'ad_settings' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Have we created this setting group yet?\n\t\t//-----------------------------------------\n\t\t\n\t\t$group = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'conf_title_id', 'from' => 'conf_settings_titles', 'where' => \"conf_title_keyword='umi'\" ) );\n\t\t\n\t\tif ( !$group['conf_title_id'] )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_insert( 'conf_settings_titles', array( 'conf_title_title' => 'Universal Mod Installer',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_desc' => 'Install and manage all compatible mods',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_count' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_noshow' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_keyword' => 'umi',\n\t\t\t\t\t\t\t\t\t\t )\t\t\t\t\t\t\t\t );\n\t\t\t\n\t\t\t$group['conf_title_id'] = $this->ipsclass->DB->get_insert_id();\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Define our settings\n\t\t//-----------------------------------------\n\t\t\n\t\t$umi_settings = array( 'umi_mods_perpage' => array( 'conf_title' => 'Number of mods to display per page',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_description' => 'How many mods do you want to display per page on the mods list?',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_type' => 'input',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_default' => 10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_extra' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_evalphp' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_position' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_start_group' => 'Universal Mod Installer settings',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_end_group' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_help_key' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'umi_do_callbacks' => array( 'conf_title' => 'Use the \\'callback\\' functions?',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_description' => 'These functions can help ensure your mods are up to date, but not all hosts allow them to work.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_type' => 'yes_no',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_default' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_extra' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_evalphp' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_position' => 2,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_start_group' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_end_group' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_help_key' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'umi_skin_recache' => array( 'conf_title' => 'Recache skins automatically?',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_description' => 'If any templates are added, should the skin be automatically recached? Turn this off if installing a mod exhausts your memory at this point.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_type' => 'yes_no',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_default' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_extra' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_evalphp' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_position' => 3,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_start_group' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_end_group' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_help_key' => '',\n\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\n\t\t//-----------------------------------------\n\t\t// Ensure the settings have been created\n\t\t//-----------------------------------------\n\t\t\n\t\t$cnt = 0;\n\t\t\n\t\tforeach ( $umi_settings as $key => $value )\n\t\t{\n\t\t\tif ( !isset( $this->ipsclass->vars[ $key ] ) )\n\t\t\t{\n\t\t\t\t$cnt++;\n\t\t\t\t\n\t\t\t\t$insert = array( 'conf_title' => $value['conf_title'],\n\t\t\t\t\t\t\t\t 'conf_description' => $value['conf_description'],\n\t\t\t\t\t\t\t\t 'conf_group' => $group['conf_title_id'],\n\t\t\t\t\t\t\t\t 'conf_type' => $value['conf_type'],\n\t\t\t\t\t\t\t\t 'conf_key' => $key,\n\t\t\t\t\t\t\t\t 'conf_default' => $value['conf_default'],\n\t\t\t\t\t\t\t\t 'conf_extra' => $value['conf_extra'],\n\t\t\t\t\t\t\t\t 'conf_evalphp' => $value['conf_evalphp'],\n\t\t\t\t\t\t\t\t 'conf_protected' => 1,\n\t\t\t\t\t\t\t\t 'conf_position' => $value['conf_position'],\n\t\t\t\t\t\t\t\t 'conf_start_group' => $value['conf_start_group'],\n\t\t\t\t\t\t\t\t 'conf_end_group' => $value['conf_end_group'],\n\t\t\t\t\t\t\t\t 'conf_help_key' => $value['conf_help_key'],\n\t\t\t\t\t\t\t\t 'conf_add_cache' => 1,\n\t\t\t\t\t\t\t );\n\t\t\t\t\n\t\t\t\tif ( !$this->ipsclass->DB->field_exists( 'conf_help_key', 'conf_settings' ) )\n\t\t\t\t{\n\t\t\t\t\tunset( $insert['conf_help_key'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->do_insert( 'conf_settings', $insert );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Recache, if needed\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $cnt )\n\t\t{\n\t\t\t$settings->setting_rebuildcache();\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function get_setting($code){\n\t\tif(!is_array($this->settings_cache)){\n\t\t\t$this->load_settings();\n\t\t}\n\t\treturn $this->settings_cache[$code];\n\t}", "public function getNewSuggestedDefault()\n {\n return $this->model->where('default', '=', false)->where('enabled', '=', true)->first();\n }", "function _getNotificationSettingCategories() {\n\t\treturn array(\n\t\t\t'submissions' => array('categoryKey' => 'notification.type.submissions',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_ARTICLE_SUBMITTED, NOTIFICATION_TYPE_METADATA_MODIFIED, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED)),\n\t\t\t'reviewing' => array('categoryKey' => 'notification.type.reviewing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_REVIEWER_COMMENT, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT, NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT)),\n\t\t\t'editing' => array('categoryKey' => 'notification.type.editing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_GALLEY_MODIFIED, NOTIFICATION_TYPE_SUBMISSION_COMMENT, NOTIFICATION_TYPE_LAYOUT_COMMENT, NOTIFICATION_TYPE_COPYEDIT_COMMENT, NOTIFICATION_TYPE_PROOFREAD_COMMENT)),\n\t\t\t'site' => array('categoryKey' => 'notification.type.site',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_USER_COMMENT, NOTIFICATION_TYPE_PUBLISHED_ISSUE, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT)),\n\t\t);\n\t}", "public static function getDefaultSettingsKeys();", "public function __getNotificationSetting( $contentPageId, $userName, $section )\n\t{ \n\t\t//initialise array\n\t\t$results = array();\n\t\t//get the user course name.\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$users_section = $course_info->section_name; //section name\n\t\t$users_course = $course_info->course_name; //course name\n\n\t\t//check if setting exist\n\t\t//get setting count\n\t\t$resultsCount = $this->ReminderSetting->find('count',array('conditions'=>\n\t\t\t\t array('ReminderSetting.user_name'=>$userName,\n\t\t\t\t\t\t'ReminderSetting.content_page_id'=>$contentPageId,\n\t\t\t\t\t\t'ReminderSetting.section'=>$section,\n\t\t\t\t\t\t'ReminderSetting.course'=>$users_course\n\t\t\t\t)));\n\n\t\tif ($resultsCount) {\n\t\t\t//get setting\n\t\t\t$results = $this->ReminderSetting->find('first',array('conditions'=>\n\t\t\t\t\t array('ReminderSetting.user_name'=>$userName,\n\t\t\t\t\t\t\t'ReminderSetting.content_page_id'=>$contentPageId,\n\t\t\t\t\t\t\t'ReminderSetting.section'=>$section,\n\t\t\t\t\t\t\t'ReminderSetting.course'=>$users_course\n\t\t\t\t\t)));\n\t\t\t$notification['emailSetting'] = $results['ReminderSetting']['is_email'];\n\t\t\t$notification['feedSetting'] = $results['ReminderSetting']['is_feed_reader'];\n\t\t\t$notification['facebookSetting'] = $results['ReminderSetting']['is_facebook'];\n\t\t\t$notification['twitterSetting'] = $results['ReminderSetting']['is_twitter'];\n\t\t} else {\n\t\t\t//default seeting will be email\n\t\t\t$notification['emailSetting'] = 1;\n\t\t\t$notification['facebookSetting'] = 0;\n\t\t\t$notification['twitterSetting'] = 0;\n\t\t}\n\t\treturn $notification;\n\t}", "function GetAdminNotification()\n\t{\n\t\t$notifications = array(\n\t\t\t'adminnotify_email' => $this->adminnotify_email,\n\t\t\t'adminnotify_send_flag' => $this->adminnotify_send_flag,\n\t\t\t'adminnotify_send_threshold' => $this->adminnotify_send_threshold,\n\t\t\t'adminnotify_send_emailtext' => $this->adminnotify_send_emailtext,\n\t\t\t'adminnotify_import_flag' => $this->adminnotify_import_flag,\n\t\t\t'adminnotify_import_threshold' => $this->adminnotify_import_threshold,\n\t\t\t'adminnotify_import_emailtext' => $this->adminnotify_import_emailtext\n\t\t);\n\n\t\treturn $notifications;\n\t}", "abstract function getPluginSettingsPrefix();", "public function getMinimalValueInstallment()\n {\n $numberOfInstallments = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALMENT_MINIMAL);\n if($numberOfInstallments <= 9){\n $numberOfInstallments = 10;\n }\n return $numberOfInstallments ;\n }", "public function getPhanFlags(): int;", "function pmpro_notifications()\n{\n\tif(current_user_can(\"manage_options\"))\n\t{\n\t\t$pmpro_notification = get_transient(\"pmpro_notification_\" . PMPRO_VERSION);\n\t\tif(empty($pmpro_notification))\n\t\t{\n\t\t\t//set to NULL in case the below times out or fails, this way we only check once a day\n\t\t\tset_transient(\"pmpro_notification_\" . PMPRO_VERSION, 'NULL', 86400);\n\n\t\t\t//figure out which server to get from\n\t\t\tif(is_ssl())\n\t\t\t{\n\t\t\t\t$remote_notification = wp_remote_get(\"https://notifications.paidmembershipspro.com/?v=\" . PMPRO_VERSION);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$remote_notification = wp_remote_get(\"http://notifications.paidmembershipspro.com/?v=\" . PMPRO_VERSION);\n\t\t\t}\n\n\t\t\t//get notification\n\t\t\t$pmpro_notification = wp_remote_retrieve_body($remote_notification);\n\n\t\t\t//update transient if we got something\n\t\t\tif(!empty($pmpro_notification))\n\t\t\t\tset_transient(\"pmpro_notification_\" . PMPRO_VERSION, $pmpro_notification, 86400);\n\t\t}\n\n\t\tif($pmpro_notification && $pmpro_notification != \"NULL\")\n\t\t{\n\t\t?>\n\t\t<div id=\"pmpro_notifications\">\n\t\t\t<?php echo $pmpro_notification; ?>\n\t\t</div>\n\t\t<?php\n\t\t}\n\t}\n\n\t//exit so we just show this content\n\texit;\n}", "public function getListingNPEmailNotifPref()\n {\n return $this->listingNPEmailNotifPref;\n }", "function oqp_bp_screen_notification_settings() {\r\n\t//check if at least one form has notifications enabled\r\n\t$forms_slugs = oqp_get_forms_page_ids();\r\n\tforeach ($forms_slugs as $form_slug) {\r\n\t\t$form = oqp_get_form_options($form_slug);\r\n\t\tif (!$form[email_notifications_enabled]) continue;\r\n\t\t$forms_notifications=true;\r\n\t}\r\n\tif (!$forms_notifications) return false;\r\n\t\r\n\t\r\n\t?>\r\n\t<table class=\"notification-settings zebra\" id=\"oqp-notification-settings\">\r\n\t\t<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<th class=\"icon\"></th>\r\n\t\t\t\t<th class=\"title\"><?php _e( 'One Quick Post', 'oqp' ) ?></th>\r\n\t\t\t\t<th class=\"yes\"><?php _e( 'Yes', 'buddypress' ) ?></th>\r\n\t\t\t\t<th class=\"no\"><?php _e( 'No', 'buddypress' )?></th>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\r\n\t\t<tbody>\r\n\t\t\t<tr>\r\n\t\t\t\t<td></td>\r\n\t\t\t\t<td><?php _e( 'One of your post is awaiting moderation', 'oqp' ) ?></td>\r\n\t\t\t\t<td class=\"yes\"><input type=\"radio\" name=\"notifications[notification_oqp_pending_post]\" value=\"yes\" <?php if ( !get_user_meta( get_current_user_id(), 'notification_oqp_pending_post', true ) || 'yes' == get_user_meta( get_current_user_id(), 'notification_oqp_pending_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t\t<td class=\"no\"><input type=\"radio\" name=\"notifications[notification_oqp_pending_post]\" value=\"no\" <?php if ( 'no' == get_user_meta( get_current_user_id(), 'notification_oqp_pending_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td></td>\r\n\t\t\t\t<td><?php _e( 'One of your post is published', 'oqp' ) ?></td>\r\n\t\t\t\t<td class=\"yes\"><input type=\"radio\" name=\"notifications[notification_oqp_approved_post]\" value=\"yes\" <?php if ( !get_user_meta( get_current_user_id(), 'notification_oqp_approved_post', true ) || 'yes' == get_user_meta( get_current_user_id(), 'notification_oqp_approved_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t\t<td class=\"no\"><input type=\"radio\" name=\"notifications[notification_oqp_approved_post]\" value=\"no\" <?php if ( 'no' == get_user_meta( get_current_user_id(), 'notification_oqp_approved_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td></td>\r\n\t\t\t\t<td><?php _e( 'One of your post has been deleted', 'oqp' ) ?></td>\r\n\t\t\t\t<td class=\"yes\"><input type=\"radio\" name=\"notifications[notification_oqp_deleted_post]\" value=\"yes\" <?php if ( !get_user_meta( get_current_user_id(), 'notification_oqp_deleted_post', true ) || 'yes' == get_user_meta( get_current_user_id(), 'notification_oqp_deleted_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t\t<td class=\"no\"><input type=\"radio\" name=\"notifications[notification_oqp_deleted_post]\" value=\"no\" <?php if ( 'no' == get_user_meta( get_current_user_id(), 'notification_oqp_deleted_post', true ) ) { ?>checked=\"checked\" <?php } ?>/></td>\r\n\t\t\t</tr>\r\n\t\t\t<?php do_action( 'oqp_bp_screen_notification_settings' ) ?>\r\n\t\t</tbody>\r\n\t</table>\r\n<?php\r\n}", "static function getDefaultLang() {\n if (self::$default_lang === NULL) {\n if (self::$list == NULL) {\n self::getList();\n }\n foreach (self::$list as $data) {\n if ($data->default == static::STATUS_KEY_ON) {\n self::$default_lang = $data;\n break;\n }\n }\n }\n return self::$default_lang;\n }", "function getFlags()\n { \n $startup_id = $_GET['startup_id']; // for test, use 147930\n \n $this->PopulateTables($startup_id, $debug);\n }", "function register_initial_settings()\n {\n }", "function sendEventStartNotifications()\n {\n $ret = false;\n\n // Settings\n $ini = eZINI::instance( \"bceventnotifications.ini\" );\n $eventClassIdentifier = $ini->variable( \"EventNotificationsSettings\", \"EventClassIdentifier\" );\n $userClassIdentifier = $ini->variable( \"EventNotificationsSettings\", \"UserClassIdentifier\" );\n $userGroupNodeID = $ini->variable( \"EventNotificationsSettings\", \"UserGroupNodeID\" );\n $eventCalendarNodeID = $ini->variable( \"EventNotificationsSettings\", \"EventCalendarNodeID\" );\n $administratorUserID = $ini->variable( \"EventNotificationsSettings\", \"AdministratorUserID\" );\n\n // Change Script Session User to Privilaged Role User, Admin\n $this->loginDifferentUser( $administratorUserID );\n\n // Fetch users in user group\n $groupNode = eZContentObjectTreeNode::fetch( $userGroupNodeID );\n $groupConditions = array( 'ClassFilterType' => 'include', 'ClassFilterArray' => array( $userClassIdentifier ) );\n $groupUsers = $groupNode->subTree( $groupConditions, $userGroupNodeID );\n\n foreach( $groupUsers as $user )\n {\n // Fetch subtree notification rules\n $userID = $user->attribute( 'contentobject_id' );\n $userSubtreeNotificationRules = eZSubtreeNotificationRule::fetchList( $userID, true, false, false );\n $userSubtreeNotificationRulesCount = eZSubtreeNotificationRule::fetchListCount( $userID );\n\n if ( $userSubtreeNotificationRulesCount != 0 )\n {\n foreach ( $userSubtreeNotificationRules as $rule )\n {\n // Check each node in rule for event starting\n $ruleNodeID = $rule->attribute( 'node_id' );\n $node = eZContentObjectTreeNode::fetch( $ruleNodeID );\n\n if ( $this->isEventStarting( $node ) )\n $this->sendEventStartNotificationEmail( $user, $node );\n }\n }\n\n }\n return $ret;\n }", "public function getUserDefaultStatus();", "public static function checkLightBoxSetting()\n {\n return Settings::getSettings(Settings::EMAIL_LIGHT_BOX ) ;\n }", "private function settingsAnalyzer()\n {\n require '../configuration/app.php';\n\n if ($external_server_settings['mode'] == 'on') {\n return $this->settings[] = $external_server_settings; \n }\n \n return $this->settings[] = $server_settings;\n }", "static function onSmwInitProperties () {\n\n\t\t// id, typeid, label, show\n\t\t// \\SMW\\DIProperty::registerProperty(\n\t\t\t// '___somenewproperty',\n\t\t\t// 2,\n\t\t\t// 'meetingminutes-some-property',\n\t\t\t// true\n\t\t// );\n\t\t\n\t\t\n\t\t/**\n\t\t * @note Property data types as follows (this needs to go somewhere else)\n\t\t * From SMWDataItem:\n\t\t * 0 = No data item class (not sure if this can be used)\n\t\t * 1 = Number\n\t\t * 2 = String/Text\n\t\t * 3 = Blob\n\t\t * 4 = Boolean\n\t\t * 5 = URI\n\t\t * 6 = Time (This must mean Date)\n\t\t * 7 = Geo\n\t\t * 8 = Container\n\t\t * 9 = WikiPage\n\t\t * 10 = Concept\n\t\t * 11 = Property\n\t\t * 12 = Error\n\t\t */\n\t\treturn MeetingPropertyRegistry::getInstance()->registerPropertiesAndAliases();\n\t\t\n\t}", "function wpsl_get_default_setting( $setting ) {\n\n global $wpsl_default_settings;\n\n return $wpsl_default_settings[$setting];\n}", "function rawpheno_function_get_support_email() {\n $support_email = variable_get('kp_rawpheno_support_email');\n\n if (!empty($support_email)) {\n return $support_email;\n }\n\n // Nothing set.\n $support_email = '#';\n\n // As provided by hook_alter implementation - following command#value format.\n // example: $support_email = 'username#DrupalUsername';\n drupal_alter('rawpheno_support_email', $support_email);\n\n @list($command, $value) = explode('#', $support_email);\n\n switch ($command) {\n case 'username':\n case 'useridno':\n // By username or user id no.\n $user = ($command == 'username') ? 'name' : 'uid';\n\n $sql = sprintf(\"SELECT mail FROM users WHERE %s = :user LIMIT 1\", $user);\n $support_email = chado_query($sql, array(':user' => $value))\n ->fetchField();\n\n break;\n\n case 'emailadd':\n // Use the email as provided.\n $support_email = $value;\n\n break;\n\n default:\n // Get email from user id #1.\n $support_email = chado_query(\"SELECT mail FROM users WHERE uid = 1\")\n ->fetchField();\n\n if (empty($support_email)) {\n // Or site-wide email provided when setting up a Drupal site.\n $support_email = variable_get('site-mail');\n }\n }\n\n // Set this variable to support email so this can be accessed\n // by the entire rawphenotypes module as well as pages hosting\n // this application (eg. video demo page)\n\n // This will also set an email in case one is determined.\n $cur_email = variable_get('kp_rawpheno_support_email');\n if (empty($cur_email) || $cur_email != $support_email) {\n // Update only when new support email and no value detected.\n variable_set('kp_rawpheno_support_email', $support_email);\n }\n\n\n return $support_email;\n}", "public function getEnableConfirmations()\r\n {\r\n return $this->enable_confirmations;\r\n }", "public function getMemberSettings()\n {\n return $this->getProperty(\"MemberSettings\", new TeamMemberSettings());\n }", "private static function _get_default_settings()\n\t{\n\t\treturn array(\n\t\t\t'nr_api_key'\t\t\t\t\t\t=> '',\n\t\t\t'nr_apps_list'\t\t\t\t\t\t=> '', // The apps list associated with the account\n\t\t\t'nr_selected_app_servers'\t\t\t=> '', // The servers from the selected app\n\t\t\t'user_datasets'\t\t\t\t\t\t=> '', // Saved user datasets\n\t\t);\n\t}", "abstract protected function getSetting() ;", "function amap_ma_check_if_membersmap_gm_enabled() {\n if (!elgg_is_active_plugin(\"membersmap\")) {\n return false;\n }\n \n $gm_membersmap = trim(elgg_get_plugin_setting('gm_membersmap', AMAP_MA_PLUGIN_ID));\n\n if ($gm_membersmap == AMAP_MA_GENERAL_YES && elgg_is_active_plugin('membersmap')) {\n return true;\n }\n\n return false;\n}", "private function getDefaultStatusByType($type) {\n if (!in_array($type, ['groupex', 'personify'])) {\n return TRUE;\n }\n $config = $this->configFactory->get(self::CONFIG);\n return $config->get($type == 'groupex' ? 'groupex_default_status' : 'personify_default_status');\n }", "public static function checkSettings() {\r\n \t\r\n \t$currentYear = date('Y');\r\n \tif(date('m') == 1){\r\n\t $record = Doctrine_Query::create ()\r\n\t ->from ( 'InvoicesSettings is' )\r\n\t ->where ( \"is.year = ?\", $currentYear )\r\n\t\t\t\t\t->andWhere('is.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n\t ->limit ( 1 )\r\n\t ->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n\t \r\n\t if(empty($record)){\r\n\t\t\t\t$is = new InvoicesSettings();\r\n\t\t\t\t$is['year'] = $currentYear;\r\n\t\t\t\t$is['next_number'] = 1;\r\n\t\t\t\t$is->save();\r\n\t }\r\n \treturn true;\r\n \t}\r\n \treturn false;\r\n }", "public static function getAutoSetupValues() {\r\n\t\treturn array(\r\n\t\t\t '0' => 'Do not automatically register or transfer domains'\r\n\t\t \t,'1' => 'Automatically register or transfer domains as soon as an order is placed'\r\n\t\t \t,'2' => 'Automatically register or transfer domains as soon as the first payment is received'\r\n\t\t \t,'3' => 'Automatically register or transfer domains when you manually accept a pending order'\r\n\t\t \t,'4' => 'Automatically register or transfer domains as soon as the payment is complete'\r\n\t\t);\r\n\t}", "public function onBeforeInit()\n {\n $this->siteConfig = $this->owner->getSiteConfig();\n\n if (!$this->siteConfig || !$this->siteConfig->exists()) {\n $this->siteConfig = SiteConfig::current_site_config();\n }\n\n $this->includeCookiePolicyNotification = $this->siteConfig->CookiePolicyIsActive;\n }", "public static function getDefaultVars()\n {\n return [\n 'posts_per_page' => 15,\n 'topics_per_page' => 15,\n 'hot_threshold' => 20,\n 'email_from' => '', // use system default email\n 'url_ranks_images' => \"ranks\",\n 'post_sort_order' => 'ASC',\n 'log_ip' => false,\n 'extendedsearch' => false,\n 'm2f_enabled' => false,\n 'favorites_enabled' => false,\n 'removesignature' => false,\n 'striptags' => false,\n 'hooks' => ['providers' => [], 'subscribers' => []],\n 'rss2f_enabled' => false,\n 'timespanforchanges' => 24,\n 'forum_enabled' => true,\n 'forum_disabled_info' => 'Sorry! The forums are currently off-line for maintenance. Please try later.',\n 'signaturemanagement' => false,\n 'signature_start' => '--',\n 'signature_end' => '--',\n 'showtextinsearchresults' => false,\n 'minsearchlength' => 3,\n 'maxsearchlength' => 30,\n 'fulltextindex' => false,\n 'solved_enabled' => false,\n 'ajax' => false,\n 'striptagsfromemail' => false,\n 'indexTo' => '',\n 'notifyAdminAsMod' => 2,\n 'defaultPoster' => 2,\n 'onlineusers_moderatorcheck' => false,\n 'forum_subscriptions_enabled' => false,\n 'topic_subscriptions_enabled' => false,\n ];\n }", "public function current(): ?\\StructType\\EwsUnifiedGroupSenderRestrictionsDataType\n {\n return parent::current();\n }", "protected function initNotifications()\n {\n $this->di->setShared('notifications', function () {\n return new NotificationsChecker();\n });\n }", "protected function get_default() {\n\t\treturn array( 'ownerID' => 0 );\n\t}", "private function zzOrgCaddyConfig()\n {\n $config = null;\n\n switch (true)\n {\n case( $this->pObj->powermailVersionInt < 1000000 ):\n $prompt = 'ERROR: unexpected result<br />\n powermail version is below 1.0.0: ' . $this->pObj->powermailVersionInt . '<br />\n Method: ' . __METHOD__ . ' (line ' . __LINE__ . ')<br />\n TYPO3 extension: ' . $this->extKey;\n die($prompt);\n break;\n case( $this->pObj->powermailVersionInt < 2000000 ):\n $config = $this->zzOrgCaddyConfigPowermail1x();\n break;\n case( $this->pObj->powermailVersionInt < 3000000 ):\n $config = $this->zzOrgCaddyConfigPowermail2x();\n break;\n case( $this->pObj->powermailVersionInt >= 3000000 ):\n default:\n $prompt = 'ERROR: unexpected result<br />\n powermail version is 3.x: ' . $this->pObj->powermailVersionInt . '<br />\n Method: ' . __METHOD__ . ' (line ' . __LINE__ . ')<br />\n TYPO3 extension: ' . $this->extKey;\n die($prompt);\n break;\n }\n\n return $config;\n }", "function av5_kirki_check_value() {\r\n\t\t$mods = get_theme_mods();\r\n\t\tif ( empty( $mods ) ) {\r\n\t\t\tav5_kirki_set_default();\r\n\t\t}\r\n\t}", "function it_gets_and_sets_the_notify_option()\n {\n $this->doNotify()->shouldReturn(true);\n\n // Set the api key\n $this->setNotify(false);\n\n // Get the current notify status\n $this->doNotify()->shouldReturn(false);\n }", "function ms_override($ms_overriden){\n $model_config = WYSIJA::get('config' , 'model');\n if($model_config->getValue('premium_key')){\n $bounce_value = array('bounce','bouncing');\n return array_merge($ms_overriden, $bounce_value);\n }\n return $ms_overriden;\n }", "public function getNeedIsMember()\n {\n return $this->getProperty('needIsMember');\n }", "function get_setting() {\n // has to be overridden\n return NULL;\n }", "function saveUserNotificationsPreferences($member, $notification_data)\n{\n\t$db = database();\n\n\t$inserts = [];\n\n\t// First drop the existing settings\n\t$db->query('', '\n\t\tDELETE FROM {db_prefix}notifications_pref\n\t\tWHERE id_member = {int:member}\n\t\t\tAND mention_type IN ({array_string:mention_types})',\n\t\t[\n\t\t\t'member' => $member,\n\t\t\t'mention_types' => array_keys($notification_data),\n\t\t]\n\t);\n\n\tforeach ($notification_data as $type => $level)\n\t{\n\t\t// used to skip values that are here only to remove the default\n\t\tif (empty($level))\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If they have any site notifications enabled, set a flag to request Push.Permissions\n\t\tif (in_array('notification', $level))\n\t\t{\n\t\t\t$_SESSION['push_enabled'] = true;\n\t\t}\n\n\t\t$inserts[] = [\n\t\t\t$member,\n\t\t\t$type,\n\t\t\tjson_encode($level),\n\t\t];\n\t}\n\n\tif (empty($inserts))\n\t{\n\t\treturn;\n\t}\n\n\t$db->insert('',\n\t\t'{db_prefix}notifications_pref',\n\t\t[\n\t\t\t'id_member' => 'int',\n\t\t\t'mention_type' => 'string-12',\n\t\t\t'notification_type' => 'string',\n\t\t],\n\t\t$inserts,\n\t\t['id_member', 'mention_type']\n\t);\n}", "public function default_settings_section_info() {\n global $WCPc;\n _e('Enter your default settings below', $WCPc->text_domain);\n }", "public function SetInitialLevel()\n {\n $initLvls = array(1);\n $profile = $this->GetProfile();\n $spokenAtHome = $profile->GetSpokenAtHome();\n $leopairs = $profile->GetLeoPairs();\n \n if ($spokenAtHome)\n {\n $parameters = $this->GetParameters();\n $initLvls[] = $parameters->GetSpokenAtHomeInitLevel();\n }\n \n foreach($leopairs as $leopair)\n {\n $experienceName = $leopair->GetExperienceName();\n $optionName = $leopair->GetOptionName();\n \n $initLvls[] = GetLanguageExperienceInitLevel($experienceName, $optionName);\n }\n \n $initLvl = max($initLvls);\n \n $this->SetLevel($initLvl);\n $this->SetPrevLevel($initLvl);\n }", "public function first(): ?\\StructType\\EwsUnifiedGroupSenderRestrictionsDataType\n {\n return parent::first();\n }", "function _get_maintainance() \n { \n return $this->admin_setting_model->get_maintainance();\n }", "function getMembershipLevel($force = false)\n\t\t{\n\t\t\tglobal $wpdb;\n\n\t\t\tif(!empty($this->membership_level) && empty($force))\n\t\t\t\treturn $this->membership_level;\n\n\t\t\t//check if there is an entry in memberships_users first\n\t\t\tif(!empty($this->user_id))\n\t\t\t{\n\t\t\t\t$this->membership_level = $wpdb->get_row(\"SELECT l.id as level_id, l.name, l.description, l.allow_signups, l.expiration_number, l.expiration_period, mu.*, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_membership_levels l LEFT JOIN $wpdb->pmpro_memberships_users mu ON l.id = mu.membership_id WHERE mu.status = 'active' AND l.id = '\" . $this->membership_id . \"' AND mu.user_id = '\" . $this->user_id . \"' LIMIT 1\");\n\n\t\t\t\t//fix the membership level id\n\t\t\t\tif(!empty($this->membership_level->level_id))\n\t\t\t\t\t$this->membership_level->id = $this->membership_level->level_id;\n\t\t\t}\n\n\t\t\t//okay, do I have a discount code to check? (if there is no membership_level->membership_id value, that means there was no entry in memberships_users)\n\t\t\tif(!empty($this->discount_code) && empty($this->membership_level->membership_id))\n\t\t\t{\n\t\t\t\tif(!empty($this->discount_code->code))\n\t\t\t\t\t$discount_code = $this->discount_code->code;\n\t\t\t\telse\n\t\t\t\t\t$discount_code = $this->discount_code;\n\n\t\t\t\t$sqlQuery = \"SELECT l.id, cl.*, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_discount_codes_levels cl LEFT JOIN $wpdb->pmpro_membership_levels l ON cl.level_id = l.id LEFT JOIN $wpdb->pmpro_discount_codes dc ON dc.id = cl.code_id WHERE dc.code = '\" . $discount_code . \"' AND cl.level_id = '\" . $this->membership_id . \"' LIMIT 1\";\n\n\t\t\t\t$this->membership_level = $wpdb->get_row($sqlQuery);\n\t\t\t}\n\n\t\t\t//just get the info from the membership table\t(sigh, I really need to standardize the column names for membership_id/level_id) but we're checking if we got the information already or not\n\t\t\tif(empty($this->membership_level->membership_id) && empty($this->membership_level->level_id))\n\t\t\t{\n\t\t\t\t$this->membership_level = $wpdb->get_row(\"SELECT l.* FROM $wpdb->pmpro_membership_levels l WHERE l.id = '\" . $this->membership_id . \"' LIMIT 1\");\n\t\t\t}\n\t\t\t\n\t\t\t// Round prices to avoid extra decimals.\n\t\t\tif( ! empty( $this->membership_level ) ) {\n\t\t\t\t$this->membership_level->initial_payment = pmpro_round_price( $this->membership_level->initial_payment );\n\t\t\t\t$this->membership_level->billing_amount = pmpro_round_price( $this->membership_level->billing_amount );\n\t\t\t\t$this->membership_level->trial_amount = pmpro_round_price( $this->membership_level->trial_amount );\n\t\t\t}\n\n\t\t\treturn $this->membership_level;\n\t\t}", "public function getFunSettings()\n {\n return $this->getProperty(\"FunSettings\", new TeamFunSettings());\n }", "public function getGeneralSettingsDefaultData()\n {\n $settings = array(\n 'enabled' => 1,\n 'pull_out' => 1,\n 'display_interval' => 1,\n 'custom_css' => '',\n 'wheel_sound' => 1,\n 'show_fireworks' => 0,\n 'pull_out_image_url' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'vss_spinandwin' . DS . 'gift.png'\n );\n return $settings;\n }", "public function getUserForcePasswordChangeOnLogonEnabled()\n {\n if (array_key_exists(\"userForcePasswordChangeOnLogonEnabled\", $this->_propDict)) {\n return $this->_propDict[\"userForcePasswordChangeOnLogonEnabled\"];\n } else {\n return null;\n }\n }", "public function to_enable()\n {\n global $SITE_INFO;\n $cpf = array();\n if (($SITE_INFO['forum_type'] != 'cns') || (get_db_forums() != get_db_site()) || ($GLOBALS['FORUM_DRIVER']->get_drivered_table_prefix() != get_table_prefix())) {\n $cpf['role'] = true;\n $cpf['sites'] = true;\n $cpf['firstname'] = true;\n $cpf['lastname'] = true;\n }\n return $cpf;\n }", "public function getSettings(){\r\n\t\treturn $this->initSettings;\r\n\t}", "function check()\n {\n /* Call common method to give check the hook */\n $message= plugin::check();\n $message = array_merge($message,$this->gotoLpdEnable_dialog->check());\n\n if($this->gotoXMethod != \"default\"){\n $xdmcp_types = $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES'];\n $available_servers = array();\n foreach($xdmcp_types as $servername =>$supported_types){\n if(in_array_strict(strtoupper($this->gotoXMethod),$supported_types)){\n $available_servers[] = $servername;\n }\n }\n foreach($this->selected_xdmcp_servers as $server){\n if(!in_array_strict($server,$available_servers)){\n $message[] = _(\"Remote desktop settings contains servers that do not support the selected connection method.\");\n break;\n }\n }\n }\n\n return ($message);\n }", "public function getdefaultPersonInEvent()\n {\n return $this->defaultpersoninevent;\n }", "public function defaultCode()\n {\n \tif (!$lang = $this->model->where('is_default', '=', 1)->first()) {\n \t\treturn false;\n \t}\n\n \treturn $lang->code;\n }", "function get_registered_settings()\n {\n }", "public function core_settings(){\r\n\t\tif($this->has_admin_panel()) return $this->module_core_settings();\r\n return $this->module_no_permission();\r\n\t}", "public function notification_settings()\n {\n return $this->hasOne('App\\NotificationSettings');\n }", "final protected function _defaults(){\n if(! $this->_defaults) return;\n foreach($this->_defaults as $conf => $default_value){\n if(! self::inform($conf)) self::define($conf, $default_value);\n }\n }", "public function getSynchronizeUpnForManagedUsersEnabled()\n {\n if (array_key_exists(\"synchronizeUpnForManagedUsersEnabled\", $this->_propDict)) {\n return $this->_propDict[\"synchronizeUpnForManagedUsersEnabled\"];\n } else {\n return null;\n }\n }", "public function default_settings() : array {\n\t\treturn [\n\t\t\t'layout' => 'block',\n\t\t\t'newsletter' => '',\n\t\t\t'theme' => 'light',\n\t\t\t'type' => 'subscribe',\n\t\t];\n\t}", "public static function createFromDiscriminatorValue(ParseNode $parseNode): NoTrainingNotificationSetting {\n return new NoTrainingNotificationSetting();\n }", "function getSettingValue(Collection $settings, $code){\n $setting = $settings->first(function($index, $setting)use($code){\n return $setting->code == $code;\n });\n\n if($setting)\n return $setting->value;\n\n return null;\n}", "public function getSmsNotificationsEnabled()\n {\n if (array_key_exists(\"smsNotificationsEnabled\", $this->_propDict)) {\n return $this->_propDict[\"smsNotificationsEnabled\"];\n } else {\n return null;\n }\n }", "public function getInitialConfig()\n {\n return $this->initialConfig;\n }", "function getInvitation() \n\t{\n\t\treturn ($this->invitation) ? $this->invitation : self::INVITATION_OFF;\n\t}", "function get_integration_settings($set_admin_defaults = FALSE) {\n\tglobal $db, $wpuAbs;\n\t\n\t$config_fields = get_db_schema();\n\t$wpSettings = array();\n\tif ($wpuAbs->ver == 'PHPBB3') {\n\t\tforeach($config_fields as $var_name => $field_name) {\n\t\t\tif ($wpuAbs->config('wpu_'.$field_name) !== FALSE) {\n\t\t\t\t$wpSettings[$var_name] = $wpuAbs->config('wpu_'.$field_name);\n\t\t\t\t//unset($GLOBALS['config']['wpu_'.$field_name]);\n\t\t\t} elseif ($set_admin_defaults) {\n\t\t\t\t$wpSettings[$var_name] = set_default($var_name);\n\t\t\t}\n\t\t}\n\t\treturn $wpSettings;\t\n\t}\n\t\n\t$sql = 'SELECT * FROM ' . WP_INT_TABLE . ' LIMIT 1';\n\tif (!$result = $db->sql_query($sql)) {\n\t\t//db error -- die\n\t\tmessage_die(GENERAL_ERROR, $lang['WP_DBErr_Retrieve'], __LINE__, __FILE__, $sql);\n\t\treturn FALSE;\n\t}\n\tif (!$db->sql_numrows($result)) {\n\t\t// table not populated yet\n\t\treturn FALSE;\n\t}\n\telse {\n\t\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$fullFieldSet = get_db_schema();\n\t\t\n\t\tforeach($fullFieldSet as $var_name => $field_name) {\n\t\t\t$wpSettings[$var_name] = $row[$field_name];\n\t\t}\n\t}\n}", "public function getNluSettings()\n {\n return isset($this->nlu_settings) ? $this->nlu_settings : null;\n }", "function show_notifications() {\n\n $is_cl_screen = CL_Common::is_settings_page();\n $transient_key = CL_Common::get_transient_key( 'announcement' );\n $ignore_key = CUSTOM_LOGIN_OPTION . '_ignore_announcement';\n $old_message = get_option( CUSTOM_LOGIN_OPTION . '_announcement_message' );\n $user_meta = get_user_meta( get_current_user_id(), $ignore_key, true );\n $capability = CL_Common::get_option( 'capability', 'general', 'manage_options' );\n\n /**\n * delete_user_meta( get_current_user_id(), $ignore_key, 1 );\n * delete_transient( $transient_key );\n * update_option( CUSTOM_LOGIN_OPTION . '_announcement_message', '' ); //*/\n\n // Current user can't manage options\n if ( ! current_user_can( $capability ) ) {\n return;\n }\n\n if ( ! $is_cl_screen ) {\n\n // Let's not show this at all if not on out menu page. @since 3.1\n return;\n\n // Global notifications\n if ( 'off' === CL_Common::get_option( 'admin_notices', 'general', 'off' ) ) {\n return;\n }\n\n // Make sure 'Frosty_Media_Notifications' isn't activated\n if ( class_exists( 'Frosty_Media_Notifications' ) ) {\n return;\n }\n }\n\n // https://raw.github.com/thefrosty/custom-login/master/extensions.json\n $message_url = esc_url( add_query_arg( array( 'edd_action' => 'cl_announcements' ), trailingslashit( CUSTOM_LOGIN_API_URL ) . 'cl-checkin-api/' ) );\n\n $announcement = CL_Common::wp_remote_get(\n $message_url,\n $transient_key,\n DAY_IN_SECONDS,\n 'CustomLogin' // We need our custom $user_agent\n );\n\n // Bail if errors\n if ( is_wp_error( $announcement ) ) {\n return;\n }\n\n // Bail if false or empty\n if ( ! $announcement || empty( $announcement ) ) {\n return;\n }\n\n if ( trim( $old_message ) !== trim( $announcement->message ) && ! empty( $old_message ) ) {\n delete_user_meta( get_current_user_id(), $ignore_key );\n delete_transient( $transient_key );\n update_option( CUSTOM_LOGIN_OPTION . '_announcement_message', $announcement->message );\n }\n\n $html = '<div class=\"updated\"><p>';\n $html .= ! $is_cl_screen ? // If we're on our settings page let not show the dismiss notice link.\n sprintf( '%2$s <span class=\"alignright\">| <a href=\"%3$s\">%1$s</a></span>',\n __( 'Dismiss', CUSTOM_LOGIN_DIRNAME ),\n $announcement->message,\n esc_url( add_query_arg( $ignore_key, wp_create_nonce( $ignore_key ), admin_url( 'options-general.php?page=custom-login' ) ) ),\n esc_url( admin_url( 'options-general.php?page=custom-login#custom_login_general' ) )\n ) :\n sprintf( '%s', $announcement->message );\n $html .= '</p></div>';\n\n if ( ( ! $user_meta && 1 !== $user_meta ) || $is_cl_screen ) {\n echo $html;\n }\n }" ]
[ "0.5604965", "0.52011174", "0.5119234", "0.5007001", "0.49854013", "0.49307632", "0.49038061", "0.4860217", "0.4830116", "0.4828151", "0.47871506", "0.47715014", "0.47662607", "0.47631186", "0.47241667", "0.47213748", "0.46924117", "0.46796", "0.46478423", "0.4646224", "0.46181265", "0.4612216", "0.46081743", "0.45995107", "0.45994565", "0.4584028", "0.45772055", "0.4535103", "0.45265123", "0.4526198", "0.4509839", "0.44876945", "0.44839168", "0.44828808", "0.44565707", "0.44441962", "0.4442736", "0.44395828", "0.44361004", "0.44352394", "0.4434327", "0.44328377", "0.44180307", "0.4415744", "0.44099218", "0.4401634", "0.4399742", "0.43958765", "0.43943974", "0.43938887", "0.4393117", "0.43916827", "0.4382674", "0.43807632", "0.4380587", "0.43799007", "0.43795753", "0.4369807", "0.43675202", "0.43633145", "0.43585396", "0.43584594", "0.43564242", "0.43561128", "0.43515947", "0.4351366", "0.43511215", "0.43477514", "0.43467724", "0.434343", "0.43417788", "0.43326247", "0.43133128", "0.4309647", "0.43009382", "0.4300114", "0.4298637", "0.4298223", "0.42968807", "0.42899513", "0.42847067", "0.4282597", "0.4282294", "0.42807734", "0.4273772", "0.42721915", "0.42672336", "0.4264604", "0.4264516", "0.42640516", "0.42632905", "0.4260511", "0.42588115", "0.42580155", "0.4255641", "0.42534602", "0.42438713", "0.42427862", "0.42419758", "0.4241961" ]
0.57416373
0
Get a list of all the notification codes this hook can handle. (Addons can define hooks that handle whole sets of codes, so hooks are written so they can take wide authority)
public function list_handled_codes() { $list = array(); $list['filedump'] = array(do_lang('CONTENT'), do_lang('filedump:NOTIFICATION_TYPE_filedump')); return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAllCodes() {\n \t$codes = array();\n \t$config = Mage::getConfig()->getNode('crontab/jobs'); /* @var $config Mage_Core_Model_Config_Element */\n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($codes);\n \treturn $codes;\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}", "protected function getAllCodes() {\n\t\t$codes = array();\n\t\t$config = Mage::getConfig()->getNode('crontab/jobs'); \n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$config = Mage::getConfig()->getNode('default/crontab/jobs');\n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($codes);\n\t\treturn $codes;\n\t}", "public static function getExcludedChannelCodes()\n {\n if (!static::canUse()) {\n return array();\n }\n\n static $codes = null;\n if ($codes === null) {\n $codes = ImConnector\\Connector::getListConnectorNotNewsletter();\n }\n\n return $codes;\n }", "public function getCodes () {\n $list = [\n '' => '全部',\n 'optask' => '任务',\n 'patientrecord' => '运营备注',\n 'patientstage' => '患者阶段',\n 'patientgroup' => '患者分组',\n 'patientremark' => '患者文本备注',\n ];\n\n return $list;\n }", "public static function codes()\n {\n return static::CODES;\n }", "public function codes()\n {\n return $this->codes;\n }", "public function getPreCommitHookList() {}", "static function getCodes() {\n $oClass = new ReflectionClass(__CLASS__);\n return $oClass->getConstants();\n }", "public function getBackupCodes();", "static public function getDeclaredNotifications(): array\n {\n return static::$declared_notifications;\n }", "static public function __hx__list () {\n\t\treturn [\n\t\t\t0 => 'BackOff',\n\t\t\t3 => 'Clog',\n\t\t\t1 => 'Finish',\n\t\t\t2 => 'Resume',\n\t\t];\n\t}", "public function getNotificationNids(): array;", "public function getNotifications()\n\t{\n\t\t$arrReturn = array();\n\t\t\n\t\t$arrTypes = array_keys($GLOBALS['NOTIFICATION_CENTER']['NOTIFICATION_TYPE']['pct_customcatalog_frontedit']);\n\t\t\n\t\t$objNotifications = \\NotificationCenter\\Model\\Notification::findBy(array('FIND_IN_SET(type,?)'),implode(',',$arrTypes));\n\t\tif($objNotifications === null)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\tforeach($objNotifications as $objModel)\n\t\t{\n\t\t\t$arrReturn[ $objModel->id ] = $objModel->title;\n\t\t}\n\t\t\n\t\treturn $arrReturn;\n\t}", "public function getNotificationCommands()\n {\n return $this->getCommandList(1);\n }", "public function getAppCodes() {\n return $this->api('appcodes')->getRows();\n }", "public function list_bbcodes()\r\n\t{\r\n\t\treturn array_keys($this->bbcodes);\r\n\t}", "public static function mainCodes()\n {\n return static::MAIN_CODES;\n }", "public function getPostCommitHookList() {}", "public static function availableHooks() {\n\t\t$data = array(\n\t\t\t'form',\n\t\t\t'input',\n\t\t\t'fieldset',\n\t\t\t'legen',\n\t\t\t'label',\n\t\t\t'select',\n\t\t\t'_token',\n\t\t\t'_edit',\n\t\t\t'_create',\n\t\t\t'_email',\n\t\t\t'extension',\n\t\t\t'_instance'\n\t\t);\n\n\t\treturn $data;\n\t}", "public function getList()\n {\n $_params = array();\n return $this->master->call('webhooks/list', $_params);\n }", "abstract public function getReceptionCodes();", "abstract public function getReceptionCodes();", "public function getAllHooks() {\n\t\t$this->hooks = $this->getConfig('hooks');\n\t\tif (empty($this->hooks)) {\n\t\t\t$this->hooks = $this->updateBMOHooks();\n\t\t}\n\t\treturn $this->hooks;\n\t}", "public function getNoticeCodes()\n {\n return static::NOTICE_CODES;\n }", "private function getCoreHokkCallbacks() {\n\n\t\tglobal $wp_filter;\n\t\tif (isset($wp_filter[$this->hookName]))\n\t\t\treturn $wp_filter[$this->hookName];\n\t\telse {\n\t\t\t\treturn array();\n\t\t}\n\t}", "static public function getCodes(){\n return array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Moved Temporarily',\n 307 => 'Temporary Redirect',\n 310 => 'Too many Redirects',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range unsatisfiable',\n 417 => 'Expectation failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 508 => 'Loop detected',\n );\n }", "function getSpecialRegistrationCodes() {\n // authenticate as the firebase service account\n global $gServiceAccountCredentialsFilepath;\n $firebaseServiceAccount = Firebase\\ServiceAccount::fromJsonFile( $gServiceAccountCredentialsFilepath );\n $firebase = (new Firebase\\Factory)->withServiceAccount( $firebaseServiceAccount )->create();\n $fireDatabase = $firebase->getDatabase();\n $regCodes = $fireDatabase->getReference( 'registration-codes' )->getValue();\n return $regCodes;\n}", "function _getNotificationSettingCategories() {\n\t\treturn array(\n\t\t\t'submissions' => array('categoryKey' => 'notification.type.submissions',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_ARTICLE_SUBMITTED, NOTIFICATION_TYPE_METADATA_MODIFIED, NOTIFICATION_TYPE_SUPP_FILE_MODIFIED)),\n\t\t\t'reviewing' => array('categoryKey' => 'notification.type.reviewing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_REVIEWER_COMMENT, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT, NOTIFICATION_TYPE_EDITOR_DECISION_COMMENT)),\n\t\t\t'editing' => array('categoryKey' => 'notification.type.editing',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_GALLEY_MODIFIED, NOTIFICATION_TYPE_SUBMISSION_COMMENT, NOTIFICATION_TYPE_LAYOUT_COMMENT, NOTIFICATION_TYPE_COPYEDIT_COMMENT, NOTIFICATION_TYPE_PROOFREAD_COMMENT)),\n\t\t\t'site' => array('categoryKey' => 'notification.type.site',\n\t\t\t\t'settings' => array(NOTIFICATION_TYPE_USER_COMMENT, NOTIFICATION_TYPE_PUBLISHED_ISSUE, NOTIFICATION_TYPE_NEW_ANNOUNCEMENT)),\n\t\t);\n\t}", "protected function get_deprecated_hooks() {\n\n\t\treturn array(\n\t\t\t// TODO remove by January 2020 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_sort_order_items' => array(\n\t\t\t\t'version' => '3.3.5',\n\t\t\t\t'replacement' => 'wc_pip_sort_order_item_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => false,\n\t\t\t),\n\t\t\t// TODO remove by December 2019 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_pick_list_document_table_row_cells' => array(\n\t\t\t\t'version' => '3.6.2',\n\t\t\t\t'replacement' => 'wc_pip_pick_list_grouped_by_category_table_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t);\n\t}", "public static function getNotifications()\n {\n $callbacks = Notifications::_checks();\n\n $notifications = array();\n foreach ($callbacks as $check) {\n $notification = call_user_func($check);\n if (is_array($notification)) {\n $notifications = array_merge($notifications, $notification);\n } elseif (strlen(trim($notification))) {\n $notifications[] = $notification;\n }\n }\n if (count(self::$notifications)) {\n $notifications = array_merge($notifications, self::$notifications);\n }\n if (count($notifications)) {\n return $notifications;\n } else {\n return null;\n }\n }", "public static function notifications(): array\n {\n return [];\n }", "protected function get_deprecated_hooks() {\n\n\t\t$hooks = array(\n\t\t\t'woocommerce_elavon_vm_icon' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_icon',\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t\t'woocommerce_elavon_card_types' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_available_card_types',\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t\t'wc_payment_gateway_elavon_vm_request_xml' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_request_data',\n\t\t\t),\n\t\t);\n\n\t\treturn $hooks;\n\t}", "protected function getStateCodes()\n {\n $states = \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\State')->findAll();\n $result = array();\n\n foreach ($states as $state) {\n $result[] = array(\n 'id' => $state->getStateId(),\n 'code' => $state->getCode(),\n );\n }\n\n return json_encode($result);\n }", "public function getFeatureCodes()\n {\n return isset($this->FeatureCodes) ? $this->FeatureCodes : null;\n }", "public static function getNames()\n\t{\n\t\t$list = [];\n\t\tforeach (self::getCodes() as $code)\n\t\t{\n\t\t\t$list[$code] = Base::getNameByCode($code);\n\t\t}\n\n\t\treturn $list;\n\t}", "public function getNotificationTypes()\n {\n return $this->notifications;\n }", "private function getHookNames()\n {\n $container = $this->getContainer();\n\n $gridServiceIds = $container->getParameter('prestashop.core.grid.definition.service_ids');\n $optionsFormHookNames = $container->getParameter('prestashop.hook.option_form_hook_names');\n $identifiableObjectFormTypes = $container->getParameter('prestashop.core.form.identifiable_object.form_types');\n\n $gridDefinitionHooksProvider = $container->get(\n 'prestashop.core.hook.provider.grid_definition_hook_by_service_ids_provider'\n );\n\n $identifiableObjectFormTypeProvider = $container->get(\n 'prestashop.core.hook.provider.identifiable_object_hook_by_form_type_provider'\n );\n\n $gridDefinitionHookNames = $gridDefinitionHooksProvider->getHookNames($gridServiceIds);\n\n $identifiableObjectHookNames = $identifiableObjectFormTypeProvider->getHookNames($identifiableObjectFormTypes);\n\n return array_merge(\n $identifiableObjectHookNames,\n $optionsFormHookNames,\n $gridDefinitionHookNames\n );\n }", "public function getCodes()\n {\n \n $materials = $this->materialsDao->getAll();\n \n $codesArr = array_map(function ($material) {\n return $material->code;\n }, $materials);\n\n return $codesArr;\n }", "protected function getNotificationActions(): array {\n $notifications = [];\n $actions = $this->getActions();\n foreach ($actions as $key => $action) {\n if (!isset($action['enable_notifications']) || $action['enable_notifications'] === FALSE) {\n continue;\n }\n if ($key === 'moderation_state_published') {\n $action['title'] = $this->t('Publish now');\n }\n\n $notifications[$key] = [\n '#type' => 'button',\n '#name' => 'moderation-state-notification-button-' . $action['hyphenated_key'],\n '#id' => 'moderation-state-notification-button-' . $action['hyphenated_key'],\n '#value' => $action['title'],\n '#attributes' => [\n 'class' => [\n 'use-ajax-submit',\n 'button',\n 'moderation-state-notification-button',\n ],\n 'data-moderation-state' => $key,\n ],\n '#ajax' => [\n 'callback' => [NotificationsHelper::class, 'notificationCallback'],\n ],\n '#submit' => [],\n '#limit_validation_errors' => [],\n '#displayNotification' => $this->displayNotificationAction($action['field']),\n ];\n }\n\n return $notifications;\n }", "public function getCodeIdentifier() : array\n {\n $list = [];\n\n foreach ($this->binds as $codeName => $value){\n $list['codeName'] = Str::snake($codeName);\n $list['value'] = intval($value);\n }\n\n return $list;\n }", "public function getItemCodes()\n {\n return $this->itemCodes;\n }", "public static function codeceptionEvents()\n {\n if (null === static::$compiledCodeceptionEvents) {\n static::$compiledCodeceptionEvents = array_filter(array_map(static function ($const) {\n return defined($const) ? constant($const) : null;\n }, static::$allCodeceptionEvents));\n }\n\n return static::$compiledCodeceptionEvents;\n }", "public function getAllCode(){\n return parent::getAll('code_ade');\n }", "public function getWarningList() {\n\t\treturn [\n\t\t\t110 => 1,\n\t\t\t111 => 1,\n\t\t\t114 => 1,\n\t\t\t118 => 1,\n\t\t\t119 => 1,\n\t\t\t122 => 1,\n\t\t\t125 => 1,\n\t\t\t130 => 1,\n\t\t\t131 => 1,\n\t\t\t132 => 1,\n\t\t\t137 => 1,\n\t\t\t138 => 1,\n\t\t\t139 => 1,\n\t\t\t208 => 1,\n\t\t];\n\t}", "public function getHooksToInstall(): array\n {\n // to make sure the user will be asked to confirm every hook installation\n // unless the user provided the force or skip option\n // if specific hooks are set, the use has actively chosen it, so don't ask for permission anymore\n if (!empty($this->hooksToHandle)) {\n return array_map(fn($hook) => false, array_flip($this->hooksToHandle));\n }\n $hooks = Hooks::nativeHooks();\n if ($this->onlyEnabled) {\n $hooks = array_filter(\n $hooks,\n fn($hook) => $this->config->isHookEnabled($hook),\n ARRAY_FILTER_USE_KEY\n );\n }\n return array_map(fn($hook) => true, $hooks);\n }", "protected function getHookLines($hook)\n {\n $hookLines = [\n 'pre-commit' => [\n './vendor/bin/run qa:update-sniff-list',\n ],\n ];\n \n return array_key_exists($hook, $hookLines) ? $hookLines[$hook] : [];\n }", "public function get_langs_list()\n {\n // they must come first. (ex: CSS has to come \n // before CSS-extras)\n\n return [\n 1 => ['id' => 'markup', 'name' => 'Markup', 'file' => 'prism-markup', 'require' => '', 'in_popup' => 1],\n 2 => ['id' => 'css', 'name' => 'CSS', 'file' => 'prism-css', 'require' => '', 'in_popup' => 1],\n 3 => ['id' => 'css-extras', 'name' => 'CSS Extras', 'file' => 'prism-css-extras', 'require' => 'css', 'in_popup' => 0],\n 4 => ['id' => 'clike', 'name' => 'C-Like', 'file' => 'prism-clike', 'require' => '', 'in_popup' => 1],\n 5 => ['id' => 'javascript', 'name' => 'Java-Script', 'file' => 'prism-javascript', 'require' => 'clike', 'in_popup' => 1],\n 6 => ['id' => 'php', 'name' => 'PHP', 'file' => 'prism-php', 'require' => 'clike', 'in_popup' => 1],\n 7 => ['id' => 'php-extras', 'name' => 'PHP Extras', 'file' => 'prism-php-extras', 'require' => 'php', 'in_popup' => 0],\n 8 => ['id' => 'ruby', 'name' => 'Ruby', 'file' => 'prism-ruby', 'require' => 'clike', 'in_popup' => 1],\n 9 => ['id' => 'sql', 'name' => 'SQL', 'file' => 'prism-sql', 'require' => '', 'in_popup' => 1],\n 10 => ['id' => 'c', 'name' => 'C', 'file' => 'prism-c', 'require' => 'clike', 'in_popup' => 1],\n 11 => ['id' => 'abap', 'name' => 'ABAP', 'file' => 'prism-abap', 'require' => '', 'in_popup' => 1],\n 12 => ['id' => 'actionscript', 'name' => 'ActionScript', 'file' => 'prism-actionscript', 'require' => 'javascript', 'in_popup' => 1],\n 13 => ['id' => 'ada', 'name' => 'Ada', 'file' => 'prism-ada', 'require' => '', 'in_popup' => 1],\n 14 => ['id' => 'apacheconf', 'name' => 'Apache Configuration', 'file' => 'prism-apacheconf', 'require' => '', 'in_popup' => 1],\n 15 => ['id' => 'apl', 'name' => 'APL', 'file' => 'prism-apl', 'require' => '', 'in_popup' => 1],\n 16 => ['id' => 'applescript', 'name' => 'Applescript', 'file' => 'prism-applescript', 'require' => '', 'in_popup' => 1],\n 17 => ['id' => 'asciidoc', 'name' => 'AsciiDoc', 'file' => 'prism-asciidoc', 'require' => '', 'in_popup' => 1],\n 18 => ['id' => 'aspnet', 'name' => 'ASP.NET (C#)', 'file' => 'prism-aspnet', 'require' => 'markup', 'in_popup' => 1],\n 19 => ['id' => 'autoit', 'name' => 'AutoIt', 'file' => 'prism-autoit', 'require' => '', 'in_popup' => 1],\n 20 => ['id' => 'autohotkey', 'name' => 'AutoHotkey', 'file' => 'prism-autohotkey', 'require' => '', 'in_popup' => 1],\n 21 => ['id' => 'bash', 'name' => 'Bash', 'file' => 'prism-bash', 'require' => '', 'in_popup' => 1],\n 22 => ['id' => 'basic', 'name' => 'BASIC', 'file' => 'prism-basic', 'require' => '', 'in_popup' => 1],\n 23 => ['id' => 'batch', 'name' => 'Batch', 'file' => 'prism-batch', 'require' => '', 'in_popup' => 1],\n 24 => ['id' => 'bison', 'name' => 'Bison', 'file' => 'prism-bison', 'require' => 'c', 'in_popup' => 1],\n 25 => ['id' => 'brainfuck', 'name' => 'Brainfuck', 'file' => 'prism-brainfuck', 'require' => '', 'in_popup' => 1],\n 26 => ['id' => 'bro', 'name' => 'Bro', 'file' => 'prism-bro', 'require' => '', 'in_popup' => 1],\n 27 => ['id' => 'csharp', 'name' => 'C#', 'file' => 'prism-csharp', 'require' => 'c', 'in_popup' => 1],\n 28 => ['id' => 'cpp', 'name' => 'C++', 'file' => 'prism-cpp', 'require' => 'c', 'in_popup' => 1],\n 29 => ['id' => 'coffeescript', 'name' => 'CoffeeScript', 'file' => 'prism-coffeescript', 'require' => 'javascript', 'in_popup' => 1],\n 30 => ['id' => 'crystal', 'name' => 'Crystal', 'file' => 'prism-crystal', 'require' => 'ruby', 'in_popup' => 1],\n 31 => ['id' => 'd', 'name' => 'D', 'file' => 'prism-d', 'require' => 'clike', 'in_popup' => 1],\n 32 => ['id' => 'dart', 'name' => 'Dart', 'file' => 'prism-dart', 'require' => 'clike', 'in_popup' => 1],\n 33 => ['id' => 'diff', 'name' => 'Diff', 'file' => 'prism-diff', 'require' => '', 'in_popup' => 1],\n 34 => ['id' => 'django', 'name' => 'Django/Jinja2', 'file' => 'prism-django', 'require' => 'markup', 'in_popup' => 1],\n 35 => ['id' => 'docker', 'name' => 'Docker', 'file' => 'prism-docker', 'require' => '', 'in_popup' => 1],\n 36 => ['id' => 'eiffel', 'name' => 'Eiffel', 'file' => 'prism-eiffel', 'require' => '', 'in_popup' => 1],\n 37 => ['id' => 'elixir', 'name' => 'Elixir', 'file' => 'prism-elixir', 'require' => '', 'in_popup' => 1],\n 38 => ['id' => 'erlang', 'name' => 'Erlang', 'file' => 'prism-erlang', 'require' => '', 'in_popup' => 1],\n 39 => ['id' => 'fsharp', 'name' => 'F#', 'file' => 'prism-fsharp', 'require' => 'clike', 'in_popup' => 1],\n 40 => ['id' => 'fortran', 'name' => 'Fortran', 'file' => 'prism-fortran', 'require' => '', 'in_popup' => 1],\n 41 => ['id' => 'gherkin', 'name' => 'Gherkin', 'file' => 'prism-gherkin', 'require' => '', 'in_popup' => 1],\n 42 => ['id' => 'git', 'name' => 'Git', 'file' => 'prism-git', 'require' => '', 'in_popup' => 1],\n 43 => ['id' => 'glsl', 'name' => 'GLSL', 'file' => 'prism-glsl', 'require' => 'clike', 'in_popup' => 1],\n 44 => ['id' => 'go', 'name' => 'Go', 'file' => 'prism-go', 'require' => 'clike', 'in_popup' => 1],\n 45 => ['id' => 'graphql', 'name' => 'GraphQL', 'file' => 'prism-graphql', 'require' => '', 'in_popup' => 1],\n 46 => ['id' => 'groovy', 'name' => 'Groovy', 'file' => 'prism-groovy', 'require' => 'clike', 'in_popup' => 1],\n 47 => ['id' => 'haml', 'name' => 'Haml', 'file' => 'prism-haml', 'require' => 'ruby', 'in_popup' => 1],\n 48 => ['id' => 'handlebars', 'name' => 'Handlebars', 'file' => 'prism-handlebars', 'require' => 'markup', 'in_popup' => 1],\n 49 => ['id' => 'haskell', 'name' => 'Haskell', 'file' => 'prism-haskell', 'require' => '', 'in_popup' => 1],\n 50 => ['id' => 'haxe', 'name' => 'Haxe', 'file' => 'prism-haxe', 'require' => 'clike', 'in_popup' => 1],\n 51 => ['id' => 'http', 'name' => 'HTTP', 'file' => 'prism-http', 'require' => '', 'in_popup' => 1],\n 52 => ['id' => 'icon', 'name' => 'Icon', 'file' => 'prism-icon', 'require' => '', 'in_popup' => 1],\n 53 => ['id' => 'inform7', 'name' => 'Inform 7', 'file' => 'prism-inform7', 'require' => '', 'in_popup' => 1],\n 54 => ['id' => 'ini', 'name' => 'Ini', 'file' => 'prism-ini', 'require' => '', 'in_popup' => 1],\n 55 => ['id' => 'j', 'name' => 'J', 'file' => 'prism-j', 'require' => '', 'in_popup' => 1],\n 56 => ['id' => 'jade', 'name' => 'Jade', 'file' => 'prism-jade', 'require' => 'javascript', 'in_popup' => 1],\n 57 => ['id' => 'java', 'name' => 'Java', 'file' => 'prism-java', 'require' => 'clike', 'in_popup' => 1],\n 58 => ['id' => 'jolie', 'name' => 'Jolie', 'file' => 'prism-jolie', 'require' => 'clike', 'in_popup' => 1],\n 59 => ['id' => 'json', 'name' => 'JSON', 'file' => 'prism-json', 'require' => '', 'in_popup' => 1],\n 60 => ['id' => 'julia', 'name' => 'Julia', 'file' => 'prism-julia', 'require' => '', 'in_popup' => 1],\n 61 => ['id' => 'keyman', 'name' => 'Keyman', 'file' => 'prism-keyman', 'require' => '', 'in_popup' => 1],\n 62 => ['id' => 'kotlin', 'name' => 'Kotlin', 'file' => 'prism-kotlin', 'require' => 'clike', 'in_popup' => 1],\n 63 => ['id' => 'latex', 'name' => 'LaTex', 'file' => 'prism-latex', 'require' => '', 'in_popup' => 1],\n 64 => ['id' => 'less', 'name' => 'Less', 'file' => 'prism-less', 'require' => 'css', 'in_popup' => 1],\n 65 => ['id' => 'livescript', 'name' => 'LiveScript', 'file' => 'prism-livescript', 'require' => '', 'in_popup' => 1],\n 66 => ['id' => 'lolcode', 'name' => 'LOLCODE', 'file' => 'prism-lolcode', 'require' => '', 'in_popup' => 1],\n 67 => ['id' => 'lua', 'name' => 'Lua', 'file' => 'prism-lua', 'require' => '', 'in_popup' => 1],\n 68 => ['id' => 'makefile', 'name' => 'Makefile', 'file' => 'prism-makefile', 'require' => '', 'in_popup' => 1],\n 69 => ['id' => 'markdown', 'name' => 'Markdown', 'file' => 'prism-markdown', 'require' => 'markup', 'in_popup' => 1],\n 70 => ['id' => 'matlab', 'name' => 'MATLAB', 'file' => 'prism-matlab', 'require' => '', 'in_popup' => 1],\n 71 => ['id' => 'mel', 'name' => 'MEL', 'file' => 'prism-mel', 'require' => '', 'in_popup' => 1],\n 72 => ['id' => 'mizar', 'name' => 'Mizar', 'file' => 'prism-mizar', 'require' => '', 'in_popup' => 1],\n 73 => ['id' => 'monkey', 'name' => 'Monkey', 'file' => 'prism-monkey', 'require' => '', 'in_popup' => 1],\n 74 => ['id' => 'nasm', 'name' => 'NASM', 'file' => 'prism-nasm', 'require' => '', 'in_popup' => 1],\n 75 => ['id' => 'nginx', 'name' => 'nginx', 'file' => 'prism-nginx', 'require' => 'clike', 'in_popup' => 1],\n 76 => ['id' => 'nim', 'name' => 'Nim', 'file' => 'prism-nim', 'require' => '', 'in_popup' => 1],\n 77 => ['id' => 'nix', 'name' => 'Nix', 'file' => 'prism-nix', 'require' => '', 'in_popup' => 1],\n 78 => ['id' => 'objectivec', 'name' => 'Objective-C', 'file' => 'prism-objectivec', 'require' => 'c', 'in_popup' => 1],\n 79 => ['id' => 'ocaml', 'name' => 'OCaml', 'file' => 'prism-ocaml', 'require' => '', 'in_popup' => 1],\n 80 => ['id' => 'oz', 'name' => 'Oz', 'file' => 'prism-oz', 'require' => '', 'in_popup' => 1],\n 81 => ['id' => 'parigp', 'name' => 'PARI/GP', 'file' => 'prism-parigp', 'require' => '', 'in_popup' => 1],\n 82 => ['id' => 'parser', 'name' => 'Parser', 'file' => 'prism-parser', 'require' => 'markup', 'in_popup' => 1],\n 83 => ['id' => 'pascal', 'name' => 'Pascal', 'file' => 'prism-pascal', 'require' => '', 'in_popup' => 1],\n 84 => ['id' => 'perl', 'name' => 'Perl', 'file' => 'prism-perl', 'require' => '', 'in_popup' => 1],\n 85 => ['id' => 'powershell', 'name' => 'PowerShell', 'file' => 'prism-powershell', 'require' => '', 'in_popup' => 1],\n 86 => ['id' => 'processing', 'name' => 'Processing', 'file' => 'prism-processing', 'require' => 'clike', 'in_popup' => 1],\n 87 => ['id' => 'prolog', 'name' => 'Prolog', 'file' => 'prism-prolog', 'require' => '', 'in_popup' => 1],\n 88 => ['id' => 'properties', 'name' => '.properties', 'file' => 'prism-properties', 'require' => '', 'in_popup' => 1],\n 89 => ['id' => 'protobuf', 'name' => 'Protocol Buffers', 'file' => 'prism-protobuf', 'require' => 'clike', 'in_popup' => 1],\n 90 => ['id' => 'puppet', 'name' => 'Puppet', 'file' => 'prism-puppet', 'require' => '', 'in_popup' => 1],\n 91 => ['id' => 'pure', 'name' => 'Pure', 'file' => 'prism-pure', 'require' => '', 'in_popup' => 1],\n 92 => ['id' => 'python', 'name' => 'Python', 'file' => 'prism-python', 'require' => '', 'in_popup' => 1],\n 93 => ['id' => 'q', 'name' => 'Q', 'file' => 'prism-q', 'require' => '', 'in_popup' => 1],\n 94 => ['id' => 'qore', 'name' => 'Qore', 'file' => 'prism-qore', 'require' => 'clike', 'in_popup' => 1],\n 95 => ['id' => 'r', 'name' => 'R', 'file' => 'prism-r', 'require' => '', 'in_popup' => 1],\n 96 => ['id' => 'jsx', 'name' => 'React JSX', 'file' => 'prism-jsx', 'require' => 'markup', 'in_popup' => 1],\n 97 => ['id' => 'reason', 'name' => 'Reason', 'file' => 'prism-reason', 'require' => 'clike', 'in_popup' => 1],\n 98 => ['id' => 'rest', 'name' => 'reST (reStructuredText)', 'file' => 'prism-rest', 'require' => '', 'in_popup' => 1],\n 99 => ['id' => 'rip', 'name' => 'Rip', 'file' => 'prism-rip', 'require' => '', 'in_popup' => 1],\n 100 => ['id' => 'roboconf', 'name' => 'Roboconf', 'file' => 'prism-roboconf', 'require' => '', 'in_popup' => 1],\n 101 => ['id' => 'rust', 'name' => 'Rust', 'file' => 'prism-rust', 'require' => '', 'in_popup' => 1],\n 102 => ['id' => 'sas', 'name' => 'SAS', 'file' => 'prism-sas', 'require' => '', 'in_popup' => 1],\n 103 => ['id' => 'sass', 'name' => 'Sass (Sass)', 'file' => 'prism-sass', 'require' => 'css', 'in_popup' => 1],\n 104 => ['id' => 'scss', 'name' => 'Sass (Scss)', 'file' => 'prism-scss', 'require' => 'css', 'in_popup' => 1],\n 105 => ['id' => 'scala', 'name' => 'Scala', 'file' => 'prism-scala', 'require' => 'clike', 'in_popup' => 1],\n 106 => ['id' => 'scheme', 'name' => 'Scheme', 'file' => 'prism-scheme', 'require' => '', 'in_popup' => 1],\n 107 => ['id' => 'smalltalk', 'name' => 'Smalltalk', 'file' => 'prism-smalltalk', 'require' => '', 'in_popup' => 1],\n 108 => ['id' => 'smarty', 'name' => 'Smarty', 'file' => 'prism-smarty', 'require' => 'markup', 'in_popup' => 1],\n 109 => ['id' => 'stylus', 'name' => 'Stylus', 'file' => 'prism-stylus', 'require' => '', 'in_popup' => 1],\n 110 => ['id' => 'swift', 'name' => 'Swift', 'file' => 'prism-swift', 'require' => 'clike', 'in_popup' => 1],\n 111 => ['id' => 'tcl', 'name' => 'Tcl', 'file' => 'prism-tcl', 'require' => '', 'in_popup' => 1],\n 112 => ['id' => 'textile', 'name' => 'Textile', 'file' => 'prism-textile', 'require' => 'markup', 'in_popup' => 1],\n 113 => ['id' => 'twig', 'name' => 'Twig', 'file' => 'prism-twig', 'require' => 'markup', 'in_popup' => 1],\n 114 => ['id' => 'typescript', 'name' => 'TypeScript', 'file' => 'prism-typescript', 'require' => 'javascript', 'in_popup' => 1],\n 115 => ['id' => 'verilog', 'name' => 'Verilog', 'file' => 'prism-verilog', 'require' => '', 'in_popup' => 1],\n 116 => ['id' => 'vhdl', 'name' => 'VHDL', 'file' => 'prism-vhdl', 'require' => '', 'in_popup' => 1],\n 117 => ['id' => 'vim', 'name' => 'vim', 'file' => 'prism-vim', 'require' => '', 'in_popup' => 1],\n 118 => ['id' => 'wiki', 'name' => 'Wiki markup', 'file' => 'prism-wiki', 'require' => 'markup', 'in_popup' => 1],\n 119 => ['id' => 'xojo', 'name' => 'Xojo (REALbasic)', 'file' => 'prism-xojo', 'require' => '', 'in_popup' => 1],\n 120 => ['id' => 'yaml', 'name' => 'YAML', 'file' => 'prism-yaml', 'require' => '', 'in_popup' => 1],\n\n ];\n }", "public static function get_installed_addons_list(){\n $installed_addons = [];\n $installed_addons = apply_filters('latepoint_installed_addons', $installed_addons);\n return $installed_addons;\n }", "public static function get_subscribed_events() {\r\n\t\t$current_theme = wp_get_theme();\r\n\r\n\t\tif ( 'Bridge' !== $current_theme->get( 'Name' ) ) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn [\r\n\t\t\t'rocket_lazyload_background_images' => 'disable_lazyload_background_images',\r\n\t\t\t'update_option_qode_options_proya' => [ 'maybe_clear_cache', 10, 2 ],\r\n\t\t];\r\n\t}", "public function getKeys() {\n if (!isset($this->_keys)) {\n $this->_keys = array('ADDONS_CATALOG_SUPPORT_TICKETS_STATUS');\n }\n\n return $this->_keys;\n }", "protected function _getLangCodesMapping()\n {\n $oLang = \\OxidEsales\\Eshop\\Core\\Registry::getLang();\n $aLanguages = $oLang->getLanguageArray();\n $aRetArray = array();\n foreach ($aLanguages as $aLanguage) {\n $aRetArray[$aLanguage->oxid] = $aLanguage->id;\n }\n return $aRetArray;\n }", "private function getAppMentionEventData(): array {\n return [\n 'type' => 'app_mention',\n 'user' => 'W021FGA1Z',\n 'text' => 'You can count on <@U0LAN0Z89> for an honorable mention.',\n 'ts' => '1515449483.000108',\n 'channel' => 'C0LAN2Q65',\n 'event_ts' => '1515449483000108',\n ];\n }", "function getStatusList() {\n $statusList = array();\n foreach (Constants::$statusNames as $id => $name) {\n $statusList[$id] = \"$id - $name\";\n }\n return $statusList;\n}", "public static function getStatusList()\n {\n return array(\n self::STATUS_TRASH => 'trash',\n self::STATUS_DRAFT => 'draft',\n self::STATUS_PUBLISHED => 'published',\n );\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "function drush_module_builder_callback_data_list() {\n $commands = func_get_args();\n\n // Get our task handler, which checks hook data is ready.\n try {\n $mb_task_handler_report = \\DrupalCodeBuilder\\Factory::getTask('ReportHookData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $time = $mb_task_handler_report->lastUpdatedDate();\n $data = $mb_task_handler_report->listHookData();\n\n if (drush_get_option('raw')) {\n drush_print_r($data);\n return;\n }\n\n if (count($commands)) {\n // Put the requested filenames into the keys of an array, and intersect them\n // with the hook data.\n $files_requested = array_fill_keys($commands, TRUE);\n $data_requested = array_intersect_key($data, $files_requested);\n }\n else {\n $data_requested = $data;\n }\n\n if (!count($data_requested) && count($files_requested)) {\n drush_print(t(\"No hooks found for the specified files.\"));\n }\n\n drush_print(\"Hooks:\");\n foreach ($data_requested as $file => $hooks) {\n drush_print(\"Group $file:\", 2);\n foreach ($hooks as $key => $hook) {\n drush_print($hook['name'] . ': ' . $hook['description'], 4);\n }\n }\n\n // List presets.\n try {\n $mb_task_handler_report_presets = \\DrupalCodeBuilder\\Factory::getTask('ReportHookPresets');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $hook_presets = $mb_task_handler_report_presets->getHookPresets();\n foreach ($hook_presets as $hook_preset_name => $hook_preset_data) {\n drush_print(\"Preset $hook_preset_name: \" . $hook_preset_data['label'], 2);\n foreach ($hook_preset_data['hooks'] as $hook) {\n drush_print($hook, 4);\n }\n }\n\n if (drush_drupal_major_version() == 8) {\n try {\n $mb_task_handler_report_plugins = \\DrupalCodeBuilder\\Factory::getTask('ReportPluginData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_plugins->listPluginData();\n\n drush_print(\"Plugins types:\");\n foreach ($data as $plugin_type_id => $plugin_type_data) {\n drush_print($plugin_type_id, 2);\n }\n\n try {\n $mb_task_handler_report_services = \\DrupalCodeBuilder\\Factory::getTask('ReportServiceData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_services->listServiceData();\n\n drush_print(\"Services:\");\n foreach ($data as $service_id => $service_info) {\n drush_print($service_id, 2);\n }\n }\n\n $hooks_directory = \\DrupalCodeBuilder\\Factory::getEnvironment()->getHooksDirectory();\n drush_print(t(\"Component data retrieved from @dir.\", array('@dir' => $hooks_directory)));\n drush_print(t(\"Component data was processed on @time.\", array(\n '@time' => date(DATE_RFC822, $time),\n )));\n}", "public function getCodeDataProvider()\n {\n return [\n ['method', 21],\n ['dropoff', 5],\n ['packaging', 7],\n ['containers_filter', 4],\n ['delivery_confirmation_types', 4],\n ['unit_of_measure', 2],\n ];\n }", "public function listNotifications()\r\n { \t \r\n \r\n \t$data = $this->call(array(), \"GET\", \"notifications.json\");\r\n \t$data = $data->{'notifications'};\r\n \t$notificationArray = new ArrayObject();\r\n \tfor($i = 0; $i<count($data);$i++){\r\n \t\t$notificationArray->append(new Notification($data[$i], $this));\r\n \t}\r\n \treturn $notificationArray;\r\n }", "public function getEnumValues()\n {\n return array(\n 'SCRIPT_TYPE_TASK_CMD' => self::SCRIPT_TYPE_TASK_CMD,\n 'SCRIPT_TYPE_OPR_CMD' => self::SCRIPT_TYPE_OPR_CMD,\n 'SCRIPT_TYPE_CRON' => self::SCRIPT_TYPE_CRON,\n 'SCRIPT_TYPE_MONITOR' => self::SCRIPT_TYPE_MONITOR,\n 'SCRIPT_TYPE_SVR' => self::SCRIPT_TYPE_SVR,\n );\n }", "public static function get_types(){\n\t\t$types = [];\n\t\t$types[self::TYPE_ENROLLMENT] = get_string('messagetypeenrollment', 'local_custom_certification');\n\t\t$types[self::TYPE_UNENROLLMENT] = get_string('messagetypeunenrollment', 'local_custom_certification');\n\t\t$types[self::TYPE_CERTIFICATION_EXPIRED] = get_string('messagetypecertificationexpired', 'local_custom_certification');\n\t\t$types[self::TYPE_CERTIFICATION_COMPLETED] = get_string('messagetypecertificationcompleted', 'local_custom_certification');\n\t\t$types[self::TYPE_RECERTIFICATION_WINDOW_OPEN] = get_string('messagetyperecertificationwindowopen', 'local_custom_certification');\n\t\t$types[self::TYPE_CERTIFICATION_BEFORE_EXPIRATION] = get_string('messagetyperecertificationbeforeexpiration', 'local_custom_certification');\n\n\t\treturn $types;\n\t}", "private function registered_events () {\n\n\t\t$triggers = array();\n\n\t\tforeach( get_option( 'nce_triggers' ) as $trigger => $enabled ) {\n\n\t\t\tif( $enabled == \"1\" ) {\n\n\t\t\t\t$triggers[] = $trigger;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $triggers;\n\n\t}", "public function getEnumValues()\n {\n return array(\n 'UnknownRoamingNotificationStatus' => self::UnknownRoamingNotificationStatus,\n 'RoamingNotificationStatusNone' => self::RoamingNotificationStatusNone,\n 'RoamingNotificationStatusSuccess' => self::RoamingNotificationStatusSuccess,\n 'RoamingNotificationStatusError' => self::RoamingNotificationStatusError,\n );\n }", "public static function getCodeName(){\n\n $langArray = [];\n\n foreach (self::where('status', 1)->select('code','name')->get() as $lang){\n $langArray[$lang->code] = $lang->name;\n }\n\n return $langArray;\n }", "public function getAllHandlerCodes($handlers) {\n $code = \"\";\n foreach($handlers as $collection) {\n foreach($collection['entries'] as $item) {\n if($item['handler'] == 'TIMEONPAGE') {\n $code .= $this->getTimeonpageJSHandlerCode($collection['collectionid'],$collection['pageid'],$item['goalid']);\n }\n if($item['handler'] == 'CLICKS') {\n if($collection['testtype'] == OPT_TESTTYPE_TEASER) {\n $code .= $this->getTeasertestClickJSHandlerCode($collection['collectionid'],$collection['pageid'],$item['goalid']);\n }\n else {\n $code .= $this->getClickJSHandlerCode($collection['collectionid'],$collection['pageid'],$item['goalid'],$item['selector']);\n }\n }\n if($item['handler'] == 'TT_VIEWS') {\n $code .= $this->getTeasertestViewJSHandlerCode($collection['collectionid'],$collection['pageid']);\n }\n }\n }\n return ($code);\n }", "public function getWarningList() : array {\n\t\t$file = func_get_arg( 0 );\n\t\tswitch ( $file ) {\n\t\t\tcase 'SlowMetaQueryUnitTest.success.inc':\n\t\t\t\treturn [];\n\n\t\t\tcase 'SlowMetaQueryUnitTest.fail.inc':\n\t\t\t\treturn [\n\t\t\t\t\t69 => 1,\n\t\t\t\t\t84 => 1,\n\t\t\t\t\t90 => 1,\n\t\t\t\t\t110 => 1,\n\t\t\t\t];\n\t\t}\n\t\treturn [];\n\t}", "public function getNotifyAgentEvents() {\n\t\t$events = [];\n\t\tforeach ( $this->notifications as $event => $attribs ) {\n\t\t\tif ( $attribs['canNotifyAgent'] ?? false ) {\n\t\t\t\t$events[] = $event;\n\t\t\t}\n\t\t}\n\t\treturn $events;\n\t}", "function _getNotificationSettingsMap() {\n\t\treturn array(\n\t\t\tNOTIFICATION_TYPE_ARTICLE_SUBMITTED => array('settingName' => 'notificationArticleSubmitted',\n\t\t\t\t'emailSettingName' => 'emailNotificationArticleSubmitted',\n\t\t\t\t'settingKey' => 'notification.type.articleSubmitted'),\n\t\t\tNOTIFICATION_TYPE_METADATA_MODIFIED => array('settingName' => 'notificationMetadataModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationMetadataModified',\n\t\t\t\t'settingKey' => 'notification.type.metadataModified'),\n\t\t\tNOTIFICATION_TYPE_SUPP_FILE_MODIFIED => array('settingName' => 'notificationSuppFileModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationSuppFileModified',\n\t\t\t\t'settingKey' => 'notification.type.suppFileModified'),\n\t\t\tNOTIFICATION_TYPE_GALLEY_MODIFIED => array('settingName' => 'notificationGalleyModified',\n\t\t\t\t'emailSettingName' => 'emailNotificationGalleyModified',\n\t\t\t\t'settingKey' => 'notification.type.galleyModified'),\n\t\t\tNOTIFICATION_TYPE_SUBMISSION_COMMENT => array('settingName' => 'notificationSubmissionComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationSubmissionComment',\n\t\t\t\t'settingKey' => 'notification.type.submissionComment'),\n\t\t\tNOTIFICATION_TYPE_LAYOUT_COMMENT => array('settingName' => 'notificationLayoutComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationLayoutComment',\n\t\t\t\t'settingKey' => 'notification.type.layoutComment'),\n\t\t\tNOTIFICATION_TYPE_COPYEDIT_COMMENT => array('settingName' => 'notificationCopyeditComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationCopyeditComment',\n\t\t\t\t'settingKey' => 'notification.type.copyeditComment'),\n\t\t\tNOTIFICATION_TYPE_PROOFREAD_COMMENT => array('settingName' => 'notificationProofreadComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationProofreadComment',\n\t\t\t\t'settingKey' => 'notification.type.proofreadComment'),\n\t\t\tNOTIFICATION_TYPE_REVIEWER_COMMENT => array('settingName' => 'notificationReviewerComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationReviewerComment',\n\t\t\t\t'settingKey' => 'notification.type.reviewerComment'),\n\t\t\tNOTIFICATION_TYPE_REVIEWER_FORM_COMMENT => array('settingName' => 'notificationReviewerFormComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationReviewerFormComment',\n\t\t\t\t'settingKey' => 'notification.type.reviewerFormComment'),\n\t\t\tNOTIFICATION_TYPE_EDITOR_DECISION_COMMENT => array('settingName' => 'notificationEditorDecisionComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationEditorDecisionComment',\n\t\t\t\t'settingKey' => 'notification.type.editorDecisionComment'),\n\t\t\tNOTIFICATION_TYPE_USER_COMMENT => array('settingName' => 'notificationUserComment',\n\t\t\t\t'emailSettingName' => 'emailNotificationUserComment',\n\t\t\t\t'settingKey' => 'notification.type.userComment'),\n\t\t\tNOTIFICATION_TYPE_PUBLISHED_ISSUE => array('settingName' => 'notificationPublishedIssue',\n\t\t\t\t'emailSettingName' => 'emailNotificationPublishedIssue',\n\t\t\t\t'settingKey' => 'notification.type.issuePublished'),\n\t\t\tNOTIFICATION_TYPE_NEW_ANNOUNCEMENT => array('settingName' => 'notificationNewAnnouncement',\n\t\t\t\t'emailSettingName' => 'emailNotificationNewAnnouncement',\n\t\t\t\t'settingKey' => 'notification.type.newAnnouncement'),\n\t\t);\n\t}", "private function get_addons_array_list() {\n\t\treturn array_values($this->addons);\n\t}", "public function getCustomCodesForHead() {\n return $this->custom;\n }", "function getOrderStatusList(){\n\treturn [\n\t\t\"NEW\" => [\n\t\t\t'code' => 1,\n\t\t\t'text' => \"Yet to Start\"\n\t\t],\n\t\t\"IN_PROGRESS\" => [\n\t\t\t'code' => 2,\n\t\t\t'text' => \"Working\"\n\t\t],\n\t\t\"DELIVERED\" => [\n\t\t\t'code' => 3,\n\t\t\t'text' => \"Delivered\"\n\t\t],\n\t\t\"IN_REVIEW\" => [\n\t\t\t'code' => 4,\n\t\t\t'text' => \"In review\"\n\t\t],\n\t\t\"COMPLETED\" => [\n\t\t\t'code' => 5,\n\t\t\t'text' => \"Completed\"\n\t\t],\n\t\t\"CANCELLED\" => [\n\t\t\t'code' => 6,\n\t\t\t'text' => \"Cancelled\"\n\t\t],\n\t\t\"PENDIND_REQUIREMENT\" => [\n\t\t\t'code' => 7,\n\t\t\t'text' => \"Pending Requirement\"\n\t\t]\n\t];\n}", "function getStatusNameList()\n\t{\n\t\tglobal $lang;\n\t\tif(!isset($lang->status_name_list))\n\t\t\treturn array_flip($this->getStatusList());\n\t\telse return $lang->status_name_list;\n\t}", "public function getWarningList() {\n\t\treturn array(\n\t\t\t18 => 1,\n\t\t\t19 => 1,\n\t\t\t20 => ( version_compare( PHPCSHelper::get_version(), '3.4.0', '<' ) === true ? 0 : 1 ),\n\t\t\t21 => 1,\n\t\t\t34 => 1,\n\t\t\t35 => 1,\n\t\t\t48 => 1,\n\t\t\t49 => 1,\n\t\t\t64 => 1,\n\t\t\t65 => 1,\n\t\t);\n\t}", "public function listNotificationInterests( );", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "protected function getAllExtensionNames()\n {\n $extensionNames = $this->getMageBridge()->_module_()->getAllExtensionNames();\n return is_array($extensionNames) ? $extensionNames : array();\n }", "public function getInformations(): array\n {\n /** @var string|AppController $class */\n $class = $this->getClassName();\n\n if (class_exists($class)) {\n $reflector = new \\ReflectionClass($class);\n if ($reflector->isSubclassOf(AppController::class)) {\n return [\n 'name'=> call_user_func([$class, 'getThemeName']),\n 'author'=> call_user_func([$class, 'getThemeAuthor']),\n 'copyright'=> call_user_func([$class, 'getThemeCopyright']),\n 'dir'=> call_user_func([$class, 'getThemeDir'])\n ];\n }\n }\n\n return [];\n }", "public function getWebsiteCodes()\n {\n return $this->websiteCodes;\n }", "public function notificationlist(){\n \n $select = $this->_db->select()\n ->from(array('MNT'=>MAIL_NOTIFY_TYPES), array('MNT.notification_id','MNT.notification_name','MNT.templatecategory_id'))\n\t\t ->where(\"MNT.notification_staus='1' AND MNT.templatecategory_id=1\")\n\t\t ->order(\"MNT.notification_name ASC\");\n $result = $this->getAdapter()->fetchAll($select);\n\t return $result;\n }", "public function getHooksToInstall(): array\n {\n // callback to write bool true to all array entries\n // to make sure the user will be asked to confirm every hook installation\n // unless the user provided the force option\n $callback = function () {\n return true;\n };\n // if a specific hook is set the user chose it so don't ask for permission anymore\n return empty($this->hookToHandle)\n ? array_map($callback, HookUtil::getValidHooks())\n : [$this->hookToHandle => false];\n }", "function getLanguageSymbol() {\n\t\tglobal $vsSkin;\n\n\t\t$flagspath = ROOT_PATH.$vsSkin->obj->getFolder().\"/images/flags\";\n\t\t$dh = opendir($flagspath);\n\n\t\t$flags = array();\n\t\twhile($file=readdir($dh)) {\n\t\t\tif($file==\".\" || $file==\"..\" || $file==\".svn\" || is_dir($flagspath.$file)) continue;\n\t\t\t\t$flags[] = array('name'=>substr($file,0,-4),'value' => $file);\n\t\t}\n\n\t\treturn $flags;\n\t}", "public static function getTypeList() {\n return array(\n self::TYPE_CODE_1=>self::TYPE_STRING_1,\n self::TYPE_CODE_2=>self::TYPE_STRING_2,\n self::TYPE_CODE_3=>self::TYPE_STRING_3,\n self::TYPE_CODE_4=>self::TYPE_STRING_4,\n self::TYPE_CODE_5=>self::TYPE_STRING_5,\n self::TYPE_CODE_6=>self::TYPE_STRING_6\n );\n }", "function xmlrpc_server_list_methods() {\n $xmlrpc_server = xmlrpc_server_get();\n return array_keys($xmlrpc_server->callbacks);\n}", "private function getConfigCodeAction()\n {\n $code_action = array();\n $codes = $this->getAllCodesAction();\n foreach ($codes as $code => $value) {\n $code_action['ca_' . $value['id_code_action']] = $value['groupe'];\n }\n\n return $code_action;\n }", "private function getHooksFromOnlineDoc() {\n\t\t\t// All hooks\n\t\t\t$allhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:MediaWiki_hooks&cmlimit=500&format=php' );\n\t\t\t$allhookdata = unserialize( $allhookdata );\n\t\t\t$allhooks = array();\n\t\t\tforeach ( $allhookdata['query']['categorymembers'] as $page ) {\n\t\t\t\t$found = preg_match( '/Manual\\:Hooks\\/([a-zA-Z0-9- :]+)/', $page['title'], $matches );\n\t\t\t\tif ( $found ) {\n\t\t\t\t\t$hook = str_replace( ' ', '_', $matches[1] );\n\t\t\t\t\t$allhooks[] = $hook;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Removed hooks\n\t\t\t$oldhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Removed_hooks&cmlimit=500&format=php' );\n\t\t\t$oldhookdata = unserialize( $oldhookdata );\n\t\t\t$removed = array();\n\t\t\tforeach ( $oldhookdata['query']['categorymembers'] as $page ) {\n\t\t\t\t$found = preg_match( '/Manual\\:Hooks\\/([a-zA-Z0-9- :]+)/', $page['title'], $matches );\n\t\t\t\tif ( $found ) {\n\t\t\t\t\t$hook = str_replace( ' ', '_', $matches[1] );\n\t\t\t\t\t$removed[] = $hook;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn array_diff( $allhooks, $removed );\n\t}", "public function getEnumValues()\n {\n return array(\n 'PHONE_VERIFICATION_STATUS_UNKNOWN' => self::PHONE_VERIFICATION_STATUS_UNKNOWN,\n 'PHONE_VERIFICATION_STATUS_VERIFIED' => self::PHONE_VERIFICATION_STATUS_VERIFIED,\n );\n }", "public function getRecoveryCodes(): Collection\n {\n return $this->twoFactorAuth->recovery_codes ?? collect();\n }", "public static function getStatusList()\n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'rocket_buffer' => [\r\n\t\t\t\t[ 'extract_ie_conditionals', 1 ],\r\n\t\t\t\t[ 'inject_ie_conditionals', 34 ],\r\n\t\t\t],\r\n\t\t];\r\n\t}", "public static function iconsList()\n {\n $icons = [\n 'build',\n 'add_shopping_cart',\n 'settings_phone',\n 'assignment_turned_in',\n 'check_circle_outline',\n 'theaters',\n 'airplay',\n 'cached',\n 'calendar_today',\n 'check_circle',\n 'credit_card',\n 'dashboard',\n 'description',\n 'exit_to_app',\n 'extension',\n 'feedback',\n 'grade',\n 'group_work',\n 'help',\n 'help_outline',\n 'home',\n 'https',\n 'info',\n 'language',\n 'lock',\n 'open_in_browser',\n 'pageview',\n 'payment',\n 'perm_identity',\n 'record_voice_over',\n 'question_answer',\n 'redeem',\n 'restore_from_trash',\n 'shop',\n 'shopping_basket',\n 'shopping_cart',\n 'settings_voice',\n 'speaker_notes',\n 'stars',\n 'supervised_user_circle',\n 'system_update_alt',\n 'verified_user',\n 'add_alert',\n 'featured_play_list',\n 'queue',\n 'video_library',\n 'contact_mail',\n 'ring_volume',\n 'save',\n 'devices',\n 'widgets',\n 'insert_invitation',\n ];\n \n return $icons;\n }", "function get_cert_country_codes() {\n\t$countries = get_country_name();\n\n\t$country_codes = array();\n\tforeach ($countries as $country) {\n\t\t$country_codes[$country['code']] = $country['code'];\n\t}\n\tksort($country_codes);\n\n\t/* Preserve historical order: None, US, CA, other countries */\n\t$first_items[''] = gettext(\"None\");\n\t$first_items['US'] = $country_codes['US'];\n\t$first_items['CA'] = $country_codes['CA'];\n\tunset($country_codes['US']);\n\tunset($country_codes['CA']);\n\n\treturn array_merge($first_items, $country_codes);\n}", "public static function lists()\n\t{\n\t\treturn [\n\t\t\tstatic::UNPAID,\n\t\t\tstatic::PAID,\n\t\t\tstatic::CANCELED,\n\t\t];\n\t}", "protected function getCustomHandlers(): array\n {\n return [];\n }", "protected static function getBackupCodeJsonStatusCodes()\n {\n return array(\n self::NO_IDENTIFIER_SUPPLIED,\n self::NO_TOKEN_SUPPLIED,\n self::INVALID_TOKEN,\n self::IDENTIFIER_TOO_LONG,\n );\n }", "public static function getStatusList() {\r\n return [\r\n self::STATUS_ACTIVE => 'Active',\r\n self::STATUS_RETIRED => 'Retired'\r\n ];\r\n }", "public function getStatusList()\n {\n return ['0' => __('修改'), '1' => __('提议'), '2' => __('新增'), '3' => __('废止')];\n }", "function om_warnings_get_warning_types()\n{\n\t// check if cache file exists, not - generate it\n\tif (!file_exists(FORUM_CACHE_DIR.'cache_om_warnings_types.php'))\n\t\tom_warnings_generate_types_cache();\n\n\trequire FORUM_CACHE_DIR.'cache_om_warnings_types.php';\n\treturn $om_warnings_types;\n}", "public function get_valid_statuses() {\n\t\treturn array_keys( _wc_cs_get_credits_statuses() ) ;\n\t}", "function get_message_types() {\n\t$policy = new Config;\n\treturn $policy->getMessageTypes();\n}" ]
[ "0.6726171", "0.66064316", "0.6601019", "0.6216556", "0.6199188", "0.60930735", "0.6081675", "0.60282975", "0.601612", "0.585455", "0.5851668", "0.5848004", "0.5815001", "0.58126533", "0.5779163", "0.5748517", "0.5744446", "0.5688069", "0.56798387", "0.5676644", "0.56759083", "0.56642324", "0.56642324", "0.5635719", "0.5574455", "0.5570933", "0.55637795", "0.5533749", "0.5533233", "0.55276257", "0.5526205", "0.55260414", "0.5522886", "0.5522708", "0.5514947", "0.55142117", "0.5514172", "0.55051947", "0.5504637", "0.5477436", "0.5474238", "0.54477227", "0.5442512", "0.5434585", "0.5426404", "0.5424996", "0.5421962", "0.5394663", "0.5390149", "0.53778416", "0.5374248", "0.5367705", "0.5361915", "0.534906", "0.53464544", "0.53252244", "0.53252244", "0.53249043", "0.53236467", "0.53214604", "0.53129447", "0.5306244", "0.5304493", "0.53037435", "0.5296879", "0.5296141", "0.5292709", "0.52761084", "0.52756256", "0.52678007", "0.52574366", "0.5255826", "0.5255026", "0.5251453", "0.524982", "0.52465254", "0.5245562", "0.5236008", "0.5230781", "0.52305204", "0.52240527", "0.52239925", "0.5222009", "0.5221142", "0.5214295", "0.5206168", "0.52039284", "0.5200651", "0.5197553", "0.5196517", "0.51943135", "0.51937515", "0.518958", "0.5185329", "0.51782435", "0.5173729", "0.51700366", "0.51677966", "0.5166016", "0.51646113" ]
0.7120404
0
Get a list of members who have enabled this notification (i.e. have permission to AND have chosen to or are defaulted to).
public function list_members_who_have_enabled($notification_code, $category = null, $to_member_ids = null, $start = 0, $max = 300) { $members = $this->_all_members_who_have_enabled($notification_code, $category, $to_member_ids, $start, $max); $members = $this->_all_members_who_have_enabled_with_page_access($members, 'filedump', $notification_code, $category, $to_member_ids, $start, $max); return $members; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMembers() {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.status = '\" . KontakteData::$STATUS_MEMBER . \"'\";\n\t\t$query .= \" OR c2.status = '\" . KontakteData::$STATUS_ADMIN . \"' \";\n\t\t$query .= \"ORDER BY c2.name ASC\";\n\t\treturn $this->database->getSelection($query);\n\t}", "public function memberList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function memberIdList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function ApproverMembers() {\n\t\tif ($this->owner->CanApproveType == 'OnlyTheseUsers') {\n\t\t\t$groups = $this->owner->ApproverGroups();\n\t\t\t$members = new DataObjectSet();\n\t\t\tif($groups) foreach($groups as $group) {\n\t\t\t\t$members->merge($group->Members());\n\t\t\t}\n\t\t\t\n\t\t\t// Default to ADMINs, if something goes wrong\n\t\t\tif(!$members->Count()) {\n\t\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\t\t$members = $group->Members();\n\t\t\t}\n\t\t\t\n\t\t\treturn $members;\n\t\t} elseif($this->owner->CanApproveType == 'LoggedInUsers') {\n\t\t\treturn Permission::get_members_by_permission('CMS_ACCESS_CMSMain');\n\t\t} else {\n\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\treturn $group->Members();\n\t\t}\n\t}", "public function get_members()\n\t{\n\t\treturn $this->members;\n\t}", "public function getStaffMembers()\n\t{\n\t\treturn $this->staff->members();\n\t}", "public function PublisherMembers() {\n\t\tif($this->owner->CanPublishType == 'OnlyTheseUsers'){\n\t\t\t$groups = $this->owner->PublisherGroups();\n\t\t\t$members = new DataObjectSet();\n\t\t\tif($groups) foreach($groups as $group) {\n\t\t\t\t$members->merge($group->Members());\n\t\t\t}\n\t\t\t\n\t\t\t// Default to ADMINs, if something goes wrong\n\t\t\tif(!$members->Count()) {\n\t\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\t\t$members = $group->Members();\n\t\t\t}\n\t\t\t\n\t\t\treturn $members;\n\t\t} elseif($this->owner->CanPublishType == 'LoggedInUsers') {\n\t\t\treturn Permission::get_members_by_permission('CMS_ACCESS_CMSMain');\n\t\t} else {\n\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\treturn $group->Members();\n\t\t}\n\t}", "public function admins()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_ADMIN)->get();\n }", "public function getMembers() {\n /* get members */\n $c = $this->modx->newQuery('modUser');\n $c->innerJoin('modUserGroupMember','UserGroupMembers');\n $c->innerJoin('modUserGroupRole','Role','UserGroupMembers.role = Role.id');\n $c->where(array(\n 'UserGroupMembers.user_group' => $this->userGroup->get('id'),\n ));\n $c->select($this->modx->getSelectColumns('modUser','modUser'));\n $c->select(array(\n 'role' => 'Role.id',\n 'role_name' => 'Role.name',\n ));\n $members = $this->modx->getCollection('modUser',$c);\n $list = array();\n /** @var $member modUserGroupMember */\n foreach ($members as $member) {\n $list[] = array(\n $member->get('id'),\n $member->get('username'),\n $member->get('role'),\n $member->get('role_name'),\n );\n }\n $this->userGroupArray['members'] = '(' . $this->modx->toJSON($list) . ')';\n return $list;\n }", "public static function all(): array\n\t{\n\t\t$users = get_field('users', self::$member_id);\n\t\tif(empty($users)) return [];\n\t return $users;\n\t}", "public function getGuildMembers()\n {\n return $this->get(self::_GUILD_MEMBERS);\n }", "function getMembers(){\n\t\treturn $this->members;\n\t}", "public function members()\n\t{\n\t\treturn $this->members;\n\t}", "public function list_members() {\n\n\t\t//ignored users\n\t\t$stm = $this->db()->prepare('select \"to_big\" from \"member_settings\" where \"from_big\" = :current_member_big and \"chat_ignore\" = 1');\n\t\t$stm->execute(array(\n\t\t\t':current_member_big'\t=> $this->member_big,\n\t\t));\n\t\t$ignored_members_raw = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t$ignored_members = array(0);\n\t\tforeach($ignored_members_raw as $member) {\n\t\t\t$ignored_members[] = $member['to_big'];\n\t\t}\n\t\t$ignored_members = implode(',', $ignored_members);\n\n\t\t//joined users\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\", (case when \"c\".\"physical\"=1 then \\'onsite\\' else \\'online\\' end) as \"status\"\n\t\t\tfrom \"checkins\" \"c\"\n\t\t\t\tleft join \"members\" \"m\" on (\"c\".\"member_big\" = \"m\".\"big\")\n\t\t\twhere (\"c\".\"checkout\" is null or \"c\".\"checkout\" > now())\n\t\t\t\tand \"c\".\"event_big\" = (select \"event_big\" from \"checkins\" where \"member_big\" = :member_big and (\"checkout\" is null or \"checkout\" > now()) order by \"created\" desc limit 1)\n\t\t\t\tand (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout)\n\t\t\t\tand \"m\".\"big\" != :member_big\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.')\n\t\t\torder by m.big, \"c\".\"created\" asc'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$joined_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$joined_member_bigs = array(0);\n\t\tforeach($joined_members as $member) {\n\t\t\t$joined_member_bigs[] = $member['big'];\n\t\t}\n\t\t$joined_member_bigs = implode(',', $joined_member_bigs);\n\n\t\t//users we already had conversation with\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\",\n\t\t\t\t(case when (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout) then \\'online\\' else \\'offline\\' end) as \"status\"\n\t\t\tfrom \"member_rels\" \"r\"\n\t\t\t\tleft join \"members\" \"m\" on (\"m\".\"big\" = (case when \"r\".\"member1_big\"=:member_big then \"r\".\"member2_big\" else \"r\".\"member1_big\" end))\n\t\t\t\tleft join \"chat_messages\" as \"cm\" on (\"cm\".\"rel_id\" = \"r\".\"id\" and (case when \"cm\".\"from_big\"=:member_big then \"cm\".\"from_status\" else \"cm\".\"to_status\" end) = 1)\n\t\t\twhere \"m\".\"big\" != :member_big\n\t\t\t\tand (r.member1_big = :member_big OR r.member2_big = :member_big)\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.','.$joined_member_bigs.')\n\t\t\t\tand \"cm\".\"id\" > 0\n\t\t\torder by m.big'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$history_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($joined_members as $key=>$val) {\n\t\t\t$joined_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\t\tforeach($history_members as $key=>$val) {\n\t\t\t$history_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\n\t\treturn $this->reply(array(\n\t\t\t'joined' => $joined_members,\n\t\t\t'history' => $history_members,\n\t\t));\n\n\t}", "public function getMembers()\n {\n if (!is_null($this->members_relation)) {\n return array_keys($this->members_relation);\n }\n\n if ($this->members_objs == null) {\n // load members\n $response = Helper::get('group/'.$this->unique_id);\n if (isset($response->body['result']['members'])) {\n $this->__construct($response->body['result']);\n }\n }\n\n if ($this->members_objs != null) {\n $list = array();\n foreach ($this->members_objs as $user) {\n $list[] = $user instanceof User ? $user->username : $user;\n }\n\n return $list;\n }\n }", "protected function getEventMembers(): array\n {\n $members = [];\n /** @var \\RideTimeServer\\Entities\\EventMember $member */\n foreach ($this->getMembers() as $member) {\n if ($member->getStatus() !== Event::STATUS_CONFIRMED) {\n continue;\n }\n $members[] = $member->getUser();\n }\n\n return $members;\n }", "public function getMembers ()\n {\n $userIds = (array) $this['users']->getValue ();\n\n // Users should already be in the instance pool, so we retrieve them\n // one by one with findPk\n $users = array ();\n foreach ($userIds as $uid)\n $users[] = UserQuery::create ()->findPk($uid);\n\n return $users;\n }", "public function getModeratorEmails() {\n $moderatorNames = $this->get('moderators');\n $moderatorNames = explode(',',$moderatorNames);\n $moderators = array();\n foreach ($moderatorNames as $name) {\n $c = $this->xpdo->newQuery('modUser');\n $c->innerJoin('modUserProfile','Profile');\n $c->select(array('modUser.id','Profile.email'));\n $c->where(array('username' => $name));\n $user = $this->xpdo->getObject('modUser',$c);\n if ($user) {\n $moderators[] = $user->get('email');\n }\n }\n\n /* now get usergroup moderators */\n $moderatorGroup = $this->get('moderator_group');\n $c = $this->xpdo->newQuery('modUserProfile');\n $c->innerJoin('modUser','User');\n $c->innerJoin('modUserGroupMember','UserGroupMembers','User.id = UserGroupMembers.member');\n $c->innerJoin('modUserGroup','UserGroup','UserGroup.id = UserGroupMembers.user_group');\n $c->where(array(\n 'UserGroup.name' => $moderatorGroup,\n ));\n $members = $this->xpdo->getCollection('modUserProfile',$c);\n foreach ($members as $member) {\n $email = $member->get('email');\n if (!empty($email)) array_push($moderators,$email);\n }\n $moderators = array_unique($moderators);\n\n return $moderators;\n }", "public function GetAllMembers()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllMembers();\n }", "public static function getAllEnabled()\n {\n $c = new Criteria();\n $c->add(ServerPeer::IS_ENABLED, true);\n return parent::doSelect($c);\n }", "public function participants()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_PARTICIPANT)->get();\n }", "public function getMembers(){\n $this->db->select('*');\n $this->db->from('users');\n $query = $this->db->get();\n \n return $query->result_array();\n\t\t}", "public function GetMembers()\n {\n if($this->getGroupId())\n {\n $user = new User($this->sqlDataBase);\n $groupMembers = $user->GetGroupUsers($this->groupId);\n return $groupMembers;\n }\n return array();\n }", "public function enabled()\n {\n return $this->andWhere(['>=', User::tableName() . '.status', User::STATUS_ENABLED]);\n }", "public function getMemberObjs()\n {\n if (!empty($this->members_objs) && ($this->members_objs[0] instanceof User)) {\n return $this->members_objs;\n }\n }", "public function members()\n\t{\n\t\treturn $this -> hasMany(__CLASS__.'\\Member', 'participant_team_id');\n\t}", "function get_members($gid, $limit = NULL, $approved = NULL) {\n global $db;\n\n $app_query = \"\";\n if ($approved)\n $app_query = \" AND \" . tbl($this->gp_mem_tbl) . \".active='$approved'\";\n\n //List of fields we need from a user table\n $user_fields = get_user_fields();\n\n $user_fields = apply_filters($user_fields, 'get_group_members');\n\n $fields_query = '';\n\n foreach ($user_fields as $field)\n $fields_query .= ',' . tbl('users') . '.' . $field;\n\n $result = $db->select(tbl($this->gp_mem_tbl)\n . \" LEFT JOIN \" . tbl('users')\n . \" ON \" . tbl($this->gp_mem_tbl)\n . \".userid=\" . tbl('users') . \".userid\"\n , tbl($this->gp_mem_tbl) . \".*\" . $fields_query\n , \" group_id='$gid' $app_query\", $limit);\n\n\n\n if ($db->num_rows > 0)\n return $result;\n else\n return false;\n }", "function get_enabled_users() {\n // Execute the query\n $query = $this->db->query('SELECT * from UserAccount WHERE is_enabled=1');\n // Check if any results are returned from the query\n if ($query->num_rows() > 0) {\n foreach ($query->result_array() as $row) {\n $data[] = array(\n 'email' => $row['email'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'is_admin' => $row['is_admin']\n );\n }\n } else {\n $data = \"Error: could not retrieve list of enabled accounts.\";\n }\n return $data;\n }", "public function defaultMemberPermissions()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/default-member-permissions');\n }", "function getMailList_moderator($exclude='')\r\n\t{\r\n\t\t/* exclude must be an array of values\r\n\t\t * OR not quoted list separated by ,\r\n\t\t */\r\n\r\n\t\t$database =& JFactory::getDBO();\r\n\r\n\t if (is_array($exclude)) {\r\n\t $exclude = implode(',', $exclude);\r\n\t }\r\n\r\n /* Moderators(if requested) */\r\n\r\n $moderator_maillist = array();\r\n\r\n if ($this->_notify_moderator && $this->_moderator) {\r\n $usertype = '';\r\n foreach($this->_moderator as $moderator) {\r\n $usertype .= ($usertype ? ',':'') . \"'\" . JOSC_utils::getJoomlaUserType($moderator) . \"'\";\r\n }\r\n\t\t\t$query \t= \"SELECT DISTINCT email \"\r\n\t\t\t\t\t. \"\\n FROM `#__users` \"\r\n\t\t\t\t\t. \"\\n WHERE email <> '' \"\r\n\t\t\t\t\t. \"\\n AND usertype IN ($usertype)\"\r\n\t\t\t\t\t;\r\n\t\t\tif ($exclude) {\r\n\t\t\t\t$quoted = str_replace( ',', \"','\", $exclude); /* add quotes */\r\n\t\t\t\t$query .= \"\\n AND email NOT IN ('$quoted')\";\r\n\t\t\t}\r\n\t\t\t$database->setQuery( $query );\r\n\t\t\t$moderator_maillist = $database->loadResultArray(); //tableau\r\n\t\t\t//echo implode(';' , $moderator_maillist); // liste s�par� par des ;\r\n } elseif ($this->_notify_admin && $this->_notify_email <> '') {\r\n $moderator_maillist[] = $this->_notify_email;\r\n }\r\n return $moderator_maillist;\r\n\t}", "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 get_memberships() {\n \n $active_memberships = pmpro_getMembershipLevelForUser($this->user_id);\n \n if (is_object($active_memberships)) {\n $return[$active_memberships->ID] = $active_memberships->name;\n return $return;\n }\n\n $return = [];\n if (is_array($active_memberships)) {\n foreach ($active_memberships as $membership) {\n $return[$membership->ID] = $membership->name;\n }\n }\n \n return $return;\n }", "public function getUsersToNotifyOfTokenGiven() {\n return array(\n $this->getAuthorPHID(),\n );\n }", "public function getMembers()\n {\n if (!$this->has('memberList')) {\n throw new NoMemberListException('Clan instance has no memberlist property.');\n } else {\n return $this->get('memberList');\n }\n }", "public function getMembers() {\n\n\t\t$order = ((Request::has('order')) ? Request::get('order') : 'id');\n\t\t$dir = ((Request::has('dir')) ? Request::get('dir') : 'asc');\n\n\t\t$users = User::orderBy($order, $dir);\n\n\t\t$filterable_fields = ['level', 'location', 'q'];\n\n\t\tforeach ($filterable_fields as $f) {\n\t\t\tif (Request::has($f)) {\n\t\t\t\tif ($f == 'q') {\n\t\t\t\t\t$users->where('username', 'LIKE', '%' . Request::get($f) . '%')\n\t\t\t\t\t\t->orWhere('first_name', 'LIKE', '%' . Request::get($f) . '%')\n\t\t\t\t\t\t->orWhere('last_name', 'LIKE', '%' . Request::get($f) . '%')\n\t\t\t\t\t\t->orWhere('email', 'LIKE', '%' . Request::get($f) . '%');\n\t\t\t\t} else {\n\t\t\t\t\t$users->where($f, 'LIKE', '%' . Request::get($f) . '%');\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn response()->app(200, 'admin.members.index', ['members' => $users->paginate(30), 'filters' => Request::all()]);\n\n\t}", "public function getMemberStatusAllowableValues()\r\n {\r\n return [\r\n self::MEMBER_STATUS_PENDING,\r\n self::MEMBER_STATUS_ACCEPTED,\r\n self::MEMBER_STATUS_REJECTED,\r\n ];\r\n }", "private function collectAllKnownMembers()\n {\n return $this->getDoctrine()->getRepository(Board::class)->findAllKnownMembers($this->getUser());\n }", "public function members()\n\t{\n return $this->belongsToMany('App\\Models\\User', 'team_user')\n ->withPivot(['is_admin']);\n\t}", "public function members() {\n return $this->belongsToMany('Rockit\\Models\\Member', 'staffs');\n }", "public function get_members(){\n return $this->connected_clients;\n }", "public function getExpiringMembers() {\n\t\t$date = new DateTime();\n\t\t$end = $date->setTimestamp(strtotime('+30 days'));\n\n\t\treturn Member::get()->filter(array(\n\t\t\t'MembershipStatus' => 'Verified',\n\t\t\t'ExpiryDate:LessThan' => $end->format('Y-m-d H:i:s'),\n\t\t\t'Notified' => 0\n\t\t));\n\t}", "public function allowedPermissions()\n {\n return $this->permissions()->wherePivot('has_access', true)->orderBy('name');\n }", "function wpscSupportTicketsReturnValidManagers() {\r\n global $wpdb;\r\n \r\n $valid_managers = array();\r\n\r\n $search = $wpdb->get_results(\"SELECT `ID` FROM `{$wpdb->prefix}users` ORDER BY `ID`;\", ARRAY_A);\r\n\r\n foreach ($search as $userid) {\r\n if (user_can($userid['ID'], 'manage_wpsct_support_tickets')) {\r\n $valid_managers[] = $userid['ID'];\r\n }\r\n } \r\n\r\n return $valid_managers;\r\n }", "public function filtermember() {\n $response = $this->Allusers_model->filtermember();\n return $response;\n }", "public function OrganisationMembers() {\n\t\t$memberIDs = $this->RelatedMembers()\n\t\t\t->filter(['Type.Code' => ['MJO', 'MRO', 'MEM', 'MCO']])\n\t\t\t->column('FromModelID');\n\n\t\t$uniquemembers = Member::get()->filter(['ID' => $memberIDs])->distinct(true)->setQueriedColumns(array('ID'));\n\n\t\treturn $uniquemembers;\n\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}", "function GetMembers()\n\t{\t$members = array();\n\t\t$where = array();\n\t\t$tables = array('students');\n\t\t\n\t\tif ($_GET['morf'])\n\t\t{\t$where[] = 'students.morf=\"' . $this->SQLSafe($_GET['morf']) . '\"';\n\t\t}\n\t\n\t\tif ($_GET['ctry'])\n\t\t{\t$where[] = 'students.country=\"' . $this->SQLSafe($_GET['ctry']) . '\"';\n\t\t}\n\t\t\n\t\tif ($name = $this->SQLSafe($_GET['name']))\n\t\t{\t$where[] = '(CONCAT(students.firstname, \" \", students.surname, \"|\", students.username) LIKE \"%' . $name . '%\")';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT students.* FROM ' . implode(',', $tables);\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' GROUP BY students.userid ORDER BY students.surname, students.firstname LIMIT 0, 1000';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\tif (!$row[\"country\"] || $this->user->CanAccessCountry($row[\"country\"]))\n\t\t\t\t{\t$members[] = $row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $members;\n\t}", "public function getWhoToNotifyByEmail()\n\t{\n\t\t//return array\n\t\t$group = Group::model()->findByPk($this->groupId);\n\t\t$emails = $group->getMembersByStatus(User::STATUS_ACTIVE);\n\t\treturn $emails->data;\n\t}", "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}", "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 getAdmins()\n\t{\n\t\t$query = <<<QUERY\nSELECT\n\t*\nFROM\n\tplayer\nWHERE\n\trole LIKE '%admin%'\nQUERY;\n\n\t\treturn $this->database->query( $query, 'Get admins from player table' );\n\t}", "function getMemberListAdmin() {\n $sql = \"SELECT d.*\n FROM admin_building a,\n condo_building b,\n member_condo c,\n member d \n WHERE a.admin_id=? AND a.building_id = b.building_id AND b.condo_id= c.condo_id AND c.member_id = d.id AND b.building_id=? ORDER BY d.id ASC\";\n \n return getAll($sql, [getLogin()['uid'], getLogin()['bid']]);\n}", "public function getMembers() {\n return $this->parseData($this->sql['mem']);\n }", "function getMembers()\r\n {\r\n // define the query\r\n $sql = \"SELECT * FROM member ORDER BY lname\";\r\n // prepare statement\r\n $statement = $this->_dbh->prepare($sql);\r\n // execute statement\r\n $statement->execute();\r\n // get result\r\n return $statement->fetchAll(PDO::FETCH_ASSOC);\r\n }", "private function getUsersMailist() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $users = $this->mailist->gets($param);\n\n return $users;\n }", "function enabledModules() {\n\n\t\t// get user course\n\t\t$myCourse = Course::whereHas('users', function($query) {\n\t\t\t$query->where('course_role', '1')->where('user_id',$this->id);\n\t\t})->first();\n\n\t\t// gather module list and init array\n\t\t$allModules = Module::all();\n\t\t$modulesList = array();\n\n\t\t// return array of 1s if user is not registered to a course\n\t\tif ($myCourse == null) {\n\t\t\t$modulesList = array_fill(0,count($allModules)+1,1);\n\t\t\treturn $modulesList;\n\t\t}\n\n\t\t// gather list of enabled modules for user course\n\t\t$enabledModules = Module::select(array('id'))->whereHas('courses', function($q) use ($myCourse) {\n\t\t\t$q->where('course_id',$myCourse->id)->where('enabled',1);\n\t\t})->get();\n\n\t\t// generate a full list of modules and \n\t\t$modulesList = array_fill(0,count($allModules),0);\n\t\tforeach ($allModules as $mod) {\n\t\t\t// check if current mod is present in modules\n\t\t\tforeach($enabledModules as $eMod) {\n\t\t\t\tif ($eMod->id == $mod->id) {\n\t\t\t\t\t// add to modules list as 1\n\t\t\t\t\t$modulesList[$mod->id] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $modulesList;\n\n\t}", "public function filterMembers()\n {\n return $this->team->where('id', Auth::user()->getTeam()->id)->with([\n 'members' => function ($query) {\n $query->where('slug', 'like', '%' . $this->request->get('q') . '%');\n },\n ])->first()->members;\n }", "public function NotificationRecipients() {\n\t\t$members = new ArrayList();\n\t\t$members->merge($this->NotifyMembers());\n\t\t/** @var \\Group $group */\n\t\tforeach ($this->NotifyGroups() as $group) {\n\t\t\t$members->merge($group->Members());\n\t\t}\n\t\t$members->removeDuplicates();\n\t\treturn $members;\n\t}", "function getMemberList() {\n return getAll(\"SELECT * FROM member \");\n}", "public function memberUserQuery()\n {\n return $this->pushCriteria(MemberUserCriteria::class);\n }", "public function getAllAvailable()\n {\n return $this->allPermissions;\n }", "public function getAdmins()\n {\n $query = $this->newQuery();\n $query->where('admin', true);\n\n return $this->doQuery($query, false, false);\n }", "public function getOnlineList()\n {\n $online = [];\n if ( $this->online )\n {\n $id = 0;\n $pack = pack( 'N*', -1, 1, $id ) . $this->gamed->packString( '1' );\n $pack = $this->gamed->createHeader( 352, $pack );\n $send = $this->gamed->SendToDelivery( $pack );\n $data = $this->gamed->deleteHeader($send);\n $data = $this->gamed->unmarshal( $data, $this->data['RoleList'] );\n\n if ( isset( $data['users'] ) )\n {\n foreach ( $data['users'] as $user )\n {\n $online[] = $user;\n //$id = $this->gamed->MaxOnlineUserID( $data['users'] );\n }\n }\n }\n return $online;\n }", "public function activeConfirmedAdmins()\n {\n return $this->newQuery('getUsers', ['type' => 'ActiveConfirmedAdmins']);\n }", "public function listAllApproved() {\n\t\treturn $this->personRepository->findAllApprovedUsers();\n\t}", "public function members()\n {\n return $this->belongsToMany('\\App\\Model\\User', 'joined', 'idproject', 'iduser')->withPivot('role')->orderBy('role', 'ASC');\n }", "public function getActiveMemberships()\n\t{\n\t\tif (!Yum::hasModule('membership'))\n\t\t\treturn array();\n\n\t\tYii::import('application.modules.role.models.*');\n\t\tYii::import('application.modules.membership.models.*');\n\n\t\t$roles = array();\n\n\t\tif ($this->memberships)\n\t\t\tforeach ($this->memberships as $membership) {\n\t\t\t\tif ($membership->end_date > time())\n\t\t\t\t\t$roles[] = $membership->role;\n\t\t\t}\n\n\t\treturn $roles;\n\t}", "function pms_get_users_non_members( $args = array() ) {\r\n\r\n global $wpdb;\r\n\r\n $defaults = array(\r\n 'orderby' => 'ID',\r\n 'offset' => '',\r\n 'limit' => ''\r\n );\r\n\r\n $args = apply_filters( 'pms_get_users_non_members_args', wp_parse_args( $args, $defaults ), $args, $defaults );\r\n\r\n // Start query string\r\n $query_string = \"SELECT {$wpdb->users}.ID \";\r\n\r\n // Query string sections\r\n $query_from = \"FROM {$wpdb->users} \";\r\n $query_join = \"LEFT JOIN {$wpdb->prefix}pms_member_subscriptions ON {$wpdb->users}.ID = {$wpdb->prefix}pms_member_subscriptions.user_id \";\r\n $query_where = \"WHERE {$wpdb->prefix}pms_member_subscriptions.user_id is null \";\r\n\r\n $query_limit = '';\r\n if( !empty( $args['limit'] ) )\r\n $query_limit = \"LIMIT \" . $args['limit'] . \" \";\r\n\r\n $query_offset = '';\r\n if( !empty( $args['offset'] ) )\r\n $query_offset = \"OFFSET \" . $args['offset'] . \" \";\r\n\r\n\r\n // Concatenate the sections into the full query string\r\n $query_string .= $query_from . $query_join . $query_where . $query_limit . $query_offset;\r\n\r\n $results = $wpdb->get_results( $query_string, ARRAY_A );\r\n\r\n $users = array();\r\n\r\n if( !empty( $results ) ) {\r\n foreach( $results as $result ) {\r\n $users[] = new WP_User( $result['ID'] );\r\n }\r\n }\r\n\r\n return apply_filters( 'pms_get_users_non_members', $users, $args );\r\n\r\n }", "public function get_members() {\r\n $this->db->select('user.id, user.username, user.email, user.first_name, user.last_name, user.date_registered,\r\n user.last_login, user.active, user.banned, role.name as role_name');\r\n $this->db->from('user');\r\n $this->db->join('role', 'role.id = user.role_id');\r\n\r\n $query = $this->db->get();\r\n\r\n $members = \"Username|E-mail address|First name|Last name|Registration date|Last login|Active?|Banned?|Role\\r\\n\";\r\n\r\n if ($query->num_rows() > 0) {\r\n foreach($query->result() as $row) {\r\n $members .= $row->username .\"|\". $row->email .\"|\". $row->first_name .\"|\".$row->last_name .\"|\". $row->date_registered .\r\n \"|\". $row->last_login .\"|\". $row->active .\"|\". $row->banned .\"|\". $row->role_name .\"\\r\\n\";\r\n }\r\n }else{\r\n $members = \"no results\";\r\n }\r\n\r\n return $members;\r\n }", "function listMemberStatus() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\n\t\t// only show orders if user has access\n\t\tif($page->validatePath(\"/janitor/admin/user/members/list\")) {\n\n\t\t\tinclude_once(\"classes/users/superuser.class.php\");\n\t\t\t$model = new SuperUser();\n\t\t\t$IC = new Items();\n\n\t\t\t$memberships = $IC->getItems(array(\"itemtype\" => \"membership\", \"status\" => 1, \"extend\" => true));\n\n\t\t\t$_ .= '<div class=\"members\">';\n\t\t\t$_ .= '<h2>Member status</h2>';\n\n\t\t\tif($memberships) {\n\t\t\t$_ .= '<ul class=\"members\">';\n\t\t\t\tforeach($memberships as $membership) {\n\t\t\t\n\t\t\t\t\t$_ .= '<li class=\"'.superNormalize($membership[\"name\"]).'\">';\n\t\t\t\t\t$_ .= '<h3>';\n\t\t\t\t\t$_ .= '<a href=\"/janitor/admin/user/members/list/'.$membership[\"id\"].'\">'.$membership[\"name\"].'</a> ';\n\t\t\t\t\t$_ .= '<span class=\"count\">'.$model->getMemberCount(array(\"item_id\" => $membership[\"id\"])).'</span>';\n\t\t\t\t\t$_ .= '<h3>';\n\t\t\t\t\t$_ .= '</li>';\n\t\t\t\t}\n\t\t\t\t$_ .= '</ul>';\n\t\t\t}\n\n\t\t\t$_ .= '</div>';\n\n\t\t}\n\n\t\treturn $_;\n\t}", "function _get_moderators () {\n\t\tif (!is_array(module('forum')->_forum_moderators)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ((array)module('forum')->_forum_moderators as $moderator_info) {\n\t\t\t$replace = array(\n\t\t\t\t'user_profile_link'\t=> module('forum')->_user_profile_link($moderator_info['member_id']),\n\t\t\t\t'user_name'\t\t\t=> _prepare_html($moderator_info['member_name']),\n\t\t\t);\n\t\t\tforeach (explode(',', $moderator_info['forums_list']) as $_forum_id) {\n\t\t\t\t$mods_array[$_forum_id][$moderator_info['member_id']] = tpl()->parse('forum'.'/view_home_moderator_item', $replace);\n\t\t\t}\n\t\t}\n\t\tforeach ((array)$mods_array as $forum_id => $moderators_infos) {\n\t\t\t$moderators_by_forums[$forum_id] = implode(', ', $moderators_infos);\n\t\t}\n\t\treturn $moderators_by_forums;\n\t}", "public static function selectAllMember()\n {\n global $dbh;\n $sql = $dbh->prepare(\"SELECT id, username FROM memeber\");\n $sql->execute();\n $data = null;\n while($fetch = $sql->fetch(PDO::FETCH_ASSOC))\n {\n $data[] = $fetch;\n }\n return $data;\n }", "public function notifications_disabled_by()\n {\n return $this->belongsToMany(User::class, 'disabled_notifications', 'disabled_user_id', 'user_id', 'id');\n }", "public function viaNotificationChannels()\n {\n return UserNotificationChannel::with('notification_channel')->get()->filter(function ($item) {\n return $item->muted_at == null;\n })->pluck('notification_channel.name');\n }", "public function members()\n\t\t{\n\t\t\t\treturn $this->belongsToMany( User::class ,'project_members' );\n\t\t}", "public static function getAdministrators()\n\t{\n\t\t$users = [];\n\t\tif (Main\\Loader::includeModule('bitrix24'))\n\t\t{\n\t\t\t$users = \\CBitrix24::getAllAdminId();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$res = \\CAllGroup::GetGroupUserEx(1);\n\t\t\twhile ($row = $res->fetch())\n\t\t\t{\n\t\t\t\t$users[] = (int)$row[\"USER_ID\"];\n\t\t\t}\n\t\t}\n\n\t\treturn $users;\n\t}", "public function activeRestrictions()\n\t{\n\t\t$return = array();\n\t\t\n\t\tif ( !$this->member->group['gbw_disable_tagging'] and $this->member->members_bitoptions['bw_disable_tagging'] )\n\t\t{\n\t\t\t$return[] = 'restriction_no_tagging';\n\t\t}\n\t\tif ( !$this->member->group['bw_disable_prefixes'] and $this->member->members_bitoptions['bw_disable_prefixes'] )\n\t\t{\n\t\t\t$return[] = 'restriction_no_prefixes';\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "public function getFriendableForCurrentProvider(): array;", "public function selectAllMember() {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->memberSelectAll();\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\n\t}", "static function members( $receiverGroupID, $limit=false, $asObject=true ) \n {\n return eZPersistentObject::fetchObjectList( nvNewsletterReceiver::definition(), \n array( 'id', \n 'email_address' ),\n array( 'nvnewsletter_receivers.status' => nvNewsletterReceiver::STATUS_PUBLISHED ), \n null, \n $limit, \n $asObject,\n null, \n array( 'mail_type, pub_date, nrhg.status AS subscribe_status' ),\n array( 'nvnewsletter_receivers_has_groups AS nrhg' ), \n ' AND nrhg.receiver_id = nvnewsletter_receivers.id \n AND nrhg.receivergroup_id = '.$receiverGroupID );\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 applicants()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_APPLICANT)->get();\n }", "public function getAllowedStaffGroups()\n {\n $this->refreshAllowedStaffGroups();\n\n return $this->_getVar('__allowedStaffGroups');\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 }", "public static function checkNotificationsOn()\n {\n $user = $_SESSION[\"staff_id\"];\n $con = $GLOBALS[\"con\"];\n $sql = \"select notificationsOn from user where staff_id = $user\";\n $result = mysqli_query($con, $sql);\n $row = mysqli_fetch_assoc($result);\n return $row[\"notificationsOn\"];\n }", "protected function getMemberNames()\n {\n $arrMembers = array();\n\n $objMembers = $this->Database\n ->execute(\"SELECT id, username, firstname, lastname\n\t\t\t FROM tl_member\n\t\t\t WHERE login = 1\"\n );\n\n while ($objMembers->next()) {\n $varId = $objMembers->id;\n $varName = $objMembers->firstname . ' ' . $objMembers->lastname;\n\n $arrMembers[$varId] = $varName;\n }\n\n return $arrMembers;\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 lobby_membersapi_getMemberships($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\tif ($uid == 0) {\r\n\t\treturn false;\r\n\t} else {\r\n\t \t$tables = pnDBGetTables();\r\n\t \t$column = $tables['lobby_members_column'];\r\n\t \t$where = $column['uid'].\" = '\".$uid.\"'\";\r\n\t\t$result = DBUtil::selectObjectArray('lobby_members',$where);\r\n\t\t$r = array();\r\n\t\tforeach ($result as $item) {\r\n\t\t\t$r[]=$item['gid'];\r\n\t\t}\r\n\t\treturn $r;\r\n\t}\r\n}", "public function getGroupsCanJoin()\n {\n $query = Group::find()\n ->where(['show_at_directory' => '1'])\n ->orderBy([\n 'group.sort_order' => SORT_ASC,\n 'group.name' => SORT_ASC,\n ]);\n $groupsCanJoin = [];\n foreach ($query->all() as $group) {\n if ($group->canSelfBecomeMember()) {\n $groupsCanJoin[] = $group;\n }\n }\n return $groupsCanJoin;\n }", "private function makeActiveMemeberships() {\n\t\t$roles = array ();\n\t\t\n\t\tif ($this->memberships)\n\t\t\tforeach ( $this->memberships as $membership ) {\n\t\t\t\tif ($membership->end_date > time ())\n\t\t\t\t\t$roles [] = $membership->role;\n\t\t\t}\n\t\t\n\t\treturn $roles;\n\t}", "public function get_my_tribe_member_list($post_data){\n $searchId = $post_data['searchId'];\n $loginUserId = $post_data['loginUserId']; \n \n $sql = \"SELECT * FROM tribe WHERE searchId= $searchId AND fromuserId= $loginUserId AND deleteFlag !=1 AND status = 'accept'\";\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array();\n } \n }", "public function members()\n {\n return $this->hasMany('App\\Member');\n }", "public function permList()\n {\n return $this->getParent()->channelGroupPermList($this->getId());\n }", "function getAll() {\r\n\t\t$cond = new Criteria();\r\n\t\t$alls = NewsletterUserPeer::doSelect($cond);\r\n\t\treturn $alls;\r\n }", "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}", "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 getEnableConfirmations()\r\n {\r\n return $this->enable_confirmations;\r\n }", "public function ADStaff_Get_Group_Memners(){\n\t \n\t $result_key = parent::Initial_Result('members');\n\t $result = &$this->ModelResult[$result_key];\n\t \n\t try{\n\t \n\t\t// 查詢資料庫\n\t\t$DB_OBJ = $this->DBLink->prepare(parent::SQL_Permission_Filter(SQL_AdStaff::SELECT_GROUP_MEMBER()));\n\t\tif(!$DB_OBJ->execute()){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_ACCESS_FAIL'); \n\t\t}\n\t\t\n\t\t$members = array();\n\t\twhile($tmp = $DB_OBJ->fetch(PDO::FETCH_ASSOC)){\n\t\t if(!isset($members[$tmp['gid']])) $members[$tmp['gid']] = array();\n\t\t $role_set = json_decode($tmp['role_json'],true) ? json_decode($tmp['role_json'],true) : array();\n $tmp['roles'] = array_keys(array_filter($role_set)); \n\t\t $members[$tmp['gid']][] = $tmp;\n\t\t}\n\t\t$result['action'] = true;\t\t\n\t\t$result['data'] = $members;\t\t\n\t \n\t } catch (Exception $e) {\n $result['message'][] = $e->getMessage();\n }\n\t return $result;\n\t}", "function listMembers($id, $status='subscribed', $start=0, $limit=100) {\n $params = array();\n $params[\"id\"] = $id;\n $params[\"status\"] = $status;\n $params[\"start\"] = $start;\n $params[\"limit\"] = $limit;\n return $this->callServer(\"listMembers\", $params);\n }", "private function getUserRolePermissions()\n {\n return [];\n }" ]
[ "0.687358", "0.67866564", "0.659898", "0.6572389", "0.64167917", "0.6406683", "0.63261586", "0.6314214", "0.6312841", "0.630027", "0.6293736", "0.62828463", "0.6210745", "0.62021595", "0.61608386", "0.6138692", "0.61380374", "0.61049277", "0.6098283", "0.60658115", "0.6060525", "0.60272163", "0.6008595", "0.59969413", "0.59690064", "0.5963742", "0.5952662", "0.5939869", "0.5938725", "0.59291357", "0.5897427", "0.58916825", "0.58881843", "0.58679855", "0.5866925", "0.5864634", "0.5861206", "0.58558035", "0.58485997", "0.5847862", "0.5838133", "0.57932514", "0.57922035", "0.57797337", "0.57630974", "0.5757538", "0.5745187", "0.5744931", "0.5744056", "0.57436126", "0.5740489", "0.5739308", "0.5727506", "0.5724481", "0.57238925", "0.57146645", "0.5707639", "0.57062614", "0.5690936", "0.56727666", "0.56678605", "0.56606334", "0.5656281", "0.56540793", "0.56344116", "0.56307465", "0.56298906", "0.5625457", "0.56159294", "0.5604299", "0.5582742", "0.5577126", "0.55767775", "0.55712956", "0.5571109", "0.55709094", "0.5569051", "0.55577755", "0.55421305", "0.5539197", "0.55363965", "0.55354637", "0.55302984", "0.55128336", "0.5510032", "0.549871", "0.54976773", "0.5492943", "0.54877305", "0.54767656", "0.5472952", "0.5472008", "0.546236", "0.5450348", "0.5440252", "0.54334074", "0.54199326", "0.5419925", "0.5419603", "0.54172593" ]
0.6742181
2
Check create person validation.
public function check_create_person_validation() { $person = []; $this->signInAsRelationshipsManager('api'); $response = $this->json('POST','api/v1/person/', $person); $response->assertStatus(422) ->assertJson( [ 'message' => 'The given data was invalid.', 'errors' => [ 'givenName' => [ 'The given name field is required.' ], "surname1" => [ "The surname1 field is required." ], "identifier" => [ "The identifier field is required." ], "identifier_type" => [ "The identifier type field is required." ] ] ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkIsValidForCreate() {\n $errors = array();\n if (strlen($this->email) < 5) {\n $errors[\"email\"] = i18n(\"You must write your email\");\n }\n if (sizeof($errors)>0){\n throw new ValidationException($errors, \"user is not valid\");\n }\n }", "function ctr_validateDetails(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n // tables exist *AND* are not empty\n if (!empty($_POST['fullnames']) AND !empty($_POST['ages']))\n {\n $ages = $_POST['ages'];\n $fullnames = $_POST['fullnames'];\n $persons = array();\n\n for ($i = 0; $i < count($fullnames); $i++)\n {\n // age in [1;120] and fullname is set\n if (1 <= $ages[$i] AND $ages[$i] <= 120 AND $fullnames[$i])\n {\n array_push($persons, new Person($fullnames[$i], $ages[$i]));\n }\n else\n {\n $ctx['warning'] .= \"Veuillez remplir le(s) \".\n \"participant(s) correctement.\\n\";\n return false;\n }\n }\n\n $reservation->persons = $persons;\n $reservation->save();\n \n return true;\n }\n\n // Bypass checks if datas were already filled\n if ($reservation->persons)\n return true;\n\n $ctx['warning'] .= \"Veuillez remplir tous les champs correctement.\\n\";\n\n return false;\n}", "function validate_on_create() {}", "public function checkIsValidForCreate() {\n $errors = array();\n /*if (strlen($this->email) < 5) {\n $errors[\"register-email\"] = \"You must write your email\";\n }*/\n if (sizeof($errors)>0){\n throw new ValidationException($errors, \"Notification is not valid\");\n }\n }", "public function testCreatePerson()\n {\n }", "public function create() {\n $response = $this->sendRequest(\n 'GET', '/api/v1/persons/create'\n );\n\n return $this->validate($response);\n }", "public function validateCreate(){\n $currentUser=$this->getCurrentUser();\n /** @noinspection PhpMethodParametersCountMismatchInspection */\n $this->input->field('miner')\n ->addRule(IValidator::REQUIRED,'Miner ID is required!')\n ->addRule(IValidator::CALLBACK,'Requested miner is not available!',function($value)use($currentUser){\n try{\n $miner=$this->minersFacade->findMiner($value);\n }catch(\\Exception $e){\n return false;\n }\n if (!($miner->getUserId()==$currentUser->userId)){return false;}\n return $miner->metasource->state==Metasource::STATE_AVAILABLE;\n });\n /** @noinspection PhpMethodParametersCountMismatchInspection */\n $this->input->field('minSupport')\n ->addRule(IValidator::REQUIRED,'Min value of support is required!')\n ->addRule(IValidator::RANGE,'Min value of support has to be in interval [0;1]!',[0,1]);\n }", "function ValidateRegistrationSubmissionPerson()\n {\n \n $validator = new FormValidator();\n $validator->addValidation(\"naam\",\"req\",\"Vul een naam in\");\n $validator->addValidation(\"emailadres\",\"email\",\"De invoer meot bestaan uit een gelding e-mail adres\");\n $validator->addValidation(\"emailadres\",\"req\",\"Vul een e-mail adres in\");\n $validator->addValidation(\"gebruikersnaam\",\"req\",\"Vul een gebruikersnaam in \");\n $validator->addValidation(\"wachtwoord\",\"req\",\"Vul een wachtwoord in\");\n $validator->addValidation(\"telefoon\",\"req\",\"Vul een telefoonnummer in\");\n $validator->addValidation(\"zorgverlenersnummer\",\"req\",\"Vul een zorgnummer in\");\n\n \n if(!$validator->ValidateForm())\n {\n $error='';\n $error_hash = $validator->GetErrors();\n foreach($error_hash as $inpname => $inp_err)\n {\n $error .= $inpname.':'.$inp_err.\"\\n\";\n }\n $this->HandleErrors($error);\n return false;\n } \n return true;\n }", "function RegisterPerson()\n {\n if(!isset($_POST['submitted']))\n {\n return false;\n }\n // Maak een Array\n $formvars = array();\n \n $this->CollectRegistrationSubmissionPerson($formvars);\n \n \n if(!$this->SaveToDatabasePerson($formvars))\n {\n return false;\n }\n \n return true;\n }", "public function test_canCreate_Returns_True_If_Personnel_Have_No_Access() {\n\n\t\t$check_returns_false = $this->authorization_service4->canCreate(2,2);\n\n\t\t$this->assertFalse($check_returns_false);\n\t}", "public function test_canCreate_Returns_True_If_Personnel_Have_Access() {\n\n\t\t$check_returns_true = $this->authorization_service3->canCreate(1,1);\n\n\t\t$this->assertTrue($check_returns_true);\n\t}", "public function postCreate()\n\t{\n\t\t$person = new Person;\n\t\t$admin = new Admin;\n\t\t$data = Input::all();\n\t\tif($admin->isValid($data)){\n\t\t\t$person->name = Input::get('name');\n\t\t\t$person->first_surname = Input::get('first_surname');\n\t\t\t$person->second_surname = Input::get('second_surname');\n\t\t\t$person->email = Input::get('email');\n\t\t\t$person->phone_number = Input::get('phone_number');\n\n\t\t\t$person->save();\n\n\t\t\t$admin->people_id = $person->id;\n\t\t\t$admin->username = Input::get('username');\n\t\t\t$admin->password = Hash::make('12345');\n\n\t\t\t$admin->save();\n\t\t\treturn Redirect::To('admin/admins');\n\t\t}\n\t\telse{\n return Redirect::back()->withInput()->withErrors($admin->errors);\n\t\t}\n\t}", "public function canCreate();", "public function canCreate();", "protected function canCreate() {}", "function verify_person () {\n $bh=new gs_base_handler($this->data,$this->params);\n $f=$bh->validate();\n if (!is_object($f) || !is_a($f,'g_forms')) return $f;\n $d=$f->clean();\n\n $rec=person($this->params['role']);\n if (!$rec) {\n $f->trigger_error('FORM_ERROR','REC_NOTFOUND');\n return $bh->showform($f);\n }\n\n $fname=$this->params['field_name'].'_secret';\n $ga=new GoogleAuthenticator;\n $code=$ga->getCode($rec->$fname);\n\n\n if ($code!=$d['ga_code']) {\n $f->trigger_error('FORM_ERROR','GA_INCORRECT_CODE');\n return $bh->showform($f);\n }\n\n $person=person();\n $fname=$this->params['field_name'].'_verified';\n $person->$fname=TRUE;\n return true;\n }", "public function create(){\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 'dni' => 'required|regex:/^[0-9]{8}+$/|unique:App\\Models\\Person,dni',\n 'first_lastname' => 'string|required',\n 'second_lastname' => 'string|required',\n 'birthday' => 'date|required',\n 'email' => 'email|required|unique:App\\Models\\Person,email',\n 'address' => 'required|string',\n 'type_people_id' => 'numeric|required|min:2|max:3',\n 'ruc' => 'required_if:type_people_id,2|regex:/^[0-9]{11}+$/|unique:App\\Models\\Person,ruc',\n 'business_name' => 'required_if:type_people_id,2|string'\n ]);\n\n\n\n //Creando persona\n $person = Person::create($fields);\n\n // CREANDO EMPLEADO\n Client::create([\"people_id\" => $person->id]);\n\n //CREANDO USUARIO\n User::create([\n \"password\" => Hash::make($fields['dni']),\n \"user_name\" => $person->email,\n \"people_id\" => $person->id,\n ]);\n\n return response()->json([\n 'res' => true,\n 'message' => \"el cliente {$person->name} ha sido creado correctamente\"\n ]);\n }", "public static function validateCreateRequest() {\n $errors = array();\n $data = array();\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "function canCreate(){\n\t\t\tif(!isset($_POST['action'])) return false;\n\t\t\tif($_POST['action'] !== 'create_profile') return false;\n\t\t\tif($_POST['profile_folder'] === '') return false;\n\t\t\tif($_POST['profile_name'] === '') return false;\n\t\t\treturn true;\n\t\t}", "function create_person($personRec = \"\", $personID = \"\")\n\t{\n\t\t//throw new exception(\"create_person - this function is not implemented\");\n\n\t}", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "protected function onCreating()\n {\n return $this->isDataOnCreateValid();\n }", "public function isValidCreateData($form){\n return true;\n }", "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 testValidateSurname_ReturnsPleaseEnterAValidSurname_GivenGenerationRequiredTrue()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'valid',\n $person->validateSurname('Gates III', true)\n );\n }", "public function validates($person){\n $people=$this->all();\n //check that there are less then 10 entries\n if (10<=$people->rowCount()){\n return false; \n }\n //check that there are 4 or less of the same job\n $same_job=0;\n foreach($people as $p){\n if($p['job_role']==$person['job_role']){\n $same_job++;\n }\n }\n if (4<=$same_job){\n return false; \n }\n //return true if validation passes\n return true;\n }", "public function canAddUnknownPerson();", "public static function validateCreateRequest() {\n $errors = array();\n $data = array();\n self::checkTitle($errors, $data);\n self::checkDescription($errors, $data);\n self::checkGoal($errors, $data);\n self::checkStartDate($errors, $data);\n self::checkDuration($errors, $data);\n self::checkCategories($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'create_project']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "public function canCreateAUser ()\n {\n\n $faker = Factory::create();\n\n $this->withoutExceptionHandling();\n\n\n $response = $this->json('POST', 'api/users', [\n 'name' => $name = $faker->company,\n 'surName' => $surName = $faker->company,\n 'email' => $email = $faker->company,\n 'password' => $password = $faker->company,\n 'entity' => $entity = $faker->company,\n 'street' => $street = $faker->company,\n 'number' => $number = random_int(0,9999),\n 'city' => $city = $faker->company,\n 'CP' => $CP = random_int(0,9999),\n ])\n ->assertStatus(201);\n\n $this->assertDatabaseHas('users', [\n 'name'=> $name,\n 'surName'=> $surName,\n 'email'=>$email,\n 'password'=>$password,\n 'entity'=>$entity,\n 'street'=>$street,\n 'number'=>$number,\n 'city'=>$city,\n 'CP'=>$CP,\n ]);\n }", "public function testNewPersonsOwnershipExistingCustomers() {\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n $this->assertCheckoutProgressStep('Event registration');\n\n // Save first registrant.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => '[email protected]',\n 'field_comments[0][value]' => 'No commments',\n ], 'Save');\n\n // Assert that this person profile is now owned by the current logged in\n // user.\n $person = Profile::load(1);\n // Assert that we are checking the expected person.\n $this->assertEquals('Person 1', $person->field_name->value);\n $this->assertEquals($this->adminUser->id(), $person->getOwnerId());\n }", "public static function checkCreateRequest() {\n self::checkConnection();\n $data = self::validateCreateRequest();\n $project = new Project();\n if ($data != null) {\n $project->update($data);\n $project->save();\n $project->updateCategory($data['categories']);\n redirect(url(['_page' => 'project_detail', 'project_id' => $project->id]));\n }\n }", "public function canCreate(string $name) : bool;", "public function first_name_is_required_on_create()\n {\n $this\n ->from('nova/resources/users/new')\n ->post('nova-api/users', [\n 'first_name' => '',\n ])\n ->assertRedirect('nova/resources/users/new')\n ->assertSessionHasErrors('first_name');\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}", "public function testCanValidateCreateOperationForMultipleDomains() {\n\n $ukDomain = \"validationdomain.uk\";\n $comDomain = \"validationdomain.com\";\n $owner = new DomainNameContact();\n\n $createDescriptor = new DomainNameCreateDescriptor(array($ukDomain, $comDomain), 1, $owner, array(\"monkeynameserver\"));\n\n $validationErrors = $this->api->domains()->validate($createDescriptor);\n\n $this->assertTrue(is_array($validationErrors[$ukDomain]));\n $this->assertTrue(isset($validationErrors[$ukDomain][\"DOMAIN_INVALID_OWNER_CONTACT\"]));\n $this->assertTrue(isset($validationErrors[$ukDomain][\"DOMAIN_INVALID_NAMESERVER_FORMAT\"]));\n\n $this->assertTrue(is_array($validationErrors[$comDomain]));\n $this->assertTrue(isset($validationErrors[$comDomain][\"DOMAIN_INVALID_OWNER_CONTACT\"]));\n $this->assertTrue(isset($validationErrors[$comDomain][\"DOMAIN_INVALID_NAMESERVER_FORMAT\"]));\n\n $this->assertTrue($validationErrors[$comDomain][\"DOMAIN_INVALID_NAMESERVER_FORMAT\"] instanceof TransactionError);\n\n }", "public function create()\n {\n return 'can`t create ';\n }", "public function testPeopleRequirementsCreate($model)\n { \n // $randomId = self::$f1->randomId('person');\n // $model['peopleRequirement']['person']['@id'] = $randomId['person'];\n // $model['peopleRequirement']['requirement']['@id'] = \"\";//$requirement['@id'];\n // $model['peopleRequirement']['requirementStatus']['@id'] = \"1\";\n // $model['peopleRequirement']['requirementDate'] = \"\";\n // $model['peopleRequirement']['staffPerson']['@id'] = \"\";//\"40919398\";\n // $model['peopleRequirement']['backgroundCheck']['backgroundCheckStatus']['@id'] = \"1\";\n // $r = self::$f1->post($model, '/v1/people/'.$randomId['person'].'/requirements.json');\n // $this->assertEquals('201', $r['http_code']);\n // $this->assertNotEmpty($r['body'], \"No Response Body\");\n // return $peopleRequirement = $r['body']['requirement'];\n }", "public function only_person(CreateVisitorRequest $request){\n \n $person = Person::create([\n 'type_dni' => $request->type_dni,\n 'dni' => $request->dni,\n 'name' => $request->name,\n 'lastname' => $request->lastname,\n 'address' => $request->address,\n 'phone' => $request->phone,\n 'email' => $request->email,\n 'branch_id' => 1,\n ]);\n\n /**\n * Registro de la fotografia \n */\n if ($request->file('file') != null) {\n $photo = $request->file('file');\n $path = $photo->store('persons');\n $image = new Image;\n $image->path = $path;\n $image->imageable_type = \"App\\Person\";\n $image->imageable_id = $person->id;\n $image->save();\n }\n\n return response()->json([\n 'message' => 'Registrado correctamente',\n ]);\n }", "protected function creatingNewUser() {\n return ($this->request_exists('user_choice') && $this->request('user_choice') == 'new' );\n }", "function ctr_validateHome(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n // variables exist *AND* are not empty\n if (!empty($_POST['destination']) AND !empty($_POST['personsCounter']))\n {\n $reservation->destination = htmlspecialchars($_POST['destination']);\n $reservation->insurance = isset($_POST['insurance'])? 'True':'False';\n $personsCounter = intval($_POST['personsCounter']);\n\n // set bounds to the number of persons\n if (1 <= $personsCounter AND $personsCounter <= 30)\n {\n $reservation->personsCounter = $personsCounter;\n $reservation->save();\n\n return true;\n }\n\n $ctx['warning'] .= \"Vous ne pouvez enregistrer \".\n \"que entre 1 et 30 personnes.\\n\";\n }\n\n // Bypass checks if datas were already filled\n if ($reservation->destination)\n return true;\n\n $ctx['warning'] .= \"Veuillez remplir tous les champs correctement.\\n\";\n\n return false;\n}", "function a_user_can_be_created(){\n\n $profession = factory(Profession::class)->create([\n 'title' => 'Web Developer'\n ]);\n $skillA = factory(Skill::class)->create([\n 'description' => 'CSS'\n ]);\n $skillB = factory(Skill::class)->create([\n 'description' => 'HTML'\n ]);\n\n $this->browse(function(Browser $browser) use ($profession,$skillA,$skillB){\n $browser->visit('users/create')\n ->assertSeeIn('h5','Create User')\n ->type('name','Yariel Gordillo')\n ->type('email','[email protected]')\n ->type('password','secret')\n ->type('bio','This a small bio')\n ->select('profession_id',$profession->id)\n ->type('twitter' ,'https://twitter.com/yariko')\n ->check(\"skills[{$skillA->id}]\")\n ->check(\"skills[{$skillB->id}]\")\n ->radio('role', 'user')\n ->press('Create User')\n ->assertPathIs('/users')\n ->assertSee('Yariel Gordillo')\n ->assertSee('[email protected]');\n });\n\n }", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "public function validate()\n {\n // FUTURE FIXME: no se deberia retornar un simple true/false, sino que \n // si una condicion no se cumple deberia devolverse un mensaje \n // indicando qué no se ha cumplido, posiblemente usando una excepcion \n // para cada caso, para que el controlador la capture y muestre el \n // mensaje adecuado a la vista y no un simple mensaje de error \n // generico.\n\n // name solo puede tener letras, números y guiones\n if (!filter_var($this->name, FILTER_VALIDATE_REGEXP, [\"options\" => [\"regexp\" => \"/[a-zA-Z0-9\\-]+/\"]]))\n return false;\n\n // descrpicion debe limpiarse para prevenir ataques XSS\n $this->description = filter_var($this->description, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);\n\n // nombre debe tener como minimo 4 caracteres y como maximo 255\n if (strlen($this->name) <4 || strlen($this->name) > 255)\n return false;\n\n // estado debe ser \"pendiente\", \"subasta\" o \"venta\" exclusivamente\n if ($this ->state !== \"pendiente\" && $this->state !== \"subasta\" && $this->state !== \"venta\")\n return false;\n\n // el propietario debe existir como usuario en la BD\n $user = new User($this->owner);\n if (!$user->fill()) return false;\n\n // todas las condiciones se han cumplido, retorna true\n return true;\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 store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:people,email,NULL,id,deleted_at,NULL',\n 'jabatan' => 'required',\n 'status' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect('persons/add')\n ->withErrors($validator)\n ->withInput();\n }\n\n $Person = new 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\n if ($Person->save()) {\n Log::info('User: '.Auth::user()->id. '->Create Person: '. $Person->id);\n flash()->overlay('Berhasil disimpan', 'Notification');\n return redirect('persons');\n }\n }", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function store(PersonRequest $request)\n {\n $this->validate($request, [\n 'codigo' => 'required|unique:persona|max:30',\n ]);\n\n Person::create([\n 'codigo' => $request->codigo,\n 'nombre' => $request->nombre,\n 'apaterno' => $request->apaterno,\n 'amaterno' => $request->amaterno,\n 'fec_nac' => $request->fec_nac,\n 'tipo' => $request->tipo,\n 'sexo' => $request->sexo,\n ]);\n\n PersonalData::create([\n 'persona_codigo' => $request->codigo,\n 'estado_civil' => $request->estado_civil,\n 'religion' => $request->religion,\n 'email' => $request->email,\n 'telefono' => $request->telefono,\n 'escolaridad' => $request->escolaridad,\n 'carrera_id' => $request->carrera_id,\n 'domicilio' => $request->domicilio,\n 'actividad_economica' => $request->actividad_economica,\n 'lug_nac' => $request->lug_nac,\n 'lug_res' => $request->lug_res,\n ]);\n\n toast('Alumno registrado correctamente.', 'success', 'top');\n return redirect()->route('student.show', $request['codigo']);\n }", "public function createValidator();", "function before_validation_on_create() {}", "public function valid(){ }", "public function testValidateForenemes_ReturnsValid_GivenRegnalNumberRequiredTrue()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'valid',\n $person->validateForenemes(\"George VI\", true)\n );\n }", "private function validateInsert() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t\t// application id not 0\n\t}", "function canCreate() {\r\n\t\treturn !DataObject::get_one($this->class);\r\n\t}", "public function Valid();", "public function validate(){\r\n $userInfo = wbUser::getSession();\r\n \r\n if ($this->actionType == 'CREATE'){\r\n // TODO : Write your validation for CREATE here\r\n $this->record['creation_date'] = date('Y-m-d');\r\n $this->record['created_by'] = $userInfo['user_name'];\r\n \r\n $this->record['updated_date'] = date('Y-m-d');\r\n $this->record['updated_by'] = $userInfo['user_name'];\r\n \r\n }else if ($this->actionType == 'UPDATE'){\r\n // TODO : Write your validation for UPDATE here\r\n $this->record['updated_date'] = date('Y-m-d');\r\n $this->record['updated_by'] = $userInfo['user_name'];\r\n }\r\n \r\n return true;\r\n }", "public function beforeValidationOnCreate()\r\n {\r\n // Data de cadastro\r\n $this->cadastroDt = date('Y-m-d H:i:s');\r\n\r\n // Seta status da mensagem para ativa\r\n $this->enviadoEmail = 'N';\r\n }", "public function valid_json_request_to_people_store_route_is_successful()\n {\n \t$data = [\n \t\t[\n \t\t\t\"first_name\" => \"Shawn\",\n \t\t\t\"last_name\" => \"Jones\",\n \t\t\t\"age\" => \"32\",\n \t\t\t\"email\" => \"[email protected]\",\n \t\t\t\"secret\" => \"mem172946\",\n \t\t],\n \t\t[\n \t\t\t\"first_name\" => \"Maria\",\n \t\t\t\"last_name\" => \"Jones\",\n \t\t\t\"age\" => \"37\",\n \t\t\t\"email\" => \"[email protected]\",\n \t\t\t\"secret\" => \"jones2724\",\n \t\t],\n \t];\n\n \t$response = $this->json('POST','/people/store', $data);\n \n $response->assertStatus(200);\n\n $this->assertDatabaseHas('people', ['id' => '1']); \n }", "public function isCreatable();", "protected function check_create_permission($post)\n {\n }", "public function create()\n\t{\n\t\treturn $this->fail(lang('RESTful.notImplemented', ['create']), 501);\n\t}", "public function beforeValidationOnCreate()\n {\n\n }", "public static function validatePersonName(): array\n\t{\n\t\treturn [\n\t\t\tnew LengthValidator(null, 100),\n\t\t];\n\t}", "public function check_authorization_uri_to_show_a_person()\n {\n $person = create_person_with_nif_array();\n $this->check_json_api_uri_authorization('api/v1/person/','post', $person);\n }", "function addPerson(){\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[\"uuid\"]) && isset($requestParams[\"role\"])){\n\t\t\t\t\n\t\t\t\t$personUUID = trim($requestParams[\"uuid\"]);\n\t\t\t\t$uri = self::personBaseURI.$personUUID;\n\t\t\t\t\n\t\t\t\tif(isset($requestParams[\"rank\"])){\n\t\t\t\t\t $rank = $requestParams[\"rank\"];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t $rank = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pObj = new dbXML_dbPerson;\n\t\t\t\t$pObj->initialize();\n\t\t\t\t$pObj->dbPenelope = true;\n\t\t\t\t$pFound = $pObj->getByID($personUUID);\n\t\t\t\tif($pFound){\n\t\t\t\t\t $name = $pObj->label;\n\t\t\t\t\t if($requestParams[\"role\"] == \"creator\"){\n\t\t\t\t\t\t $persons = $this->rawCreators;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawCreators = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"contributor\"){\n\t\t\t\t\t\t $persons = $this->rawContributors;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawContributors = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"person\"){\n\t\t\t\t\t\t $persons = $this->rawLinkedPersons;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawLinkedPersons = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t \n\t\t\t\t\t }\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 testAllowCreate()\n {\n $createFalse = LogEntry::create()->canCreate(null);\n $this->assertFalse($createFalse);\n $this->logInWithPermission('ADMIN');\n $createFalse = LogEntry::create()->canCreate();\n $this->assertFalse($createFalse);\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 }", "public abstract function validation();", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "function user_can_added_to_DB_and_name_check() {\n $user = factory(User::class)->create();\n\n $this->assertEquals( !0, User::all()->count() );\n $this->seeInDatabase('users', ['name' => $user->name]);\n }", "public function validateForCreate($input)\n {\n return $this->validate($input, $this->getRules());\n }", "public function testPostPerson400BadRequest(array $person): void\n {\n // Mismo username\n $p_data = [\n 'name' => $person['name'],\n ];\n $response = $this->runApp(\n 'POST',\n self::RUTA_API,\n $p_data,\n $this->getTokenHeaders()\n );\n $this->internalTestError($response, StatusCode::STATUS_BAD_REQUEST);\n }", "public function isCreated() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->creationDate) ? false: true;\r\n\t}", "public function testValidateSurname_ReturnsPleaseEnterAValidSurname_GivenGenerationRequiredFalse()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'valid',\n $person->validateSurname('Gates III', false)\n );\n }", "public static function createAccount()\n {\n $firstname = $_POST['firstname'] ?? '';\n $lastname = $_POST['lastname'] ?? '';\n $email = $_POST['email'] ?? '';\n $password = $_POST['password'] ?? '';\n\n // validate the data\n $validator = Validation::createValidator();\n $errors[] = $validator->validate($firstname, [\n new Length([\n 'min' => 2,\n 'minMessage' => 'Your first name must be at least {{ limit }} characters long',\n 'max' => 100,\n 'maxMessage' => 'Your first name cannot be longer than {{ limit }} characters'\n ]),\n new NotBlank([\n 'message' => 'Your first name should not be blank'\n ]),\n ]);\n $errors[] = $validator->validate($lastname, [\n new Length([\n 'min' => 2,\n 'minMessage' => 'Your last name must be at least {{ limit }} characters long',\n 'max' => 100,\n 'maxMessage' => 'Your last name cannot be longer than {{ limit }} characters'\n ]),\n new NotBlank([\n 'message' => 'Your last name should not be blank'\n ]),\n ]);\n $errors[] = $validator->validate($email, [\n new Email([\n 'message' => 'Your email {{ value }} is not a valid email',\n ]),\n new NotBlank([\n 'message' => 'Your email should not be blank'\n ]),\n ]);\n $errors[] = $validator->validate($password, [\n new Length([\n 'min' => 6,\n 'minMessage' => 'Your password must be at least {{ limit }} characters long'\n ]),\n new Regex([\n 'pattern' => '/\\d/',\n 'match' => true,\n 'message' => 'Your password must contain a number',\n ]),\n new Regex([\n 'pattern' => '/^[a-z]+$/',\n 'match' => false,\n 'message' => 'Your password must contain a lower case character',\n ]),\n new Regex([\n 'pattern' => '/^[A-Z]+$/',\n 'match' => false,\n 'message' => 'Your password must contain an upper case character',\n ]),\n new Regex([\n 'pattern' => '/^[!@#$%^&*()]+$/',\n 'match' => false,\n 'message' => 'Your password must contain a special character',\n ]),\n new NotBlank([\n 'message' => 'Your password should not be blank'\n ]),\n ]);\n\n $errorData = [];\n foreach ($errors as $error) {\n foreach ($error as $violation) {\n $errorData[] = $violation->getMessage();\n }\n }\n if (count($errorData) > 0)\n Response::error(message: 'Validation error', data: $errorData);\n \n // sanitize data\n $data = [\n 'email' => $email,\n 'password' => $password,\n 'firstname' => $firstname,\n 'lastname' => $lastname\n ];\n\n $filters = [\n 'email' => 'trim|escape|lowercase',\n 'password' => 'trim',\n 'firstname' => 'trim|escape|capitalize',\n 'lastname' => 'trim|escape|capitalize'\n ];\n\n $sanitizer = new Sanitizer($data, $filters);\n $sanitized = $sanitizer->sanitize();\n $email = $sanitized['email'];\n $password = $sanitized['password'];\n $firstname = $sanitized['firstname'];\n $lastname = $sanitized['lastname'];\n \n // store the data in the database\n $conn = Database::connect();\n\n // ensure unique emails within the application\n // check if user exist already\n $query = \"SELECT email FROM users WHERE email='$email'\";\n $stmt = $conn->prepare($query);\n $stmt->execute();\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $response = $stmt->fetchAll();\n if ($response[0]['email'] > 0) {\n Response::error(message: \"Email \\\"{$email}\\\" already exist in database.\");\n }\n\n // hash password\n $hash = Auth::hashPassword($password);\n\n // create a wallet Id for the user\n $walletId = time();\n\n // store the user data in the users table\n $query = \"INSERT INTO users (firstname, lastname, email, password, wallet_id) VALUES (:firstname, :lastname, :email, :password, :wallet_id)\";\n $stmt = $conn->prepare($query);\n $stmt->bindParam(':firstname', $firstname);\n $stmt->bindParam(':lastname', $lastname);\n $stmt->bindParam(':email', $email);\n $stmt->bindParam(':password', $hash);\n $stmt->bindParam(':wallet_id', $walletId);\n $stmt->execute();\n\n if ($stmt->rowCount() > 0) {\n // account created\n // return response\n Response::success(message: 'Account created successfully. Wallet created.');\n } else {\n Response::error(message: 'Account not created, please try again.', code: 200);\n }\n }", "function user_create_validate($data)\r\n{\r\n\tglobal $db;\r\n\t$out = true;\r\n\t@unlink(_CACHE.'user_create_validate_msg.txt');\r\n\tif ($db->getOne(\"SELECT 1 FROM `bbc_user` WHERE `username`='\".$data['username'].\"'\"))\r\n\t{\r\n\t\tuser_create_validate_msg('Username has already been used!');\r\n\t\t$out = false;\r\n\t}\r\n\tif ($out && $db->getOne(\"SELECT 1 FROM `bbc_account` WHERE `email`='\".$data['email'].\"'\"))\r\n\t{\r\n\t\tuser_create_validate_msg('Email address has already been used!');\r\n\t\t$out = false;\r\n\t}\r\n\tif ($out)\r\n\t{\r\n\t\t$out = user_call_func_validate(__FUNCTION__, $data);\r\n\t}\r\n\treturn $out;\r\n}", "public function test_reject_lname()\n {\n $controller = new Controller();\n \n $result = $controller->addEmpOwner('abc', '0', null);\n \n $this->assertEquals($result, false);\n }", "public function testCreateSiteMembershipRequestForPerson()\n {\n }", "public function validation();", "public function check_form()\n\t{\n\t\tProfil_fields_forum::validate(PROFIL_FIELDS_CONTACT, 'contact', $this->errstr, Fsb::$session->id());\n\t}", "public function testValidateForenemes_ReturnsValid_GivenWilliamHenryRequiredTrue()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'valid',\n $person->validateForenemes(\"William Henry\", true)\n );\n }", "public function isValid() {}", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}" ]
[ "0.70678824", "0.6912674", "0.6803462", "0.67670065", "0.67114013", "0.6701259", "0.6678954", "0.66605467", "0.66580576", "0.66430044", "0.66178644", "0.6581013", "0.6515533", "0.6515533", "0.6514173", "0.6509381", "0.64894927", "0.637923", "0.63351506", "0.6283792", "0.62376994", "0.62174875", "0.61996675", "0.61869186", "0.6177499", "0.6151062", "0.61150265", "0.60979134", "0.6094047", "0.60857946", "0.607535", "0.6054399", "0.60543144", "0.6048081", "0.60154545", "0.5970104", "0.59624696", "0.59602714", "0.5925923", "0.5902213", "0.5874582", "0.58671457", "0.586708", "0.58605486", "0.5858682", "0.58543926", "0.58427954", "0.58427954", "0.58427954", "0.58427954", "0.58427954", "0.58427954", "0.58427954", "0.58427954", "0.58111346", "0.5804035", "0.5797366", "0.579694", "0.57867247", "0.5786578", "0.5782418", "0.5777665", "0.5776226", "0.5772837", "0.57677543", "0.576412", "0.57598007", "0.57524633", "0.5751491", "0.57454634", "0.57430875", "0.5734538", "0.57268524", "0.5720775", "0.5718294", "0.57118756", "0.57118756", "0.57118756", "0.57118756", "0.57036155", "0.5702985", "0.56944704", "0.5693725", "0.5688199", "0.5680965", "0.5672302", "0.5671766", "0.567094", "0.5669215", "0.5651618", "0.56442845", "0.56435937", "0.5643357", "0.5643357", "0.5643357", "0.5643357", "0.5642665", "0.5642665", "0.5642368", "0.5642368" ]
0.83110464
0
Check authorization uri to show a person.
public function check_authorization_uri_to_show_a_person() { $person = create_person_with_nif_array(); $this->check_json_api_uri_authorization('api/v1/person/','post', $person); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize() {\n\t\tif (Auth::user()->user_type == \"S\" || Auth::user()->user_type == \"O\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tabort(404);\n\t\t}\n\t}", "abstract public function url_authorize();", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "public function authorize()\n {\n $id = Auth::id();\n $livro = $this->route('livro');\n if ($livro!=NULL) {\n $author = $livro->user_id;\n return $author == $id ? true : false;\n }\n else\n return true;\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function authorize()\n {\n return auth()->user()->is_author($this->route('board'));\n }", "public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n // dd($this->route('file')->name_id);\n return $this->auth->check();\n // return $this->route('file')->name_id === $this->auth->user()->id;\n }", "public function show($id)\n {\n $user = Auth::user();\n $interaction = Interaction::find($id);\n if (is_null($user) || is_null($interaction))\n {\n abort(404);\n }\n\n if ($user->can('see-all-interactions') || ($user->can('see-new-interactions') && $interaction->user_id == $user->id))\n {\n return redirect('person/'.$interaction->person_id);\n }\n abort(403);\n }", "function hasPermission($uriPermission){\n\tif(Auth::check() && Auth::user()->hasAnyPermission($uriPermission))\n return true;\n else\n return false;\n}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = auth('web')->user();\n\n $uuidTenant = isset($user) ? $user->tenant->uuid : $this->segment(4);\n\n if(!app(TenantRepository::class)->getTenantByUuid($uuidTenant)) {\n return false; // 404\n }\n\n return true;\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function authorize()\n {\n $this->id = $this->route('admin');\n return auth('admin')->check();\n }", "abstract protected function auth_url();", "public function openAuthorizationUrl()\n {\n header('Location: ' . $this->getAuthorizationUrl());\n exit(1);\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function show($params){\n if( $_SESSION[\"username\"] ){\n // check if user has one of the permited roles\n // TODO: check if user was deleted\n $user_id = $_SESSION[\"user_id\"];\n $user = User::findBy(\"id\", $user_id);\n $roles = $user->roles;\n $role_page = \"PAGE_\".$params;\n\n if( $user->hasRole($role_page) ){\n $GLOBALS['page_name'] = $params;\n render('pages', 'show');\n }\n else{\n header('HTTP/1.0 401 Unauthorized');\n render('errors', '401');\n }\n }\n else{\n $_SESSION['PAGE_REFERER'] = $_SERVER['REQUEST_URI'];\n header('Location: /sign_in');\n }\n\n }", "function custom_rules_is_during_oauth(){\n\treturn (\n\t\t// on oauth route itself\n\t\targ(0) == 'oauth2' ||\n\t\t// or logging in using the form\n\t\t( isset( $_GET['destination'] ) &&\n\t\t stripos( $_GET['destination'], 'oauth2' ) !== FALSE )\n\t);\n}", "public function isAuthorized() {}", "private function processAuthorization($uri) {\n\t\tif (isset($_SESSION['user'])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "protected function check_auth( )\n\t{\n\t\t$page = $this->uri->segment( 2);\n\t\t$section = $this->uri->segment(1);\t\t\n\t\t$function = $this->uri->segment(3);\n\t\t\n\t\tif( $section == 'api' and $page == 'users' and $function == 'login' )\n\t\t\treturn;\n\n\t\t$logged_in = $this->is_logged_in();\n\t\t$excused_uri = array('login' , 'recover_password' , 'auth_help' , 'token_login');\n\t\tif( ! $logged_in )\n\t\t{\n\t\t\t//if in app mode\n\t\t\tif( $this->_app_mode == 'json' and $section != 'admin' )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->output->set_status_header('401');\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//check if is login page\n\t\t\tif( $section == 'admin' and ( ! in_array($page, $excused_uri) ) )\n\t\t\t{\n\t\t\t\theader('Location: /admin/login');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\treturn;\n\t}", "function canViewButton($uri,$type=false)\n{\n if(isset($type) && $type != null)\n {\n if($type='route')\n {\n if(\\App\\Permission::where('route_name',$uri)->exists()) {\n $permission = \\App\\Permission::where('route_name', $uri)->first();\n $uri = $permission->route_uri;\n }\n }\n }\n $mdl=new \\App\\Http\\Middleware\\UserizationMiddleware();\n if($mdl->checkAccessibility($uri))\n {\n return true;\n }\n return false;\n}", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "public function testGetAuthorizationUrl()\n {\n $uri = parse_url($this->provider->getAuthorizationUrl());\n parse_str($uri['query'], $query);\n\n $this->assertEquals('oauth.mail.ru', $uri['host']);\n $this->assertEquals('/login', $uri['path']);\n\n $this->assertArrayHasKey('client_id', $query);\n $this->assertArrayHasKey('response_type', $query);\n $this->assertArrayHasKey('state', $query);\n $this->assertEquals('code', $query['response_type']);\n\n $this->assertNotNull($this->provider->getState());\n }", "private function requiresAuthorization($uri) {\n\t\tif (array_key_exists($uri, $this->routes))\t {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function people_show()\n {\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n return view('hact.reports.people');\n }", "public function hasAuthorization(): bool;", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n $tag = $this->route()->parameter('tag');\n return Auth::user()->can('view', [Tag::class, $tag]);\n }", "public function authDoView(){\n if(!$this->authUser()){\n echo '{\"status\":-1,\"result\":\"/user/login?prePage='.$_SERVER['HTTP_REFERER'].'\"}';\n exit();\n }\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n $feedID = $this->route('feed');\n if (isset($feedID)) {\n return !empty(Feed::find($feedID));\n }\n\n return true;\n }", "public function authorize(): bool\n {\n return null !== $this->getGame()->findPlayerByName($this->request->get('nickname'));\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n $id = $this->route('id');\n if ($id) {\n $giftList = GiftList::find($id);\n if (!$giftList || $giftList->user->id != Auth::user()->id) {\n return false;\n }\n }\n return true;\n }", "public function authorize()\n {\n $auth_user = User::find(ApiHelper::getAuthenticatedUser()->id);\n $user_id = $this->route('user_id');\n if($user_id == $auth_user->id || ApiHelper::isPatient($user_id)){\n\n // ugly code; since iOs sends back <null> instead of null -> need to filter out these fields\n $fields = array('firstName', 'lastName', 'phone', 'gender', 'dateOfBirth', 'email');\n foreach ($fields as $f) {\n if($f == '<null>'\n )\n {\n echo $this->$f;\n $this->$f == null;\n }\n }\n return true;\n }\n return false;\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public static function ValidateUser()\n {\n $allowed_page = '/(login|article\\/(list|read))/';\n\n// $_SESSION['user'] not set or empty, and current view is allowed\n if ((!isset($_SESSION['user']) || empty($_SESSION['user'])) && !preg_match($allowed_page, $_GET['views'])) {\n header('Location: /login');\n }\n }", "public function isAuthorized() {\n\t\t\n\t}", "function action_profile_show() {\n // Process request with using of models\n $user = get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n return ['view' => 'user/show', 'data' => $data];\n } else {\n return error403();\n }\n}", "function check_uri_permissions($allow = TRUE)\n\t{\n\t\t// First check if user already logged in or not\n\t\tif ($this->is_logged_in())\n\t\t{\n\t\t\t// If user is not admin\n\t\t\tif ( ! $this->is_admin())\n\t\t\t{\n\t\t\t\t// Get variable from current URI\n\t\t\t\t$controller = '/'.$this->ci->uri->rsegment(1).'/';\n\t\t\t\tif ($this->ci->uri->rsegment(2) != '')\n\t\t\t\t{\n\t\t\t\t\t$action = $controller.$this->ci->uri->rsegment(2).'/';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$action = $controller.'index/';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Get URI permissions from role and all parents\n\t\t\t\t// Note: URI permissions is saved in 'uri' key\n\t\t\t\t$roles_allowed_uris = $this->get_permissions_value('uri');\n\t\t\t\t\n\t\t\t\t// Variable to determine if URI found\n\t\t\t\t$have_access = ! $allow;\n\t\t\t\t// Loop each roles URI permissions\n\t\t\t\tforeach ($roles_allowed_uris as $allowed_uris)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif ($allowed_uris != NULL)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Check if user allowed to access URI\n\t\t\t\t\t\tif ($this->_array_in_array(array('/', $controller, $action), $allowed_uris))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$have_access = $allow;\n\t\t\t\t\t\t\t\t// Stop loop\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\t\t\t\t// Trigger event\n\t\t\t\t$this->checked_uri_permissions($this->get_user_id(), $have_access);\n\t\t\t\t\n\t\t\t\tif ( ! $have_access)\n\t\t\t\t{\n\t\t\t\t\t// User didn't have previlege to access current URI, so we show user 403 forbidden access\n\t\t\t\t\t$this->deny_access();\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// User haven't logged in, so just redirect user to login page\n\t\t\t$this->deny_access('login');\n\t\t}\n\t}", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n return Auth::user()->type == 1;\n }", "public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "public function show()\n {\n return $this->responseOk(Auth::user());\n }", "public function getAuthUrl();", "public function isAuth();", "public function authorize()\n { \n\n if($this->path() == 'add_vendor' || $this->path() == 'edit_vendor'){\n return true;\n }else{\n return false;\n }\n \n }", "public function authorize()\n\t{\n $subjectId = $this->route('subject');\n\n return Subject::find($subjectId)->user->id == Auth::id();\n\t}", "public function authorize()\n {\n if($this->path() == 'signup'){\n return true;\n } else {\n return false;\n }\n \n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return Auth::user()->is_supplier;\n }", "function show() {\n // Process request with using of models\n $user = Service::get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n $view = 'user/show';\n return $this->render($view, $data);\n } else {\n return Application::error403();\n }\n}", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "public function show($id) {\n return redirect()->route('permissions.index');\n }", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "abstract public function getAuthUri(): string;", "public function authorize();", "public function authorize();", "public function whois_looking_check(){\n\t\tglobal $post;\n\t\t$post_id = get_the_ID();\n\t\t$current_user_id = get_current_user_id();\n\t\t$author_user_id = $post->post_author;\n\t\tif ($current_user_id == $author_user_id){\n\t\t\t$include_file = plugin_dir_path( __FILE__ ) . \"subscription_view_author.php\";\n\t\t\tinclude_once($include_file);\n\t\t\tif (isset ($$subscription_view_author)){return;}\n\t\t\t$subscription_view_author = new subscription_view_author($post_id);\n\t\t}\n\t}", "public function checkAuth();", "public function checkAuth();", "public function isAuthorize(){\n $userPlan = $this->request->session()->get('userPlan');\n return ($userPlan >= 1)? true : abort(404) ;\n }", "public function isAuthorized($user)\n {\n if (isset($user['V_ROL']) and $user['V_ROL']==='Viewer')\n {\n if (in_array($this->request->action,['home','view','logout']))\n {\n return true;\n }\n }\n return parent::isAuthorized($user);\n }", "public function authorize()\n {\n $id = $this->route('auction_house');\n $user = \\Auth::user();\n $auctionHouse = \\App\\AuctionHouse::findOrFail($id);\n\n return $user\n && $auctionHouse->user_id !== $user->id;\n }", "public function showResourceMenu(User $auth)\n {\n return $auth->isSuper() || $auth->isAdmin() || $this->isAllowedFor($auth, 'fetch');\n }", "function can($action, $params=array()){\n $logger = Logger::getInstance();\n\n $user = false;\n if(isset($_SESSION['JR'])){\n //who is logged in.\n $user = $_SESSION['JR']->getUser();\n }\n\n //If someone is logged in\n if($user !== false){\n switch($action){\n case 'find':\n //IF searching for own address, return true;\n $ret = true;\n foreach($params[0] as $p){\n if($p[0] == \"person_id\"){\n if(count($p) == 2 && $p[1] == $user['person_id']) $ret = true && $ret;\n else if(count($p) == 3 && $p[2] == $user['person_id']) $ret = true && $ret;\n else $ret = false;\n }\n }\n if($ret) return true;\n //Otherwise let anyone but reviewers search addresses\n return $user['role_id'] != ROLE::REVIEWER;\n\n case 'read':\n //Let anyone but reviewers read addresses, except their own\n return $this->vals['person_id'] == $user['person_id'] || $user['role_id'] != ROLE::REVIEWER;\n break;\n case 'update':\n //A user can update their own address\n if($user['person_id'] == $this->person_id) return true;\n \n //Administrators and Editors can edit addresses\n return $user['role_id'] == ROLE::ADMINISTRATOR || $user['role_id'] == ROLE::EDITOR;\n break;\n case 'create':\n if($user['person_id'] == $params['person_id']) return true;\n case 'delete':\n //Administrators, Editors can create and delete\n return $user['role_id'] == ROLE::ADMINISTRATOR || $user['role_id'] == ROLE::EDITOR;\n break;\n }\n }\n\n $logger->log(\"Permission Denied!\",Logger::DEBUG,true);\n return false;\n\n\n }", "public function filter() {\n $value = null;\n\n if (func_num_args() > 2) {\n $args = func_get_args();\n $value = array_slice($args, 2)[0];\n }\n\n $userId = $this->getSessionUserId();\n\n if ($this->tokenParam !== false && is_null($userId)) {\n $token = $this->getAccessToken();\n\n if (!empty($token)) {\n $userId = call_user_func($this->getCallback(), $token);\n }\n }\n\n if (!empty($userId)) {\n $ret = $this->acl->isRouteAllowed($userId, $value);\n } else {\n $msg = ($this->tokenParam !== false) ? ' ' . trans('acl-manager-laravel::messages.token_not_found') : '.';\n throw new AclServerErrorException(trans('acl-manager-laravel::messages.userid_not_found') . $msg);\n }\n\n if (!$ret) {\n throw new AclPolicyException($value);\n }\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize()\n {\n $contact = $this->route('contact');\n\n return $contact->user_id == auth()->id() || user()->acl < 9;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "function CheckShowAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n if (preg_match('/^(Friend)$/',$this->Profile()))\n {\n if ($item[ \"Friend\" ]=$this->LoginData(\"ID\"))\n {\n $res=TRUE;\n }\n }\n\n return $res;\n }", "public function authorizeAction();", "abstract public function authorize();", "abstract public function authorize();", "public function show(Request $request, Person $person)\n {\n if($request->isJson())\n return response()->json($person, 200);\n\n return response()->json(['error' => 'Sin autorización'], 401, []);\n }", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "public function authorize()\n {\n $canAdd = Voyager::can('add_membercontacts');\n $canUpdate = Voyager::can('edit_membercontacts');\n if($canAdd && $canUpdate)\n {\n return true;\n }\n else\n {\n // fix this with redirection\n return false;\n }\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function show(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['show']);\n }\n }", "public function show($tname)\n {\n // $view = Auth::user()->id ;\n \n \n }", "public function displayperson() {\r\n if (isset($_GET['id'])) {\r\n $display = $this->model->displayPerson($_GET['id']);\r\n }\r\n return $this->view('/company/displayperson', $display);\r\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "function userCanViewPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageView(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "public function urlAuthorize() {\n return $this->api_location.\"/authorize\";\n }", "public function show($id)\n {\n if (Url::where('user_id', Auth::user()->id)) {\n $main = Url::find($id);\n return view('admin.urls.show', compact('main'));\n } else\n abort(403);\n }", "public function authorize()\n {\n return Auth::user()->type == 'admin';\n }", "public function authorize()\n {\n $user = \n return false;\n }", "public function getAuthorizationUri() : string\r\n {\r\n return $this->authorization_uri;\r\n }", "static protected function checkAccess()\n {\n $cur_user = User::getConnectedUser();\n if (!$cur_user || !$cur_user->canSeeInvitations()) {\n redirectTo('/');\n }\n return $cur_user;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }" ]
[ "0.6208289", "0.619818", "0.61616457", "0.6037186", "0.60190815", "0.591433", "0.58267933", "0.578252", "0.576901", "0.5762709", "0.5741984", "0.5741984", "0.5696148", "0.56688863", "0.5667511", "0.5658546", "0.5647978", "0.56392956", "0.5636935", "0.561792", "0.56166047", "0.56081516", "0.559889", "0.55955464", "0.5586525", "0.55834854", "0.55776757", "0.5559427", "0.5558692", "0.5557442", "0.5556453", "0.5535931", "0.5528954", "0.5498689", "0.5493978", "0.5428102", "0.54272693", "0.54194975", "0.5413014", "0.5396403", "0.5391417", "0.53812486", "0.5380613", "0.53785586", "0.5364035", "0.5363813", "0.53637946", "0.5354507", "0.5352696", "0.53490806", "0.5344451", "0.53426886", "0.5334989", "0.53310627", "0.5329563", "0.5313421", "0.5313421", "0.53121924", "0.53116745", "0.5307695", "0.5306079", "0.5301773", "0.52999634", "0.5296488", "0.5296423", "0.52959865", "0.52959865", "0.5292768", "0.52924174", "0.52924174", "0.5291774", "0.5291316", "0.52902526", "0.52888256", "0.5287479", "0.5286651", "0.5280572", "0.5280348", "0.52778226", "0.52690375", "0.5266732", "0.52598196", "0.52598196", "0.52557266", "0.524605", "0.5245811", "0.52448106", "0.5242383", "0.52404237", "0.5238772", "0.5230171", "0.5227984", "0.52267367", "0.5220979", "0.52198046", "0.5219145", "0.52188146", "0.5218243", "0.5217691", "0.52144736" ]
0.80825865
0
$url = "/character?name.first=" . $character_name . "&c:case=false&c:limit=1000&c:join=type:characters_world^list:0^inject_at:world^terms:world_id=17^outer:0,type:outfit_member_extended^list:0^inject_at:outfit_member^terms:outfit_id=37530159341115681^outer:0,type:faction^inject_at:faction";
public function getUserByName($character_name) { $url = "/character?name.first=" . $character_name . "&c:case=false&c:limit=1000&c:join=type:characters_world^list:0^inject_at:world^terms:world_id=17^outer:0,type:outfit_member_extended^list:0^inject_at:outfit_member^outer:0,type:faction^inject_at:faction"; $character = $this->query($url); if (!empty ($character->character_list [0])) { return $character->character_list [0]; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createURL($key_word, $tipo_pasto){\r\n $url = \"http://localhost:5028/rec/?q=\" . $key_word .'&';\r\n\r\n/*\r\n if($tipo_dieta == 'balanced')\r\n $url = $url . \"diet=balanced&\";\r\n if($tipo_dieta == 'high-protein')\r\n $url = $url . \"diet=high-protein&\";\r\n if($tipo_dieta == 'high-fiber')\r\n $url = $url . \"diet=high-fiber&\";\r\n if($tipo_dieta == 'low-carb')\r\n $url = $url . \"diet=low-carb&\";\r\n if($tipo_dieta == 'low-fat')\r\n $url = $url . \"diet=low-fat&\";\r\n if($tipo_dieta == 'low-sodium')\r\n $url = $url . \"diet=low-sodium&\";\r\n\r\n if($etichette_salutari == 'vegan')\r\n $url = $url . \"health=vegan&\" ;\r\n if($etichette_salutari == 'vegetarian')\r\n $url = $url . \"health=vegetarian&\" ;\r\n if($etichette_salutari == 'egg-free')\r\n $url = $url . \"health=egg-free&\" ;\r\n if($etichette_salutari == 'fish-free')\r\n $url = $url . \"health=fish-free&\" ;\r\n if($etichette_salutari == 'gluten-free')\r\n $url = $url . \"health=gluten-free&\" ;\r\n\r\n if($tipo_pasto == 'Breakfast')\r\n $url = $url.'mealType=Breakfast&';\r\n if($tipo_pasto == 'Launch')\r\n $url = $url.'mealType=Launch&';\r\n if($tipo_pasto == 'Dinner')\r\n $url = $url.'mealType=Dinner&';\r\n if($tipo_pasto == 'Sneak')\r\n $url = $url.'mealType=Sneak&';\r\n if($tipo_pasto == 'Teatime')\r\n $url = $url.'mealType=Teatime&';\r\n*/ \r\n if($tipo_pasto == 'Starter')\r\n \t$url = $url.'dishType=Starter&';\r\n if($tipo_pasto == 'Biscuits and cookies')\r\n $url = $url.'dishType=Biscuitsandcookies&';\r\n if($tipo_pasto == 'Bread')\r\n $url = $url.'dishType=Bread&';\r\n if($tipo_pasto == 'Cereals')\r\n $url = $url.'dishType=Cereals&';\r\n if($tipo_pasto == 'Condimentsandsauces')\r\n $url = $url.'dishType=Condimentsandsauces&';\r\n if($tipo_pasto == 'Desserts')\r\n $url = $url.'dishType=Desserts&';\r\n if($tipo_pasto == 'Egg')\r\n $url = $url.'dishType=Egg&';\r\n if($tipo_pasto == 'Main course')\r\n $url = $url.'dishType=Maincourse&';\r\n if($tipo_pasto == 'Omelet')\r\n $url = $url.'dishType=Omelet&';\r\n if($tipo_pasto == 'Pancake')\r\n $url = $url.'dishType=Pancake&';\r\n if($tipo_pasto == 'Preps')\r\n $url = $url.'dishType=Preps&';\r\n if($tipo_pasto == 'Preserve')\r\n $url = $url.'dishType=Preserve&';\r\n if($tipo_pasto == 'Salad')\r\n $url = $url.'dishType=Salad&';\r\n if($tipo_pasto == 'Sandwiches')\r\n $url = $url.'dishType=Sandwiches&';\r\n if($tipo_pasto == 'Soup')\r\n $url = $url.'dishType=Soup&';\r\n \r\n \r\n $url = $url . \"n=10&lang=en\";\r\n\r\n return $url;\r\n\r\n}", "function url($url){\n $url=ereg_replace(\"[&?]+$\", \"\", $url);\n \n $url .= ( strpos($url, \"?\") != false ? \"&\" : \"?\" ).urlencode($this->name).\"=\".$this->id;\n \n return $url;\n }", "function char_inv()\r\n{\r\n global $output, $realm_id, $characters_db, $world_db, $corem_db, $site_encoding,\r\n $action_permission, $user_lvl, $user_name, $locales_search_option, $base_datasite,\r\n $item_datasite, $sql, $core;\r\n\r\n // this page uses wowhead tooltops\r\n //wowhead_tt();\r\n\r\n $cid = $_GET[\"id\"];\r\n \r\n // we need at least an id or we would have nothing to show\r\n // also, make sure id is numeric to prevent SQL injection\r\n if ( ( empty($_GET[\"id\"]) ) || ( !is_numeric($cid) ) )\r\n error(lang(\"global\", \"empty_fields\"));\r\n\r\n // this is multi realm support, as of writing still under development\r\n // this page is already implementing it\r\n if ( empty($_GET[\"realm\"]) )\r\n $realmid = $realm_id;\r\n else\r\n {\r\n $realmid = $sql[\"logon\"]->quote_smart($_GET[\"realm\"]);\r\n if ( is_numeric($realmid) )\r\n $sql[\"char\"]->connect($characters_db[$realmid][\"addr\"], $characters_db[$realmid][\"user\"], $characters_db[$realmid][\"pass\"], $characters_db[$realmid][\"name\"], $characters_db[$realmid][\"encoding\"]);\r\n else\r\n $realmid = $realm_id;\r\n }\r\n\r\n //-------------------SQL Injection Prevention--------------------------------\r\n // no point going further if we don have a valid ID\r\n // this_is_junk: char.php doesn't post account. Why is this even here?\r\n //$acct = $sql[\"char\"]->quote_smart($_GET[\"acct\"]);\r\n //if (is_numeric($acct));\r\n //else error($lang_global[\"empty_fields\"]);\r\n\r\n // getting character data from database\r\n if ( $core == 1 )\r\n $result = $sql[\"char\"]->query(\"SELECT acct, name, race, class, level, gender, gold, online\r\n FROM characters WHERE guid='\".$cid.\"' LIMIT 1\");\r\n else\r\n $result = $sql[\"char\"]->query(\"SELECT account AS acct, name, race, class, level, gender, money AS gold, online\r\n FROM characters WHERE guid='\".$cid.\"' LIMIT 1\");\r\n\r\n // no point going further if character does not exist\r\n if ( $sql[\"char\"]->num_rows($result) )\r\n {\r\n $char = $sql[\"char\"]->fetch_assoc($result);\r\n\r\n // we get user permissions first\r\n $owner_acc_id = $sql[\"char\"]->result($result, 0, \"acct\");\r\n if ( $core == 1 )\r\n $query = $sql[\"logon\"]->query(\"SELECT login FROM accounts WHERE acct='\".$owner_acc_id.\"'\");\r\n else\r\n $query = $sql[\"logon\"]->query(\"SELECT username as login FROM account WHERE id='\".$owner_acc_id.\"'\");\r\n $owner_name = $sql[\"logon\"]->result($query, 0, \"login\");\r\n\r\n $s_query = \"SELECT *, SecurityLevel AS gm FROM config_accounts WHERE Login='\".$owner_name.\"'\";\r\n $s_result = $sql[\"mgr\"]->query($s_query);\r\n $s_fields = $sql[\"mgr\"]->fetch_assoc($s_result);\r\n $owner_gmlvl = $s_fields[\"gm\"];\r\n $view_mod = $s_fields[\"View_Mod_Inv\"];\r\n\r\n if ( $owner_gmlvl >= 1073741824 )\r\n $owner_gmlvl -= 1073741824;\r\n\r\n // owner configured overrides\r\n $view_override = false;\r\n if ( $view_mod > 0 )\r\n {\r\n if ( $view_mod == 1 )\r\n ;// TODO: Add friends limit\r\n elseif ( $view_mod == 2 )\r\n {\r\n // only registered users may view this page\r\n if ( $user_lvl > -1 )\r\n $view_override = true;\r\n }\r\n }\r\n\r\n // visibility overrides for specific tabs\r\n $view_talent_override = false;\r\n if ( $s_fields[\"View_Mod_Talent\"] > 0 )\r\n {\r\n if ( $s_fields[\"View_Mod_Talent\"] == 1 )\r\n ;// TODO: Add friends limit\r\n elseif ( $s_fields[\"View_Mod_Talent\"] == 2 )\r\n {\r\n // only registered users may view this tab\r\n if ( $user_lvl > -1 )\r\n $view_talent_override = true;\r\n }\r\n }\r\n else\r\n {\r\n if ( ( $user_lvl > $owner_gmlvl ) || ( $owner_name === $user_name ) || ( $user_lvl == $action_permission[\"delete\"] ) )\r\n $view_talent_override = true;\r\n }\r\n\r\n $view_achieve_override = false;\r\n if ( $s_fields[\"View_Mod_Achieve\"] > 0 )\r\n {\r\n if ( $s_fields[\"View_Mod_Achieve\"] == 1 )\r\n ;// TODO: Add friends limit\r\n elseif ( $s_fields[\"View_Mod_Achieve\"] == 2 )\r\n {\r\n // only registered users may view this tab\r\n if ( $user_lvl > -1 )\r\n $view_achieve_override = true;\r\n }\r\n }\r\n else\r\n {\r\n if ( ( $user_lvl > $owner_gmlvl ) || ( $owner_name === $user_name ) || ( $user_lvl == $action_permission[\"delete\"] ) )\r\n $view_achieve_override = true;\r\n }\r\n\r\n $view_quest_override = false;\r\n if ( $s_fields[\"View_Mod_Quest\"] > 0 )\r\n {\r\n if ( $s_fields[\"View_Mod_Quest\"] == 1 )\r\n ;// TODO: Add friends limit\r\n elseif ( $s_fields[\"View_Mod_Quest\"] == 2 )\r\n {\r\n // only registered users may view this tab\r\n if ( $user_lvl > -1 )\r\n $view_quest_override = true;\r\n }\r\n }\r\n else\r\n {\r\n if ( ( $user_lvl > $owner_gmlvl ) || ( $owner_name === $user_name ) || ( $user_lvl == $action_permission[\"delete\"] ) )\r\n $view_quest_override = true;\r\n }\r\n\r\n $view_friends_override = false;\r\n if ( $s_fields[\"View_Mod_Friends\"] > 0 )\r\n {\r\n if ( $s_fields[\"View_Mod_Friends\"] == 1 )\r\n ;// TODO: Add friends limit\r\n elseif ( $s_fields[\"View_Mod_Friends\"] == 2 )\r\n {\r\n // only registered users may view this tab\r\n if ( $user_lvl > -1 )\r\n $view_friends_override = true;\r\n }\r\n }\r\n else\r\n {\r\n if ( ( $user_lvl > $owner_gmlvl ) || ( $owner_name === $user_name ) || ( $user_lvl == $action_permission[\"delete\"] ) )\r\n $view_friends_override = true;\r\n }\r\n\r\n $view_view_override = false;\r\n if ( $s_fields[\"View_Mod_View\"] > 0 )\r\n {\r\n if ( $s_fields[\"View_Mod_View\"] == 1 )\r\n ;// TODO: Add friends limit\r\n elseif ( $s_fields[\"View_Mod_View\"] == 2 )\r\n {\r\n // only registered users may view this tab\r\n if ( $user_lvl > -1 )\r\n $view_view_override = true;\r\n }\r\n }\r\n else\r\n {\r\n if ( ( $user_lvl > $owner_gmlvl ) || ( $owner_name === $user_name ) || ( $user_lvl == $action_permission[\"delete\"] ) )\r\n $view_view_override = true;\r\n }\r\n\r\n // find out what mode we're in View or Delete (0 = View, 1 = Delete)\r\n $mode = ( ( isset($_GET[\"mode\"]) ) ? $_GET[\"mode\"] : 0 );\r\n // only the character's owner or a GM with Delete privs can enter Delete Mode\r\n if ( $owner_name != $user_name )\r\n if ( $user_lvl < $action_permission[\"delete\"] )\r\n $mode = 0;\r\n else\r\n $mode = $mode;\r\n\r\n // View Mode is only availble on characters that are offline\r\n if ( $char[\"online\"] != 0 )\r\n $mode = 0;\r\n\r\n // check user permission\r\n if ( ( $view_override ) || ( $user_lvl > $owner_gmlvl ) || ( $owner_name === $user_name ) || ( $user_lvl == $action_permission[\"delete\"] ) )\r\n {\r\n // main data that we need for this page, character inventory\r\n if ( $core == 1 )\r\n $result = $sql[\"char\"]->query(\"SELECT \r\n containerslot, slot, entry, enchantments AS enchantment, randomprop AS property, count, flags\r\n FROM playeritems WHERE ownerguid='\".$cid.\"' ORDER BY containerslot, slot\");\r\n elseif ( $core == 2 )\r\n $result = $sql[\"char\"]->query(\"SELECT \r\n bag, slot, item_template AS entry, item, \r\n SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 11), ' ', -1) AS creator,\r\n SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 23), ' ', -1) AS enchantment, \r\n SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 60), ' ', -1) AS property, \r\n SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 15), ' ', -1) AS count,\r\n SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 62), ' ', -1) AS durability,\r\n SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 22), ' ', -1) AS flags\r\n FROM character_inventory LEFT JOIN item_instance ON character_inventory.item=item_instance.guid\r\n WHERE character_inventory.guid='\".$cid.\"' ORDER BY bag, slot\");\r\n else\r\n $result = $sql[\"char\"]->query(\"SELECT \r\n bag, slot, itemEntry AS entry, item, \r\n creatorGuid AS creator,\r\n enchantments AS enchantment, \r\n randomPropertyId AS property, \r\n count, durability, flags\r\n FROM character_inventory \r\n LEFT JOIN item_instance ON character_inventory.item=item_instance.guid\r\n WHERE character_inventory.guid='\".$cid.\"' ORDER BY bag, slot\");\r\n\r\n //---------------Page Specific Data Starts Here--------------------------\r\n // lets start processing first before we display anything\r\n // we have lots to do for inventory\r\n\r\n // character bags, 1 main + 4 additional\r\n $bag = array\r\n (\r\n 0=>array(),\r\n 1=>array(),\r\n 2=>array(),\r\n 3=>array(),\r\n 4=>array()\r\n );\r\n\r\n // character bank, 1 main + 7 additional\r\n $bank = array\r\n (\r\n 0=>array(),\r\n 1=>array(),\r\n 2=>array(),\r\n 3=>array(),\r\n 4=>array(),\r\n 5=>array(),\r\n 6=>array(),\r\n 7=>array()\r\n );\r\n\r\n // this is where we will put items that are in main bag\r\n $bag_id = array();\r\n // this is where we will put items that are in main bank\r\n $bank_bag_id = array();\r\n // this is where we will put items that are in character bags, 4 arrays, 1 for each\r\n $equiped_bag_id = array(0, 0, 0, 0, 0);\r\n // this is where we will put items that are in bank bangs, 7 arrays, 1 for each\r\n $equip_bnk_bag_id = array(0, 0, 0, 0, 0, 0, 0, 0);\r\n // we load the things in each bag slot\r\n while ( $slot = $sql[\"char\"]->fetch_assoc($result) )\r\n {\r\n if ( $core == 1 )\r\n {\r\n if ( ( $slot[\"containerslot\"] == -1 ) && ( $slot[\"slot\"] > 18 ) )\r\n {\r\n if ( $slot[\"slot\"] < 23 ) // SLOT 19 TO 22 (Bags)\r\n {\r\n $bag_id[$slot[\"slot\"]] = ($slot[\"slot\"]-18);\r\n $equiped_bag_id[$slot[\"slot\"]-18] = array($slot[\"entry\"],\r\n $sql[\"world\"]->result($sql[\"world\"]->query(\"SELECT containerslots FROM items\r\n WHERE entry='\".$slot[\"entry\"].\"'\"), 0, \"containerslots\"), $slot[\"count\"]);\r\n }\r\n elseif ( $slot[\"slot\"] < 39 ) // SLOT 23 TO 38 (BackPack)\r\n {\r\n $i_query = \"SELECT \r\n *, description AS description1, name1 AS name, quality AS Quality, inventorytype AS InventoryType, \r\n socket_color_1 AS socketColor_1, socket_color_2 AS socketColor_2, socket_color_3 AS socketColor_3,\r\n requiredlevel AS RequiredLevel, allowableclass AS AllowableClass,\r\n sellprice AS SellPrice, itemlevel AS ItemLevel\r\n FROM items \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN items_localized ON (items_localized.entry=items.entry AND language_code='\".$locales_search_option.\"') \" : \" \" ).\r\n \"WHERE items.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n if ( isset($bag[0][$slot[\"slot\"]-23]) )\r\n $bag[0][$slot[\"slot\"]-23][0]++;\r\n else\r\n $bag[0][$slot[\"slot\"]-23] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n elseif ( $slot[\"slot\"] < 67 ) // SLOT 39 TO 66 (Bank)\r\n {\r\n $i_query = \"SELECT\r\n *, description AS description1, name1 AS name, quality AS Quality, inventorytype AS InventoryType, \r\n socket_color_1 AS socketColor_1, socket_color_2 AS socketColor_2, socket_color_3 AS socketColor_3,\r\n requiredlevel AS RequiredLevel, allowableclass AS AllowableClass,\r\n sellprice AS SellPrice, itemlevel AS ItemLevel\r\n FROM items \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN items_localized ON (items_localized.entry=items.entry AND language_code='\".$locales_search_option.\"') \" : \" \" ).\r\n \"WHERE items.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n $bank[0][$slot[\"slot\"]-39] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n elseif ( $slot[\"slot\"] < 74 ) // SLOT 67 TO 73 (Bank Bags)\r\n {\r\n $bank_bag_id[$slot[\"slot\"]] = ($slot[\"slot\"]-66);\r\n $equip_bnk_bag_id[$slot[\"slot\"]-66] = array($slot[\"entry\"], \r\n $sql[\"world\"]->result($sql[\"world\"]->query(\"SELECT containerslots FROM items\r\n WHERE entry='\".$slot[\"entry\"].\"'\"), 0, \"containerslots\"), $slot[\"count\"]);\r\n }\r\n }\r\n else\r\n {\r\n // Bags\r\n if ( isset($bag_id[$slot[\"containerslot\"]]) )\r\n {\r\n $i_query = \"SELECT\r\n *, description AS description1, name1 AS name, quality AS Quality, inventorytype AS InventoryType, \r\n socket_color_1 AS socketColor_1, socket_color_2 AS socketColor_2, socket_color_3 AS socketColor_3,\r\n requiredlevel AS RequiredLevel, allowableclass AS AllowableClass,\r\n sellprice AS SellPrice, itemlevel AS ItemLevel\r\n FROM items \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN items_localized ON (items_localized.entry=items.entry AND language_code='\".$locales_search_option.\"') \" : \" \" ).\r\n \"WHERE items.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n if ( isset($bag[$bag_id[$slot[\"containerslot\"]]][$slot[\"slot\"]]) )\r\n $bag[$bag_id[$slot[\"containerslot\"]]][$slot[\"slot\"]][1]++;\r\n else\r\n $bag[$bag_id[$slot[\"containerslot\"]]][$slot[\"slot\"]] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n // Bank Bags\r\n elseif ( isset($bank_bag_id[$slot[\"containerslot\"]]) )\r\n {\r\n $i_query = \"SELECT\r\n *, description AS description1, name1 AS name, quality AS Quality, inventorytype AS InventoryType, \r\n socket_color_1 AS socketColor_1, socket_color_2 AS socketColor_2, socket_color_3 AS socketColor_3,\r\n requiredlevel AS RequiredLevel, allowableclass AS AllowableClass,\r\n sellprice AS SellPrice, itemlevel AS ItemLevel\r\n FROM items \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN items_localized ON (items_localized.entry=items.entry AND language_code='\".$locales_search_option.\"') \" : \" \" ).\r\n \"WHERE items.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n $bank[$bank_bag_id[$slot[\"containerslot\"]]][$slot[\"slot\"]] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n if ( ( $slot[\"bag\"] == 0 ) && ( $slot[\"slot\"] > 18 ) )\r\n {\r\n if ( $slot[\"slot\"] < 23 ) // SLOT 19 TO 22 (Bags)\r\n {\r\n $bag_id[$slot[\"item\"]] = ($slot[\"slot\"]-18);\r\n $equiped_bag_id[$slot[\"slot\"]-18] = array($slot[\"entry\"],\r\n $sql[\"world\"]->result($sql[\"world\"]->query(\"SELECT ContainerSlots FROM item_template\r\n WHERE entry='\".$slot[\"entry\"].\"'\"), 0, \"containerslots\"), $slot[\"count\"]);\r\n }\r\n elseif ( $slot[\"slot\"] < 39 ) // SLOT 23 TO 38 (BackPack)\r\n {\r\n $i_query = \"SELECT *, description AS description1 FROM item_template \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN locales_item ON locales_item.entry=item_template.entry \" : \" \" ).\r\n \"WHERE item_template.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n if ( isset($bag[0][$slot[\"slot\"]-23]) )\r\n $bag[0][$slot[\"slot\"]-23][0]++;\r\n else\r\n $bag[0][$slot[\"slot\"]-23] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n elseif ( $slot[\"slot\"] < 67 ) // SLOT 39 TO 66 (Bank)\r\n {\r\n $i_query = \"SELECT *, description AS description1 FROM item_template \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN locales_item ON locales_item.entry=item_template.entry \" : \" \" ).\r\n \"WHERE item_template.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n $bank[0][$slot[\"slot\"]-39] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n elseif ( $slot[\"slot\"] < 74 ) // SLOT 67 TO 73 (Bank Bags)\r\n {\r\n $bank_bag_id[$slot[\"item\"]] = ($slot[\"slot\"]-66);\r\n $equip_bnk_bag_id[$slot[\"slot\"]-66] = array($slot[\"entry\"], \r\n $sql[\"world\"]->result($sql[\"world\"]->query('SELECT ContainerSlots FROM item_template\r\n WHERE entry = '.$slot[\"entry\"].''), 0, \"ContainerSlots\"), $slot[\"count\"]);\r\n }\r\n }\r\n else\r\n {\r\n // Bags\r\n if ( isset($bag_id[$slot[\"bag\"]]) )\r\n {\r\n $i_query = \"SELECT *, description AS description1 FROM item_template \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN locales_item ON locales_item.entry=item_template.entry \" : \" \" ).\r\n \"WHERE item_template.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n if ( isset($bag[$bag_id[$slot[\"bag\"]]][$slot[\"slot\"]]) )\r\n $bag[$bag_id[$slot[\"bag\"]]][$slot[\"slot\"]][1]++;\r\n else\r\n $bag[$bag_id[$slot[\"bag\"]]][$slot[\"slot\"]] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n // Bank Bags\r\n elseif ( isset($bank_bag_id[$slot[\"bag\"]]) )\r\n {\r\n $i_query = \"SELECT *, description AS description1 FROM item_template \"\r\n .( ( $locales_search_option != 0 ) ? \"LEFT JOIN locales_item ON locales_item.entry=item_template.entry \" : \" \" ).\r\n \"WHERE item_template.entry='\".$slot[\"entry\"].\"'\";\r\n\r\n $i_result = $sql[\"world\"]->query($i_query);\r\n $i = $sql[\"world\"]->fetch_assoc($i_result);\r\n\r\n $bank[$bank_bag_id[$slot[\"bag\"]]][$slot[\"slot\"]] = array($slot[\"entry\"], 0, $slot[\"count\"], $i, $slot[\"enchantment\"], $slot[\"property\"], $slot[\"creator\"], $slot[\"durability\"], $slot[\"flags\"], $slot[\"bag\"], $slot[\"slot\"]);\r\n }\r\n }\r\n }\r\n }\r\n unset($slot);\r\n unset($bag_id);\r\n unset($bank_bag_id);\r\n unset($result);\r\n\r\n //------------------------Character Tabs---------------------------------\r\n // we start with a lead of 10 spaces,\r\n // because last line of header is an opening tag with 8 spaces\r\n // keep html indent in sync, so debuging from browser source would be easy to read\r\n $output .= '\r\n <!-- start of char_inv.php -->\r\n <center>\r\n <div class=\"tab\">\r\n <ul>\r\n <li><a href=\"char.php?id='.$cid.'&amp;realm='.$realmid.'\">'.lang(\"char\", \"char_sheet\").'</a></li>';\r\n\r\n $output .= '\r\n <li class=\"selected\"><a href=\"char_inv.php?id='.$cid.'&amp;realm='.$realmid.'\">'.lang(\"char\", \"inventory\").'</a></li>';\r\n\r\n if ( $view_talent_override )\r\n $output .= '\r\n '.(($char[\"level\"] < 10) ? '' : '<li><a href=\"char_talent.php?id='.$cid.'&amp;realm='.$realmid.'\">'.lang(\"char\", \"talents\").'</a></li>').'';\r\n\r\n if ( $view_achieve_override )\r\n $output .= '\r\n <li><a href=\"char_achieve.php?id='.$cid.'&amp;realm='.$realmid.'\">'.lang(\"char\", \"achievements\").'</a></li>';\r\n\r\n if ( $view_quest_override )\r\n $output .= '\r\n <li><a href=\"char_quest.php?id='.$cid.'&amp;realm='.$realmid.'\">'.lang(\"char\", \"quests\").'</a></li>';\r\n\r\n if ( $view_friends_override )\r\n $output .= '\r\n <li><a href=\"char_friends.php?id='.$cid.'&amp;realm='.$realmid.'\">'.lang(\"char\", \"friends\").'</a></li>';\r\n\r\n if ( $view_view_override )\r\n $output .= '\r\n <li><a href=\"char_view.php?id='.$cid.'&amp;realm='.$realmid.'\">'.lang(\"char\", \"view\").'</a></li>';\r\n\r\n $output .= '\r\n </ul>\r\n </div>\r\n <div class=\"tab_content\">\r\n <font class=\"bold\">\r\n '.htmlentities($char[\"name\"], ENT_COMPAT, $site_encoding).' -\r\n <img src=\"img/c_icons/'.$char[\"race\"].'-'.$char[\"gender\"].'.gif\"\r\n onmousemove=\"oldtoolTip(\\''.char_get_race_name($char[\"race\"]).'\\', \\'old_item_tooltip\\')\" onmouseout=\"oldtoolTip()\" alt=\"\" />\r\n <img src=\"img/c_icons/'.$char[\"class\"].'.gif\"\r\n onmousemove=\"oldtoolTip(\\''.char_get_class_name($char[\"class\"]).'\\',\\'old_item_tooltip\\')\" onmouseout=\"oldtoolTip()\" alt=\"\" /> - '.lang(\"char\", \"level_short\").char_get_level_color($char[\"level\"]).'\r\n </font>\r\n <br />\r\n <br />\r\n <table class=\"lined\" id=\"ch_inv_bags\">\r\n <tr>';\r\n\r\n //---------------Page Specific Data Starts Here--------------------------\r\n\r\n // equipped bags\r\n for ( $i = 4; $i > 0; --$i )\r\n {\r\n $output .= '\r\n <th>';\r\n if ( $equiped_bag_id[$i] )\r\n {\r\n $output .= '\r\n <a href=\"'.$base_datasite.$item_datasite.$equiped_bag_id[$i][0].'\" target=\"_blank\">\r\n <img class=\"bag_icon\" src=\"'.get_item_icon($equiped_bag_id[$i][0]).'\" alt=\"\" />\r\n </a>\r\n '.lang(\"item\", \"bag\").' '.$i.'<br />\r\n <font class=\"small\">'.$equiped_bag_id[$i][1].' '.lang(\"item\", \"slots\").'</font>';\r\n }\r\n $output .= '\r\n </th>';\r\n }\r\n $output .= '\r\n </tr>\r\n <tr>';\r\n\r\n // equipped bag slots\r\n for ( $t = 4; $t > 0; --$t )\r\n {\r\n // this_is_junk: style left hardcoded because it's calculated.\r\n $output .= '\r\n <td align=\"center\">\r\n <div class=\"bag\" style=\"width: '.(4*43).'px; height: '.(ceil($equiped_bag_id[$t][1]/4)*41).'px;\">';\r\n $dsp = $equiped_bag_id[$t][1]%4;\r\n\r\n if ( $dsp )\r\n $output .= '\r\n <div class=\"no_slot\"></div>';\r\n\r\n foreach ( $bag[$t] as $pos => $item )\r\n {\r\n // this_is_junk: style left hardcoded because it's calculated.\r\n $item[2] = ( ( $item[2] == 1 ) ? '' : $item[2] );\r\n $output .= '\r\n <div class=\"bag_slot\" style=\"left: '.((($pos+$dsp)%4*43)+4).'px; top: '.((floor(($pos+$dsp)/4)*41)+4).'px;\">\r\n <a href=\"'.$base_datasite.$item_datasite.$item[0].'\" target=\"_blank\" onmouseover=\"ShowTooltip(this,\\'_b'.$t.'p'.$pos.(($pos+$dsp)%4*42).'x'.(floor(($pos+$dsp)/4)*41).'\\');\" onmouseout=\"HideTooltip(\\'_b'.$t.'p'.$pos.(($pos+$dsp)%4*42).'x'.(floor(($pos+$dsp)/4)*41).'\\');\">\r\n <img src=\"'.get_item_icon($item[0]).'\" alt=\"\" class=\"inv_icon\" />\r\n </a>';\r\n if ( $mode )\r\n $output .= '\r\n <div>\r\n <a href=\"char_inv.php?action=delete_item&amp;id='.$cid.'&amp;bag='.$item[9].'&amp;slot='.$item[10].'&amp;item='.$item[0].'&amp;mode='.$mode.'\">\r\n <img src=\"img/aff_cross.png\" class=\"ch_inv_delete\" alt=\"\" />\r\n </a>\r\n </div>';\r\n else\r\n $output .= '\r\n <div class=\"ch_inv_quantity_shadow\">'.$item[2].'</div>\r\n <div class=\"ch_inv_quantity\">'.$item[2].'</div>';\r\n $output .= '\r\n </div>';\r\n // build a tooltip object for this item\r\n $output .= '\r\n <div class=\"item_tooltip\" id=\"tooltip_b'.$t.'p'.$pos.(($pos+$dsp)%4*42).'x'.(floor(($pos+$dsp)/4)*41).'\" style=\"left: '.((($pos+$dsp)%4*42)-129).'px; top: '.((floor(($pos+$dsp)/4)*41)+42).'px;\">\r\n <table>\r\n <tr>\r\n <td>'.get_item_tooltip($item[3], $item[4], $item[5], $item[6], $item[7], $item[8]).'</td>\r\n </tr>\r\n </table>\r\n </div>';\r\n }\r\n $output .= '\r\n </div>\r\n </td>';\r\n }\r\n unset($equiped_bag_id);\r\n // this_is_junk: style left hardcoded because it's calculated.\r\n $output .= '\r\n </tr>\r\n <tr>\r\n <th colspan=\"2\" align=\"left\">\r\n <img class=\"bag_icon\" src=\"'.get_item_icon(3960).'\" alt=\"\" align=\"middle\" id=\"ch_backpack_icon_margin\" />\r\n <font id=\"ch_backpack_name_margin\">'.lang(\"char\", \"backpack\").'</font>\r\n </th>\r\n <th colspan=\"2\">\r\n '.lang(\"char\", \"bank_items\").'\r\n </th>\r\n </tr>\r\n <tr>\r\n <td colspan=\"2\" align=\"center\" height=\"220px\">\r\n <div class=\"bag\" style=\"width: '.(4*43).'px; height: '.(ceil(16/4)*41).'px;\">';\r\n\r\n // inventory items\r\n foreach ( $bag[0] as $pos => $item )\r\n {\r\n // this_is_junk: style left hardcoded because it's calculated.\r\n $item[2] = ( ( $item[2] == 1 ) ? '' : $item[2] );\r\n $output .= '\r\n <div class=\"bag_slot\" style=\"left: '.(($pos%4*43)+4).'px; top: '.((floor($pos/4)*41)+4).'px;\">\r\n <a href=\"'.$base_datasite.$item_datasite.$item[0].'\" target=\"_blank\" onmouseover=\"ShowTooltip(this,\\'_b'.$t.'p'.$pos.($pos%4*42).'x'.(floor($pos/4)*41).'\\');\" onmouseout=\"HideTooltip(\\'_b'.$t.'p'.$pos.($pos%4*42).'x'.(floor($pos/4)*41).'\\');\">\r\n <img src=\"'.get_item_icon($item[0]).'\" class=\"inv_icon\" alt=\"\" />\r\n </a>';\r\n if ( $mode )\r\n $output .= '\r\n <div>\r\n <a href=\"char_inv.php?action=delete_item&amp;id='.$cid.'&amp;bag='.$item[9].'&amp;slot='.$item[10].'&amp;item='.$item[0].'&amp;mode='.$mode.'\">\r\n <img src=\"img/aff_cross.png\" class=\"ch_inv_delete\" alt=\"\" />\r\n </a>\r\n </div>';\r\n else\r\n $output .= '\r\n <div class=\"ch_inv_quantity_shadow\">'.$item[2].'</div>\r\n <div class=\"ch_inv_quantity\">'.$item[2].'</div>';\r\n $output .= '\r\n </div>';\r\n // build a tooltip object for this item\r\n $output .= '\r\n <div class=\"item_tooltip\" id=\"tooltip_b'.$t.'p'.$pos.($pos%4*42).'x'.(floor($pos/4)*41).'\" style=\"left: '.(($pos%4*42)-129).'px; top: '.((floor($pos/4)*41)+42).'px;\">\r\n <table>\r\n <tr>\r\n <td>'.get_item_tooltip($item[3], $item[4], $item[5], $item[6], $item[7], $item[8]).'</td>\r\n </tr>\r\n </table>\r\n </div>';\r\n }\r\n unset($bag);\r\n $output .= '\r\n </div>\r\n <div id=\"ch_money\">\r\n <b>\r\n '.substr($char[\"gold\"], 0, -4).'<img src=\"img/gold.gif\" alt=\"\" align=\"middle\" />\r\n '.substr($char[\"gold\"], -4, 2).'<img src=\"img/silver.gif\" alt=\"\" align=\"middle\" />\r\n '.substr($char[\"gold\"], -2).'<img src=\"img/copper.gif\" alt=\"\" align=\"middle\" />\r\n </b>\r\n </div>\r\n </td>\r\n <td colspan=\"2\" align=\"center\">\r\n <div class=\"bag bank\" style=\"width: '.((7*43)+2).'px; height: '.(ceil(24/7)*41).'px;\">';\r\n\r\n // bank items\r\n foreach ( $bank[0] as $pos => $item )\r\n {\r\n // this_is_junk: style left hardcoded because it's calculated.\r\n $item[2] = ( ( $item[2] == 1 ) ? '' : $item[2] );\r\n $output .= '\r\n <div class=\"bag_slot\" style=\"left: '.(($pos%7*43)+4).'px; top: '.((floor($pos/7)*41)+4).'px;\">\r\n <a href=\"'.$base_datasite.$item_datasite.$item[0].'\" target=\"_blank\" onmouseover=\"ShowTooltip(this,\\'_bbp'.$pos.($pos%7*43).'x'.(floor($pos/7)*41).'\\');\" onmouseout=\"HideTooltip(\\'_bbp'.$pos.($pos%7*43).'x'.(floor($pos/7)*41).'\\');\">\r\n <img src=\"'.get_item_icon($item[0]).'\" class=\"inv_icon\" alt=\"\" />\r\n </a>';\r\n if ( $mode )\r\n $output .= '\r\n <div>\r\n <a href=\"char_inv.php?action=delete_item&amp;id='.$cid.'&amp;bag='.$item[9].'&amp;slot='.$item[10].'&amp;item='.$item[0].'&amp;mode='.$mode.'\">\r\n <img src=\"img/aff_cross.png\" class=\"ch_inv_delete\" alt=\"\" />\r\n </a>\r\n </div>';\r\n else\r\n $output .= '\r\n <div class=\"ch_inv_quantity_shadow\">'.$item[2].'</div>\r\n <div class=\"ch_inv_quantity\">'.$item[2].'</div>';\r\n $output .= '\r\n </div>';\r\n // build a tooltip object for this item\r\n $output .= '\r\n <div class=\"item_tooltip\" id=\"tooltip_bbp'.$pos.($pos%7*43).'x'.(floor($pos/7)*41).'\" style=\"left: '.(($pos%7*43)-129).'px; top: '.((floor($pos/7)*41)+42).'px;\">\r\n <table>\r\n <tr>\r\n <td>'.get_item_tooltip($item[3], $item[4], $item[5], $item[6], $item[7], $item[8]).'</td>\r\n </tr>\r\n </table>\r\n </div>';\r\n }\r\n $output .= '\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>';\r\n\r\n // equipped bank bags, first 4\r\n for ( $i = 1; $i < 5; ++$i )\r\n {\r\n $output .= '\r\n <th>';\r\n if ( $equip_bnk_bag_id[$i] )\r\n {\r\n $output .= '\r\n <a href=\"'.$base_datasite.$item_datasite.$equip_bnk_bag_id[$i][0].'\" target=\"_blank\">\r\n <img class=\"bag_icon\" src=\"'.get_item_icon($equip_bnk_bag_id[$i][0]).'\" alt=\"\" />\r\n </a>\r\n '.lang(\"item\", \"bag\").' '.$i.'<br />\r\n <font class=\"small\">'.$equip_bnk_bag_id[$i][1].' '.lang(\"item\", \"slots\").'</font>';\r\n }\r\n $output .= '\r\n </th>';\r\n }\r\n $output .= '\r\n </tr>\r\n <tr>';\r\n\r\n // equipped bank bag slots\r\n for ( $t = 1; $t < 8; ++$t )\r\n {\r\n // equipped bank bags, last 3\r\n if ( $t === 5 )\r\n {\r\n $output .= '\r\n </tr>\r\n <tr>';\r\n for ( $i = 5; $i < 8; ++$i )\r\n {\r\n $output .= '\r\n <th>';\r\n if ( $equip_bnk_bag_id[$i] )\r\n {\r\n $output .= '\r\n <a href=\"'.$base_datasite.$item_datasite.$equip_bnk_bag_id[$i][0].'\" target=\"_blank\">\r\n <img class=\"bag_icon\" src=\"'.get_item_icon($equip_bnk_bag_id[$i][0]).'\" alt=\"\" />\r\n </a>\r\n '.lang(\"item\", \"bag\").' '.$i.'<br />\r\n <font class=\"small\">'.$equip_bnk_bag_id[$i][1].' '.lang(\"item\", \"slots\").'</font>';\r\n }\r\n $output .= '\r\n </th>';\r\n }\r\n $output .= '\r\n <th>\r\n </th>\r\n </tr>\r\n <tr>';\r\n }\r\n // this_is_junk: style left hardcoded because it's calculated.\r\n $output .= '\r\n <td align=\"center\">\r\n <div class=\"bag bank\" style=\"width: '.((4*43)+2).'px; height: '.(ceil($equip_bnk_bag_id[$t][1]/4)*41).'px;\">';\r\n $dsp = $equip_bnk_bag_id[$t][1]%4;\r\n if ( $dsp )\r\n $output .= '\r\n <div class=\"no_slot\"></div>';\r\n foreach ( $bank[$t] as $pos => $item )\r\n {\r\n // this_is_junk: style left hardcoded because it's calculated.\r\n $item[2] = ( ( $item[2] == 1 ) ? '' : $item[2] );\r\n $output .= '\r\n <div class=\"bag_slot\" style=\"left: '.((($pos+$dsp)%4*43)+4).'px; top: '.((floor(($pos+$dsp)/4)*41)+4).'px;\">\r\n <a href=\"'.$base_datasite.$item_datasite.$item[0].'\" target=\"_blank\" onmouseover=\"ShowTooltip(this,\\'_bb'.$t.'p'.$pos.(($pos+$dsp)%4*43).'x'.(floor(($pos+$dsp)/4)*41).'\\');\" onmouseout=\"HideTooltip(\\'_bb'.$t.'p'.$pos.(($pos+$dsp)%4*43).'x'.(floor(($pos+$dsp)/4)*41).'\\');\">\r\n <img src=\"'.get_item_icon($item[0]).'\" class=\"inv_icon\" alt=\"\" />\r\n </a>';\r\n if ( $mode )\r\n $output .= '\r\n <div>\r\n <a href=\"char_inv.php?action=delete_item&amp;id='.$cid.'&amp;bag='.$item[9].'&amp;slot='.$item[10].'&amp;item='.$item[0].'&amp;mode='.$mode.'\">\r\n <img src=\"img/aff_cross.png\" class=\"ch_inv_delete\" alt=\"\" />\r\n </a>\r\n </div>';\r\n else\r\n $output .= '\r\n <div class=\"ch_inv_quantity_shadow\">'.$item[2].'</div>\r\n <div class=\"ch_inv_quantity\">'.$item[2].'</div>';\r\n $output .= '\r\n </div>';\r\n // build a tooltip object for this item\r\n $output .= '\r\n <div class=\"item_tooltip\" id=\"tooltip_bb'.$t.'p'.$pos.(($pos+$dsp)%4*43).'x'.(floor(($pos+$dsp)/4)*41).'\" style=\"left: '.((($pos+$dsp)%4*43)-129).'px; top: '.((floor(($pos+$dsp)/4)*41)+42).'px;\">\r\n <table>\r\n <tr>\r\n <td>'.get_item_tooltip($item[3], $item[4], $item[5], $item[6], $item[7], $item[8]).'</td>\r\n </tr>\r\n </table>\r\n </div>';\r\n }\r\n\r\n $output .= '\r\n </div>\r\n </td>';\r\n }\r\n unset($equip_bnk_bag_id);\r\n unset($bank);\r\n $output .= '\r\n <td><div class=\"bag bank\"></div></td>';\r\n //---------------Page Specific Data Ends here----------------------------\r\n //---------------Character Tabs Footer-----------------------------------\r\n $output .= '\r\n </tr>\r\n </table>\r\n </div>\r\n <br />\r\n <table class=\"hidden\">\r\n <tr>\r\n <td>';\r\n // button to user account page, user account page has own security\r\n makebutton(lang(\"char\", \"chars_acc\"), 'user.php?action=edit_user&amp;id='.$owner_acc_id.'', 130);\r\n $output .= '\r\n </td>\r\n <td>';\r\n\r\n // show Delete Mode / View Mode button depending on current mode\r\n if ( $mode )\r\n makebutton(lang(\"char\", \"viewmode\"), 'char_inv.php?id='.$cid.'&amp;realm='.$realmid.'&amp;mode=0\" type=\"def', 130);\r\n else\r\n makebutton(lang(\"char\", \"deletemode\"), 'char_inv.php?id='.$cid.'&amp;realm='.$realmid.'&amp;mode=1\" type=\"def', 130);\r\n $output .= '\r\n </td>\r\n <td>';\r\n // only higher level GM with delete access can edit character\r\n // character edit allows removal of character items, so delete permission is needed\r\n if ( ( $user_lvl > $owner_gmlvl ) && ( $user_lvl >= $action_permission[\"delete\"] ) )\r\n {\r\n //makebutton($lang_char[\"edit_button\"], 'char_edit.php?id='.$cid.'&amp;realm='.$realmid.'', 130);\r\n $output .= '\r\n </td>\r\n <td>';\r\n }\r\n // only higher level GM with delete access, or character owner can delete character\r\n if ( ( ($user_lvl > $owner_gmlvl) && ($user_lvl >= $action_permission[\"delete\"]) ) || ($owner_name === $user_name) )\r\n {\r\n makebutton(lang(\"char\", \"del_char\"), 'char_list.php?action=del_char_form&amp;check%5B%5D='.$cid.'\" type=\"wrn', 130);\r\n $output .= '\r\n </td>\r\n <td>';\r\n }\r\n // only GM with update permission can send mail, mail can send items, so update permission is needed\r\n if ( $user_lvl >= $action_permission[\"update\"] )\r\n {\r\n makebutton(lang(\"char\", \"send_mail\"), 'mail.php?type=ingame_mail&amp;to='.$char[\"name\"].'', 130);\r\n $output .= '\r\n </td>\r\n <td>';\r\n }\r\n makebutton(lang(\"global\", \"back\"), 'javascript:window.history.back()\" type=\"def', 130);\r\n $output .= '\r\n </td>\r\n </tr>\r\n </table>\r\n <br />\r\n </center>\r\n <!-- end of char_inv.php -->';\r\n }\r\n else\r\n error(lang(\"char\", \"no_permission\"));\r\n }\r\n else\r\n error(lang(\"char\", \"no_char_found\"));\r\n\r\n}", "private function createURL($difficulty, $url) {\n\t\t\t$wordLength;\n\t\t\tswitch($difficulty) {\n\t\t\t\tcase(\"easy\"):\n\t\t\t\t$minLength = 3;\n\t\t\t\t$maxLength = 4;\n\t\t\t\tbreak;\n\t\t\t\tcase(\"medium\"):\n\t\t\t\t$minLength = 5;\n\t\t\t\t$maxLength = 7;\n\t\t\t\tbreak;\n\t\t\t\tcase(\"hard\"):\n\t\t\t\t$minLength = 8;\n\t\t\t\t$maxLength = 10;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$url = $url . \"lettersMin=\" . $minLength . \"&lettersMax=\" . $maxLength;\n\t\t\treturn $url;\n\t\t}", "protected function _build_url() {\n\n $params = array_filter([\n 'name' => $this->_names,\n 'country_id' => $this->_country_id,\n 'language_id' => $this->_language_id,\n ], function($v) {\n if (!is_array($v)) {\n return strlen(trim($v)) > 0;\n } else {\n return $v;\n }\n });\n //Only pass apikey if there is one set\n if ($api_key = $this->get_api_key()) {\n $params['apikey'] = trim($api_key);\n }\n\n return self::BASE . '?' . http_build_query($params);\n }", "function GetCRMURL($spec,$vars,$url)\n{\n $bad = false;\n $list = explode(\",\",$spec);\n\t$map = array();\n for ($ii = 0 ; $ii < count($list) ; $ii++)\n {\n $name = $list[$ii];\n if ($name)\n {\n //\n // the specification must be in this format:\n // form-field-name:CRM-field-name\n //\n if (($i_crm_name_pos = strpos($name,\":\")) > 0)\n {\n $s_crm_name = substr($name,$i_crm_name_pos + 1);\n $name = substr($name,0,$i_crm_name_pos);\n\t\t\t\tif (isset($vars[$name]))\n\t\t\t\t{\n\t\t\t\t\t$map[] = $s_crm_name.\"=\".urlencode($vars[$name]);\n\t\t\t\t\t$map[] = \"Orig_\".$s_crm_name.\"=\".urlencode($name);\n\t\t\t\t}\n }\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t//\n\t\t\t\t\t// not the right format, so just include as a parameter\n\t\t\t\t\t// check for name=value format to choose encoding\n\t\t\t\t\t//\n\t\t\t\t$a_values = explode(\"=\",$name);\n\t\t\t\tif (count($a_values) > 1)\n\t\t\t\t\t$map[] = urlencode($a_values[0]).\"=\".urlencode($a_values[1]);\n\t\t\t\telse\n\t\t\t\t\t$map[] = urlencode($a_values[0]);\n\t\t\t}\n }\n }\n\tif (count($map) == 0)\n\t\treturn (\"\");\n\tif (strpos($url,'?') === false)\t// append ? if not present\n\t\t$url .= '?';\n\treturn ($url.implode(\"&\",$map));\n}", "public function testGetCharacters()\n {\n $response = $this->get('/api/characters');\n $response->assertStatus(200);\n\n $response = $this->get('/api/characte');\n $response->assertStatus(404);\n\n $response = $this->get('/api/characters/?name=odes');\n $response->assertStatus(200);\n\n $response = $this->get('/api/characters/?name=123');\n $response->assertStatus(404);\n }", "function append_random( &$sUrl, $nLon=1 )\n{\n $sSep = '&';\n if( strpos($sUrl,'?') ===false )\n {\n $sSep = '?';\n }\n $sUrl .= $sSep.'rnd='.STRING::get_random($nLon);\n}", "private function _getURL()\n {\n\n $url = $this->_ect . '?';\n foreach ($this as $name => $var) {\n if ($name == 'ect') {\n continue;\n }\n $url .= \"$name=$var&\";\n }\n\n $this->url = $url;\n\n return $this->url;\n }", "function papi_include_query_strings( $first_character = '?', array $allowed_keys = [] ) {\n\tif ( empty( $allowed_keys ) ) {\n\t\treturn '';\n\t}\n\n\t$include = array_intersect_key( $_GET, array_flip( $allowed_keys ) );\n\n\tif ( empty( $include ) ) {\n\t\treturn '';\n\t}\n\n\treturn $first_character . http_build_query( $include );\n}", "function createurl($type, $params=array()){\n\t$page=(isset($params[\"page\"]))? (($params[\"page\"]>1)? \"page\".$params[\"page\"].\"/\" : \"\"): \"\";\n\t//set the hidden type to hidden only if the passed value is set and equal to show\n\t$hidden=(isset($params['hidden']) && $params['hidden']=='show')? 'hidden/' : '';\n\t$base=\"http://collabor8r.com/\";\n\tswitch($type){\n\t\tcase \"user\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/\".$hidden.$page;\n\t\tcase \"classes\":\n\t\t\treturn $base.\"classes/\";\n\t\tcase \"classessummary\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\";\n\t\tcase \"classesall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/all/\".$hidden.$page;\n\t\tcase \"classesstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/stories/\".$hidden.$page;\n\t\tcase \"classescomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/comments/\".$hidden.$page;\n\t\tcase \"classsummary\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/\";\n\t\tcase \"classall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/all/\".$hidden.$page;\n\t\tcase \"classstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/stories/\".$hidden.$page;\n\t\tcase \"classcomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/comments/\".$hidden.$page;\n\t\tcase \"classmember\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/classes/\".$params[\"classid\"].\"/classmember/\".$id[\"classmemberid\"].\"/\".$hidden.$page;\n\t\tcase \"feedall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/feed/\".$hidden.$page;\n\t\tcase \"feedstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/feed/stories/\".$hidden.$page;\n\t\tcase \"feedcomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/feed/comments/\".$hidden.$page;\n\t\tcase \"followingall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/following/\".$hidden.$page;\n\t\tcase \"followingstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/following/stories/\".$hidden.$page;\n\t\tcase \"followingcomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/following/comments/\".$hidden.$page;\n\t\tcase \"users\":\n\t\t\treturn $base.'users/';\n\t\tcase \"userall\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/all/\".$hidden.$page;\n\t\tcase \"userstories\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/stories/\".$hidden.$page;\n\t\tcase \"usercomments\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/comments/\".$hidden.$page;\n\t\tcase \"external\":\n\t\t\treturn $params[\"link\"];\n\t\tcase \"storylink\":\n\t\t\treturn $base.\"stories/\".$params[\"link\"].\"/\";\n\t\tcase \"options\":\n\t\t\treturn $base.\"users/\".$params[\"username\"].\"/options/\";\n\t\tcase \"submissions\":\n\t\t\treturn $base.$hidden.$page;\n\t\tcase \"tos\":\n\t\t\treturn $base.\"terms/\";\n\t\tcase \"404\":\n\t\t\treturn $base.\"404/\";\n\t\tcase \"403\":\n\t\t\treturn $base.\"403/\";\n\t\tcase \"info\":\n\t\t\treturn $base.$params[\"type\"].\"/\";\n\t\tcase 'search':\n\t\t\treturn $base.'search/';\n\t\tcase 'base':\n\t\t\treturn $base;\n\t\tdefault:\n\t\t\treturn $base.\"404/\";\n\t}//end switch type\n}", "function cldcwhitehallURL() {\n return \"./?page=cl_dc_whitehall\";\n}", "function city_name(){\n\tif(isset($_GET[\"expansion\"])){\n\t\treturn ucwords(str_replace(\"-\", \" \", $_GET[\"expansion\"]));\n\t}else{\n\t\treturn \"\";\n\t}\n}", "function short($urlf){\r\n\t\r\n$url = file_get_contents(\"http://migre.me/api.txt?url=$urlf\");\r\necho $url;\r\n}", "function buildUrl($parts=array()){\r\n\t$uparts=array();\r\n\tforeach($parts as $key=>$val){\r\n\t\tif(preg_match('/^(PHPSESSID|GUID|debug|error|username|password|add_result|domain_href|add_id|add_table|edit_result|edit_id|edit_table|)$/i',$key)){continue;}\r\n\t\tif(preg_match('/^\\_(login|pwe|try|formfields|action|view|formname|enctype|fields|csuid|csoot)$/i',$key)){continue;}\r\n\t\tif(!is_string($val) && !isNum($val)){continue;}\r\n\t\tif(!strlen(trim($val))){continue;}\r\n\t\tif($val=='Array'){continue;}\r\n\t\tarray_push($uparts,\"$key=\" . encodeURL($val));\r\n \t}\r\n $url=implode('&',$uparts);\r\n return $url;\r\n\t}", "function get_final_url($xid){\n\t$base_url = 'http://www.swarthmore.edu/';\n\t$url = $base_url . $xid; \n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_AUTOREFERER, 1);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 5);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30);\n\tcurl_exec ($ch);\n\treturn str_replace($base_url, '', curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));\n}", "function getURL($url, $prams)\n {\n return $url . '?' . http_build_query($prams);\n }", "private function getUrlRequests(): string\n {\n $arrRequests = [];\n if ('' != $this->states['title']) {\n $arrRequests[] = 'title=' . $this->states['title'];\n }\n // if(''!=$this->states['action']) $arrRequests[]='action='.$this->states['action'];\n return implode('&', $arrRequests);\n }", "function zg_ai_web_request($bot, string $screen, $arg1 = '') {\n global $game, $base_url;\n\n $uri = $base_url . \"/$game/$screen/{$bot->phone_id}\";\n if (strlen($arg1)) {\n $uri .= \"/$arg1\";\n }\n\n// if (($screen != 'home') &&\n// ($screen != 'debates_challenge') &&\n// ($screen != 'land')) {\n $ai_out = \"web-req: $screen/{$bot->phone_id}/$arg1\";\n// }\n\n $response = file_get_contents($uri);\n $ai_response_start = strpos($response, \"\\n<ai \") + 5;\n\n if ($ai_response_start > 5) {\n $ai_response_end = strpos($response, \"/>\\n\", $ai_response_start);\n $ai_response = trim(substr($response, $ai_response_start,\n $ai_response_end - $ai_response_start));\n }\n else {\n $ai_response = $response;\n }\n\n if (($screen != 'home')) {\n// ($screen != 'land-o')) {\n zg_ai_out($ai_out . \", response: $ai_response\");\n }\n\n return zg_ai_data_type([\n trim(str_replace('\"', '', $ai_response))\n ]);\n}", "function urlencode_1738_plus($url) {\n\t$uri = '';\n\n\t# nom de domaine accentué ?\n\tif (preg_match(',^https?://[^/]*,u', $url, $r)) {\n\t\t\n\t}\n\n\t$l = strlen($url);\n\tfor ($i=0; $i < $l; $i++) {\n\t\t$u = ord($a = $url[$i]);\n\t\tif ($u <= 0x20 OR $u >= 0x7F OR in_array($a, array(\"'\",'\"')))\n\t\t\t$a = rawurlencode($a);\n\t\t// le % depend : s'il est suivi d'un code hex, ou pas\n\t\tif ($a == '%'\n\t\tAND !preg_match('/^[0-9a-f][0-9a-f]$/i', $url[$i+1].$url[$i+2]))\n\t\t\t$a = rawurlencode($a);\n\t\t$uri .= $a;\n\t}\n\treturn quote_amp($uri);\n}", "function buildUrl($action, $credentials, $params) {\n $query = http_build_query(array_merge($credentials, $params));\n return \"https://m2web.talk2m.com/t2mapi/\" . $action . \"?\" . $query;\n}", "function Character($uid) {\r\n\t\tglobal $CONFIG, $gameinstance, $moduleinstance;\r\n\t\tdb(__FILE__,__LINE__,\"select char_check from ${gameinstance}_characters where login_id = '$uid'\");\r\n\t\t$created = dbr();\r\n\t\tif($created['char_check'] < 1 && $_GET['op_c'] != \"create\" && $_POST['op'] != \"race\" && $_POST['op'] != \"class\" && $_POST['op'] != \"class2\" && $_POST['op'] != \"save_skills\" && $_POST['op'] != \"finalise\") \r\n\t\t{\t\r\n\t\techo(\"<script>self.location='$CONFIG[url_prefix]/core/character_create.php?op_c=create';</script>\");\r\n\t\t}\r\n\t}", "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}", "function buildLinkWithQueryString($userName, $firstName, $lastName, $email) {\t\n\t$linkWithQueryString = 'index.php?userName=' . $userName . '&firstName=' . $firstName . '&lastName=' . $lastName . \n\t'&email=' . $email;\t\n\treturn $linkWithQueryString;\t\t\n}", "private function url_params()\n {\n return \"?user={$this->login}&password={$this->password}&answer=json\";\n }", "function toSab($url,$cat = NULL,$title = NULL)\r\n{\r\n\r\n\t$config = config();\r\n\r\n\t$url = urlencode($url);\r\n\r\n\tif ($cat != NULL)\r\n\t{\r\n\t\t$cat = '&cat='.$cat;\r\n\t}\r\n\r\n\tif ($title != NULL)\r\n\t{\r\n\t\t$title = '&nzbname='.$title;\r\n\t}\r\n\r\n\t$toSab = $config['sabAddress'].'/api?mode=addurl&name='.$url.'&pp=3'.$cat.'&priority=-1'.$title.'&apikey='.$config['sabApiKey'];\r\n\r\n\t$send = file_get_contents($toSab);\r\n\r\n\techo $send;\r\n\r\n}", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "function mk_Characterlink($val, $arr_cNames, $txt='', $key='', $newStr='' ){\n#make text field an array\n\t$arr_words = explode(\"\\n\", $val);\n\t#dumpDie($arr_words);\n\n\t#chek each word in string for match\n\tforeach($arr_words as $word) {\n\t\t#save for later replace\n\t\t$original = $word;\n\n\t\t$txt = preg_replace('/^.*(\\(.*\\)).*$/', '$1', $word);\n\t\t#chek for parens and text between them....\n\t\t$txt = preg_replace('/\\(|\\)/', '', $txt);\n\n\t\t#pred for search\n\t\tif (strpos($word, ' - ') !== false) {\n\t\t\t$word = substr($word, 0, strpos($word, ' - '));\n\t\t}\n\t\t$word = preg_replace('#\\s*\\(.+\\)\\s*#U', ' ', $word);\n\n\t\t#check for white space before and after...\n\t\t$word = ltrim($word);\n\t\t$word = rtrim($word);\n\n\t\t#check for white space before and after...\n\t\t$txt = ltrim($txt);\n\t\t$txt = rtrim($txt);\n\n\t\t#var_dump($word);\n\t\t#var_dump($txt);\n\n\t\t#if match make link...\n\t\tif(in_array($word, $arr_cNames) ){\n\t\t#dumpDie($word);\n\t\t\t#cID of character\n\t\t\t$key = array_search($word, $arr_cNames);\n\n\t\t\t#make link\n\t\t\t$link = '<a href=\"'\n\t\t\t\t. VIRTUAL_PATH . 'characters/profile.php?CodeName='\n\t\t\t\t. $word . '&id='\n\t\t\t\t. $key . '&act=show\"\n\t\t\t\ttarget=\"_blank\" data-toggle=\"tooltip\"\n\t\t\t\ttitle=\"'\n\t\t\t\t. $word . '!\"\">'\n\t\t\t\t. $word . '</a>';\n\n\t\t\t$newStr .= str_replace($word, $link, $original) . '<br />';\n\n\t\t}else if(in_array($txt, $arr_cNames) ){\n\t\t#dumpDie($word);\n\t\t\t#cID of character\n\t\t\t$key = array_search($word, $arr_cNames);\n\n\t\t\t#make link\n\t\t\t$link = '<a href=\"'\n\t\t\t\t. VIRTUAL_PATH . 'characters/profile.php?CodeName='\n\t\t\t\t. $txt . '&id='\n\t\t\t\t. $key . '&act=show\"\n\t\t\t\ttarget=\"_blank\" data-toggle=\"tooltip\"\n\t\t\t\ttitle=\"'\n\t\t\t\t. $txt . '!\"\">'\n\t\t\t\t. $txt . '</a>';\n\n\t\t\t$newStr .= str_replace($txt, $link, $original) . '<br />';\n\n\t\t}else{\n\t\t\t#no match - add to pile and continue on...\n\t\t\t$newStr .= $original . '<br />';\n\t\t}\n\n\n\t}\n\treturn $newStr;\n}", "function buildContactDetail() {\n return url(\"thong-tin-lien-he\");\n }", "function build_pixel_url() {\n\t\tif ( $this->error ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$args = get_object_vars( $this );\n\n\t\t// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.\n\t\tunset( $args['_rt'] );\n\t\tunset( $args['_'] );\n\n\t\t$validated = self::validate_and_sanitize( $args );\n\n\t\tif ( is_wp_error( $validated ) )\n\t\t\treturn '';\n\n\t\treturn Jetpack_Tracks_Client::PIXEL . '?' . http_build_query( $validated );\n\t}", "function shortUrl($url, $service='google', $action='short') {\n\n if($action=='short') {\n\n if($service=='google') {\n\n $urlapi = \"https://www.googleapis.com/urlshortener/v1/url\";\n $postData = array('longUrl'=>$url, 'key'=>'AIzaSyAcJa1PtXCCRXVUEYiv4iu4MnT4vBM2r-o');\n\n } else {\n\n $postData = array('login'=>'lslucas', 'longUrl'=>$url, 'apiKey'=>'R_9413f87bc6b34d74c50254d31a8a55c8', 'format'=>'json');\n $querystring = http_build_query($postData);\n $postData = null;\n\n $urlapi = \"http://api.bitly.com/v3/shorten?\".$querystring;\n\n }\n\n\n\n\n $post = !is_null($postData) ? json_encode($postData) : null;\n $json = curl_post($urlapi, $post, array('Content-Type: application/json'));\n\n if($service=='google') return $json->id;\n else {\n if($json->status_code!=500) return $json->data->url;\n }\n\n\n }\n\n}", "function charity_head_profile() {\n $content = '<head profile=\"http://gmpg.org/xfn/11\">' . \"\\n\";\n echo apply_filters('charity_head_profile', $content);\n}", "function UrlIfy($fields) {\n\t$delim = \"\";\n\t$fields_string = \"\";\n\tforeach($fields as $key=>$value) {\n\t\t$fields_string .= $delim . $key . '=' . $value;\n\t\t$delim = \"&\";\n\t}\n\n\treturn $fields_string;\n}", "function jc_url() {\n\n}", "function cot_url_custom($name, $params = '', $tail = '', $htmlspecialchars_bypass = false)\n{\n\tglobal $cfg, $cot_urltrans, $sys;\n\t// Preprocess arguments\n\tif (is_string($params))\n\t{\n\t\t$params = cot_parse_str($params);\n\t}\n\t$area = empty($cot_urltrans[$name]) ? '*' : $name;\n\t// Find first matching rule\n\t$url = $cot_urltrans['*'][0]['trans']; // default rule\n\t$rule = array();\n\tif (!empty($cot_urltrans[$area]))\n\t{\n\t\tforeach($cot_urltrans[$area] as $rule)\n\t\t{\n\t\t\t$matched = true;\n\t\t\tforeach($rule['params'] as $key => $val)\n\t\t\t{\n\t\t\t\tif (empty($params[$key])\n\t\t\t\t\t|| (is_array($val) && !in_array($params[$key], $val))\n\t\t\t\t\t|| ($val != '*' && $params[$key] != $val))\n\t\t\t\t{\n\t\t\t\t\t$matched = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($matched)\n\t\t\t{\n\t\t\t\t$url = $rule['trans'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// Some special substitutions\n\t$spec['_area'] = $name;\n\t$spec['_host'] = $sys['host'];\n\t$spec['_rhost'] = $_SERVER['HTTP_HOST'];\n\t$spec['_path'] = COT_SITE_URI;\n\t// Transform the data into URL\n\tif (preg_match_all('#\\{(.+?)\\}#', $url, $matches, PREG_SET_ORDER))\n\t{\n\t\tforeach($matches as $m)\n\t\t{\n\t\t\tif ($p = mb_strpos($m[1], '('))\n\t\t\t{\n\t\t\t\t// Callback\n\t\t\t\t$func = mb_substr($m[1], 0, $p);\n\t\t\t\t$url = str_replace($m[0], $func($params, $spec), $url);\n\t\t\t}\n\t\t\telseif (mb_strpos($m[1], '!$') === 0)\n\t\t\t{\n\t\t\t\t// Unset\n\t\t\t\t$var = mb_substr($m[1], 2);\n\t\t\t\t$url = str_replace($m[0], '', $url);\n\t\t\t\tunset($params[$var]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Substitute\n\t\t\t\t$var = mb_substr($m[1], 1);\n\t\t\t\tif (isset($spec[$var]))\n\t\t\t\t{\n\t\t\t\t\t$url = str_replace($m[0], urlencode($spec[$var]), $url);\n\t\t\t\t}\n\t\t\t\telseif (isset($params[$var]))\n\t\t\t\t{\n\t\t\t\t\t$url = str_replace($m[0], urlencode($params[$var]), $url);\n\t\t\t\t\tunset($params[$var]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$url = str_replace($m[0], urlencode($GLOBALS[$var]), $url);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Append query string if needed\n\tif (!empty($params))\n\t{\n\t\t$sep = $htmlspecialchars_bypass ? '&' : '&amp;';\n\t\t$sep_len = mb_strlen($sep);\n\t\t$qs = mb_strpos($url, '?') !== false ? $sep : '?';\n\t\tforeach($params as $key => $val)\n\t\t{\n\t\t\t// Exclude static parameters that are not used in format,\n\t\t\t// they should be passed by rewrite rule (htaccess)\n\t\t\tif ($rule['params'][$key] != $val)\n\t\t\t{\n\t\t\t\t$qs .= $key .'='.urlencode($val).$sep;\n\t\t\t}\n\t\t}\n\t\t$qs = mb_substr($qs, 0, -$sep_len);\n\t\t$url .= $qs;\n\t}\n\t// Almost done\n\t$url .= $tail;\n\t$url = str_replace('&amp;amp;', '&amp;', $url);\n\treturn $url;\n}", "function convertStringUrl($string){\n\n $wasteValue = [3];\n $url = parse_url($string);\n\n $scheme = $url['scheme'];\n $host = $url['host'];\n $path = $url['path'];\n\n $query = explode('&', $url['query']);\n\n $params = getFilteredArrayFromString($query, $wasteValue);\n\n //sort params by value\n asort($params);\n\n //add path parameter from input link to array\n $params['url'] = $path;\n\n //form get params as a string\n $paramsString = http_build_query($params);\n\n //form a valid url as a string\n $result = $scheme . '://' . $host . '/?' . $paramsString;\n\n return $result;\n\n}", "function link_to_mp($row, $i = 1)\n{\n if ($i == 1)\n $i = \"\";\n\n $mpn = '';\n if ($row['house'] == 'lords')\n $mpn .= $row['title'] . ' ';\n $mpn .= $row['first_name'].' '.$row['last_name'];\n $mpn = trim($mpn);\n\n if ($row['house'] == 'lords')\n $mpc = \"Lords\";\n else \n $mpc = $row['constituency'];\n\n return \"mpn$i=\".urlencode(str_replace(\" \", \"_\", $mpn)).\"&\".\"mpc$i=\".urlencode(str_replace(\" \", \"_\", $mpc)).\"&\".\"house$i=\".urlencode($row['house']);\n}", "public function url()\n {\n if (empty($this->parameters)) {\n return $this->url;\n }\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $va) {\n $total[] = HttpClient::urlencodeRFC3986($k).\"[]=\".HttpClient::urlencodeRFC3986($va);\n }\n } else {\n $total[] = HttpClient::urlencodeRFC3986($k).\"=\".HttpClient::urlencodeRFC3986($v);\n }\n }\n $out = implode(\"&\", $total);\n\n return $this->url.'?'.$out;\n }", "function cp_url($path, $qs)\n{\n return $path.'?'.$qs;\n}", "function double_play_offer_link()\n{\n\tglobal $form_config;\n\t\n\t$offer_link = 'http://track.thewebgemnetwork.com/aff_c?offer_id=1301&aff_id=3903';\n\t\n\t$offer_link .= '&aff_sub=' . urlencode($form_config['affid']);\n\n\t$offer_link .= '&first_name=' . urlencode($_POST['first_name']);\n\t$offer_link .= '&last_name=' . urlencode($_POST['last_name']);\n\t$offer_link .= '&street_addr1=' . urlencode($_POST['street_addr1']);\n\t$offer_link .= '&city=' . urlencode($_POST['city']);\n\t$offer_link .= '&state=' . urlencode($_POST['state']);\n\t$offer_link .= '&zip=' . urlencode($_POST['zip']);\n\t//$offer_link .= '&phone_home=' . urlencode($_POST['HomePhone']);\n\t$offer_link .= '&email=' . urlencode($_POST['email']);\n\t//$offer_link .= '&bank_aba=' . urlencode($_POST['BankRoutingNumber']);\n\t//$offer_link .= '&bank_account=' . urlencode($_POST['BankAccountNumber']);\n\t\n\treturn $offer_link;\n}", "function name_and_representation_in_url() {\n preg_match(URI_REGEX, request_uri(), $request_matches);\n return array(\n (isset($request_matches[1]) ? $request_matches[1] : ''),\n (isset($request_matches[2]) ? $request_matches[2] : ''),\n );\n}", "function searchURI()\t{\n return $this->getRandomString(mt_rand(0,100));\n\t}", "public function toUrl()\n {\n $queryParams = '';\n\n $index = 0;\n\n foreach ($this->args as $key => $param) {\n $separator = '?';\n\n if ($index) {\n $separator = '&';\n }\n\n $queryParams .= \"{$separator}{$key}={$param}\";\n\n $index++;\n }\n\n return \"https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}\";\n }", "function modify_url($mod) { \n $url = \"http://\" .$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; \n $query = explode(\"&\", $_SERVER['QUERY_STRING']); \n // modify/delete data \n foreach($query as $q) { \n @list($key, $value) = explode(\"=\", $q); \n if(array_key_exists($key, $mod)) \n { \n if($mod[$key]) \n { \n $url = preg_replace('/' .$key. '=' .$value. '/', $key. '=' .$mod[$key], $url); \n } \n else \n { \n $url = preg_replace('/&?'.$key.'='.$value.'/', '', $url); \n } \n } \n } \n // add new data \n foreach($mod as $key => $value) { \n if($value && !preg_match('/' .$key. '=/', $url)) \n { \n $url .= '&' .$key. '=' .$value; \n } \n }\n \n \tfor ($i=0; $_SERVER['QUERY_STRING'] == \"\" && $i != 1; $i++)\n \t$url = str_replace(\"&\", \"?\", $url);\n \n \n return $url; \n}", "function ucf_creol_people_directory_shortcode($atts ){\n $a = shortcode_atts( array(\n 'base_uri' => 'https://api.creol.ucf.edu/SqltoJson.aspx',\n 'stored_procedure' => 'WWWDirectory',\n 'grp_id' => 2,\n 'show_fields' => true\n ), $atts );\n\n $result = build_uri_string_directory($a);\n //var_dump($result);\n $json_string = curl_url($result);\n //var_dump($json_string);\n $json_obj = jsonifyier($json_string);\n\n\n if($atts['show_fields'] == true) {\n layout_people($json_obj);\n } else {\n echo $json_string;\n }\n}", "function elgg_http_add_url_query_elements($url, array $elements) {\n\t$url_array = parse_url($url);\n\n\tif (isset($url_array['query'])) {\n\t\t$query = elgg_parse_str($url_array['query']);\n\t} else {\n\t\t$query = array();\n\t}\n\n\tforeach ($elements as $k => $v) {\n\t\t$query[$k] = $v;\n\t}\n\n\t$url_array['query'] = http_build_query($query);\n\t$string = elgg_http_build_url($url_array);\n\n\treturn $string;\n}", "public function getEcommUrl()\n {\n $this->db->select(\"hp_parm_desc\");\n $this->db->from(\"ims_hris.hradmin_parms\");\n $this->db->where(\"hp_parm_code = 'ECOMMUNITY_STAFF_URL'\");\n\n $q = $this->db->get();\n return $q->row_case('UPPER');\n }", "function rebuild($to_unset=\"block\"){\n\t\t\tglobal $_GET;\n\t\t\tunset($_GET[$to_unset]);\n\t\t\t\t\n\t\t\t$glue = \"?\";\n\t\t\treset($_GET);\n\t\t\twhile(list($key,$val)=each($_GET)){\n\t\t\t\t$val = str_replace(\" \",\"%20\",$val);\n\t\t\t\t$glue .= $key . \"=\" . $val . \"&\";\n\t\t\t}\n\t\t\treturn $glue;\n\t\t}", "function randomUrl($type = 'alphanumeric', $length = 4){\n $str = '';\n switch($type):\n case 'alphanumeric':\n $possible = \"23456789bcdfghjkmnpqrstvwxyzBCDFGHJKMNPQRSTVWXYZ\";\n break;\n case 'alpha':\n $possible = \"abcdefghijklmnopqrstuvwxyz\";\n break;\n case 'numeric':\n $possible = \"0123456789\";\n break;\n endswitch;\n \n $i = 0;\n while ($i < $length) {\n $str .= substr( $possible, mt_rand( 0, strlen( $possible )-1 ), 1 );\n $i++;\n }\n return $str;\n}", "public function buildQueryString();", "public function urlTo(string $cql, int $start = 1, int $count = 10, array $extraParams = []): string\n {\n $qs = array(\n 'operation' => 'searchRetrieve',\n 'version' => $this->version,\n 'recordSchema' => $this->schema,\n 'maximumRecords' => $count,\n 'query' => $cql\n );\n\n if ($start != 1) {\n // At least the BIBSYS SRU service, specifying startRecord results in\n // a less clear error message when there's no results\n $qs['startRecord'] = $start;\n }\n\n foreach ($extraParams as $key => $value) {\n $qs[$key] = $value;\n }\n\n return $this->url . '?' . http_build_query($qs);\n }", "protected function buildCharacterAvatarURL($armoryUrl, $level, $genderId, $raceId, $classId) {\r\n\t $result = '';\r\n\t if(!empty($level) && !empty($genderId) && !empty($raceId) && !empty($classId)){\r\n\t $dir = \"wow\" . ($level < 70 ? \"-default\" : ($level < 80 ? \"-70\" : \"-80\"));\r\n\t $result = $armoryUrl . \"/_images/portraits/$dir/$genderId-$raceId-$classId.gif\";\r\n \t}\r\n \treturn $result;\r\n }", "function createTwitterUrl ( $_name, $_link ) {\n $twitter_url = [];\n if ( $_name !== \"\" ) {\n $_text = $_name . \" at xbank.amsterdam\";\n } else {\n $_text = \"xbank.amsterdam\";\n } \n $_url = encodeURIComponent ( $_link );\n $_url = \"test.xbank.amsterdam%23potluck\";\n $twitter_url[1] = $_url;\n $twitter_url[2] = \"https://twitter.com/share\" . \n \"?text=\" . $_text . \n \"&hashtags=XBank, Amsterdam, \" . str_replace( \" \", \"\", $_name ); \n return $twitter_url; \n}", "private function urlEncodeChar($matches): string\r\n {\r\n return rawurlencode($matches[0]);\r\n }", "function meteoGreg(){\r\n $curl = curl_init();\r\n \r\n curl_setopt_array($curl, array(\r\n CURLOPT_URL => \"api.openweathermap.org/data/2.5/find?q=Prévenchères&units=metric&appid=d196fbd705116ddcd1911b5c8606c6e0&lang=fr\",\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_TIMEOUT => 30,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => \"GET\",\r\n CURLOPT_HTTPHEADER => array(\r\n \"cache-control: no-cache\"\r\n ),\r\n ));\r\n \r\n $response = curl_exec($curl);\r\n \r\n curl_close($curl);\r\n \r\n $response = json_decode($response, true);\r\n echo(\"<p style='text-align:center; color:#373737;'>Le temps à <b>Prévenchères</b> est actuellement <b>\".$response['list'][0]['weather'][0]['description'].\"</b> et la température est de <b>\".intval($response['list'][0]['main']['temp']).\"°C</b></p>\");\r\n}", "function shortcode_personagem_marvel( ){\n\n\t\t$idPersonagem = $_GET['id'];\n\t\tif (!$idPersonagem) { $idPersonagem = 1011334; }\n\n\t\t//variaveis\n\t\t$publickey = 'a80b3d6da752653db8e06bf115158301';\n\t\t$privatekey = 'de2d8bb7ce1de8f871318cf9e18dbf137d89f83e';\n\t\t$ts = '1';\n\t\t$hash = md5($ts.$privatekey.$publickey);\n\n\t\t$token = 'apikey='.$publickey.'&ts='.$ts.'&hash='.$hash;\n\n\t\t//requisicao\n\t\t$json = file_get_contents('http://gateway.marvel.com/v1/public/characters/'.$idPersonagem.'?'.$token);\n\t\t$obj = json_decode($json);\n\n\t\tswitch ($obj->code) {\n\t\t\tcase '200': //ok\n\t\t\texibePersonagem($obj);\n\t\t\tbreak;\n\n\t\t\tcase '409':\n\t\t\treturn \"Erro em requisição com o servidor.\";\n\t\t\tbreak;\n\n\t\t\tcase '401': //invalid referer\n\t\t\treturn \"API Key inválida.\";\n\t\t\tbreak;\n\n\t\t\tcase '405': //method not allowed\n\t\t\treturn \"Método sem permissão de utilização.\";\n\t\t\tbreak;\n\n\t\t\tcase '403': //forbidden\n\t\t\treturn \"Sem acesso para utilizar esta requisição.\";\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\treturn \"Requisição não permitida.\";\n\t\t\tbreak;\n\t\t}\n\t}", "function raw_u($string=\"\"){\r\n //\"?\"前部分语句 空格 = %20\r\n return rawurlencode($string);\r\n}", "function Char_Name() {\r\n\t\tglobal $sr;\r\n\t\t$sr->assign(\"location_name\", \"Character Creation\");\r\n\t\t$sr->display(\"character_name.tpl.html\");\r\n\t\texit();\r\n\t}", "function seoname($name) {\n\tglobal $language_char_conversions, $originals, $replacements;\n\tif ((isset($language_char_conversions)) && ($language_char_conversions == 1)) {\n\t\t$search = explode(\",\", $originals);\n\t\t$replace = explode(\",\", $replacements);\n\t\t$name = str_replace($search, $replace, $name);\n\t}\n\t$name = stripslashes($name);\n\t$name = strtolower($name);\n\t$name = str_replace(\"&\", \"and\", $name);\n\t$name = str_replace(\" \", \"-\", $name);\n\t$name = str_replace(\"---\", \"-\", $name);\n\t$name = str_replace(\"/\", \"-\", $name);\n\t$name = str_replace(\"?\", \"\", $name);\n\t$name = preg_replace( \"/[\\.,\\\";'\\:]/\", \"\", $name );\n\t//$name = urlencode($name);\n\treturn $name;\n}", "function fielding_youtube_params( $url ) {\n\treturn ((strpos($url, \"?\") < -1) ? \"?\" : \"&\") . \"autoplay=1&fs=1&rel=0\";\n}", "function shortcode()\n{\n\t//$uuid = substr($chars,0,3) . rand(100,999);\n\t$uuid = rand(100,999) . rand(100,999) . rand(100,999);\n\treturn strtoupper($uuid);\n}", "function display_json_shortcode($atts ){\n $a = shortcode_atts( array(\n 'base_uri' => 'https://api.creol.ucf.edu/test.aspx',\n 'group' => 1\n ), $atts );\n\n $result = build_uri_string_directory($a);\n $json_string = curl_url($result);\n $json_obj = jsonifyier($json_string);\n layout_people($json_obj);\n}", "function shortcode_personagens_marvel ( ) {\n\t\t//variaveis\n\t\t$publickey = get_option(\"marvelPublicKey\");\n\t\t$privatekey = get_option(\"marvelPrivateKey\");\n\t\t$ts = '1';\n\t\t$hash = md5($ts.$privatekey.$publickey);\n\n\t\t$token = 'apikey='.$publickey.'&ts='.$ts.'&hash='.$hash;\n\n\t\t$pagina = $_GET['pagina'];\n\t\tif (!$pagina) { $pagina = 1; }\n\t\t\n\t\t$limit = 20;\n\t\t$offset = ($pagina - 1) * $limit;\t\t\n\n\t\t//requisicao\n\t\t$json = file_get_contents('http://gateway.marvel.com/v1/public/characters?'.$token\n\t\t\t.'&offset='.$offset.'&limit='.$limit);\n\t\t$obj = json_decode($json);\n\n\t\tswitch ($obj->code) {\n\t\t\tcase '200': //ok\n\t\t\texibeListaPersonagens($obj, $offset, $pagina);\n\t\t\tbreak;\n\n\t\t\tcase '409':\n\t\t\treturn \"Erro em requisição com o servidor.\";\n\t\t\tbreak;\n\n\t\t\tcase '401': //invalid referer\n\t\t\treturn \"API Key inválida.\";\n\t\t\tbreak;\n\n\t\t\tcase '405': //method not allowed\n\t\t\treturn \"Método sem permissão de utilização.\";\n\t\t\tbreak;\n\n\t\t\tcase '403': //forbidden\n\t\t\treturn \"Sem acesso para utilizar esta requisição.\";\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\treturn \"Requisição não permitida.\";\n\t\t\tbreak;\n\t\t}\n\t}", "function unity_query_r_gen() {\r\n $count = 1;\r\n $encoded_avatars = func_arg(0);\r\n\r\n $pairs = explode(\".\", $encoded_avatars);\r\n \r\n $result = array();\r\n \r\n foreach ($pairs as $avatar) {\r\n $ret = generate_redeem_avatar($avatar, $count);\r\n $result[] = $ret;\r\n }\r\n \r\n return json_encode($result);\r\n}", "function _gaiabb_autocompresp($string) {\n\n $matches = array();\n $result = db_select('gbb_gresp', 'c')\n ->fields('c', array('nomu'))\n ->condition('nomu', '%' . db_like($string) . '%', 'LIKE')\n ->distinct()\n ->range(0, 10)\n ->execute();\n foreach ($result as $r) {\n $matches[$r->nomu] = $r->nomu;\n }\n $count = $result->rowCount();\n if ($count > 9) $matches[' '] = '..... Et bien d\\'autres .....';\n drupal_json_output($matches);\n}", "function url_encode($component) {\n $base_encoded = urlencode($component);\n $replacement = [\n '%3A' => ':',\n '%2C' => ',',\n '+' => '%20',\n ];\n return strtr($base_encoded, $replacement);\n}", "function query_vars($vars) {\n $vars[] = 'hcard_url';\n\n return $vars;\n }", "protected function buildRequestUrl($action = \"url\"){\n return \"https://{$this->host}/urlshortener/{$this->version}/{$action}?key={$this->token}\";\n }", "function KeyUrl($url, $parm = \"\") {\n\t\t$sUrl = $url . \"?\";\n\t\tif ($parm <> \"\") $sUrl .= $parm . \"&\";\n\t\tif (!is_null($this->gjd_id->CurrentValue)) {\n\t\t\t$sUrl .= \"gjd_id=\" . urlencode($this->gjd_id->CurrentValue);\n\t\t} else {\n\t\t\treturn \"javascript:ew_Alert(ewLanguage.Phrase('InvalidRecord'));\";\n\t\t}\n\t\treturn $sUrl;\n\t}", "public function lookupCharacter(String $realm, String $name, Array $fields)\n {\n $response = $this->wowapi->getCharacter(\n $realm,\n $name,\n ['fields' => implode(',', $fields)] // fields here\n ); // @TODO: fields\n\n if (200 === $response->getStatusCode()) {\n return (String)$response->getBody()->getContents();\n } else {\n throw new NotFoundHttpException('Character not found!');\n }\n }", "function rebuildURL($remove){\n\t\t$curl = preg_replace('/\\?.*/', '', curPageURL()); //get current URL and remove the query string\n\t\t$query = constructQuery(removeURLQuery($remove));\n\t\treturn $curl.$query;\n\t\t\n\t\t\n\t}", "public function makeHTTPParameters()\n { \n $b =\"&\";\n $b.=\"id=\".$this->id.\"&\";\n $b.=\"title=\".$this->title.\"&\";\n $b.=\"artist=\".$this->artist.\"&\";\n $b.=\"added=\".$this->added.\"&\";\n $b.=\"last_modified=\".$this->last_modified.\"&\";\n $b.=\"lookup_count=\".$this->lookup_count.\"&\";\n $b.=\"modify_count=\".$this->modify_count.\"&\";\n $b.=\"source=\".$this->source.\"&\";\n $b.=\"barcode=\".$this->barcode.\"&\";\n $b.=\"comment=\".$this->comment.\"&\";\n return($b);\n\n\n }", "public function getUrlString(){\n\t\treturn rawurlencode($this->getJsonString());\t\n\t}", "function shGETGarbageCollect()\n{\n\t// builds up a string using all remaining GET parameters, to be appended to the URL without any sef transformation\n\t// those variables passed litterally must be removed from $string as well, so that they are not stored in DB\n\tglobal $shGETVars;\n\t$sefConfig = Sh404sefFactory::getConfig();\n\tif (!$sefConfig->shAppendRemainingGETVars || empty($shGETVars))\n\t\treturn '';\n\t$ret = '';\n\tksort($shGETVars);\n\tforeach ($shGETVars as $param => $value)\n\t{\n\t\tif (is_array($value))\n\t\t{\n\t\t\tforeach ($value as $k => $v)\n\t\t\t{\n\t\t\t\t$ret .= '&' . $param . '[' . $k . ']=' . $v;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ret .= '&' . $param . '=' . $value;\n\t\t}\n\n\t}\n\treturn $ret;\n}", "public function searchCharacter($Name, $Server, $GetExact = true)\n {\n $this->log(__LINE__, 'function: searchCharacter()');\n\n if (!$Name)\n {\n echo \"error: No Name Set.\";\n }\n else if (!$Server)\n {\n echo \"error: No Server Set.\";\n }\n else\n {\n // Exact name for later\n $ExactName = $Name;\n $this->log(__LINE__, 'function: searchCharacter() - searching ...');\n\n // Get the source\n $this->getSource($this->URL['character']['profile'] . str_ireplace(array('%name%', '%server%'), array(str_ireplace(\" \", \"+\", $Name), $Server), $this->URL['search']['query']));\n\n // Get all found characters\n $Found = $this->findAll('thumb_cont_black_50', 10, NULL, false);\n $this->log(__LINE__, 'function: searchCharacter() - got results');\n\n // Loop through results\n if ($Found)\n {\n foreach($Found as $F)\n {\n $Avatar = explode('&quot;', $F[1])[3];\n $Data = explode('&quot;', $F[6]);\n $ID = trim(explode('/', $Data[3])[3]);\n $NameServer = explode(\"(\", trim(str_ireplace(\">\", NULL, strip_tags(html_entity_decode($Data[4])))));\n $Name = htmlspecialchars_decode(trim($NameServer[0]), ENT_QUOTES);\n $Server = trim(str_ireplace(\")\", NULL, $NameServer[1]));\n $Language = $F[4];\n\n // Append search results\n $this->Search['results'][] = array(\n \"avatar\" => $Avatar,\n \"name\" => $Name,\n \"server\" => $Server,\n \"id\" => $ID,\n );\n }\n\n // If to get exact\n if ($GetExact)\n {\n $Exact = false;\n foreach($this->Search['results'] as $Character)\n {\n //show($Character['name'] .' < > '. $ExactName);\n //show(md5($Character['name']) .' < > '. md5($ExactName));\n //show(strlen($Character['name']) .' < > '. strlen($ExactName));\n $n1 = trim(strtolower($Character['name']));\n $n2 = trim(strtolower($ExactName));\n if ($n1 == $n2 && strlen($n1) == strlen($n2))\n {\n $Exact = true;\n $this->Search['results'] = NULL;\n $this->Search['results'][] = $Character;\n $this->Search['isExact'] = true;\n break;\n }\n }\n\n // If no exist false, null array\n if (!$Exact)\n {\n $this->Search = NULL;\n }\n }\n\n // Number of results\n $this->Search['total'] = count($this->Search['results']);\n }\n else\n {\n $this->Search['total'] = 0;\n $this->Search['results'] = NULL;\n }\n }\n }", "function get_tiny_url($beforeurl) { \n\t$ch = curl_init(); \n\t$timeout = 5; \n\tcurl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$beforeurl); \n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1); \n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); \n\t$data = curl_exec($ch); \n\tcurl_close($ch); \n\treturn $data; \n}", "function getPersonLink($lastname,$firstname) {\n return getNormalisedChars($lastname).'_'.getNormalisedChars($firstname);\n}", "function suggestion_link($locum_result) {\n $url_prefix = variable_get('sopac_url_prefix', 'cat/seek');\n $sugg_link = l($locum_result['suggestion'], $url_prefix . '/search/' . $locum_result['type'] . '/' . $locum_result['suggestion'],\n array('query' => sopac_make_pagevars(sopac_parse_get_vars())));\n return $sugg_link;\n}", "function main_url(){\n return \"http://\".$this->imdbsite.\"/name/nm\".$this->imdbid().\"/\";\n }", "function fetch($name){\n \n return (isset($_GET[$name])? $_GET[$name]:''); \n }", "function rule_names($category, $offset, $limit, $phrase)\n\t{\n\t\tlog_message('debug', '_setting/rule_names');\n\t\tlog_message('debug', '_setting/rule_names:: [1] category='.$category.' offset='.$offset.' limit='.$limit.' phrase='.$phrase);\n\n\t\t$values['category_condition'] = !empty($category)? \" AND category ='\".$category.\"' \": '';\n\t\t$values['phrase_condition'] = !empty($phrase)? \" AND display LIKE '%\".htmlentities($phrase, ENT_QUOTES).\"%'\": '';\n\t\t$values['limit_text'] = \" LIMIT \".$offset.\",\".$limit.\" \";\n\n\t\t$result = server_curl(IAM_SERVER_URL, array('__action'=>'get_list', 'query'=>'get_rule_name_list', 'variables'=>$values));\n\t\tlog_message('debug', '_setting/rule_names:: [2] result='.json_encode($result));\n\n\t\treturn $result;\n\t}", "function KeyUrl($url, $parm = \"\") {\n\t\t$sUrl = $url . \"?\";\n\t\tif ($parm <> \"\") $sUrl .= $parm . \"&\";\n\t\tif (!is_null($this->IDXDAFTAR->CurrentValue)) {\n\t\t\t$sUrl .= \"IDXDAFTAR=\" . urlencode($this->IDXDAFTAR->CurrentValue);\n\t\t} else {\n\t\t\treturn \"javascript:ew_Alert(ewLanguage.Phrase('InvalidRecord'));\";\n\t\t}\n\t\treturn $sUrl;\n\t}", "function generate_follow_link() {\n\t\treturn str_replace( 'swfw_username', $this->username, $this->url);\n\t}", "function chat_make_link($cm_id, $start, $end) {\n global $CFG;\n\n return $CFG->wwwroot.'/mod/chat/report.php?id='.$cm_id.'&amp;start='.$start.'&amp;end='.$end;\n}", "public function getFullUrl(){\n return 'http://'. $_SERVER['HTTP_HOST'] .'/'. implode('/', self::$_request_vars);\n }", "public function test_comicEntityIsCrated_charactes_setCharacters()\n {\n $sut = $this->getSUT();\n $characters = $sut->getCharacters();\n $expected = CharacterList::create(\n 0,\n 0,\n 'http://gateway.marvel.com/v1/public/comics/41530/characters',\n [\n [\n 'resourceURI' => 'http://gateway.marvel.com/v1/public/characters/4430',\n 'name' => 'Jeff Young',\n ],\n ]\n );\n\n $this->assertEquals($expected, $characters);\n }", "function piece_http_request($origin_location, $destination_location){\r\n $bing_secret = file_get_contents(BING_SECRET_FILE);\r\n $request_url = \"http://dev.virtualearth.net/REST/V1/Routes/Driving?\". //Base url\r\n \"wp.0=\".urlencode($origin_location). //Filter address to match url-formatting\r\n \"&wp.1=\".urlencode($destination_location).\r\n \"&routeAttributes=routeSummariesOnly&output=xml\". //Setup XML and only route summaries\r\n \"&key=\".$bing_secret;\r\n return $request_url;\r\n}", "private function sanitized_url() {\n $url = $_SERVER['SCRIPT_NAME'] . \"?\";\n /* the GET vars used by git-php */\n $git_get = array('p', 'dl', 'b', 'a', 'h', 't');\n foreach ($_GET as $var => $val) {\n if(!in_array($var, $git_get)){\n $get[$var] = $val;\n $url.=\"{$var}={$val}&amp;\";\n }\n }\n return $url;\n }", "function FrontgetReqRep($str, $relpace) {\r\n $reqstr = @explode($relpace, $str);\r\n return $reqstr[0];\r\n}", "function addURLQuery($query){\n\t\t$query = \"?\".$query.\"&\";\n\t\tforeach($_GET as $k=>$v){\n\t\t\t$query .= \"$k=$v\".\"&\";\n\t\t}\n\t\t$query = substr($query, 0, -1);//chop last ampersand off\n\t\t$curl = preg_replace('/\\?.*/', '', curPageURL()); //get current URL and remove the query string\n\t\treturn $curl.$query;\n\t}", "function unity_query_k_gen() {\r\n $length = func_arg(0);\r\n $key = get_random($length);\r\n return \"{'key':'\" . $key . \"'}\";\r\n}", "function mr_url($string) { \n\t$find = Array(\"Á\",\"Č\",\"Ď\",\"É\",\"Ě\",\"Í\",\"Ň\",\"Ó\",\"Ř\",\"Š\",\"Ť\",\"Ú\",\"Ů\",\"Ý\",\"Ž\", \"á\", \"č\", \"ď\", \"é\", \"ě\", \"í\", \"ľ\", \"ň\", \"ó\", \"ř\", \"š\", \"ť\", \"ú\", \"ů\", \"ý\", \"ž\", \"_\", \" - \", \" \", \".\", \"ü\", \"ä\", \"ö\"); \n\t$replace = Array(\"a\",\"c\",\"d\",\"e\",\"e\",\"i\",\"n\",\"o\",\"r\",\"s\",\"t\",\"u\",\"u\",\"y\",\"z\", \"a\", \"c\", \"d\", \"e\", \"e\", \"i\", \"l\", \"n\", \"o\", \"r\", \"s\", \"t\", \"u\", \"u\", \"y\", \"z\", \"\", \"-\", \"-\", \"-\", \"u\", \"a\", \"o\"); \n\t$string = preg_replace(\"~%[0-9ABCDEF]{2}~\", \"\", urlencode(str_replace($find, $replace, mb_strtolower($string)))); \n\treturn $string; \n}", "function wikiurl( $s ) {\n\treturn str_replace( '%2F', '/', rawurlencode( $s ) );\n}", "function template_alpha_list($params,&$smarty)\n {\n extract($params);\n \n $buffer = \"<a href=\\\"$url&start=ALL\\\">All</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=A\\\">A</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=B\\\">B</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=C\\\">C</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=D\\\">D</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=E\\\">E</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=F\\\">F</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=G\\\">G</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=H\\\">H</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=I\\\">I</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=J\\\">J</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=K\\\">K</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=L\\\">L</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=M\\\">M</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=N\\\">N</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=O\\\">O</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=P\\\">P</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=Q\\\">Q</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=R\\\">R</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=S\\\">S</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=T\\\">T</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=U\\\">U</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=V\\\">V</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=W\\\">W</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=X\\\">X</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=Y\\\">Y</a>&nbsp;\\n\";\n $buffer .= \"<a href=\\\"$url&start=Z\\\">Z</a>&nbsp;\\n\";\n\n return $buffer;\n }", "public function add_party_character($character_data)\n\t{\n\t\t$data['name'] = strip_tags($character_data['name']);\n\t\t$data['fight_max'] = intval($character_data['fight_max']);\n\t\t$data['fight_current'] = intval($character_data['fight_current']);\n\t\t$data['stealth_max'] = intval($character_data['stealth_max']);\n\t\t$data['stealth_current'] = intval($character_data['stealth_current']);\n\t\t$data['lore_max'] = intval($character_data['lore_max']);\n\t\t$data['lore_current'] = intval($character_data['lore_current']);\n\t\t$data['survive_max'] = intval($character_data['survive_max']);\n\t\t$data['survive_current'] = intval($character_data['survive_current']);\n\t\t$data['charisma_max'] = intval($character_data['charisma_max']);\n\t\t$data['charisma_current'] = intval($character_data['charisma_current']);\n\t\t$data['health_max'] = intval($character_data['health_max']);\n\t\t$data['health_current'] = intval($character_data['health_current']);\n\t\t$data['armour_current'] = intval($character_data['armour_current']);\n\t\t$data['notes'] = strip_tags($character_data['notes']);\n\t\t$data['party_id'] = intval($character_data['party_id']);\n\t\t\n\t\t$this->db->reset_query();\n\t\t$this->db->flush_cache();\n\t\t\n\t\treturn $this->db->insert(\"character_list\", $data);\n\t}", "function buildRequestString() {\n $req =\n 'x_version=3.1'\n .'&x_delim_data=TRUE'\n .'&x_delim_char=%2C'\n .'&x_encap_char=%22'\n .'&x_login='.urlencode($this->account_id)\n .'&x_tran_key='.urlencode($this->tran_key)\n .'&x_amount='.number_format($this->amount, 2)\n .'&x_card_num='.urlencode($this->payment->cc_number)\n .'&x_exp_date='.urlencode(date('my', $this->payment->getExpirationDate()));\n \n $type = $this->trans_type;\n $req .= '&x_type='.urlencode($type);\n\n if( $this->address->first_name ) $req .= '&x_first_name='.urlencode($this->address->first_name);\n if( $this->address->last_name ) $req .= '&x_last_name='.urlencode($this->address->last_name);\n if( $this->address->street_address ) $req .= '&x_address='.urlencode($this->address->street_address);\n if( $this->address->city ) $req .= '&x_city='.urlencode($this->address->city);\n if( $this->address->state ) $req .= '&x_state='.urlencode($this->address->state);\n if( $this->address->zip ) $req .= '&x_zip='.urlencode($this->address->zip);\n if( $this->address->phone ) $req .= '&x_phone='.urlencode($this->address->phone);\n \n $send_receipt = $this->email_receipt;\n if( $send_receipt && $this->address->email )\n {\n $req .= '&x_email='.urlencode($this->address->email);\n }\n\n if( $this->test_mode ) {\n $req .= '&x_test_request=TRUE';\n }\n\n return $req;\n }", "function reward_link($id){\r\n $info = mysql_fetch_array(mysql_query(\"SELECT * FROM rewards WHERE id = '$id' LIMIT 1\")); \r\n $partner = mysql_fetch_array(mysql_query(\"SELECT * FROM partners WHERE id = '\".$info[\"partner\"].\"' LIMIT 1\"));\r\n return \"/get-rewarded/\" . $partner[\"url\"] . \"/\" . $info[\"id\"] . \"/\";\r\n}", "function shorturl($url) {\n\n$blusername = get_option('bitly_username');\n$blkey = get_option('bitly_apikey');\n$data = file_get_contents(\"http://api.bit.ly/shorten?version=2.0.1&format=xml&longUrl=\".$url.\"&login=\".$blusername.\"&apiKey=\".$blkey);\n$xml = new SimpleXMLElement($data);\n$shortlink = $xml->results->nodeKeyVal->shortUrl;\n\nreturn $shortlink;\n\n}", "function elgg_add_action_tokens_to_url($url) {\n\t$components = parse_url($url);\n\n\tif (isset($components['query'])) {\n\t\t$query = elgg_parse_str($components['query']);\n\t} else {\n\t\t$query = array();\n\t}\n\n\tif (isset($query['__elgg_ts']) && isset($query['__elgg_token'])) {\n\t\treturn $url;\n\t}\n\n\t// append action tokens to the existing query\n\t$query['__elgg_ts'] = time();\n\t$query['__elgg_token'] = generate_action_token($query['__elgg_ts']);\n\t$components['query'] = http_build_query($query);\n\n\t// rebuild the full url\n\treturn elgg_http_build_url($components);\n}", "public static function urlCampaign($action,$campaign_id) {\n return [\"picture/$action\", 's[campaign_id]' => $campaign_id, 's[map_bind]' => '1'];\n }" ]
[ "0.54280907", "0.5385004", "0.5291851", "0.5262706", "0.51733476", "0.5093116", "0.50602406", "0.5047144", "0.50261986", "0.500112", "0.4987151", "0.49847162", "0.49834102", "0.49685076", "0.49440193", "0.48846596", "0.48659563", "0.48357734", "0.4835669", "0.47928932", "0.47788274", "0.47629175", "0.47513506", "0.47504136", "0.47465244", "0.47434226", "0.47208497", "0.4713354", "0.46947384", "0.46891588", "0.4653232", "0.46496838", "0.46376568", "0.46189576", "0.46188813", "0.4608654", "0.46085054", "0.4586762", "0.45816708", "0.4581306", "0.45798147", "0.45750356", "0.45716003", "0.45689094", "0.45659202", "0.45459598", "0.45442048", "0.4541772", "0.45334226", "0.4533295", "0.45284522", "0.45281988", "0.45241287", "0.45119593", "0.45101443", "0.45081648", "0.45049244", "0.45032048", "0.45012647", "0.44952947", "0.44942662", "0.44776148", "0.44722527", "0.44709986", "0.44707474", "0.44702473", "0.44635427", "0.44602874", "0.44590092", "0.4457636", "0.44491664", "0.44482663", "0.44477978", "0.44476074", "0.4446438", "0.4446246", "0.44460452", "0.4442362", "0.443597", "0.44335505", "0.4429157", "0.4428024", "0.44245148", "0.44223174", "0.44210958", "0.44081873", "0.44068822", "0.4404418", "0.44038537", "0.43985963", "0.43984586", "0.4396701", "0.43965125", "0.43957868", "0.43934068", "0.43924817", "0.4385957", "0.43856466", "0.43849686", "0.4380751" ]
0.49273792
15
Register any application services.
public function register() { API::error(function (AuthorizationException $exception) { //如果出现权限异常,请先检查策略是否有再服务提供者中进行绑定 abort(403, $exception->getMessage()); }); API::error(function (AuthenticationException $exception) { abort(401, $exception->getMessage()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n $this->app->bind(\n PegawaiServiceContract::class,\n PegawaiService::class \n );\n\n $this->app->bind(\n RiwayatPendidikanServiceContract::class,\n RiwayatPendidikanService::class \n );\n\n $this->app->bind(\n ProductionHouseServiceContract::class,\n ProductionHouseService::class\n );\n\n $this->app->bind(\n MovieServiceContract::class,\n MovieService::class\n );\n\n $this->app->bind(\n PangkatServiceContract::class,\n PangkatService::class \n );\n\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n $this->registerRepositories();\n }", "public function register()\n {\n $this->registerFacades();\n $this->registerRespository();\n }", "public function register()\n {\n $this->app->bind('App\\Services\\UserService');\n $this->app->bind('App\\Services\\PostService');\n $this->app->bind('App\\Services\\MyPickService');\n $this->app->bind('App\\Services\\FacebookService');\n $this->app->bind('App\\Services\\LikeService');\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->registerGraphQL();\n\n $this->registerConsole();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n\n $this->registerCommand();\n $this->registerSchedule();\n $this->registerDev();\n\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/telescope-error-service-client.php', 'telescope-error-service-client'\n );\n\n $this->registerStorageDriver();\n\n $this->commands([\n Console\\InstallCommand::class,\n Console\\PublishCommand::class,\n ]);\n }", "public function register()\n\t{\n\t\t$this->registerPasswordBroker();\n\n\t\t$this->registerTokenRepository();\n\t}", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\UtilitiesServiceProvider');\n $this->registerLogViewer();\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\CommandsServiceProvider');\n }", "public function register()\n {\n // $this->app->make('CheckStructureService');\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'APIcoLAB\\Services\\Registrar'\n\t\t);\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Flight\\FlightRepository',\n 'APIcoLAB\\Repositories\\Flight\\SkyScannerFlightRepository'\n );\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Place\\PlaceRepository',\n 'APIcoLAB\\Repositories\\Place\\SkyScannerPlaceRepository'\n );\n\t}", "public function register()\n {\n $this->app->register(\\Maatwebsite\\Excel\\ExcelServiceProvider::class);\n $this->app->register(\\Intervention\\Image\\ImageServiceProvider::class);\n $this->app->register(\\Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\DatatablesServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\ButtonsServiceProvider::class);\n\n $loader = null;\n if (class_exists('Illuminate\\Foundation\\AliasLoader')) {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n }\n\n // Facades\n if ($loader != null) {\n $loader->alias('Image', \\Intervention\\Image\\Facades\\Image::class);\n $loader->alias('Excel', \\Maatwebsite\\Excel\\Facades\\Excel::class);\n\n }\n\n if (app()->environment() != 'production') {\n // Service Providers\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n\n // Facades\n if ($loader != null) {\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n }\n }\n\n if ($this->app->environment('local', 'testing')) {\n $this->app->register(\\Laravel\\Dusk\\DuskServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerInertia();\n $this->registerLengthAwarePaginator();\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->app->bind(\n 'Toyopecas\\Repositories\\TopoRepository',\n 'Toyopecas\\Repositories\\TopoRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ServicesRepository',\n 'Toyopecas\\Repositories\\ServicesRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\SobreRepository',\n 'Toyopecas\\Repositories\\SobreRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ProdutosRepository',\n 'Toyopecas\\Repositories\\ProdutosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register()\n {\n $this->registerRepositories();\n\n $this->pushMiddleware();\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel-base.php', 'laravel-base');\r\n\r\n $this->app->bind(UuidGenerator::class, UuidGeneratorService::class);\r\n\r\n }", "public function register()\n {\n\n $this->app->register(RepositoryServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n 'Uhmane\\Repositories\\ContatosRepository', \n 'Uhmane\\Repositories\\ContatosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }", "public function register()\n {\n $this->app->register('ProAI\\Datamapper\\Providers\\MetadataServiceProvider');\n\n $this->app->register('ProAI\\Datamapper\\Presenter\\Providers\\MetadataServiceProvider');\n\n $this->registerScanner();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(\n 'Larafolio\\Http\\HttpValidator\\HttpValidator',\n 'Larafolio\\Http\\HttpValidator\\CurlValidator'\n );\n\n $this->app->register(ImageServiceProvider::class);\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->app->bind(\n 'App\\Contracts\\UsersInterface',\n 'App\\Services\\UsersService'\n );\n $this->app->bind(\n 'App\\Contracts\\CallsInterface',\n 'App\\Services\\CallsService'\n );\n $this->app->bind(\n 'App\\Contracts\\ContactsInterface',\n 'App\\Services\\ContactsService'\n );\n $this->app->bind(\n 'App\\Contracts\\EmailsInterface',\n 'App\\Services\\EmailsService'\n );\n $this->app->bind(\n 'App\\Contracts\\PhoneNumbersInterface',\n 'App\\Services\\PhoneNumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\NumbersInterface',\n 'App\\Services\\NumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\UserNumbersInterface',\n 'App\\Services\\UserNumbersService'\n );\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerFriendsLog();\n $this->registerNotifications();\n $this->registerAPI();\n $this->registerMailChimpIntegration();\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerMigrator();\n $this->registerArtisanCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/services.php', 'services'\n );\n }", "public function register()\n {\n $this->registerRateLimiting();\n\n $this->registerHttpValidation();\n\n $this->registerHttpParsers();\n\n $this->registerResponseFactory();\n\n $this->registerMiddleware();\n }", "public function register()\n {\n $this->registerConfig();\n $this->registerView();\n $this->registerMessage();\n $this->registerMenu();\n $this->registerOutput();\n $this->registerCommands();\n require __DIR__ . '/Service/ServiceProvider.php';\n require __DIR__ . '/Service/RegisterRepoInterface.php';\n require __DIR__ . '/Service/ErrorHandling.php';\n $this->registerExportDompdf();\n $this->registerExtjs();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerParser();\n }", "public function register()\n {\n $this->registerOtherProviders()->registerAliases();\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'jarvisPlatform');\n $this->app->bind('jarvis.auth.provider', AppAuthenticationProvider::class);\n $this->loadRoutes();\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register(Providers\\ManagerServiceProvider::class);\n $this->app->register(Providers\\ValidationServiceProvider::class);\n }", "public function register()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n $loader->alias('Laratrust', 'Laratrust\\LaratrustFacade');\n $loader->alias('Form', 'Collective\\Html\\FormFacade');\n $loader->alias('Html', 'Collective\\Html\\HtmlFacade');\n $loader->alias('Markdown', 'BrianFaust\\Parsedown\\Facades\\Parsedown');\n\n $this->app->register('Baum\\Providers\\BaumServiceProvider');\n $this->app->register('BrianFaust\\Parsedown\\ServiceProvider');\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Laravel\\Scout\\ScoutServiceProvider');\n $this->app->register('Laratrust\\LaratrustServiceProvider');\n\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\AuthServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\EventServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\ViewServiceProvider');\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(ReviewService::class, function ($app) {\n return new ReviewService();\n });\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }", "public function register()\n {\n $this->app->bind(VehicleRepository::class, GuzzleVehicleRepository::class);\n }", "public function register()\n {\n $this->app->bind('gameService', 'App\\Service\\GameService');\n }", "public function register()\n {\n $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function($app){\n return new ElasticsearchNedvizhimostsObserver(new Client());\n });\n\n // $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function()\n // {\n // return new ElasticsearchNedvizhimostsObserver(new Client());\n // });\n }", "public function register()\n {\n // Register the app\n $this->registerApp();\n\n // Register Commands\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGeography();\n\n $this->registerCommands();\n\n $this->mergeConfig();\n\n $this->countriesCache();\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'App\\Services\\Registrar'\n\t\t);\n \n $this->app->bind(\"App\\\\Services\\\\ILoginService\",\"App\\\\Services\\\\LoginService\");\n \n $this->app->bind(\"App\\\\Repositories\\\\IItemRepository\",\"App\\\\Repositories\\\\ItemRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IOutletRepository\",\"App\\\\Repositories\\\\OutletRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IInventoryRepository\",\"App\\\\Repositories\\\\InventoryRepository\");\n\t}", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->app->bind('activity', function () {\n return new ActivityService(\n $this->app->make(Activity::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('views', function () {\n return new ViewService(\n $this->app->make(View::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('setting', function () {\n return new SettingService(\n $this->app->make(Setting::class),\n $this->app->make(Repository::class)\n );\n });\n\n $this->app->bind('images', function () {\n return new ImageService(\n $this->app->make(Image::class),\n $this->app->make(ImageManager::class),\n $this->app->make(Factory::class),\n $this->app->make(Repository::class)\n );\n });\n }", "public function register()\n {\n $this->app->bind(CertificationService::class, function($app){\n return new CertificationService();\n });\n }", "public function register()\n {\n $this->registerUserProvider();\n $this->registerGroupProvider();\n $this->registerNeo();\n\n $this->registerCommands();\n\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Neo', 'Wetcat\\Neo\\Facades\\Neo');\n });\n }", "public function register()\n {\n App::bind('CreateTagService', function($app) {\n return new CreateTagService;\n });\n\n App::bind('UpdateTagService', function($app) {\n return new UpdateTagService;\n });\n }", "public function register()\n {\n $this->registerDomainLocalization();\n $this->registerDomainLocaleFilter();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(MailConfigServiceProvider::class);\n }", "public function register()\n {\n //\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\CompanyInterface', \n 'App\\Repositories\\CompanyRepo'\n );\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\UtilityInterface', \n 'App\\Repositories\\UtilityRepo'\n );\n }", "public function register()\n {\n $this->registerPayment();\n\n $this->app->alias('image', 'App\\Framework\\Image\\ImageService');\n }", "public function register()\n {\n $this->app->bind(AttributeServiceInterface::class,AttributeService::class);\n $this->app->bind(ProductServiceIntarface::class,ProductService::class);\n\n\n }", "public function register()\n {\n App::bind('App\\Repositories\\UserRepositoryInterface','App\\Repositories\\UserRepository');\n App::bind('App\\Repositories\\AnimalRepositoryInterface','App\\Repositories\\AnimalRepository');\n App::bind('App\\Repositories\\DonationTypeRepositoryInterface','App\\Repositories\\DonationTypeRepository');\n App::bind('App\\Repositories\\NewsAniRepositoryInterface','App\\Repositories\\NewsAniRepository');\n App::bind('App\\Repositories\\DonationRepositoryInterface','App\\Repositories\\DonationRepository');\n App::bind('App\\Repositories\\ProductRepositoryInterface','App\\Repositories\\ProductRepository');\n App::bind('App\\Repositories\\CategoryRepositoryInterface','App\\Repositories\\CategoryRepository');\n App::bind('App\\Repositories\\TransferMoneyRepositoryInterface','App\\Repositories\\TransferMoneyRepository');\n App::bind('App\\Repositories\\ShippingRepositoryInterface','App\\Repositories\\ShippingRepository');\n App::bind('App\\Repositories\\ReserveProductRepositoryInterface','App\\Repositories\\ReserveProductRepository');\n App::bind('App\\Repositories\\Product_reserveRepositoryInterface','App\\Repositories\\Product_reserveRepository');\n App::bind('App\\Repositories\\Ordering_productRepositoryInterface','App\\Repositories\\Ordering_productRepository');\n App::bind('App\\Repositories\\OrderingRepositoryInterface','App\\Repositories\\OrderingRepository');\n App::bind('App\\Repositories\\UserUpdateSlipRepositoryInterface','App\\Repositories\\UserUpdateSlipRepository');\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->registerPublishing();\n }\n }", "public function register()\n {\n $this->app->bind(HttpClient::class, function ($app) {\n return new HttpClient();\n });\n\n $this->app->bind(SeasonService::class, function ($app) {\n return new SeasonService($app->make(HttpClient::class));\n });\n\n $this->app->bind(MatchListingController::class, function ($app) {\n return new MatchListingController($app->make(SeasonService::class));\n });\n\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\MakeEndpointCommand::class,\n Console\\MakeControllerCommand::class,\n Console\\MakeRepositoryCommand::class,\n Console\\MakeTransformerCommand::class,\n Console\\MakeModelCommand::class,\n ]);\n }\n\n $this->registerFractal();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n {\n // Bind facade\n\n $this->registerRepositoryBibdings();\n $this->registerFacades();\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(\\Laravel\\Socialite\\SocialiteServiceProvider::class);\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->registerDataStore();\n\n $this->registerStorageFactory();\n\n $this->registerStorageManager();\n\n $this->registerSimplePhoto();\n }", "public function register()\n {\n // Default configuration file\n $this->mergeConfigFrom(\n __DIR__.'/Config/auzo_tools.php', 'auzoTools'\n );\n\n $this->registerModelBindings();\n $this->registerFacadesAliases();\n }", "public function register()\n {\n\n\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\UserRepository',\n 'Onlinecorrection\\Repositories\\UserRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ClientRepository',\n 'Onlinecorrection\\Repositories\\ClientRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ProjectRepository',\n 'Onlinecorrection\\Repositories\\ProjectRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentRepository',\n 'Onlinecorrection\\Repositories\\DocumentRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderRepository',\n 'Onlinecorrection\\Repositories\\OrderRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderItemRepository',\n 'Onlinecorrection\\Repositories\\OrderItemRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentImageRepository',\n 'Onlinecorrection\\Repositories\\DocumentImageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\PackageRepository',\n 'Onlinecorrection\\Repositories\\PackageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\StatusRepository',\n 'Onlinecorrection\\Repositories\\StatusRepositoryEloquent'\n );\n\n }", "public function register()\n {\n\n $config = $this->app['config']['cors'];\n\n $this->app->bind('Yocome\\Cors\\CorsService', function() use ($config){\n return new CorsService($config);\n });\n\n }", "public function register()\n {\n $this->app->bind(\\Cookiesoft\\Repositories\\CategoryRepository::class, \\Cookiesoft\\Repositories\\CategoryRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\BillpayRepository::class, \\Cookiesoft\\Repositories\\BillpayRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\UserRepository::class, \\Cookiesoft\\Repositories\\UserRepositoryEloquent::class);\n //:end-bindings:\n }", "public function register()\n {\n $this->app->singleton(ThirdPartyAuthService::class, function ($app) {\n return new ThirdPartyAuthService(\n config('settings.authentication_services'),\n $app['Laravel\\Socialite\\Contracts\\Factory'],\n $app['Illuminate\\Contracts\\Auth\\Factory']\n );\n });\n\n $this->app->singleton(ImageValidator::class, function ($app) {\n return new ImageValidator(\n config('settings.image.max_filesize'),\n config('settings.image.mime_types'),\n $app['Intervention\\Image\\ImageManager']\n );\n });\n\n $this->app->singleton(ImageService::class, function ($app) {\n return new ImageService(\n config('settings.image.max_width'),\n config('settings.image.max_height'),\n config('settings.image.folder')\n );\n });\n\n $this->app->singleton(RandomWordService::class, function ($app) {\n return new RandomWordService(\n $app['App\\Repositories\\WordRepository'],\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.number_of_words_to_remember')\n );\n });\n\n $this->app->singleton(WordRepository::class, function ($app) {\n return new WordRepository(config('settings.min_number_of_chars_per_one_mistake_in_search'));\n });\n\n $this->app->singleton(CheckAnswerService::class, function ($app) {\n return new CheckAnswerService(\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.min_number_of_chars_per_one_mistake')\n );\n });\n\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerJWT();\n $this->registerJWSProxy();\n $this->registerJWTAlgoFactory();\n $this->registerPayload();\n $this->registerPayloadValidator();\n $this->registerPayloadUtilities();\n\n // use this if your package has a config file\n // config([\n // 'config/JWT.php',\n // ]);\n }", "public function register()\n {\n $this->registerManager();\n $this->registerConnection();\n $this->registerWorker();\n $this->registerListener();\n $this->registerFailedJobServices();\n $this->registerOpisSecurityKey();\n }", "public function register()\n {\n $this->app->register(RouterServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('App\\Services\\TripService.php', function ($app) {\n return new TripService();\n });\n }", "public function register()\n {\n $this->registerUserComponent();\n $this->registerLocationComponent();\n\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\UserCertificate\\IUserCertificateService::class,\n \\App\\Services\\UserCertificate\\UserCertificateService::class\n );\n }", "public function register()\n {\n $this->app->bind(FacebookMarketingContract::class,FacebookMarketingService::class);\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->app->singleton('composer', function($app)\n {\n return new Composer($app['files'], $app['path.base']);\n });\n\n $this->app->singleton('forge', function($app)\n {\n return new Forge($app);\n });\n\n // Register the additional service providers.\n $this->app->register('Nova\\Console\\ScheduleServiceProvider');\n $this->app->register('Nova\\Queue\\ConsoleServiceProvider');\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__.'/../config/colissimo.php', 'colissimo');\r\n $this->mergeConfigFrom(__DIR__.'/../config/rules.php', 'colissimo.rules');\r\n $this->mergeConfigFrom(__DIR__.'/../config/prices.php', 'colissimo.prices');\r\n $this->mergeConfigFrom(__DIR__.'/../config/zones.php', 'colissimo.zones');\r\n $this->mergeConfigFrom(__DIR__.'/../config/insurances.php', 'colissimo.insurances');\r\n $this->mergeConfigFrom(__DIR__.'/../config/supplements.php', 'colissimo.supplements');\r\n // Register the service the package provides.\r\n $this->app->singleton('colissimo', function ($app) {\r\n return new Colissimo;\r\n });\r\n }", "public function register()\n {\n\n\n\n $this->mergeConfigFrom(__DIR__ . '/../config/counter.php', 'counter');\n\n $this->app->register(RouteServiceProvider::class);\n\n\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/atlas.php', 'atlas'\n );\n \n $this->app->singleton(CoreContract::class, Core::class);\n \n $this->registerFacades([\n 'Atlas' => 'Atlas\\Facades\\Atlas',\n ]);\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyService::class,\n \\App\\Services\\Survey\\SurveyService::class\n );\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyQuestionService::class,\n \\App\\Services\\Survey\\SurveyQuestionService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptService::class,\n \\App\\Services\\Survey\\SurveyAttemptService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptDataService::class,\n \\App\\Services\\Survey\\SurveyAttemptDataService::class\n );\n }", "public function register()\n {\n $this->registerRepositoryBindings();\n\n $this->registerInterfaceBindings();\n\n $this->registerAuthorizationServer();\n\n $this->registerResourceServer();\n\n $this->registerFilterBindings();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events');\n\n $this->app->singleton(EventsService::class);\n $this->app->singleton(GuestService::class);\n }", "public function register()\n {\n $this->registerAliases();\n $this->registerFormBuilder();\n\n // Register package commands\n $this->commands([\n 'CoreDbCommand',\n 'CoreSetupCommand',\n 'CoreSeedCommand',\n 'EventEndCommand',\n 'ArchiveMaxAttempts',\n 'CronCommand',\n 'ExpireInstructors',\n 'SetTestLock',\n 'StudentArchiveTraining',\n 'TestBuildCommand',\n 'TestPublishCommand',\n ]);\n\n // Merge package config with one in outer app \n // the app-level config will override the base package config\n $this->mergeConfigFrom(\n __DIR__.'/../config/core.php', 'core'\n );\n\n // Bind our 'Flash' class\n $this->app->bindShared('flash', function () {\n return $this->app->make('Hdmaster\\Core\\Notifications\\FlashNotifier');\n });\n\n // Register package dependencies\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Bootstrapper\\BootstrapperL5ServiceProvider');\n $this->app->register('Codesleeve\\LaravelStapler\\Providers\\L5ServiceProvider');\n $this->app->register('PragmaRX\\ZipCode\\Vendor\\Laravel\\ServiceProvider');\n $this->app->register('Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider');\n\n $this->app->register('Zizaco\\Confide\\ServiceProvider');\n $this->app->register('Zizaco\\Entrust\\EntrustServiceProvider');\n }" ]
[ "0.78798115", "0.7601541", "0.7493926", "0.73860854", "0.7369017", "0.73060066", "0.72911495", "0.72905713", "0.7279868", "0.72693264", "0.72689337", "0.72660935", "0.7248237", "0.7217507", "0.72099274", "0.71999437", "0.71971434", "0.719557", "0.7177418", "0.7176995", "0.7164727", "0.714884", "0.7133956", "0.71305424", "0.7124248", "0.7120879", "0.71042967", "0.7103381", "0.7098175", "0.7095116", "0.7093082", "0.7090919", "0.7089653", "0.708781", "0.7083585", "0.70768666", "0.70750886", "0.7074432", "0.70725685", "0.70717555", "0.70717484", "0.70686233", "0.7067628", "0.7062164", "0.7057745", "0.7053146", "0.7051819", "0.704817", "0.7045575", "0.7043879", "0.7043779", "0.70416707", "0.70389324", "0.70387244", "0.70344466", "0.70343846", "0.70323545", "0.7029406", "0.70262766", "0.7023864", "0.7023558", "0.7023114", "0.7022826", "0.7022281", "0.70220125", "0.70219433", "0.7021686", "0.7019965", "0.70183533", "0.70170337", "0.701164", "0.70088667", "0.7007829", "0.700737", "0.70070124", "0.70069975", "0.69998974", "0.6999735", "0.69992167", "0.6998713", "0.69985986", "0.6997343", "0.6996582", "0.69957423", "0.69922924", "0.69905806", "0.6988383", "0.698833", "0.6986343", "0.69857514", "0.69847983", "0.69788915", "0.69785535", "0.6978336", "0.6976838", "0.6973475", "0.6973336", "0.69718456", "0.6971578", "0.6968889", "0.6968535" ]
0.0
-1
Bootstrap any application services.
public function boot() { Carbon::setLocale('zh'); Comment::observe(CommentObserver::class); Good::observe(GoodObserver::class); Collection::observe(CollectionObserver::class); // User::observe(UserObserver::class); app('Dingo\Api\Transformer\Factory')->setAdapter(function ($app) { $fractal = new \League\Fractal\Manager; $fractal->setSerializer(new \League\Fractal\Serializer\ArraySerializer); return new \Dingo\Api\Transformer\Adapter\Fractal($fractal); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }", "public function boot()\n {\n $this->app->bind(IUserService::class, UserService::class);\n $this->app->bind(ISeminarService::class, SeminarService::class);\n $this->app->bind(IOrganizationService::class, OrganizationService::class);\n $this->app->bind(ISocialActivityService::class, SocialActivityService::class);\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }", "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductServiceInterface::class,ProductService::class);\n $this->app->bind(ShopSettingsServiceInterface::class,ShopSettingsService::class);\n $this->app->bind(FeedbackServiceInterface::class,FeedbackService::class);\n $this->app->bind(UserServiceInterface::class,UserService::class);\n $this->app->bind(ShoppingCartServiceInterface::class,ShoppingCartService::class);\n $this->app->bind(WishlistServiceInterface::class,WishlistService::class);\n $this->app->bind(NewPostApiServiceInterface::class,NewPostApiService::class);\n $this->app->bind(DeliveryAddressServiceInterface::class,DeliveryAddressService::class);\n $this->app->bind(StripeServiceInterface::class,StripeService::class);\n $this->app->bind(OrderServiceInterface::class,OrderService::class);\n $this->app->bind(MailSenderServiceInterface::class,MailSenderSenderService::class);\n }", "public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Ports\n $this->app->bind(\n IAuthenticationService::class,\n AuthenticationService::class\n );\n $this->app->bind(\n IBeerService::class,\n BeerService::class\n );\n\n // Adapters\n $this->app->bind(\n IUserRepository::class,\n UserEloquentRepository::class\n );\n $this->app->bind(\n IBeerRepository::class,\n BeerEloquentRepository::class\n );\n }", "public function boot()\n {\n $this->setupConfig($this->app);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }", "public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }", "public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }", "public function boot()\n {\n $this->app->singleton('LaraCurlService', function ($app) {\n return new LaraCurlService();\n });\n\n $this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }", "public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }", "public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }", "public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }", "public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }", "public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->app->bindMethod([SendMailPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(MailService::class));\n });\n\n $this->app->bindMethod([ClearTokenPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(PasswordResetRepository::class));\n });\n\n $this->app->bind(AuthService::class, function ($app) {\n return new AuthService($app->make(HttpService::class));\n });\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function boot(): void\n {\n $this->loadMiddlewares();\n }", "public function boot()\n {\n $this->app->when(ChatAPIChannel::class)\n ->needs(ChatAPI::class)\n ->give(function () {\n $config = config('services.chatapi');\n return new ChatAPI(\n $config['token'],\n $config['api_url']\n );\n });\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }", "public function boot(){\r\n $this->app->configure('sdk');\r\n $this->publishes([\r\n __DIR__.'/../../resources/config/sdk.php' => config_path('sdk.php')\r\n ]);\r\n $this->mergeConfigFrom(__DIR__.'/../../resources/config/sdk.php','sdk');\r\n\r\n $api = config('sdk.api');\r\n foreach($api as $key => $value){\r\n $this->app->singleton($key,$value);\r\n }\r\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EnvironmentCommand::class,\n EventGenerateCommand::class,\n EventMakeCommand::class,\n JobMakeCommand::class,\n KeyGenerateCommand::class,\n MailMakeCommand::class,\n ModelMakeCommand::class,\n NotificationMakeCommand::class,\n PolicyMakeCommand::class,\n ProviderMakeCommand::class,\n RequestMakeCommand::class,\n ResourceMakeCommand::class,\n RuleMakeCommand::class,\n ServeCommand::class,\n StorageLinkCommand::class,\n TestMakeCommand::class,\n ]);\n }\n }", "public function boot()\n {\n $this->app->bind(WeatherInterface::class, OpenWeatherMapService::class);\n $this->app->bind(OrderRepositoryInterface::class, EloquentOrderRepository::class);\n $this->app->bind(NotifyInterface::class, EmailNotifyService::class);\n }", "public function boot()\n {\n $this->app->bind(DateService::class,DateServiceImpl::class);\n $this->app->bind(DisasterEventQueryBuilder::class,DisasterEventQueryBuilderImpl::class);\n $this->app->bind(MedicalFacilityQueryBuilder::class,MedicalFacilityQueryBuilderImpl::class);\n $this->app->bind(RefugeCampQueryBuilder::class,RefugeCampQueryBuilderImpl::class);\n $this->app->bind(VictimQueryBuilder::class,VictimQueryBuilderImpl::class);\n $this->app->bind(VillageQueryBuilder::class,VillageQueryBuilderImpl::class);\n }", "public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $this->bootPackages();\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands($this->load(__DIR__.'/../Console', Command::class));\n }\n }", "public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }", "public function boot()\n {\n // DEFAULT STRING LENGTH\n Schema::defaultStringLength(191);\n\n // PASSPORT\n Passport::routes(function (RouteRegistrar $router)\n {\n $router->forAccessTokens();\n });\n Passport::tokensExpireIn(now()->addDays(1));\n\n // SERVICES, REPOSITORIES, CONTRACTS BINDING\n $this->app->bind('App\\Contracts\\IUser', 'App\\Repositories\\UserRepository');\n $this->app->bind('App\\Contracts\\IUserType', 'App\\Repositories\\UserTypeRepository');\n $this->app->bind('App\\Contracts\\IApiToken', 'App\\Services\\ApiTokenService');\n $this->app->bind('App\\Contracts\\IModule', 'App\\Repositories\\ModuleRepository');\n $this->app->bind('App\\Contracts\\IModuleAction', 'App\\Repositories\\ModuleActionRepository');\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n $this->registerMigrationFolder();\n $this->registerConfig();\n }\n }", "public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }", "public function boot(): void\n {\n $this->app->bind(Telegram::class, static function () {\n return new Telegram(\n config('services.telegram-bot-api.token'),\n new HttpClient()\n );\n });\n }", "public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }", "public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }", "protected function bootServiceProviders()\n {\n foreach($this->activeProviders as $provider)\n {\n // check if the service provider has a boot method.\n if (method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }", "public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }", "public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}", "public function boot()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->commands([\n ListenCommand::class,\n InstallCommand::class,\n EventsListCommand::class,\n ObserverMakeCommand::class,\n ]);\n\n foreach ($this->listen as $event => $listeners) {\n foreach ($listeners as $listener) {\n RabbitEvents::listen($event, $listener);\n }\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n MultiAuthInstallCommand::class,\n ]);\n }\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }", "public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }", "public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }", "public function boot(): void\n {\n $this->app\n ->when(RocketChatWebhookChannel::class)\n ->needs(RocketChat::class)\n ->give(function () {\n return new RocketChat(\n new HttpClient(),\n Config::get('services.rocketchat.url'),\n Config::get('services.rocketchat.token'),\n Config::get('services.rocketchat.channel')\n );\n });\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}", "public function boot()\n {\n $this->app->booted(function () {\n $this->callMethodIfExists('jobs');\n });\n }", "public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }", "public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }", "public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }", "public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }", "public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }", "public function boot()\n {\n $this->app->bind(CustomersRepositoryInterface::class, CustomersRepository::class);\n $this->app->bind(CountryToCodeMapperInterface::class, CountryToCodeMapper::class);\n $this->app->bind(PhoneNumbersValidatorInterface::class, PhoneNumbersRegexValidator::class);\n $this->app->bind(CustomersFilterServiceInterface::class, CustomersFilterService::class);\n $this->app->bind(CacheInterface::class, CacheAdapter::class);\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([$this->configPath() => config_path('oauth.php')], 'oauth');\n }\n\n app()->bind(ClientToken::class, function () {\n return new ClientToken();\n });\n\n app()->bind(TokenParser::class, function () {\n return new TokenParser(\n app()->get(Request::class)\n );\n });\n\n app()->bind(OAuthClient::class, function () {\n return new OAuthClient(\n app()->get(Request::class),\n app()->get(ClientToken::class)\n );\n });\n\n app()->bind(AccountService::class, function () {\n return new AccountService(app()->get(OAuthClient::class));\n });\n }", "public function boot()\n {\n Client::observe(ClientObserver::class);\n $this->app->bind(ClientRepositoryInterface::class, function ($app) {\n return new ClientRepository(Client::class);\n });\n $this->app->bind(UserRepositoryInterface::class, function ($app) {\n return new UserRepository(User::class);\n });\n }", "public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }", "public function boot()\n {\n $path = __DIR__.'/../..';\n\n $this->package('clumsy/cms', 'clumsy', $path);\n\n $this->registerAuthRoutes();\n $this->registerBackEndRoutes();\n\n require $path.'/helpers.php';\n require $path.'/errors.php';\n require $path.'/filters.php';\n\n if ($this->app->runningInConsole()) {\n $this->app->make('Clumsy\\CMS\\Clumsy');\n }\n\n }", "public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }", "public function boot()\n {\n $this->client = new HttpClient([\n 'base_uri' => 'https://api.ipfinder.io/v1/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP-Torann',\n ],\n 'query' => [\n 'token' => $this->config('key'),\n ],\n ]);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Check::class,\n Clear::class,\n Fix::class,\n Fresh::class,\n Foo::class,\n Ide::class,\n MakeDatabase::class,\n Ping::class,\n Version::class,\n ]);\n }\n }", "public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }", "public function boot()\r\n\t{\r\n\t\t$this->package('estey/hipsupport');\r\n\t\t$this->registerHipSupport();\r\n\t\t$this->registerHipSupportOnlineCommand();\r\n\t\t$this->registerHipSupportOfflineCommand();\r\n\r\n\t\t$this->registerCommands();\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n ControllerMakeCommand::class,\n ServiceMakeCommand::class,\n RepositoryMakeCommand::class,\n ModelMakeCommand::class,\n RequestRuleMakeCommand::class,\n ]);\n }\n }", "public function boot() {\n $srcDir = __DIR__ . '/../';\n \n $this->package('baseline/baseline', 'baseline', $srcDir);\n \n include $srcDir . 'Http/routes.php';\n include $srcDir . 'Http/filters.php';\n }", "public function boot()\n {\n $this->app->bind('App\\Services\\ProviderAccountService', function() {\n return new ProviderAccountService;\n });\n }", "public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/resources/views', 'Counters');\n\n $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Counters');\n\n\n //To load migration files directly from the package\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n\n $this->app->booted(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('Counters', Counters::class);\n\n });\n\n $this->publishes([\n __DIR__ . '/../config/counter.php' => config_path('counter.php'),\n ], 'config');\n\n\n\n $this->publishes([\n __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().\"/migrations/0000_00_00_000000_create_counters_tables.php\",\n ], 'migrations');\n\n\n if ($this->app->runningInConsole()) {\n $this->commands([\\Maher\\Counters\\Commands\\MakeCounter::class]);\n }\n\n\n }", "public function boot(Application $app)\n {\n\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }" ]
[ "0.7344842", "0.7212776", "0.7207748", "0.7123287", "0.7109729", "0.70822036", "0.7076881", "0.70718396", "0.7051853", "0.7025475", "0.7011949", "0.70043486", "0.6955807", "0.69322443", "0.69319373", "0.69272774", "0.6911386", "0.69069713", "0.6898877", "0.6898432", "0.6896597", "0.6889767", "0.6886577", "0.6880688", "0.6875815", "0.6874972", "0.68696195", "0.6864291", "0.6864246", "0.68631536", "0.68599164", "0.6857919", "0.685537", "0.68552583", "0.68522125", "0.6839775", "0.683261", "0.6831196", "0.68272495", "0.68250644", "0.68241394", "0.68181944", "0.68132496", "0.68117976", "0.6811785", "0.6808445", "0.68066794", "0.680175", "0.68005246", "0.67994386", "0.67969066", "0.67912513", "0.67884964", "0.678574", "0.678558", "0.6783794", "0.67782456", "0.6773669", "0.6766658", "0.6766194", "0.67617613", "0.67611295", "0.6758855", "0.6756636", "0.6754412", "0.6751842", "0.6747439", "0.6744991", "0.67441815", "0.6743506", "0.67400324", "0.6739403", "0.6738356", "0.6738189", "0.6731425", "0.6730627", "0.67293024", "0.6726232", "0.67261064", "0.67192256", "0.6716676", "0.6716229", "0.671442", "0.6713091", "0.6702467", "0.66990495", "0.66913867", "0.6689953", "0.66861963", "0.66840357", "0.66826946", "0.6681548", "0.6680455", "0.6676407", "0.6675645", "0.6672465", "0.66722375", "0.66722375", "0.66722375", "0.66722375", "0.66722375" ]
0.0
-1
Display the Debug/Status page
function ninja_forms_tab_system_status(){ // Display the system status! include("system-status-html.php"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show() {\n\t\t$this->view->show('debug/debug');\n\t}", "public function debugActionGet()\n {\n $title = \"Debug\";\n\n $this->app->page->add(\"movie/debug\", [\n ]);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "function debug_output() {\n\t\tglobal $ac_tos_response, $ac_status_response;\n\t\t$response = 'tos' == $_GET['ac_debug'] ? $ac_tos_response : $ac_status_response;\n\t\tif ( empty( $response ) ) {\n\t\t\t$response = 'No response from API :(';\n\t\t} else {\n\t\t\t$response = print_r( $response, 1 );\n\t\t}\n\n\t\t$tos = $this->get_option( 'tos' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$status = $this->get_option( 'wordads_approved' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$house = $this->get_option( 'wordads_house' ) ? 'Yes' : 'No';\n\n\t\t$type = $this->get_option( 'tos' ) && $this->get_option( 'wordads_approved' ) ?\n\t\t\t'updated' :\n\t\t\t'error';\n\n\t\techo <<<HTML\n\t\t<div class=\"notice $type is-dismissible\">\n\t\t\t<p>TOS: $tos | Status: $status | House: $house</p>\n\t\t\t<pre>$response</pre>\n\t\t</div>\nHTML;\n\t}", "public function Run() {\n\t\tif(!$this->IfDebug()) {\n\t\t\t$this->PageViewSetErrorStatus(404, 'NO Twig-TPL-DEBUG Service has been activated on this server ...');\n\t\t\treturn;\n\t\t} //end if\n\t\t//--\n\n\t\t//--\n\t\t$tpl = $this->RequestVarGet('tpl', '', 'string');\n\t\t//--\n\n\t\t//--\n\t\t$this->PageViewSetCfg('rawpage', true);\n\t\t//--\n\t\t$this->PageViewSetVar(\n\t\t\t'main',\n\t\t\t(string) SmartMarkersTemplating::render_file_template(\n\t\t\t\t'lib/core/templates/debug-profiler-util.htm',\n\t\t\t\t[\n\t\t\t\t\t'CHARSET' \t=> Smart::escape_html(SmartUtils::get_encoding_charset()),\n\t\t\t\t\t'TITLE' \t=> '{{ Twig-TPL }} Template Debug Profiling',\n\t\t\t\t\t'MAIN' \t\t=> (string) (new \\SmartModExtLib\\TplTwig\\Templating())->debug($tpl)\n\t\t\t\t],\n\t\t\t\t'no'\n\t\t\t)\n\t\t);\n\t\t//--\n\n\t}", "public function show()\n {\n if ($this->mode > 0) {\n $this->tracker(\"END DEBUG-CLASS\");\n $out .= \"<div align=\\\"left\\\"><table width=\\\"100%\\\" border=\\\"0\\\" cols=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\">\";\n /* $out .= debug::row_top(\"<a name=\\\"debug_top\\\"><b>Quicknavi</b></a>\");\n $out .= debug::row_single(\"<a href=\\\"#debugtracker\\\">Debugtracker</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#debugvars\\\">User-Debugvars</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#post\\\">\\$_POST</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#get\\\">\\$_GET</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#cookie\\\">\\$_COOKIE</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#session\\\">\\$_SESSION</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#server\\\">\\$_SERVER</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#files\\\">\\$_FILES</a>&nbsp;|&nbsp;\"\n .\"<a href=\\\"#sql_querys\\\">SQL-Querys</a>\");*/\n $out .= debug::row_top(\"<a name=\\\"debugtracker\\\"><b>Debugtracker</b></a>\");\n $out .= debug::row_single($this->timer_show());\n /*\n $out .= debug::row_top(\"<a name=\\\"debugvars\\\"><b>Userdefined Debugvars</b></a>\");\n $out .= debug::row_array($this->debugvars);\n $out .= debug::row_top(\"<a name=\\\"post\\\"><b>\\$_POST-Data</b></a>\");\n $out .= debug::row_array($_POST);\n $out .= debug::row_top(\"<a name=\\\"get\\\"><b>\\$_GET-Data</b></a>\");\n $out .= debug::row_array($_GET);\n $out .= debug::row_top(\"<a name=\\\"cookie\\\"><b>\\$_COOKIE-Data</b></a>\");\n $out .= debug::row_array($_COOKIE);\n $out .= debug::row_top(\"<a name=\\\"session\\\"><b>\\$_Session-Data</b></a>\");\n $out .= debug::row_array($_SESSION);\n $out .= debug::row_top(\"<a name=\\\"server\\\"><b>\\$_SERVER-Data</b></a>\");\n $out .= debug::row_array($_SERVER);\n $out .= debug::row_top(\"<a name=\\\"files\\\"><b>\\$_FILES-Data</b></a>\");\n $out .= debug::row_array($_FILES);\n */\n $out .= debug::row_top(\"<a name=\\\"sql_querys\\\"><b>SQL-Querys (\".count($this->sql_query_list).\")</b></a>\");\n $out .= $this->query_fetchlist();\n $out .= \"</table></div>\";\n // Mode 2 write complete Debugvars to a file. The directory has to be protected.\n if ($this->mode == \"2\") {\n echo $this->mode;\n $file_handle = fopen($this->debug_path.\"debug_\".time().\".htm\", \"a\");\n fputs($file_handle, $out);\n fclose($file_handle);\n }\n return $out;\n } else {\n return \"\";\n }\n }", "public function show() {\n Logger::debug(\"url:{$this->header}, replace: {$this->replace}, responseCode: {$this->responseCode}\");\n }", "static function show()\n {\n $trace = self::log();\n ?>\n <style type=\"text/css\">\n #-pt-debug { position:relative; z-index:2147483584; background-color:rgba(255,255,255,0.9); margin:20px; padding:20px 20px 40px 20px; font:14px/20px Tahoma; border:#666 dashed 1px; opacity:0.2; text-align:left; }\n #-pt-debug:hover { opacity:1; }\n #-pt-debug legend { text-shadow:1px -2px 0px #FFF; font:bold 16px Tahoma; margin:0px; border:0px; width:auto; }\n #-pt-debug p { margin-top:5px; }\n #-pt-debug p code { display:block; background:#FAFAFA; border:#DDD solid 1px; font-size:12px; padding:10px; margin:5px 0px 0px 30px; }\n #-pt-debug .pt-error { color:#CB1818; }\n #-pt-debug .pt-warning { color:#E88500; }\n #-pt-debug ._cls { position:absolute; top:20px; right:15px; color:#E00; font-weight:bold; font-size:16px; }\n </style>\n <fieldset id=\"-pt-debug\">\n <legend>DEBUG MESSAGE</legend>\n <?php foreach ($trace as $value) { ?>\n <p class=\"pt-<?php echo $value['type']; ?>\"><?php echo is_string($value['message']) ? $value['message'] : var_export($value['message'], true); ?></p>\n <?php } ?>\n <a class=\"_cls\" href=\"javascript:;\" onclick=\"this.parentNode.style.display='none'\">CLOSE</a>\n </fieldset>\n <?php\n }", "function debug_index() {\n\t$response = new Response(Request::http_version());\n\t$response->content_type('text/html; charset=iso-8859-1');\n\t$response->body(<<<HTML\n<!doctype html>\n<html>\n<head>\n<title>Debug</title>\n</head>\n<body>\n<h1>Debug</h1>\n<ul>\n<li><a href=\"/debug/phpinfo/\">PHP Info</a></li>\n<li><a href=\"/debug/error-test/\">Error Test</a></li>\n<li><a href=\"/debug/test/\">Model Test</a></li>\n<li><a href=\"/debug/headers/\">Headers</a></li>\n</ul>\n</body>\n</html>\nHTML\n\t);\n\treturn $response;\n}", "function Debug($debug, $msg = \"Debugging\"){\n\tif(ENV == PRODUCTION && (!isset($_GET['debug'])) ){\n\t\treturn;\n\t}\n\n\techo '<pre class=\"debug\">';\n\techo '<h2>'.$msg.'</h2>';\n\tprint_r($debug);\n\techo '</pre>';\n}", "public function display()\n {\n $this->view->viewFile = \"404\";\n echo $this->view->generateMarkup();\n }", "public static function show(){\r\n\t\techo \r\n\t\t\tIncludes::Head()\r\n\t\t \t. Includes::Header()\r\n\t\t\t. \"<div class='page-header'>\r\n\t\t\t \t<h1>Error 404 - ¡Uuups!</h1>\r\n\t\t\t </div>\"\r\n\t\t\t . \"<p>La pagina a la que intenta acceder parece no existir.</p>\r\n\t\t\t <div class='alert alert-danger'><strong>No se haga el hacker<strong>, vaya a estudiar.</div>\"\r\n\t\t\t . Includes::Footer();\r\n\t}", "public function displayPageStart()\n {\n if( isset( $_SERVER[\"HTTP_HOST\"] ) && true === $this->display )\n {\n echo '<pre style=\"font-size: 11px; line-height: 7px;\">';\n }\n }", "public function debug()\n {\n // Get the request paramaters\n $request = Zend_Controller_Front::getInstance()->getRequest()->getParams();\n\n // Create the string variable\n $string = <<<HTML\n <div id=\"debugArea\">\n <b>Debug Area</b>\n <hr />\nHTML;\n\n // Run the isfacebook method\n $string .= self::_isFacebook();\n\n // Run the isTodo method\n $string .= '<b>Todo</b>';\n $string .= self::_isTodo();\n\n // Output the Request Paramaters\n $string .= '<b>Paramaters</b><br />';\n $string .= Zend_Debug::dump($request, '<b>All Params</b>', false);\n $string .= Zend_Debug::dump($_REQUEST, '<b>Request Paramaters</b>', false);\n\n // Get the Auth Instance\n $auth = Zend_Auth::getInstance();\n\n // Check if this user is logged in\n if ($auth->hasIdentity()) {\n $string .= Zend_Debug::dump($auth->getIdentity(), '<b>Zend Auth</b>', false);\n }\n\n // If Files is not empty then output these\n if (!empty($_FILES)) {\n $string .= Zend_Debug::dump($_FILES, '<b>Files</b>', false);\n }\n\n // End the DIV\n $string .= '</div>';\n\n return $string;\n }", "public static function div_main_debug() {\n\n\t//--\n\tif(!SmartFrameworkRuntime::ifDebug()) {\n\t\treturn '';\n\t} //end if\n\t//--\n\n\t//--\n\treturn '<div id=\"SmartFramework__Debug__Profiler\"></div>';\n\t//--\n\n}", "function _showStatus() {\r\n $okMessage = implode('<br />', $this->_okMessage);\r\n $errMessage = implode('<br />', $this->_errMessage);\r\n\r\n if (!empty($errMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_ERROR_MESSAGE', $errMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('errormsg');\r\n }\r\n\r\n if (!empty($okMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_OK_MESSAGE', $okMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('okmsg');\r\n }\r\n }", "public function debug();", "public function debug();", "public function displayUpgradePage()\n {\n global $token;\n $upgraderVesion = $this->context['versionInfo'][0];\n $upgraderBuild = $this->context['versionInfo'][1];\n $this->log(\"WebUpgrader v.\" . $upgraderVesion . \" (build \" . $upgraderBuild . \") starting\");\n include dirname(__FILE__) . '/upgrade_screen.php';\n }", "public function err_page()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n $site->printNav();\n echo \"An Error has occured and your request could not be completed. Return <a href=\\\"index.php\\\">Home</a>\";\n $site->printFooter();\n }", "public function display()\n\t{\n\t\tprint_r(\"<br/>RedheadDuck looks like this!<br/>\");\n\t}", "function showPage() \n\t{\n\t\t$this->xt->display($this->templatefile);\n\t}", "public function debug()\n {\n \t// Observer responses\n \t$responses = array();\n \t \n \t// Interate the observers and fire their handle() method\n \tforeach($this->observers as $observer){\n \t\t$responses[get_class($observer)] = $observer->handle($this->breakpoints);\n \t}\n \t\n \t// Generate the notification email content\n \t$viewData = array('responses' => $responses);\n \t$message = $this->CI->load->view('Notification', $viewData, true);\n \t \n \t// Prepare the to addresses\n \t$to = implode(',', $this->config['emailTo']);\n \t\n \t// Set the message subject\n \t$subject = '[' . $this->CI->config->item('base_url') . '] Debug Notification';\n \t\n \t// Prepare mail headers\n \t$headers = array(\n \t\t'From: ' . $this->config['emailFrom'],\n \t\t'Content-Type:text/html; charset=utf-8'\n \t);\n \t\n \t// Send the message\n \tmail($to, $subject, $message, implode(PHP_EOL, $headers));\n }", "public static function printErrors() {\n\t\tif (PNApplication::hasErrors()) {\n\t\t\tforeach (PNApplication::$errors as $e)\n\t\t\t\techo \"<div style='color:#C00000;font-familiy:Tahoma;font-size:10pt'><img src='\".theme::$icons_16[\"error\"].\"' style='vertical-align:bottom'/> \".$e.\"</div>\";\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"if (typeof window.top.status_manager != 'undefined'){\";\n\t\t\tforeach (PNApplication::$errors as $e)\n\t\t\t\techo \"window.top.status_manager.addStatus(new window.top.StatusMessageError(null,\".json_encode($e).\",5000));\";\n\t\t\techo \"};\";\n\t\t\techo \"window.page_errors=[\";\n\t\t\t$first = true;\n\t\t\tforeach (PNApplication::$errors as $e) {\n\t\t\t\tif ($first) $first = false; else echo \",\";\n\t\t\t\techo json_encode($e);\n\t\t\t}\n\t\t\techo \"];\";\n\t\t\techo \"</script>\";\n\t\t}\n\t\tif (PNApplication::hasWarnings()) {\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"if (typeof window.top.status_manager != 'undefined'){\";\n\t\t\tforeach (PNApplication::$warnings as $e)\n\t\t\t\techo \"window.top.status_manager.addStatus(new window.top.StatusMessage(window.top.Status_TYPE_WARNING,\".json_encode($e).\",[{action:'popup'},{action:'close'}],5000));\";\n\t\t\techo \"};\";\n\t\t\techo \"</script>\";\n\t\t}\n\t}", "function print_debugger()\n\t{\n\t\t$output = str_replace(\"\\n\", \"<br/>\\n\", $this->debugger);\n\t\techo $output;\t\n\t}", "private function debug($message) {\n if ($this->debug) echo $message . \"\\n\";\n if ($this->htmldebug) {\n echo \"<br />\\n\";\n ob_flush();\n }\n }", "protected function displayMaintenancePage()\n {\n }", "protected function displayMaintenancePage()\n {\n }", "protected function displayMaintenancePage()\n {\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "function show() {\n // Abort if empty file\n if($this->oParser->oManager->tsCurDate < 1) {\n return;\n }\n \n // We want to process the output later\n ob_start();\n\n $this->printHeading();\n $this->printDailyMessages();\n $this->printAbsentTeachers();\n $this->printStandInTable();\n $this->printStandInTableFooter();\n\n $str = ob_get_clean();\n #debugPrint($str);\n echo vpBeautifyString($str);\n }", "public function menu_page() {\n\t\tinclude EPT_PATH . 'views/troubleshoot.php';\n\t}", "public function show() {\n $this->buildPage();\n echo $this->_page;\n }", "function debug($status = array())\n {\n $this->debug = $status;\n }", "public function show()\n {\n /** Configure generic views */\n $this->setupViews();\n /** Render views */\n ?>\n <html>\n <body>\n <?php\n /** Render views */\n $this->head_view->render();\n $this->secondary_nav_bar->render();\n $this->tree_view->render();\n $this->title_view->render();\n $this->primary_nav_bar->render();\n $this->render_page();\n ?>\n </body>\n </html>\n <?php\n }", "function debugger(){\n $debug = 1;\n if($debug === 1) {\n header(\"Content-Type: text/html; charset=utf-8\");\n error_reporting(E_ALL);\n ini_set('display_errors', 1);\n }else{\n error_reporting( 0 );\n }\n}", "function testDebugShow() {\n ob_start();\n Debug::out('Testing, testing, 123.');\n $output = ob_get_clean();\n $this->assertPattern('/<pre>Testing, testing, 123.<\\/pre>/is', $output);\n }", "static function show($val, $showHeader = true) {\n\t\tif(!Director::isLive()) {\n\t\t\tif($showHeader) {\n\t\t\t\t$caller = Debug::caller();\n\t\t\t\tif(Director::is_ajax() || Director::is_cli())\n\t\t\t\t\techo \"Debug ($caller[class]$caller[type]$caller[function]() in line $caller[line] of \" . basename($caller['file']) . \")\\n\";\n\t\t\t\telse \n\t\t\t\t\techo \"<div style=\\\"background-color: white; text-align: left;\\\">\\n<hr>\\n<h3>Debug <span style=\\\"font-size: 65%\\\">($caller[class]$caller[type]$caller[function]() \\n<span style=\\\"font-weight:normal\\\">in line</span> $caller[line] \\n<span style=\\\"font-weight:normal\\\">of</span> \" . basename($caller['file']) . \")</span>\\n</h3>\\n\";\n\t\t\t}\n\t\t\t\n\t\t\techo Debug::text($val);\n\t\n\t\t\tif(!Director::is_ajax() && !Director::is_cli()) echo \"</div>\";\n\t\t\telse echo \"\\n\\n\";\n\t\t}\n\n\t}", "function view() {\n $status_update = StatusUpdates::findById($this->request->get('status_update_id'));\n \n if (!instance_of($status_update, 'StatusUpdate')) {\n $this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n \n $this->redirectToUrl($status_update->getRealViewUrl($this->status_updates_per_page));\n die();\n }", "private static function debugging($message) {\r\n $debugdisplay = ini_get('display_errors');\r\n\r\n if (($debugdisplay == '1' || strtolower($debugdisplay) == 'on') && (error_reporting() >= E_ALL | E_STRICT)) {\r\n if (defined('CLI_SCRIPT') && CLI_SCRIPT) {\r\n echo \"++ $message ++\\n\";\r\n } else {\r\n echo '<div class=\"notifytiny debuggingmessage\" data-rel=\"debugging\">' , $message , '</div>';\r\n }\r\n }\r\n }", "protected function status( $status )\n\t{\n\t\techo $status . PHP_EOL;\n\t}", "public function show() {\n\t\t$variables = $this->sanitize($this->data);\n\t\tif (is_array($variables)) {\n\t\t\textract($variables);\n\t\t}\n\n\t\t$this->setHeaders();\n\n\t\tob_start();\n\t\tif ($this->isPartial) {\n\t\t\trequire_once $this->pathToPartial;\n\t\t} else {\n\t\t\trequire_once $this->pathToLayout;\n\t\t}\n\t\t$this->performReplacements();\n\t\tif (ob_get_length() !== false) {\n\t\t\tob_end_flush();\n\t\t}\n\t}", "private function showProjectInfo()\n {\n // URLs\n $this->output->writeln('');\n $this->output->writeln('<info>'. $this->project->getName(false) .'</info> has now been created.');\n $this->output->writeln('<comment>Development:</comment> ' . $this->project->getDevUrl());\n $this->output->writeln('<comment>Staging:</comment> ' . $this->project->getStagingUrl());\n $this->output->writeln('<comment>Production:</comment> N/A');\n\n // Database credentials\n $databaseCredentials = $this->project->getDatabaseCredentials('dev');\n $this->output->writeln('');\n $this->output->writeln('<info>Development MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n\n $databaseCredentials = $this->project->getDatabaseCredentials('staging');\n $this->output->writeln('');\n $this->output->writeln('<info>Staging MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n $this->output->writeln('');\n\n // We're done!\n $this->output->writeln('<info>You can now run \"cd '. $this->project->getName() .' && vagrant up\"</info>');\n }", "public function toScreen() {\r\n\t\t\t$sDefaultFile = 'errors.log';\r\n\t\t\t$sFileTime = @date('Ymd');\r\n\t\t\t$sPath = $sFileTime . '_' . $sDefaultFile;\r\n\t\t\t$rFile = @fopen($sPath, 'r');\r\n\t\t\tif ($rFile !== FALSE) {\r\n\t\t\t\t$sContent = '<pre>';\r\n\t\t\t\twhile (!feof($rFile)) {\r\n\t\t\t\t $sContent .= fread($rFile, 8192);\r\n\t\t\t\t}\r\n\t\t\t\t$sContent .= '</pre>';\r\n\t\t\t\tfclose($rFile);\r\n\t\t\t\tprint $sContent;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\terror_log('Impossible to open the log file ' . $sPath . '', 0);\r\n\t\t\t}\r\n\t\t}", "public function debug(): void\n {\n echo \"CLIENT : \" . PHP_EOL;\n echo \"=========\" . PHP_EOL;\n echo \"URL : \" . $this->getUrl(). PHP_EOL;\n echo \"METHOD : \" . $this->method. PHP_EOL;\n echo \"SPA ID : \" . $this->spaceId. PHP_EOL;\n echo \"ACCEPT : \" . $this->acceptContentType. PHP_EOL;\n echo \"C TYPE : \" . $this->contentType . PHP_EOL;\n echo \"API : \" . $this->apiType. PHP_EOL;\n echo \"TOKEN : \" . $this->c->getCredentials()->getAccessToken(). PHP_EOL;\n echo \"GEOJSON: \" . $this->geojsonFile. PHP_EOL;\n var_dump($this->requestBody);\n echo \"=========\" . PHP_EOL;\n }", "public function report()\n\t{\n\t\t$startTime = microtime();\n\n\t\t// pull in globals needed\n\t\tglobal $GLOBALS;\n\t\tglobal $CONFIG;\n\t\tglobal $globals_count;\n\t\t\n\t\t$output = \"\";\n\n\t\t// produce some CSS data\n\t\tif($CONFIG['debug_style']) $this->printStyleSheet();\n\t\n\t\t// print debugging log\n\t\t$output .= $this->format_log();\n\n\t\t// collect script globals\n\t\t$varcount = 0;\n\t\tforeach($GLOBALS as $g_key => $g_value)\n\t\t{\n\t\t\tif(++$varcount > $globals_count)\n\t\t\t{\n\t\t\t\t// these are handled later so don't process them\n\t\t\t\tif ($g_key != 'HTTP_SESSION_VARS' && $g_key != '_SESSION')\n\t\t\t\t{\n\t\t\t\t\t$script_globals[$g_key] = $g_value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// no need to show our own global\n\t\tunset($script_globals['globals_count']);\n\n\t\t// print variable arrays\n\t\t$variablesArray['script_globals'] = array('Script Globals', '#7DA7D9', 'globals');\n\t\t$variablesArray['_GET'] = array('$_GET', '#7DA7D9', '_get');\n\t\t$variablesArray['_POST'] = array('$_POST', '#F49AC1', '_post');\n\t\t$variablesArray['_FILES'] = array('$_FILES', '#82CA9C', '_files');\n\t\t$variablesArray['_SESSION'] = array('$_SESSION', '#FCDB26', '_session');\n\t\t$variablesArray['_COOKIE'] = array('$_COOKIE', '#A67C52', '_cookie');\n\t\t\n\t\tif($CONFIG['debug_server_vars']) $variablesArray['_SERVER'] = array('$_SERVER', '#f3f4f5', '_server');\n\t\tif($CONFIG['debug_env_vars']) $variablesArray['_ENV'] = array('$_ENV', '#f3f4f5', '_env');\n\n\t\tforeach($variablesArray as $arrayName => $arrayData)\n\t\t{\n\t\t\tif($arrayName != 'script_globals') global $$arrayName;\n\t\t\tif($$arrayName)\n\t\t\t{\n\t\t\t\t$output .= '<div id=\"section\" class=\"'.$arrayData[2].'\"><h3>'.$arrayData[0].'</h3>';\n\t\t\t\t$output .= debug_print_array( $$arrayName );\n\t\t\t\t$output .= '</div>';\n\t\t\t}\n\t\t}\n\n\t\t$endTime = microtime();\n\t\t\n\t\tlist($s_usec, $s_sec) = explode(\" \", $startTime);\n\t\tlist($e_usec, $e_sec) = explode(\" \", $endTime);\n\t\t$runTime = round(((float)$e_usec + (float)$e_sec) - ((float)$s_usec + (float)$s_sec), 6);\n\n\t\t// output report\n\t\t$output = '<div id=\"debug\">\n\t\t\t<h2>DEBUG\n\t\t\t\t<span style=\"color: red; font-weight: normal; font-size: 9px; float: right; text-align: right; margin-top: 4px;\">\n\t\t\t\t\t(debug generated in <strong>'.$runTime.' s</strong>)\n\t\t\t\t</span>\n\t\t\t</h2>\n\t\t'.$output.'\n\t\t</div>';\n\n\t\t//\tDebug Window\n\t\t//\tCurrently not functioning\n/*\t\t\n\t\tif($CONFIG['debug_window'])\n\t\t{\n\t\t\t$debugwindow_origin = $_SERVER[\"HTTP_HOST\"].$_SERVER[\"REQUEST_URI\"];\n\t\t\tprint '\n\t\t\t\t<script type=\"text/javascript\" language=\"JavaScript\">\n\t\t\t\t\tvar debugwindow;\n\t\t\t\t\talert(\"Debugging...\");\t\n\t\t\t\t\tdebugwindow = window.open(\"\", \"\", \"menubar=no,scrollbars=yes,resizable=yes,width=640,height=480\");\n\t\t\t\t\tdebugwindow.document.open();\n\t\t\t\t\tdebugwindow.document.write(\"'.addslashes($output).'\");\n\t\t\t\t\tdebugwindow.document.close();\n\t\t\t\t\tdebugwindow.document.title = \"Debugwindow for : http://'.$debugwindow_origin.'\";\n\t\t\t\t\tdebugwindow.focus();\n\t\t\t\t</script>\n\t\t\t';\n\t\t}\n\t\telse\n\t\t{\n*/\n\t\t\tprint $output;\n\n/*\n\t\t}\n*/\n\t}", "private static function display(string $view, string $title, int $status) {\n\n\t\t\t$screen = self::get($view);\n\n\t\t\t# Set data\n\n\t\t\t$screen->language = Extend\\Languages::get('iso');\n\n\t\t\t$screen->title = Language::get($title);\n\n\t\t\t$screen->copyright = Date::getYear();\n\n\t\t\t# ------------------------\n\n\t\t\tTemplate::output($screen, $status);\n\t\t}", "public function showInfo(){\n if(defined('PLUGIN_OPTIONS'))\n return $this->moduleShowInfo();\n return browser\\msg::pageNotFound();\n }", "public function display_option_debug() {\n $debug = (bool) $this->options['debug'];\n $this->display_checkbox_field('debug', $debug);\n }", "public function actionDemo()\n {\n CommonUtility::startProfiling();\n try\n {\n //code\n }\n catch(Exception $e)\n { \n //catch exception\n $msg = $e->getMessage();\n CommonUtility::catchErrorMsg( $msg );\n }\n CommonUtility::endProfiling();\n }", "public function display() {\r\n\t\t$this->script();\r\n\t\t$this->html();\r\n\t\t\r\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function run(): void\n {\n try {\n $content = $this->handleRequest();\n } catch (\\Exception $e) {\n if (DEBUG_MODE) {\n ob_start();\n include __DIR__ . '/../views/error/error.php';\n $content = ob_get_clean();\n } else {\n $content = self::$config['error_message'];\n }\n }\n\n echo self::$view->renderPage($content);\n }", "private static function showError($aDebug)\n\t{\n\t\techo '<table style=\"background-color:red\" cellpadding=\"10\" cellspacing=\"10\" width=\"100%\"><tr><td style=\"background-color:orange;\">';\n\t\techo ' line '.$aDebug[\"line\"].'&nbsp;';\n\t\techo ' in file '.$aDebug[\"file\"].'<br/>';\n\t\techo ' code '.$aDebug[\"code\"].'&nbsp;';\n\t\techo ' message '.$aDebug[\"message\"];\n\t\techo '</td></tr></table>';\n\t}", "public static function displayUpdate() {\n\n\t\t\tself::display('Main/Status/Update', 'STATUS_TITLE_UPDATE', STATUS_CODE_503);\n\t\t}", "public function show(Status $status)\n {\n //\n }", "public function show(Status $status)\n {\n //\n }", "public function show(Status $status)\n {\n //\n }", "public function debug()\n {\n return '<dl>\n\t\t\t\t<dt><strong>URL</strong></dt>\n\t\t\t\t<dd>' . $this->url . '</dd>\n\t\t\t\t<dt><strong>Code</strong></dt>\n\t\t\t\t<dd>' . $this->code . '</dd>\n\t\t\t\t<dt><strong>Response</strong></dt>\n\t\t\t\t<dd><pre>' . $this->raw . '</pre></dd>\n\t\t\t\t<dt><strong>Errors</strong></dt>\n\t\t\t\t<dd>' . Debug::text(json_decode(json_encode($this->error), true)) . '</dd>\n\t\t\t </dl>';\n }", "function Output ( $html = 0 ){\n // default to no html. (useful for cli applications)\n // only output if debugging is actually enabled.\n if ($this->debug_status) {\n if ($html) {\n $this->debug_out = \"<div id=\\\"debug\\\"><h4>Debug:</h4><p>\" . nl2br($this->debug_out) . \"</p></div>\";\n }\n return $this->debug_out;\n }\n }", "public function debugAction() : string\n {\n // Deal with the action and return a response.\n //return __METHOD__ . \", \\$db is {$this->db}\";\n return \"Debug my database!!\";\n }", "function dev_debug_display( $thing ) {\n\techo '<pre>';\n\tprint_r( $thing );\n\techo '</pre>';\n}", "protected function displayMaintenancePage()\n {\n return;\n }", "function showTestResult($debug = 0, $html = 0) {\n // debug output\n if ($debug) $this->show = 1;\n if ($debug) {\n echo str_repeat(\"-\",50).$html?\"<br>\\n\":\"\\n\";\n }\n\n echo \"testing $this->test_name : \";\n\n if ($debug) {\n print \"method params: \";\n print_r($this->params);\n print \"\\n\";\n }\n\n $ok = $this->result['success'];\n if ($ok) {\n if ($html) {\n print \"<font color=\\\"#00cc00\\\">SUCCESS</font>\\n\";\n } else {\n print \"SUCCESS\\n\";\n }\n } else {\n $fault = $this->result['fault'];\n if ($fault) {\n \t\t$res = $fault->faultcode;\n $pos = strpos($res,':');\n if ($pos !== false) {\n \t$res = substr($res,$pos+1); \t\n }\n if ($html) {\n print \"<font color=\\\"#ff0000\\\">FAILED: [$res] {$fault->faultstring}</font>\\n\";\n } else {\n print \"FAILED: [$res] {$fault->faultstring}\\n\";\n }\n } else {\n if ($html) {\n print \"<font color=\\\"#ff0000\\\">FAILED: \".$this->result['result'].\"</font>\\n\";\n } else {\n print \"FAILED: \".$this->result['result'].\"\\n\";\n }\n }\n }\n if ($debug) {\n if ($html) {\n echo \"<pre>\\n\".htmlentities($this->result['wire']).\"</pre>\\n\";\n } else {\n echo \"\\n\".htmlentities($this->result['wire']).\"\\n\";\n }\n }\n }", "public static function menu_debug() {\n\t\tadd_submenu_page(\n\t\t\t'tools.php',\n\t\t\t__('Debug File Validation', 'blob-mimes'),\n\t\t\t__('Debug File Validation', 'blob-mimes'),\n\t\t\t'manage_options',\n\t\t\t'blob-mimes-admin',\n\t\t\tarray(get_called_class(), 'page_debug')\n\t\t);\n\t}", "public function display() {\n echo $this->render();\n }", "public function render() {\n echo \"<!DOCTYPE html>\\n\";\n echo \"<html>\\n\";\n $this->show_head();\n \n echo\"\\n<body>\\n\";\n echo $this->show_contents();\n\n echo \"\\n</body>\";\n echo \"\\n</html>\\n\\n\";\n }", "public function index() {\n $status = simplexml_load_file('http://bsx.jlparry.com/status');\n $this->data['gamenum'] = 'Game round number: ' . $status->round;\n $this->data['gamestatus'] = 'Game status: ' . $status->desc;\n $this->data['countdown'] = 'Count down: ' . $status->countdown;\n\n if ($this->session->has_userdata('username')) {\n $this->data['logindata'] = '<a href=\"/login/logout\">Logout</a>';\n $this->data['username'] = $this->session->userdata('username');\n } else {\n $this->data['logindata'] = '<a href=\"/login\">Login</a>';\n }\n $this->data['pagebody'] = 'admin';\n $this->render();\n }", "public function debug()\n {\n echo '<h3>Request Object</h3>';\n echo '<pre>';\n var_dump($this->request);\n echo '</pre>';\n\n echo '<hr/>';\n\n echo '<h3>Request XML</h3>';\n echo '<textarea class=\"widefat\" rows=\"10\">';\n echo htmlentities( $this->service->__getLastRequest() );\n echo '</textarea>';\n\n echo '<hr/>'; \n\n echo '<h3>Response Object</h3>';\n echo '<pre>';\n var_dump($this->response);\n echo '</pre>';\n\n echo '<hr/>';\n\n echo '<h3>Response XML</h3>';\n echo '<textarea class=\"widefat\" rows=\"10\">';\n echo htmlentities( $this->service->__getLastResponse() );\n echo '</textarea>';\n }", "public function printHTML()\n {\n\n $html = '<main style=\"margin-top:20px \">\n <div class=\"container-md\">';\n echo $_SESSION['error'];\n $html .= $this->errorHandler();\n\n if ($this->e == null) {\n $html .= $this->htmlFormHead();\n $html .= $this->htmlFavoriteGames();\n $html .= $this->htmlGameTime();\n }\n\n if ($this->e == \"updatePassword\") {\n $html .= $this->htmlFormUpdatePassword();\n }\n\n $html .= \"</div></main> \";\n\n echo $html;\n }", "public function dev(){\n $view = array(\n 'content' => 'developers'\n );\n $this->load->view('includes/content', $view);\n }", "public function show()\n {\n echo 1;die;\n }", "public function render() {\n\t\t$this->title = \"Pagina niet gevonden\";\n\t\techo \"\\t\\t\\t\\t\\t<h2>404</h2>\\n\\t\\t\\t\\t\\t<p>De opgegeven pagina kon niet gevonden worden</p>\";\n\t}", "Public function displayInfo(){ \r\n\t\t\techo \"The info about the dress.\"; \r\n\t\t\techo $this->color; \r\n\t\t\techo $this->fabric ; \r\n\t\t\techo $this->design;\r\n\t\t\techo self::MEDIUM;\r\n\t\t}", "public function debug()\n {\n add_settings_field(\n 'debug',\n apply_filters($this->plugin_name . 'label-debug', esc_html__('Debug', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable debug at the bottom of your security.txt file & this page.',\n 'id' => 'debug',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['debug']) ? $this->options['debug'] : false,\n ]\n );\n }", "private function show_template_view( $error = NULL )\n {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n \n $params = array(\n 'id' => onapp_get_arg('id'),\n 'error' => onapp_string( $error ),\n 'title' => onapp_string('DEBUG_LOGS' ),\n 'info_title' => onapp_string('DEBUG_LOGS'),\n 'info_body' => onapp_string('DEBUG_LOGS_INFO'),\n );\n\n onapp_show_template( 'debugLogs_view', $params );\n\n \n }", "public static function displayMaintenance() {\n\n\t\t\tself::display('Main/Status/Maintenance', 'STATUS_TITLE_MAINTENANCE', STATUS_CODE_503);\n\t\t}", "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 }", "static function create_debug_view() {\n\t\tif(Director::is_cli() || Director::is_ajax()) return new CliDebugView();\n\t\telse return new DebugView();\n\t}", "private function displayDebug($res){\n\t\tif( $this->waitForHeaders &&\n\t\t\t((ob_get_level() && ob_get_length() === 0) || (!ob_get_level() && !headers_sent())) ){\n\t\t\tarray_push($this->queue, $res);\n\t\t} else {\n\t\t\t$this->purgeQueue();\n\t\t\techo $res;\n\t\t}\n\t}", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }", "public function Display()\n\t\t{\n\t\t\techo \"<html>\\n<head>\\n\";\n\t\t\t$this -> DisplayTitle();\n\t\t\t$this -> DisplayKeywords();\n\t\t\t$this -> DisplayStyles();\n\t\t\techo \"</head>\\n<body>\\n\";\n\t\t\t$this -> DisplayHeader();\n\t\t\t$this -> DisplayMenu($this->buttons);\n\t\t\techo $this->content;\n\t\t\t$this -> DisplayFooter();\n\t\t\techo \"</body>\\n</html>\\n\";\n\t\t}", "protected function dumpPage() {\n\t\tif ($this->_debugCatcher !== null) {\n\t\t\t$this->_debugCatcher->flush();\n\t\t}\n\n\t\t$this->_dumped = true;\n\t\tparent::dumpPage();\n\t}", "public function show(status $status)\n {\n //\n }", "public function displayHeader()\n {\n // Display the page start in case of an html page\n $this->displayPageStart();\n \n // Display the script header line\n $this->display( sprintf( \"%s - version %s\". PHP_EOL, $this->scriptName, $this->version ) );\n \n // Display settings?\n if( null !== $this->limit || null !== $this->remove || null !== $this->update )\n {\n $this->display( PHP_EOL .'Settings:' );\n\n // Display the \"debug\" setting\n if( true === $this->debug )\n {\n $this->display( PHP_EOL . \"- debug mode enabled\" );\n }\n \n // Display the \"limit\" setting\n if( null !== $this->limit )\n {\n $line = 'no limit';\n if( is_int($this->limit) )\n {\n $line = sprintf( \"%d hour%s\", $this->limit, ( 1 < $this->limit ? 's' : '' ) );\n }\n $this->display( PHP_EOL . sprintf( \"- limit : %s\", $line ) );\n }\n \n // Display the \"remove\" setting\n if( null !== $this->remove )\n {\n $line = \"Data will be removed.\";\n if( true !== $this->remove )\n {\n $line = 'No data is removed from the database!'. PHP_EOL .' Change the \"REMOVE\" setting if you want to remove releases or parts';\n }\n $this->display( PHP_EOL . sprintf( \"- remove: %s\", $line ) );\n }\n \n // Display the \"update\" setting\n if( null !== $this->update )\n {\n $line = \"Data will be updated.\";\n if( true !== $this->update )\n {\n $line = 'No data is updated in the database!'. PHP_EOL .' Change the \"UPDATE\" setting if you want to enable update';\n }\n $this->display( PHP_EOL . sprintf( \"- update: %s\", $line ) );\n }\n \n // Spacer\n $this->display( PHP_EOL );\n }\n \n // End spacer\n $this->display( PHP_EOL );\n }", "public function display()\n {\n if (waRequest::isXMLHttpRequest()) {\n $this->getResponse()->addHeader('Content-Type', 'application/json');\n }\n $this->getResponse()->sendHeaders();\n if (!$this->errors) {\n $data = $this->response;\n echo json_encode($data);\n } else {\n $type = ifset($this->response, 'type', null);\n $timestamp = ifset($this->response, 'timestamp', null);\n $errors = array('error' => $this->errors);\n if ($type) {\n $errors['type'] = $type;\n }\n if ($timestamp) {\n $errors['timestamp'] = $timestamp;\n }\n echo json_encode($errors);\n }\n }", "public function show()\n {\n //the board string is used in the view\n $data = $this->getBoardAsString();\n require VIEW_PATH.'web.php';\n\n }", "function debug($header, $something) {\n echo \"<h1>$header</h1>\\n\";\n echo \"<div class='debug'>\\n\";\n print_r($something);\n echo \"\\n</div>\\n\";\n}", "public function debugAction() : string\n {\n // Deal with the action and return a response.\n return \"Debug my game\";\n }", "public function display_log() {\n\t\t$log_choices = $this->get_available_logs();\n\t\t$log_engines = $this->get_log_engines();\n\t\t$log_levels = $this->get_logging_levels();\n\t\t$log_entries = $this->get_log_entries();\n\t\t$download_url = $this->get_log_url();\n\n\t\tob_start();\n\t\tinclude trailingslashit( Tribe__Main::instance()->plugin_path ) . 'src/admin-views/event-log.php';\n\t\treturn ob_get_clean();\n\t}", "public function logStatus()\n {\n //piece to handle the login/logout\n $u = $this->isAuth();\n $lstr = ($u) ? '<a href=\"/user/main\">' . $u .\n '</a> <a href=\"/user/logout\">[logout]</a>' :\n '<a href=\"/user/login\">login</a>';\n $this->template->write('logged', $lstr);\n }", "function showPageNotice()\n {\n $instr = $this->getInstructions();\n $output = common_markup_to_html($instr);\n\n $this->elementStart('div', 'instructions');\n $this->raw($output);\n $this->elementEnd('div');\n }", "public function display()\n {\n }", "public function display()\n {\n }", "public function display()\n {\n }", "public function display()\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 function Debug($TITLE, $DATA)\n {\n if ($this->debug) {\n echo BR;\n if ($TITLE !== false)\n echo '<h3>'.$TITLE.'</h3>';\n if ($this->output == 'html') \n echo \"<pre>\";\n var_dump($DATA);\n if ($this->output == 'html') \n echo \"</pre>\";\n echo BR;\n }\n }", "public function run()\n {\n if (Yii::$app->user->isGuest)\n return;\n\n return $this->render('overview', array(\n 'update' => \\humhub\\modules\\notification\\controllers\\ListController::getUpdates()\n ));\n }" ]
[ "0.741947", "0.7303669", "0.7014762", "0.6995796", "0.6949632", "0.6889222", "0.6803357", "0.67419964", "0.65606153", "0.6542594", "0.6489135", "0.6463026", "0.64446324", "0.64238065", "0.6396035", "0.6388566", "0.6388566", "0.63659406", "0.63652074", "0.63362736", "0.6333585", "0.6312517", "0.62793654", "0.6255317", "0.62467784", "0.6241011", "0.6241011", "0.6241011", "0.62370974", "0.62038845", "0.6192833", "0.6174539", "0.6123315", "0.6116935", "0.6110721", "0.61076957", "0.6105855", "0.6088528", "0.6084817", "0.60701823", "0.60532075", "0.60467756", "0.6031515", "0.60306203", "0.6011224", "0.59917754", "0.59854454", "0.5985435", "0.59853", "0.59849674", "0.5984269", "0.5984269", "0.5984269", "0.59816605", "0.5981607", "0.5973927", "0.59716696", "0.59716696", "0.59716696", "0.59648335", "0.59491104", "0.5938598", "0.59373194", "0.59230846", "0.59225595", "0.5900288", "0.5886615", "0.5883634", "0.58832043", "0.5877059", "0.5866176", "0.5865694", "0.5860369", "0.5856927", "0.5856239", "0.58557", "0.5852077", "0.58502835", "0.584681", "0.5845721", "0.5845586", "0.5844501", "0.58443046", "0.58380365", "0.5836534", "0.5817258", "0.58167046", "0.58146864", "0.5812933", "0.58097607", "0.58085907", "0.58064103", "0.58060217", "0.58053863", "0.58053863", "0.58047307", "0.58047307", "0.58035845", "0.58033854", "0.5802467" ]
0.5843536
83
throw new \RuntimeException('No way to go down!');
public function down(MetadataInterface $schema) { //$this->addSql(/*Sql instruction*/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __test()\n {\n throw new \\Exception('Oops! It is a dead end!', 400);\n }", "function broken() { }", "function throw_socket_error() {\n $code = socket_last_error();\n $str = socket_strerror($code);\n throw new \\RuntimeException(sprintf(\n '(%s) - %s',\n $code, $str\n ));\n}", "private function __construct()\n {\n throw new RuntimeException(\"Can't get there from here\");\n }", "function broken() { return TRUE; }", "final public function __invoke(): \\Exception\n {\n throw new \\BadFunctionCallException();\n }", "public function die(): void;", "private static function fail2()\n {\n throw new \\Exception('Thrown from fail2()');\n }", "private function throwException()\n {\n throw new CacheException(\\odbc_errormsg(), (int) \\odbc_error());\n }", "protected final function requireNotReady()\n {\n if ($this->ready) {\n throw new \\RuntimeException('The command cannot be configured anymore');\n }\n }", "final public function __wakeup(){\n throw new Exception('Feature disabled.');\n }", "abstract protected function doEvil();", "abstract public function abort(): void;", "final public function __unset($name)\n {\n throw new \\RuntimeException('The state of the object cannot be changed');\n }", "protected function throwInaccessibleException() {}", "public function check()\n {\n if (!file_exists($this->websitesDir)) {\n throw new \\RuntimeException(sprintf('Websites directory \"%s\" is not available', $this->websitesDir));\n }\n\n if (!is_writable($this->websitesDir)) {\n throw new \\RuntimeException(sprintf('Websites directory \"%s\" is not writable', $this->websitesDir));\n }\n }", "private function assert_not_running(): void\n\t{\n\t\tif ($this->status >= self::STATUS_RUNNING)\n\t\t{\n\t\t\tthrow new ApplicationAlreadyRunning;\n\t\t}\n\t}", "function tell()\n {\n throw new \\RuntimeException('Stream is not seekable');\n }", "abstract protected function down($failed = false);", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "public function recoverFromCorruption()\n {\n }", "public function failed()\n {\n // Do nothing\n }", "public function execute()\n {\n throw new Exception('Method not implemented');\n }", "public function getClosure()\n\t{\n\t\tthrow new Exception\\RuntimeException('Cannot invoke invalid functions', Exception\\RuntimeException::UNSUPPORTED, $this);\n\t}", "public function makeErrorAction()\n {\n // test this\n\n $this->app->abort(404, 'I am a code generated 404 error message');\n\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "function graceful_fail($message)\n {\n }", "public function testNotImplementingInterface(): void\n {\n $this->expectException('\\RuntimeException');\n\n Queue::setConfig('fail', ['engine' => '\\stdClass']);\n Queue::engine('fail');\n }", "public function stop()\n {\n throw new Stop();\n }", "protected static function throwHardCheckError()\n {\n throw new \\InvalidArgumentException('Value has wrong type');\n }", "private function createNotDeletableException()\n {\n throw new RuntimeException(sprintf(\n 'The entities of type \"%s\" cannot be deleted from its repository.',\n $this->getEntityServiceName()\n ));\n }", "public function testException() {\n\t\ttry {\n\t\t\t$array = array( 'ABC' );\n\t\t\t$percentages = new Percentages( $array );\n\t\t} catch ( \\RuntimeException $expected ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->fail( 'An expected exception has not been raised.' );\n\t}", "function rewind()\n {\n throw new \\RuntimeException('Stream is not seekable');\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "final public function __set($name, $value)\n {\n throw new \\RuntimeException('The state of the object cannot be changed');\n }", "public function validate() {\n\t\tthrow new \\RuntimeException('Invalid message');\n\t}", "public function abort(): void;", "public function __construct () {\n\t\tthrow Exception::thrown(\"Not implemented for this platform\");\n\t}", "public function testThrowException(): void\n {\n throw new Exception();\n }", "public static function doMaintenance() {\n\t\t\n\t\t// Do tasks here\n\t\tthrow new Exception(\"Unimplemented\");\n\t}", "public function failed();", "public function isOperational();", "public function get_lookup(/* ... */)\n {\n throw new \\RuntimeException('Method not implemented');\n }", "function eof()\n {\n throw new \\RuntimeException('Stream is not seekable');\n }", "public function testConnectBadDriver()\n {\n PDB::connect('ExceptionThrower');\n }", "private function createNotWritableException()\n {\n throw new RuntimeException(sprintf(\n 'The entities of type \"%s\" cannot be written to its repository.',\n $this->getEntityServiceName()\n ));\n }", "public function setName(string $name): void\n\t{\n\t\tthrow new \\RuntimeException('The console application name cannot be changed');\n\t}", "public function delete()\n\t{\n\t\tthrow new Exception(\"You shouldn't be doing that, you'll break logs.\");\n\t}", "private function assert_not_booted(): void\n\t{\n\t\tif ($this->status >= self::STATUS_BOOTING)\n\t\t{\n\t\t\tthrow new ApplicationAlreadyBooted;\n\t\t}\n\t}", "public function shutDown() {\n\t\techo \"Permission has not been given.<br>\";\n\t}", "public abstract function onFail();", "final public function onOutOfBand (): void {\n // do nothing\n }", "private function createNotReadableException()\n {\n throw new RuntimeException(sprintf(\n 'It is not possible to read entities of type \"%s\" from its repository.',\n $this->getEntityServiceName()\n ));\n }", "public function onOutOfBand (): void;", "abstract protected function _restart();", "public function shutdown()\n {\n // do nothing here\n }", "protected function assertHasProcess()\n {\n if (!$this->process) {\n throw new \\RuntimeException('Process is not set');\n }\n }", "public function shouldntRaiseAnEvent()\n {\n }", "public function raise() {\n throw $this;\n }", "public function testTask1Exception(){\n\n }", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "public function die()\n {\n if (!$this->shouldThrow) return;\n\n throw $this;\n }", "function raise(\\Exception $ex);", "public function testFault()\n {\n \t$client = new RPC_Client_Exec('/bin/' . md5(microtime()));\n \t$rpc = $client->getInterface();\n \t\n \t$this->setExpectedException('Q\\RPC_Fault', \"Execution of command failed\");\n \t$result = $rpc->test();\n\t}", "public function runBare()\n {\n $e = null;\n ha::resetCount();\n\n try {\n parent::runBare();\n } catch (\\Exception $e) { }\n\n $this->addToAssertionCount(ha::getCount());\n\n if ($e !== null) {\n throw $e;\n }\n }", "function texc($x)\r\n{\r\n\tthrow new \\Exception('Debug: ' . $x);\r\n}", "public function abort() {\n return UPS_SUCCESS;\n }", "private function failure(string $message, array $context = []): never\n {\n // Log a message\n $this->logger->critical($message, $context);\n\n // Set task and migration in the failure status\n if (isset($this->migratorEntity)) {\n $this->migratorEntity\n ->setStatus(ComponentStatus::FAILURE)\n ->setFinishedAt();\n }\n\n if (isset($this->migrationEntity)) {\n $this->migrationEntity\n ->setStatus(MigrationStatus::FAILURE)\n ->setFinishedAt();\n }\n\n if (isset($this->migratorEntity) || isset($this->migrationEntity)) {\n $this->entityManager->flush();\n }\n\n throw new \\RuntimeException($message);\n }", "public function theExitCodeShouldBeNonZero()\n {\n if ($this->return_code == 0) {\n throw new \\Exception('Return code was 0');\n }\n }", "public function fails();", "public function fails();", "public function try(){\n\n }", "public function shutdown() {\n global $conf;\n if ($this->skip) {\n $conf['error_level'] = 0;\n // By throwing an Exception here the subsequent registered shutdown\n // functions will not get executed.\n throw new \\Exception(\"Skip shutdown functions\");\n }\n }", "protected function raiseNotImplemented() {\n $calling_method_name = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2)[1]['function'];\n storeErrorMsg($calling_method_name. \" function not implemented!\");\n }", "protected abstract function do_down();", "public function failure(){\n\t}", "function check(){\r\n\t\tglobal $PDBCExceptionException;\r\n\t\tif($PDBCExceptionException)\r\n\t\t\tPDBCException::raise($PDBCExceptionException);\r\n\t}", "abstract public function handleFatalError($e);", "public function runFailed();", "public function disconnect()\n {\n if ($this->currentEnvelope) {\n throw new \\RuntimeException('Trying to disconnect with an unacknoleged message.');\n }\n\n $this->manager->disconnect();\n }", "public function testExceptionIsThrownWhenServiceNotAvailable()\n {\n $mockHandler = new MockHandler([\n new ClientException(\n 'Error Communicating with Server',\n new Request('GET', 'test'),\n new Response()\n )\n ]);\n $handlerStack = HandlerStack::create($mockHandler);\n $client = new Client(['handler' => $handlerStack]);\n $request = new Request('GET', 'test');\n $response = new Response();\n\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessage('Cannot connect to HIBP API');\n $hibp = new Hibp($client, $request, $response);\n $hibp->isPwnedPassword('foo');\n $this->fail('Expected exception was not thrown');\n }", "public function shutdown()\n {\n }", "final public function check() : void {\n\t\tif($this !== self::current()) {\n\t\t\tthrow new PlatformMismatchException(self::current(), $this);\n\t\t}\n\t}", "public function testException()\n {\n throw new Exception('This is not expected.');\n }", "public function testStartException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "function ktd()\n {\n Helpers::die(Kint::trace());\n }", "function act() {\n throw $this->exception;\n }", "public function dead();", "public function halt(): void\n {\n throw new Exception('Halted request');\n }", "public function pass()\n {\n throw new Pass();\n }", "public function checkShutdown()\n {\n if (!$error = error_get_last()) {\n return;\n }\n if (!in_array($error[\"type\"], [E_COMPILE_ERROR, E_CORE_ERROR, E_ERROR, E_PARSE])) {\n return;\n }\n $this->handle(new ErrorException(\n $error['message'], 0, $error['type'], $error['file'], $error['line']\n ));\n }", "public function no_op() {\n\t\t\texit( 'Not permitted' );\n\t\t}", "protected static function getBinaryName()\n {\n throw new \\Exception('Should be implemented');\n }", "public function onShutDown()\n {\n }", "public function onShutDown()\n {\n }", "public function down()\r\n\t{\r\n\t\t//return false;\r\n\t}", "public function testCannotStopWhenStop()\r\n {\r\n $this->myTestcar = new Car(new StopCarState());\r\n $this->myTestcar->stop();\r\n }" ]
[ "0.6397973", "0.6277467", "0.6026885", "0.597149", "0.5956195", "0.59364283", "0.5870079", "0.58595234", "0.5840712", "0.5810101", "0.5780892", "0.5746662", "0.5712695", "0.57119304", "0.56908387", "0.56780326", "0.56743616", "0.5661515", "0.56483525", "0.56395954", "0.56395954", "0.56395954", "0.56069493", "0.56026363", "0.5580818", "0.55787784", "0.55690324", "0.5555348", "0.5543448", "0.55399597", "0.5525462", "0.55178344", "0.5504071", "0.55036336", "0.5490332", "0.54774004", "0.54774004", "0.54774004", "0.5451886", "0.5438165", "0.5415154", "0.5414001", "0.5400152", "0.5382", "0.5366686", "0.53568655", "0.5353148", "0.535245", "0.5344695", "0.53357637", "0.53355503", "0.5328288", "0.53231823", "0.5320734", "0.5320329", "0.530764", "0.53055215", "0.5299188", "0.5298346", "0.52982885", "0.5285832", "0.52568614", "0.5229293", "0.5223819", "0.5221486", "0.5214718", "0.5213748", "0.5209904", "0.5201687", "0.51860434", "0.51750374", "0.5167407", "0.5166067", "0.5155454", "0.5155454", "0.5154059", "0.5148198", "0.514612", "0.5141928", "0.51336724", "0.513353", "0.5126", "0.5125373", "0.5118626", "0.51138914", "0.5108269", "0.5105965", "0.50867045", "0.5083791", "0.5083253", "0.5082421", "0.50806034", "0.5077136", "0.50734913", "0.50727564", "0.50694495", "0.5068311", "0.5067771", "0.5067771", "0.5063296", "0.50548697" ]
0.0
-1
echo ""; print_r($getWeatherData>daily); echo "";
function returnOutcome($precipProbability){ $outcome = ""; if($precipProbability < 0.05) { $outcome = "Yes! 😎"; } else if($precipProbability >= 0.05 && $precipProbability < 0.1){ $outcome = "Maybe 🤔"; } else { $outcome = "Nope 😔"; } return $outcome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 weather(): array\n {\n return $this->weather;\n }", "public function getToday(){\n\t\ttry{\n\t\t\tif(!empty($this->_city) && !empty($this->_country)){\n\t\t\t\t//get the xml for the weather\n\t\t\t\t$this->url = str_replace(\"city\",$this->_city, $this->url);\n\t\t\t\t$this->url = str_replace(\"country\",$this->_country, $this->url);\n\t\t\t\t$this->url = str_replace(\" \",\"\",$this->url);\n\t\t\t\t$xml = utf8_encode(file_get_contents($this->url));\n\t\t\t\t$xml = simplexml_load_string($xml);\n\n\t\t\t\tif($xml->weather->current_conditions->condition['data']){ \n\t\t\t\t\t$this->today['currentWeather'] = $xml->weather->current_conditions->condition['data'];\n\t\t\t\t\t$this->today['currentTemperature'] = $xml->weather->current_conditions->temp_f['data'];\n\t\t\t\t\t$this->today['picture'] = $this->url_image.$xml->weather->current_conditions->icon['data'];\n\t\t\t\t\treturn $this->today;\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn false;\n\t\t}catch(Exception $e){\n\t\t\t//log error +\n\t\t\tthrow new Exception (\"Error - please try again.\");\n\t\t}\n\t}", "public function days() {\n\t\tforeach ( self::$_days as $day => $day_title ) {\n\t\t\t$day_weather = $this->_weather [$day];\n\t\t\t$condition = $day_weather ['condition'];\n\t\t\t$temp = $day_weather ['temp'];\n\t\t\t$wind = $day_weather ['wind'];\n\t\t\t$pm25 = isset ( $day_weather ['pm25'] ) ? ( int ) $day_weather ['pm25'] : 0;\n\t\t\tempty ( $pm25 ) && $pm25 = '未知';\n\t\t\t$date = $day_weather ['date'];\n\t\t\t$time = $day_weather ['time'];\n\t\t\t$icon = $day_weather ['imgs'] [0];\n\t\t\tif (isset ( $this->_workflow )) {\n\t\t\t\t$this->_workflow->result ( 'weather_' . $day, $day_weather ['link'], \"{$time} {$day_title},{$condition}\", \"气温{$temp},{$wind},PM2.5:{$pm25},{$date}\", 'icon/' . $icon . '.jpg' );\n\t\t\t}\n\t\t}\n\t}", "public function ttsWeather() {\n\t\t// https://www.prevision-meteo.ch/uploads/pdf/recuperation-donnees-meteo.pdf\n\t\t$data = json_decode(file_get_contents(Flight::get(\"ttsWeather\")),true);\n\n\t\t$txt = \"Bonjour, voici la météo pour aujourd'hui: Il fait actuellement \".$data['current_condition']['tmp'].\"°.\";\n\t\t$txt .= \" Les températures sont prévues entre \".$data['fcst_day_0']['tmin'].\" et \".$data['fcst_day_0']['tmax'].\"°.\";\n\t\t$txt .= \" Conditions actuelles: \".$data['current_condition']['condition'].\", Conditions pour la journée: \".$data['fcst_day_0']['condition'];\n\t\tself::playTTS($txt);\n\t}", "function get_wheather_data_rounded_off($city)\n {\n $config = \\Drupal::config('weather.settings');\n $appid= $config->get('appid');\n $client = new Client();\n $response = $client->request('GET', 'https://samples.openweathermap.org/data/2.5/weather?q='.$city.'&appid='.$appid);\n $res = Json::decode($response->getBody());\n $temp_min = ceil($res['main']['temp_min']);\n $temp_max = ceil($res['main']['temp_max']);\n $pressure = ceil($res['main']['pressure']);\n $humidity = ceil($res['main']['humidity']);\n $speed = ceil($res['wind']['speed']);\n //this only for debugging purpose if whether it is rounded off or not\n \\Drupal::logger('my_module')->notice(\"temp min:\".$temp_min.\" temp max:\".$temp_max.\" pressure:\".$pressure.\" humidity:\".$humidity.\" speed:\".$speed);\n return array(\n '#temp_min' => $temp_min,\n '#temp_max' => $temp_max,\n '#pressure' => $pressure,\n '#humidity' => $humidity,\n '#wind' => $speed,\n );\n }", "public function fetchWeatherInfo()\n {\n if ($this->latitude && $this->latitude) {\n $cUrl = $this->di->get(\"callurl\");\n $args = $this->buildArgs();\n $apiResult = $cUrl->fetchConcurrently(\n $args[\"urls\"],\n $args[\"params\"],\n $args[\"queries\"]\n );\n\n if (isset($apiResult[0][\"error\"])) {\n $this->setErrorMessage(\"DarkSkyError: \" . $apiResult[0]['error']);\n }\n\n $pastDays = array(\"data\" => []);\n\n $resultCount = count($apiResult);\n\n for ($i=1; $i<$resultCount; $i++) {\n if ($apiResult[$i] && isset($apiResult[$i][\"daily\"][\"data\"][0])) {\n array_push($pastDays[\"data\"], $apiResult[$i][\"daily\"][\"data\"][0]);\n }\n }\n\n // var_dump($apiResult);\n\n if ($apiResult[0]) {\n $this->fillInfo(\n array_merge($apiResult[0], array(\"pastDays\" => $pastDays)),\n [\n \"currently\",\n \"hourly\",\n \"daily\",\n \"pastDays\"\n ]\n );\n } else {\n $this->setErrorMessage(\"DarkSkyError: daily usage limit exceeded\");\n }\n }\n return $this->getWeatherInfo();\n }", "private function extractWeatherBitResult($json)\n {\n // check main data field\n if (!isset($json->data)) {\n $this->errorMsg = \"'data' field not found in the response object!\";\n return false;\n }\n // check main data field has records \n if (count($json->data) === 0) {\n $this->errorMsg = \"Weather forecast data not found in the response object!\";\n return false;\n }\n \n // display units will be different depends on selection\n $degree_simbol = $this->unit === 'FAHRENHEIT' ? \"<span>&#8457;&nbsp;</span>\" : \"<span>&#8451;&nbsp;</span>\";\n $wind_unit = $this->unit === 'FAHRENHEIT' ? \" m/h\" : \" m/s\";\n\n // weatherBit provide daily forecast data\n foreach ($json->data as $day_data) {\n $weather = (object)[];\n $weather->dt = $day_data->valid_date; // date\n $weather->wind = number_format(floatval($day_data->wind_spd), 2) . $wind_unit;\n $weather->humidity = $day_data->rh . \"%\";\n $weather->temp = $day_data->temp . $degree_simbol;\n $weather->temp_min = round($day_data->min_temp) . $degree_simbol;\n $weather->temp_max = round($day_data->max_temp) . $degree_simbol;\n $weather->description = $day_data->weather->description;\n // make icon image url using icon code\n $weather->icon = \"https://www.weatherbit.io/static/img/icons/\" . $day_data->weather->icon . \".png\";\n array_push($this->forecast, $weather);\n } \n return true;\n }", "public function fetchWeatherWeekly(){\n\t $url = \"http://opendata.cwb.gov.tw/opendata/MFC/F-C0032-005.xml\"; // 7days\n\t $forecasting = $this->fetchWeather($url);\n\t \n\t return $forecasting;\n\t}", "public function getDarkSkyForecastData($args) {\n if (!$this->apiKey) {\n Log::notice($this->apiName . \" API key missing\");\n return false;\n }\n\n // check rate limiting before calling api\n $rateLimit = $this->getRateLimit($this->apiName);\n if ($rateLimit) {\n return false;\n }\n\n // connect to api\n Log::info(\"Calling \" . $this->apiName . \" forecast API for \" . $args['city']->name);\n $url = $this->getUrl($args['city']);\n $data = $this->connect->getData($url, $this->apiName);\n\n if (!$data || empty($data)) {\n Log::info($this->apiName . \" forecast data not found for \" . $args['city']->name);\n return false;\n }\n\n $today = $data->daily->data[0];\n $tomorrow = $data->daily->data[1];\n\n $this->saveDarkSkyData($args['city'], $today);\n $this->saveDarkSkyData($args['city'], $tomorrow);\n\n return true;\n }", "public function testItReturnsFullWeatherReport()\n {\n $weather = json_decode($this->api->full_weather_report($this->location));\n\n $this->assertObjectHasAttribute('weather', $weather);\n $this->assertObjectHasAttribute('main', $weather);\n $this->assertObjectHasAttribute('wind', $weather);\n $this->assertObjectHasAttribute('clouds', $weather);\n }", "public function getDarkSkyHistoryData($args) {\n if (!$this->apiKey) {\n Log::notice($this->apiName . \" API key missing\");\n return false;\n }\n\n // check rate limiting before calling api\n $rateLimit = $this->getRateLimit($this->apiName);\n if ($rateLimit) {\n return false;\n }\n\n // connect to api\n Log::info(\"Calling \" . $this->apiName . \" history API for \" . $args['city']->name . \", \" . $args['date']->format('Y-m-d'));\n $url = $this->getUrl($args['city'], $args['date']->getTimestamp());\n $data = $this->connect->getData($url, $this->apiName);\n\n if (!$data || empty($data)) {\n Log::info($this->apiName . \" history data not found for \" . $args['city']->name);\n return false;\n }\n\n if (isset($data->code) && $data->code != 200) {\n Log::notice($data->error);\n return false;\n }\n\n $weather = $data->daily->data[0];\n $this->saveDarkSkyData($args['city'], $weather, $args['date']);\n\n return true;\n }", "public function getWeatherData() {\n\t\t$this->cleanCache();\n\t\tif (!$this->useCache || !file_exists($this->cache_path) || @filemtime(($this->cache_path) + $this ->cachtime < time()) || file_get_contents($this->cache_path) == \"\") {\n\t\t\t$weather_api_url = \"http://query.yahooapis.com/v1/public/yql?q=select+%2A+from+weather.forecast+where+woeid%3D%22\".$this->location_code.\"%22+and+u%3D%22\".$this->unit.\"%22&format=json\";\n\t\t\t$rss_api_url = \"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%27http%3A%2F%2Fweather.yahooapis.com%2Fforecastrss%3Fw%3d\".$this->location_code.\"%26u%3d\".$this->unit.\"%27&format=json\";\n\n\t\t\t$data = $this->getContentFromUrl($weather_api_url);\n\t\t\t$data_forecast = $this->getContentFromUrl($rss_api_url);\n\t\t\tif ($this->isJson($data) && $this->isJson($data_forecast)) {\n\t\t\t\t$weather_assoc = json_decode($data, true);\n\t\t\t\tif ($weather_assoc[\"query\"][\"results\"][\"channel\"][\"title\"] == \"Yahoo! Weather - Error\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$weather_assoc_forecast = json_decode($data_forecast,true);\n\t\t\t\t$weather_assoc[\"query\"][\"results\"][\"channel\"][\"item\"][\"forecast\"]=$weather_assoc_forecast[\"query\"][\"results\"][\"item\"][\"forecast\"];\n\t\t\t\tif ($this->useCache) {\n\t\t\t\t\tfile_put_contents($this->cache_path.$this->cache_name, json_encode($weather_assoc));\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$weather_assoc = json_decode(file_get_contents($this->cache_path.$this->cache_name));\n\t\t}\n\t\t\n\t\treturn $weather_assoc[\"query\"][\"results\"][\"channel\"];\n\t}", "function getWeather(){\n\t\t$this->racine->asXml();\n\t}", "function drush_sandwich_sandwiches_served() {\n $served = 0;\n $served_object = drush_cache_get(drush_get_cid('sandwiches-served'));\n if ($served_object) {\n $served = $served_object->data;\n }\n // In the default format, key-value, this return value\n // will print \" Sandwiches Served : 1\". In the default pipe\n // format, only the array value (\"1\") is returned.\n return $served;\n}", "function meteoGreg(){\r\n $curl = curl_init();\r\n \r\n curl_setopt_array($curl, array(\r\n CURLOPT_URL => \"api.openweathermap.org/data/2.5/find?q=Prévenchères&units=metric&appid=d196fbd705116ddcd1911b5c8606c6e0&lang=fr\",\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_TIMEOUT => 30,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => \"GET\",\r\n CURLOPT_HTTPHEADER => array(\r\n \"cache-control: no-cache\"\r\n ),\r\n ));\r\n \r\n $response = curl_exec($curl);\r\n \r\n curl_close($curl);\r\n \r\n $response = json_decode($response, true);\r\n echo(\"<p style='text-align:center; color:#373737;'>Le temps à <b>Prévenchères</b> est actuellement <b>\".$response['list'][0]['weather'][0]['description'].\"</b> et la température est de <b>\".intval($response['list'][0]['main']['temp']).\"°C</b></p>\");\r\n}", "private function getTempExtremsToday() {\n //get last update date\n $update = explode(\" \", $this->lastUpdateStr())[0];\n\n $statement = $this->db->prepare('SELECT max(\"amount\") as \"high\", min(\"amount\") as \"low\" FROM \"temperature\" WHERE date(\"created\") = ?');\n $statement->bindValue(1, $update);\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC);\n }", "public function get_values()\n {\n $stm = $this->prepare(\"SELECT time, water_level, temperature, ph, dis_oxygen FROM readings WHERE system_id = 1\n ORDER BY TIME DESC\");\n $stm->execute();\n $res = $stm->fetchAll(PDO::FETCH_CLASS); // returns array of objects\n if (count($res) > 0)\n return $res;\n else\n return FALSE;\n }", "public function getWeather() {\n\n return $this->weather;\n }", "public function info()\n{\necho \"Informations en date du \",date(\"d/m/Y H:i:s\"),\"<br>\";\n\n$now=getdate();\n$heure= $now[\"hours\"];\n$jour= $now[\"wday\"];\n\necho \"<h3>Horaires des cotations</h3>\";\nif(($heure>=9 && $heure <=17)&& ($jour!=0 && $jour!=6))\n{ echo \"La Bourse de Paris est ouverte <br>\"; }\nelse\n{ echo \"La Bourse de Paris est fermée <br>\"; }\nif(($heure>=16 && $heure <=23)&& ($jour!=0 && $jour!=6) )\n{ echo \"La Bourse de New York est ouverte <hr>\"; }\nelse\n{ echo \"La Bourse de New York est fermée <hr>\"; }\n}", "public function currentWeather($city_id) {\n\t\t$API_KEY = '91d6ff6cfa05fd51f54773c8dca55123';\n\t\t$API_URL = \"http://api.openweathermap.org/data/2.5/weather?\";\n\t\t$API_IMG_URL = \"http://openweathermap.org/img/w/\";\n\t\t\n\t\ttry {\n\t\t\t$client = \\Drupal::httpClient();\n\t\t\t$apiURL = $API_URL.'id='.$city_id.'&lang=en&units=metric&appid='.$API_KEY;\n\t\t\t$response = $client->request('GET', $apiURL, ['verify' => FALSE]);\n \t\t$response = $response->getBody();\n\n\t\t\t$data = Json::decode($response);\n\t\t\n\t\t\t$weatherArr = array(\n\t\t\t\t'name' => $data['name'],\n\t\t\t\t'curday' => date('l g:i a'),\n\t\t\t\t'curdate' => date('jS F, Y'),\n\t\t\t\t'type' => $data['weather'][0]['description'],\n\t\t\t\t'imageUrl' => $API_IMG_URL.$data['weather'][0]['icon'].'.png',\n\t\t\t\t'minTemp' => $data['main']['temp_min'],\n\t\t\t\t'maxTemp' => $data['main']['temp_max'],\n\t\t\t\t'humidity' => $data['main']['humidity'].'%',\n\t\t\t\t'wind' => $data['wind']['speed'].' km/h',\n\t\t\t);\n\t\n\t\t\treturn array(\n\t\t\t\t'#theme' => 'weather',\n\t\t\t\t'#items' => $weatherArr,\n\t\t\t\t'#title' => 'Weather Report'\t\n\t\t\t);\n\t\t}\n\t\tcatch (GuzzleException $e) {\n\t\t\twatchdog_exception('current_weather', $e);\n\t\t\treturn FALSE;\n\t\t}\t\n\t}", "function get_hourly_weather_for_day( \n $y, \n $m, \n $d )\n {\n $day = date( 'Y-m-d', mktime( 0, 0, 0, $m, $d, $y ) );\n $results = $this->_db->select( \n \"SELECT * \n FROM weather_hours\n WHERE date_day = '\".$day.\"'\n ORDER BY date_hour ASC\" );\n if ( is_array( $results ) ) {\n return $results;\n }\n return false;\n }", "public function getWeatherData()\n {\n return $this->service->getWeatherData();\n }", "private function getWeatherBit()\n {\n $url = 'https://api.weatherbit.io/v2.0/forecast/daily';\n $url .= '?lat=' . $this->location->lat;\n $url .= '&lon=' . $this->location->lng;\n $url .= '&units=' . ($this->unit === \"FAHRENHEIT\" ? \"I\" : \"M\");\n $url .= '&days=3'; // default return 16 days forecast. Using forecast of 3 days.\n $url .= '&key=' . $GLOBALS['apikey_weatherbit'];\n $result = $this->callAPI($url);\n return $result ? $this->extractWeatherBitResult(json_decode($result)) : false;\n }", "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 day_summary($cond=array())\r\n\t{\r\n\t\tif (is_logged_in_user() == true) {\r\n\t\t\t$c_filter = '';\r\n\t\t\tif (is_domain_user() == true) {\r\n\t\t\t\t$c_filter .= ' AND TL.domain_origin = '.get_domain_auth_id();\r\n\t\t\t}\r\n\t\t\tif (is_app_user()) {\r\n\t\t\t\t$c_filter .= ' AND TL.created_datetime = '.intval($this->CI->entity_user_id);\r\n\t\t\t}\r\n\t\t\tif (valid_array($cond)) {\r\n\t\t\t\t$c_filter .= $this->CI->custom_db->get_custom_condition($cond);\r\n\t\t\t}\r\n\t\t\treturn $this->CI->db->query('select count(*) as total, TL.origin as event_origin, TLE.* from timeline_master_event TLE LEFT JOIN timeline TL ON TLE.origin=TL.event_origin '.$c_filter.' group by TLE.origin order by TLE.event_title')->result_array();\r\n\t\t}\r\n\t}", "function theme_meteologic_noaa_forecast($variables) {\n\n $data = $variables['data']['data'];\n\n$display_out = '<div class=\"forecast-wrapper\">';\nfor ($i = 0; $i < 5; $i++) {\n $dayindex = $i * 2;\n $nightindex = $dayindex + 1; \n $daystamp = strtotime($data['time-layout'][0]['start-valid-time'][$i]);\n $dow = date('l',$daystamp);\n $forecast_icon1 = $data['parameters']['conditions-icon']['icon-link'][$dayindex];\n $forecast_icon2 = $data['parameters']['conditions-icon']['icon-link'][$nightindex];\n $hi = $data['parameters']['temperature'][0]['value'][$i];\n $lo = $data['parameters']['temperature'][1]['value'][$i];\n $pop1 = $data['parameters']['probability-of-precipitation']['value'][$dayindex];\n $pop2 = $data['parameters']['probability-of-precipitation']['value'][$nightindex];\n $weather1 = $data['parameters']['weather']['weather-conditions'][$dayindex]['@attributes']['weather-summary'];\n $weather2 = $data['parameters']['weather']['weather-conditions'][$nightindex]['@attributes']['weather-summary'];;\n if($i == 0 && is_array($forecast_icon1)){\n $forecast_icon1 = $forecast_icon2;\n $dow = 'Tonight';\n }\n $display_out .= '<div class=\"forecast-day-wrapper\">';\n $display_out .= '<div class=\"forecast-day-inner\">';\n $display_out .= '<div class=\"forecast-day-heading\">'.$dow.'</div>';\n $display_out .= '<div class=\"forecast-day-icon\"><img class=\"scalable\" width=\"55\" height=\"58\" src=\"'.$forecast_icon1.'\"></div>';\n $display_out .= '<div class=\"forecast-day-weather\">'.$weather1.'</div>';\n $display_out .= '<div class=\"forecast-day-hilo\">HI:'.$hi.' / LO:'.$lo.'</div>';\n $display_out .= '<div class=\"forecast-day-pop\">Probablilty of Precipitation: '.$pop1.'%</div>';\n $display_out .= '</div>';\n $display_out .= '</div>';\n\n}\n$display_out .= '</div>';\n // @TODO do something with these results.\nreturn $display_out;\n}", "public function currently()\n {\n $currently = [];\n setlocale(LC_ALL, 'sv_SV');\n if ($this->currently && $this->currently[\"time\"]) {\n $currently = $this->pushInfo(\n $this->currently,\n [\n \"weekday\",\n \"date\",\n \"timeofday\",\n \"icon\",\n \"temperature\",\n \"apparentTemperature\",\n \"summary\",\n \"windSpeed\",\n \"precipProbability\",\n \"pressure\"\n ]\n );\n\n $time = $this->currently[\"time\"];\n $localdate = strftime(self::$dateFormat, $time);\n $localtime = strftime(self::$timeFormat, $time);\n $weekday = strftime(self::$dayFormat, $time);\n\n $currently[\"weekday\"] = ucfirst($weekday);\n $currently[\"date\"] = ucfirst($localdate);\n $currently[\"timeofday\"] = ucfirst($localtime);\n }\n return $currently;\n }", "function cron_data() {\n return false;\n }", "public function getDailyForecast() : array\n {\n $data = $this->getForecast();\n return $data[self::DAILY_KEY] ?? [];\n }", "public function getTemperature()\n {\n //no-op\n }", "function get_weather_data() {\n\n\tdate_default_timezone_set(TIMEZONE);\n\n\t// Check if cached weather data already exists and if the cache has expired\n\tif ( ( file_exists(CACHEDATA_FILE) ) && ( date('YmdHis', filemtime(CACHEDATA_FILE)) > date('YmdHis', strtotime('Now -'.WEATHER_CACHE_DURATION.' seconds')) ) ) {\n\t\t$weather_string = file_get_contents(CACHEDATA_FILE) or make_new_cachedata();\n\t\t$weather = (json_decode($weather_string, true));\n\t\treturn $weather;\n\t}\n\n\telse {\n\t\treturn make_new_cachedata();\n\t}\n\n}", "function returnDamwidiOHLC($verbose, $debug){\n $dbc = connect();\n $stmt = $dbc->prepare(\"SELECT `date`, `open`, `high`, `low`, `close` FROM `data_value` ORDER BY `date` DESC\");\n $stmt->execute();\n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n\n $damwidiOHLC = array();\n foreach($result as $candle){\n $damwidiOHLC['Time Series (Daily)'][$candle['date']] = array(\n \"1. open\" => round($candle['open'],2),\n \"2. high\" => round($candle['high'],2),\n \"3. low\" => round($candle['low'],2),\n \"4. close\" => round($candle['close'],2),\n );\n }\n\n if ($verbose) show($damwidiOHLC);\n if (!$verbose) echo json_encode($damwidiOHLC);\n}", "public function daily()\n {\n $days = [];\n if ($this->daily) {\n setlocale(LC_ALL, 'sv_SV');\n $comingDays = array_slice($this->daily[\"data\"], 1, 30);\n foreach ($comingDays as $i => $data) {\n if ($data[\"time\"]) {\n $this->parseDate(\"daily\", $i, $data[\"time\"]);\n $days[$i] = $this->pushInfo(\n $this->daily[\"data\"][$i],\n [\n \"weekday\",\n \"date\",\n \"icon\",\n \"summary\",\n \"temperatureMax\",\n \"apparentTemperatureMax\",\n \"temperatureMin\",\n \"apparentTemperatureMin\",\n \"time\"\n ]\n );\n }\n }\n }\n return $days;\n }", "function check_temp($temperature){\n\tif($temperature < 18 || $temperature > 27){\n\t\treturn '<td class =\"fail_color\">'.sprintf(\"%01.2f\",$temperature).'</td>';\n\t} else {\n\t\treturn '<td class =\"ok_color\">'.sprintf(\"%01.2f\",$temperature).'</td>';\n\t}\n }", "public function getWeatherDetail() : array\n {\n $response = array(\n \"weather_type\" => $this->type,\n \"temperature\" => $this->temperature,\n \"wind\" => array(\n \"speed\" => $this->windSpeed,\n \"direction\" => $this->windDirection\n )\n );\n\n return $response;\n }", "public function getBrodcastData() { \n die('Amit');\n }", "function show_earthriestext($products) {\r\n\tglobal $product;\r\n\t$pid=$product->id;\r\n\t$_enable_warehouse=get_metadata('post',$pid,'_enable_warehouse',true);\r\n\r\n\t\r\n\tif($_enable_warehouse==1) {\r\n\t\t $output= '<div style=\"font-size: 10px;color: #000;\">fulfilled by Eartheries warehouse</div>';\r\n\t\techo sprintf($output);\r\n\t}\r\n\t\r\n\t\r\n}", "public function current() {\n\t\t$week = isset ( $this->_weather ['week'] ) ? $this->_weather ['week'] : '';\n\t\t$city = isset ( $this->_weather ['city'] ) ? $this->_weather ['city'] : $this->_query;\n\t\t$currenttemp = isset ( $this->_weather ['currenttemp'] ) ? $this->_weather ['currenttemp'] : '未知';\n\t\t$source = isset ( $this->_weather ['source'] ['name'] ) ? $this->_weather ['source'] ['name'] : '未知';\n\t\t$weather_source_url = isset ( $this->_weather ['calendar'] ['weatherSourceUrl'] ) ? $this->_weather ['calendar'] ['weatherSourceUrl'] : null;\n\t\t$lunar = isset ( $this->_weather ['calendar'] ['lunar'] ) ? $this->_weather ['calendar'] ['lunar'] : null;\n\t\tif (isset ( $this->_workflow )) {\n\t\t\t$this->_workflow->result ( 'city_' . $city, $weather_source_url, \"当前气温:{$currenttemp} @ {$city}\", \"{$week},{$lunar}, 数据来自:{$source} \", '' );\n\t\t}\n\t}", "function dd($data, $flag = false) {\n if (isset($flag) && !empty($flag)) {\n echo '<pre>';\n print_r($data);\n die;\n } else {\n echo '<pre>';\n print_r($data);\n }\n}", "private function extractOpenWeatherMapResult($json)\n {\n // check response status field\n if (!isset($json->cod)) {\n $this->errorMsg = \"'cod' field not found in the response object!\";\n return false;\n }\n \n // check response status field has success code\n if ($json->cod !== '200') {\n $this->errorMsg = \"API error! status code=\" . $json->cod;\n return false;\n }\n\n // check main data field\n if (!isset($json->list) || count($json->list) === 0) {\n $this->errorMsg = \"Weather forecast data not found in the response object!\";\n return false;\n }\n \n // display units will be different depends on selection\n $degree_simbol = $this->unit === 'FAHRENHEIT' ? \"<span>&#8457;&nbsp;</span>\" : \"<span>&#8451;&nbsp;</span>\";\n $wind_unit = $this->unit === 'FAHRENHEIT' ? \" m/h\" : \" m/s\";\n \n // OpenWeatherMap provide forecast data for every 3 hours.\n // calculating daily min, max temperature\n $prev = '';\n $count = 0;\n foreach ($json->list as $hour_data) {\n // convert timestamp in UTC to Japan time and extract day part\n $dt = gmdate(\"Y-m-d\", intval($hour_data->dt)+9*60*60);\n if ($dt === $prev) {\n // find dialy max values\n $weather->wind = max($weather->wind, floatval($hour_data->wind->speed));\n $weather->humidity = max($weather->humidity, floatval($hour_data->main->humidity));\n $weather->temp = max($weather->temp, intval($hour_data->main->temp));\n $weather->temp_min = min($weather->temp_min, intval($hour_data->main->temp_min));\n if ($weather->temp_max < intval($hour_data->main->temp_max)) {\n $weather->temp_max = intval($hour_data->main->temp_max);\n // get icon and description for max temp\n if (count($hour_data->weather) > 0) {\n $weather->description = $hour_data->weather[0]->main;\n $weather->icon = \"https://openweathermap.org/img/wn/\" . $hour_data->weather[0]->icon . \"@2x.png\";\n }\n }\n } else {\n if ($prev !== '') {\n // format and add object to the Area, if there are previos records\n $weather->wind = number_format(floatval($weather->wind), 2) . $wind_unit;\n $weather->humidity = $weather->humidity . \"%\";\n $weather->temp = $weather->temp . $degree_simbol;\n $weather->temp_min = $weather->temp_min . $degree_simbol;\n $weather->temp_max = $weather->temp_max . $degree_simbol;\n array_push($this->forecast, $weather);\n // 3 days forecast required\n if (++$count>2) {\n break;\n }\n }\n \n // next day start\n $weather = (object)[];\n $weather->dt = $dt;\n $prev = $dt;\n $weather->wind = floatval($hour_data->wind->speed);\n $weather->humidity = floatval($hour_data->main->humidity);\n $weather->temp = intval($hour_data->main->temp);\n $weather->temp_min = intval($hour_data->main->temp_min);\n $weather->temp_max = intval($hour_data->main->temp_max);\n if (count($hour_data->weather) > 0) {\n $weather->description = $hour_data->weather[0]->main;\n $weather->icon = \"https://openweathermap.org/img/wn/\" . $hour_data->weather[0]->icon . \"@2x.png\";\n }\n }\n }\n // if days are less than 3, add last object\n if ($count<2) {\n $weather->wind = number_format(floatval($weather->wind), 2) . $wind_unit;\n $weather->humidity = $weather->humidity . \"%\";\n $weather->temp = $weather->temp . $degree_simbol;\n $weather->temp_min = $weather->temp_min . $degree_simbol;\n $weather->temp_max = $weather->temp_max . $degree_simbol;\n array_push($this->forecast, $weather);\n }\n return true;\n }", "public function getIf(): array;", "function live_get_current_daily(): array\r\n{\r\n\tglobal $DATABASE;\r\n\tglobal $UNIX_TIMESTAMP;\r\n\t\r\n\t$out = [];\r\n\t$group = $DATABASE->execute_query('SELECT MAX(daily_category), MIN(daily_category) FROM `daily_rotation`')[0];\r\n\t$max_group = $group[0];\r\n\t$min_group = $group[1];\r\n\t\r\n\tfor($i = $min_group; $i <= $max_group; $i++)\r\n\t{\r\n\t\t$current_days = intdiv($UNIX_TIMESTAMP, 86400);\r\n\t\t$current_rot = $DATABASE->execute_query(\"SELECT live_id FROM `daily_rotation` WHERE daily_category = $i\");\r\n\t\t$out[] = $current_rot[$current_days % count($current_rot)][0];\r\n\t}\r\n\t\r\n\treturn $out;\r\n}", "public function testTemperatureSummary()\n {\n }", "private function getRainToday() {\n //rain now\n $statement = $this->db->prepare('SELECT * FROM \"pluviometer\" ORDER BY \"created\" DESC LIMIT 1');\n $result = $statement->execute();\n $rain_end = $result->fetchArray(SQLITE3_ASSOC);\n \n //now get amount on day start\n $statement = $this->db->prepare('SELECT \"amount\" FROM \"pluviometer\" WHERE \"created\" < ? ORDER BY \"created\" DESC LIMIT 1');\n $statement->bindValue(1, explode(\" \", $rain_end['created'])[0]);\n $result = $statement->execute();\n $rain_start = $result->fetchArray(SQLITE3_ASSOC);\n \n //now clac today rain\n return floatval($rain_end[\"amount\"]) - floatval($rain_start[\"amount\"]);\n }", "public function getHourlyForecast() : array\n {\n $data = $this->getForecast();\n return $data[self::HOURLY_KEY] ?? [];\n }", "public function export(WeatherDataDto $weatherDataDto): string;", "public function getOpenWeatherMapData($args) {\n if (!$this->apiKey) {\n Log::notice($this->apiName . \" API key missing\");\n return false;\n }\n\n // check rate limiting before calling api\n $rateLimit = $this->getRateLimit($this->apiName);\n if ($rateLimit) {\n return false;\n }\n\n // connect to api\n Log::info(\"Calling \" . $this->apiName . \" API for \" . $args['city']->name);\n $url = $this->getUrl($args['city']);\n $data = $this->connect->getData($url, $this->apiName);\n\n // if using a free account\n if (env('API_LIMIT_OPENWEATHERMAP') == 1440) {\n sleep(1); // unpaid accounts are limited to 60 calls/minute\n }\n\n if (!$data) {\n Log::info($this->apiName . \" forecast data not found for \" . $args['city']->name);\n return false;\n }\n\n if ($data->cod != 200) {\n Log::notice($this->apiName . \": \" . $data->message);\n return false;\n }\n\n if (!$args['city']->id_openweathermap) {\n $args['city']->id_openweathermap = $data->city->id;\n $args['city']->save();\n }\n\n $today = $data->list[0];\n $tomorrow = array_pop($data->list);\n\n $this->saveOpenWeatherMapData($args['city'], $today);\n $this->saveOpenWeatherMapData($args['city'], $tomorrow);\n\n return true;\n }", "private function decodeCurrentWeather() {\n //if delte between two rains with time distance 10m > 0.1 - raining\n if ($this->getRainInLast(10) > 0.1) {\n return (object)[\n 'name' => $this->lang->weathers->rain,\n 'icon' => $GLOBALS['weather_icons']->rain\n ];\n } else if ($this->getCurrentWind()['speed'] > 10) {\n // when wind is > 35KPH\n return (object)[\n 'name' => $this->lang->weathers->wind,\n 'icon' => $GLOBALS['weather_icons']->wind\n ];\n } else if ($this->getCurrentDewPoint() - $this->getCurrentTemp() < 2.5) {\n //when delta between dew point and temperature is < 2.5 C\n return (object)[\n 'name' => $this->lang->weathers->mist,\n 'icon' => $GLOBALS['weather_icons']->mist\n ];\n } else {\n $hour = date(\"H\");\n\n //others I cant detect easy just say its partly_cloudy\n return (object)[\n 'name' => $this->lang->weathers->partly_cloudy,\n 'icon' => ($hour > 6 && $hour < 20) ? $GLOBALS['weather_icons']->partly_cloudy->day : $GLOBALS['weather_icons']->partly_cloudy->night\n ];\n }\n \n }", "private function getCurrentWind() {\n $statement = $this->db->prepare('SELECT \"speed\", \"gust\", \"direction\" FROM \"wind\" ORDER BY \"created\" DESC LIMIT 1');\n $result = $statement->execute();\n return $result->fetchArray(SQLITE3_ASSOC);\n }", "public function hasLogintime(){\n return $this->_has(2);\n }", "function printSchedule($date) {\n\t\t$scheduleFound = false;\n\t\t$file = \"data/schedule.txt\";\n\t\t$handle = fopen($file,\"a+\");\n\t\tif (!$handle) {\n \treturn \"<p> Internal Error </p>\";\n }\n while (($line = fgets($handle)) !== false) {\n \t$current = explode(\";\",$line); \n \tif ($current[0] == $date) {\n \t\techo '<input type=\"radio\" name=\"class\" value=\"'.$line.'\">'.$current[0].\": \".$current[2].\n \t\t\t' with '.$current[3].' at '.$current[1].' '.$current[4].'slots left <br>'; \n \t\t// print to screen\n \t\t$scheduleFound = true;\n \t}\n }\n fclose($handle);\n return $scheduleFound;\n\t}", "public function hasData(){\n return $this->_has(10);\n }", "public function hasData(){\n return $this->_has(10);\n }", "function info($data)\n{\n print_r($data);\n print(PHP_EOL);\n}", "function info($data)\n{\n print_r($data);\n print(PHP_EOL);\n}", "public function getWeather()\n {\n return $this->apiWeather === 'WeatherBit.io' ? $this->getWeatherBit() : $this->getOpenWeatherMap();\n }", "function getHotSystemData($exclude_expression) // получает данные системы тёплых клиентов\n {\n $sql = \"SELECT * FROM `hot_system` WHERE `{$exclude_expression}` <> -1 ORDER BY `timestamp` DESC;\";\n $result = db_fetchall_array($sql, __LINE__, __FILE__);\n \n return json_encode($result);\n }", "function check_humid($humidity){\n\n\t$humidity_formated = sprintf(\"%01.2f\",$humidity);\n\n\tif($humidity_formated < 40 || $humidity_formated > 50){\n\t\treturn '<td class =\"fail_color\">'.$humidity_formated.'</td>';\n\t} else {\n\t\treturn '<td class =\"ok_color\">'.$humidity_formated.'</td>';\n\t}\n }", "public function isHistorical()\n {\n return $this->isHistorical;\n }", "public function isWorkingDay($datum){\n $jahr = substr($datum, 0, 4);\n $monat = substr($datum, 5, 2);\n $day = substr($datum, 8, 2);\n $svatkyArray = $this->getSvatkyArray($jahr, $monat);\n \n $cislodne = sprintf(\"%02d\",date('w',mktime(0, 1, 1, $monat, $day, $jahr)));\n\n\n $svatek = array_search($day, $svatkyArray);\n\n// Debug::fireLog(\"svatek=$svatek,cislodne=$cislodne\".\"svatkyArray=\".join(',', $svatkyArray));\n\n if($cislodne==0 || $cislodne==6 || $svatek!==false)\n return false;\n else\n return true;\n\n }", "function PrintData($key,$region)\n{\n\n $data = GetTheDataArray(array('theme','data',$key,$region));\n $returnData = '';\n if(is_array($data))\n {\n foreach($data as $key => $d)\n {\n if(!isset($data[0]) && !isset($data[1]))\n {\n $returnData .= '';\n } else {\n $returnData .= $d;\n }\n\n }\n } else {\n\n $returnData = $data;\n }\n\n return $returnData;\n\n\n}", "function is_info ($sc) { \n return $sc >= 100 && $sc < 200; \n}", "function god(){\n print_r( current_filter() );\n echo '<br />';\n }", "public function isHeavyValues(): bool;", "public function getTemperature();", "function car_hire(){\n //\n $sql= $this->chk(\n \"SELECT \n vehicle.reg_no,\n vehicle.model,\n vehicle.rate\n FROM \n vehicle \"\n );\n // \n $car_hire= $this->sqlData($sql);\n echo ($car_hire);\n }", "function get_water_level() {\r\n $configs = include('config/config.php');\r\n $query = \"SELECT * FROM vogomo_currentstatus\";\r\n $result = $configs->query($query);\r\n if ($result->num_rows > 1) {\r\n return array(2, $result);\r\n } else {\r\n $water_level = $result->fetch_array();\r\n return array(1, $water_level['water_level']);\r\n }\r\n}", "public function getShow_on_market () {\n\t$preValue = $this->preGetValue(\"show_on_market\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->show_on_market;\n\treturn $data;\n}", "function chkFiredata($firedata, $satellite){\n $result = pg_query(\"SELECT * FROM $satellite WHERE '\".$firedata.\"'=concat(latitude,longitude,bright_ti4,acq_date,acq_time)\");\n\n if(pg_fetch_array($result) !== false){\n return 1;\n }else{\n return 0;\n }\n}", "public function getCurrentForecast() : array\n {\n $data = $this->getForecast();\n return $data[self::CURRENT_KEY] ?? [];\n }", "function debug($data, $die=true)\n{\n if (DEVELOPMENT_ENVIRONMENT)\n {\n if (is_array($data))\n {\n print_r($data);\n } else\n {\n echo $data;\n }\n\n if ($die)\n {\n die();\n }\n }\n}", "function xfilter($x) {\r\r\n return (isset($_GET['daily'])) ? $x-1 : $x;\r\r\n}", "public function hourly()\n {\n $hourly = [];\n if ($this->hourly && isset($this->hourly[\"data\"])) {\n $this->hourly[\"data\"] = array_slice($this->hourly[\"data\"], 0, 12);\n $hours = count($this->hourly[\"data\"]);\n for ($i=0; $i < $hours; $i++) {\n setlocale(LC_ALL, 'sv_SV');\n $time = $this->hourly[\"data\"][$i][\"time\"];\n if ($time) {\n $this->parseDate(\"hourly\", $i, $time);\n $weekday = strftime(self::$dayFormat, $time);\n $weeknr = strftime(\"%w\", $time);\n\n $hourly[\"days\"][$weeknr][\"hours\"][$i] = $this->pushInfo(\n $this->hourly[\"data\"][$i],\n [\n \"icon\",\n \"timeofday\",\n \"summary\",\n \"temperature\",\n \"apparentTemperature\",\n \"date\",\n \"weekday\",\n \"timeofday\"\n ]\n );\n $hourly[\"days\"][$weeknr][\"day\"] = ucfirst($weekday);\n }\n }\n }\n return $hourly;\n }", "public function sensorRecentReadings($sensorId, $datapoint)\n {\n $sensorDetail = Device::where('unique_id', '=', floatval($sensorId))->first();\n foreach($sensorDetail->data_points as $data_point){\n if($data_point['point'] == $datapoint){\n $minT = $data_point['minT'];\n $maxT = $data_point['maxT'];\n }\n }\n $reading = 0;\n //date_default_timezone_set(\"Europe/London\");\n $date = new DateTime(date(\"Y-m-d\"));\n $sensordataToday = array();\n $today = str_replace(\"+\",\".000+\", $date->format(DateTime::ATOM));\n $this_record = MongoSensorData::where('sensor_id', '=', floatval($sensorId))\n ->where('recordDay', '=', new DateTime($today))->first();\n\n if($this_record){\n $sensorDs = $this_record->dataSamples;\n for (end($sensorDs); key($sensorDs)!==null; prev($sensorDs)){\n $sensordata = current($sensorDs);\n // ...\n if(isset($sensordata[$datapoint])){\n $reading = $sensordata[$datapoint];\n //var_dump($reading);\n\n if($sensordata[$datapoint.'-minV'] == 1 || $sensordata[$datapoint.'-maxV'] == 1){\n $status = 'danger';\n }\n elseif($sensordata[$datapoint.'-minV'] == -1 || $sensordata[$datapoint.'-maxV'] == -1){\n $status = 'warning';\n }\n else{\n $status = 'success';\n }\n\n $min_T = $sensordata[$datapoint.'-minT'];\n $max_T = $sensordata[$datapoint.'-maxT'];\n }\n else{\n $reading = 0;\n $status = 'danger';\n $min_T = 0;\n $max_T = 0;\n }\n //var_dump($status);\n array_push($sensordataToday,\n array(\n 'sensorName' => $sensorDetail->name,\n 'sensorID' => $sensorId,\n 'dateTime' => $sensordata['recordDate']->toDateTime()->format('Y-m-d H:i:s'),\n 'reading' => round($reading, 2),\n 'status' => $status,\n 'min_threshold' => $min_T,\n 'max_threshold' => $max_T,\n 'n_min_violation' => 0,\n 'n_max_violation' => 0,\n\n )\n );\n\n if(key($sensorDs) == count($sensorDs) - 10)\n break;\n }\n }\n else{\n\n array_push($sensordataToday,\n array(\n 'sensorName' => $sensorDetail->name,\n 'sensorID' => $sensorId,\n 'dateTime' => date('Y-m-d H:i:s'),\n 'reading' => round($reading, 2),\n 'status' => 'danger',\n 'min_threshold' => isset($minT) ? $minT : 0,\n 'max_threshold' => isset($maxT) ? $maxT : 0,\n 'n_min_violation' => 0,\n 'n_max_violation' => 0,\n\n )\n );\n }\n\n\n\n\n\n\n\n $sensordataRecents = array();\n\n $sensorDRs = MongoSensorData::where('sensor_id', '=', floatval($sensorId))\n ->orderBy('recordDay', 'DESC')->take(10)->get();\n\n\n foreach($sensorDRs as $sensordata){\n $reading = $sensordata->$datapoint['average'];\n if($reading < $minT || $reading > $maxT){\n $status = 'danger';\n }\n elseif($reading == $minT || $reading == $maxT){\n $status = 'warning';\n }\n else{\n $status = 'success';\n }\n //var_dump(date_format(new DateTime($sensordata->recordDay), 'd-m-Y H:i:s'));\n //var_dump($sensordata->maxTime);\n //var_dump(date_format($sensordata->recordDay->toDateTime(), 'Y-m-d'));\n array_push($sensordataRecents,\n array(\n 'sensorName' => $sensorDetail->name,\n 'sensorID' => $sensordata->sensorId,\n 'dateTime' => date_format($sensordata->recordDay->toDateTime(), 'Y-m-d H:i:s'),\n 'reading' => round($reading, 2),\n 'status' => $status,\n 'min_threshold' => $minT,\n 'max_threshold' => $maxT,\n 'n_min_violation' => $sensordata->$datapoint['n-minV'],\n 'n_max_violation' => $sensordata->$datapoint['n-maxV'],\n )\n );\n //var_dump($sensordataRecents);\n\n }\n\n\n\n\n return response()->json(['today' => $sensordataToday, 'recents' => $sensordataRecents, 'reading' => $reading]);\n }", "public function getHot(){\n return array_get($this->hot,$this->c_hot,'[N\\A]');\n }", "public function hasInfo() {\n return $this->_has(10);\n }", "function todayTenantLogs() {\n\t\trequire_once \"../../models/model.php\";\n\t\t$tenant = new CRUD;\n\t\t$controller = new Database;\n\t\t$html = \"\";\n\t\t$sql = \"SELECT * FROM time_in_out \n\t\tINNER JOIN customer ON time_in_out.cust_id=customer.cust_id \n\t\tWHERE DATE(time_in_out.datetime) = CURDATE()\";\n\t\t$data = $tenant->displayRecord($sql);\n\t\t$logs = \"\";\n\t\t\n\t\tfor ($i = 0; $i < count($data); $i ++) {\n\t\t\t$left = \"\";\n\n\t\t\tif($data[$i]['logs'] == \"in\") {\n\t\t\t\t$logs = '<span class=\"label label-success\">TIMEIN</span>';\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$logs = '<span class=\"label label-warning\">TIMEOUT</span>';\n\t\t\t}\n\n\t\t\t$html = $html.'\n\t\t\t\t<tr>\n\t\t\t\t\t<td>'.($i +1).'</td>\n\t\t\t\t\t<td>'.$data[$i]['fname'].\" \".$data[$i]['lname'].'</td>\n\t\t\t\t\t<td>'.date('h:i:s A', strtotime($data[$i]['datetime'])).'</td>\n\t\t\t\t\t<td>'.date('M d, Y', strtotime($data[$i]['datetime'])).'</td>\n\t\t\t\t\t<td>'.$logs.'</td>\n\t\t\t\t</tr>';\n\t\t}\n\n\t\tif(count($data) > 0) {\n\t\t\treturn $html;\n\t\t}\n\t\telse {\n\t\t\treturn \"\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='text-center' colspan='5'><h4>-------------------- No records available. -------------------</h4></td>\n\t\t\t\t</tr>\n\t\t\t\";\n\t\t}\n\t}", "function printvalues(){\n\t\tprint_r([$this->bedroom,$this->bathroom,$this->kitchen, $this->livingroom]);\n\t}", "public function getHumidity();", "function get_daily_weather_for_month( \n $y = 2014, \n $m = 01 )\n {\n $days = date( 't', mktime( 0, 0, 0, $m, 1, $y ) );\n $data = array();\n for ( $i = 1; $i <= $days; $i++ ) {\n $date = date( 'Y-m-d', mktime( 0, 0, 0, $m, $i, $y ) );\n $results = $this->_db->select( \n \"SELECT * \n FROM weather_days\n WHERE date_day = '\".$date.\"'\" );\n if ( is_object( $results[0] ) ) {\n $data[$i] = $results[0];\n }\n }\n return $data;\n }", "public function display(){\n $weather = Weather::orderBy('created_at','desc')->first();\n\n return view('home')\n ->with('weather',$weather);\n }", "function emptyDays ($empty, $numDays, $month, $year) {\n for ($i = 1; $i <= $numDays; $i++) {\n $eachDay[$i] = $i; \n }\n foreach($eachDay as $day => &$wkday) {\n $wkday = date(\"w\", mktime(0,0,0,$month,$day,$year));\n }\n if ($eachDay[1] == 1) {\n echo $empty;\n } elseif ($eachDay[1] == 2) {\n echo $empty;\n echo $empty;\n } elseif ($eachDay[1] == 3) {\n echo $empty;\n echo $empty;\n echo $empty;\n } elseif ($eachDay[1] == 4) {\n echo $empty;\n echo $empty;\n echo $empty;\n echo $empty;\n } elseif ($eachDay[1] == 5) {\n echo $empty;\n echo $empty;\n echo $empty;\n echo $empty;\n echo $empty;\n } elseif ($eachDay[1] == 6) {\n echo $empty;\n echo $empty;\n echo $empty;\n echo $empty;\n echo $empty;\n echo $empty;\n } else { \n }\n }", "public function get_upcoming() {\n\t\t$sql = \"SELECT DATE_FORMAT (datetime,'%M %e') as date, event FROM events\n\t\tWHERE datetime > now() limit 2\";\n\t\t$eh = $this->pdo->query($sql);\n\t\t$text = \"Upcoming Events: \\n-------------------\\n \";\n\t\t\tforeach ($eh as $ev ){\n\t\t\t\t$text .= $ev['date'] . \": \" . $ev['event'] . NL;\n\t\t\t}\n\t\t$text .= NL;\n\t\tfile_put_contents(FileDefs::next_dir . '/' . FileDefs::tease_calendar,$text);\n\t\t//echo $text . BRNL;\n\n\t\treturn true;\n\t}", "public function current() {\n\n $wind = $this->getCurrentWind();\n $temp_extrems = $this->getTempExtremsToday();\n $weather = $this->decodeCurrentWeather();\n\n return [\n 'weather' => $weather->name,\n 'weather_icon' => $weather->icon,\n 'temp' => round($this->getCurrentTemp()) . '&deg;',\n 'stats' => [\n [\n 'label' => $this->lang->low,\n 'value' => $temp_extrems['low'] . '&deg;'\n ],\n\n [\n 'label' => $this->lang->high,\n 'value' => $temp_extrems['high'] . '&deg;'\n ],\n\n [\n 'label' => $this->lang->wind,\n 'value' => $wind['speed'] . 'm/s'\n ],\n\n [\n 'label' => $this->lang->rain,\n 'value' => $this->getRainToday() . 'mm'\n ],\n\n [\n 'label' => $this->lang->direction,\n 'value' => $wind['direction'] . '&deg;'\n ],\n\n [\n 'label' => $this->lang->humidity,\n 'value' => $this->getCurrentHumidity() . '%'\n ],\n\n ]\n ];\n }", "public function is_day()\n {\n }", "public function isAllday() {\n\t\treturn $this->getAllday();\n\t}", "public function chk_dat()\n {\n echo \"title = \" . $this->dat[\"title\"] . \"\\n\\n\";\n echo \"name = \" . $this->dat[\"name\"] . \"\\n\\n\";\n echo \"era = \" . $this->dat[\"era\"] . \"\\n\\n\";\n echo \"rows = \" . $this->dat[\"rows\"] . \"\\n\\n\";\n\n echo $this->dat[\"field\"][\"n\"] . \", \".\n $this->dat[\"field\"][\"id\"] . \", \".\n $this->dat[\"field\"][\"scd\"] . \", \".\n $this->dat[\"field\"][\"name\"] . \", \".\n $this->dat[\"field\"][\"ymd\"] . \", \".\n $this->dat[\"field\"][\"line\"] . \", \".\n $this->dat[\"field\"][\"debit\"] . \", \".\n $this->dat[\"field\"][\"credit\"] . \", \".\n $this->dat[\"field\"][\"debit_name\"] . \", \".\n $this->dat[\"field\"][\"credit_name\"] . \", \".\n $this->dat[\"field\"][\"debit_account\"] . \", \".\n $this->dat[\"field\"][\"credit_account\"] . \", \".\n $this->dat[\"field\"][\"debit_amount\"] . \", \".\n $this->dat[\"field\"][\"credit_amount\"] . \", \".\n $this->dat[\"field\"][\"amount\"] . \", \".\n $this->dat[\"field\"][\"remark\"] . \", \".\n $this->dat[\"field\"][\"settled_flg\"] . \"\\n\\n\";\n\n $cnt = $this->dat[\"rows\"];\n for ($i = 0; $i < $cnt; $i++) {\n echo $this->dat[\"data\"][$i][\"n\"] . \", \".\n $this->dat[\"data\"][$i][\"id\"] . \", \".\n $this->dat[\"data\"][$i][\"scd\"] . \", \".\n $this->dat[\"data\"][$i][\"name\"] . \", \".\n $this->dat[\"data\"][$i][\"ymd\"] . \", \".\n $this->dat[\"data\"][$i][\"line\"] . \", \".\n $this->dat[\"data\"][$i][\"debit\"] . \", \".\n $this->dat[\"data\"][$i][\"credit\"] . \", \".\n $this->dat[\"data\"][$i][\"debit_name\"] . \", \".\n $this->dat[\"data\"][$i][\"credit_name\"] . \", \".\n $this->dat[\"data\"][$i][\"debit_account\"] . \", \".\n $this->dat[\"data\"][$i][\"credit_account\"] . \", \".\n $this->dat[\"data\"][$i][\"debit_amount\"] . \", \".\n $this->dat[\"data\"][$i][\"credit_amount\"] . \", \".\n $this->dat[\"data\"][$i][\"amount\"] . \", \".\n $this->dat[\"data\"][$i][\"remark\"] . \", \".\n $this->dat[\"data\"][$i][\"settled_flg\"] . \"\\n\\n\";\n }\n }", "public function getMinutelyForecast() : array\n {\n $data = $this->getForecast();\n return $data[self::MINUTELY_KEY] ?? [];\n }", "public function BuildDailySpoil()\n {\n\n }", "function test($the_data)\n\t\t{\n\t\t\techo '<pre>';\n\t\t\tvar_dump($the_data);\n\t\t\techo '<pre/>';\n\t\t\texit;\n\t\t}", "public function getCurrentInformation($ticker)\n {\n if (!$ticker) {\n return false;\n }\n $uri = env('STOCKS_API');\n $uri .= 'latest_information' . '?ticker=' . $ticker;\n $response = Http::get($uri);\n if (!$response->status() === 200) {\n return false;\n }\n $body = json_decode($response->body());\n return json_decode(json_encode($body), true);\n }", "public function fire()\n\t{\n $date = Day::max('date');\n\t\t$dayData = Day::where('date', '=', \"{$date}\")->get()->first();\n $lastData = $dayData->archives->last();\n\n $lastHourRain = DB::table('archive')->where('day_id', '=', $dayData->id)->orderBy('id', 'desc')->take(6)->lists('rain'); \n\n $datetime = new DateTime(\"{$dayData->date} {$lastData->time}\");\n $datetime->setTimezone(new DateTimeZone('UTC')); \n\n $t=((17.27*$lastData->temperature)/(237.7+$lastData->temperature))+log($lastData->humidity/100);\n $dewPoint = (237.7*$t)/(17.27-$t); \n\n $data = array(\n \"ID\" => \"IBUENOSA197\",\n \"PASSWORD\" => \"145000\",\n \"action\" => \"updateraw\",\n \"dateutc\" => $datetime->format('d/m/Y H:i:s'),\n \"tempf\" => (9/5) * $lastData->temperature + 32, \n \"winddir\" => $lastData->wind_direction == 255 ? 0 : $lastData->wind_direction*22.5,\n \"windspeedmph\" => 0.621371 * $lastData->wind_speed,\n \"windgustmph\" => 0.621371 * $lastData->wind_gust,\n \"humidity\" => $lastData->humidity,\n \"dewptf\" => (9/5) *$dewPoint + 32,\n \"rainin\" => 0.0393700787 * array_sum($lastHourRain),\n \"dailyrainin\" => 0.0393700787 * $dayData->sum_rain, \n );\n\n $getData = array();\n foreach ($data as $key=>$value)\n $getData[] = \"{$key}={$value}\";\n\n $requestGet = implode(\"&\", $getData);\n\n $request = Requests::get(\"http://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?{$requestGet}\");\n\n $this->info(\"Response from Weather Underground is '{$request->body}'\");\n\t}", "public function hasCriticalDf(){\r\n return $this->_has(10);\r\n }", "public function dayList()\n\t{\n\t\techo json_encode($this->sched_day->fetchData());\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}", "function roshine_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}", "public function shouldGetTemperature(): void\n {\n $this->assertPollutantLevel('getTemperature', $this->faker->randomFloat(2, -100, 100));\n }", "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 static function debug_data()\n {\n }", "function getWeather($options = array()) {\n\t\tif ($this->getWeatherData($options)) {\n\t\t\t$this->processingWeatherData();\n\t\t\t// register hit data to weather\n\t\t\tif ((bool)$this->register_hits)\n\t\t\t$this->_registerHits();\n\t\t}\n\t\treturn $this->weather_data;\n\t}" ]
[ "0.5812498", "0.56404227", "0.56036806", "0.5561534", "0.55160725", "0.5343139", "0.5319446", "0.5302747", "0.5290477", "0.5281897", "0.52360475", "0.5211746", "0.5149673", "0.5130905", "0.510455", "0.5091989", "0.5071574", "0.50558853", "0.5049033", "0.50471157", "0.5016741", "0.49902534", "0.4990219", "0.4972163", "0.49631596", "0.49349493", "0.49342075", "0.49138206", "0.4911606", "0.48934677", "0.48644435", "0.4859883", "0.48178765", "0.48118544", "0.4807132", "0.4798157", "0.47969744", "0.47910932", "0.47909972", "0.47847596", "0.4783709", "0.4778301", "0.47519022", "0.47468972", "0.47454408", "0.47300646", "0.47146282", "0.4704438", "0.46925256", "0.467957", "0.46792638", "0.46777123", "0.46669647", "0.46669647", "0.46564218", "0.46564218", "0.46483636", "0.46454975", "0.46294034", "0.46274823", "0.46271655", "0.46246865", "0.4620709", "0.46178243", "0.46177182", "0.46143797", "0.4605418", "0.45984873", "0.45971522", "0.45962617", "0.45761603", "0.45735115", "0.4572024", "0.45687515", "0.4563971", "0.45627424", "0.45617655", "0.45612425", "0.45576555", "0.45570344", "0.45492834", "0.4548558", "0.45402747", "0.45396197", "0.45371723", "0.45314237", "0.45286444", "0.45187673", "0.45149413", "0.45144477", "0.45132598", "0.45105934", "0.4506299", "0.45036328", "0.44997674", "0.4498512", "0.44968376", "0.44962457", "0.44955513", "0.4491925", "0.44837123" ]
0.0
-1
Crea la tabla para recoger los datos del formulario
function wp_plugin_business_init() { global $wpdb; // Este objeto global permite acceder a la base de datos de WP // Crea la tabla sólo si no existe // Utiliza el mismo prefijo del resto de tablas $tabla_aspirantes = $wpdb->prefix . 'business'; // Utiliza el mismo tipo de orden de la base de datos $charset_collate = $wpdb->get_charset_collate(); // Prepara la consulta $query = "CREATE TABLE IF NOT EXISTS $tabla_aspirantes ( id mediumint(9) NOT NULL AUTO_INCREMENT, titulo varchar(200) NOT NULL, nombre varchar(300) NOT NULL, cliente varchar(400) NOT NULL, dirurl varchar(400) NOT NULL, fecha datetime NOT NULL, imagen varchar(600) NOT NULL, UNIQUE (id) ) $charset_collate;"; // La función dbDelta permite crear tablas de manera segura se // define en el archivo upgrade.php que se incluye a continuación include_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta($query); // Lanza la consulta para crear la tabla de manera segura }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function crearTablas(){\r\n\t\t\t$this->crearTablaUsuario();\r\n\t\t\t$this->crearTablaDeporte();\r\n\t\t\t$this->crearTablaUsuarioDeporte();\r\n\t\t\t$this->crearTablaPassw();\r\n\t\t}", "function create_form_table($args) {\n\t\t$table_name = $args[\"singular_code_name\"];\n\t\t$result = $GLOBALS['db']->query(\"DROP TABLE \".$table_name);\n\t\t$result = $GLOBALS['db']->query(\"CREATE TABLE IF NOT EXISTS \".$table_name.\" (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY)\");\n\n\t\t$items = $args[\"items\"];\n\n\t\tforeach($items as $item) {\n\t\t\tif($item[\"type\"] == 'input') {\n\t\t\t\tswitch($item[\"var_type\"][0]) {\n\t\t\t\t\tcase 'varchar':\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'string':\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" VARCHAR(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" \".$item[\"var_type\"][0].\"(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD reg_date TIMESTAMP\");\n\t}", "public function create(){\n $alter = '';\n $crear = '';\n $creartablas = '';\n\n $a = '';\n if(!empty($_POST)){\n if( isset($_POST['creartabla']) )\n $a = $_POST['creartabla'];\n }\n if($a!=''):\n $array = explode(',', $a);\n $crear = '';\n $tablas = array();\n foreach ($array as $v): \n $v = trim($v);\n $inic = $crear;\n if( stristr($v, 'id_') ){ \n $tabla = str_replace('id_', '', $v);\n $crear.= 'CREATE TABLE IF NOT EXISTS '.$tabla.' ( ';\n $crear.= ' id_'.$tabla.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n }\n if( stristr( $v, '_id') ){\n $tablas[] = str_replace('_id', '', $v);\n $crear.= ','.$v.' INTEGER(10)'; \n } \n\n if( stristr($v, 'fecha' )or stristr($v, 'fecha') ) $crear.= ','.$v.' DATE NOT NULL '; \n if( stristr($v, '_nro' ) or stristr($v, 'nro_' ) ) $crear.= ','.$v.' INTEGER(10) NOT NULL '; \n if( stristr($v, 'text' ) or stristr($v, 'texto' ) ) $crear.= ','.$v.' TEXT NOT NULL COMMENT \\'col:12\\' '; \n if( stristr($v, 'timestamp' ) ) $crear.= ','.$v.' TIMESTAMP DEFAULT CURRENT_TIMESTAMP '; \n if($inic==$crear) $crear.= ','.$v.' VARCHAR(255) NOT NULL '; \n \n \n endforeach;\n\n $fk = '';\n $creartablas ='';\n foreach ($tablas as $value):\n $fk.=', FOREIGN KEY('.$value.'_id) REFERENCES '.$value.'(id_'.$value.') '; \n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$value.' ( ';\n $creartablas.= ' id_'.$value.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$value.' VARCHAR(99) NOT NULL';\n $creartablas.= ', detail_'.$value.' VARCHAR(99) NOT NULL ';\n $creartablas.= ') ENGINE = InnoDB; ';\n endforeach;\n $crear .= $fk.') ENGINE = InnoDB;';\n\n $a = $creartablas.$crear;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n $tables = $this -> Tables_model -> table_name();\n $this->session->set_userdata('tables', $tables);\n return $re;\n endif;\n }", "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 glv_create_tables(){\r\n global $wpdb;\r\n \r\n //el nombre de la tabla, utilizamos el prefijo de wordpress\r\n $table_forms = $wpdb->prefix.'glv_forms'; \r\n\r\n //sql con el statement de la tabla \r\n $glv_form = \"CREATE TABLE \".$table_forms.\"(\r\n for_id int(11) NOT NULL AUTO_INCREMENT,\r\n for_name varchar(100) DEFAULT NULL,\r\n for_value text DEFAULT NULL,\r\n for_date date,\r\n UNIQUE KEY for_id (for_id)\r\n )\";\r\n\r\n //upgrade contiene la función dbDelta la cuál revisará si existe la tabla o no\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n \r\n //creamos la tabla\r\n dbDelta($glv_form);\r\n }", "private function _agregarComponenteTabuladores() {\n $componente_carga = new Acciones_ComponenteAltaInsercion();\n\n $this->_id_componente = $componente_carga->crearComponente($_POST['id_tb_rel'], 'PaginaTabuladores', '');\n\n // crear componente y obtener id de insercion\n $componente_carga->consultaParametro($this->_id_componente, 'id_tabla', $_GET['id_tabla']);\n $componente_carga->consultaParametro($this->_id_componente, 'intermedia_tb_id', $_GET['intermedia_tb_id']);\n $componente_carga->consultaParametro($this->_id_componente, 'id_tabla_trd', $_GET['id_tabla_trd']);\n if (isset($_POST['id_cp_rel']) && ($_POST['id_cp_rel'] != '')) {\n $componente_carga->consultaParametro($this->_id_componente, 'id_cp_rel', $_POST['id_cp_rel']);\n }\n $componente_carga->consultaParametro($this->_id_componente, 'tabla_relacionada', $_POST['id_tb_rel']);\n }", "function form() \r\n {\r\n \t //El formateo va a ser realizado sobre una tabla en la que cada fila es un campo del formulario\r\n $table = &html_table($this->_width,0,2,2);\r\n $table->add_row($this->_showElement(\"Asunto\", '6', \"asunto_de_usuario\", 'Asunto', \"Asunto\", \"left\" )); \r\n $table->add_row($this->_showElement(\"Comentario\", '7', \"comentario\", 'Texto', \"Comentario\", \"left\" )); \r\n \r\n $this->set_form_tabindex(\"Aceptar\", '10'); \r\n $label = html_label( \"submit\" );\r\n $label->add($this->element_form(\"Aceptar\"));\r\n $table->add_row(html_td(\"\", \"left\", $label));\r\n \r\n return $table; \r\n }", "function crear_tabla()\n {\n //Array para saber cuantos dias tienen los meses\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n //Recogemos los datos\n $num1 = filter_input(INPUT_POST, 'num1');\n $profe = filter_input(INPUT_POST, 'profe');\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n //Recogemos los horarios del profesor y la zona seleccionados\n $h_profe=$this->model->get_h_profe($profe, $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n //Sacamos los cinco numeros de la semana\n for($i=0;$i<5;$i++)\n {\n $numeros[$i+1] = $numeros[$i]+1;\n //si el numero es superior al dia maximo del mes entonces le restamos el dia maximo y reseteamos los dias\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n //marcamos que cambiamos de mes\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n //bucle para crear los tr de las horas\n for($i=8;$i<21;$i++)\n {\n //Quitamos las horas de comer\n if($i!=14 && $i!=15)\n {\n //generamos el primer td con la hora\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n //bucle para sacar el resto de td\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n //foreach de horarios para comprobar si coincide con la fecha y tenemos que printar un boton\n foreach ($h_profe as $hora)\n {\n //creamos otra variable de mes para no modificar la global\n $mes_1 = $mes;\n //Preguntas para saber si hay que modificar el mes, ya sea sumar o cambiar a 1\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n //Añadimos un zero a la izquierda si es inferior a 10\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $dia = str_pad($numeros[$k], 2, \"0\", STR_PAD_LEFT);\n //Montamos la fecha\n $fecha = $año.\"-\".$mes_1.\"-\".$dia ;\n\n //Preguntamos si la hora del tr es la misma que la del horario y lo mismo con la fecha\n if($hora['hora']== $i && $hora['fecha'] == $fecha)\n {\n //Si coincide creamos el boton\n $total.= \"<button class='practica hvr-grow-shadow'>Marcar</button>\";\n }\n }\n //Le metemos un span oculto con los datos de dia y hora.\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n\n }\n $total.=\"</tr>\";\n }\n }\n //Enviamos la tabla\n echo $total;\n }", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "public function obtenerTabla() {\n $builder = $this->db->table($this->table);\n $data = $builder->get()->getResult();\n $tabla = '';\n foreach($data as $item):\n $accion = '<div class=\\\"custom-control custom-radio\\\">';\n $accion .= '<input type=\\\"radio\\\" id=\\\"row-'.$item->tipoTelefonoId.'\\\" name=\\\"id\\\" class=\\\"custom-control-input radio-edit\\\" value=\\\"'.$item->tipoTelefonoId.'\\\">';\n $accion .= '<label class=\\\"custom-control-label\\\" for=\\\"row-'.$item->tipoTelefonoId.'\\\"> </label> </div>';\n $tabla .= '{\n \"concepto\" : \"'.$item->tipoTelefonoTipo.'\",\n \"acciones\" : \"'.$accion.'\"\n },';\n endforeach;\n $tabla = substr($tabla, 0, strlen($tabla) - 1);\n $result = '{\"data\" : ['. $tabla .']}';\n return $this->response->setStatusCode(200)->setBody($result);\n }", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "function make_form_row(){\n\t\t$index = $this->col_index;\n\t\t# remove the * at the start of the first line\n\t\t$this->col_data = preg_replace(\"/^\\*/\",\"\",$this->col_data);\n\t\t# split the lines and remove the * from each. The value in each line goes into the array $values\n\t\t$values = preg_split(\"/\\n\\*?/\", $this->col_data);\n\t\t# pad the values array to make sure there are 3 entries\n\t\t$values = array_pad($values, 3, \"\");\n\t\t\n\t\t/*\n\t\tmake three input boxes. TableEdit takes row input from an input array named field a \n\t\tvalue for a particular field[$index] can be an array\n\t\t\tfield[$index][] is the field name\n\t\t\t40 is the length of the box\n\t\t\t$value is the value for the ith line\n\t\t \n\t\t */\n\t\t $form = ''; #initialize\n\t\t foreach($values as $i => $value){\n\t\t\t$form .= \"$i:\".XML::input(\"field[$index][]\",40,$value, array('maxlength'=>255)).\"<br>\\n\";\n\t\t}\n\t\treturn $form;\n\t\n\t}", "function crear_tabla_horario()\n {\n //El funcionamiento es el mismo que en crear_tabla, excepto que aqui no le pasamos el profesor\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n\n $num1 = filter_input(INPUT_POST, 'num1');\n\n $profe=$this->model->get_profe($_SESSION['iduser']);\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n $mes = str_pad($mes, 2, \"0\", STR_PAD_LEFT);\n $h_profe=$this->model->get_h_profe($profe[0]['id_profesores'], $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n for($i=0;$i<5;$i++)\n {\n\n $numeros[$i+1] = $numeros[$i]+1;\n\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n for($i=8;$i<21;$i++)\n {\n if($i!=14 && $i!=15)\n {\n\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n $ano=str_pad($numeros[$k],2,\"0\",STR_PAD_LEFT);\n //Si el horario del profe esta vacio printamos boton en todos los td\n if(!empty($h_profe))\n {\n $cont = 0;\n foreach ($h_profe as $hora)\n {\n $mes_1 = $mes;\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $fecha = $año.\"-\".$mes_1.\"-\".$ano;\n\n //Comprobamos si la hora y la fecha coincide y sumamos 1 al contador\n if($hora['hora']==$i && $hora['fecha'] == $fecha)\n {\n $cont++;\n }\n }\n //Si el cantador sigue en 0 printamos boton ya que significa que no ha sido marcada\n if($cont ==0)\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n }\n else\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n }\n $total.=\"</tr>\";\n }\n }\n echo $total;\n }", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "function make_table($result)\r\n{\r\n $temp_result=\"\\n<form name=f1 metbod='POST' action=''>\";\r\n $temp_result.=\"\\n<table cellpadding=2 cellspacing=1>\";\r\n for($i=0;$i<mysql_num_rows($result);$i++)\r\n {\r\n $a_rows=mysql_fetch_assoc($result);\r\n $noofcolumns=mysql_num_fields($result);\r\n #Starting rows-\r\n if($i==0)\r\n\t{\r\n\t $temp_result.=\"\\n<tr bgcolor=#d3dce3>\\n\";\r\n\t \t $temp_result.=\"<td colspan=3></td>\";\r\n\t foreach($a_rows as $key=>$value)\r\n\t {\r\n\t $temp_result.=\"<td>\".$key.\"</td>\";\r\n\t }\r\n\t $temp_result.=\"\\n</tr>\";\r\n\t}\r\n\r\n #data rows-\r\n $temp_result.=\"\\n<tr bgcolor=\".(($i%2==0)?\"#e5e5e5\":\"#d5d5d5\").\">\\n\";\r\n\t#edit columns-\r\n $temp_result.=\"\\n\\t<td><input type=checkbox name=check\".$i.\"></td>\";\r\n $temp_result.=\"\\n\\t<td><a name=\".$i.\" href=\\\"javascript:enable(\".$i.\",\".$noofcolumns.\")\\\"><img src=\\\"b_edit.png\\\" border=0></a></td>\";\r\n $temp_result.=\"\\n\\t<td><a href=\\\"\\\"><img src=\\\"b_drop.png\\\" border=0></a></td>\";\r\n\t#data columns- \r\n foreach($a_rows as $key=>$value)\r\n\t{\r\n\t $temp_result.=\"\\n\\t<td visibility='hidden'>\".$value.\"</td>\";\r\n\t $temp_result.=\"\\n\\t\";\r\n\t $temp_result.='<td id='.$key.$value.' display=\"none\"><input type=\"text\" disabled value=\"'.$value.'\" size='.size_of($key);\r\n\t /* if($key==\"Rollno\")*/ $temp_result.=(' name='.parsekey($key).$i);\r\n\t $temp_result.=' ></td>';\r\n\t}\r\n $temp_result.=\"\\n</tr>\";\r\n }\r\n\r\n $temp_result.=\"\\n</table>\";\r\n $temp_result.=\"\\n</form>\";\r\n\r\n $temp_java_result='<SCRIPT type=text/javascript>\r\n\tfunction hide(obj)\r\n\t{\r\n\t\tif(obj.style.display==\"none\")obj.style.display=\"\";\r\n\t\telse obj.style.display=\"none\";\r\n\t}\r\n\tfunction enable(row,col)\r\n\t{\r\n//\t\talert(\"row=\"+row+\"col=\"+col);\r\n\t\tfor( i=row*col+row+1;i<row*col+col+row+1 ;i++ )\r\n\t\t{\r\n//\t\t\talert(\"i=\"+document.f1.elements[i].name);\r\n\t\t\tdocument.f1.elements[i].disabled=false;//abled();//=\"\";\r\n\t\t}\t\t';\r\n\r\n foreach($a_rows as $key=>$value)\r\n {\r\n $temp_java_result.=\"\\n\\t\\tcellname=eval(\\\"\".parsekey($key).\"\\\"+row);\";\r\n $temp_java_result.=\"\\n\\t\\tdocument.f1.cellname.enabled=on;\";\r\n }\r\n $temp_java_result.='\r\n\t}\r\n\t</SCRIPT>';\r\n \r\n $temp_result=$temp_java_result.$temp_result;\r\n return $temp_result;\r\n}", "function create_table($table_name, $field_name, $field_type, $field_length){\n // $sql_chk = db::query(\"SELECT COUNT(*) AS TOTAL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='\".strtoupper(db::$_dbName).\"' AND TABLE_NAME = '\".$table_name.\"'\");\n // $rec_chk = db::fetch_array($sql_chk);\n // if($rec_chk['TOTAL'] > 0)\n // {\n // echo \"<script>alert('ตาราง \".$table_name.\" ถูกใช้งานแล้ว กรุณาตรวจสอบ'); window.location.href='\".$_SERVER['HTTP_REFERER'].\"';</script>\";\n // db::db_close();\n // exit;\n // }\n\n $field_length = $field_length == \"\" ? \"\" : \"(\".$field_length.\")\";\n\n $sql_create = \" CREATE TABLE [dbo].[\".$table_name.\"]([\".$field_name.\"] \".$field_type.\" \".$field_length.\" NOT NULL, PRIMARY KEY ([\".$field_name.\"]))\";\n\n }", "function build_table($new,$array_cat){\n\t\t//de categorias de serviceo.\n\t\t//Hacemos las iniciaciones pertinentes para intentar\n\t\t//aclarar un poco el codigo\n\t\t$ini_fila=\"<tr>\";\n\t\t$fin_fila=\"</tr>\";\n\t\t$ini_col='<td valign=\"top\" nowrap>';\n\t\t$fin_col=\"</td>\";\n\t\t$NUM_MAX_COLS=1;\n\t\t//Por cada columna un padre y sus hijos.\n\t\t$cadena='<table border=\"0\">';\n\t\t$num_current_col=$NUM_MAX_COLS+1;\t\t\n\t\tfor ($i=0;$i<count($array_cat);$i++){\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$num_current_col=1;\n\t\t\t\t$cadena=$cadena.$ini_fila;\n\t\t\t}\n\t\t\t$cadena=$cadena.$ini_col;\n\t\t\t//Damos el padre para que empiece la recursividad\t\t\t\n\t\t\t\n\t\t\t$cadena=$cadena.$this->build_col($new,$array_cat[$i],0,\"services\");\t\t\n\t\t\t//0 es el numero de tabulaciones inicial.\n\t\t\t//\"services\" es el nombre que tendran los checkbox.\n\t\t\t$cadena=$cadena.$fin_col;\n\t\t\t$num_current_col++;\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$cadena=$cadena.$fin_fila;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Si el numero de la columna actual es menor\n\t\t//que el numero maximo de columnas +1 \n\t\t//restamos al maximo la actual para saber cuantas faltan. \n\t\tif ($num_current_col<$NUM_MAX_COLS+1){\t\t\t\n\t\t\t$cadena=$cadena.'<td colspan=\"'.($NUM_MAX_COLS+1-$num_current_col).'\">&nbsp;'.$fin_col.$fin_fila;\n\t\t}\n\t\t$cadena=$cadena.'</table>';\n\t\treturn $cadena;\n\t}", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "public function create()\n {\n $capitulo = Capitulo::find(Session::get('capitulo_id'));\n $libro = Libro::find($capitulo->libro_id);\n return view('descarga.formTable', compact('capitulo', 'libro'));\n }", "private function create_tables()\n {\n global $wpdb;\n\n /* http://wiip.fr/content/choisir-le-type-de-colonne-de-ses-tables-mysql */\n $sql = '\n CREATE TABLE IF NOT EXISTS '.$this->tables['users'].'(\n id int(11) NOT NULL auto_increment,\n PRIMARY KEY (id),\n nom VARCHAR(255) NOT NULL,\n prenom VARCHAR(255) NOT NULL,\n email VARCHAR(320) NOT NULL,\n password VARCHAR(500) NOT NULL,\n adresse CHAR(255),\n codepostal CHAR(10),\n ville CHAR(60),\n pays CHAR(60),\n telephone_professionnel CHAR(20),\n dateinscription CHAR(20) NOT NULL,\n statut VARCHAR(15),\n evenement VARCHAR(255),\n date_evenement DATE,\n specialite VARCHAR(100),\n categorie VARCHAR(20),\n isUpdate VARCHAR(10),\n organisme_facturation CHAR(100),\n email_facturation CHAR(255),\n adresse_facturation CHAR(255),\n ville_facturation CHAR(60),\n codepostal_facturation CHAR(10),\n pays_facturation CHAR(50),\n contacts TEXT\n \n\n )';\n\n dbDelta($sql);\n\n $sql = '\n CREATE TABLE IF NOT EXISTS '.$this->tables['users_file'].'(\n id int(11) NOT NULL auto_increment,\n PRIMARY KEY (id),\n email VARCHAR(320) NOT NULL,\n fichier VARCHAR(500) NOT NULL,\n chemin VARCHAR(500) NOT NULL,\n date_enregistrement VARCHAR(500) NOT NULL,\n type_doc VARCHAR(100) NOT NULL\n \n )';\n\n dbDelta($sql);\n }", "function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }", "static public function ctrAgregarTabla($datos){\n\n\t\t\n\t\techo '<table class=\"table table-bordered\">\n <tbody>\n <tr>\n <th style=\"width: 10px;\">#</th>\n <th style=\"width: 10px;\">Cantidad</th>\n <th style=\"width: 400px;\">Articulo</th>\n <th style=\"width: 70px;\">Precio</th>\n <th style=\"width: 70px;\">Total</th>\n <th style=\"width: 10px;\">Opciones</th> \n </tr>';\n\t\t\n\t\t\techo \"<tr>\n\t\t\t\t\t\n\t\t\t\t\t<td>1.</td>\n\t\t\t\t\t<td><span class='badge bg-red'>\".$datos['cantidadProducto'].\"</span></td>\n\t\t\t\t\t<td>\".$datos['productoNombre'].\"</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['cantidadProducto']*$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td><button class='btn btn-link btn-xs' data-toggle='modal' data-target='#myModalEliminarItemVenta'><span class='glyphicon glyphicon-trash'></span></button></td>\n\t\t\t\t\t\n\t\t\t\t </tr>\";\n\t\t\t\t\n\t\techo '</tbody></table>';\n\t\t\t\t\n\t\t\n\t}", "function makeForm() {\n if($this->table_title != '' ) {\n $db_obj = new db_class();\n $desc_table = $db_obj->tableDescription($this->table_title);\n $db_obj->closeDB();\n \n// showArray($desc_table);\n echo '<form id=\"generic_edit_form\" method=\"POST\" >';\n echo '<input type=\"hidden\" name=\"title_input\" value=\"name\"> '; // THIS MUST BE HERE FOR CLONABLE FORMS!!!\n echo '<input type=\"hidden\" name=\"table\" value=\"vendors\">'; // THE TABLE MUST BE LABELED\n echo '<b>This is a generic input</b> <input type=\"text\" name=\"generic\">' . \"\\n\";\n \n echo '<br><br><input type=\"submit\" >';\n echo '</form>';\n } else {\n echo '<h2>hello, form<h2>';\n }\n }", "private function tbl_guiones_registro() {\r\n\t\t\t$this->guiones_registro = $this->esquema->createTable('GUIONES_REGISTRO');\r\n\t\t\t$this->guiones_registro->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 registro del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('FECHA', 'datetime', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'comment' => 'Fecha de ingreso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('USUARIO', '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 usuario del registro [ID de la tabla USUARIOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('TIPO', '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 tipo de registro [ID de la tabla GUIONES_REGISTRO_TIPO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AFECTACION', '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 de la afectacion del registro [ID de la tabla GUIONES_REGISTRO_AFECTACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AVISO', 'bigint', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'default' => 0,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Numero del aviso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('UBICACION', '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 de la UBICACION del registro [ID de la tabla GUIONES_REGISTRO_UBICACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->usuarios, array('USUARIO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_tipo, array('TIPO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_afectacion, array('AFECTACION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_ubicacion, array('UBICACION'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function create()\n {\n return view('tables.create');\n }", "public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n User::create_table();\n }", "public function create()\n {\n return view('users_tables.create');\n }", "private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }", "private function createNewTable() {\n //generate the create table statement\n $sql = \"create table $this->tableName(\";\n $comma = \"\";\n $keyNameList = [];\n foreach ($this->columns as $column /* @var $column DbColumn */) {\n $sql .= \" $comma $column->columnName $column->dataType $column->extraStuff\";\n $comma = \",\";\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n //generate the primary key list, if any are present\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \",$primaryKeySql)\";\n }\n\n //constraints\n $cSql = \"\";\n //we are assuming that there is at least one table. otherwise, the query would fail anyway.\n $comma = \",\";\n foreach ($this->constraints as $c) {\n $cSql .= \" $comma\";\n switch ($c->constraintType) {\n case \"foreign key\":\n $cSql .= \" FOREIGN KEY($c->columnName) REFERENCES $c->referencesTableName($c->referencesColumnName)\";\n break;\n }\n }\n $sql = \"$sql $primaryKeySql $cSql)\";\n return DbManager::nonQuery($sql);\n }", "function crearTablas(){\n $cnn = new conexion();\n $con = $cnn->conectar();\n mysqli_select_db($con,\"TecLogin\");\n $sql = \"CREATE TABLE usuarios (\n id INT(11) NOT NULL AUTO_INCREMENT,\n usuario CHAR(50),\n contrasena CHAR(50),\n PRIMARY KEY(id)\n )\";\n if(mysqli_query($con,$sql)){\n echo \"Tabla Creada\";\n }\n mysqli_close($con);\n}", "public function tableWizard() {}", "function create_table($id, $data, $headers=[], $caption = \"\") {\n $table = \"<table id=\\\"$id\\\"><caption>$caption</caption>\";\n\n if (sizeof($headers) > 0) {\n $table .= add_row(create_headers($headers));\n }\n\n foreach($data as $vals) {\n $table .= add_row(create_row($vals));\n }\n\n $table .= \"</table>\";\n return $table;\n }", "public function createTable($prenotazioni) {\r\n echo \"<table id='tblPrenotazioni' summary='Tabella che riporta le prenotazioni delle aule di interesse per gli studenti di Matematica e Informatica.' >\";\r\n echo \"<thead>\";\r\n echo \"<tr> <th> ORARIO: </th>\";\r\n // NUMERO DI AULE:\r\n $numAule = 0;\r\n foreach (self::$array_aule as $aula) {\r\n echo \"<th> $aula </th>\";\r\n $numAule++;\r\n }\r\n echo \"</tr>\";\r\n echo \"</thead>\";\r\n echo \"<tbody>\";\r\n for ($i = 0; $i <= 22; $i++) {\r\n echo \"<tr> <td class='indice_ora'> \".$this->convertiInOra($i).\" </td>\";\r\n if (isset($prenotazioni[$i])) {\r\n foreach (self::$array_aule as $aula) {\r\n if (isset($prenotazioni[$i][$aula])) {\r\n if ($prenotazioni[$i][$aula]==\"\\\"\")\r\n echo \"<td class='apici'> <span > \\\" </span> </td>\";\r\n else\r\n echo \"<td class='corso'> <span>\" . $prenotazioni[$i][$aula][4] . \"</span> </td>\";\r\n } else {\r\n echo \"<td> </td>\";\r\n $this->arrayAuleLibere[$i][$aula]=\"libera\";\r\n }\r\n }\r\n } else {\r\n for ($j = 0; $j < $numAule; $j++)\r\n echo \"<td> </td>\";\r\n $this->arrayAuleLibere[$i]=\"tutto libero\";\r\n }\r\n echo \"</tr>\";\r\n } \r\n echo \"</tbody>\";\r\n echo \"</table>\";\r\n //var_dump($this->arrayAuleLibere);\r\n }", "function Forms_creer_table($structure_xml,$type=NULL, $unique = true, $c=NULL){\n\tinclude_spip('inc/xml');\n\n\t$xml = spip_xml_load($structure_xml);\n\tforeach($xml as $k1=>$forms)\n\t\tforeach($forms as $k2=>$formscont)\n\t\t\tforeach($formscont as $k3=>$form)\n\t\t\t\tforeach($form as $k4=>$formcont)\n\t\t\t\t\tforeach($formcont as $prop=>$datas)\n\t\t\t\t\tif ($prop=='type_form'){\n\t\t\t\t\t\tif ($type)\n\t\t\t\t\t\t\t$xml[$k1][$k2][$k3][$k4][$prop] = array($type);\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t$type = trim(applatit_arbre($datas));\n\t\t\t\t\t}\n\n\tif (!$type) return;\n\tif ($unique){\n\t\t$res = spip_query(\"SELECT id_form FROM spip_forms WHERE type_form=\"._q($type));\n\t\tif (spip_num_rows($res))\n\t\t\treturn;\n\t}\n\t// ok on peut creer la table\n\t$snippets_forms_importer = charger_fonction('importer','snippets/forms');\n\t$id_form = $snippets_forms_importer(0,$xml);\n\tif ($c!==NULL){\n\t\tinclude_spip('forms_crayons');\n\t\tform_revision($id_form,$c);\n\t}\n\treturn $id_form;\n}", "function create_new() {\n if($this->table_title != '' ) {\n $this->title = 'New ' . $this->table_title .\n $this->makeForm();\n }\n }", "function insertarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function create()\n {\n return view(\"management.table.create\");\n }", "function modificarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function __construct(){\n \n $this->create_tables();\n \n }", "public function tabla()\n\t\t{\t//condicion para la proteccion de las vistas\n\t\t\t$id_empleado = $_SESSION['id_empleado'];\n\t\t\tif ($id_empleado == null)\n\t\t\t{\n\t\t\t\tredirect(base_url() . 'index.php/header/controller_inicio/login');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->load->view(\"header/Header_caja\");\n\t\t\t\t$this->load->view(\"ventas/Tabla_dinamica_producto\");\n\t\t\t}\n\t\t}", "function tabla_filas_compra_pago($filas,$tpago,$monto,$moneda,$tcambio,$opera,$boucher,$observ,$empresa,$caja,$banco,$cuenta,$tcambiodia){\n\t\t$tpago = explode(\"|\", $tpago);\n\t\t$monto = explode(\"|\", $monto);\n\t\t$moneda = explode(\"|\", $moneda);\n\t\t$tcambio = explode(\"|\", $tcambio);\n\t\t$opera = explode(\"|\", $opera);\n\t\t$boucher = explode(\"|\", $boucher);\n\t\t$observ = explode(\"|\", $observ);\n\t\t$empresa = explode(\"|\", $empresa);\n\t\t$caja = explode(\"|\", $caja);\n\t\t$banco = explode(\"|\", $banco);\n\t\t$cuenta = explode(\"|\", $cuenta);\n\t\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\t$total = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//acumulado\n\t\t\t$Dcambiar = 0;\n\t\t\t$Dcambiar = Cambio_Moneda($tcambio[$i],$tcambiodia,$monto[$i]);\n\t\t\t$total += $Dcambiar;\n\t\t\t//-\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttpag'.$i.'\" id = \"Ttpag'.$i.'\" value = \"'.$tpago[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmonto'.$i.'\" id = \"Tmonto'.$i.'\" value = \"'.$monto[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmoneda'.$i.'\" id = \"Tmoneda'.$i.'\" value = \"'.$moneda[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttipcambio'.$i.'\" id = \"Ttipcambio'.$i.'\" value = \"'.$tcambio[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Toperador'.$i.'\" id = \"Toperador'.$i.'\" value = \"'.utf8_decode($opera[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tboucher'.$i.'\" id = \"Tboucher'.$i.'\" value = \"'.trim($boucher[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tobserva'.$i.'\" id = \"Tobserva'.$i.'\" value = \"'.utf8_decode($observ[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tsucur'.$i.'\" id = \"Tsucur'.$i.'\" value = \"'.$empresa[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcaja'.$i.'\" id = \"Tcaja'.$i.'\" value = \"'.$caja[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tbanco'.$i.'\" id = \"Tbanco'.$i.'\" value = \"'.$banco[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcuenta'.$i.'\" id = \"Tcuenta'.$i.'\" value = \"'.$cuenta[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagFilas\" id = \"PagFilas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagTotal\" id = \"PagTotal\" value = \"'.$total.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "function get_data_form(){\n\n $IdTrabajo= $_REQUEST['IdTrabajo']; //Variable para el id del trabajo\n $NombreTrabajo = $_REQUEST['NombreTrabajo']; //Variable para el nombre del trabajo\n $FechaIniTrabajo = $_REQUEST['FechaIniTrabajo']; //Variable para la fecha de inicio del trabajo\n $FechaFinTrabajo = $_REQUEST['FechaFinTrabajo']; //Variable para la fecha de finalizacion del trabajo\n $PorcentajeNota = $_REQUEST['PorcentajeNota']; //Variable para el porcentaje de la nota\n $action = $_REQUEST['action']; //Variable action para la accion a realizar\n\n //crea un trabajo\n $TRABAJO = new TRABAJO_Model(\n $IdTrabajo,\n $NombreTrabajo,\n $FechaIniTrabajo,\n $FechaFinTrabajo,\n $PorcentajeNota);\n\n return $TRABAJO;\n }", "public function addTable(array &$form, FormStateInterface $form_state) {\n $num_table = $form_state->get('num_table') + 1;\n $form_state->set('num_table', $num_table);\n $form_state->setRebuild();\n }", "public function crea_tabella_singola($valore_estrazione_univoca='',$campo_per_estrazione_univoca='',$testo_modifica='',$testo_cancella='',$url_modifica='',$url_cancella=''){\n\t\tif($campo_per_estrazione_univoca=='')$campo_per_estrazione_univoca='id';\n\n\t\t\n\t\t\t\n\t\t$dati_per_estrazione='&amp;'.$campo_per_estrazione_univoca.'='.($valore_estrazione_univoca!=''?$valore_estrazione_univoca:'SETTARE_VALORE_UNIVOCO');\n\n\t\tif($testo_modifica=='')$testo_modifica==NULL;\n\t\tif($testo_modifica=='default')$testo_modifica=(file_exists('img/modifica.gif')?'<img src=\"img/modifica.gif\" alt=\"\" border=\"none\" />':'file \"modifica.gif\" non presente');\n\t\t\t\n\t\tif($testo_cancella=='')$testo_cancella==NULL;\n\t\tif($testo_cancella=='default')$testo_cancella=(file_exists('img/cancella.gif')?'<img src=\"img/cancella.gif\" alt=\"\" border=\"none\" />':'file \"cancella.gif\" non presente');\n\t\tif($url_modifica=='')$url_modifica='modifica.php';\n\t\tif($url_cancella=='')$url_cancella='cancella.php';\n\t\t\t\n\t\tif($testo_modifica!=NULL)\n\t\techo '<a href=\"'.$url_modifica.'?nome_tabella='.$this->nome_tabella.$dati_per_estrazione.'\">'.$testo_modifica.'</a>&nbsp;&nbsp';\n\t\tif($testo_cancella!=NULL)\n\t\techo '<a href=\"'.$url_cancella.'?nome_tabella='.$this->nome_tabella.$dati_per_estrazione.'\">'.$testo_cancella.'</a>';\n\t\t\t\n\t\t\n\t\t//Creo la tabella\n\t\t$tabella='<table width=\"100%\" border=\"1\" cellspacing=\"3\" cellpadding=\"3\">';\t\t\n\t\t\n\t\tforeach($this->riga as $chiave=>$valore){\n\t\t\t$tabella.='<tr><th scope=\"row\">'.$chiave.'</th>\n\t\t\t';\n\t\t\t$tabella.='<td>'.$valore.'</td></tr>\n\t\t\t';\n\t\t}\n\n\t\t$tabella.='</table>';\n\t\treturn $tabella;\n\t}", "private static function do_html_form_create($fields, $table){\n global $dbname;\n global $app_dir;\n $filename = Inflect::singularize($table);\n $form_str = '@extends(\\'layouts.bulma\\')'.\"\\n\";\n $form_str .= '@section(\\'title\\', \\'creating new '.Inflect::singularize($table).'\\')'.\"\\n\";\n $form_str .= '@section(\\'sidebar\\')'.\"\\n\";\n $form_str .= '@parent'.\"\\n\";\n $form_str .= '@endsection'.\"\\n\";\n $form_str .= '@section(\\'content\\')'.\"\\n\";\n $form_str .= '<form action=\"{{ route(\\''.$table.'.create\\') }}\" class=\"form container\" method=\"POST\" enctype=\"multipart/form-data\">';\n $form_str .= \"\\n\".' <h1 class=\"title is-3\">ADD '.strtoupper(str_replace(\"_\",\" \",Inflect::singularize($table))).'</h1>'.\"\\n\";\n foreach($fields as $field){\n $req = false;\n if(strpos($field[\"Type\"], \"int\")>-1 && $field[\"Key\"]!==\"MUL\"){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"number\", $table, $req);\n }else if($field[\"Key\"] === \"MUL\"){\n $form_str .= \" \".self::getSelectField($field[\"Field\"], $table);\n }else if(strpos($field[\"Type\"], \"varchar\")>-1){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"text\", $table, $req);\n }else if(strpos($field[\"Type\"], \"text\")>-1){\n $form_str .= \" \".self::getTextarea($field[\"Field\"], $table);\n }\n }\n $form_str .= self::getButtonGrp();\n $form_str .= \"</form>\\n@endsection\";\n $file_dir = $app_dir.\"/resources/views/$table\";\n $views_file = $app_dir.\"/resources/views/$table/create.blade.php\";\n if(is_readable($views_file)){\n file_put_contents($views_file, $form_str);\n }else{\n exec(\"mkdir $file_dir\");\n exec(\"chmod -R 755 $app_dir./resources/views/\");\n $fp = fopen($views_file,\"w+\");\n fwrite($fp, \"file created\", 128);\n fclose($fp);\n file_put_contents($views_file, $form_str);\n }\n }", "function geraClasseDadosFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.DadosFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoDadosFormularioCadastro.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n # varre a estrutura dos campos da tabela em questao\n $camposForm = $aModeloFinal = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n $nomeCampo \t = $nomeCampoOriginal;\n //$nomeCampo \t = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n switch ((string)$oCampo->TIPO) {\n case 'date':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n case 'datetime':\n case 'timestamp':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataHoraFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n default:\n if((int)$oCampo->CHAVE == 1)\n if((string)$aTabela['TIPO_TABELA'] != 'NORMAL')\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n else\n $camposForm[] = \"if(\\$acao == 2){\\n\\t\\t\\t\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\\n\\t\\t}\";\n else\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n break;\n }\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.DadosFormulario.php\",\"w\");\n fputs($fp, $modeloFinal);\n fclose($fp);\n return true;\t\n }", "public function build_table()\n {\n if (count($this->properties) > 0)\n {\n foreach ($this->properties as $property => $values)\n {\n $contents = array();\n $contents[] = $property;\n \n if (! is_array($values))\n {\n $values = array($values);\n }\n \n if (count($values) > 0)\n {\n foreach ($values as $value)\n {\n $contents[] = $value;\n }\n }\n \n $this->addRow($contents);\n }\n \n $this->setColAttributes(0, array('class' => 'header'));\n }\n else\n {\n $contents = array();\n $contents[] = Translation::get('NoResults', null, Utilities::COMMON_LIBRARIES);\n $row = $this->addRow($contents);\n $this->setCellAttributes($row, 0, 'style=\"font-style: italic;text-align:center;\" colspan=2');\n }\n }", "function tabla_filas_proyecto_pago($filas,$tpago,$monto,$moneda,$tcambio,$opera,$boucher,$observ,$tcambiodia){\n\t\t$tpago = explode(\"|\", $tpago);\n\t\t$monto = explode(\"|\", $monto);\n\t\t$moneda = explode(\"|\", $moneda);\n\t\t$tcambio = explode(\"|\", $tcambio);\n\t\t$opera = explode(\"|\", $opera);\n\t\t$boucher = explode(\"|\", $boucher);\n\t\t$observ = explode(\"|\", $observ);\n\t\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\t$total = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//acumulado\n\t\t\t$Dcambiar = 0;\n\t\t\t$Dcambiar = Cambio_Moneda($tcambio[$i],$tcambiodia,$monto[$i]);\n\t\t\t$total += $Dcambiar;\n\t\t\t//-\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttpag'.$i.'\" id = \"Ttpag'.$i.'\" value = \"'.$tpago[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmonto'.$i.'\" id = \"Tmonto'.$i.'\" value = \"'.$monto[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmoneda'.$i.'\" id = \"Tmoneda'.$i.'\" value = \"'.$moneda[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttipcambio'.$i.'\" id = \"Ttipcambio'.$i.'\" value = \"'.$tcambio[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Toperador'.$i.'\" id = \"Toperador'.$i.'\" value = \"'.$opera[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tboucher'.$i.'\" id = \"Tboucher'.$i.'\" value = \"'.$boucher[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tobserva'.$i.'\" id = \"Tobserva'.$i.'\" value = \"'.$observ[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagFilas\" id = \"PagFilas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagTotal\" id = \"PagTotal\" value = \"'.$total.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "public function createSchema(){\n //meta Data\n $this->rowNames = array_merge($this->rowNames,array(\n array(\"name\" => \"timestamp\" , \"type\" => \"timestamp\" ),\n array(\"name\" => \"user_id\" , \"type\" => \"number\" ),\n array(\"name\" => \"status\" , \"type\" => \"number\" ),\n array(\"name\" => \"checked_by_user\" , \"type\" => \"number\" )\n \n ));\n\n \t//geo Data\n $this->rowNames = array_merge($this->rowNames,array(\n array(\"name\" => \"_div\" , \"type\" => \"number\" ),\n array(\"name\" => \"_dist\" , \"type\" => \"number\" ),\n array(\"name\" => \"_upz\" , \"type\" => \"number\" ),\n array(\"name\" => \"_union\" , \"type\" => \"number\" ),\n array(\"name\" => \"_geoProxy\" , \"type\" => \"text\" )\n ));\n \n \n //form Data\n foreach ($this->keys as $key => $value) {\n //if not array simple\n if($value[\"type\"]!=\"textarray\"){\n $row = [];\n $row[\"name\"] = $key;\n $row[\"type\"] = $value[\"type\"];\n $this->rowNames[]=$row;\n }\n else{\n $types = explode(\"~\",$value[\"subtype\"]);\n for ($i=0; $i<$value[\"size\"]; $i++){\n $row=[];\n $row[\"name\"] = $key . \"_\" . $i;\n $row[\"type\"] = (isset($types[$i])? $types[$i] : $types[0]);\n $this->rowNames[]=$row;\n }\n }\n }\n \n \n// var_dump($this->rowNames);\n }", "function creaTablaPartidos(){\r\n // Create connection\r\n $conn = dameConexion();//new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Conexión fallida: \" . $conn->connect_error);\r\n }\r\n \r\n // sql to create table carta (Nombre, Coleccion, Imagen, fecha, entrada)\r\n $sql = \"CREATE TABLE partidos (\r\n id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n Local VARCHAR(15) NOT NULL,\r\n Visitante VARCHAR(15),\r\n Resultado VARCHAR(5),\r\n Entrada INT(6)\r\n )\";\r\n \r\n if ($conn->query($sql) === TRUE) {\r\n echo \"Tabla creada correctamente\";\r\n } else {\r\n \r\n //echo \"Error creando la tabla: \" . $conn->error;\r\n }\r\n \r\n $conn->close();\r\n}", "public static function createTables()\n\t{\n\t\treturn (self::createContentTable());\n\t}", "private function tbl_estados() {\r\n\t\t\t$this->estados = $this->esquema->createTable('ESTADOS');\r\n\t\t\t$this->estados->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 Estado'\r\n\t\t\t));\r\n\t\t\t$this->estados->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 Estado'\r\n\t\t\t));\r\n\t\t\t$this->estados->setPrimaryKey(array('ID'));\r\n\t\t}", "function tabela($vetorComcadastros, $vetorComIndices){//Função que cria a tabela/lista recebe o vetor cos os cadsastros e outro com os indices\n retornaEscolhidos($vetorComcadastros, $vetorComIndices);//escreve a tabela\n }", "function create_table(){\n\t\t$tables=array();\n\t\t/**\n\t\t* Table structure for table 'user_info'\n\t\t*/\n\t\t\n\t\t$fields = array(\n\t\t\tarray(\"client_identifier\"\t\t,\"unsigned integer\"\t\t\t,\"NOT NULL\"\t,\"auto_increment\", \"key\"),\n\t\t\tarray(\"client_name\"\t\t\t\t,\"varchar(255)\"\t\t\t\t,\"\"\t,\"default ''\"),\n\t\t\tarray(\"client_contact\"\t\t\t,\"unsigned integer\"\t\t\t,\"\"\t,\"default ''\", \"key\"),\n\t\t\tarray(\"client_logo_setting\"\t\t,\"unsigned small integer\"\t,\"\"\t,\"default ''\"),\n\t\t\tarray(\"client_strapline\"\t\t,\"varchar(255)\"\t\t\t\t,\"\"\t,\"default ''\"),\n\t\t\tarray(\"client_logo_alignment\"\t,\"varchar(10)\"\t\t\t\t,\"\"\t,\"default 'LEFT'\"),\n\t\t\tarray(\"client_robot_setting\"\t,\"varchar(50)\"\t\t\t\t,\"\"\t,\"default 'index,follow'\"),\n\t\t\tarray(\"client_revisit_setting\"\t,\"unsigned small integer\"\t,\"\"\t,\"default '29'\"),\n\t\t\tarray(\"client_date_created\"\t\t,\"datetime\"\t\t\t\t\t,\"\" ,\"default ''\")\n\t\t);\n\t\t$primary =\"client_identifier\";\n\t\t$tables[count($tables)] = array(\"client\",$fields,$primary);\n\t\t/**\n\t\t* Table data for table 'client'\n\t\t*/\n//\t\t$this->call_command(\"DB_QUERY\",array(\"INSERT INTO client (client_name) VALUES('admin');\"));\n\t\t/**\n\t\t* Table structure for table 'domains'\n\t\t*/\n\t\t$fields = array(\n\t\tarray(\"domain_identifier\"\t,\"unsigned integer\"\t,\"NOT NULL\"\t,\"auto_increment\"),\n\t\tarray(\"domain_client\"\t\t,\"unsigned integer\"\t,\"NOT NULL\"\t,\"default '0'\"),\n\t\tarray(\"domain_name\"\t\t\t,\"varchar(255)\"\t\t,\"NULL\"\t\t,\"default ''\")\n\t\t);\n\t\t\n\t\t$primary=\"domain_identifier\";\n\t\t$tables[count($tables)] = array(\"domain\",$fields,$primary);\n\t\t/**\n\t\t* Table structure for table 'site_footer_data'\n\t\t*/\n\t\t$fields = array(\n\t\tarray(\"sfd_identifier\"\t,\"unsigned integer\"\t,\"NOT NULL\"\t,\"auto_increment\",\"key\"),\n\t\tarray(\"sfd_client\"\t\t,\"unsigned integer\"\t,\"NOT NULL\"\t,\"default '0'\"),\n\t\tarray(\"sfd_text\"\t\t,\"text\"\t\t\t\t,\"NULL\"\t\t,\"default ''\")\n\t\t);\n\t\t\n\t\t$primary=\"sfd_identifier\";\n\t\t$tables[count($tables)] = array(\"site_footer_data\",$fields,$primary);\n\n\n/*\t\t$sql = \"insert into domain (domain_client,domain_name) values (1,'\".$this->parent->domain.\"')\";\n\t\t$this->parent->db_pointer->database_query($sql);\n\t\t$sql = \"insert into domain (domain_client,domain_name) values (1,'localhost')\";\n\t\t$this->parent->db_pointer->database_query($sql);\n\t\t*/\n\t\treturn $tables;\n\t}", "public function getTabla()\n {\n return Datatables::of($this->index())\n ->addColumn(\n 'acciones',\n function ($ret) {\n return '<button data-id=\"'.$ret->id_area_tematica.'\" class=\"btn btn-info btn-xs editar\" '.\n 'title=\"Editar\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></button>';\n }\n )\n ->make(true);\n }", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}", "public function tablaProductos () \n\t\t{\t\t\n\t\t\t//Javascript !!!\n\t\t\taddJs('js/products_table.js');\n\t\t\thidden ('iter',0); \n\t\t\t\n\t\t\techo '<table id=\"tabla_productos\" bgColor=#333 cellspacing=1 cellpadding=2 width=700><tbody>';\n\t\t\techo '<tr>'.\n\t\t\t\t\t'<th>Cantidad</th><th>Producto</th><th>Precio<br>sin Iva</th>'.\n\t\t\t\t\t'<th>Precio<br>con Iva</th><th>Total Neto</th><th>Total</th><th></th></tr>';\n\n\t\t\techo '</tbody></table>';\n\n\t\t\techo '<table bgColor=#333 cellspacing=1 cellpadding=2 width=700>';\n\t\t\t$this->tablaSumatoria();\n\t\t\techo '</table>';\t\t\t\n\t\t}", "public function createTable()\n\t{\n\t\t$table = $this->getTableName();\n\t\t$indexes = $this->defineIndexes();\n\t\t$columns = array();\n\n\t\t// Add any Foreign Key columns\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$required = !empty($config['required']);\n\t\t\t$columns[$config[2]] = array('column' => ColumnType::Int, 'required' => $required);\n\n\t\t\t// Add unique index for this column?\n\t\t\t// (foreign keys already get indexed, so we're only concerned with whether it should be unique)\n\t\t\tif (!empty($config['unique']))\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($config[2]), 'unique' => true);\n\t\t\t}\n\t\t}\n\n\t\t// Add all other columns\n\t\tforeach ($this->defineAttributes() as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\n\t\t\t// Add (unique) index for this column?\n\t\t\t$indexed = !empty($config['indexed']);\n\t\t\t$unique = !empty($config['unique']);\n\n\t\t\tif ($unique || $indexed)\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($name), 'unique' => $unique);\n\t\t\t}\n\n\t\t\t$columns[$name] = $config;\n\t\t}\n\n\t\t// Create the table\n\t\tblx()->db->createCommand()->createTable($table, $columns);\n\n\t\t// Create the indexes\n\t\tforeach ($indexes as $index)\n\t\t{\n\t\t\t$columns = ArrayHelper::stringToArray($index['columns']);\n\t\t\t$unique = !empty($index['unique']);\n\t\t\t$name = \"{$table}_\".implode('_', $columns).($unique ? '_unique' : '').'_idx';\n\t\t\tblx()->db->createCommand()->createIndex($name, $table, implode(',', $columns), $unique);\n\t\t}\n\t}", "function toString(){\n\t\tinclude '../Views/base/header.php';\n\t\t\n\t\techo '<table class=\"detalle\">';\n\t\t\t$i = 0;\n\t\t\twhile($fila = $this->pistasyHorarios->fetch_row()){\n\t\t\t\tif($i == 0){\n\t\t\t\t\techo '<tr class=\"'; echo $this->_getTr($i); echo'\">';\n\t\t\t\t\t\techo '<td class=\"formularioTd\">';\n\t\t\t\t\t\t\techo $this->campos['nombre'];\n\t\t\t\t\t\techo '</td>';\n\t\t\t\t\t\t\n\t\t\t\t\t\techo '<td class=\"nombrePista\">';\n\t\t\t\t\t\t\techo $fila[1];\n\t\t\t\t\t\techo '</td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t\t$i++;\n\t\t\t\t\techo '<tr class=\"'; echo $this->_getTr($i); echo'\">';\n\t\t\t\t\t\techo '<td class=\"formularioTd\">';\n\t\t\t\t\t\t\techo $this->campos['codigoHorario'];\n\t\t\t\t\t\techo '</td>';\n\t\t\t\t\techo '<td class=\"mensaje\">';\n\t\t\t\t}\n\t\t\t\techo '<form method=\"POST\" accept-charset=\"UTF-8\" id=\"addHorario'; echo $i; echo '\" name=\"addHorario'; echo $i; echo '\" action=\"../Controllers/'; echo $this->controlador; echo '\">';\n\t\t\t\techo '<b class=\"lblBtAddHorario\"> Desde las ' . $fila[3] . ' hasta las ' . $fila[4] . '</b>';\n\t\t\t\techo '<input type=\"hidden\" name=\"codigoPista\" value=\"'; echo $fila[0]; echo '\"/>';\n\t\t\t\techo '<input type=\"hidden\" name=\"codigoHorario\" value=\"'; echo $fila[2]; echo '\"/>';\n\t\t\t\techo '<input type=\"hidden\" name=\"nombre\" value=\"'; echo $fila[1]; echo '\"/>';\n\t\t\t\techo '<input class=\"btn btn-info\" type=\"submit\" name=\"submit\" value=\"ADDHORARIO\"/><br/><br/>';\n\t\t\t\techo '</form>';\n\t\t\t}\n\t\t\techo '</td>';\n\t\t\techo '</tr>';\n\t\t\t\t$i++;\n\t\t\t/*Fila para volver*/\n\t\t\techo '<tr class=\"'; echo $this->_getTr($i); echo'\">';\n\t\t\t\techo '<td class=\"formularioTd\">';\n\t\t\t\t\techo $this->Volver;\n\t\t\t\techo '</td>';\n\t\t\t\t\n\t\t\t\techo '<td class=\"formularioTd\">';\n\t\t\t\t\techo '<a href=\"'; echo $this->controlador; echo '\">';\n\t\t\t\t\techo '<button class=\"btn btn-secondary\">'; echo $this->Volver; echo '</button>';\n\t\t\t\t\techo '</a>';\n\t\t\t\techo '</td>';\n\t\t\techo '</tr>';\n\t\t\t\n\t\t/**FIN TABLA**/\n\t\techo '</table>';\n\t\tinclude '../Views/base/footer.php';\n\t}", "public function tblRequisitos($array){\n $tabla = \"<table class='table table-bordered table-hover'>\n <thead>\n <tr align='center'>\n <th>Programa</th>\n <th>Requisito</th>\n <th>Editar</th>\n </tr>\n </thead>\n <tbody>\";\n foreach ($array as $value){\n $info = utf8_encode(implode($value, '|'));\n //En la ruta de la imagen nos salimos de la carpeta \"../\" ya que la ruta que se guarda \n //en la base de datos se encuentra fuera de la carpeta 'admin'\n $tabla .= \"<tr align='left'>\n <td width='150'>\".utf8_encode($value[1]).\"</td>\n <td>\".utf8_encode($value[3]).\"</td>\n <td align='center'><a href='' onclick='frmEditarRequisito(\\\"$info\\\");return false;'><i class='fa fa-pencil'></i></a></td>\n </tr>\";\n }\n $tabla .= \"</tbody></table>\";\n return $tabla;\n }", "public function crear() {\n /**\n * guardamos la consulta en $sql\n * ejecutamos la consulta en php \n * asignamos el id del objeto = al ultimo id que añadimos a la bd, asi coincidiran el id objeto con tupla\n * lista de atributos a introducir valores de atributos a introducir\n * formato insertar datos INSERT INTO NombreTabla (NombreAtributo1, NombreAtributo2) VALUES (ValorAtributo1, ValorAtributo2)\n */\n // para acceder a una cosntante de la clase NombreClase::NOMBRECONSTANTE\n \n try {\n $sql=\"INSERT INTO \".Bebidas::TABLA[0].\" (nombre, descripcion, tipo, estado, foto) VALUES ('$this->nombre', '$this->descripcion', '$this->tipo', '$this->estado', '$this->foto')\";\n $this->conexion->query($sql);\n $this->__set(\"id_bebida\", $this->conexion->insert_id);\n } catch (Exception $ex) {\n echo 'error '.$ex;\n }\n \n }", "public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}", "function generate_form_from_table($tb,$item_id=0)\t{\n\n\tglobal $Form,$dbSwitch,$outPut,${$tb},$customInserts,$customPrints;\n\t\n\t\n//\tprint_r($_POST);\n\t\n\t\n\t\n//\t\tse quel tipo di form ha bisogno di una variabile per creare una nuova voce\n//\t\tin caso di assenza di questa variabile restituisco messaggio e back.\n\t\n\t\n\tif\t(\t(\tpreg_match(\t\"/\".$tb.\"\\[/\",\tREQUEST_MANDATORY_VALUES)\t)\t&&\t(\t!$_REQUEST[item_id]\t)\t)\t:\n\t\n\t\t$value\t=\tpreg_replace(\t\"/.*\".$tb.\"\\[([A-Za-z0-9_]*)\\].*/\",\"$1\",\tREQUEST_MANDATORY_VALUES\t);\n\t\t\n\t\tif\t(\t!$_REQUEST[$value]\t)\t:\t\t\n\t\t\t\n\t\t\t$form\t.=\t$Form->open(\"clarify\",FORM_ACTION,'POST',true,'Associazione');\n\t\t\t\n\t\t\t\n\t\t\t\n\t//\t\t$sql\t=\t\"SELECT \".$value.\" FROM \".find_primary_key_parent($value);\t###CONTROLLARE###\n\t\t\t\n\t//\t\t$data_list\t=\t$dbSwitch->select($sql);\n\t\t\t\n\t\t\t$form\t.=\t$Form->dynamic_select(codice_cliente,CLIENTI,ragione_sociale,cliente);\n\t\t\t\n\t\t\t$form\t.=\t$Form->submit(\"avanti\");\n\t\t\t\n\t\t\t$form\t.=\t$Form->close(true);\n\t\t\t\n\t\t\treturn\t$form;\t\t\t\n\t\t\n\t\tendif;\n\t\n\tendif;\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\tif\t(\t!$item_id\t)\t:\t$item_id\t=\t$_GET[item_id];\tendif;\n\n\n\t//definisco i tipi di campi\n\t$fields\t=\tfield_types($tb);\n\t\n\t\n\n\n\n\n\n\n\n\n\n\n//------- SE E' STATO POSTATO IL FORM IN QUESTIONE AGGIORNO -------//\n\n\tif\t(\t$_POST[$tb.'_is_sent']\t)\t:\n\t\n\t\t\n\t\tif\t(\tform_is_correct(\t$tb,\t$fields\t)\t)\t:\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t//definisco il tipo di query\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif\t(\t$item_id\t)\t:\n\t\t\t\t\t\n\t\t\t\t\t\t$action\t=\t\"UPDATE \"; $where\t=\t\" WHERE \".primary_key($tb).\"='\".$item_id.\"'\";\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$action\t=\t\"INSERT INTO \";\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t//preparo i pezzi di query\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tfor\t(\t$i=0;\t$i\t<\tcount($fields);\t$i++\t)\t:\n\t\t\t\t\t\n\t\t\t\t\t\n#************\t\t\t//COMBO INSERT da rivedere!!!!!!!!!!!!!!!!!!!!!! (3 variabili)\n\t\t\t\t\t\n\t\t\t\t\t\tif\t(\tpreg_match(\t\"/\".$fields[$i][Field].\"/\",\tCOMBO_INSERTS\t)\t)\t:\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\tATTENZIONE LA LISTA DELLE ATTREZZATURE ASSOCIATE VANNO PRESE DALLA TABELLA PRODOTTI SPECIFICI!\t*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ins_funct\t=\tpreg_replace(\"/.*\".$fields[$i][Field].\"\\[([^\\[\\]$]*)\\].*/\",\"$1\",COMBO_INSERTS\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$sets\t.=\t$ins_funct($fields[$i][Field],$tb,$item_id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//SPECIAL INSERT (1 variabile)\n\t\t\t\t\t\telseif\t(\tpreg_match(\t\"/\".$fields[$i][Field].\"/\",\tSPECIAL_INSERTS\t)\t):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$ins_funct\t=\tpreg_replace(\"/.*\".$fields[$i][Field].\"\\[([^\\[\\]$]*)\\].*/\",\"$1\",SPECIAL_INSERTS\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$toPost\t=\t$ins_funct($_POST[$fields[$i][Field]]);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$sets.=\" \".$fields[$i][Field].\"='\".$toPost.\"', \";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//NORMAL INSERT\n\t\t\t\t\t\telse:\n\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\tif\t(\t$_POST[$fields[$i][Field]]\t!=\t$_POST['PRE_'.$fields[$i][Field]]\t)\t:\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$sets.=\" \".$fields[$i][Field].\"='\".trim($_POST[$fields[$i][Field]]).\"', \";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tendfor;\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\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t//se è stato immesso/modificato almeno un campo metto insieme la query\n\t\t\n\t\t\t\t\n\t\t\t\tif\t(\t$sets\t)\t:\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t//preparo gli aggiornamenti di data e ora\n\t\t\t\t\t\n\t\t\t\t\t$time=time();\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\tif\t(\thas_date_to_be_updated($fields)\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\tif\t(\t!$_POST[mod]\t)\t:\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$update_entry_date=\", entry_date=\".$time;\t//data inserimento\n\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$update_mod_date=\", mod_date=\".$time;\t\t\t\t//data modifica\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\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\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\tif\t(\tisClosing()\t)\t:\n\t\t\t\t\t\n\t\t\t\t\t\t$update_close_date=\", close_date=\".$time;\t\t//data chiusura\n\t\t\t\t\t\n\t\t\t\t\tendif;\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\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t$sql=$action.$tb.\" SET \".substr($sets,-strlen($sets),strlen($sets)-2).$update_entry_date.$update_mod_date.$update_close_date.$where;\n\t\t\t\t\t\n\t\t\t\t\t\n#\t\t\t\t\tprint $sql;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$form\t.=\t$dbSwitch->insert($sql);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tunset($sets,$sql);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tendif;\n\n\n\n\n\n\t\t\t\t\t//------se è stato fatto salva e chiudi ed il form è corretto \n\t\t\t\t\t//porto di nuovo all'elenco della categoria in questione-------//\n\t\t\t\t\t\n\t\t\t\t\tif\t(\t$_POST['salva-e-chiudi']\t)\t:\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\theader(\"Location: \".ROOT.\"?cat=\".$_REQUEST[cat]);\n\t\t\t\t\t\n\t\t\t\t\tendif;\t\t\n\n\t\n\t\t\t\n\t\t\n\t\tendif;//fine se il form è corretto\n\t\n\t\n\tendif;//fine se c'è post\n\n//------- FINE AGGIORNAMENTO DATI IN PRESENZA DI POST -------//\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//apro il form\n\t$form\t.=\t$Form->open($tb);\n\n\n\n\n\n//Se è stato specificato l'item ID vado ad aprire la voce\n\t\n\tif\t(\t$item_id\t)\t:\n\t\n\t\t$dati\t=\t$dbSwitch->select(\t\"SELECT * FROM \".$tb.\" WHERE \".primary_key($tb).\"='\".$item_id.\"'\"\t);\n\t\t\n\t\tif\t(\t!is_array($dati)\t)\t:\t\t$_SESSION[err_mess]\t.= $dati;\tendif;\n\t\t\n\t\tif\t(\t!count($dati)\t\t)\t:\t\t$_SESSION[err_mess]\t.= \"non sono state trovate le informazioni.<br/>\";\tendif;\n\t\t\n\t\t$form\t.=\t$Form->hidden(\t\"mod\"\t,\t$item_id\t);\n\t\t\n\t\t\t\n\t\t\n\tendif;\n\t\n\n\n\n\n//per ogni campo creo l'apposito campo form\n\n\n\tfor\t(\t$i=0;\t$i\t<\tcount($fields);\t$i++\t)\t:\n\t\n\t\n\t\t//se il value va convertito lo converto ora\t\t\n\t\t$dati[0][$fields[$i][Field]]\t=\tdisplay_converted_form_value($fields[$i][Field],$dati[0][$fields[$i][Field]]);\n\t\t\n\t\t\t\n\t\n\t//definisco il fieldset al quale aqppartiene questo specifico campo\n\n\t\n\t\n\tforeach (${$tb}[fieldsets] as $k => $v) {\n\t\t\n\t\tif\t(\tpreg_match(\t\"/\".$fields[$i][Field].\"/\", $v)\t)\t:\t$fieldset=$k; endif;\n\t\t\n\t}\n\t\n\tif\t(\t!$fieldset\t)\t:\t$fieldset=\"altro\";\tendif;\n\t\n\t\n\t$FORM[$fieldset]\t.=\t\"\\n<div class='\".$fields[$i][Field].\"'>\\n\";\n\t\n\t\n\t\n\t\t//-- stampo eventuali messaggi e stili di errore --//\n\t\t\n\t\tif\t(\t$_POST[$tb.'_is_sent']\t&&\t!is_valid(\t$tb,$fields[$i][Field],true\t)\t)\t:\t\n\t\t\n\t\t\t$class=\" class='error'\";\n\t\t\n\t\tendif;\n\t\t\n\t\t//-- fine eventuali messaggi e stili di errore--//\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t//se il campo è da trattare in modo speciale\n\t\tif\t(\tis_special_field($fields[$i][Field])\t)\t:\n\t\t\n\t\t\t//richiamo l'apposita funzione dalla classe form\n\t\t\t$FORM[$fieldset]\t.=\t$Form->$fields[$i][Field]($dati[0][$fields[$i][Field]],$err_mess);\n\t\t\n\t\t\n\t\t//se viene specificato un fieldtype diverso\n\t\telseif\t(\tis_custom_field_type(\t$fields[$i][Field]\t)\t)\t:\n\t\t\n\t\t\t//richiamo l'apposita funzione dalla classe form\n\t\t\t\n\t\t\t//print get_custom_field_type(\t$fields[$i][Field]\t);\n\t\t\t\n\t\t\t$function=get_custom_field_type(\t$fields[$i][Field]\t);\n\t\t\t\n\t\t\t//se il campo personalizzato ha bisogno di variabili immetto fino alle prima 6 variabili presenti dopo la prima voce, separate da virgole nel file formconfig.php\n\t\t\t\n\t\t\t$FORM[$fieldset]\t.=\t$Form->$function[0]($fields[$i][Field],$function[1],$function[2],$function[3],$function[4],$function[5],$function[6]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\telse:\t//altrimenti se è un campo normale\n\t\t\n\t\t\t\t\n\t\t\t//se è varchar o smallint\n\t\t\tif\t(\tpreg_match('/varchar/',\t$fields[$i][Type]\t)\t||\n\t\t\t\t\tpreg_match('/smallint/',\t$fields[$i][Type]\t)\t||\n\t\t\t\t\tpreg_match('/int/',\t$fields[$i][Type]\t)\n\t\t\t\t)\t:\n\t\t\t\n\t\t\t\t$maxlength\t=\tpreg_replace('/[a-z]+\\(([0-9]+)\\)/','$1',$fields[$i][Type]);\n\t\t\t\t\n\t\t\t\t$FORM[$fieldset]\t.=\t$Form->input($fields[$i][Field],$dati[0][$fields[$i][Field]],$maxlength,$class,$err_mess);\n\t\t\t\n\t\t\t\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t\t//----------\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//se SET o ENUM\n\t\t\tif\t(\tpreg_match('/set/',\t$fields[$i][Type]\t)\t||\tpreg_match('/enum/',\t$fields[$i][Type]\t)\t)\t:\n\t\t\t\n\t\t\t\n\t\t\t$labels\t=\tpreg_replace('/\\'/','',$fields[$i][Type]);\n\t\t\t$labels\t=\tpreg_replace('/set\\((.*)\\)/','$1',$labels);\n\t\t\t$labels\t=\tpreg_replace('/enum\\((.*)\\)/','$1',$labels);\n\t\t\t$labels\t=\texplode(\",\", $labels); //metto tutti i valori in un array\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$FORM[$fieldset]\t.=\t$Form->select($fields[$i][Field],$labels,$dati[0][$fields[$i][Field]]);\n\t\t\t\n\t\t\t\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t\t//----------\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//se TEXT\n\t\t\tif\t(\t$fields[$i][Type] === \"text\"\t)\t:\n\t\t\t\n\t\t\t$FORM[$fieldset]\t.=\t$Form->textarea($fields[$i][Field],$dati[0][$fields[$i][Field]]);\n\t\t\t\n\t\t\tendif;\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\n\t\tendif;\t//fine se il campo non speciale\n\t\t\n\t\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\t//$FORM[$fieldset]\t.= is_valid($tb,$dati[0][$fields[$i][Field]]);\n\t\t\n\t\t\n\t\t\n\t\t$FORM[$fieldset]\t.=\t$_SESSION[err_mess][$fields[$i][Field]];\n\t\t\n\t\tunset($_SESSION[err_mess]);\n\t\t\n\t\t$FORM[$fieldset]\t.=\t\"</div>\\n\\n\";\n\t\n\t\n\t\n\t\n\t\n\t//se c'è un'inserto da mettere dopo questo fieldset lo metto\n//\tprint \"preg_match(\\\"/\".$fieldset.\"/\".${$tb}[custom_inserts].\")\";\n\t\t\t\n\tif(\t(\tpreg_match(\"/\".$fieldset.\"/\",${$tb}[custom_inserts])\t)\t&&\t(\t!$FORM[custom_field]\t)\t):\n\t\n\t$custom_field\t=\tpreg_replace(\"/.*\".$fieldset.\"\\[([^\\[\\]$]*)\\].*/\",\"$1\",${$tb}[custom_inserts]\t)\t;\n\t\n\t$FORM[$custom_field]\t=\t$customInserts->$custom_field();\n\t\n\tendif;\n\t\n\t\n\t\n\t\n\t\n\tunset($fieldset,$class, $err_mess);\n//\t\tprint $fields[$i][Field].$i.$tb;\n\tendfor;\n\t\n\t\n\t\n\nprint_r($FORM);exit;\n\n\nforeach ($FORM as $key => $value) {\n \n\t$FIELDSET[$key]\t.=\t\"\\n\\n<fieldset id='\".$key.\"'>\\n\";\t\n\t$FIELDSET[$key]\t.=\t\"\\n<legend>\";\n\t$FIELDSET[$key]\t.=\t$outPut->label($key);\n\t$FIELDSET[$key]\t.=\t\"</legend>\\n\";\n\t$FIELDSET[$key]\t.=\t$value;\n\t$FIELDSET[$key]\t.=\t\"\\n</fieldset>\\n\\n\";\n\t\n}\n\n\n//se non è stato stabilito l'ordine dei fieldset seguo l'ordine di apparizione da DB\n\nif\t(\t!trim(${$tb}[fieldset_order])\t\t)\t:\n\n\tforeach ($FIELDSET as $key => $value) :\n\t\t\n\t\t$form\t.=\t$FIELDSET[$key];\n\t\t\n\tendforeach;\n\t\n\t\nelse:\n\n\tforeach (explode(\" \",${$tb}[fieldset_order]) as $value) :\n\t\t\n\t\t$form\t.=\t$FIELDSET[$value];\n\t\t\n\tendforeach;\n\t\n\nendif;\n\n\n\n\n\n\n\n$form\t.=$Form->tripleSubmit();\n\n\n$form\t.=$Form->close();\n\n\n\n\n\n\n\n\n\n\n\n\n//aggiungo eventuale lista correlata\nif\t(\tpreg_match(\t\"/\".$tb.\"\\[[^\\[\\]]*\\]/\",FORM_RELATED_LISTS\t)\t)\t:\n\t\t\t\t\n\t$related_list\t=\tpreg_replace(\t\"/.*\".$tb.\"\\[([^\\[\\]]*)\\].*/\",\"$1\",FORM_RELATED_LISTS\t);\n\t\n\t$form\t.=\tlist_($related_list,\" WHERE \".primary_key($tb).\"='\".$_GET[item_id].\"'\",1,1,'scroll');\t\n\t\nendif;\n\n//print_r($_POST);\n\nreturn $form;\n\n\n}", "public function rellenarTabla($cabecera,$cuerpo,$ini,$fin,$tipo){\n \n if($tipo == '1'){\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th class='text-center'>FAMILIAR</th>\";\n }else{\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th>NOMBRE</th>\";\n }\n \n //*********Se agregan las cabeceras a las tablas********\n \n $numRegistros = count($cabecera);\n \n for ($i=$ini; $i < $fin; $i++) {\n \n if($i < $numRegistros){\n $tablaHead = $tablaHead.\"<th class='text-center'>\".$cabecera[$i]->NOMBRE_ENFER.\"</th>\";\n }\n \n }\n\n $endThead = \"</tr></thead>\";\n $tablaBody = \"<tbody>\";\n $seEncontroRel = FALSE;\n\n //***********se agrega el body a las tablas************\n\n foreach ($cuerpo as $rel) {\n $enfermedad = explode(\",\", $rel->ENFERMEDAD);\n $numEnf = count($enfermedad);\n $rowTable = \"</tr><td>\".$rel->NOMBRE_PAR.\"</td>\";\n //se recorre las enfermedades en base a un inicio y un fin\n for ($i=$ini; $i < $fin; $i++) {\n //es te if es para que en caso de que el fin sea mayor al del arreglo no se rompa\n if($i < $numRegistros){\n //se recorren los enfermedades relacionadas\n for ($j=0; $j < $numEnf; $j++) {\n //se valisa si son iguales\n if($cabecera[$i]->ID_ENFER_PK == $enfermedad[$j]){\n //echo \"valor 1 \".$cabecera[$i]->ID_ENFER_PK.\"<br>\";\n //echo \"valor 2 \".$enfermedad[$j].\"<br>\";\n $seEncontroRel = TRUE;\n break;\n }else{\n $seEncontroRel = FALSE;\n }\n }\n //en base a la variable se agrega si o no\n if($seEncontroRel == FALSE){\n //se agrega un No si no corresponde\n $rowTable = $rowTable.\"<td>NO</td>\";\n }else{\n //se agrega un Si cuando sena iguales\n $rowTable = $rowTable.\"<td>SI</td>\";\n }\n }\n }\n //se agregan los valores a la tabla\n $tablaBody = $tablaBody.$rowTable.\"<tr>\";\n }\n //*****************************************************\n \n $endTBody = \"</tbody>\";\n $endTabla = \"</table>\";\n \n //se concatenan todos los valores para la creacion de la tabla\n $tablaFamily = $tabla.$tablaHead.$endThead.$tablaBody.$endTBody.$endTabla;\n\n //Se regresa la tabla\n return $tablaFamily;\n }", "public function newTable($items);", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "public function create()\n {\n return view(\"dashboard.mesas.create\",['mesa'=>new Table()]);\n \n }", "public function create()\n\t{\n\t\treturn view('alumnos.create');\n\t}", "function CreateTable (){\r\n\t\t$conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n\t\t// Check connection\r\n\t\tif ($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\r\n\t\t} \r\n\r\n\t\t// sql to create table\r\n\t\t$sql = \"CREATE TABLE tbldmlmapcontent (\r\n\t\tCntID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, \r\n\t\tCntUsrCtrlID INT(6) NOT NULL,\r\n\t\tCntLink TEXT NOT NULL,\r\n\t\tCntField1 TEXT,\r\n\t\tCntField2 TEXT,\r\n\t\tCntField3 TEXT,\r\n\t\tCntField4 VARCHAR(200),\r\n\t\tCntField5 VARCHAR(200),\r\n\t\tCntField6 VARCHAR(200),\r\n\t\tCntField7 MEDIUMTEXT,\r\n\t\tCntField8 VARCHAR(200),\r\n\t\tCntField9 VARCHAR(200),\r\n\t\tCntField10 VARCHAR(200)\r\n\t\t)\";\r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n\t\t\t// There are no available data for current page. So, shows API panel.\r\n\t\t\techo \"1\";\r\n\t\t} else {\r\n\t\t\techo \"0\";\r\n\t\t}\r\n\r\n\t\t$conn->close();\r\n\t}", "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest()->getPost()))\r\n\t\t;\r\n\t\treturn $table;\r\n\t}", "function NewRow() {\n\t\t$row = array();\n\t\t$row['id'] = NULL;\n\t\t$row['nombre_contacto'] = NULL;\n\t\t$row['name'] = NULL;\n\t\t$row['lastname'] = NULL;\n\t\t$row['email'] = NULL;\n\t\t$row['address'] = NULL;\n\t\t$row['phone'] = NULL;\n\t\t$row['cell'] = NULL;\n\t\t$row['is_active'] = NULL;\n\t\t$row['created_at'] = NULL;\n\t\t$row['id_sucursal'] = NULL;\n\t\t$row['documentos'] = NULL;\n\t\t$row['DateModified'] = NULL;\n\t\t$row['DateDeleted'] = NULL;\n\t\t$row['CreatedBy'] = NULL;\n\t\t$row['ModifiedBy'] = NULL;\n\t\t$row['DeletedBy'] = NULL;\n\t\t$row['latitud'] = NULL;\n\t\t$row['longitud'] = NULL;\n\t\t$row['tipoinmueble'] = NULL;\n\t\t$row['id_ciudad_inmueble'] = NULL;\n\t\t$row['id_provincia_inmueble'] = NULL;\n\t\t$row['imagen_inmueble01'] = NULL;\n\t\t$row['imagen_inmueble02'] = NULL;\n\t\t$row['imagen_inmueble03'] = NULL;\n\t\t$row['imagen_inmueble04'] = NULL;\n\t\t$row['imagen_inmueble05'] = NULL;\n\t\t$row['imagen_inmueble06'] = NULL;\n\t\t$row['imagen_inmueble07'] = NULL;\n\t\t$row['imagen_inmueble08'] = NULL;\n\t\t$row['tipovehiculo'] = NULL;\n\t\t$row['id_ciudad_vehiculo'] = NULL;\n\t\t$row['id_provincia_vehiculo'] = NULL;\n\t\t$row['imagen_vehiculo01'] = NULL;\n\t\t$row['imagen_vehiculo02'] = NULL;\n\t\t$row['imagen_vehiculo03'] = NULL;\n\t\t$row['imagen_vehiculo04'] = NULL;\n\t\t$row['imagen_vehiculo05'] = NULL;\n\t\t$row['imagen_vehiculo06'] = NULL;\n\t\t$row['imagen_vehiculo07'] = NULL;\n\t\t$row['imagen_vehiculo08'] = NULL;\n\t\t$row['tipomaquinaria'] = NULL;\n\t\t$row['id_ciudad_maquinaria'] = NULL;\n\t\t$row['id_provincia_maquinaria'] = NULL;\n\t\t$row['imagen_maquinaria01'] = NULL;\n\t\t$row['imagen_maquinaria02'] = NULL;\n\t\t$row['imagen_maquinaria03'] = NULL;\n\t\t$row['imagen_maquinaria04'] = NULL;\n\t\t$row['imagen_maquinaria05'] = NULL;\n\t\t$row['imagen_maquinaria06'] = NULL;\n\t\t$row['imagen_maquinaria07'] = NULL;\n\t\t$row['imagen_maquinaria08'] = NULL;\n\t\t$row['tipomercaderia'] = NULL;\n\t\t$row['imagen_mercaderia01'] = NULL;\n\t\t$row['documento_mercaderia'] = NULL;\n\t\t$row['tipoespecial'] = NULL;\n\t\t$row['imagen_tipoespecial01'] = NULL;\n\t\t$row['email_contacto'] = NULL;\n\t\treturn $row;\n\t}", "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}", "function desplegarTabla($query,$anchtable=array(),$iconos=array(),$coLoTabla=\"table-primary\"){\n\n\tglobal $oBD;\n\n\t$registros = $oBD->consulta($query);\n\n\t$columnas = mysqli_num_fields($registros);\n\techo '<table class= \"table table-hover'.$coLoTabla.'\">';\n\t// creacion de la cabecera\n\techo '<tr class=\"table-dark\">';// hace el renglon\n\n\t// if (count($anchtable)){\n\t// \tforeach ($anchtable as $anch) {\n\t// \t\techo \"<td style=width:$anch.'%';></td>\";\n\t// \t\techo $anch;\n\t// \t}\n\t// }\n$k = 0;\n// si el count de iconos existe entonces me mandaron iconos \n\tif (count($iconos)){\n\t\tforeach ($iconos as $icono) {\n\t\t\techo $k;\n\t\t\t\t\t\n\t\t\tif (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>&nbsp;</td>\";\t\n\t\t\t}else{\n\t\t\t\techo \"<td>&nbsp;</td>\";\t\n\t\t\t}\n\n\t\t\t$k++;\n\t\t}\n\t}\n\t//echo $columnas;\n\techo $k;\n\t//$k=$k-1;\n\tfor ($c=0; $c < $columnas; $c++){\n\t\t// para traer los nombres de los campos\n\t\t$campo=mysqli_fetch_field_direct($registros,$c); // da la informacion de un campo en la base de datos\n\t\t \n\t\t if (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>$campo->name.$c</td>\";\t\n\t\t\t}else{\n\t\t\t\techo '<td style=\"width:(90/$columnas)%\">'.$campo->name.'</td>';\t\t\n\t\t\t}\n\t\t // echo $anchtable[$c];\n\t\t $k++;\n\t\t\n\t}\n\techo '</tr>';\n\t// fin cabecera\n\t// comienzo de registros\n\tfor ($r=0; $r < $oBD->numeRegistros; $r++) \n\t{ echo '<tr>';\n\t\t// agregando iconos\n\t\t// EN EL CASO DE QUE \"UPDATE EXISTA EN EL ARRGLO DE LOS ICONOS\"\n\t\tif (in_array(\"update\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/update.png\"></td>';\n\t\t}\n\n\t\tif (in_array(\"delete\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/delete.png\"></td>';\n\t\t}\n\n\n\t\t$campos = mysqli_fetch_array($registros);\n\t\t// despliega la informacion de un registro especifico\n\t\tfor ($c=0; $c < $columnas; $c++) \n\t\t\techo '<td>'.$campos[$c].'</td>';\n\t echo '</tr>';\n\t\t\n\t}\necho '</table>';\necho $k;\n}", "function makeForm($frm) {\r\n\t\tif(!empty($frm)) preg_replace('/\\s+/', ' ', $frm);\r\n\r\n \t$html=\"<table>\";\r\n\r\n\t foreach ($frm AS $row) {\r\n\t\t\t$html.=\"<tr><td>\".$row['title'].\"</td><td>\".$row['field'].\"</td></tr>\";\r\n\t\t}\r\n\r\n \t$html.=\"</table>\";\r\n\r\n\t return $html;\r\n\t}", "protected abstract function createTestTable();", "function afterCreateTable(){\n $aData = array(\n array( \"Intranet\", \"INTR\", 1 ),\n array( \"Document Management\", \"DOCU\" ),\n array( \"Email\", \"EMAI\" ),\n array( \"General\", \"GENE\" )\n );\n \n foreach( $aData as $row ){\n $this->id = 0;\n $this->aFields[\"name\"]->value = $row[0];\n $this->aFields[\"code\"]->value = $row[1];\n \n // Default option\n if( array_key_exists( 2, $row ) ) $this->aFields[\"is_default\"]->value = $row[2];\n else $this->aFields[\"is_default\"]->value = 0;\n \n $this->save();\n }\n \n // Make everything point to the default\n $sql = \"SELECT id FROM issue_system WHERE is_default = 1\";\n $db = new DB();\n $db->query( $sql );\n $row = $db->fetchRow();\n $sql = \"UPDATE issue SET issue_system_id = \".$row[\"id\"];\n $db->query( $sql );\n \n }", "function buildTable($schedule,$users){\n\t\t$this->refreshTable();\n\t}", "function tabla_lotes_compra($filas,$lot='',$art='',$gru=''){\n\t$lot = explode(\"|\", $lot);\n\t$art = explode(\"|\", $art);\n\t$gru = explode(\"|\", $gru);\n\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"celda\">Lote #: </td>';\n\t\t\t//-\n\t\t\t$desc = Agrega_Ceros($lot[$i]).\"-\".Agrega_Ceros($art[$i]).\"-\".Agrega_Ceros($gru[$i]);\n\t\t\t$salida.= '<td class = \"busqueda\">'.$desc;\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLlot'.$i.'\" id = \"TLlot'.$i.'\" value = \"'.$lot[$i].'\"/>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLart'.$i.'\" id = \"TLart'.$i.'\" value = \"'.$art[$i].'\"/>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLgru'.$i.'\" id = \"TLgru'.$i.'\" value = \"'.$gru[$i].'\"/>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t}\n\t}else{\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><span class = \"celda\">No hay Lotes Enlazados</span></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLlot0\" id = \"TLot0\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLart0\" id = \"TLart0\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLgru0\" id = \"TLgru0\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t}\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"LotTotal\" id = \"LotTotal\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "function createTableModel()\r\n {\r\n?>\r\n // table model\r\n var <?php echo $this->Name; ?>_tableModel = new qx.ui.table.SimpleTableModel();\r\n <?php\r\n if ($this->owner!=null)\r\n {\r\n ?>\r\n <?php echo $this->owner->Name.\".\".$this->Name; ?>_tableModel=<?php echo $this->Name; ?>_tableModel;\r\n <?php\r\n }\r\n ?>\r\n<?php\r\n }", "public function makeTableur()\n {\n return $this->setDocumentPropertiesWithMetas(new Spreadsheet());\n }", "public function create()\n {\n //este deriva a un formulario, el cual debe tomar todos\n //los parametros del bache (nombre, fecha_y_hora, ubicacion, object_state_id (recuperarlo y pasarlo), estado(mostrar opciones y tomar el elegido)) y luego de todo esto llama a store para ser almacenado en la base de datos\n\n }", "protected function table()\n {\n $table = new Table(new Client);\n\n $table->column('id', 'ID');\n $table->column('name', __('name'));\n $table->column('created_at', trans('admin.created_at'));\n $table->column('updated_at', trans('admin.updated_at'));\n\n return $table;\n }", "public function create()\n {\n //KEMUDIAN DI DALAMNYA KITA MENJALANKAN FUNGSI UNTUK MENGOSONGKAN FIELD\n $this->resetFields();\n //DAN MEMBUKA MODAL\n $this->openModal();\n }", "protected function createFormFields() {\n\t}", "function insertTableInsumosVendidos($headers,$matrizDatos) {\n //verificar tabla a insertar (posteriormente puede ser una funcion):\n\n\n\n\n echo '<div class=\"card-body\">\n <div class=\"table-responsive\" >\n <table class=\"table table-bordered dataTableClase\" width=\"100%\" cellspacing=\"0\">'; //apertura de etiquetas\n //rellenar head:\n echo '<thead><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></thead>';\n //rellenar el footer:\n echo '<tfoot><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></tfoot>';\n echo '<tbody>';\n foreach ($matrizDatos as $reg) {\n echo \"<tr>\";\n foreach ($reg as $cell) {\n echo \"<td>\".$cap = ucfirst(mb_strtolower($cell)).\"</td>\"; // Capitalize\n }\n echo \"</tr>\";\n }\n echo '</tbody></table></div></div>'; //cierre etiquetas tabla\n}", "private function createTablesTab()\n {\n $tab = $this->createTab(\n 'tables_tab',\n '__responsive_tab_tables__',\n [\n 'attributes' => [\n 'autoScroll' => true,\n ],\n ]\n );\n\n $attributes = array_merge($this->fieldSetDefaults, ['height' => 200]);\n $fieldSetTables = $this->createFieldSet(\n 'tables_fieldset',\n '__responsive_tab_tables_fieldset_tables__',\n ['attributes' => $attributes]\n );\n\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'panel-table-header-bg',\n '@panel-table-header-bg',\n $this->themeColorDefaults['panel-table-header-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'panel-table-header-color',\n '@panel-table-header-color',\n $this->themeColorDefaults['panel-table-header-color']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-row-bg',\n '@table-row-bg',\n $this->themeColorDefaults['table-row-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-row-color',\n '@table-row-color',\n $this->themeColorDefaults['table-row-color']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-row-highlight-bg',\n '@table-row-highlight-bg',\n $this->themeColorDefaults['table-row-highlight-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-header-bg',\n '@table-header-bg',\n $this->themeColorDefaults['table-header-bg']\n )\n );\n $fieldSetTables->addElement(\n $this->createColorPickerField(\n 'table-header-color',\n '@table-header-color',\n $this->themeColorDefaults['table-header-color']\n )\n );\n\n $tab->addElement($fieldSetTables);\n\n $attributes = array_merge($this->fieldSetDefaults, ['height' => 200]);\n $fieldSetBadges = $this->createFieldSet(\n 'badges_fieldset',\n '__responsive_tab_tables_fieldset_badges__',\n ['attributes' => $attributes]\n );\n\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-discount-bg',\n '@badge-discount-bg',\n $this->themeColorDefaults['badge-discount-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-discount-color',\n '@badge-discount-color',\n $this->themeColorDefaults['badge-discount-color']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-newcomer-bg',\n '@badge-newcomer-bg',\n $this->themeColorDefaults['badge-newcomer-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-newcomer-color',\n '@badge-newcomer-color',\n $this->themeColorDefaults['badge-newcomer-color']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-recommendation-bg',\n '@badge-recommendation-bg',\n $this->themeColorDefaults['badge-recommendation-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-recommendation-color',\n '@badge-recommendation-color',\n $this->themeColorDefaults['badge-recommendation-color']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-download-bg',\n '@badge-download-bg',\n $this->themeColorDefaults['badge-download-bg']\n )\n );\n $fieldSetBadges->addElement(\n $this->createColorPickerField(\n 'badge-download-color',\n '@badge-download-color',\n $this->themeColorDefaults['badge-download-color']\n )\n );\n\n $tab->addElement($fieldSetBadges);\n\n return $tab;\n }", "private function createTables() {\r\n\r\n\t\t\t//User table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `users` (\r\n\t\t\t\t\tuser_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\temail varchar(100),\r\n\t\t\t\t\tstudent_id varchar(30),\r\n\t\t\t\t\tpassword varchar(50),\r\n\t\t\t\t\tsociety_id int DEFAULT 0,\r\n\t\t\t\t\tactive BOOL DEFAULT 1,\r\n\t\t\t\t\tPRIMARY KEY(user_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\tif (!$this->userExists($this->config->admin[\"defaultAdmin\"])) $this->addUser($this->config->admin[\"defaultAdmin\"], $this->config->admin[\"defaultPass\"], 'A000000', 1);\r\n\t\t\t\r\n\t\t\t//Society table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `societies` (\r\n\t\t\t\t\tsociety_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\temail varchar(100),\r\n\t\t\t\t\tsociety_name varchar(50),\r\n\t\t\t\t\tPRIMARY KEY(society_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t$sql = \"INSERT IGNORE INTO `societies` (society_id, email, society_name)\r\n\t\t\t\t\tVALUES (1, '[email protected]', 'LSUCS')\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t\t//Products table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `products` (\r\n\t\t\t\t\tproduct_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tproduct_name varchar(100),\r\n\t\t\t\t\tprice DECIMAL(10, 2) NOT NULL,\r\n\t\t\t\t\tsociety_id int DEFAULT 0,\r\n\t\t\t\t\tavailable BOOL DEFAULT 1,\r\n\t\t\t\t\tPRIMARY KEY(product_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t\t//Receipts table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `receipts` (\r\n\t\t\t\t\treceipt_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tuser_id int,\r\n\t\t\t\t\tstudent_id varchar(30),\r\n\t\t\t\t\tcust_email varchar(100),\r\n\t\t\t\t\tname varchar(100),\r\n\t\t\t\t\tcomments text,\r\n\t\t\t\t\tproducts varchar(100),\r\n\t\t\t\t\tsociety_id int,\r\n\t\t\t\t\tPRIMARY KEY(receipt_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t\t//Refund table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `refunds` (\r\n\t\t\t\t\trefund_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\treceipt_id int,\r\n\t\t\t\t\trefund_amount DECIMAL(10, 2) NOT NULL,\r\n\t\t\t\t\tcomments text,\r\n\t\t\t\t\tPRIMARY KEY(refund_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t}", "public function createForm();", "public function createForm();", "public function limparTabela(){\r\n\t\t$sql = 'DELETE FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t}", "protected function createTable() {\n\t\t$query = \"\n\t\tCREATE TABLE `items` (\n\t\t\t`id`\tINTEGER,\n\t\t\t`firstName`\tTEXT,\n\t\t\t`lastName`\tTEXT,\n\t\t\t`address`\tTEXT,\n\t\t\t'occupation' TEXT,\n\t\t\tPRIMARY KEY(`id`)\n\t\t);\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "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}", "protected function Form_Create() {\n\t\t\t$this->dtgFichasNotases = new FichasNotasDataGrid($this);\n\n\t\t\t// Style the DataGrid (if desired)\n\t\t\t$this->dtgFichasNotases->CssClass = 'datagrid';\n\t\t\t$this->dtgFichasNotases->AlternateRowStyle->CssClass = 'alternate';\n\n\t\t\t// Add Pagination (if desired)\n\t\t\t$this->dtgFichasNotases->Paginator = new QPaginator($this->dtgFichasNotases);\n\t\t\t$this->dtgFichasNotases->ItemsPerPage = 20;\n\n\t\t\t// Use the MetaDataGrid functionality to add Columns for this datagrid\n\n\t\t\t// Create an Edit Column\n\t\t\t$strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/fichas_notas_edit.php';\n\t\t\t$this->dtgFichasNotases->MetaAddEditLinkColumn($strEditPageUrl, QApplication::Translate('Edit'), QApplication::Translate('Edit'));\n\n\t\t\t// Create the Other Columns (note that you can use strings for fichas_notas's properties, or you\n\t\t\t// can traverse down QQN::fichas_notas() to display fields that are down the hierarchy)\n\t\t\t$this->dtgFichasNotases->MetaAddColumn('IdFichaNota');\n\t\t\t$this->dtgFichasNotases->MetaAddColumn(QQN::FichasNotas()->IdFichasObject);\n\t\t\t$this->dtgFichasNotases->MetaAddColumn('IdNota');\n\t\t}", "public function table($data = null) {\n\t\t\tif ($data) {\n\t\t\t\tforeach ( $data as $key => $value ) {\n\t\t\t\t\t$this->{$key} = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// baut tabelle zusammen\n\t\t\techo \"<table>\";\n\t\t\techo \"<thead>\";\n\t\t\t// falls alias übergeben wurde\n\t\t\tif (isset ( $this->alias )) {\n\t\t\t\techo \"<tr>\";\n\t\t\t\tforeach ( $this->alias [0] as $key => $value ) {\n\t\t\t\t\techo \"<td>\";\n\t\t\t\t\techo htmlentities ( $value );\n\t\t\t\t\techo \"</td>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\t\t\t\techo \"</thead>\";\n\t\t\t} else {\n\t\t\t\t// falls keine alias übergeben, dann spaltenname\n\t\t\t\techo \"<tr>\";\n\t\t\t\tforeach ( $this->table [0] as $key => $value ) {\n\t\t\t\t\techo \"<td>\";\n\t\t\t\t\techo htmlentities ( $key );\n\t\t\t\t\techo \"</td>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\t\t\t\techo \"</thead>\";\n\t\t\t}\n\t\t\t// befüllt tabelle mit daten\n\t\t\techo \"<tbody>\";\n\t\t\techo \"<tr>\";\n\t\t\t$i = 0;\n\t\t\twhile ( $i < count ( $this->table ) ) {\n\t\t\t\techo \"<tr>\";\n\t\t\t\tforeach ( $this->table [$i] as $key => $value ) {\n\t\t\t\t\tif ($i % 2 != 0) {\n\t\t\t\t\t\techo \"<td style=background:#A9DFFF; >\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<td>\";\n\t\t\t\t\t}\n\t\t\t\t\techo htmlentities ( $value );\n\t\t\t\t\techo \"</td>\";\n\t\t\t\t}\n\t\t\t\t// falls link\n\t\t\t\tif (isset ( $this->link )) {\n\t\t\t\t\tforeach ( $this->link [0] as $key => $value ) {\n\t\t\t\t\t\t$submitName = $key;\n\t\t\t\t\t\techo \"<td align=center>\";\n\t\t\t\t\t\techo \"<form action=\\\"\";\n\t\t\t\t\t\techo htmlentities ( $value );\n\t\t\t\t\t\techo \"\\\" method=\\\"post\\\">\";\n\t\t\t\t\t\tforeach ( $this->table [$i] as $key => $value ) {\n\t\t\t\t\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"\";\n\t\t\t\t\t\t\techo htmlentities ( $key );\n\t\t\t\t\t\t\techo \"\\\" value=\\\"\";\n\t\t\t\t\t\t\techo htmlentities ( $value );\n\t\t\t\t\t\t\techo \"\\\">\";\n\t\t\t\t\t\t}\n\t/*\n\t * ===============================================\n\t * Start Sprint: 4\n\t * @author: Kilian Kraus\n\t * User Story: Als Admin/Verwalter möchte ich Rechte vergeben können.\n\t * ===============================================\n\t */\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// zusätzliche hidden values\n\t\t\t\t\t\t\tif(isset($this->hidden)){\n\t\t\t\t\t\t\t\tforeach ( $this->hidden[0] as $key => $value ) {\n\t\t\t\t\t\t\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"\";\n\t\t\t\t\t\t\t\t\techo htmlentities ( $key );\n\t\t\t\t\t\t\t\t\techo \"\\\" value=\\\"\";\n\t\t\t\t\t\t\t\t\techo htmlentities ( $value );\n\t\t\t\t\t\t\t\t\techo \"\\\">\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n \t/**-----------------------------------------------------------------------------------------\n\t* START SPRINT 05\n\t* @author: Damian Wysocki\n\t* User Story (Nr.: 430a) Als Mitarbeiter möchte ich Noten von Veranstaltungen für die Teilnehmer eintragen können. (erneut)\n\t* Task: 430a/03 Beschreibung: Maske zum Eintragen\n\t* Zeitaufwand (in Stunden): 5\n\t* START SPRINT 05\t\n\t*/\n\t \n\t\t/**\n\t\t *\n\t\t * @author Damian Wysocki\n\t\t * \n\t\t * Nur Zahlen mit Schritten von 0,3 als Noteneintrag erlaubt\n\t\t **/ \n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\techo \"<select name=\\\"Note\\\" required=\\\"required\\\" style=\\\"max-width:45%\\\" >\n\t\t\t\t<option value=\\\"1.0\\\">1.0</option>\n\t\t\t\t<option value=\\\"1.3\\\">1.3</option>\n\t\t\t\t<option value=\\\"1.7\\\">1.7</option>\n\t\t\t\t<option value=\\\"2.0\\\">2.0</option>\n\t\t\t\t<option value=\\\"2.3\\\">2.3</option>\n\t\t\t\t<option value=\\\"2.7\\\">2.7</option>\n\t\t\t\t<option value=\\\"3.0\\\">3.0</option>\n\t\t\t\t<option value=\\\"3.3\\\">3.3</option>\n\t\t\t\t<option value=\\\"3.7\\\">3.7</option>\n\t\t\t\t<option value=\\\"4.0\\\">4.0</option>\n\t\t\t\t<option value=\\\"5.0\\\">5.0</option>\t\t\t\t\n\t\t\t\t<\\\"select>\";\n\t\t\t\t\t\n\t\t\t\t\t\techo \"<input class=\\\"button\\\" type=\\\"submit\\\" onClick=\\\"return confirm('Wollen Sie die Note wirklich ändern?')\\\" value=\\\"\";\n\t\t\t\t\t\t/**\n\t* ENDE SPRINT 05\n\t* @author: Damian Wysocki\n\t* User Story (Nr.: 430a) Als Mitarbeiter möchte ich Noten von Veranstaltungen für die Teilnehmer eintragen können. (erneut)\n\t* Task: 430a/03 Beschreibung: Maske zum Eintragen\n\t* Zeitaufwand (in Stunden): 5\n\t* ENDE SPRINT 05\n\t**-----------------------------------------------------------------------------------------*/\t\n\t\t\t\t\t\t\n\t\t\t\t\t\techo htmlentities ( $submitName );\n\t\t\t\t\t\techo \"\\\">\";\n\t\t\t\t\t\techo \"</form>\";\n\t\t\t\t\t\techo \"</td>\";\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\techo \"</tr>\";\n\t\t\t\t$i ++;\n\t\t\t}\n\t\t\techo \"</tr>\";\n\t\t\techo \"</tbody>\";\n\t\t\techo \"</table>\";\n\t\t}", "private function create_forms_table($db) {\n\t\t$this->company_forge = $this->load->dbforge($db, TRUE);\n\t\t// Load fields to create the Forms table\n\t\t$fields = array(\n\t\t\t'id' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE,\n\t\t\t\t'auto_increment'\t=> TRUE\n\t\t\t),\n\t\t\t'department' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 100,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 100,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'subtitle' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 100\n\t\t\t),\n\t\t);\n\t\t// Add the fields before creating the Forms table\n\t\t$this->company_forge->add_field($fields);\n\t\t// Add active as the last field\n\t\t$this->company_forge->add_field(\"active TINYINT(1) NOT NULL DEFAULT 1\");\n\t\t// Make the id the primary key of the Forms table\n\t\t$this->company_forge->add_key('id', TRUE);\n\t\t// Attempt to create the Forms table and return success or failure\n\t\tif ($this->company_forge->create_table('forms'))\n\t\t\treturn TRUE;\n\t\telse\n\t\t\treturn FALSE;\n\t}", "function createTable($result) {\n $table = \"<table class='table table-bordered'>\";\n $row = $result->fetch_assoc();\n $table .= \"<tr>\";\n foreach(array_keys($row) as $field) {\n $table .= \"<th class='text-center'>$field</th>\";\n }\n $table .= \"</tr>\";\n while($row) {\n $table .= \"<tr>\";\n foreach($row as $key => $value) {\n $table .= \"<td class='text-center'>\";\n if(strcmp($key, \"Price\") == 0 or strcmp($key, \"Revenue\") == 0) {\n $table.=\"\\$\" . number_format($value, 2, \".\", \"\");\n }\n else {\n $table .= $value;\n }\n $table.=\"</td>\";\n }\n $table .= \"</tr>\";\n $row = $result->fetch_assoc();\n }\n $table .= \"</table>\";\n return $table;\n }", "function getTablas() {\n $tablas['departamento']['id'] = 'departamento';\n $tablas['departamento']['nombre'] = 'Departamentos';\n\n $tablas['departamento_region']['id'] = 'departamento_region';\n $tablas['departamento_region']['nombre'] = 'Departamentos (Region)';\n\n $tablas['municipio']['id'] = 'municipio';\n $tablas['municipio']['nombre'] = 'Municipios';\n\n $tablas['operador']['id'] = 'operador';\n $tablas['operador']['nombre'] = 'Operador';\n\n $tablas['pais']['id'] = 'pais';\n $tablas['pais']['nombre'] = 'Paises';\n\n $tablas['ciudad']['id'] = 'ciudad';\n $tablas['ciudad']['nombre'] = 'Ciudades';\n\n $tablas['familias']['id'] = 'familias';\n $tablas['familias']['nombre'] = 'Familias';\n\n $tablas['monedas']['id'] = 'monedas';\n $tablas['monedas']['nombre'] = 'Monedas';\n\n $tablas['cuentas_financiero']['id'] = 'cuentas_financiero';\n $tablas['cuentas_financiero']['nombre'] = 'Cuentas';\n\n $tablas['cuentas_financiero_ut']['id'] = 'cuentas_financiero_ut';\n $tablas['cuentas_financiero_ut']['nombre'] = 'Cuentas UT';\n\n $tablas['cuentas_financiero_tipo']['id'] = 'cuentas_financiero_tipo';\n $tablas['cuentas_financiero_tipo']['nombre'] = 'Tipos de Cuentas';\n\n $tablas['extracto_movimiento']['id'] = 'extracto_movimiento';\n $tablas['extracto_movimiento']['nombre'] = 'Movimientos';\n\n $tablas['centropoblado']['id'] = 'centropoblado';\n $tablas['centropoblado']['nombre'] = 'Centros Poblados';\n\n $tablas['encuesta_tipo']['id'] = 'encuesta_tipo';\n $tablas['encuesta_tipo']['nombre'] = 'Tipo de Encuesta';\n\n $tablas['actividades_tipo']['id'] = 'actividades_tipo';\n $tablas['actividades_tipo']['nombre'] = 'Planes de Actividades';\n\n $tablas['tipohallazgo']['id'] = 'tipohallazgo';\n $tablas['tipohallazgo']['nombre'] = 'Tipo Hallazgo';\n\n asort($tablas);\n return $tablas;\n }", "function NewRow() {\n\t\t$row = array();\n\t\t$row['id'] = NULL;\n\t\t$row['fecha_tamizaje'] = NULL;\n\t\t$row['id_centro'] = NULL;\n\t\t$row['apellidopaterno'] = NULL;\n\t\t$row['apellidomaterno'] = NULL;\n\t\t$row['nombre'] = NULL;\n\t\t$row['ci'] = NULL;\n\t\t$row['fecha_nacimiento'] = NULL;\n\t\t$row['dias'] = NULL;\n\t\t$row['semanas'] = NULL;\n\t\t$row['meses'] = NULL;\n\t\t$row['sexo'] = NULL;\n\t\t$row['discapacidad'] = NULL;\n\t\t$row['id_tipodiscapacidad'] = NULL;\n\t\t$row['resultado'] = NULL;\n\t\t$row['resultadotamizaje'] = NULL;\n\t\t$row['tapon'] = NULL;\n\t\t$row['tipo'] = NULL;\n\t\t$row['repetirprueba'] = NULL;\n\t\t$row['observaciones'] = NULL;\n\t\t$row['id_apoderado'] = NULL;\n\t\t$row['id_referencia'] = NULL;\n\t\treturn $row;\n\t}", "function make_form_row(){\n\t\tswitch($this->fieldType){\n\t\t\tcase 'id':\n\t\t\t\treturn $this->obo_id();\n\t\t\t\tbreak;\n\t\t\tcase 'term':\n\t\t\t\treturn $this->obo_term();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$form = parent::make_form_row();\n\t\t\n\t\t}\n\t\treturn $form;\n\t\n\t}", "function mscaffolding_create_table($name, $data)\n\t{\n\t\t$query_string = \"CREATE TABLE `\" . lconf_get(\"db_name\") . \"`.`\" . $name . \"` (`id` INT NOT NULL AUTO_INCREMENT,\";\n\n\t\tfor ($i = 0; $i < count($data) / 2; $i++)\n\t\t{\n\t\t\t$query_string .= \"`\" . $data[\"name\" . $i] . \"`\" . mscaffolding_get_type($data[\"type\" . $i]);\n\t\t}\n\n\t\t$query_string .= \" PRIMARY KEY ( `id` )) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_slovenian_ci\";\n\n\t\treturn ldb_query($query_string);\n\t}" ]
[ "0.75758296", "0.71097934", "0.6964749", "0.6937182", "0.68306154", "0.66994697", "0.66915166", "0.6523501", "0.64936286", "0.6458122", "0.64244217", "0.64239234", "0.6421778", "0.64184856", "0.63971436", "0.6391282", "0.63753736", "0.63441133", "0.632369", "0.6316495", "0.62882566", "0.6282721", "0.6277663", "0.62662226", "0.624818", "0.6248135", "0.6227218", "0.6226062", "0.62131417", "0.6193078", "0.6154664", "0.61485434", "0.61439943", "0.6140586", "0.61039144", "0.6102983", "0.6099552", "0.60937005", "0.60909545", "0.6089934", "0.608186", "0.60781497", "0.607486", "0.60668015", "0.60665804", "0.60595584", "0.6037122", "0.60364884", "0.60273015", "0.6024507", "0.6015431", "0.6015112", "0.6011364", "0.60106564", "0.60098845", "0.60080576", "0.6002897", "0.59979415", "0.5994384", "0.5970787", "0.5959733", "0.5958288", "0.5955344", "0.59549576", "0.59547067", "0.5954382", "0.5945772", "0.5937253", "0.59353584", "0.59349245", "0.5932782", "0.5924037", "0.5917756", "0.59166765", "0.59155774", "0.59123135", "0.59106094", "0.590549", "0.5903804", "0.58983934", "0.5898138", "0.5891778", "0.5890337", "0.58857757", "0.5881265", "0.5880232", "0.5876414", "0.58732027", "0.5871275", "0.5871275", "0.58690524", "0.5865057", "0.58519477", "0.58507395", "0.5848562", "0.58478063", "0.58467656", "0.5842533", "0.5838886", "0.5838717", "0.58337295" ]
0.0
-1
get single message error, from result validate form request laravel
public function getNameproducts($id) { //? find id $product = Product::find($id); if (is_null($product)) return ''; return $product->product_name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getErrorMessage();", "public function getErrorMessage();", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function getValidationFailed();", "public function getValidationErrorMessages() {}", "public function getValidationResult();", "public function validAndGetErrorMsg() {\r\n require_once 'Samus/Samus_CRUD/Samus_CRUD_RequestValidator.php';\r\n $req = new Samus_CRUD_RequestValidator($this->object);\r\n $req->init();\r\n return $req->result();\r\n }", "public function getErrorMessage()\n {\n return $this->applyTemplate();\n }", "public function messages()\n {\n return [\n //'order_number'=>'required|unique:jobs|min:10|max:11',\n 'contact_id.exists'=>'Please select a contact from the company',\n ];\n }", "public function getErrorMessage()\n {\n return null;\n }", "public function getValidationErrors();", "public function getValidationErrors();", "public function validate()\n {\n $result = parent::validate();\n \n if ($result === true)\n $this->setErrorMessage('');\n else\n $this->setErrorMessage(Resources::getValue(Resources::SRK_FORM_ERRORGENERIC));\n \n return $result;\n }", "public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }", "public function message()\n {\n return $this->getError();\n }", "public function message()\n {\n return 'The validation error messagess.';\n }", "protected function createValidationErrorMessage() {}", "public function messages()\n {\n return [\n 'name' => 'required',\n 'address' => 'required',\n 'city' => 'required',\n 'latitude' => 'required',\n 'longitude' => 'required',\n 'type' => 'required',\n 'is_public' => 'required',\n 'school_zone' => 'required',\n ];\n }", "public function messages()\n {\n return [\n 'query.required' => \"La valeur de la recherche est obligatoire.\",\n ];\n }", "public function errors(): MessageBag;", "public function messages()\n {\n return [\n 'name.required' => 'Por favor proporcione su nombre',\n 'email.required' => 'Por favor proporcione un email valido.',\n 'message.required' => 'Escriba su mensaje',\n //'g-recaptcha-response.required' => 'Responda el captcha.'\n ];\n }", "protected function getFlattenedValidationErrorMessage() {}", "private function errorMessages()\n {\n return [\n 'question_category_id.required' => 'Atleast one question-category '.\n 'is required',\n ];\n }", "public function messages()\n {\n return $messages = [\n 'country_id.required' => trans('error_messages.req_country'),\n 'country_id.numeric' => trans('error_messages.invalid_country'),\n 'first_name.required' => trans('error_messages.req_first_name'),\n 'first_name.regex' => trans('error_messages.invalid_first_name'),\n 'first_name.max' => trans('error_messages.first_name_max_length'),\n \n \n 'last_name.required' => trans('error_messages.req_last_name'),\n 'last_name.regex' => trans('error_messages.invalid_last_name'),\n 'last_name.max' => trans('error_messages.last_name_max_length'),\n 'dob.required' => trans('error_messages.req_dob_name'),\n 'email.required' => trans('error_messages.req_email'),\n 'email.max' => trans('error_messages.email_max_length'),\n 'email.email' => trans('error_messages.invalid_email'),\n 'email.unique' => trans('error_messages.email_already_exists'),\n 'email.unique' => trans('error_messages.email_already_exists'),\n 'country_code.required' => trans('forms.Corperate_Reg.client_error.req_country_code'),\n\n 'phone.min'=>trans('error_messages.phone_minlength'),\n 'phone.max'=>trans('error_messages.phone_maxlength'),\n 'phone.numeric'=>trans('error_messages.invalid_phone'),\n ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'Email is required!',\n 'year.required' => 'Year is required!',\n 'artist_id.required' => 'Artist is required!'\n ];\n }", "public function getErrorMessage()\n {\n return $this->error_message;\n }", "public static function getMessageRule(){\n return [\n 'title.required' => 'Please input the title',\n 'cat_id.required' => 'Please chose a category',\n 'country_id.required' => 'Please chose a country',\n ];\n }", "public function getErrorMessage()\n {\n $errorMessages = $this->getErrorMessages();\n if (empty($errorMessages)) {\n return false;\n }\n return $errorMessages[0];\n }", "public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\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 }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function getMessage($validator) {\n $messages = $validator->messages();\n if (!empty($messages)) {\n foreach ($messages->all() as $error) {\n $data['error'] = $error;\n $data['status'] = false;\n return $data;\n }\n }\n }", "public function getValidatedMessage(){\n $valid = $this->getIsValid();\n if(!is_null($valid)){\n if($valid === false) $key = 'error';\n else $key = 'success';\n return \"<p class=\\\"form_{$key}\\\">{$this->validatedMessage[$key]}</p>\";\n }\n return '';\n }", "public function message()\n {\n if ($this->error['type'] === 'custom') {\n return $this->error['message'];\n }\n\n $messages = null;\n\n if ($this->request) {\n $messages = $this->request->messages();\n }\n\n $message = $messages[\"{$this->error['attribute']}.check_file_{$this->error['type']}\"] ??\n trans(\"validation.check_file_{$this->error['type']}\");\n\n [$keys, $values] = Arr::divide($this->error['payload'] ?? []);\n\n $keys = \\array_map(function (string $key) {\n return \":{$key}\";\n }, $keys);\n\n return \\str_replace($keys, $values, $message);\n }", "public function errorMessage() { return $this->errorMessage; }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function messages()\n {\n /*\n return [\n 'bio.required' => 'Bio is required',\n 'state.required' => 'State is required',\n 'city.required' => 'City name is required',\n 'postalcode.required' => 'Postal Code is required',\n 'gender.required' => 'Gender is required',\n 'seeking_gender.requred' => 'Gender you are searching for is required',\n ];\n */\n }", "public function getErrorMessage($field);", "public function message()\n {\n return 'Recaptcha validation failed.';\n }", "function getErrorMsg() {\n $CI = & get_instance();\n $tempArr = $CI->form_validation->error_array();\n if (count($tempArr) > 0) {\n foreach ($tempArr as $key => $val) {\n return $val;\n break;\n }\n }\n}", "function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}", "public function messages() \n {\n return[\n 'name.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.numeric' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.major' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity']\n ];\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function message()\n {\n return [\n 'first_name.required' => 'First name is required',\n 'last_name.required' => 'Last name is required',\n 'mobile_no.required' => 'Mobile no is required',\n 'email.required' => 'Email is required',\n 'password.required' => 'Password is required',\n 'confirmed_password.required' => 'Confirmed password is required',\n ];\n }", "public function getErrorMessage() {\n return $this->errorMessage;\n }", "public function messages()\n {\n return [\n 'first_name.required' => 'Voornaam is vereist',\n 'last_name.required' => 'Achternaam is vereist',\n 'function.required' => 'Functie is vereist',\n 'date_of_birth.required' => 'Geboortedatum is vereist',\n 'postal_code.required' => 'Postcode is vereist',\n 'housenumber.required' => 'Huisnummer is vereist',\n 'street.required' => 'Straat is vereist',\n 'residence.required' => 'Woonplaats is vereist',\n 'email.required' => 'E-mail is vereist',\n 'phone_number.required' => 'Telefoonnummer is vereist',\n 'username.required' => 'Gebruikersnaam is vereist',\n 'password.required' => 'Wachtwoord is vereist',\n 'password2.required' => 'Wachtwoord herhalen is vereist',\n\n ];\n }", "protected function getFlattenedValidationErrorMessage()\n\t{\n\t\t$outputMessage = 'Validation failed while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;\n\t\t$errorObject = [\n\t\t\t'message' => $outputMessage,\n\t\t];\n\t\t$logMessage = $outputMessage;\n\n\t\tforeach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyPath => $errors) {\n\t\t\t/* @var $error Error */\n\t\t\tforeach ($errors as $error) {\n\t\t\t\t$logMessage .= 'Error for ' . $propertyPath . ': ' . $error->render() . PHP_EOL;\n\t\t\t\t$errorObject['errors'][] = ['code' => $error->getCode(), 'field' => $propertyPath, 'message' => $error->render()];\n\t\t\t}\n\t\t}\n\t\t$this->logger->error($logMessage, $errorObject);\n\n\t\t$errorObject = $this->transformErrorObject($errorObject);\n\n\t\t$this->response->setStatusCode(422);\n\t\t$this->response->setContentType('application/json');\n\n\t\treturn json_encode($errorObject, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\t}", "public function messages()\n {\n return [\n 'price_type_id.required' => 'The price type is required',\n 'project_type_id.required' => 'The project type is required',\n ];\n }", "public function validateInformation(Request $request){\n \n $data_input = $request->get('drivingLicence');\n // echo '<pre> licencia';\n // print_r($data_input);\n // die;\n $message_error_expi_date = 'La fecha de vencimiento no puede ser menor a la de expedición';\n $validator = Validator::make(\n $data_input,\n [\n 'licence_num' => 'required|max:255',\n 'country_expedition' => 'required|max:255',\n 'category' => 'required|max:255',\n 'state' => 'required|max:255',\n 'expedition_day' => 'required|max:255',\n 'expi_date' => [new ValidateDate($data_input['expedition_day'],$message_error_expi_date),'required','max:255'],\n ],\n [\n 'driver_information_dni_id.unique' => \"Este conductor ya tiene una licencia asignada.\",\n 'licence_num.required' => \"El número de licencia es obligatorio.\",\n 'category.required' => \"La categoría de la licencia es obligatoria.\",\n 'state.required' => \"El estado de la licencia es obligatoria.\",\n 'expedition_day.required' => \"La fecha de expedición es obligatoria.\",\n 'expi_date.required' => \"La fecha de vencimiento es obligatoria.\",\n ]\n );\n $errors = $validator->errors()->getMessages();\n // print_r($errors);\n // die;\n if (!empty($errors)) {\n return response()->json(['errors' => $errors]);\n }else{\n return response()->json(['response'=>'','errors' => []]);\n }\n }", "public function getValidationMessages();", "public function messages()\n {\n return [\n 'division_id.required' => 'Select a Division',\n 'district_id.required' => 'Select a District',\n 'upazila_id.required' => 'Select a Upazila',\n ];\n }", "public function message()\n {\n return $this->validationFailures;\n }", "public function messages(){\n return [\n 'name.required' => 'You should fill in the name section',\n 'subject.required' => 'You need to fill in the subject section',\n 'message.required' => 'You need to fill in the message section'\n ];\n }", "public function message()\n {\n return __(\"validation.{$this->error}\", ['attribute' => 'nomor sampel']);\n }", "public function messages()\n {\n return [\n \n 'name.required' => 'A name is required',\n //'guard_name.required' => 'A guard name is required',\n ];\n }", "public function validationHasFailed() {}", "public function messages()\n {\n return [\n 'nama.required' => 'Field nama wajib diisi',\n 'kode.required' => 'Field kode wajib diisi',\n ];\n }", "public function messages()\n {\n return [\n 'code_day.required' => 'Code day must required!',\n 'name.required' => 'Name must required!',\n ];\n }", "public function message()\n {\n return [ \n 'nombre.required' => 'Este campo es requerido',\n 'nombre.string' => 'El valor no es correcto deben ser solo Letras' ,\n 'nombre.max' => 'Largo maximo es de 150 caracteres' ,\n 'nombre.unique' => 'Ya se encuentra registrado ese nombre' ,\n\n 'email.required' => 'Este campo es requerido',\n 'email.string' => ' El valor deben ser alfanumerico y no debe comenzar por un numero',\n 'email.max' => 'Largo maximo es de 250 caracteres',\n 'email.unique' => 'Ya se encuentra registrado ese email' ,\n\n 'direccion.required' => 'Este campo es requerido',\n 'direccion.max' => 'Largo maximo es de 250 caracteres',\n \n 'telefono.required' => 'Este campo es requerido',\n 'telefono.max' => 'Largo maximo es de 16 caracteres', ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'A name is required.',\n 'color.required' => 'Please select a color.'\n ];\n }", "public function renderGlobalErrorMessage()\n {\n $message = \"\";\n $nberror = count($this->getErrorSchema());\n if ($nberror > 0) {\n $tmp = $this->getErrorSchema()->getErrors();\n $message = \"<div class='alert alert-danger'>Please check your form, $nberror field(s) seem(s) not correctly filled </br>\";\n foreach ($tmp as $key => $e) {\n if ($key == 'Description'){\n $message .= \"- Problem description field is too long (4000 characters max): Please use verbose mode and reduce this field.\";\n }\n\n }\n $message .= \"</div>\";\n }\n return $message;\n }", "public function messages()\n {\n return [\n 'code_area.required' => 'Code area cannot be blank',\n 'name.required' => 'Name area cannot be blank'\n ];\n }", "public function errorMessage()\n {\n return $this->error;\n }", "public function getLastValidationError(): string;", "protected function validator(array $data)\n {\n $data['no_hp'] = phone::validate($data['no_hp']);\n $customMessage = [\n 'nama.required' => 'Nama lengkap wajib diisi',\n 'nama.min' => 'Nama lengkap minimal terdiri sebanyak :min karakter',\n 'nama.max' => 'Nama lengkap maksimal terdiri sebanyak :max karakter',\n 'username.required' => 'Nama pengguna wajib diisi. Contoh: budianduk',\n 'username.min' => 'Nama pengguna minimal terdiri sebanyak :min karakter',\n 'username.max' => 'Nama pengguna maksimal terdiri sebanyak :max karakter',\n 'username.unique' => 'Nama pengguna yang anda masukan telah terdaftar, silahkan gunakan nama pengguna lain',\n 'username.alpha_dash'=> 'Nama pengguna tidak boleh menggunakan karakter spasi',\n 'email.required' => 'Email wajib diisi',\n 'email.min' => 'Email minimal terdiri sebanyak :max karakter',\n 'email.max' => 'Email maksimal terdiri sebanyak :max karakter',\n 'email.unique' => 'Email yang anda masukan telah terdaftar, silahkan gunakan email lain',\n 'no_hp.required' => 'Nomor telepon wajib diisi',\n 'no_hp.numeric' => 'Pastikan nomor telepon yang dimasukkan berupa angka',\n 'no_hp.digits_between' => 'Nomor telepon harus memiliki panjang minimal :min digit dan maksimal :max digit',\n 'password.required' => 'Kata sandi wajib diisi',\n 'password.string' => 'Kata sandi harus terdiri dari teks',\n 'password.min' => 'Kata sandi minimal terdiri sebanyak :min karakter',\n 'password.confirmed' => 'Pastikan kata sandi konfirmasi sesuai',\n 'role.required' => 'Pastikan pilih salah satu keperluan anda dalam mendaftar',\n ];\n $dataValidator = [\n 'nama' => ['required', 'string', 'min:5', 'max:128'],\n 'username' => ['required', 'string', 'min:5', 'max:32', 'unique:user,username','alpha_dash'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:user'],\n 'no_hp' => ['required', 'numeric', 'digits_between:10,14'],\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n 'role' => ['required', 'string', 'max:8'],\n ];\n return Validator::make($data, $dataValidator, $customMessage);\n }", "public function getErrors()\n {\n return $this->getInputFilter()->getMessages();\n }", "public function message()\n {\n return $this->errorMsg;\n }", "public function messages()\n {\n return [\n 'sku.required' => 'Product sku must is required',\n 'vol_weight.required' => 'Merchant ID must is required',\n 'weight.required' => 'Merchant Sku must is required',\n 'length.required' => 'Merchant Sku must is required',\n 'width.required' => 'Merchant Sku must is required',\n 'height.required' => 'Merchant Sku must is required',\n ];\n }", "public function validationErrors(): MessageBag\n {\n return new MessageBag([\n 'file' => __('profile::profile.upload.not-valid')\n ]);\n }", "protected function structureValidationErrorMessages($validation_result)\n {\n\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "public function getErrorMessage() {\n return '';\n }", "public function getMessage() {\n\n // Remove the 'validate_' prefix that GUMP adds to all broken rules.\n $key = str_replace('validate_', '', $this->rule);\n\n // Get the message template for this rule.\n $template = self::$messages[$key];\n\n // Inject our field label, and if this field has a parameter, inject that too.\n $message = preg_replace(array(\"/(%s)/\", \"/(%s)/\"), array($this->field->getLabel(), $this->parameter), $template, 1);\n\n // Return the message.\n return $message;\n }", "public function messages()\n {\n return $messages = [\n 'source_funds.required' => trans('common.error_messages.req_this_field'),\n 'jurisdiction_funds.required' => trans('common.error_messages.req_this_field'),\n 'annual_income.required' => trans('common.error_messages.req_this_field'),\n 'other_source.required' => trans('common.error_messages.req_this_field'),\n 'estimated_wealth.required' => trans('common.error_messages.req_this_field'),\n 'wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'other_wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'tin_code.required' => trans('common.error_messages.req_this_field'),\n 'is_abandoned.required' => trans('common.error_messages.req_this_field'),\n 'date_of_abandonment.required' => trans('common.error_messages.req_this_field'),\n 'abandonment_reason.required' => trans('common.error_messages.req_this_field'),\n 'justification.required' => trans('common.error_messages.req_this_field'),\n 'tin_country_name.required' => trans('common.error_messages.req_this_field'),\n 'tin_number.required' => trans('common.error_messages.req_this_field'),\n ];\n }", "function errorMsg() {\r\n return \r\n $this->resultError;\r\n }", "public function get_error();", "public function get_error();", "public function messages()\n {\n return [\n 'g-recaptcha-response.required' => 'Please verify that you are not robocop :)',\n 'g-recaptcha-response.captcha' => 'Captcha error! try again later or contact site admin.',\n 'image.required' => 'The cover photo field is required!',\n 'code.required' => 'The sourcecode link field is required!'\n ];\n }", "public function postErrorResponse()\n {\n $this->getResponse()->code(400)->redirect();\n return $this->form;\n }", "public function messages()\n {\n return [\n 'name.required' => 'Please enter service name.',\n 'name.max' => 'Service name should not be greater than 50 character.',\n 'provider_name.required' => 'Please enter provider name.',\n 'provider_name.max' => 'Provider name should not be greater than 50 character.',\n 'mobile_no.required' => 'Please enter mobile no.',\n 'mobile_no.min' => 'The mobile number must be at least 10 digit.',\n 'mobile_no.regex' => 'Please enter valid mobile number.',\n 'email.email' => 'Please enter valid email address.'\n ];\n }", "public function getError();", "public function getError();", "public function getError();", "public function messages()\n {\n return [\n 'display_name.required' => 'El campo Nombre es obligatorio',\n ];\n }", "public function returnErrorMessage()\n \n {\n if (null !== $this->errormessage) {\n\n return $this->returnExternalObjectHtml($this->errorobjarray['errorobj'], $this->errorobjarray['att']);\n\n }\n\n }" ]
[ "0.71105236", "0.71105236", "0.70272464", "0.7019878", "0.6715373", "0.67019147", "0.66358936", "0.6484374", "0.64819574", "0.64482844", "0.644632", "0.644632", "0.6445338", "0.6434859", "0.6402762", "0.6391771", "0.6362143", "0.63563925", "0.63449985", "0.634066", "0.63342434", "0.6329299", "0.6322208", "0.6310704", "0.6286902", "0.62580776", "0.6254795", "0.6248114", "0.6246977", "0.6237848", "0.6237848", "0.6237848", "0.6237848", "0.6237848", "0.6237848", "0.6223715", "0.6213665", "0.62128556", "0.62043035", "0.6199315", "0.6199315", "0.61962926", "0.61962926", "0.61962926", "0.61962926", "0.61729", "0.61649084", "0.6160302", "0.61496127", "0.6147125", "0.6146815", "0.6145933", "0.6145933", "0.6145933", "0.6145933", "0.6145933", "0.6145933", "0.6145933", "0.6142539", "0.61399865", "0.6136464", "0.6132994", "0.6132239", "0.61316144", "0.61308366", "0.6124891", "0.6123861", "0.6121708", "0.6117304", "0.6117035", "0.6110869", "0.6110394", "0.6091236", "0.6080168", "0.60750264", "0.6071503", "0.60691637", "0.60676175", "0.6057541", "0.6047435", "0.60368145", "0.60363805", "0.603504", "0.6032576", "0.60321903", "0.6032056", "0.6032056", "0.6028514", "0.6027198", "0.6021912", "0.60201395", "0.60189885", "0.60189885", "0.6015695", "0.60061055", "0.59999645", "0.599615", "0.599615", "0.599615", "0.5994769", "0.5994228" ]
0.0
-1
Get data sum credit, debit, income from transaction
public function getTransactionByOtherSpecification( $request = null, $account_id = null, $parent_account_id = null, $balance = null, $account_type = null, $transaction_id = null ) { $query = TransactionDetail::select(DB::raw(' SUM(credit_amount) AS nominal_credit_amount, SUM(debit_amount) AS nominal_debit_amount, (SUM(credit_amount) - SUM(debit_amount)) AS nominal_income, (SUM(debit_amount) - SUM(credit_amount)) AS nominal_net_mutation_debit, (SUM(credit_amount) - SUM(debit_amount)) AS nominal_net_mutation_credit ')) ->join('transactions', 'transactions.id', '=', 'transaction_details.transaction_id') ->join('accounts', 'accounts.id', '=', 'transaction_details.account_id') ->where('transactions.transaction_status', Transaction::STATUS_POSTED); if (!is_null($request)) { if (!is_null($request->company_id)) { $query->where('transactions.company_id', $request->company_id); } if ($request->is_profit_loss) { $query->whereRaw('(accounts.account_type IN ( '.Account::INCOME.', '.Account::COGS.', '.Account::EXPENSES.', '.Account::OTHER_INCOME.', '.Account::OTHER_EXPENSES.' ))'); } // untuk filter format bulan 'Y-m' if (!is_null($request->start_period) && !is_null($request->end_period)) { $query->whereBetween('transactions.transaction_date', [ app('string.helper')->parseStartOrLastDateOfMonth($request->start_period, 'Y-m-d', false), app('string.helper')->parseStartOrLastDateOfMonth($request->end_period, 'Y-m-d', true) ]); } // untuk filter format tanggal indo 'd-m-Y' if (!is_null($request->start_date) && !is_null($request->end_date)) { $query->whereBetween('transactions.transaction_date', [ app('string.helper')->parseDateFormat($request->start_date), app('string.helper')->parseDateFormat($request->end_date) ]); } } // kondisi jika sekaligus account id dan parent id ada if (!is_null($account_id) && !is_null($parent_account_id)) { if ($account_id == $parent_account_id) { $query->whereRaw('( transaction_details.account_id = '.'"'.$account_id.'"'. ' OR accounts.parent_account_id = '.'"'.$parent_account_id.'"'. ' )'); } } else { if (!is_null($account_id)) { if (is_array($account_id)) $query->whereIn('transaction_details.account_id', $account_id); else $query->where('transaction_details.account_id', $account_id); } if (!is_null($parent_account_id)) $query->where('accounts.parent_account_id', $parent_account_id); } if (!is_null($balance)) $query->where('accounts.balance', $balance); if (!is_null($account_type)) $query->where('accounts.account_type', $account_type); if (!is_null($transaction_id)) $query->where('transactions.id', $transaction_id); $result = $query->first(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_total_debit(){\n return $this->get_storage_cost() + $this->get_services_cost();\n }", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }", "public function getData()\n {\n $this->validate('transactionReference', 'amount');\n\n return [\n 'amount' => [\n 'currency' => $this->currency,\n 'total' => $this->amount,\n ],\n 'is_final_capture' => true,\n ];\n }", "public function getTotalAmount();", "public function balance()\n {\n $credit = $this->query->where('type_id', Transaction::TYPE_CREDIT)->sum('amount');\n $debit = $this->query->where('type_id', Transaction::TYPE_DEBIT)->sum('amount');\n return $credit - $debit;\n }", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getSum()\n {\n return $this->amount;\n }", "public function calculate() {\n $price = $this->calculateFirstPayment($user);\n\n $currency = $price->currency;\n\n if ($user == Constants::USER_CLIENT) {\n $credit = ClientTransaction::getCreditBalance(Yii::app()->user->id);\n } else {\n $credit = new Price(0, $currency); //carer can't have credit\n }\n\n $paidCredit = new Price(0, $currency);\n $paidCash = new Price(0, $currency);\n $remainingCreditBalance = new Price(0, $currency);\n\n if ($credit->amount > 0) {\n\n if ($credit->amount >= $price->amount) {\n\n $paidCredit = $price;\n $remainingCreditBalance = $credit->substract($price);\n } else {\n\n $paidCash = $price->substract($credit);\n $paidCredit = $credit;\n }\n } else {\n $paidCash = $price;\n }\n\n return array('toPay' => $price, 'paidCash' => $paidCash, 'paidCredit' => $paidCredit, 'remainingCreditBalance' => $remainingCreditBalance);\n }", "function getAmountData($data){\n $amountData = json_decode($data['amounts'], true);\n return $amountData;\n }", "function total_debit_transactions_amount(){\n $today_debit_rec_q = mysql_query(\"SELECT COUNT(order_id) AS TOTAL_DEBIT_ORDERS,SUM(amount) AS TOTAL_AMOUNT FROM orders WHERE (card_payment_type = '4' OR card_payment_type = 'D') AND DATE_FORMAT(timestamp,'%Y-%m-%d') = CURDATE()\");\n $today_debit_rec = mysql_fetch_assoc($today_debit_rec_q);\n $total_debit_transactions = $today_debit_rec[\"TOTAL_DEBIT_ORDERS\"];\n $total_debit_transactions_amount = $today_debit_rec[\"TOTAL_AMOUNT\"];\n return $total_debit_transactions_amount;\n }", "public function getDistribusiRevenueData()\n {\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n\n $data_rekening = array();\n $total_rata_rata = array();\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\") - $this->getRekeningBeban(\"saldo\");\n $total_pendapatan_product = 0;\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product),\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product)\n ]);\n }\n\n\n return $data_rekening;\n }", "public function getTransactionAmount() \n {\n return $this->_fields['TransactionAmount']['FieldValue'];\n }", "public function getTotalTranscodeData()\n {\n return $this->TotalTranscodeData;\n }", "function getUserAmountDetails($user_id)\n\t\t{\n\t\t\t//defining variable\n\t\t\t$total_earning = 0;\n\t\t\t$total_withdraw = 0;\n\t\t\t//getting values of user money\n\t\t\t$userMoney = $this->manageContent->getValueMultipleCondtn('user_money_info', '*', array('user_id'), array($user_id));\n\t\t\tif(!empty($userMoney[0]))\n\t\t\t{\n\t\t\t\tforeach($userMoney as $money)\n\t\t\t\t{\n\t\t\t\t\tif(!empty($money['credit_amount']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$total_earning = $total_earning + $money['credit_amount'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($money['debit_amount']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$total_withdraw = $total_withdraw + $money['debit_amount'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$net_amount = $total_earning - $total_withdraw;\n\t\t\t\n\t\t\treturn array($total_earning,$total_withdraw,$net_amount);\n\t\t}", "function get_sales_amount($pccustno){\n\t$oConn = get_coneccion(\"CIA\");\n\t$lcsqlcmd = \" select sum(nsalesamt - ndesamt + ntaxamt) as nsalestot ,\n\t sum(nbalance) as nbalance\n\t\t\t\t from arinvc\n\t\t\t\t where ccustno = '$pccustno' and\n\t\t\t\t\t\tcstatus = 'OP' \";\n\n\t$lcResult = mysqli_query($oConn,$lcsqlcmd); // $oConn->query($lcSqlCmd);\n\t// convirtiendo estos datos en un array asociativo\n\t$ldata = mysqli_fetch_assoc($lcResult);\n\t// convirtiendo este array en archivo jason.\n\t$jsondata =json_encode($ldata,true);\n\t// retornando objeto json\n\techo $jsondata;\n}", "public function getInsuranceAmount();", "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 getData()\n {\n $this->validate('amount', 'card', 'transactionId');\n $this->getCard()->validate();\n\n $data = array(\n 'apiOperation' => 'PAY',\n 'sourceOfFunds' => array(\n 'type' => 'CARD',\n 'provided' => array(\n 'card' => array(\n 'number' => $this->getCard()->getNumber(),\n 'expiry' => array(\n 'month' => $this->getCard()->getExpiryDate('m'),\n 'year' => $this->getCard()->getExpiryDate('y'),\n ),\n 'securityCode' => $this->getCard()->getCVV(),\n ),\n ),\n ),\n 'transaction' => array(\n 'amount' => $this->getAmount(),\n 'currency' => $this->getCurrency(),\n 'reference' => $this->getTransactionId(),\n ),\n 'order' => array(\n 'reference' => $this->getTransactionId(),\n ),\n 'customer' => array(\n 'ipAddress' => $_SERVER['REMOTE_ADDR'],\n ),\n );\n\n return $data;\n }", "public function sumCashTransactionPerMonths(): array\n {\n $months = ['jan', 'feb', 'mar', 'apr', 'mei', 'jun', 'jul', 'agu', 'sep', 'okt', 'nov', 'des'];\n\n for ($i = 1; $i <= 12; $i++) {\n // Looping dari angka 1-12 karena setiap tahun ada 12 bulan dan menghitung kolom amount\n // berdasarkan bulannya.\n $cashTransactions = $this->model\n ->select('is_paid', 'amount', 'date')\n ->whereMonth('date', \"{$i}\")\n ->whereYear('date', date('Y'))\n ->sum('amount');\n\n $results[$months[$i - 1]] = $cashTransactions;\n }\n\n /**\n * Output yang akan dihasilkan seperti dibawah ini\n * \n * $results = [\n * 'jan' => 10000,\n * 'feb' => 10000,\n * 'mar' => 10000,\n * 'apr' => 10000,\n * 'mei' => 10000,\n * 'jun' => 10000,\n * 'jul' => 10000,\n * 'agu' => 10000,\n * 'sep' => 10000,\n * 'okt' => 10000,\n * 'nov' => 10000,\n * 'des' => 10000\n * ];\n */\n\n return $results;\n }", "public function getcosstotalcourier()\n {\n\t\t $courbudget = 0;\n\t\t$sql = \"SELECT r_costtotal,total_insurance,total_tax FROM \" . self::cTable . \" WHERE act_status = '1' AND con_status= '0' AND payment_status='0' AND username='\" . $this->username . \"'\";\n\t\t$row = self::$db->fetch_all($sql);\n \n foreach ($row as $budget){\n\t\t\treturn $courbudget+= $budget->r_costtotal;\t\n\t\t\t} \n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "public function total_debit()\n\t{\n\t\tif ($this->input->post('katakunci')) {\n\t\t\n\t\t\t$katakunci = $this->input->post('katakunci',true);\t\n\t\t\t$this->db->like('kode_akun',$katakunci);\n\t\t\t$this->db->or_like('bukti_transaksi',$katakunci);\n\t\t\t$this->db->or_like('pos_laporan',$katakunci);\n\t\t\t$this->db->or_like('debit',$katakunci);\n\t\t\t$this->db->or_like('kredit',$katakunci);\n\t\t\t$this->db->or_like('akun',$katakunci);\n\t\t\t$this->db->or_like('keterangan',$katakunci);\n\t\t\n\t\t\t$this->db->select('SUM(debit) as total');\n\t\t\treturn $this->db->get('transaksi')->row()->total;\n\n\t\t\t\n\t\t} elseif ($this->input->post('tanggal_awal')) {\n\t\t\t\n\t\t\t$this->db->where('tanggal_transaksi >=',$this->input->post('tanggal_awal'));\n\t\t\t$this->db->where('tanggal_transaksi <=',$this->input->post('tanggal_akhir'));\n\t\t\t$this->db->select('SUM(debit) as total');\n\t\treturn $this->db->get('transaksi')->row()->total;\n\n\t\t} elseif ($this->input->post('bulan_post') && $this->input->post('tahun_post')) {\n\n\t\t$month = $this->input->post('bulan_post');\n\t\t$tahun = $this->input->post('tahun_post');\n\t\t\n\t\t$this->db->where('month(tanggal_transaksi)',$month);\n\t\t$this->db->where('year(tanggal_transaksi)',$tahun);\n\t\t$this->db->select('SUM(debit) as total');\n\t\treturn $this->db->get('transaksi')->row()->total;\n\n\t\t} elseif ($this->input->post('tahun_post')) {\n\n\t\t$tahun = $this->input->post('tahun_post');\n\t\t\n\t\t$this->db->where('year(tanggal_transaksi)',$tahun);\n\t\t$this->db->select('SUM(debit) as total');\n\t\treturn $this->db->get('transaksi')->row()->total;\n\n\t\t} else {\n\t\t\t$month = date('m');\n\t\t\t$tahun = date('Y');\n\t\t\t$this->db->where('year(tanggal_transaksi)',$tahun);\n\t\t\t$this->db->where('month(tanggal_transaksi)',$month);\n\t\t\t$this->db->select('SUM(debit) as total');\n\t\t\treturn $this->db->get('transaksi')->row()->total;\n\t\t}\n\t\t\n\t}", "function totalAmount_account() {\r\n global $date;\r\n $query = \"SELECT DISTINCT\r\n account AS Account,\r\n (\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'in'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE to_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n -\r\n (\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE acc = Account\r\n AND transaction_type = 'ex'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n +\r\n (\r\n SELECT IFNULL(SUM(amount), 0)\r\n FROM record\r\n WHERE from_acc = Account\r\n AND transaction_type = 'tr'\r\n AND date BETWEEN\r\n (\r\n SELECT MIN(date)\r\n FROM record\r\n ) AND '{$date}'\r\n )\r\n )\r\n ) AS Remain\r\n FROM account;\";\r\n return fetch($query);\r\n }", "function getCreditosComprometidos(){ return $this->getOEstats()->getTotalCreditosSaldo(); }", "function totalAmount_incomeType() {\r\n global $date;\r\n $query = \"SELECT \r\n (\r\n SELECT SUM(amount)\r\n FROM record\r\n WHERE transaction_type = 'in'\r\n AND in_type = 'act'\r\n AND date LIKE '{$date}'\r\n ) AS active,\r\n (\r\n SELECT SUM(amount)\r\n FROM record\r\n WHERE transaction_type = 'in'\r\n AND in_type = 'pas'\r\n AND date LIKE '{$date}'\r\n ) AS passive;\";\r\n return fetch($query, MYSQLI_ASSOC);\r\n }", "public function returnDBTCData($transactions) \n\t{\n\t\t// data: trans_id => transaction info\n\t\t\n\t\t$index = array();\n\t\t$data = array();\n\t\t// Get all transactions for this dbtc\n\n\t\t// setup index of transactions\n\t\tforeach ($transactions as &$trans) {\n\t\t\t$id = $trans[\"dbtc_transaction_id\"];\n\t\t\t$donor_id = $trans[\"dbtc_donor_id\"];\n\t\t\t$data[$id] = $trans; \n\t\t\t$index[$donor_id][] = $id;\n\t\t\n\t\t}\n\t\treturn array(\"dbtc_index\" => $index,\n\t\t\t\t\t \"dbtc_transactions\" => $data, );\n\t}", "function get_transaction_amount()\n {\n // payment_gross depreciated: https://www.x.com/message/168279;jsessionid=194758CBB355AB9E942D506519951253.node0\n //return $this->platnosci_post_vars['payment_gross'];\n return $this->platnosci_post_vars['mc_gross'];\n }", "public function get_total_credit(){\n $sql = \"SELECT * FROM payment WHERE paid_for={$this->id}\";\n $payments = Payment::find_by_sql($sql);\n $total_credits = 0;\n foreach ($payments as $payment) {\n $total_credits += $payment->amount;\n }\n\n return $total_credits;\n }", "public function get_bankcash() {\n\t return $this->db->get(\"tat_finance_bankcash\");\n\t}", "public function getSum()\n {\n $balance = 0;\n\n foreach ($this->getEntries() as $entry) {\n $balance += ($entry->getAmount() * ((double) $entry->getAccount()->getType()->getValue().'1'));\n }\n\n return $balance;\n }", "private function getItemTransactionDetail($transaction_key)\n\t{\n\t\t$data = array();\n\t\t$data['currency'] \t\t\t\t\t= $this->payment_details['currencyCode'];\n\t\t$data['reference_content_id'] \t\t= $this->order_details['id'];\n\t\t$data['invoice_id'] \t\t\t\t= $this->order_details['id'];\n\t\t//$data['item_id'] \t\t\t\t\t= $this->invoice_detail['item_id'];\n\t\t$data['reference_content_table']\t= 'shop_order';\n\t\t$data['status'] \t\t\t\t\t= $this->order_details['order_status'];\n\n\t\t//echo \"<pre>\";print_r($this->order_details);echo \"</pre>\";exit;\n\t\t$total_item_amount\t= $this->payment_amount_details['total_amount'];\n\n\t\t//This is to include the wallet amount (if purchased using both wallet and paypal) while debit from buyer\n\t\tif(!isset($this->wallet_transaction_details['buyer']['amount']))\n\t\t\t$this->wallet_transaction_details['buyer']['amount'] = 0;\n\t\t$buyer_debit_amount = $total_item_amount + $this->wallet_transaction_details['buyer']['amount'];\n\n\t\t$receiver_amount\t= $this->payment_amount_details['seller_amount'];\n\t\t$site_commission\t= $this->payment_amount_details['site_commission'];\n\t\t$credit_to_admin\t= $this->payment_amount_details['credit_to_admin'];\n\t\t$credit_to_seller\t= $this->payment_amount_details['credit_to_seller'];\n\t\t//$receiver_amount\t= $total_item_amount - $site_commission;\n\t\t//echo \"dsds<pre>\";print_r($this->paypal_adaptive_transaction_details);echo \"</pre>\";exit;\n\t\t$payment_type = 'purchase';\n\t\t$site_payment_type = 'purchase_fee';\n\t\tswitch ($transaction_key) {\n\n\t\t\tcase 'BuyerCredit':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Amount credited to wallet account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $total_item_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['buyer_id'];\n\t\t\t\t\t$data['transaction_id']\t\t\t= isset($this->paypal_adaptive_transaction_details['buyer_trans_id'])?$this->paypal_adaptive_transaction_details['buyer_trans_id']:'';\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'BuyerDebit':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Debited amount from paypal account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $buyer_debit_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['buyer_id'];\n\t\t\t\t\t$data['transaction_id']\t\t\t= isset($this->paypal_adaptive_transaction_details['buyer_trans_id'])?$this->paypal_adaptive_transaction_details['buyer_trans_id']:'';\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'SiteCreditFromBuyer':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $site_payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited amount to paypal account from buyer for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_admin;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\t$data['transaction_id']\t\t\t= $this->site_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'SiteDebitSellerAmount':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $site_payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Debited amount from your paypal account to transfer seller amount except site commission for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_seller;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'SellerCreditFromSite':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited amount to your paypal account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_seller;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['seller_id'];\n\t\t\t\t\t$data['transaction_id']\t\t\t= $this->seller_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'ParallelSellerCreditFromBuyer':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited amount to your paypal acccount for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_seller;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->order_details['seller_id'];\n\t\t\t\t\t$data['transaction_id'] \t\t= $this->seller_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'ParallelSiteCreditFromBuyer':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $site_payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Credited site commission amount to paypal account for the order: '.CUtil::setOrderCode($this->order_details['id']);\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $credit_to_admin;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\t$data['transaction_id']\t\t\t= $this->site_transaction_id;\n\t\t\t\t\t$data['paypal_adaptive_transaction_id']\t= isset($this->paypal_adaptive_transaction_details['id'])?$this->paypal_adaptive_transaction_details['id']:'';\n\t\t\t\tbreak;\n\n\t\t\tcase 'PurchaseItem':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'Purchase Item Debit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $receiver_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\n\t\t\t\tbreak;\n\t\t\t//in case of parrallel payment, for buyer there will be 2 debits\n\t\t case 'ParallelBuyerSitePayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'SiteCommission';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ParallelBuyerSitePayment- Debit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $site_commission;//$this->getPaymentInfo('receiver.amount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\t\t\t\tbreak;\n\n\t\t\tcase 'ParallelAuthorPayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'AuthorPayment';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ParallelAuthorPayment - Credit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $receiver_amount;//$this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\tbreak;\n\n\t\t\tcase 'ChainedAuthorPayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'AuthorPayment';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ChainedAuthorPayment - Credit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('receiver.amount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\tbreak;\n\n\t\t\t//in case of chained payment, for seller there will be 1 additional debit\n\t\t\tcase 'ChainedAuthorSitePayment':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'SiteCommission';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'ChainedAuthorSitePayment-Debit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->invoice_detail['item_site_commission'];\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\tbreak;\n\n\t\t\tcase 'SiteCommission':\n\t\t\t\t\t$data['transaction_type']\t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= $payment_type;\n\t\t\t\t\t$data['transaction_notes']\t\t= 'SiteCommission-Credit';\n\t\t\t\t\t$data['related_transaction_id'] = 0;\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->invoice_detail['item_site_commission'];\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');;\n\t\t\t\tbreak;\n\n\t\t\t//\tDebit for seller\n\t\t\tcase 'AuthorRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundPayment';\n\t\t\t\t\t$data['transaction_notes'] \t\t= 'AuthorRefund - Debit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'AuthorPayment', $this->invoice_detail['item_owner_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//\tCredit for buyer\n\t\t\tcase 'BuyerRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundPayment';\n\t\t\t\t\t$data['transaction_notes'] = 'BuyerRefund - Credit';\n\t\t\t\t\t$data['related_transaction_id']\t=$this->getRelativeTransactionId($data['invoice_id'], 'PurchaseItem', $this->invoice_detail['buyer_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'primary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//in case of chained payment, site refund will be to the seller, Credit for seller\n\t\t\tcase 'ChainedSiteRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundSiteFee';\n\t\t\t\t\t$data['transaction_notes'] \t = 'ChainedSiteRefund - Credit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'SiteCommission', $this->invoice_detail['item_owner_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['item_owner_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//in case of parallel payment, site refund will be to the buyer, Credit for buyer\n\t\t\tcase 'ParallelSiteRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Credit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundSiteFee';\n\t\t\t\t\t$data['transaction_notes'] \t= 'ParallelSiteRefund - Credit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'SiteCommission', $this->invoice_detail['buyer_id']);\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= $this->invoice_detail['buyer_id'];\n\t\t\t\t\tbreak;\n\n\t\t\t//in case of site refund for both , site refund will be debit to the admin\n\t\t\tcase 'SiteCommissionRefund':\n\t\t\t\t\t$data['transaction_type'] \t\t= 'Debit';\n\t\t\t\t\t$data['transaction_key'] \t\t= 'RefundSiteFee';\n\t\t\t\t\t$data['transaction_notes'] = 'SiteCommissionRefund - Debit';\n\t\t\t\t\t$data['related_transaction_id']\t= $this->getRelativeTransactionId($data['invoice_id'], 'SiteCommission', Config::get('generalConfig.admin_id'));\n\t\t\t\t\t$data['amount'] \t\t\t\t= $this->getPaymentInfo('refundedAmount', 'secondary');\n\t\t\t\t\t$data['user_id'] \t\t\t\t= Config::get('generalConfig.admin_id');\n\t\t\t\t\tbreak;\n\t\t}\n\t\treturn $data;\n\t}", "public function showAllBalance(){\n $user=Auth::user();\n $userProfit=Buy::where('rev_id',$user->id)->where('finish',1)->sum('buy_price');\n $userPay=Buy::where('user_id',$user->id)->where('finish','!=',2)->sum('buy_price');\n $userCharge=Pay::where('user_id',$user->id)->sum('price');\n $profitDone= Profit::where(\"user_id\",$user->id)->sum(\"profit_price\");\n\n $getWaitProfit=Profit::where(\"user_id\",$user->id)->where(\"status\",0)->sum(\"profit_price\");\n $getDoneProfit=Profit::where(\"user_id\",$user->id)->where(\"status\",1)->sum(\"profit_price\");\n\n $p= $userProfit - $profitDone;\n\n $array= [\n 'user' => $user,\n 'userProfit' => $p,\n 'userPay' => $userPay,\n 'userCharge' => $userCharge,\n 'waitProfit' => $getWaitProfit,\n \"DoneProfit\" => $getDoneProfit\n ];\n return $array;\n\n }", "public function getAmounts(): array{\r\n $amounts = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM amounts')as $key){ $amounts[$key['idamounts']] = $key['amount']; }\r\n return $amounts;\r\n $this->con->closeConnection();\r\n }", "public function getAmountTransfers($id){\n\n $amountWallets = Wallets::select('amount')->where('id',$id)->get();\n\n return $amountWallets[0]->amount;\n \n }", "public function getChargeSum()\n {\n return $this->get(self::CHARGE_SUM);\n }", "public function get_debit_data($i, $object, $highestRow, $worksheet) {\n $tax_debit_value = array();\n $data_arr4 = array();\n for ($j = $i; $j <= $highestRow; $j++) {\n if ($object->getActiveSheet()->getCell('B' . $j)->getValue() == \"Total\") {\n $highestColumn_dr = $worksheet->getHighestColumn($j);\n for ($k = 0; $k < 4; $k++) {\n $a11 = strlen($highestColumn_dr);\n $index1 = strlen($highestColumn_dr) - 1;\n $ord1 = ord($highestColumn_dr[$index1]);\n $a1 = substr($highestColumn_dr, 0, 1);\n $a2 = substr($highestColumn_dr, 1);\n if ($a1 != $a2 and $a2 == \"A\") {\n $ord = ord($highestColumn_dr[1]);\n $index = 1;\n $o1 = ord($a1);\n $o2 = chr($o1 - 1);\n $highestColumn_row_pp = $o2 . \"Z\";\n } else {\n $highestColumn_row_pp = $this->getAlpha($highestColumn_dr, $ord1, $a11, $index1);\n }\n $highestColumn_dr = $highestColumn_row_pp;\n }\n\n $highest_value_without_DR = $highestColumn_dr; //hightest cloumn till where we have to find our data\n $char = 'G';\n while ($char !== $highest_value_without_DR) {\n $values_DR[] = $object->getActiveSheet()->getCell($char . $j)->getValue();\n $char++;\n }\n $cnt = count($values_DR);\n\n//get the value for tax debit value\n\n $data_debit_value_tax = array();\n\n for ($a_dr = 0; $a_dr < $cnt; $a_dr++) {\n $Dr_values = $values_DR[$a_dr];\n $data_debit_value_tax[] = $values_DR[$a_dr];\n }\n\n $aa2 = array();\n for ($a_dr = 1; $a_dr < sizeof($values_DR); $a_dr++) {\n\n if ($a_dr % 5 != 0) {\n\n $aa2[] = $values_DR[$a_dr];\n }\n// var_dump($aa2);\n }\n $a1 = sizeof($aa2);\n $a2 = $a1 % 4;\n $a3 = $a1 - $a2;\n\n for ($k = 0; $k < $a3; $k = $k + 4) {\n $tax_debit_value[] = $aa2[$k] + $aa2[$k + 1] + $aa2[$k + 2] + $aa2[$k + 3];\n }\n\n for ($a_dr = 0; $a_dr < $cnt; $a_dr++) {\n// $Dr_values = $values_DR[$a_dr];\n $data_arr4[] = $values_DR[$a_dr];\n $a_dr = ($a_dr * 1 + 4);\n }\n }\n }\n\n return array($data_arr4, $tax_debit_value);\n }", "public function income($params) {\r\n return $this->request_info('v1/income' , $params );\r\n }", "function get_balance($acc=null,$month=null,$year=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('MONTH(dates)', $month);\n $this->db->where('YEAR(dates)', $year);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "public function get_income_expenditure_report_data($year)\n\t{\n\t\t$this->db->where('td_fee_collection.session', $year);\n\t\t$this->db->select('tb_fin_head.name as name, SUM(td_fee_subfunds.amount) as amount');\n\t\t$this->db->group_by('td_fee_subfunds.fee_head_id');\n\t\t$this->db->order_by('tb_fin_head.name', 'asc');\n\t\t$this->db->from('td_fee_collection');\n\t\t$this->db->join('td_fee_subfunds', 'td_fee_subfunds.fee_id = td_fee_collection.fee_id', 'inner');\n\t\t$this->db->join('tb_fin_head', 'tb_fin_head.id = td_fee_subfunds.fee_head_id', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn $query->result();\n\t}", "function extractTransaction(array $transactionRow): array{\n [$date,$checkNumber,$description, $amount]=$transactionRow;\n $amount=(float)str_replace(['$',','], '',$amount);\n return [\n 'date'=>$date,\n 'checkNumber'=>$checkNumber,\n 'description'=>$description,\n 'amount'=>$amount,\n ];\n}", "public function getBalance()\n {\n return (float)$this->client->requestExecute(\"credit\");\n }", "public function getAmount(): string;", "public function getTotalTransactionsIn()\n\t{\n\t\treturn $this->data['total_transactions_in'];\n\t}", "public function getTransactions();", "public function transactions() {\n if ($this->input->get('view')) {\n $id = $this->myencrypt->decrypt_url($this->input->get('transaction_id'));\n $data['transaction'] = $this->account_model->getTransactions(array('ttransactions.ttransaction_id' => $id));\n } else {\n $mfinancialyear_id = null;\n if ($this->session->has_userdata('financialyear')) {\n $financialyear_data = $this->session->userdata('financialyear');\n $mfinancialyear_id = $financialyear_data['mfinancialyear_id'];\n }\n if ($this->input->get('unlimited')) {\n $data['unlimited'] = true;\n $data['transactions'] = $this->account_model->getTransactions(false, array('mfinancialyear_id' => $mfinancialyear_id));\n } else {\n $data['transactions'] = $this->account_model->getTransactions(FALSE, array('mfinancialyear_id' => $mfinancialyear_id), 10);\n }\n }\n $this->view('transactions', $data);\n }", "public function calculateTransactionalTotals() \n {\n \treturn 2500;\n }", "public function getBalance();", "public function balancesAndInfo()\r\n {\r\n return $this->httpRequest(\"balances-and-info\",\"POST\",[\"wapi\" => true],true);\r\n }", "public function getBaseCredit(){\n return $this->creditAccount->getCredit();\n }", "public function getRechargeSum()\n {\n return $this->get(self::_RECHARGE_SUM);\n }", "public function getAmount()\r\n\t{\r\n\t\treturn $this->getTransaction()->getAmount();\r\n\t}", "public function sum() {\r\n $summedData = 123;\r\n\r\n return $summedData;\r\n }", "public function getData()\n {\n $oUtils = $this->getDataUtils();\n $oConvert = $this->getConverter();\n $aShopData = $this->_getData();\n\n $dError = (double) $this->_calculatePayPalTaxError($aShopData);\n $dHandlingExtra = $dDiscountExtra = 0.0;\n\n if ($dError >= 0.0) {\n $dHandlingExtra = $dError;\n } else {\n $dDiscountExtra = $dError;\n }\n\n return array(\n 'Amount' => array(\n 'Total' => $oConvert->price($oUtils->getArrayValue('Total', $aShopData)),\n 'Currency' => $oConvert->string($oUtils->getArrayValue('Currency', $aShopData), 3),\n ),\n 'Details' => array(\n 'Subtotal' => $oConvert->price($oUtils->getArrayValue('Subtotal', $aShopData)),\n 'Tax' => $oConvert->price($oUtils->getArrayValue('Tax', $aShopData)),\n 'HandlingFee' => $oConvert->price($oUtils->getArrayValue('HandlingFee', $aShopData) + $dHandlingExtra),\n 'Insurance' => $oConvert->price($oUtils->getArrayValue('Insurance', $aShopData)),\n 'Shipping' => $oConvert->price($oUtils->getArrayValue('Shipping', $aShopData)),\n 'ShippingDiscount' => $oConvert->price($oUtils->getArrayValue('ShippingDiscount', $aShopData) + $dDiscountExtra),\n ),\n 'ItemList' => (array) $oUtils->getArrayValue('ItemList', $aShopData),\n );\n }", "public function getCredit(){\n return $this->priceCurrency->convert($this->getBaseCredit());\n }", "public function total_amount()\n {\n $total_price = DB::table('payment_details')\n ->select(DB::raw('SUM(received_amount) as taka'))\n ->get();\n return $total_price;\n }", "public function getAmountSum(Transaction $transaction): Money\n {\n $sum = new Money(0, new Currency($this->baseCurrency));\n\n if (!isset(\n $this->transactionsByUserAndType[$transaction->getUserId()]\n ) || !isset(\n $this->transactionsByUserAndType[$transaction->getUserId()][$transaction->getOperationType()]\n )) {\n return $sum;\n }\n\n foreach ($this->transactionsByUserAndType[$transaction->getUserId()][$transaction->getOperationType(\n )] as $savedTransaction) {\n /** @var Transaction $savedTransaction */\n $converted = $this->converter->convert(\n $savedTransaction->getAmount(),\n $sum->getCurrency()\n );\n $sum = $sum->add($converted);\n }\n\n return $sum;\n }", "public function gettransaction($transaction){\n return $this->bitcoin->gettransaction($transaction);\n }", "public function getBalance()\n {\n return Cash::orderBy('id', 'desc')\n ->value('solde');\n }", "public function getTransaction();", "private function transactions()\n {\n $invoiceModel = new InvoiceModel();\n $transactions = $invoiceModel->getAllInvoices();\n\n $csvData = [];\n $csvData[] = [\"Invoice ID\", \"Company Name\", \"Invoice Amount\"];\n if (!empty($transactions)) {\n foreach ($transactions as $transaction) {\n $csvData[] = [$transaction[\"id\"], $transaction[\"client\"], $transaction[\"invoice_amount_plus_vat\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"transactions_\" . time() . \".csv\");\n }", "protected function _getTransactionData() {\n\n $data = array();\n\n $request = $this->getRequest();\n $module = $request->getModuleName();\n $controller = $request->getControllerName();\n\n if($module == 'checkout' || $module == 'checkout' && $controller == 'cart' && $action == 'index') {\n return $this->_getTransactionDataCart();\n }else if($controller == 'index' && $this->isHomepage()) {\n return $this->_getPageData('home');\n }else if($controller == 'product') {\n return $this->_getProductData();\n }else if(Mage::registry('current_category')) {\n return $this->_getCategoryDataContent('category');\n }else if(Mage::registry('current_landingpage')) {\n return $this->_getPageData('landingpage');\n }else if($controller == 'result') {\n return $this->_getSearchResultsData('searchresults');\n }else if($controller == 'account') {\n return $this->_getCustomerPage('account');\n }else if($module == 'cms' && $controller == 'page') {\n return $this->_getPageData('institucional');\n }\n\n return $data;\n }", "public function getData()\n {\n $this->validate('amount', 'customerId', 'numberLastFour', 'brand');\n\n return [\n 'amount' => $this->getAmount(),\n 'customer_id' => $this->getCustomerId(),\n 'transaction_type' => 'sale',\n 'card_last_four' => $this->getNumberLastFour(),\n 'card_brand' => $this->getBrand(),\n 'card_token' => $this->getToken()\n ];\n }", "public function get_wallet_amount($id){\n $query = $this->db->select('sum(09_effective_balance) as amount')->where('01_id', $id)->get('wallet_09');\n if($query){\n $amt = $query->row_array();\n return $amt['amount'];\n }else{\n return false;\n }\n }", "public function getCreditRuleData()\n {\n return $this->_helper->calculateCreditAmountforCart();\n }", "function returnCashBalance($date, $verbose = false, $debug = false){\n $dbc = connect();\n $stmt = $dbc->prepare(\"SELECT SUM(`amount`) AS balance FROM `data_transactions`\n WHERE `transaction_date` <= :transaction_date\");\n $stmt->bindParam(':transaction_date', $date);\n $stmt->execute();\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n if ($verbose) show('cash balance as of '.$date.' is '. $result['balance']);\n return $result['balance'];\n}", "public function sumar_transacciones($account_id, $tabla) {\n $this->db->select('SUM(amount) as ingresos');\n\t\t$this->db->from($tabla);\n\t\t$this->db->where('account_id', $account_id);\n\t\t$this->db->where('status', 'approved');\n\t\t$query = $this->db->get();\n\t\t\n return $query->result();\n }", "function get_tax_cash_summary($from, $to)\n{\n\n $sql = \"SELECT SUM(gross_output) gross_output,\n SUM(net_output) net_output,\n SUM(payable) payable,\n SUM(gross_input) gross_input,\n SUM(net_input) net_input,\n SUM(collectible) collectible,\n rate,\n id,\n name\n FROM (\".tax_cash_sql($from, $to).\") taxrec\n GROUP BY id, name, rate\";\n//display_error($sql);\n return db_query($sql,\"Cannot retrieve tax summary\");\n}", "private function getCashTotals($account_id, $jwt_token) {\n $res = $this->doRequest($this->base_URL.'v2/account-cash-totals?account.id='.$account_id, 'get', [], $jwt_token, 'Bearer');\n\n return json_decode($res)->data[0]->attributes;\n }", "public function getOpdInvoiceCalculation(Request $request)\n {\n $invoice = trim($request->invoice);\n // get patient id by invoice\n $bill_tr_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->get();\n $total_payable = 0 ;\n $total_payment = 0 ;\n $total_discount = 0 ;\n $total_rebate = 0 ;\n foreach ($bill_tr_info as $bill_tr_info_value) {\n $total_payable = $total_payable + $bill_tr_info_value->total_payable ;\n $total_payment = $total_payment + $bill_tr_info_value->total_payment ;\n $total_discount = $total_discount + $bill_tr_info_value->total_discount ;\n $total_rebate = $total_rebate + $bill_tr_info_value->total_rebate ; \n }\n $all_discount_rebate = $total_discount + $total_rebate ;\n $net_payable_is = $total_payable - $all_discount_rebate ;\n $due_amount = $net_payable_is - $total_payment ;\n echo $total_payable.'/'.$due_amount ;\n }", "public function getTransactionAmount()\n {\n return $this->transactionAmount;\n }", "public function index()\n {\n //\n $categories=Category::get();\n $transactions= auth()->user()->getTransactionByDate();\n $total_expense= auth()->user()->getTodayExpense();\n $total_income = auth()->user()->getTodayIncome();\n $net_total=$total_expense-$total_income;\n $totals=[\n 'total_expense'=>$total_expense,\n 'total_income' =>$total_income,\n 'net_total' =>$net_total\n ];\n return view('transaction.index',compact('transactions','categories','totals'));\n }", "public function getAmount(): float;", "public static function getSalePerDay($i,$month,$year,$branch)\n {\n $str = $i. '-' . $month . '-' . $year;\n $date = date('Y-m-d', strtotime($str));\n $data = DB::table('month_sales')->where('branch_id', $branch)->where('_date', $date)->first();\n\n $with_receipt_total = 0;\n $with_out_receipt_total = 0;\n $credit_total = 0;\n $expense_total = 0;\n $return_total = 0;\n $total_amount = 0;\n $taken_total = 0;\n $deposit_total = 0;\n $is_check = 2;\n $coh = 0;\n\n\n $expense_string = '';\n $firstRec ='' ;\n $lastRec ='' ;\n\n $number_of_check = 0;\n\n if($data != null){\n $json_data = json_decode($data->data,TRUE);\n\n\n $rec_no = [];\n foreach ($json_data['with_receipt'] as $key => $val){\n $total =0;\n if($val['rec_amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['rec_amount'];\n }\n $with_receipt_total = $with_receipt_total + $total ;\n array_push($rec_no,$val['rec_no']);\n\n $number_of_check = $number_of_check + (isset($val['is_check']) ? 1 : 0 );\n }\n\n $firstRec = $rec_no[0];\n $lastRec = $rec_no[count($rec_no) - 1];\n\n foreach ($json_data['without_receipt'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $with_out_receipt_total = $with_out_receipt_total + $total ;\n }\n foreach ($json_data['credit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $credit_total = $credit_total + $total ;\n }\n foreach ($json_data['expense'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $expense_total = $expense_total + $total ;\n\n $expense_string .= $val['details'].' ';\n\n }\n foreach ($json_data['return'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $return_total = $return_total + $total ;\n }\n\n\n $amount_1000 = ($json_data['amount_1000'] != null) ? json_decode($data->data,TRUE)['amount_1000'] * 1000 : 0;\n $amount_500 = ($json_data['amount_500'] != null) ? json_decode($data->data,TRUE)['amount_500'] * 500 : 0;\n $amount_100 = ($json_data['amount_100'] != null) ? json_decode($data->data,TRUE)['amount_100'] * 100 : 0;\n $amount_50 = ($json_data['amount_50'] != null) ? json_decode($data->data,TRUE)['amount_50'] * 50 : 0;\n $amount_20 = ($json_data['amount_20'] != null || json_decode($data->data,TRUE)['amount_20'] != '') ? json_decode($data->data,TRUE)['amount_20'] * 20 : 0;\n $amount_coins = ($json_data['amount_coins'] != null) ? json_decode($data->data,TRUE)['amount_coins'] : 0;\n $total_amount = $amount_1000 + $amount_500 + $amount_100 + $amount_50 +$amount_20+ $amount_coins;\n $is_check = (isset($json_data['is_check'])) ? json_decode($data->data,TRUE)['is_check'] : $is_check;\n $coh = (isset($json_data['coh'])) ? json_decode($data->data,TRUE)['coh'] : $coh;\n\n foreach (json_decode($data->data,TRUE)['taken'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $taken_total = $taken_total + $total ;\n }\n foreach (json_decode($data->data,TRUE)['deposit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $deposit_total = $deposit_total + $total ;\n }\n\n }\n\n\n $_data =[\n 'with_receipt_total' =>$with_receipt_total,\n 'with_out_receipt_total' =>$with_out_receipt_total,\n 'credit_total' =>$credit_total,\n 'expense_total' =>$expense_total,\n 'return_total' =>$return_total,\n 'amount_total' =>$total_amount,\n 'taken_total' =>$taken_total,\n 'deposit_total' =>$deposit_total,\n 'data' =>($data != null) ? $data->data : '',\n 'date' =>$date,\n 'is_check'=>$is_check,\n 'coh'=>$coh,\n 'expense_details'=>$expense_string,\n 'rec_no'=>$firstRec.'-'.$lastRec,\n 'number_of_check' =>$number_of_check\n\n\n ];\n\n\n return json_encode($_data);\n\n }", "public function transferBalance($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n \n $currentDate = $this->getAppService()->getDate();\n //Check Request\n if ($post['type'] == 'debit') {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n \n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if (($localUserData['avaiPurchaseBal'] - $this->signupBal) >= $post['balance']) {\n //generate bal request code\n $transferCodeMatch = true;\n while ($transferCodeMatch == true) {\n \n $transferCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($transferCode);\n if (count($getUserInfo) == 0) {\n $transferCodeMatch = false;\n }\n }\n try {\n //set transfer code\n $updateUserData = array (\n 'balReqCode' => $transferCode,\n 'balReq' => $post['balance']\n );\n $this->getUserModel()->updateUser($localUserData['Id'], $updateUserData);\n \n //set notification message\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$post['balance'].'.Code :'.$transferCode,\n 'date' => $this->getAppService()->getDateTime()\n );\n $this->getNotificationModel()->createNotification($notificationData);\n \n $response['status'] = 'success';\n $response['message'] = 'Transfer code send successfully.';\n $response['bal'] = $userData['avaiTransBal'];\n \n } catch (\\Exception $e) {\n $response['status'] = 'error';\n $response['message'] = 'Something went wrong : Please try agaign.';\n }\n \n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient balance.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getUserByPhoneNo($post['phoneNo']);\n //Transfer credit Balance\n if ($userData['avaiTransBal'] >= $post['balance']) {\n if (count($localUserData) > 0) {\n if ($localUserData['accountStatus'] == 'Active') {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n if ($localUserData['userRoll'] == 'local') {\n $localUser = array (\n 'avaiPurchaseBal' => $post['balance'],\n 'totalWinBal' => 0,\n );\n //Update Local user balance.\n $this->getUserModel()->updateUserBal($localUserData['Id'],$localUser);\n \n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Receive chips : '.$post['balance'],\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n } else {\n //check date records exist if not then create new if Yes then use Id\n $getLocalTicketDate = $this->getTicketDateModel()->getTicketDate($localUserData['Id'],$currentDate);\n \n if (count($getLocalTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $localUserData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $localUserData['avaiTransBal'],\n );\n\n $getLocalDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $localDateId = $getLocalDateEntity->Id;\n } else {\n $localDateId = $getLocalTicketDate['Id'];\n }\n $localUser = array (\n 'avaiTransBal' => $localUserData['avaiTransBal'] + $post['balance'],\n );\n //Update Local user balance.\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n \n $transactionData = array (\n 'dateId' => $localDateId,\n 'userId' => $userData['Id'],\n 'agentId' => $localUserData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n }\n \n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] - $post['balance'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n \n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Credit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n \n $response['status'] = 'success';\n $response['message'] = 'Chips transfer successfully.';\n $response['bal'] = $userData['avaiTransBal'] - $post['balance'];\n\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = $e->getMessage();//'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'you do have not efficient balance.';\n }\n }\n return $response;\n }", "function usdt_bal()\n{\n try {\n require_once app_path('jsonRPCClient.php');\n $bitcoin_username = owndecrypt(get_wallet_keydetail('USDT', 'XDC_username'));\n $bitcoin_password = owndecrypt(get_wallet_keydetail('USDT', 'XDC_password'));\n $bitcoin_portnumber = owndecrypt(get_wallet_keydetail('USDT', 'portnumber'));\n $bitcoin_host = owndecrypt(get_wallet_keydetail('USDT', 'host'));\n $bitcoin = new jsonRPCClient(\"http://$bitcoin_username:$bitcoin_password@$bitcoin_host:$bitcoin_portnumber/\");\n\n if ($bitcoin) {\n $address_list = $bitcoin->omni_getwalletbalances();\n $bal = 0;\n if ($address_list) {\n foreach ($address_list as $list) {\n if ($list['propertyid'] == 31) {\n $bal = $list['balance'];\n }\n }\n }\n\n return $bal;\n }\n\n } catch (\\Exception $exception) {\n return 0;\n }\n}", "public function getTotal()\n {\n return ($this->amount + $this->tax_amount)* $this->currency_converter;\n }", "public function getUserTotalPaid()\n {\n $user = getUser();\n $w = self::where('type', 'credit')->where('user_id', $user->id);\n return $w->sum('amount');\n }", "function bitfinex_get_total_usd_value($key, $secret) {\n $balances = bitfinex_get_balances($key, $secret);\n $_total = 0;\n foreach ($balances as $balance) {\n if ($balance->currency == 'usd') {\n $_total += doubleval($balance->amount);\n }\n }\n return $_total;\n}", "public function getQuoteData()\n {\n $quote= Mage::getSingleton('checkout/session')->getQuote();\n $data = array();\n if ($quote) {\n $data['checkoutId'] = $quote->getId();\n $data['currency'] = $quote->getQuoteCurrencyCode();\n $data['total'] = Mage::helper('affirm/util')->formatCents($quote->getGrandTotal());\n }\n return $data;\n\n }", "function list_transactions($ucid,$db)\n{\n $s= \" select * from transactions where ucid='$ucid' \";\n //secures the connection or it dies.\n ($t=mysqli_query($db,$s)) or die(mysqli_error($db));\n //Loop to connect reteve all the data from the table for the user.\n while( $r=mysqli_fetch_array($t,MYSQLI_ASSOC)){\n $timestamp=$r[\"timestamp\"];\n $account =$r[\"account\"];\n $amount=$r[\"amount\"];\n $amountAfter = money_format ('%=#1.2n', $amount).\"\\n\";\n //Prints out the ucid, account number, amount and timestamp.\n echo \"<b>ucid: $ucid ||\";\n echo \" account: $account ||\";\n echo \" amount: $amountAfter ||\";\n echo \" timestamp: $timestamp<br>\"; \n } \n}", "public function getTransactions()\n\t{\n\t\treturn $this->data['transactions'];\n\t}", "function getTotalWithdrew($useSymbols = false)\n{\n return cache()->remember('i.totalWithdrew.useSymbols-' . ($useSymbols ? 'y' : 'n'), getCacheILifetime('totalWithdrew'), function () use ($useSymbols) {\n $totalWithdrew = [];\n $currencies = getCurrencies();\n\n foreach ($currencies as $currency) {\n $amount = \\App\\Models\\Transaction::join('transaction_types', function ($join) {\n $join->on('transactions.type_id', '=', 'transaction_types.id');\n });\n\n $amount = $amount->where('transaction_types.name', 'withdraw')\n ->where('transactions.approved', 1)\n ->where('transactions.currency_id', $currency['id'])\n ->sum('amount');\n\n $arrayKey = true === $useSymbols ? $currency['symbol'] : $currency['code'];\n\n if (!isset($totalWithdrew[$arrayKey])) {\n $totalWithdrew[$arrayKey] = 0;\n }\n\n $totalWithdrew[$arrayKey] += round($amount, $currency['precision']);\n }\n return $totalWithdrew;\n });\n}", "function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}", "function transact_num() {\r\n global $date;\r\n $query = \"SELECT DISTINCT\r\n (\r\n SELECT COUNT(*)\r\n FROM record\r\n WHERE transaction_type = 'ex'\r\n AND date = '{$date}'\r\n ) AS expense,\r\n (\r\n SELECT COUNT(*)\r\n FROM record\r\n WHERE transaction_type = 'in'\r\n AND date = '{$date}'\r\n ) AS income\r\n FROM record\r\n WHERE date = '{$date}';\";\r\n return fetch($query);\r\n }", "public function getData()\n {\n $this->validate('transactionReference', 'amount');\n\n $data = $this->getBaseData();\n $data['METHOD'] = 'DoCapture';\n $data['AMT'] = $this->amount;\n $data['CURRENCYCODE'] = $this->currency;\n $data['AUTHORIZATIONID'] = $this->transactionReference;\n $data['COMPLETETYPE'] = 'Complete';\n\n return $data;\n }", "public function get_transactions(){\n $this->load->database();\n\n $query = $this->db->select('type,is_of,date,amount,payment_mode,id')\n ->get('tbl_transactions');\n return $query->result_array();\n }", "function total_price($totals){\n $sum = 0;\n $sub = 0;\n foreach($totals as $total ){\n $sum += $total['total_saleing_price'];\n $sub += $total['total_buying_price'];\n $profit = $sum - $sub;\n }\n return array($sum,$profit);\n}", "function bitfinex_get_total_coin_value($key, $secret) {\n $balances = bitfinex_get_balances($key, $secret);\n $_total = 0;\n foreach ($balances as $balance) {\n if ($balance->currency == 'btc') {\n $_total += doubleval($balance->amount);\n }\n }\n return $_total;\n}", "public function user_transaction($user_id, $trans_type) {\n\t\t$matchArr=array('$match' => array('user_id' =>MongoID($user_id)));\n\t\t$unwindArr=array('$unwind' =>'$transactions');\n\t if($trans_type=='debit') {\n\t\t\t $matchArrsend=array('$match' => array('transactions.type' =>'DEBIT'));\n\t\t\t $option = array(array('$project' => array(\n\t\t\t\t\t\t\t\t\t\t\t'user_id' =>1,\n\t\t\t\t\t\t\t\t\t\t\t'transactions'=>1,\n\t\t\t\t\t\t\t\t\t\t\t'total' =>1\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t$matchArr,\n\t\t\t\t\t\t\t\t\t$unwindArr,\n\t\t\t\t\t\t\t\t\t$matchArrsend\n\t\t\t\t\t\t\t);\n\t } else if($trans_type=='credit') {\n\t\t\t $matchArrsend=array('$match' => array('transactions.type' =>'CREDIT'));\n\t\t\t $option = array(array('$project' => array(\n\t\t\t\t\t\t\t\t\t\t\t'user_id' =>1,\n\t\t\t\t\t\t\t\t\t\t\t'transactions'=>1,\n\t\t\t\t\t\t\t\t\t\t\t'total' =>1\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t$matchArr,\n\t\t\t\t\t\t\t\t\t$unwindArr,\n\t\t\t\t\t\t\t\t\t$matchArrsend\n\t\t\t\t\t\t\t);\n\t } else {\n\t $option = array(array('$project' => array(\n\t\t\t\t\t\t\t\t\t\t'user_id' =>1,\n\t\t\t\t\t\t\t\t\t\t'transactions'=>1,\n\t\t\t\t\t\t\t\t\t\t'total' =>1\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t$matchArr,\n\t\t\t\t\t\t\t\t$unwindArr\n\t\t\t\t\t\t\t);\n\t }\n\t $res = $this->mongo_db->aggregate(WALLET, $option);\n return $res;\n }", "public function getTransactions(){\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions t JOIN products p ON p.Product_ID = t.Product_ID;\");\r\n $stmt->execute();\r\n $purchases = $stmt->fetchAll (PDO::FETCH_ASSOC);\r\n\r\n $stmt = $this->DB->prepare(\"SELECT * FROM transactions WHERE Transaction_Type='DONATION';\");\r\n $stmt->execute();\r\n $donations = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n return array_merge($purchases,$donations);\r\n }", "public function merchantTransaction(Request $request) {\n \n $input = $request->all();\n //echo \"<pre>\";\n //print_r($input); exit;\n \n $mobileNumber = $input['mobile_number'];\n $amount = $input['amount'];\n \n if( isset( $mobileNumber ) && !empty( $mobileNumber ) ) {\n $billBalanceAmt = $usrTransAmt = $usrPoint = 0;\n $userDetail = new UserDetail();\n $mobileNoExists = $userDetail->checkUserMobileNoExists( $mobileNumber );\n\n //echo \"<pre>\";\n //print_r($mobileNoExists); exit;\n\n if( isset( $mobileNoExists ) && !empty( $mobileNoExists ) ) {\n \n $response = array();\n $getUserDetail = new RedeemCode();\n $userDetails = $getUserDetail->getUserTransactionDetails( $input );\n \n //echo \"<pre>\";\n //print_r($userDetails); exit;\n\n $merZoinPoint = $userDetails[0]->merBalance;\n $zoinPoint = $userDetails[0]->zoin_point;\n $maxBillAmt = $userDetails[0]->max_bill_amount;\n $maxCheckIn = $userDetails[0]->max_checkin;\n \n $getUserTransactions = new Transaction();\n $usrTransAmt = $getUserTransactions->getUserTransactions( $userDetails );\n \n //$loyaltyBalance = new LoyaltyBalance();\n //$usrBalanceAmt = $loyaltyBalance->checkLoyaltyBalance( $userDetails );\n $usrBalanceAmt = ( isset( $userDetails[0]->user_balance ) && !empty( $userDetails[0]->user_balance ) ? $userDetails[0]->user_balance : 0);\n if( isset( $usrBalanceAmt ) && !empty( $usrBalanceAmt ) ) {\n $usrTransAmt = $usrTransAmt + $usrBalanceAmt; \n }\n \n $usrBillAmt = $amount;\n if( isset( $usrTransAmt ) && !empty( $usrTransAmt ) ) { \n $usrBillAmt = $usrTransAmt + $amount;\n }\n \n //echo $usrBillAmt; exit;\n\n $zoinPoints = $usrBillAmt / $maxBillAmt;\n $zoinPointVal = (int) $zoinPoints;\n \n //$usrPoint = $zoinPointVal * $zoinPoint;\n $usrPoint = $zoinPoint;\n \n if($merZoinPoint > 0) {\t\n \n if( $merZoinPoint > $usrPoint) {\n\n $getTransactions = new Transaction();\n $transaction_id = $getTransactions->saveNewTransaction( $input, $amount );\n \n $userIncrement = new RedeemCode();\n $usrCheckIn = $userIncrement->getUserCheckInIncrement( $input );\n \n $getTransactionRecords = new Transaction();\n $transactionRecords = $getTransactionRecords->getTransactionDetails( $transaction_id );\n\n /* echo \"<pre>\";\n print_r($transactionRecords);\n exit; */\n\n $notifiDetailSave = new Notification();\n $notifiDetailSave->saveTransactionNotification( $transactionRecords );\n\n if( $usrBillAmt >= $maxBillAmt && $usrCheckIn >= $maxCheckIn ) {\n \n // $billBalAmt = $usrBillAmt % $maxBillAmt; //Balance Amount\n\n $loyaltyUser = new LoyaltyBalance();\n $existUser = $loyaltyUser->checkLoyaltyBalance( $userDetails ); \n \n if( empty( $existUser ) ) {\n $saveLoyaltyBalance = new LoyaltyBalance();\n $saveLoyaltyBalance->saveUserLoyaltyBalance( $userDetails );\n }\n\n $loyaltyMerchant = new LoyaltyBalance();\n $existMerchant = $loyaltyMerchant->checkMerchantLoyaltyBalance( $userDetails ); \n \n if( empty( $existMerchant ) ) {\n $saveLoyaltyBalance = new LoyaltyBalance();\n $saveLoyaltyBalance->saveMerchantLoyaltyBalance( $userDetails );\n }\n \n $getUsrBalance = new ZoinBalance();\n $usrTotAmt = $getUsrBalance->getUserBalance( $userDetails );\n \n if( isset( $usrTotAmt ) && !empty( $usrTotAmt ) ) {\n \n DB::table('zoin_balance')->where('vendor_or_user_id', $userDetails[0]->user_id)->increment('zoin_balance', $usrPoint);\n \n } else {\n \n $userDetailSave = new ZoinBalance(); \n $userDetailSave->vendor_or_user_id = $userDetails[0]->user_id; \n $userDetailSave->zoin_balance = $usrPoint;\n $userDetailSave->save(); \n }\n\n $billBalanceAmt = $usrBillAmt - $maxBillAmt; //Balance Amount\n if( isset( $billBalanceAmt ) && !empty( $billBalanceAmt ) ) {\n //$saveUserBalance = new LoyaltyBalance();\n //$saveUserBalance->userLoyaltyBalanceIncrement( $userDetails[0]->user_id, $billBalanceAmt );\n $saveUserBalance = new RedeemCode();\n $saveUserBalance->userLoyaltyBalanceIncrement( $userDetails, $billBalanceAmt );\n } else {\n $saveUserBalDec = new RedeemCode();\n $saveUserBalDec->userLoyaltyBalanceDecrement( $userDetails, $billBalanceAmt );\n }\n \n //Zoin Merchant Balance reduce\n DB::table('zoin_balance')->where('vendor_or_user_id', $userDetails[0]->vendor_id)->decrement('zoin_balance', $usrPoint);\n\n $notifiDetailSave = new Notification();\n $notifiDetailSave->saveUserPointNotification( $userDetails[0]->vendor_id, $userDetails[0]->user_id, $usrPoint, $transactionRecords['transaction_id'] );\n\n $notifiDetailsSave = new Notification();\n $notifiDetailsSave->saveMerchantPointNotification( $userDetails[0]->vendor_id, $userDetails[0]->user_id, $usrPoint, $transactionRecords['transaction_id'] );\n\n DB::table('transactions')->where(['vendor_id' => $userDetails[0]->vendor_id])->where(['user_id' => $userDetails[0]->user_id])->where(['loyalty_id' => $userDetails[0]->loyalty_id])->update( ['status'=> Config::get('constant.NUMBER.ONE') ] );\n DB::table('loyalty_balance')->where('user_id', $userDetails[0]->user_id)->increment('claimed_loyalty');\n DB::table('loyalty_balance')->where('vendor_id', $userDetails[0]->vendor_id)->increment('claimed_loyalty');\n\n if( $usrCheckIn >= $maxCheckIn ) {\n \n $balCheckIn = $usrCheckIn - $maxCheckIn; //Balance Checkin \n // DB::table('loyalty_balance')->where(['user_id' => $userDetails[0]->user_id])->update( ['total_loyalty'=> $balCheckIn ] ); \n DB::table('redeem_code')->where(['vendor_id' => $userDetails[0]->vendor_id])->where(['user_id' => $userDetails[0]->user_id])->where(['loyalty_id' => $userDetails[0]->loyalty_id])->update( ['user_checkin'=> $balCheckIn ] ); \n }\t\n \n $this->__getUserResponseDetails( $userDetails, $usrBillAmt );\n $response['transaction_id'] = $transactionRecords['transaction_id'];\n $response['message'] = $this->printTransanctionCompleted();\n return response()->json(['success' => $this->successStatus, 'message' => $response ], $this->successStatusCode );\n \n } else {\n \n $this->__getUserResponseDetails( $userDetails, $usrBillAmt );\n $response['transaction_id'] = $transactionRecords['transaction_id'];\n $response['message'] = $this->printTransanctionCompleted();\n return response()->json(['success' => $this->successStatus, 'message' => $response ], $this->successStatusCode );\n \n }\n \n } else {\n //echo \"Merchant Point is not enough\";\n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMerchantPoint() ], $this->failureStatusCode );\n }\n } else {\n //echo \"Merchant Balance is not enough\";\n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMerchantBalance() ], $this->failureStatusCode );\n }\n\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 }", "static function getServiceBal($connection){\r\n //get balance\r\n $accno = $_SESSION['accno'];\r\n\r\n $sql = \"SELECT balance FROM _accounts WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n $statement->execute(array(':account'=>$accno));\r\n $row = $statement->fetchall();\r\n\r\n $balance = \"\";\r\n foreach ($row as $key => $value) {\r\n $balance = $value['balance'];\r\n }\r\n return $balance;\r\n }", "public function getData($key = '', $index = null)\n {\n $this->_castAmount('fee_amount', 'fee_debit_or_credit');\n $this->_castAmount('gross_transaction_amount', 'transaction_debit_or_credit');\n return parent::getData($key, $index);\n }", "public function getData($key = '', $index = null)\n {\n $this->_castAmount('fee_amount', 'fee_debit_or_credit');\n $this->_castAmount('gross_transaction_amount', 'transaction_debit_or_credit');\n return parent::getData($key, $index);\n }", "public function getUnitAmount();", "public function DoTransaction(){\t\t\n\t\tif($this->IsLoggedIn('cashier')){\t\t\t\n\t\t\tif(isset($_POST) && !empty($_POST)){\n\t\t\t\t$customer_id = $_POST['txn_data']['txn_customer_id'];\t\t\t\t\t\t\t\n\t\t\t\t$count=1;\n\t\t\t\tforeach($_POST['cart_data'] as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif($key){\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// end\n\t\t\t\t$business_admin_id = $this->session->userdata['logged_in']['business_outlet_id'];\n\t\t\t\t$result = $this->CashierModel->BillingTransaction($_POST,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n\n\t\t\t\tif($result['success'] == 'true'){\n\t\t\t\t\t$transcation_detail = $this->CashierModel->GetBilledServicesByTxnId($result['res_arr']['res_arr']['insert_id']);\n\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_id'] = $result['res_arr']['res_arr']['insert_id'];\n\t\t\t\t\t$cart_data['outlet_admin_id'] = $business_admin_id;\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_time'] = $transcation_detail['res_arr'][0]['txn_datetime'];\n\t\t\t\t\t$cart_data['cart_data'] = json_encode($_POST['cart_data']);\n\t\t\t\t\t$cart_detail = $this->CashierModel->Insert($cart_data,'mss_transaction_cart');\n\t\t\t\t\tif($cart_detail['success'] == 'true'){\n\t\t\t\t\t\t$this->session->set_userdata('loyalty_point',$transcation_detail['res_arr'][0]['txn_loyalty_points']);\n\t\t\t\t\t\t$this->session->set_userdata('cashback',$transcation_detail['res_arr'][0]['txn_loyalty_cashback']);\n\t\t\t\t\t\t$detail_id = $cart_detail['res_arr']['insert_id'];\n\t\t\t\t\t\t$bill_url = base_url().\"Cashier/generateBill/$customer_id/\".base64_encode($detail_id);\n\t\t\t\t\t\t$bill_url = str_replace(\"https\", \"http\", $bill_url);\n\t\t\t\t\t\t$bill_url = shortUrl($bill_url);\n\t\t\t\t\t}\n\n\t\t\t\t\t//1.Unset the payment session\n\t\t \t\t\tif(isset($this->session->userdata['payment'])){\n\t\t \t\t\t\t$this->session->unset_userdata('payment');\n\t\t\t\t\t }\n\t\t\t\t\t //j\n\t\t\t\t\t //Memebership Package Loyalty Calculation\n if(isset($this->session->userdata['cart'][$customer_id]))\n { \n $data = $this->CashierModel->GetCustomerPackages($customer_id);\n if($data['success'] == 'false')\n {\n // $this->PrettyPrintArray(\"Customer Does not have special membership\");\n }\n else{\n if(!empty($data['res_arr']))\n {\n if(isset($this->session->userdata['cart'][$customer_id]))\n {\n $curr_sess_cart = $this->session->userdata['cart'][$customer_id];\n $cart_data = array();\n $i = 0;\n $j = 0;\n $total_product = 0;\n $total_points = 0;\n for($j;$j<count($curr_sess_cart);$j++)\n {\n $service_details = $this->CashierModel->DetailsById($curr_sess_cart[$j]['service_id'],'mss_services','service_id');\n if(isset($service_details['res_arr']))\n {\n // print_r($service_details['res_arr']);\n if($service_details['res_arr']['service_type'] == 'otc')\n {\n $total_product += $curr_sess_cart[$j]['service_total_value'];\n $total_points+= ($curr_sess_cart[$j]['service_total_value']*$data['res_arr'][$i]['service_discount'])/100;\n $curr_sess_cart[$j] += ['service_discount'=>$data['res_arr'][$i]['service_discount']];\n \n array_push($cart_data,$curr_sess_cart[$j]);\n // array_push($cart_data,$data['res_arr'][$i]['service_discount']);\n }\n }\n }\n \n if(!empty($cart_data))\n {\n foreach($cart_data as $key=>$value)\n {\n }\n }\n $update = array(\n 'total_points' => $total_points,\n 'txn_id' => $result['res_arr']['res_arr']['insert_id'],\n 'customer_id' => $customer_id\n );\n $result_2 = $this->CashierModel->SpecialLoyaltyPoints($update,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n // $this->PrettyPrintArray($cart_data);\n // exit;\n }\n }\n \n }\n \n }\n\t\t\t\t\t //end\n \n // 2.Then unset the cart session\n\t\t \t\t\tif(isset($this->session->userdata['cart'][$customer_id])){\n\t\t \t\t\t\t$curr_sess_cart_data = $this->session->userdata['cart'];\n\t\t \t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t \t\t\t\t$this->session->set_userdata('cart',$curr_sess_cart_data);\n\t\t \t\t\t}\n if(isset($this->session->userdata['recommended_ser'][$customer_id])){\n\t\t\t\t\t\t$curr_sess_cart_data = $this->session->userdata['recommended_ser'];\n\t\t\t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t\t\t\t\t$this->session->set_userdata('recommended_ser',$curr_sess_cart_data);\n\t\t\t\t\t}\n\t\t\t\t\t//3.Then unset the customer session from POS\n\t\t \t\t\tif(isset($this->session->userdata['POS'])){\n\t\t \t\t\t\t$curr_sess_cust_data = $this->session->userdata['POS'];\n\t\t \t\t\t\t\n\t\t \t\t\t\t$key = array_search($customer_id, array_column($curr_sess_cust_data, 'customer_id'));\n\t\t \t\t\t\t\n\t\t \t\t\t\tunset($curr_sess_cust_data[$key]);\n\t\t \t\t\t\t$curr_sess_cust_data = array_values($curr_sess_cust_data);\n\t\t \t\t\t\t\n\t\t \t\t\t\t$this->session->set_userdata('POS',$curr_sess_cust_data);\n\t\t \t\t\t}\n\n\t\t \t\t\t//These 2 call will be used for the further enhancement of message sending architecture.\n\t\t \t\t\t$outlet_details = $this->GetCashierDetails();\n\t\t\t\t\t$customer_details = $this->GetCustomerBilling($_POST['customer_pending_data']['customer_id']);\n\t\t\t\t\t//4.Send a msg\n\t\t\t\t\t$this->session->set_userdata('bill_url',$bill_url);\n\t\t\t\t\t$sms_status = $this->db->select('*')->from('mss_business_outlets')->where('business_outlet_id',$this->session->userdata['logged_in']['business_outlet_id'])->get()->row_array();\n\t\t\t\t\t\t// $this->PrettyPrintArray($sms_status);\n\t\t\t\t\tif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==0){\n\t\t\t\t\t\tif($_POST['send_sms'] === 'true' && $_POST['cashback']>0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\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\tif($_POST['send_sms'] === 'true' && $_POST['cashback']==0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\t\t\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==1){\n\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==0 && $sms_status['whats_app_sms_status']==1 ){\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t}\n\t\t\t\t\t//\n \n\t\t\t\t\t$this->ReturnJsonArray(true,false,\"Transaction is successful!\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t\telseif ($result['error'] == 'true') {\n\t\t\t\t\t$this->ReturnJsonArray(false,true,$result['message']);\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function getBaseTotalInvoicedCost();" ]
[ "0.67261803", "0.65870786", "0.6449425", "0.63685596", "0.6257748", "0.61839", "0.61839", "0.61839", "0.61839", "0.61762524", "0.61638105", "0.61236453", "0.61068296", "0.6100781", "0.6063094", "0.60181075", "0.60069484", "0.5999717", "0.5983235", "0.5978297", "0.5978095", "0.5964069", "0.5945135", "0.59449065", "0.5939606", "0.59349424", "0.5897552", "0.58836186", "0.5876057", "0.58646196", "0.5845129", "0.58392155", "0.5831314", "0.58291113", "0.58232576", "0.5807438", "0.58058125", "0.5804874", "0.58008957", "0.5792898", "0.57912", "0.5763671", "0.57632554", "0.5738091", "0.5735313", "0.5735165", "0.5706465", "0.5705585", "0.570186", "0.56960016", "0.569204", "0.5687024", "0.568235", "0.56817645", "0.5677292", "0.56737363", "0.5668149", "0.5664653", "0.56618744", "0.56610495", "0.5654438", "0.5653374", "0.5645051", "0.5635605", "0.56334865", "0.56217206", "0.5621023", "0.5616586", "0.560956", "0.5606498", "0.56046474", "0.5596721", "0.55912775", "0.558767", "0.5576009", "0.5574033", "0.55731136", "0.5567629", "0.55647826", "0.5562511", "0.55604017", "0.5557742", "0.55574226", "0.5556512", "0.5554777", "0.5553759", "0.55504894", "0.55455697", "0.5538867", "0.55364585", "0.55364025", "0.5531718", "0.5528391", "0.55251694", "0.552357", "0.5520346", "0.5520346", "0.55085295", "0.55022943", "0.5498938" ]
0.55983734
71
check value and object instance
public function isUnemptyObject($object, $value = null) { if (!empty($value)) { return !empty($object) && !empty($value); } return !empty($object); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function check_object($value) : bool\n {\n if (!is_object($value) && !is_array($value))\n return false;\n\n return true;\n }", "public function checkObject($value)\n {\n return $this->checkHasType($value, 'object');\n }", "protected function isValueObject($value)\n {\n return is_object($value) && is_subclass_of($value, ValueObject::class);\n }", "private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}", "public function testGetValue() : void\n {\n $instance = $this->createEmptyInstance();\n\n $value = new \\stdClass();\n\n $this->setValue($instance, 'value', $value);\n\n $this->getTestCase()->assertSame($value, $instance->getValue());\n }", "public function isinstanceof($class,$instance=null);", "abstract protected function isValid(\\stdClass $data): bool;", "abstract protected function checkValue( &$value );", "public function checkObject(): object\n {\n if (!is_object($this->getValue())) {\n throw new TypeInvalidException('object', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "public function isObject()\n {\n return \\is_object($this->value);\n }", "abstract public function checkValueType($arg_value);", "abstract protected function isValidValue($value);", "public function isValue()\n {\n return\n $this->type === 'string' ||\n $this->type === 'number' ||\n $this->type === 'null' ||\n $this->type === 'boolTrue' ||\n $this->type === 'boolFalse';\n }", "public function testValueIsCorrect()\n {\n $init = true;\n $str = new \\Pv\\PObject($init);\n }", "abstract protected function validateValue($value);", "public function eql(Value $value): bool\n\t{\n\t\treturn is_a($value, get_class());\n\t}", "public function __invoke($value) {\n return $this->isValid($value);\n }", "public function throwExceptionWhenSettingValueThatsNotInstanceOfObjectsType()\n {\n ATM_Config_Collection::$objectsType='stdClass';\n $object = $this->getMock('ATM_Config_Abstract', array('getName'));\n $expect = false;\n try {\n $this->object[]=$object;\n } catch (InvalidArgumentException $exception) {\n $this->assertContains('stdClass', $exception->getMessage());\n $expect = true;\n }\n $this->assertTrue($expect);\n $this->assertFalse(isset($this->object['name']));\n ATM_Config_Collection::$objectsType='ATM_Config_Abstract';\n try {\n $this->object[]=$object;\n } catch (InvalidArgumentException $exception) {\n $this->assertContains('ATM_Config_Abstract', $exception->getMessage());\n $expect = false;\n }\n $this->assertTrue($expect);\n $this->assertTrue(isset($this->object[0]));\n }", "public function isOk(): bool\n {\n static $valueProperty;\n $valueProperty ??= new \\ReflectionProperty(self::class, \"value\");\n $valueProperty->setAccessible(true);\n\n self::$toBeUsed[$this] = false;\n\n return $valueProperty->isInitialized($this);\n }", "abstract public function getIsValidValue($value);", "function isObject ($value)\r\n{\r\n\treturn is_object ($value);\r\n}", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\PersonType;\n\t}", "abstract public function valid();", "public function canHandle(TypedValueInterface $value): bool;", "protected function checkItem($value)\n {\n return $value instanceof MezzoModel;\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\InteractionCounter;\n\t}", "protected function _checkRecordInstance()\n {\n if (!$this->_entity)\n {\n $this->_entity = new $this->entityName();\n return false;\n }\n else\n return true; \n }", "public static function ensureObject($value)\n\t{\n\t\treturn (object)$value;\n\t}", "public function check(object $subject): bool;", "public function testExistentValuesOfSeoMetaFieldsInFormWithObjectInstance(){\n\n //Change the local configuration for next tests\n Centurion_Config_Manager::set('seo.meta.types', array('description', 'keywords'));\n\n $form = new Seotable_Form_Model_First();\n\n //Load instance\n $form->setInstance($form->getModel()->get(array('id' => 1)));\n\n $values = $form->getValues(true);\n\n $this->assertArrayHasKey(\n Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'description',\n $values,\n 'Error, the trait Seo was not add the element \"description\" for the Form'\n );\n\n $this->assertArrayHasKey(\n Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'keywords',\n $values,\n 'Error, the trait Seo was not add the element \"keywords\" for the Form'\n );\n\n $this->assertEquals(\n 'meta description first 1',\n $values[Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'description'],\n 'Error, the trait Seo was not loaded the good value for meta for the intance seotable/first_model:id:1'\n );\n\n $this->assertEquals(\n 'meta keywords first 1',\n $values[Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'keywords'],\n 'Error, the trait Seo was not loaded the good value for meta for the intance seotable/first_model:id:1'\n );\n }", "final function set($value){\n if(is_object($value) and get_class($value)===get_class($this)){\n $this->value = $value->get();\n $this->isset = TRUE;\n return $this->_ok();\n }\n\n // use accept for type-check\n $this->isset = FALSE;\n $typ = $this->get_type($value,FALSE,FALSE);\n if($this->accept($value,$typ)!==TRUE) \n return $this->_err(array(3,strval($value)),FALSE);\n\n // get method responisble for this type\n $mth = 'set_' . (method_exists($this,'set_' . $typ)?$typ:'default');\n $res = $this->$mth($value);\n $this->isset = $this->isok();\n return $res;\n }", "public function hasObject();", "public function isAnInstance($data,$type)\n {\n $result= false;\n if($data!=null)\n {\n if($type == self::TYPE_ARTICLE && $data instanceof DataArticle) $result = true;\n else if($type == self::TYPE_STRING && $data instanceof DataString) $result = true;\n else if($type == self::TYPE_DATE && $data instanceof DataDate) $result = true;\n else if($type == self::TYPE_INTEGER && $data instanceof DataInteger) $result = true;\n else if($type == self::TYPE_LIST && $data instanceof DataList) $result = true;\n else if($type == self::TYPE_LIST_ARTICLE && $data instanceof DataList && $this->isAnInstance($data->getContent()->get(0),self::TYPE_ARTICLE)) $result = true;\n else if($type == self::TYPE_LIST_STRING && $data instanceof DataList && $this->isAnInstance($data->getContent()->get(0),self::TYPE_STRING)) $result = true;\n }\n return $result;\n }", "public function validate(){\n\t\t$valid = true;\n\t\t$ref = new ReflectionObject($this);\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\tif(isset($this->_atributosMetadata[$prop->getName()])){\n\t\t\t\t$propMetadata = $this->_atributosMetadata[$prop->getName()];\n\t\t\t\tif($propMetadata->needValidate){\n\t\t\t\t\t$propMetadata->Validate($prop->getValue($this));\n\t\t\t\t\tif($propMetadata->isValid){\n\t\t\t\t\t\t$valid = $valid && $propMetadata->isValid; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $valid;\t\t\n\t}", "public function validateValue($value)\n {\n }", "function checkValue($variable) {\r\n return $this->$variable;\r\n }", "function checkValue($variable) {\r\n return $this->$variable;\r\n }", "abstract public function isValid(mixed $value): bool;", "protected function isValidValue($value)\r\n {\r\n return ($value instanceof Entity\\PluginValue);\r\n }", "public function checkExtObj() {}", "public function checkExtObj() {}", "public function testIsValidSuccessWithoutInvokedSetter()\n {\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $this->assertTrue($validator->isValid($this->_object));\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\PropertyValueType || $value instanceof DataType\\TextType || $value instanceof DataType\\URLType;\n\t}", "public function isAok($object) \n {\n return $object instanceof $this; \n }", "function instance_of($object, $class)\n{\n return $object instanceof $class;\n}", "public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }", "private static function _isPropertyType($type, $value){\n $nativeType = self::_getNativeType($type);\n if ($nativeType != null){\n switch($nativeType){\n case 'boolean':\n if (is_bool($value)){\n return true;\n } else if (is_numeric($value) && ($value == 0 || $value == 1)){\n return true;\n } else if (is_string($value)){\n if ($value == 'true' || $value == 'false'){\n return true;\n } else if ($value == '1' || $value == '0'){\n return true;\n }\n }\n break;\n case 'integer':\n if (is_int($value)){\n return true;\n } else if (preg_match('/^[0-9]+$/', $value)){\n return true;\n }\n break;\n case 'double':\n if (is_float($value) || is_numeric($value)){\n return true;\n }\n break;\n case 'datetime':\n if (is_int($value) || strtotime($value)){\n return true;\n }\n break;\n case 'binary':\n if (is_binary($value)){\n return true;\n }\n break;\n case 'ascii':\n if (is_string($value)){\n return true;\n }\n break;\n case 'instance':\n $uuid = null;\n if (is_object($value) && isset($value->uuid) && is_mysql_uuid($value->uuid)){\n $uuid = $value->uuid;\n } else if (is_mysql_uuid($value)){\n $uuid = $value;\n }\n if ($uuid != null){\n $id = Mysql::query(\"SELECT MAX(id) FROM t_instance where uuid = '{$uuid}'\");\n if ($id && is_int($id)){\n return true;\n }\n }\n break;\n }\n }\n\n // all else failed\n return false;\n }", "protected function isValidValue($value)\n {\n return ($value instanceof ClassConstant);\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\VideoGame;\n\t}", "abstract public function check();", "public function checkObjectOrClass($value)\n {\n $success = is_object($value)\n || (is_string($value) && class_exists($value));\n\n return new Result($success, '{name} must be an object or a fully qualified class name');\n }", "public function requiresInstance() : bool;", "public function GCheck (\\stdClass $param);", "public static function post_is_object(){\n if( count($_POST)>=1) return (object)$_POST;\n }", "public function getIsObject() {\n $primitives = array(\"boolean\", \"integer\", \"int\", \"string\", \"float\");\n return !is_numeric(array_search($this->getType(), $primitives));\n }", "abstract function validate(mixed $value) : bool;", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "public function __get($v) {\n return (!in_array($v,array('instance')) && isset($this->$v)) ? $this->$v : false;\n }", "private function checkTypeHints($obj, $method, $value, $pNum = 0)\n {\n if (!is_numeric($value) && !is_string($value)) {\n return $value;\n }\n\n $reflection = new \\ReflectionMethod($obj, $method);\n $params = $reflection->getParameters();\n\n if (!$params[$pNum]->getClass()) {\n return $value;\n }\n\n $hintedClass = $params[$pNum]->getClass()->getName();\n\n if ($hintedClass === 'DateTime') {\n try {\n if (preg_match('{^[0-9]+$}', $value)) {\n $value = '@'.$value;\n }\n\n return new \\DateTime($value);\n } catch (\\Exception $e) {\n throw new \\UnexpectedValueException('Could not convert '.$value.' to DateTime for '.$reflection->getDeclaringClass()->getName().'::'.$method, 0, $e);\n }\n }\n\n if ($hintedClass) {\n if (!$this->manager) {\n throw new \\LogicException('To reference objects by id you must first set a Nelmio\\Alice\\ORMInterface object on this instance');\n }\n $value = $this->manager->find($hintedClass, $value);\n }\n\n return $value;\n }", "public function isValid($value)\n\t{\n\n\t\t/**\n\t\t * @var BaseService\n\t\t */\n\t\t$res = $this->options['service']->findBy(array(\n\t\t\t$this->options['fields'] => $value,\n\t\t\t'user' => $this->options['user']\n\t\t));\n\n\t\tif(empty($res)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t//TODO THE EXCEPT SHIT IS MESSED UP!\n\t\tif(array_key_exists('except', $this->options)) {\n\t\t\tif(($res) ? 'true' : 'false' == $this->options['except']) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif(isset($this->options['values']['id']) and $res[0]->getId() === $this->options['values']['id']) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif(!empty($res)) {\n\t\t\t$this->error(self::EXISTS);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function valueChecker($className, $memberName, $keyDetails, $value, &$uniqueValuesMap, $instanceNumber)\n\t{\n\t\t$detailsJO = array();\n \n\t\t$name = $keyDetails[Constants::NAME];\n\t\t\n\t\t$type = $keyDetails[Constants::TYPE];\n\n\t\t$varType = gettype($value);\n\n\t\t$test = function ($varType, $type) { if(strtolower($varType) == strtolower($type)){return true; } return false;};\n\n\t\t$check = $test($varType, $type);\n\n\t\tif(array_key_exists($type, Constants::DATA_TYPE))\n\t\t{\n\t\t\t$type = Constants::DATA_TYPE[$type];\n\n\t\t\tif(is_array($value) && count($value) > 0 && array_key_exists(Constants::STRUCTURE_NAME, $keyDetails))\n\t\t\t{\n\t\t\t\t$structureName = $keyDetails[Constants::STRUCTURE_NAME];\n\n\t\t\t\t$index = 0;\n\n\t\t\t\tforeach($value as $data)\n\t\t\t\t{\n\t\t\t\t\t$className = get_class($data);\n\n\t\t\t\t\t$check = $test($className, $structureName);\n\n\t\t\t\t\tif(!$check)\n\t\t\t\t\t{\n\t\t\t\t\t\t$instanceNumber = $index;\n\n\t\t\t\t\t\t$type = Constants::ARRAY_KEY . \"(\" . $structureName . \")\";\n\n\t\t\t\t\t\t$varType = Constants::ARRAY_KEY . \"(\" . $className . \")\";\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$index ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$check = $test($varType, $type);\n\t\t\t}\n\t\t}\n\n\t\tif(strtolower($varType) == strtolower(Constants::OBJECT) || strtolower($type) == strtolower(Constants::OBJECT))\n\t\t{\n\t\t\tif(strtolower($type) == strtolower(Constants::OBJECT))\n\t\t\t{\n\t\t\t\t$check = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$className = get_class($value);\n\n\t\t\t\t$check = $test($className, $type);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$check && $value != null)\n {\n $detailsJO[Constants::FIELD] = $memberName;\n \n $detailsJO[Constants::CLASS_KEY] = $className;\n \n $detailsJO[Constants::INDEX] = $instanceNumber;\n \n\t\t\t$detailsJO[Constants::EXPECTED_TYPE] = $type;\n\t\t\t\n\t\t\t$detailsJO[Constants::GIVEN_TYPE] = $varType;\n \n\t\t\tthrow new SDKException(Constants::TYPE_ERROR, null, $detailsJO, null);\n }\n \n\t\tif(array_key_exists(Constants::VALUES, $keyDetails) && (!array_key_exists(Constants::PICKLIST, $keyDetails) || ($keyDetails[Constants::PICKLIST] && Initializer::getInitializer()->getSDKConfig()->getPickListValidation())))\n\t\t{\n\t\t\t$valuesJA = $keyDetails[Constants::VALUES];\n\t\t\t\n\t\t\tif($value instanceof Choice)\n\t\t\t{\n\t\t\t\t$choice = $value;\n\t\t\t\t\n\t\t\t\t$value = $choice->getValue();\n\t\t\t}\n\t\t\t\n\t\t\tif(!in_array($value, $valuesJA))\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t\n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t\t\n\t\t\t\t$detailsJO[Constants::INDEX] = $instanceNumber;\n\t\t\t\t\n\t\t\t\t$detailsJO[Constants::GIVEN_VALUE] = $value;\n\t\t\t\t\n\t\t\t $detailsJO[Constants::ACCEPTED_VALUES] = $valuesJA;\n\t\t\t\t\n\t\t\t\tthrow new SDKException(Constants::UNACCEPTED_VALUES_ERROR, null, $detailsJO, null);\n\t\t\t}\n\t\t}\n\n\t\tif(array_key_exists(Constants::UNIQUE, $keyDetails))\n\t\t{\n\t\t\t$valuesArray = null;\n\n\t\t\tif(array_key_exists($name, $uniqueValuesMap))\n\t\t\t{\n\t\t\t\t$valuesArray = $uniqueValuesMap[$name];\n\t\t\t\n\t\t\t\tif($valuesArray != null && in_array($value, $valuesArray))\n\t\t\t\t{\n\t\t\t\t\t$detailsJO[Constants::FIELD] = $memberName;\n\t\t\t\t\t\n\t\t\t\t\t$detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t\t\t\n\t\t\t\t\t$detailsJO[Constants::FIRST_INDEX] = array_search($value, $valuesArray);\n\t\t\t\t\t\n\t\t\t\t\t$detailsJO[Constants::NEXT_INDEX] = $instanceNumber;\n\t\t\t\t\t\n\t\t\t\t\tthrow new SDKException(Constants::UNIQUE_KEY_ERROR, null , $detailsJO, null);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($valuesArray == null)\n\t\t\t\t{\n\t\t\t\t\t$valuesArray = array();\n\t\t\t\t}\n\n\t\t\t\t$valuesArray[] = $value;\n\t\t\t\t\n\t\t\t\t$uniqueValuesMap[$name] = $valuesArray;\n\t\t\t}\n\t\t}\n\n\t\tif(array_key_exists(Constants::MIN_LENGTH, $keyDetails) || array_key_exists(Constants::MAX_LENGTH, $keyDetails))\n\t\t{\n\t\t\t$count = 0;\n\t\t\t\n\t\t\tif(is_array($value))\n\t\t\t{\n\t\t\t\t$count = count($value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$count = strlen($value);\n\t\t\t}\n\n\t\t if(array_key_exists(Constants::MAX_LENGTH, $keyDetails) && $count > $keyDetails[Constants::MAX_LENGTH])\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t \n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t \n\t\t\t $detailsJO[Constants::GIVEN_LENGTH] = $count;\n\t\t\t \n\t\t\t $detailsJO[Constants::MAXIMUM_LENGTH] = $keyDetails[Constants::MAX_LENGTH];\n\t\t\t\t\n\t\t\t throw new SDKException(Constants::MAXIMUM_LENGTH_ERROR, null, $detailsJO, null);\n\t\t\t}\n\t\t\t\n\t\t\tif(array_key_exists(Constants::MIN_LENGTH, $keyDetails) && $count < $keyDetails[Constants::MIN_LENGTH])\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t \n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t \n\t\t\t $detailsJO[Constants::GIVEN_LENGTH] = $count;\n\t\t\t\t\n\t\t\t $detailsJO[Constants::MINIMUM_LENGTH] = $keyDetails[Constants::MIN_LENGTH];\n\t\t\t\t\n\t\t\t\tthrow new SDKException(Constants::MINIMUM_LENGTH_ERROR, null, $detailsJO, null);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(array_key_exists(Constants::REGEX, $keyDetails))\n\t\t{\n\t\t if (!preg_match($keyDetails[Constants::REGEX], $value))\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t \n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t\t\n\t\t\t $detailsJO[Constants::INSTANCE_NUMBER] = $instanceNumber;\n\t\t\t\t\n\t\t\t\tthrow new SDKException(Constants::REGEX_MISMATCH_ERROR, null, $detailsJO, null);\n\t\t\t}\n }\n \n return true;\n\t}", "protected function update_object($value = null) {\n $db = DB::connect();\n $class = get_called_class();\n\n if ($value == null) {\n $value = 'id';\n }\n\n // If the object doesnt have the attribute passed on\n if (!$this->has_attribute($value)) {\n return false;\n }\n\n $obj = $db->prepare(\"SELECT * FROM \" . $class . \" WHERE \" . $value . \" = '\" . $this->$value . \"'\");\n $obj->bindParam(':id', $this->id);\n $obj->execute();\n\n $obj = $obj->fetch(PDO::FETCH_ASSOC);\n\n // If a record doesnt match the id of the object\n if (empty($obj)) {\n return false;\n }\n\n // Update all the attributes\n foreach (get_object_vars($this) as $key => $value) {\n $this->$key = $obj[$key];\n }\n\n return true;\n }", "function accept($data,$type=NULL){\n if(is_object($data) and get_class($data)===get_class($this)) return TRUE;\n if(is_null($type)) $type = $this->get_type($data,FALSE,FALSE);\n else if(is_int($type)) $type = def(self::$types,$type,'null');\n $acc = def($this->accept,$type,0);\n if($acc<2) return $acc==1;\n $mth = 'check_' . $type;\n return $this->$mth($data);\n }", "public function checkSubExtObj()\n {\n if (is_object($this->extObj)) {\n $this->extObj->checkExtObj();\n }\n }", "public function Valid();", "private function supportData()\n {\n $dataClass = $this->type->getDataClass();\n\n return $this->data instanceof $dataClass || $dataClass === get_class($this->data);\n }", "function isInstanceOf($object, $class) {\n return $object instanceof $class;\n}", "static function checkObj(&$data) \n\t{\n\t\tif(!$data)\n\t\t\treturn false;\n\t\tif(preg_match('/((?![\\x20-\\x7E]).)/', $data)){\n\t\t\t//todo:now just int\n\t\t\t$data = unpack('I',$data);\n\t\t\t$data = $data[1];\n\t\t\treturn false;\n\t\t}\n\t\tif(substr_compare($data,'{',0,1)==0){\n\t\t\t$ndata = json_decode($data,true);\n\t\t\tif($ndata){\n\t\t\t\t$data = $ndata;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "public static function isObject($val)\n {\n return is_object($val);\n }", "public function checkSubExtObj() {}", "protected abstract function supportsObject($object);", "protected function cbFilterObjects($value)\n {\n return !is_object($value);\n }", "function is_valid() {\n $valid = True;\n foreach(get_object_vars($this) as $name => $obj) {\n if ($obj != NULL) {\n #validacion errores genericos de los campos\n $obj->required_validate();\n $flag = $obj->is_valid(); \n if (!$flag) \n { \n $valid = False;\n echo $obj->name.\" \";\n }\n #echo $obj->name;\n }\n }\n #busca metodos de validacion definido por usuario\n foreach(get_class_methods($this) as $fname) {\n $pos = strpos($fname, \"clean_\");\n if ($pos !== False) {\n $flag = $this->$fname();\n if (!$flag) \n { \n $valid = False;\n echo $fname.\" \";\n }\n }\n }\n echo $valid;\n return $valid;\n }", "public function testValueIsSet()\n {\n $init = 'test';\n $str = new \\Pv\\PString($init);\n $value = $str->getValue();\n\n $this->assertEquals($value, $init);\n }", "static private function checkRequirments($object) {\n if (!is_object($object)) {\n self::fail('Must pass an object');\n }\n if (!self::getConfig('allowBlank') && empty((array)$object)) {\n self::fail('Empty object, and allowBlank is disabled');\n }\n if (!isset($object->_id) || empty($object->_id)) {\n $object->_id = self::getId();\n }\n if (!isset($object->_type) || empty($object->_type)) {\n $object->_type = self::getType($object);\n }\n return $object;\n }", "private function check_sanity()\n {\n if (!is_object($this->qb))\n {\n return false;\n }\n \n if (empty($this->pager_id))\n {\n\n return false;\n }\n return true;\n }", "public function isObject(): bool\n {\n return $this->phpType === self::OBJECT;\n }", "function searchObject($object){\r\n\t\tif($this->getElem($object->value)!=null) return true;\r\n\t\t\telse false;\r\n\t}", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "protected function has_content($instance)\n {\n }", "protected function has_content($instance)\n {\n }", "function rest_is_object($maybe_object)\n {\n }", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function equalsTo(ValueObjectInterface $object): bool {\n return $this->get() === $object->get();\n }", "public function equalsTo(ValueObjectInterface $object): bool {\n return $this->get() === $object->get();\n }", "public function isObjectDataValid()\n\t{\n\t\tforeach ($this->objectRequiredDataFields AS $requiredField => $_tmp) {\n\t\t\t$checkValue = $this->getObjectData($requiredField);\n\t\t\t$validationReturn = $this->validate($requiredField, $checkValue);\n\n\t\t\tif ($validationReturn != true) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function is($value) {\n return ($this->code === $value || $this->value === $value);\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\DataDownloadType;\n\t}", "public function __invoke($data): bool\n {\n return !(is_object($data))\n || count(get_object_vars($data)) >= $this->minimum;\n }", "function isValid($value)\r\n\t{\r\n\t\tstatic $combined = null;\r\n\t\tif ($combined === null) {\r\n\t\t\t$combined = array_combine($this->members, $this->members);\r\n\t\t}\r\n\t\treturn isset($combined[$value]);\r\n\t}" ]
[ "0.66583925", "0.6614984", "0.63080984", "0.62965935", "0.6262711", "0.6243978", "0.6213448", "0.615961", "0.6155123", "0.60662526", "0.60633034", "0.6017103", "0.5973925", "0.58939123", "0.5829618", "0.57853657", "0.57586753", "0.57325804", "0.5716954", "0.5707753", "0.5704469", "0.5687584", "0.5644311", "0.5626464", "0.5618993", "0.5601495", "0.55691683", "0.5566378", "0.554873", "0.5545384", "0.5535735", "0.55273044", "0.5521324", "0.5518641", "0.5483526", "0.547911", "0.547911", "0.54784364", "0.54604053", "0.54496163", "0.54494077", "0.54482085", "0.54333454", "0.54306316", "0.54299456", "0.5428995", "0.5422231", "0.5420285", "0.54143965", "0.54029816", "0.5396498", "0.537718", "0.537341", "0.53728294", "0.53716326", "0.5368303", "0.53571886", "0.53548026", "0.53474486", "0.5333797", "0.53318936", "0.53198385", "0.5310847", "0.5299593", "0.5299309", "0.5297405", "0.5290709", "0.5286387", "0.5277925", "0.52763736", "0.52749133", "0.52739453", "0.527258", "0.52707034", "0.52704877", "0.52688557", "0.5264379", "0.5263841", "0.5253639", "0.525137", "0.525137", "0.525137", "0.525137", "0.52422357", "0.52422357", "0.5239128", "0.5235104", "0.5235104", "0.5235104", "0.5235104", "0.5235104", "0.5235104", "0.5235104", "0.5235104", "0.52317595", "0.52317595", "0.5224395", "0.52226406", "0.5221733", "0.5220393", "0.52137536" ]
0.0
-1
get value sales discount from coa potongan
public function getSalesDiscounts($object) { if (app('data.helper')->isUnemptyObject($object, $object->nominal_debit_amount)) { return -$object->nominal_debit_amount; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDiscountInvoiced();", "public function getTonicDiscount()\n {\n }", "public function getTotalDiscount(): float;", "public function getDiscountAmount();", "public function getDiscount()\n\t{\n\t\treturn $this->getKeyValue('Discount'); \n\n\t}", "public function discountOrChargeValueBoleta()\n {\n if($this->discount_or_charge_value > 0)\n return $this->discount_or_charge_value;\n else if ($this->discount_or_charge_percentage > 0)\n return (int) round( ($this->discount_or_charge_percentage / 100) * ($this->price * $this->quantity));\n else //pos sale without discount\n return 0;\n }", "public function getTotalDiscountAmount();", "public function getDiscount()\r\n {\r\n return $this->discount;\r\n }", "public function getTotaldiscount()\n {\n return $this->totaldiscount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "function fuc_discount($product, $percentage){\r\n $discountValue = $product / 100 * $percentage;\r\n $totalValue = $product - $discountValue; \r\n return $totalValue;\r\n\r\n}", "public function smanjiCenu(){\n if($this->getGodiste() < 2010){\n $discount=$this->cenapolovnogauta*0.7;\n return $this->cenapolovnogauta=$discount;\n }\n return $this->cenapolovnogauta; \n }", "function customerDiscount()\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Wert FROM \" . PREFIX . \"_modul_shop_kundenrabatte WHERE GruppenId = '\".UGROUP.\"' LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\tif(is_object($row))\r\n\t\t\treturn $row->Wert;\r\n\t}", "function getDiscountFor($product) {\n\t\treturn 30;\n\t}", "public function getDiscount(): int\n {\n return $this->discount;\n }", "public function getDiscountTaxCompensationInvoiced();", "function course_discounted_amount($price, $coupon)\n{\n $return_val = $price;\n if (!empty($coupon)) {\n $coupon_details = CourseCoupon::where('code', $coupon)->first();\n if (!empty($coupon_details)) {\n if ($coupon_details->discount_type === 'percentage') {\n $discount_bal = ($price / 100) * (int)$coupon_details->discount;\n $return_val = $price - $discount_bal;\n } elseif ($coupon_details->discount_type === 'amount') {\n $return_val = $price - (int)$coupon_details->discount;\n }\n }\n }\n\n return $return_val;\n}", "public function getSubtotalDiscount()\n {\n $this->initializeSubtotals();\n\n return $this->getIfSet('discount', $this->data->amount->subtotals);\n }", "function getPorDiscount($porDiscount, $courseDisc)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM discount WHERE code = %s AND id_course = %s\",\n\t\t\t\t\t\t\t\t\t GetSQLValueString($porDiscount, \"text\"),\n\t\t\t\t\t\t\t\t\t GetSQLValueString($courseDisc, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"percent\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function getPriceDiscount()\n\t{\n\t\treturn $this->priceDiscount;\n\t}", "function getDiscountedPrice()\n {\n if (!$this->hasDiscount()) return null;\n $price = $this->price;\n if ($this->discount_active) {\n $price = $this->discountprice;\n }\n// NOTE: Add more conditions and rules as desired, i.e.\n// if ($this->testFlag('Outlet')) {\n// $discountRate = $this->getOutletDiscountRate();\n// $price = number_format(\n// $price * (100 - $discountRate) / 100,\n// 2, '.', '');\n// }\n return $price;\n }", "public function calculateDiscount(): ?float;", "private function discountOrChargePercetageBoleta()\n {\n if($this->discount_or_charge_percentage > 0)\n return $this->discount_or_charge_percentage;\n else if ($this->discount_or_charge_value > 0)\n return round(\n $this->discount_or_charge_value * 100 /\n ($this->price * $this->quantity)\n , 2); // 2 => decimal precition\n else //pos sale without discount\n return 0;\n }", "public function discountOrChargeValue()\n {\n return $this->discountOrChargeValueBoleta();\n }", "public function getDiscountAmount(){\n return $this->getParameter('discount_amount');\n }", "public function getDiscountDescription();", "public function getDiscountRefunded();", "public function getDiscountTaxCompensationAmount();", "function get_cart_discount_total() {\n\t\t\treturn $this->discount_cart;\n\t\t}", "public function getShippingDiscountAmount();", "function getMonDiscount($codDiscount, $courseDescontado)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM discount WHERE code = %s AND id_course = %s\",\n\t\t\t\t\t\t\t\t\t GetSQLValueString($codDiscount, \"text\"),\n\t\t\t\t\t\t\t\t\t GetSQLValueString($courseDescontado, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"money\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "function get_total_discount() {\n\t\t\tif ($this->discount_total || $this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_total + $this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "public function getTotalWithDiscount()\n {\n return $this->totalWithDiscount;\n }", "public function getSalesFromCOD()\n {\n $salesFromCOD = Order::whereNotIn('status', ['cancelled', 'refunded'])->where('payment_type', 'cod')\n // ->when(auth()->user()->hasRole('vendor'), function ($query) {\n // $query->where('vendor_id', auth()->user()->vendor->id);\n // })\n ->sum('total_price');\n return $salesFromCOD;\n }", "public function getDiscountPriceInfo()\n {\n return $this->discountPriceInfo;\n }", "public function getDiscountAttribute() {\n return $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum() * (1 - ($this->userPromotion->promotion->discount / 100));\n }", "public function getDocumentProductDiscount()\n {\n return (string) $this->document_product_discount;\n }", "public function getBaseDiscountInvoiced();", "function ObtenerDisc($userSec, $periodA)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT discountcode FROM cart WHERE id_student = %s AND id_term = %s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($userSec, \"int\"),\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($periodA, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"discountcode\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "function get_discount($total = 0)\n{\n global $config, $db_prefix, $sql_today, $current_user_id;\n\n $discount = array('self_gift_code' => '', 'gift_code' => '', 'gift_flat' => 0, 'gift_pct' => 0);\n $gift_discount = false;\n\n // get gift\n $gift = sql_qquery(\"SELECT * FROM \".$db_prefix.\"gift WHERE redeem_user_id='$current_user_id' AND redeem_order_id='' AND valid_date >= '$sql_today' LIMIT 1\");\n if (!empty($gift) && ($total >= $gift['min_purchase'])) {\n $gift_discount = true;\n $g = explode('.', $gift['gift_code']);\n $discount['self_gift_code'] = $gift['gift_code'];\n $discount['gift_code'] = $gift['gift_code'] = $g[0];\n if ($gift['gift_pct']) {\n $discount['gift_pct'] = $gift['gift_value'];\n } else {\n $discount['gift_flat'] = $gift['gift_value'];\n }\n }\n\n return $discount;\n}", "public function getDiscountCode()\n {\n return $this->discountCode;\n }", "function getDiscountByOrder($orders_id) {\n\t\t$sel_ord_query = tep_db_query(\"SELECT value FROM \" . TABLE_ORDERS_TOTAL . \" WHERE orders_id = '\".$orders_id.\"' AND (class = 'ot_customer_discount' OR class='ot_gv')\");\n\t\t$disctot = 0;\n\t\twhile($rst_arr = tep_db_fetch_array($sel_ord_query)) {\n\t\t\t$disctot += $rst_arr[\"value\"];\n\t\t}\n\t\treturn $disctot;\n\t}", "function getDiscountDetailByReferenceNo($reference_no) {\n $qry = $this->db->query(\"select * from tbl_discount_applied where reference_no=$reference_no\");\n if($qry->num_rows()){\n $result = current($qry->result_array());\n $result['original_total_price'] = number_format($result['original_total_price'],2,'.','');\n $result['discount'] = number_format($result['discount'],2,'.','');\n $result['total_price'] = number_format($result['total_price'],2,'.','');\n return $result;\n }\n return false;\n }", "function calc_extra_sp_cost($Discount = 1){\r\n\t$list = array('D','E','A');\r\n\tforeach($list as $v){\r\n\t\tif(preg_match('/CostSP<([0-9]+)>/',$this->Eq[$v]['spec'],$array)){\r\n\t\t\t$a = intval($array[1]);\r\n\t\t\t$this->SP_Cost += ceil($a * $Discount);\r\n\t\t}\r\n\t}\r\n}", "function get_discount($order_code = ''){\n $apply_discount = '';\n if ($order_code){\n $order = $this->Orders->get_order($order_code);\n if ($order && !empty($order['prebooking_discount'])){\n $apply_discount = array(\n 'start_date' => date('Y-m-d'),\n 'description' => 'Ưu đãi khi đặt trước',\n 'en_description' => 'Discount when pre-ordering',\n 'priority' => '10',\n 'table' => array(\n '0' => $order['prebooking_discount']\n ),\n 'is_prebook' => 1\n );\n }\n }\n return $apply_discount;\n }", "function parseDiscount($discount) {\n preg_match(\"/[0][.](\\d\\d?)/\", trim($discount), $math1);\n preg_match(\"/(\\d\\d?)\\s*折/\", trim($discount), $math2);\n preg_match(\"/(\\d\\d?)$/\", trim($discount), $math3);\n $num = $discount * 100;\n if (!empty($math1[1])) {\n $num = strlen($math1[1]) == 1 ? $math1[1] * 10 : $math1[1];\n return 100 - $num;\n } else if (!empty($math2[1])) {\n $num = strlen($math2[1]) == 1 ? $math2[1] * 10 : $math2[1];\n return 100 - $num;\n } else if (!empty($math3[1])) {\n $num = strlen($math3[1]) == 1 ? $math3[1] * 10 : $math3[1];\n return 100 - $num;\n } else {\n return 0;\n }\n}", "public function getBaseDiscountAmount();", "function get_discount($total_qty){\r\n\t\tif($total_qty>35){\r\n\t\t\t$order_discount = 3;\r\n\t\t}else{\r\n\t\t\t$order_discount = 0;\r\n\t\t}\r\n\t\t$_SESSION[\"order_discount\"] = $order_discount;\r\n\t\treturn $order_discount;\r\n\t}", "function get_discounted_price( $values, $price, $add_totals = false ) {\n\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tif ( $coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_deals\" :\n\t\t\t\t\t\tcase \"percent_deals\" :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's get the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->deal_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->deal_ids) || in_array($values['variation_id'], $coupon->deal_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// No deals ids - all items discounted\n\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's excluded from the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->exclude_deals_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->exclude_deals_ids) || in_array($values['variation_id'], $coupon->exclude_deals_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply filter\n\t\t\t\t\t\t\t$this_item_is_discounted = apply_filters( 'cmdeals_item_is_discounted', $this_item_is_discounted, $values, $before_tax = true );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply the discount\n\t\t\t\t\t\t\tif ($this_item_is_discounted) :\n\t\t\t\t\t\t\t\tif ($coupon->type=='fixed_deals') :\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price < $coupon->amount) :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $coupon->amount;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) :\n\t\t\t\t\t\t\t\t\t\t$this->discount_cart = $this->discount_cart + ( $discount_amount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\telseif ($coupon->type=='percent_deals') :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\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 is the most complex discount - we need to divide the discount between rows based on their price in\n\t\t\t\t\t\t\t * proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows\n\t\t\t\t\t\t\t * with no price (free) don't get discount too.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get item discount by dividing item cost by subtotal to get a %\n\t\t\t\t\t\t\t$discount_percent = ($values['data']->get_price( false )*$values['quantity']) / $this->subtotal_ex_tax;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Use pence to help prevent rounding errors\n\t\t\t\t\t\t\t$coupon_amount_pence = $coupon->amount * 100;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out the discount for the row\n\t\t\t\t\t\t\t$item_discount = $coupon_amount_pence * $discount_percent;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out discount per item\n\t\t\t\t\t\t\t$item_discount = $item_discount / $values['quantity'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Pence\n\t\t\t\t\t\t\t$price = ( $price * 100 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Check if discount is more than price\n\t\t\t\t\t\t\tif ($price < $item_discount) :\n\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$discount_amount = $item_discount;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Take discount off of price (in pence)\n\t\t\t\t\t\t\t$price = $price - $discount_amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Back to pounds\n\t\t\t\t\t\t\t$price = $price / 100; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cannot be below 0\n\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues)\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + (($discount_amount*$values['quantity']) / 100);\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get % off each item - this works out the same as doing the whole cart\n\t\t\t\t\t\t\t//$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\n\t\t\treturn apply_filters( 'cmdeals_get_discounted_price_', $price, $values, $this );\n\t\t}", "private function get_discount_percentage() : float {\n\t\tpreg_match( '/runParams\\.discount=\"(.*?)\";/si', $this->request, $matches );\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn floatval( $matches[1] );\n\t}", "public function getDiscountPriceAttribute(){\n\n if (!empty($this->discount)) {\n\n if ($this->discount->type == 'percentage') {\n $discount = ($this->price * $this->discount->discount) / 100;\n\n return round($this->price - $discount, 2);\n\n }else {\n\n return round($this->price - $this->discount->discount, 2);\n\n }\n\n }\n }", "public function getDiscount()\n {\n if ($this->hasDiscount() === false) {\n return false;\n }\n\n $time = new \\DateTime('now');\n $today = $time->format('Y-m-d');\n\n $discount = \\common\\models\\Discounts::find()\n ->where(['iid' => $this->id])\n ->andWhere(['<=', 'start_at', $today])\n ->andWhere(['>', 'stop_at', $today])\n ->one();\n\n return $discount->discount;\n }", "function get_order_discount_total() {\n\t\t\treturn $this->discount_total;\n\t\t}", "public function getDiscountData() {\n return array(\n 'discValue' => $this->discValue,\n 'discValueCode' => $this->discValueCode,\n 'minPurchaseVal' => $this->minPurchaseVal,\n 'receiptDisc' => $this->receiptDisc,\n 'maxreceDisc' => $this->maxreceDisc\n );\n }", "public function getSubtotalInvoiced();", "public function dinero(){\n $query = $this->db->query(\"SELECT SUM(price) AS total FROM property_unity WHERE property_id=1 AND status=1\");\n return $query->row();\n }", "public function calculateDiscount(array $order): float;", "public function getDiscount()\n {\n $currency = $this->currency();\n\n return array_reduce(\n $this->tickets(),\n function ($carry, Category $ticket) {\n return $ticket->getDiscount()->plus($carry);\n },\n Money::fromCent($currency, 0)\n );\n }", "protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }", "public function sc_cart_get_discount_amount( $total = 0, $coupon = '' ) {\n\n\t\t\t$discount = 0;\n\n\t\t\tif ( $coupon instanceof WC_Coupon ) {\n\n\t\t\t\tif ( $coupon->is_valid() && $coupon->is_type( 'smart_coupon' ) ) {\n\n\t\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t\t$coupon_amount = $coupon->get_amount();\n\t\t\t\t\t\t$coupon_code = $coupon->get_code();\n\t\t\t\t\t\t$coupon_product_ids = $coupon->get_product_ids();\n\t\t\t\t\t\t$coupon_product_categories = $coupon->get_product_categories();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$coupon_amount = ( ! empty( $coupon->amount ) ) ? $coupon->amount : 0;\n\t\t\t\t\t\t$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';\n\t\t\t\t\t\t$coupon_product_ids = ( ! empty( $coupon->product_ids ) ) ? $coupon->product_ids : array();\n\t\t\t\t\t\t$coupon_product_categories = ( ! empty( $coupon->product_categories ) ) ? $coupon->product_categories : array();\n\t\t\t\t\t}\n\n\t\t\t\t\t$calculated_total = $total;\n\n\t\t\t\t\tif ( count( $coupon_product_ids ) > 0 || count( $coupon_product_categories ) > 0 ) {\n\n\t\t\t\t\t\t$discount = 0;\n\t\t\t\t\t\t$line_totals = 0;\n\t\t\t\t\t\t$line_taxes = 0;\n\t\t\t\t\t\t$discounted_products = array();\n\n\t\t\t\t\t\tforeach ( WC()->cart->cart_contents as $cart_item_key => $product ) {\n\n\t\t\t\t\t\t\tif ( $discount >= $coupon_amount ) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $product['product_id'] );\n\n\t\t\t\t\t\t\tif ( count( $coupon_product_categories ) > 0 ) {\n\n\t\t\t\t\t\t\t\t$continue = false;\n\n\t\t\t\t\t\t\t\tif ( ! empty( $cart_item_key ) && ! empty( $discounted_products ) && is_array( $discounted_products ) && in_array( $cart_item_key, $discounted_products, true ) ) {\n\t\t\t\t\t\t\t\t\t$continue = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! $continue && count( array_intersect( $product_cats, $coupon_product_categories ) ) > 0 ) {\n\n\t\t\t\t\t\t\t\t\t$discounted_products[] = ( ! empty( $cart_item_key ) ) ? $cart_item_key : '';\n\n\t\t\t\t\t\t\t\t\t$line_totals += $product['line_total'];\n\t\t\t\t\t\t\t\t\t$line_taxes += $product['line_tax'];\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( count( $coupon_product_ids ) > 0 ) {\n\n\t\t\t\t\t\t\t\t$continue = false;\n\n\t\t\t\t\t\t\t\tif ( ! empty( $cart_item_key ) && ! empty( $discounted_products ) && is_array( $discounted_products ) && in_array( $cart_item_key, $discounted_products, true ) ) {\n\t\t\t\t\t\t\t\t\t$continue = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! $continue && in_array( $product['product_id'], $coupon_product_ids, true ) || in_array( $product['variation_id'], $coupon_product_ids, true ) || in_array( $product['data']->get_parent(), $coupon_product_ids, true ) ) {\n\n\t\t\t\t\t\t\t\t\t$discounted_products[] = ( ! empty( $cart_item_key ) ) ? $cart_item_key : '';\n\n\t\t\t\t\t\t\t\t\t$line_totals += $product['line_total'];\n\t\t\t\t\t\t\t\t\t$line_taxes += $product['line_tax'];\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$calculated_total = round( ( $line_totals + $line_taxes ), wc_get_price_decimals() );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$discount = min( $calculated_total, $coupon_amount );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $discount;\n\t\t}", "public function testGetDiscountValue()\n {\n\n $discountValue= $this->discountProvider->getDiscountValue(\"https://developer.github.com/v3/#http-redirects\",[12,7],1000);\n $this->assertEquals(21,$discountValue);\n\n }", "public function getDiscount(Request $request){\n\n \n $coupon=Coupon::where('code',$request->coupon)->first();\n if(count($coupon)==0){\n return back()->withErrors('No such coupon code found');\n }\n\n if($coupon->no_of_uses<=0){\n return back()->withErrors('Coupon code is not available now!');\n }\n\n $discount=round(($coupon->percent_off)*0.01*((float)str_replace(',', '', Cart::subtotal())+(float)str_replace(',', '', Cart::tax())),2);\n session(['coupon_id'=>$coupon->id]);\n session(['percent_off'=>$coupon->percent_off]);\n session(['discount'=>$discount]);\n $cart_total=((float)str_replace(',','',Cart::total()))-session()->get('discount');\n session(['cart_total'=>round($cart_total,2)]);\n\n Session::flash('success','Discount applied!');\n return back();\n }", "public function getDiscount(): ?float\n {\n return $this->discount;\n }", "public function getDiscountCanceled();", "private function calcDiscountPercent()\n\t{\n\t if( $this->db->table_exists($this->c_table)) $record = $this->db->query(\"select * from {$this->c_table} where products_count<=? and order_amount<=? order by discount_percent desc\",array($this->products_count,$this->order_amount))->row_array();\n\t if(!@$record) return 0;\n\t return $record['discount_percent'];\n\t}", "function get_discounts_after_tax() {\n\t\t\tif ($this->discount_total) :\n\t\t\t\treturn cmdeals_price($this->discount_total); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "function discPerc($discPe)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT percent FROM adm_discount_list WHERE code=%s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($discPe, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"percent\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function cesta_sin_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta>0?$elArticulo->oferta:$elArticulo->precio;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "public function getTaxInvoiced();", "public function AssignDiscount()\n\t{\t\n\t}", "public function getDiscountCode()\n {\n return $this->discountCode;\n }", "public function getDiscountCode()\n {\n return $this->discountCode;\n }", "public function getTotalAfterDiscount()\n\t{\n\t\treturn $this->getKeyValue('total_after_discount'); \n\n\t}", "public function getDiscountInvoiced() {\n return $this->item->getDiscountInvoiced();\n }", "private function getItemDiscount(array $line)\n {\n $price = (int) ($line['price'] ?? null);\n //====================================================================//\n // Line has no Discounts\n if (empty($line['discount_allocations']) || empty($price)) {\n return 0;\n }\n //====================================================================//\n // Sum Discounts Amounts\n $amount = 0;\n foreach ($line['discount_allocations'] as $discount) {\n $amount += $discount['amount'];\n }\n //====================================================================//\n // If Quantity is defined => Divide\n if (isset($line['quantity'])) {\n $amount = $amount / $line['quantity'];\n }\n\n return 100 * ($amount / $price);\n }", "public function discountCalculator()\n\t{\n\t\tob_clean();\n\t\t$get = JRequest::get('GET');\n\t\t$this->_carthelper->discountCalculator($get);\n\t\texit;\n\t}", "function discMoney($discMo)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT money FROM adm_discount_list WHERE code=%s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($discMo, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"money\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }", "public function cesta_con_iva(){\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo){\r\n\t\t\t\t$precio = $elArticulo->oferta_iva>0?$elArticulo->oferta_iva:$elArticulo->precio_iva;\r\n\t\t\t\t$total+= round($elArticulo->unidades*$precio,2);\r\n\t\t\t}\r\n\t\t\treturn $total;\r\n\t\t}", "public function getDiscountAmount()\n\t{\n\t\treturn $this->discount_amount;\n\t}", "public function getMonto(){\n\n $var_sum = CarritoProductosWeb::model()->findBySql('select ROUND(sum(`precio_total`), 2) as `precio_total` from carrito_productos_web \n WHERE id_pedido ='.$this->id_pedido, array());\n\n return $var_sum->precio_total;\n }", "public function getDiscount($str)\r\n\t{\r\n\t\t$query = 'SELECT * FROM marketplaceDiscounts\r\n\t\t\tWHERE code = \"'.Database::escape($str).'\"';\r\n\t\t$this->_db->setQuery($query, 0, 1);\r\n\t\treturn $this->_db->loadAssoc();\r\n\t}", "public function getValue()\n {\n return $this->value instanceof CartDiscountValueBuilder ? $this->value->build() : $this->value;\n }", "public function getValue()\n {\n return $this->value instanceof CartDiscountValueBuilder ? $this->value->build() : $this->value;\n }", "public function getTotalPrice()\n {\n return @$this->attributes[\"valor_notafiscal\"];\n }", "function get_discounts_before_tax() {\n\t\t\tif ($this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "function ciniki_sapos_itemCalcAmount($ciniki, $item) {\n\n if( !isset($item['quantity']) || !isset($item['unit_amount']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.30', 'msg'=>'Unable to calculate the item amount, missing quantity or unit amount'));\n }\n\n $unit_amount = $item['unit_amount'];\n //\n // Apply the dollar amount discount first\n //\n if( isset($item['unit_discount_amount']) && $item['unit_discount_amount'] > 0 ) {\n $unit_amount = bcsub($unit_amount, $item['unit_discount_amount'], 4);\n }\n //\n // Apply the percentage discount second\n //\n if( isset($item['unit_discount_percentage']) && $item['unit_discount_percentage'] > 0 ) {\n $percentage = bcdiv($item['unit_discount_percentage'], 100, 4);\n $unit_amount = bcsub($unit_amount, bcmul($unit_amount, $percentage, 4), 4);\n }\n\n //\n // Calculate what the amount should have been without discounts\n //\n $subtotal = bcmul($item['quantity'], $item['unit_amount'], 2);\n\n //\n // Apply the quantity\n //\n $total = bcmul($item['quantity'], $unit_amount, 2);\n\n //\n // Calculate the total discount on the item\n //\n $discount = bcsub(bcmul($item['quantity'], $item['unit_amount'], 2), $total, 2);\n\n //\n // Calculate the preorder_amount, after all discount calculations because this amount will be paid later\n //\n $preorder = 0;\n if( isset($item['unit_preorder_amount']) ) {\n $preorder = bcmul($item['quantity'], $item['unit_preorder_amount'], 2);\n if( $preorder > 0 ) {\n $total = bcsub($total, $preorder, 2);\n }\n }\n\n return array('stat'=>'ok', 'subtotal'=>$subtotal, 'preorder'=>$preorder, 'discount'=>$discount, 'total'=>$total);\n}", "public function Fetch_price(){\n\n $ProductID = $this->input->post('p_id');\n $result = $this->db-> query(\"select * from Product where ProductID = '$ProductID'\")->row();\n $max_sell_price = $result->Price;\n $min_sell_price = $result->MinPrice;\n $max_discount_price = $max_sell_price - $min_sell_price ;\n\n echo $max_sell_price.\",\".$min_sell_price.\",\".$max_discount_price;\n }", "function calculatePrice($price, $discount){\n\t$DollarsOFF = $price * ($discount/100);\n\t$finalPrice = $price - $DollarsOFF;\n\treturn $finalPrice;\n}", "public function get_company_net_calculation() {\n $amount = '';\n $percentage = '';\n $tenant_id = $this->tenant_id;\n $discount = $this->input->post('discount');\n $class = $this->input->post('class');\n $company = $this->input->post('company');\n $amt = $this->input->post('amt');\n $per = $this->input->post('per');\n $classes = $this->class->get_class_details($tenant_id, $class);\n $courses = $this->course->get_course_detailse($classes->course_id);\n $gstrate = $this->classtraineemodel->get_gst_current();\n $data = $this->input->post('data');\n $discount_changed = $this->input->post('discount_changed');\n if($discount_changed == 'Y'){\n $temp_ind_discnt_amt = $discount; \n $discount_rate = round( (($temp_ind_discnt_amt/ $classes->class_fees) * 100), 4);\n $discount_total = round(($classes->class_fees *($discount_rate / 100)),4); \n }else{\n $discount = $this->classtraineemodel->calculate_discount_enroll(0, $company, $classes->class_id, $classes->course_id, $classes->class_fees); \n $discount_rate = $discount['discount_rate'];\n $discount_total = round(($classes->class_fees *($discount_rate / 100)),4);\n if ($discount_total > $classes->class_fees) {\n $discount_rate = 100;\n $discount_total = $classes->class_fees;\n }\n }\n $feesdue = round(($classes->class_fees - $discount_total),4);\n $company_net_due = 0;\n $company_subsidy = 0;\n $company_gst = 0;\n foreach ($data as $row) {\n if (!empty($row['subsidy_amount']) && !empty($row['subsidy_pers'])) {\n $subsidy = $row['subsidy_amount'];\n } else if (!empty($row['subsidy_amount'])) {\n $subsidy = $row['subsidy_amount'];\n } else if (!empty($row['subsidy_pers'])) {\n $subsidy = ($row['subsidy_pers'] * $feesdue) / 100;\n } else {\n $subsidy = 0;\n }\n if ($per == $row['user_id']) {\n $amount = $subsidy;\n }\n if ($amt == $row['user_id']) {\n $percentage = ($subsidy * 100) / $feesdue;\n }\n $gst_total = $this->classtraineemodel->calculate_gst($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, $subsidy, $gstrate);\n $calculated_net_due = $this->classtraineemodel->calculate_net_due($courses->gst_on_off, $courses->subsidy_after_before, $feesdue, $subsidy, $gstrate);\n if ($calculated_net_due < 0) {\n echo json_encode(array('error' => 'The Net amount is negative', 'amount' => $amount, 'percentage' => $percentage));\n exit();\n }\n $company_net_due = $company_net_due + round($calculated_net_due, 4); \n $company_subsidy = $company_subsidy + round($subsidy, 4); \n $company_gst = $company_gst + $gst_total; \n }\n echo json_encode(array('error' => '', 'company_net' => round($company_net_due, 4), 'amount' => $amount,\n 'discount_rate' => $discount_rate,\n 'percentage' => $percentage, 'company_subsidy' => round($company_subsidy, 4), 'company_gst' => round($company_gst, 4)));\n exit();\n }", "public function getShippingDiscountTaxCompensationAmount();", "public function sc_order_get_discount_amount( $total, $coupon, $order ) {\n\t\t\t$discount = 0;\n\n\t\t\tif ( $coupon instanceof WC_Coupon && $order instanceof WC_Order ) {\n\t\t\t\t$coupon_amount = $coupon->get_amount();\n\t\t\t\t$discount_type = $coupon->get_discount_type();\n\t\t\t\t$coupon_code = $coupon->get_code();\n\t\t\t\t$coupon_product_ids = $coupon->get_product_ids();\n\t\t\t\t$coupon_product_categories = $coupon->get_product_categories();\n\n\t\t\t\tif ( 'smart_coupon' === $discount_type ) {\n\n\t\t\t\t\t$calculated_total = $total;\n\n\t\t\t\t\tif ( count( $coupon_product_ids ) > 0 || count( $coupon_product_categories ) > 0 ) {\n\n\t\t\t\t\t\t$discount = 0;\n\t\t\t\t\t\t$line_totals = 0;\n\t\t\t\t\t\t$line_taxes = 0;\n\t\t\t\t\t\t$discounted_products = array();\n\n\t\t\t\t\t\t$order_items = $order->get_items( 'line_item' );\n\n\t\t\t\t\t\tforeach ( $order_items as $order_item_id => $order_item ) {\n\t\t\t\t\t\t\tif ( $discount >= $coupon_amount ) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $order_item['product_id'] );\n\n\t\t\t\t\t\t\tif ( count( $coupon_product_categories ) > 0 ) {\n\n\t\t\t\t\t\t\t\t$continue = false;\n\n\t\t\t\t\t\t\t\tif ( ! empty( $order_item_id ) && ! empty( $discounted_products ) && is_array( $discounted_products ) && in_array( $order_item_id, $discounted_products, true ) ) {\n\t\t\t\t\t\t\t\t\t$continue = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! $continue && count( array_intersect( $product_cats, $coupon_product_categories ) ) > 0 ) {\n\n\t\t\t\t\t\t\t\t\t$discounted_products[] = ( ! empty( $order_item_id ) ) ? $order_item_id : '';\n\n\t\t\t\t\t\t\t\t\t$line_totals += $order_item['line_total'];\n\t\t\t\t\t\t\t\t\t$line_taxes += $order_item['line_tax'];\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( count( $coupon_product_ids ) > 0 ) {\n\n\t\t\t\t\t\t\t\t$continue = false;\n\n\t\t\t\t\t\t\t\tif ( ! empty( $order_item_id ) && ! empty( $discounted_products ) && is_array( $discounted_products ) && in_array( $order_item_id, $discounted_products, true ) ) {\n\t\t\t\t\t\t\t\t\t$continue = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( ! $continue && in_array( $order_item['product_id'], $coupon_product_ids, true ) || in_array( $order_item['variation_id'], $coupon_product_ids, true ) ) {\n\n\t\t\t\t\t\t\t\t\t$discounted_products[] = ( ! empty( $order_item_id ) ) ? $order_item_id : '';\n\n\t\t\t\t\t\t\t\t\t$line_totals += $order_item['line_total'];\n\t\t\t\t\t\t\t\t\t$line_taxes += $order_item['line_tax'];\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$calculated_total = round( ( $line_totals + $line_taxes ), wc_get_price_decimals() );\n\n\t\t\t\t\t}\n\t\t\t\t\t$discount = min( $calculated_total, $coupon_amount );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $discount;\n\t\t}", "function get_discount_info($product) {\r\n $response_arr = array(); \r\n if ($this->total_level_1 > 0) {\r\n $h_exp = $this->get_level_policy($this->total_discount_1, $this->total_level_1); \r\n $response_arr[] = $h_exp; \r\n }\r\n\r\n if ($this->total_level_2 > 0) {\r\n $h_exp = $this->get_level_policy($this->total_discount_2, $this->total_level_2); \r\n $response_arr[] = $h_exp; \r\n }\r\n\r\n if ($this->total_level_3 > 0) {\r\n $h_exp = $this->get_level_policy($this->total_discount_3, $this->total_level_3); \r\n $response_arr[] = $h_exp; \r\n }\r\n\r\n if ($this->total_level_4 > 0) {\r\n $h_exp = $this->get_level_policy($this->total_discount_4, $this->total_level_4); \r\n $response_arr[] = $h_exp; \r\n }\r\n\r\n if ($this->total_level_5 > 0) {\r\n $h_exp = $this->get_level_policy($this->total_discount_5, $this->total_level_5); \r\n $response_arr[] = $h_exp; \r\n }\r\n\r\n for ($i = 0, $n=sizeof($this->extra_levels); $i < $n; $i++) {\r\n $h_exp = $this->get_level_policy( $this->extra_discounts[$i], $this->extra_levels[$i]);\r\n $response_arr[] = $h_exp; \r\n }\r\n return $response_arr; \r\n }", "function priceCart(){\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$sum += $book['precio']*$book['cantidad'];\n\t\t}\n\t\treturn $sum;\n\t}", "private function getTotalWithPromo($promo, &$discount) {\n if (strcasecmp($promo, 'INSTA') == 0) {\n $totalNoSale = $this->getCartTotal($_SESSION['cart']);\n } else {\n $totalNoSale = $this->getCartNoSaleTotal($_SESSION['cart']);\n } \n if ($discount['amount'] > $totalNoSale * 0.25) {\n $discount['percent'] = 25;\n $discount['amount'] = 0;\n }\n $total = $this->getCartTotal($_SESSION['cart']) - $discount['amount'] - floor($totalNoSale * $discount['percent'] / 100);\n if ($total < 0) {\n $total = 0;\n }\n return $total;\n }" ]
[ "0.757209", "0.74688286", "0.73842245", "0.7383079", "0.72471625", "0.7205003", "0.7157469", "0.7145455", "0.7140655", "0.7063209", "0.7063209", "0.7063209", "0.7063209", "0.7063209", "0.7063209", "0.705828", "0.7034568", "0.6988037", "0.69079214", "0.6852381", "0.6748888", "0.6740289", "0.6659864", "0.6620668", "0.66086775", "0.6603482", "0.6600337", "0.6594761", "0.659377", "0.65873903", "0.65866023", "0.65603703", "0.6552521", "0.65341145", "0.6522457", "0.651673", "0.6490275", "0.64800996", "0.64616865", "0.6454334", "0.64501303", "0.6440411", "0.6435279", "0.6424101", "0.6422556", "0.64126855", "0.6406387", "0.6402573", "0.6382409", "0.63738525", "0.6361933", "0.63391274", "0.6338025", "0.63332343", "0.632474", "0.63231933", "0.63211894", "0.63145953", "0.62982154", "0.62979823", "0.62865895", "0.6280407", "0.6277908", "0.6273541", "0.6270026", "0.62566227", "0.62435025", "0.6237291", "0.6233394", "0.6233076", "0.6209702", "0.6203436", "0.619594", "0.619265", "0.61835736", "0.61797446", "0.6173435", "0.6173435", "0.617045", "0.6169331", "0.61661327", "0.61643654", "0.6164311", "0.6163518", "0.61596084", "0.6125977", "0.61147255", "0.61051434", "0.61039037", "0.61039037", "0.6097683", "0.60963017", "0.60925657", "0.60875857", "0.6079419", "0.6074552", "0.6063849", "0.6058113", "0.6051127", "0.60482997", "0.60473627" ]
0.0
-1
Display a listing of the resource.
public function getUserCompany() { $user_company = \App\User::with(['company'])->where('id', Auth::user()->id)->first(); return $user_company ? $user_company : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Check if params duplicated with previously step
public static function compareParams(array $oldParams, array $newParams): bool { // todo: or compare just file ids? unset( $oldParams['valueBefore'], $newParams['valueBefore'], $oldParams['type'], $newParams['type'] ); return $oldParams === $newParams; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlHasDuplicateParameters($queryString){\n //Segment the query string by breaking up each parameter into key value pairs delimited by '&'\n\t\t$parts = explode('&', $queryString);\n\t\t$parameters = array();\n\t\t\n //Loop through each parameter and push into an array, checking if its already been added\n\t\tforeach($parts as $part){\n\t\t\t$key = substr($part, 0, strpos($part, '='));\n\t\t\tif (in_array($key, $parameters)){\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tarray_push($parameters, $key);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function check_duplicate()\n {\n }", "public function hasAnotherStep()\n {\n return $this->instance->current_step < (count($this->steps) - 1);\n }", "public function hasParameters(){\n return $this->_has(2);\n }", "function checkForDuplicateUnique(){\n $_ufields_arr = explode(\",\", $this->listSettings->GetItem(\"MAIN\", \"UNIQUE_FIELDS\"));\n $check_fields = true;\n for ($i = 0; $i < sizeof($_ufields_arr); $i ++) {\n list ($_field[$i], $_value[$i]) = explode(\"=\", $_ufields_arr[$i]);\n if (strlen($_value[$i])) {\n $check_fields = false;\n $_query_arr[$_field[$i]] = $_value[$i];\n if ($this->_data[$_field[$i]] == $_value[$i]) {\n $check_fields = true;\n }\n }\n else {\n $_query_arr[$_field[$i]] = $this->_data[$_field[$i]];\n }\n }\n if ($check_fields) {\n $_data = $this->Storage->GetByFields($_query_arr, null);\n }\n else {\n $_data = array();\n }\n if (! empty($_data)) {\n if (($this->item_id != $_data[$this->key_field])) {\n if ($this->Kernel->Errors->HasItem($this->library_ID, \"RECORD_EXISTS\")) {\n $_error_section = $this->library_ID;\n }\n else {\n $_error_section = \"GlobalErrors\";\n }\n $this->validator->SetCustomError($_ufields_arr, \"RECORD_EXISTS\", $_error_section);\n }\n }\n }", "function isOnStep($step) {\n global $GLOBAL;\n\tif($GLOBAL['id']==$step)\n\t\treturn true;\n}", "public function hasParams(){\n return $this->_has(8);\n }", "public function areNamesParamsIdentical(): bool;", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "function post_all_exists($parameters){\n foreach($parameters as $parameter){\n if(!post_exists($parameter)) return false;\n }\n return true;\n}", "private function checkParams($params){\n\n if(count($params) == 3)\n return true;\n else\n return false;\n }", "protected function checkUrlKeyDuplicates()\n {\n $resource = $this->getResource();\n foreach ($this->urlKeys as $storeId => $urlKeys) {\n $urlKeyDuplicates = $this->_connection->fetchAssoc(\n $this->_connection->select()->from(\n ['url_rewrite' => $resource->getTable('url_rewrite')],\n ['request_path', 'store_id']\n )->joinLeft(\n ['cpe' => $resource->getTable('catalog_product_entity')],\n \"cpe.entity_id = url_rewrite.entity_id\"\n )->where('request_path IN (?)', array_keys($urlKeys))\n ->where('store_id IN (?)', $storeId)\n ->where('cpe.sku not in (?)', array_values($urlKeys))\n );\n foreach ($urlKeyDuplicates as $entityData) {\n $rowNum = $this->rowNumbers[$entityData['store_id']][$entityData['request_path']];\n $message = sprintf(\n $this->retrieveMessageTemplate(ValidatorInterface::ERROR_DUPLICATE_URL_KEY),\n $entityData['request_path'],\n $entityData['sku']\n );\n $this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum, 'url_key', $message);\n }\n }\n }", "public function testDuplicate()\n {\n $this->duplicate(\n [\n 'tabId' => 1,\n ],\n [\n 'tabId' => 1,\n ]\n );\n }", "private function _hasAllArguments()\n {\n $errors = [];\n foreach ($this->action->args as $key => $val) {\n if (!isset($this->args[$key])) {\n $errors[] = $key;\n }\n }\n\n return $errors;\n }", "function checkFormParams($param_array){\n\t$cnt = 0;\n\tfor($i=0; $i < count($param_array); $i++){\n\t\tif(isset($_POST[$param_array[$i]])){\n\t\t\t$params_set[$param_array[$i]] = $_POST[$param_array[$i]];\n\t\t\t$cnt++;\n\t\t}\n\t\t$params_set[\"cnt\"] = $cnt;\n\t}\n\treturn $params_set;\n}", "public function isLastStep();", "function has_keep_parameters()\n{\n static $answer = null;\n if ($answer !== null) {\n return $answer;\n }\n\n foreach (array_keys($_GET) as $key) {\n if (\n isset($key[0]) &&\n $key[0] == 'k' &&\n substr($key, 0, 5) == 'keep_'\n //&& $key != 'keep_devtest' && $key != 'keep_show_loading'/*If testing memory use we don't want this to trigger it as it breaks the test*/\n ) {\n $answer = true;\n return $answer;\n }\n }\n $answer = false;\n return $answer;\n}", "protected function hasAllParameters($input)\n {\n $arguments = $input->getArguments();\n $last = end($arguments);\n\n // If the last parameter does not have a value,\n // then not all parameters were supplied. If the last\n // argument is an array, then variable arguments are\n // supported, so we will always be able to add more.\n if (empty($last) || is_array($last)) {\n return false;\n }\n\n // All parameters have values already.\n return true;\n }", "function stepExists($stepname)\r\n {\r\n return array_key_exists($stepname, $this->_steps);\r\n }", "public function _validateAdServingParamatersStepByStep()\n {\n return [\n 'status' => false,\n 'error' => 'There is no suitable ads'\n ];;\n }", "public function isDuplicateValue(): bool\n\t{\n\t\t$picklistValues = \\App\\Fields\\Picklist::getValuesName($this->fieldModel->getName());\n\t\tif ($this->id) {\n\t\t\tunset($picklistValues[$this->id]);\n\t\t}\n\n\t\treturn \\in_array(strtolower($this->name), array_map('strtolower', $picklistValues));\n\t}", "function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function checkduplicatetypefield()\n\t{\n\n\t\t$check = $this->base_model->fetch_records_from(TBL_SETTINGS_FIELDS,array('field_name' => $this->input->post('field_name'), 'sms_gateway_id' => $this->input->post('sms_gateway_id')));\t\t\n\t\tif (count($check) == 0 && $this->input->post('id') == '') {\n\t\t return true;\n\t\t} elseif((count($check) >= 1 || count($check) == 0)&& $this->input->post('id') != '') {\n\t\t\treturn true;\n\t\t}else {\n\t\t $this->form_validation->set_message('checkduplicatetypefield', $this->phrases['duplicate']);\n\t\t return false;\n\t\t}\n\t}", "public function hasParameters()\n {\n return !empty($this->params);\n }", "public function hasParameters()\n {\n return count($this->parameters) > 0;\n }", "function isDuplicateBookmark($value, $empty, &$params, &$formvars) {\n\n if (empty($formvars['url'])) return false;\n if ($this->bm->getByID($formvars['url'])) return false;\n return true;\n\n }", "public function havingArguments();", "public function passes($attribute, $value)\n {\n foreach($value as $v){\n if($v['merge_type'] == 1 && count($v['prev_step_key'])==1){\n $next = $this->checkMergeType($value,$v['prev_step_key'][0]);\n if(count($next)>1){\n $this->msg =$v['name'].' 步骤不能配置合并';\n return false;\n }\n }\n }\n return true;\n }", "public function checkRequiredParamsSet() : bool {\n }", "function parse_param_exists($param_key, $data, $debug = false) {\n\n\n if ($debug) {\n echo __FUNCTION__ . \" \";\n print_r(compact('param_key', 'data'));\n }\n $chain = $this->parse_param_chain($param_key);\n switch (count($chain)) {\n case 1:\n return array_key_exists($param_key, $data);\n break;\n case 2:\n return\n array_key_exists($chain[0], $data) &&\n array_key_exists($chain[1], $data[$chain[0]]);\n break;\n case 3:\n return\n array_key_exists($chain[0], $data) &&\n array_key_exists($chain[1], $data[$chain[0]]) &&\n array_key_exists(\n $chain[2], $data[$chain[0]][$chain[1]]);\n break;\n case 4:\n return\n array_key_exists($chain[0], $data) &&\n array_key_exists($chain[1], $data[$chain[0]]) &&\n array_key_exists(\n $chain[2], $data[$chain[0]][$chain[1]]) &&\n array_key_exists(\n $chain[3], $data[$chain[0]][$chain[1]][$chain[2]]);\n break;\n }\n return false;\n }", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "public function testDuplicate()\n {\n $this->duplicate(\n array_merge(\n $this->_createData1(),\n $this->_createData2()\n ),\n array_merge(\n $this->_expectData1(),\n $this->_expectData2()\n )\n );\n }", "function checkQueryParams($param_array){\n\t$cnt = 0;\n\tfor($i=0; $i < count($param_array); $i++){\n\t\tif(isset($_GET[$param_array[$i]])){\n\t\t\t$params_set[$param_array[$i]] = $_GET[$param_array[$i]];\n\t\t\t$cnt++;\n\t\t}\n\t\t$params_set[\"cnt\"] = $cnt;\n\t}\n\treturn $params_set;\n}", "abstract public function isDuplicatePIMAddition($id);", "public function hasRepeatedObjField()\n {\n return count($this->get(self::REPEATED_OBJ_FIELD)) !== 0;\n }", "public function testMergeParams()\n {\n $instance = $this->getMockForTrait(DuplicationComponent::class);\n $reflex = new \\ReflectionClass($instance);\n\n $mergeParam = $reflex->getMethod('mergeParam');\n $mergeParam->setAccessible(true);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n false\n );\n $this->getTestCase()->assertEquals(['hello'=>'torvald', 'hella' => 'warld'], $result);\n\n $result = $mergeParam->invoke(\n $instance,\n ['hello'=>'world', 'hella' => 'warld'],\n ['hello' => 'torvald'],\n true\n );\n $this->getTestCase()->assertEquals(['hello' => 'torvald'], $result);\n }", "public function ajax_checkduplicate()\r\n {}", "public function ajax_checkduplicate()\r\n {}", "protected function checkParameters()\n\t{\n\t\t$this->dbResult['REQUEST'] = array(\n\t\t\t'GET' => $this->request->getQueryList()->toArray(),\n\t\t\t'POST' => $this->request->getPostList()->toArray(),\n\t\t);\n\n\t\t$this->arParams['PATH_TO_LOCATIONS_LIST'] = CrmCheckPath('PATH_TO_LOCATIONS_LIST', $this->arParams['PATH_TO_LOCATIONS_LIST'], '');\n\t\t$this->arParams['PATH_TO_LOCATIONS_EDIT'] = CrmCheckPath('PATH_TO_LOCATIONS_EDIT', $this->arParams['PATH_TO_LOCATIONS_EDIT'], '?loc_id=#loc_id#&edit');\n\t\t//$this->arParams['PATH_TO_LOCATIONS_ADD'] = CrmCheckPath('PATH_TO_LOCATIONS_ADD', $this->arParams['PATH_TO_LOCATIONS_ADD'], '?add');\n\t\t\n\t\t$this->componentData['LOCATION_ID'] = isset($this->arParams['LOC_ID']) ? intval($this->arParams['LOC_ID']) : 0;\n\n\t\tif($this->componentData['LOCATION_ID'] <= 0)\n\t\t{\n\t\t\t$locIDParName = isset($this->arParams['LOC_ID_PAR_NAME']) ? intval($this->arParams['LOC_ID_PAR_NAME']) : 0;\n\n\t\t\tif($locIDParName <= 0)\n\t\t\t\t$locIDParName = 'loc_id';\n\n\t\t\t$this->componentData['LOCATION_ID'] = isset($this->dbResult['REQUEST']['GET'][$locIDParName]) ? intval($this->dbResult['REQUEST']['GET'][$locIDParName]) : 0;\n\t\t}\n\n\t\treturn true;\n\t}", "public function hasParameters()\n {\n return isset($this->parameters);\n }", "function get_all_exists($parameters){\n foreach($parameters as $parameter){\n if(!get_exists($parameter)) return false;\n }\n return true;\n}", "public function has_parameters() {\r\n\t\treturn (sizeof($this->parameters) > 0);\r\n\t}", "protected function _isDublicatedData($params){\r\n\t $quoteId = $params['quote_id'];\r\n\t $productId = $params['product_id'];\r\n $qtyRequest = $params['request_qty'];\r\n \r\n\t $collection = Mage::getModel('qquoteadv/requestitem')->getCollection()\r\n \t ->addFieldToFilter('quote_id', $quoteId)\r\n \t ->addFieldToFilter('product_id', $productId)\r\n \t ->addFieldToFilter('request_qty', $qtyRequest)\r\n \t //->load(true)\r\n \t ;\r\n \t \r\n return (count($collection) > 0)?true:false; \r\n\t}", "public function parameterExists($key);", "private function isDuplicate($name = '') {\n\t\treturn false;\n\t}", "private function unique ($param)\n {\n list($Class, $Method) = explode(',', $param);\n $Count = $Class::$Method($this->value, self::$ExceptID);\n if ($Count)\n {\n $this->SetError('unique', 'The '.$this->SpacedKey.' field value is already in use and must be unique');\n return false;\n }\n return true;\n }", "protected function verifyParams() {\n\t\t\treturn true;\n\t\t}", "function testIsUriAliasDuplicated()\n {\n\n $this->assertTrue($this->da->isUriAliasDuplicated('my_alias', $sectionId = null));\n $this->assertTrue($this->da->isUriAliasDuplicated('my_alias', $sectionId = 32));//non-existant id\n }", "public function valid(): bool\n {\n return isset($this->parameters[$this->position]);\n }", "function isTheseParametersAvailable($params){\n\t\t\n\t\t//traversing through all the parameters \n\t\tforeach($params as $param){\n\t\t\t//if the paramter is not available\n\t\t\tif(!isset($_POST[$param])){\n\t\t\t\t//return false \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\t//return true if every param is available \n\t\treturn true; \n\t}", "public function hasParameters()\n {\n return isset($this->parameters) && count($this->parameters) > 0;\n }", "function duplicateStepsForTestCase($testCase, $relation, $clientID) {\n\n global $definitions;\n\n //DEFINITIONS\n $itemTypeStepsID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n\n //DEFINITIONS FOR PROPERTIES\n $tcParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $relatedStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRelatedID'], $clientID);\n $relatedRelationPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n\n //First, duplicate the steps inside the test case and set the new relation\n //build the return array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $tcParentPropertyID, 'value' => $testCase);\n $filters[] = array('ID' => $relatedStepPropertyID, 'value' => 0);\n\n // get testcase steps\n $steps = getFilteredItemsIDs($itemTypeStepsID, $clientID, $filters, $returnProperties);\n\n foreach ($steps as $step) {\n // make a copy of the step\n $stepCopy = duplicateItem($itemTypeStepsID, $step['ID'], $clientID);\n\n // change some properties\n setPropertyValueByID($relatedStepPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $step['ID'], '', $RSuserID);\n setPropertyValueByID($relatedRelationPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $relation['ID'], '', $RSuserID);\n }\n}", "public function paramExists (string $key)\n {\n if (array_key_exists($key, $this->getParams()))\n return true;\n\n return false;\n }", "function check_actions($observed_fields, $pas, $start_field_set = null) // {{{\n{\n // Set initial field set to empty if not given\n if ($start_field_set === null)\n $start_field_set = new FieldSet();\n else\n $start_field_set = $start_field_set->getClone();\n // Apply actions\n $pas->applyAll($start_field_set);\n // Compare result with extracted field set\n $diff = $observed_fields->differenceWith($start_field_set);\n return $diff;\n}", "public function is_duplicate() {\n\n\t\t$post = $this->input->post();\n\n\t\t// Filter by name.\n\t\t$this->db->where( 'name', trim( $post['name'] ) );\n\n\t\t// Filter by church.\n\t\t$this->db->where( 'church', (int) $post['church'] );\n\n\t\t// Filter by age.\n\t\tif ( ! empty( $post['age'] ) ) {\n\t\t\t$this->db->where( 'age', (int) $post['age'] );\n\t\t}\n\n\t\t// Filter by gender.\n\t\tif ( ! empty( $post['gender'] ) ) {\n\t\t\t$this->db->where( 'gender', $post['gender'] );\n\t\t}\n\n\t\t$query = $this->db->get( 'registration' );\n\n\t\treturn $query->num_rows() > 0;\n\n\t}", "public function clearParams(){\n\t\t$this->params = $this->paramsDefaults;\n\t\treturn true;\n\t}", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "function isLastStep()\r\n {\r\n $steps = array_keys($this->_steps);\r\n return count($steps) > 0 && array_pop($steps) == $this->getStepName();\r\n }", "public function hasOtherPrimesInfoParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_OTH);\n }", "public function checkDuplicate($check) {\n $existing_plot = $this->find('count', array(\n 'conditions' => $check,\n 'recursive' => -1\n ));\n\t/*\t\n\t\tif($existing_plot >= 1)\n\t\t\techo '<script>alert(\"Plot already in use.\");</script>';\n\t*/\t\t\n\t return $existing_plot < 1 ;\n }", "private function goalAlreadyExists() {\r\n $post_array = json_decode($this->requestParameters);\r\n $type = array_search($post_array->type, $this->type_array);\r\n\r\n if ($type === GOAL_TYPE_ENGAGEMENT || $type === GOAL_TYPE_AFFILIATE) {\r\n $query = $this->db->select('collection_goal_id')\r\n ->from('collection_goals')\r\n ->where('landingpage_collectionid', $this->project)\r\n ->where('type', $type)\r\n ->get();\r\n\r\n if ($query->num_rows() > 0) {\r\n return $query->row()->collection_goal_id;\r\n }\r\n }\r\n return FALSE;\r\n }", "public function hasParameters() {\n $count = count($this->getParameters());\n \n return ($count > 0) ? $count : FALSE;\n }", "public function isInputsHaveSameRatio(): bool\n {\n $this->consistencyCheck();\n \n $input_list = ProjectInputs::query()->where('project', $this->id)->get();\n if (count($input_list) > 1) {\n return $input_list->where('status', InputStatuses::WRONG_RATIO)->isNotEmpty();\n } else {\n return false;\n }\n }", "public function goCheck(){\n $request = Request::instance();\n\n $params = $request->param();\n\n //check the input params\n $result = $this->batch()->check($params);\n\n //adjust the checked result\n if($result){\n return true;\n }else{\n $ex = new InputParamsErr();\n $ex->errMsg = $this->getError();\n throw $ex;\n }\n }", "public function _getExistCreated()\n\t{\n\t\t$controller_session = $this->Session->read('Wizard.configuration.controller');\n\t\t$controller_actif = $this->_getController()->getName();\n\t\t$controller_session = Inflector::camelize($controller_session);\n\n\t\tif( $controller_session != $controller_actif ){\n\t\t\treturn $this->redirect();\n\t\t}\n\t\t\n\t\t$need = 0;\n\t\t\n\t\tif( $this->_getExist()){\n\n\t\t\t$step = $this->Session->read('Wizard.step');\n\t\t\t\n\t\t\tif( $step > 1 ){\n\n\t\t\t\t$need = $this->loadExist();\n\n\t\t\t\tif( empty( $need ) ){\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\t$path = $this->Session->read('Wizard.configuration.key');\n\n\t\t\t\t$keys = explode( '.', $path );\n\t\t\t\t\n\t\t\t\tif(isset($keys[0]) && isset($keys[1])){\n\t\t\t\t\t$model \t= $keys[0];\n\t\t\t\t\t$key \t= $keys[1];\n\t\t\t\t\t\n\t\t\t\t\t$model = TableRegistry::get($model);\n\t\t\t\t\t\n\t\t\t\t\t$query = $model->find('all')\n\t\t\t\t\t\t\t\t ->select([$key])\n\t\t\t\t\t\t\t\t ->where([$key.' IN'=>(array)$need])\n\t\t\t\t\t\t\t\t ->toArray();\n\n\t\t\t\t\tif( empty( $query ) ){\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $need;\n\t}", "public function check_duplicate($args)\r\n\t{\r\n\t\t//Check duplicate\r\n\t\t$webpages;\r\n\t\tif(!isset($args->id) || intval($args->id) <= 0)\r\n\t\t\t$webpages = Webpage::where('title','=', $args->title)->get();\r\n\t\telse\r\n\t\t\t$webpages = Webpage::where('title','=', $args->title)->where('id', '<>', $args->id)->get();\r\n \r\n\t\tforeach ($webpages as $webpage)\r\n\t\t{\r\n\t\t if((isset($webpage->id) && intval($webpage->id) > 0))\r\n\t\t\t{\r\n\t\t\t\tResponse::error(MSG_PAGE_EXISTS);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!isset($args->id) || intval($args->id) <= 0)\r\n\t\t\t$webpages = Webpage::where('url','=', $args->url)->get();\r\n\t\telse\r\n\t\t\t$webpages = Webpage::where('url','=', $args->url)->where('id', '<>', $args->id)->get();\r\n \r\n\t\tforeach ($webpages as $webpage)\r\n\t\t{\r\n\t\t if((isset($webpage->id) && intval($webpage->id) > 0))\r\n\t\t\t{\r\n\t\t\t\tResponse::error(MSG_URL_EXISTS);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function hasParameters()\n {\n return preg_match('/\\{/', $this->pattern) === 1;\n }", "public function fnCheckParams(&$oNode, $bAllowDuplicates) \n {\n $aNameHash = [];\n if (is_array($oNode->aParams))\n foreach ($oNode->aParams as &$oParam)\n $this->fnCheckLVal($oParam, Scope::BIND_VAR, $bAllowDuplicates ? null : $aNameHash);\n }", "public function graded($phase)\n {\n if($phase == 'a'){\n $evaluations = Evaluation::where('site_id', $this->id)->get();\n }\n\n if($phase == 'b'){\n $evaluations = Evaluation_b::where('site_id', $this->id)->get();\n }\n\n if($phase == 'c'){\n $evaluations = Evaluation_c::where('site_id', $this->id)->get();\n } \n\n $counter = 0;\n\n foreach($evaluations as $evaluation){\n\n if($evaluation->complete()){\n $counter++;\n }\n\n } \n\n if($evaluations->count() >= 2 && $counter >= 2){\n return true;\n } else {\n return false;\n }\n\n }", "private function collectRequiredParams() {\n $dst = array();\n foreach ($this->getAllOptions() as $param) \n {\n if ($this->paramIsRequired($param) === true) \n {\n $dst[] = $this->clearParam($param); \n }\n \n }\n\n return $dst;\n }", "function isTheseParametersAvailable($params){\n //assuming all parameters are available \n $available = true; \n $missingparams = \"\"; \n \n foreach($params as $param){\n if(!isset($_POST[$param]) || strlen($_POST[$param])<=0){\n $available = false; \n $missingparams = $missingparams . \", \" . $param; \n }\n }\n \n //if parameters are missing \n if(!$available){\n $response = array(); \n $response['error'] = true; \n $response['message'] = 'Parameters ' . substr($missingparams, 1, strlen($missingparams)) . ' missing';\n \n //displaying error\n echo json_encode($response);\n \n //stopping further execution\n die();\n }\n }", "public function perExiste($log){\n if($this->getNumPer($log)!=null){\n return true;\n }\n else{\n return false;\n }\n }", "public function incrementFailures(): bool;", "function valExistence_check($postedID, $watuObj) {\r\n\r\n $errorVal = true;\r\n $valDoesExist = true;\r\n\r\n $valExistence = ['', '', '']; //might not work\r\n $valExistence[0] = get_post_meta($postedID, 'wpsl_certification_url1', true);\r\n $valExistence[1] = get_post_meta($postedID, 'wpsl_certification_url2', true);\r\n $valExistence[2] = get_post_meta($postedID, 'wpsl_certification_url3', true);\r\n\r\n if (!empty($valExistence[0]) || !empty($valExistence[1]) || !empty($valExistence[2])) {\r\n $valDoesExist = true;\r\n foreach ($watuObj as $val) {\r\n if (!in_array($val, $valExistence)) {\r\n if (empty($valExistence[0])) {\r\n if (($valExistence[1] != $val) && ($valExistence[2] != $val)) {\r\n $errorVal = update_post_meta($postedID, 'wpsl_certification_url1', $val);\r\n }\r\n } elseif (empty($valExistence[1])) {\r\n if (($valExistence[0] != $val) && ($valExistence[2] != $val)) {\r\n $errorVal = update_post_meta($postedID, 'wpsl_certification_url2', $val);\r\n }\r\n } elseif (empty($valExistence[2])) {\r\n if (($valExistence[0] != $val) && ($valExistence[1] != $val)) {\r\n $errorVal = update_post_meta($postedID, 'wpsl_certification_url3', $val);\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n $valDoesExist = false;\r\n }\r\n\r\n return $valDoesExist;\r\n}", "protected function checkServiceArgumentsReferences()\n {\n $this\n ->services\n ->each(function (ServiceDefinition $serviceDefinition) {\n\n $serviceDefinition\n ->getArgumentChain()\n ->each(function (Argument $argument) use ($serviceDefinition) {\n\n $argumentValue = $argument->getValue();\n if ($argument instanceof ServiceArgument) {\n\n if (!$this->services->has($argumentValue)) {\n\n throw new DoppoServiceArgumentNotExistsException(\n sprintf(\n 'Service \"%s\" not found in \"@%s\" arguments list',\n $argumentValue,\n $serviceDefinition->getName()\n )\n );\n }\n }\n\n if ($argument instanceof ParameterArgument) {\n\n if (!$this->parameters->has($argumentValue)) {\n\n throw new DoppoServiceArgumentNotExistsException(\n sprintf(\n 'Parameter \"%s\" not found in \"@%s\" arguments list',\n $argumentValue,\n $serviceDefinition->getName()\n )\n );\n }\n }\n });\n });\n }", "public function hasPrev() {\n return call(array($this, 'prev'), func_get_args()) != null;\n }", "public function check_duplicate() {\n $this->db->where ( 'orderID', trim ( $this->input->post ( 'orderID' ) ) );\n\n if ($this->db->count_all_results ( $this->table ))\n echo \"1\"; // duplicate\n else\n echo \"0\";\n }", "public function hasArg(string $name) : bool {\n $added = false;\n\n foreach ($this->getArguments() as $argObj) {\n $added = $added || $argObj->getName() == $name;\n }\n\n return $added;\n }", "function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }", "protected function checkDuplicate($array){\n $model = Stone::model()->findByAttributes(array('idstonem'=>$array['idstonem'], 'idshape'=>$array['idshape'], 'idstonesize'=>$array['idstonesize'], 'color'=>$array['color'], 'quality'=>$array['quality']));\n if(isset($model)){\n return false;\n }else{\n return true;\n }\n }", "function isFirstStep()\r\n {\r\n $steps = array_keys($this->_steps);\r\n return count($steps) > 0 && $steps[0] == $this->getStepName();\r\n }", "public function isDuplicate($data){\n $last_topic = $this->model->where('user_id', Auth::id())\n ->orderBy('id', 'desc')\n ->first();\n return count($last_topic) && strcmp($last_topic->title, $data['title']) === 0;\n }", "public function testDuplicate()\n {\n $this->duplicate(\n [\n 'catalogId' => 1,\n 'catalogInstanceId' => 1,\n 'count' => 1,\n 'status' => 0,\n ],\n [\n 'count' => ['minValue']\n ]\n );\n }", "public function chkUserDuplicate() {\n $this->load->model('register_model');\n $user_name = $this->input->post('user_name');\n $table_to_pass = 'mst_users';\n $fields_to_pass = array('user_id', 'user_name');\n $condition_to_pass = array(\"user_name\" => $user_name);\n $arr_login_data = $this->register_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\n if (count($arr_login_data)) {\n echo 'false';\n } else {\n echo 'true';\n }\n }", "public function doesProductsHaveDuplications()\n {\n $productIDs = array();\n foreach ($this->products as $product) {\n $productIDs[] = $product->product_id;\n }\n\n $uniqueProductIDs = array_unique($productIDs);\n return (count($productIDs) != count($uniqueProductIDs));\n }", "public function testParameters1()\n{\n\n // Traversed conditions\n // if (isset($this->parameters)) == true (line 379)\n\n $actual = $this->route->parameters();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "private function verifyParams( Array $params ) {\r\n $slot_count = substr_count( $this -> query_string, '?' );\r\n $param_count = count( $params );\r\n return ($slot_count == $param_count) ? true : false;\r\n }", "function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }", "public function hasParam($index): bool\n {\n return isset($this->params[$index]);\n }", "protected function isWizardDone() {}", "public function getValidParams()\n {\n if ($this->isModuleActive() && empty($this->scriptRan)) {\n $userIdKey = Mage::helper('kproject_sas')->getAffiliateIdentifierKey();\n if (!empty($userIdKey) && !isset($this->validParams[$userIdKey])) {\n $this->validParams[$userIdKey] = false;\n unset($this->validParams['userID']);\n }\n\n $clickIdKey = Mage::helper('kproject_sas')->getClickIdentifierKey();\n if (!empty($clickIdKey) && !isset($this->validParams[$clickIdKey])) {\n $this->validParams[$clickIdKey] = false;\n unset($this->validParams['sscid']);\n }\n $this->scriptRan = true;\n }\n\n return parent::getValidParams();\n }", "function __checkDuplicateName()\n {\n $result = $this->find('first', array('conditions' => array('name' => $this->data[$this->name]['name'])));\n if ($result) {\n $this->errorMessage='Duplicate name found. Please change the name.';\n return false;\n }\n\n return true;\n }", "function checkValuesAlreadyEntered(){\n\t\t$sql = \"SELECT COUNT(*)AS number FROM Task WHERE token='\".$_SESSION['token'].\"' LIMIT 1\";\n\t\t$stmt = self::$DB->prepare($sql);\n\t\tif($stmt->execute()){\n\t\t\t$stmt = $stmt->fetch();\n\t\t\tif($stmt['number']==0){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t$arr = array('success' => 1, 'error_msg' => 'Already entered');\n\t\t\t\techo json_encode($arr);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\t$arr = array('success' => 1, 'error_msg' => 'Already entered');\n\t\t\techo json_encode($arr);\n\t\t\treturn false;\n\t\t}\n\t}", "public function hookActionShopDataDuplication($params)\r\n\t{\r\n\t\tDb::getInstance()->execute('\r\n\t\tINSERT IGNORE INTO '._DB_PREFIX_.'staticblock_shop (id_staticblock, id_shop, is_active)\r\n\t\tSELECT id_staticblock, '.(int)$params['new_id_shop'].', is_active\r\n\t\tFROM '._DB_PREFIX_.'staticblock_shop\r\n\t\tWHERE id_shop = '.(int)$params['old_id_shop']);\r\n\t\t\r\n\t\t//duplicate hometab language for shop\r\n\t\tDb::getInstance()->execute('\r\n\t\tINSERT IGNORE INTO '._DB_PREFIX_.'staticblock_lang (id_staticblock, id_lang, id_shop, title, content)\r\n\t\tSELECT id_staticblock, id_lang, '.(int)$params['new_id_shop'].', title, content\r\n\t\tFROM '._DB_PREFIX_.'staticblock_lang\r\n\t\tWHERE id_shop = '.(int)$params['old_id_shop']);\r\n\t}", "private function is_duplicate () {\n $email = $this->payload['email'];\n $facebook_id = '0';\n if (!empty($this->payload['facebook_id'])) {\n $facebook_id = $this->payload['facebook_id'];\n }\n $sql = \"SELECT id FROM users WHERE email='$email' OR facebook_id='$facebook_id'\";\n $sql = $this->conn->query($sql);\n\n return $sql->num_rows > 0;\n }", "public function hasMutations(){\n return $this->_has(2);\n }", "public function isNeedPush(): bool\n\t{\n\t\treturn !empty($this->params);\n\t}" ]
[ "0.6206604", "0.57533675", "0.55989134", "0.5512056", "0.5323277", "0.53105134", "0.52966106", "0.5292363", "0.52904546", "0.52904546", "0.52904546", "0.52904546", "0.52904546", "0.52893615", "0.52849996", "0.5223232", "0.52134234", "0.521207", "0.5198484", "0.5182664", "0.51761407", "0.5175008", "0.51712954", "0.5159517", "0.51384497", "0.5137881", "0.5121946", "0.5116972", "0.51045793", "0.5079471", "0.5070941", "0.5064412", "0.50494593", "0.5044382", "0.5036851", "0.5035857", "0.5035093", "0.5030443", "0.5029717", "0.5021797", "0.50175905", "0.50175905", "0.501716", "0.50164473", "0.5002546", "0.5001493", "0.49998984", "0.49986973", "0.49920323", "0.49439526", "0.49390256", "0.49355426", "0.49305242", "0.49199197", "0.49135622", "0.49044144", "0.4902486", "0.4893094", "0.48892173", "0.48757744", "0.48731244", "0.4871574", "0.48683846", "0.48555467", "0.48417825", "0.48265323", "0.48256406", "0.4825084", "0.4820942", "0.48121417", "0.48109123", "0.48089826", "0.48040903", "0.48011166", "0.48007858", "0.48004496", "0.47744623", "0.47606155", "0.47583756", "0.47492847", "0.47463036", "0.47456536", "0.47452733", "0.4738889", "0.47347984", "0.4733422", "0.47280967", "0.47255448", "0.4715387", "0.47058135", "0.47009706", "0.47002596", "0.47002167", "0.46998787", "0.46956292", "0.4694672", "0.46937317", "0.46900368", "0.46879622", "0.46859196", "0.4684443" ]
0.0
-1
Returns if the request was a success
public function getSuccess();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSuccess ()\n {\n return $this->info[ 'http_code' ] == '200';\n }", "public function isRequestSuccess(): bool\n {\n return count($this->errors) === 0;\n }", "public function isRequestSuccessful()\n {\n return strtolower($this->transaction->getMessages()->getResultCode()) === 'ok';\n }", "public function wasSuccess() {\n return $this->requestStatus;\n }", "public function isSuccess();", "public function isSuccess();", "public function isSuccess();", "public function isSuccess();", "public function isSuccess(): bool\n {\n return $this->get('json', 'error') === false;\n }", "public function isSuccessful() {\n\n return $this->result->success && 200 == $this->result->status_code;\n }", "public function success()\n {\n return ( \n ! empty($this->result) \n && $this->result->getStatus() == 'Success' \n && $this->result->getCode() == 200 );\n }", "public function isSuccessful();", "public function isSuccessful()\n {\n return $this->response->getStatusCode() >= 200 && $this->response->getStatusCode() < 300;\n }", "public function request_succeeded()\n {\n return curl_errno($this->ch) === 0;\n }", "public function isSuccessful() {}", "public function isSuccessful()\n {\n return $this->data['status'];\n }", "public function isSuccess()\n {\n return $this->getStatus() === 'Success' && $this->getCode() === 200;\n }", "public function isSuccessful()\n {\n return isset($this->data['status']) && $this->data['status'] === 'success';\n }", "function successful()\n\t{\n\t\treturn $this->isSuccess();\n\t}", "public function hasSuccessHTTPStatus() { return ($this->status == 200); }", "public function isSuccessful()\n {\n return true;\n }", "public function isSuccessful()\n {\n return true;\n }", "public function isSuccessful()\n {\n return true;\n }", "public function isSuccessful()\n {\n return isset($this->data['response_code']) \n && \n ( substr($this->data['response_code'], 2) == '000' );\n }", "public function isSuccessful()\n {\n return false;\n }", "public function isSuccessful()\n {\n return false;\n }", "public function isSuccessful()\n {\n return false;\n }", "protected function success()\n {\n if ( isset( $this->data['status'] ) && $this->data['status'] == 'SUCCESS' ) {\n return true;\n }\n return false;\n }", "public function isSuccess(): bool\n {\n return $this->code >= CODE_OK && $this->code < CODE_BAD_REQUEST;\n }", "public function isOK()\n {\n return $this->getHTTPCode() == 200;\n }", "public function successful()\n {\n return $this->status() >= 200 && $this->status() < 300;\n }", "function isSuccess()\n\t{\n\t\treturn($this->getStatus() == 'SUCCESS');\n\t}", "public function isSuccessful() {\n\t\treturn isset($this->data['status']) && $this->data['status'] >= 200 && $this->data['status'] < 300;\n\t}", "public function isOk() : bool\n {\n return $this->m_responseCode === 200;\n }", "public function isSuccess(): bool;", "public function isSuccess(): bool;", "public function isSuccess(): bool;", "public function isSuccess()\n {\n return $this->_success;\n }", "public function isSuccessful()\n {\n return (0 == $this->code);\n }", "public function isSuccessful()\n {\n return $this->isSuccessful;\n }", "public function isSuccessful()\n {\n return $this->isSuccessful;\n }", "public function isSuccessful()\n\t{\n\t\t$data = $this->getData();\n\n\t\treturn isset($data['gettransactionResult']);\n\t}", "public function isSuccessful(): bool\n {\n return $this->getStatusCode() >= 200 && $this->getStatusCode() < 300;\n }", "public function wasSuccessful()\n {\n return $this->success;\n }", "public function isSuccessful()\n {\n return ($this->statusCode >= 200) && ($this->statusCode < 300);\n }", "public function isSuccess(): bool\n {\n return $this->code >= 200 && $this->code < 300;\n }", "public function isOk()\n {\n $result = false;\n \n if ($this->m_responseArray['result'] == 'success')\n {\n $result = true;\n }\n \n return $result;\n }", "public function isSuccess():bool;", "public function isSuccessful(): bool\n {\n return $this->json('statusCode') === '00'\n && $this->json('errorCode') === null;\n }", "public function isSuccess()\n {\n return $this->status;\n }", "public function isSuccess()\n {\n return $this->getResult() == self::RESULT_OK;\n }", "public function success()\n {\n // Success Status Codes\n return (boolean) (substr($this->agent->code(),0,1)==2);\n }", "public function isSuccessful()\n {\n $status = (int)$this->get('status');\n return $status >= 200 && $status <= 299;\n }", "public function isSuccess() {\n return parent::isSuccess() ? count($this->getResult()) > 0 : FALSE;\n }", "public function isSuccess() : bool {\n return $this->isSuccess;\n }", "function isSuccessful() ;", "public function isSuccessful()\n {\n return $this->getOperationStatus() === static::OPERATION_STATUS_OK;\n }", "public function isSuccessful() : bool\n {\n return ! empty($this->getSuccess());\n }", "public function isOk() : bool\n {\n return $this->m_responseCode === 201;\n }", "public function isOk();", "public function isSuccessful()\n {\n return isset($this->data['customer_id']) && !empty($this->data['customer_id'])\n && isset($this->data['success']) && $this->data['success']\n && (!isset($this->data['ERROR']) || empty($this->data['ERROR']));\n }", "public function isSuccessful(): bool\n {\n return \\in_array($this->getStatusCode(), [200, 201, 202, 204, 205]);\n }", "function IsOK()\n\t{\n\t\treturn ($this->status == 200);\n\t}", "public function isOk()\n {\n return $this->status == 'success' || $this->status == 'incomplete';\n }", "public function wasSuccessful() : bool\n {\n return $this->status === self::STATUS_SUCCESS;\n }", "public function wasSuccessful(): bool\n {\n return (bool)$this->success;\n }", "public function isSuccessful(): bool\n {\n $statusCode = $this->getStatusCode();\n\n return ($statusCode >= 200 && $statusCode < 300) || $statusCode == 304;\n }", "public function was_successful() {\n return (bool) ( $this->mail_response );\n }", "public function isSuccessful()\r\n {\r\n // 訂單請求過銀聯后必須用origRespCode來判斷支付是否成功\r\n if (isset($this->data['origRespCode'])) {\r\n if ($this->data['origRespCode'] === '00') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n // 訂單沒有請求過銀聯用respCode來判斷支付是否成功\r\n return isset($this->data['respCode']) && $this->data['respCode'] === '00';\r\n }", "public function isSuccess()\n {\n return ($this->isValidArray($this->response) && !isset($this->errorStack['error']));\n }", "public function isSuccessful()\n {\n return count($this->errors) === 0;\n }", "abstract public function isSuccessful();", "public function isSuccessful(): bool\n\t{\n\t\treturn $this->getResponse()->getDeleteResult();\n\t}", "public function isSuccessful()\n {\n if (!isset($this->data['error'])) {\n return $this->data['code'] === 'SUCCESS' && $this->data['transactionResponse']['state'] === 'APPROVED';\n }\n return false;\n }", "public function isSuccessful(){\r\n return $this->code>=200&& $this->code <300;\r\n }", "public function isSuccessful() {\n return (2 === $this->getStatusClass());\n }", "public function isSuccessful()\r\n {\r\n return is_array($this->data);\r\n }", "public function isSuccessful()\n {\n return in_array($this->getCode(), ['300', '301', '302', '400']);\n }", "public function isSuccessful(): bool\n {\n return ($this->statusCode >= 200 && $this->statusCode <= 299);\n }", "public function isSuccessful(): bool\n {\n return $this->status == 'a';\n }", "public function IsOk(){\n\t\treturn $this->_isok;\n\t}", "public function isSuccess() : \\bool\n {\n return $this->success;\n }", "public function isSuccessful() : bool\n {\n return in_array($this->getStatusCode(), [static::$STATUS_OK, static::$STATUS_NOT_CHANGED]);\n }", "public function isOk()\n {\n if ($this->statusCode >= 200 && $this->statusCode < 400) {\n return true;\n }\n\n return false;\n }", "public function isOk() {\n\t\treturn $this->ok;\n\t}", "public function isSuccessful()\n {\n return !$this->isRedirect() && !isset($this->data['payment_details']['reason_for_failure']);\n }", "public function wasSent() {\n return $this->success;\n }", "public function succeeds(): bool\n {\n return $this->_succeeds;\n }", "public function isSuccessful()\n {\n if (isset($this->data['result'])\n && empty($this->data['result']['parameterErrors'])\n && $this->getCode() < 400) {\n if (!empty($this->data['result']['code'])) {\n $code = $this->data['result']['code'];\n $success = false;\n switch ($code) {\n case (preg_match('/^(000\\.200)/', $code) ? true : false):\n case (preg_match('/^(000\\.000\\.|000\\.100\\.1|000\\.[36])/', $code) ? true : false):\n case (preg_match('/^(000\\.400\\.0|000\\.400\\.100)/', $code) ? true : false):\n $success = true;\n break;\n default:\n $success = false;\n }\n\n return $success;\n }\n\n return false;\n }\n\n return false;\n }", "public function check()\n {\n if ($this->getResponse()->status == 'error') {\n return true;\n }\n\n return false;\n }", "public function isSuccessful()\n {\n return 400 > $this->statusCode;\n }", "public function isStatusSuccessful()\n\t{\n\t\treturn $this->status == self::STATUS_SUCCESSFUL;\n\t}", "public function isOK()\n {\n if($this -> status == \"OK\")\n return true;\n else\n return false;\n }", "public static function isRequest() {\n\t return http_response_code()!==FALSE;\n\t}", "public function success()\n {\n return $this->success;\n }", "function isOK() {\r\n\t\t\r\n\t\treturn $this->ok;\r\n\t}", "public function isSuccessResponseStatus()\n {\n if ($this->curl->getStatus() >= 200 & $this->curl->getStatus() < 300) {\n return true;\n }\n\n return false;\n }", "public function isOk()\n {\n $codes = [\n static::STATUS_OK,\n static::STATUS_CREATED,\n static::STATUS_ACCEPTED,\n static::STATUS_NON_AUTHORITATIVE_INFORMATION,\n static::STATUS_NO_CONTENT\n ];\n\n return in_array($this->code, $codes);\n }", "public function isComplete()\n {\n return $this->status == 'success';\n }", "public function isAuthenticatedSuccessfully(): bool;" ]
[ "0.8341519", "0.82317924", "0.8228567", "0.8111656", "0.81082577", "0.81082577", "0.81082577", "0.81082577", "0.81028354", "0.80574477", "0.80177623", "0.7963987", "0.79021716", "0.7894822", "0.7823651", "0.78205943", "0.78157187", "0.7806249", "0.7801528", "0.7799522", "0.77668434", "0.77668434", "0.77668434", "0.7756507", "0.772743", "0.772743", "0.772743", "0.77207506", "0.77059364", "0.768988", "0.7687736", "0.76834416", "0.7664993", "0.7654417", "0.760576", "0.760576", "0.760576", "0.7604911", "0.7603127", "0.75925267", "0.75925267", "0.7564781", "0.7549876", "0.7542191", "0.7526143", "0.7510251", "0.7507815", "0.75024945", "0.75003636", "0.7497045", "0.7447155", "0.74455476", "0.74329823", "0.742845", "0.74172586", "0.73974603", "0.73934", "0.7360807", "0.735508", "0.7341717", "0.73407876", "0.73265755", "0.7317641", "0.7313017", "0.7281595", "0.7280827", "0.7255504", "0.72400045", "0.72311425", "0.72306985", "0.7216935", "0.720754", "0.7203689", "0.71927196", "0.7187294", "0.71816236", "0.71800226", "0.7161348", "0.7111768", "0.7068524", "0.70564115", "0.7053621", "0.7051842", "0.7049642", "0.70402884", "0.7037199", "0.7030486", "0.70162725", "0.69526315", "0.69439334", "0.6936765", "0.6927872", "0.691981", "0.6910371", "0.6908776", "0.6892688", "0.6839374", "0.6828682", "0.6800482", "0.6789398" ]
0.6874028
96
Return monthly instalment rate
public function getMonthlyInstalment();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }", "public function getMonthlyInstalment(): float\n {\n return $this->monthlyInstalment;\n }", "function get_installment($rate, $pricipal, $installment, $interest_method = 1, $interval = 1) {\n\n $amount = 0;\n $rate_required = 0;\n if ($interval == 1) {\n //monthly\n $rate_required = (($rate / 12) / 100);\n }else if($interval == 2){\n //weekly\n $rate_required = (($rate / 52) / 100); \n }\n\n if ($interest_method == 1) {\n $up = pow((1 + $rate_required), $installment);\n\n $down = (pow((1 + $rate_required), $installment) - 1);\n\n $amount = (($pricipal * ($up / $down)) * $rate_required);\n } else if ($interest_method == 2) {\n $interest_per_month = $rate_required * $pricipal;\n $amount = ($pricipal / $installment) + $interest_per_month;\n }\n\n return round($amount, 2);\n }", "public function getMonthlyFee();", "protected function frequency()\n {\n return 'monthly';\n }", "public function getMonthlyFee(): float { return 2.0; }", "function total_monthly_cost($sum, $months, $monthfee, $rate, $startfee, $cur)\n{\n\t$sum_j_to_N = 0;\n\t// reference: Avbetalningsplaner.pdf\n\t$K0 = $sum;\n\t$A = $monthfee;\n\t$S = $startfee;\n\t$R = (pow(1.0+$rate/10000, 1.0/12.0));\n\t$N = $months;\n\tif ($rate == 0)\n\t$T = (1 / $N)*($K0 + ($N * $A) + $S);\n\telse\n\t{\n\t\t// the total cost of fees plus the cost of paying off the monthly fee first and after that amortize\n\t\tfor ($j = 2; $j < $N+1; $j++)\n\t\t{\n\t\t\t$sum_j_to_N = $sum_j_to_N + pow($R, $N - $j) * $A;\n\t\t}\n\t\t$T = (($R - 1) / (pow($R, $N) - 1)) * (pow($R, $N) * $K0 + $sum_j_to_N + pow($R, $N - 1) * ($A + $S));\n\t}\n\n\treturn round($T, 0);\n}", "public function getCurrentMonthTotalRevenue() : float;", "public function getAnnualPrice(): float\n {\n $ratio = $this->getMonths() / 12;\n return $this->getPrice() / $ratio;\n }", "public function reporteMensualTotal(){\n\n }", "public function viewMonthlyRpt()\n {\n return view('Activities.Reports.monthlyRpt(PNL)');\n }", "function getMonthTotal(){\n\t\t$total = $this->hhRentAmount;\n\t\tforeach ($this->members as $member){\n\t\t\tforeach ($member->getBills() as $bill){\n\t\t\t\t$total += $bill->getBillAmount();\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}", "public function perMonth (){\n $data = Auction::totalPreMonth();\n return view(\"welcome\")->with('totalPerMonth',$data); \n }", "public function monthly()\n {\n $submenu_code = 'monthly';\n $permits = $this->_check_menu_access( $submenu_code, 'view');//kalau tidak ada permission untuk view langsung redirect & return permits\n $this->_set_title('Monthly');\n\n //SET VARIABLE\n $from = set_var($this->input->get('from'), date('Y-m-d', strtotime('-1 day')));\n $to = set_var($this->input->get('to'), date('Y-m-d'));\n\n $cst_status = $this->config->item('order')['status']['completed'];\n $cst_delivery_type = $this->config->item('order')['delivery_type'];\n $ios = $this->config->item('user_download')['usrd_type']['ios'];\n $android = $this->config->item('user_download')['usrd_type']['android'];\n\n $url_query = '&from='.$from.'&to='.$to;\n\n //ADDITIONAL FILTER\n\n $arr_data = [\"from_date\" => $from, \"to_date\" => $to.' 23:59:59', \"negation\" => true, \"status\" => $cst_status];\n $arr_data_usrd_android = $arr_data;\n $arr_data_usrd_ios = $arr_data;\n $arr_data_usrd_android['usrd_type'] = $android;\n $arr_data_usrd_ios['usrd_type'] = $ios;\n\n $arr_data_negation = $arr_data;\n $arr_data_pickup = $arr_data;\n $arr_data_delivery = $arr_data;\n $arr_data_negation[\"negation\"] = false;\n $arr_data_pickup['delivery_type'] = $cst_delivery_type['pickup'];\n $arr_data_delivery['delivery_type'] = $cst_delivery_type['delivery'];\n\n\n $total_android = $this->reportdb->get_total_download_apps($arr_data_usrd_android);\n $total_ios = $this->reportdb->get_total_download_apps($arr_data_usrd_ios);\n $total_download = (int) $total_android->total + (int) $total_ios->total;\n\n //--------------------------------------------------------------------------------------------------------------------------\n $data_total_order = $this->reportdb->get_total_complete($arr_data);\n $data_total_pickup = $this->reportdb->get_total_complete($arr_data_pickup);\n $data_total_delivery = $this->reportdb->get_total_complete($arr_data_delivery);\n //-------------------------------------------------------------------------------------------------------------------------------------------------\n $user = $this->reportdb->get_total_user($arr_data);\n $user_not_order = $this->reportdb->get_total_user_not_order($arr_data);\n $user_topup_in_same_month = $this->reportdb->get_total_user_topup_month($arr_data);\n $user_topup_not_in_same_month = $this->reportdb->get_total_user_topup_month($arr_data_negation);\n $user_have_balance = $this->reportdb->get_total_user_have_balance_in_end_month($arr_data);\n //-------------------------------------------------------------------------------------------------------------------------------------------------\n $user_reff = $this->reportdb->get_total_user_referral($arr_data);\n $user_reff_not_claim = $this->reportdb->get_total_user_referral_claim($arr_data_negation);\n $user_reff_claim = $this->reportdb->get_total_user_referral_claim($arr_data);\n $user_reff_claim_not_repeat = $this->reportdb->get_total_user_referral_claim_repeat($arr_data_negation);\n $user_reff_claim_repeat = $this->reportdb->get_total_user_referral_claim_repeat($arr_data);\n $user_reff_not_free = $this->reportdb->get_total_user_referral_not_free($arr_data);\n //--------------------------------------------------------------------------------------------------------------------------\n $claim_free = $this->reportdb->get_total_claim_free($arr_data);\n $claim_free_repeat = $this->reportdb->get_total_claim_free_repeat($arr_data);\n $claim_free_not_order = $this->reportdb->get_total_claim_free_repeat($arr_data_negation);\n $not_claim_free = $this->reportdb->get_not_claim_free($arr_data);\n //--------------------------------------------------------------------------------------------------------------------------\n $user_topup = $this->reportdb->get_total_user_topup($arr_data);\n\n // SELECT DATA & ASSIGN VARIABLE $DATA\n $config['base_url'] = ADMIN_URL.'report/monthly'.($url_query != '' ? '?'.$url_query : '');\n $data['form_url'] = $config['base_url'];\n $data['page_url'] = str_replace($url_query, '', $config['base_url']);\n $data['permits'] = $permits;\n $data['from'] = $from;\n $data['to'] = $to;\n //-----------------------------------------------------------------------\n $data['total_order'] = $data_total_order->total;\n $data['total_pickup'] = $data_total_pickup->total;\n $data['total_delivery'] = $data_total_delivery->total;\n //-----------------------------------------------------------------------\n $data['user'] = $user;\n $data['user_not_order'] = $user_not_order;\n $data['user_topup_in_same_month'] = $user_topup_in_same_month;\n $data['user_topup_not_in_same_month'] = $user_topup_not_in_same_month;\n $data['user_have_balance'] = $user_have_balance;\n //----------------------------------------------------------------------\n $data['user_reff'] = $user_reff;\n $data['reff_not_claim'] = $user_reff_not_claim;\n $data['reff_claim'] = $user_reff_claim;\n $data['reff_claim_not_repeat'] = $user_reff_claim_not_repeat;\n $data['reff_claim_repeat'] = $user_reff_claim_repeat;\n $data['reff_not_free'] = $user_reff_not_free;\n //----------------------------------------------------------------------\n $data['claim_free'] = $claim_free;\n $data['claim_free_repeat'] = $claim_free_repeat;\n $data['claim_free_not_order'] = $claim_free_not_order;\n $data['not_claim_free'] = $not_claim_free;\n //----------------------------------------------------------------------\n $data['user_topup'] = $user_topup;\n $data['total_download'] = $total_download;\n $data['total_android'] = $total_android->total;\n $data['total_ios'] = $total_ios->total;\n\n if($this->input->get('export') == 'xls'){\n $permits = $this->_check_menu_access( $submenu_code, 'export');\n //mulai dari set header dan filename\n $filename = 'monthly.xls';\n $this->set_header_xls($filename);\n\n $this->_render('report/monthly_xls', $data);\n\n }else{\n $this->_render('report/monthly', $data);\n }\n }", "public function getProfitMonth(){\n\t\tglobal $db;\n\t\t$date_now = date('Y-m').'-01';\n\t\t$last_month = date('Y-m', strtotime('-1 month')).'-01';\n\n\t\t$sql = $db->prepare(\"SELECT SUM(price) FROM project01_report WHERE date_init BETWEEN '$last_month' AND '$date_now' \");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$profit = $sql->fetch();\n\t\t\treturn $profit;\n\t\t}\n\t}", "public function getVirusPerMonth() {\n\t\treturn parent::getVirusPerMonth();\n\t}", "public function getCurrentMonthTotalOrder() : int;", "function get_payment_rate($subtotal) {}", "public function rate()\n {\n\n }", "function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}", "public function takePostBaseOnMonth();", "public function getStoreToOrderRate();", "public function iN_CurrentMonthTotalSubscriptionEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS MonthTotalEarnSubscription FROM i_user_subscriptions WHERE status = 'active' AND MONTH(created) = MONTH(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['MonthTotalEarnSubscription']) ? $row['MonthTotalEarnSubscription'] : '0.00';\n\t}", "public static function getMonthlySales()\n\t{\n\t\tTools::displayAsDeprecated();\n\t\t$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('\n\t\tSELECT SUM(`total_paid`) as nb\n\t\tFROM `'._DB_PREFIX_.'orders`\n\t\tWHERE MONTH(`date_add`) = MONTH(NOW())\n\t\tAND YEAR(`date_add`) = YEAR(NOW())');\n\n\t\treturn isset($result['nb']) ? $result['nb'] : 0;\n\t}", "function get_totals(){\r\n $this_month = date('n', time()) - 1;\r\n\r\n $this->payments_this_month = $this->payment_totals_by_month[$this_month];\r\n\r\n $last_month = $this_month > 0 ? $this_month - 1 : false;\r\n if($last_month){\r\n $payments_last_month = $this->payment_totals_by_month[$last_month];\r\n\r\n if($payments_last_month > 0)\r\n $this->payments_this_month_change_percentage = (($this->payments_this_month/$payments_last_month) - 1) * 100;\r\n else $this->payments_this_month_change_percentage = 0;\r\n }\r\n }", "public function get_month_permastruct()\n {\n }", "public function getPricePerMonth($_product) {\n $price = $_product->getResource()->getAttribute('santanderpricemonth')->getFrontend()->getValue($_product);\n return Mage::helper('core')->currency(round($price, 2));\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function monthly()\n {\n return $this->cron('0 0 1 * * *');\n }", "public function showPricePerMonth() {\n $prijsPerMaand = Mage::getStoreConfig('santander/general/prijs_maand');\n if($prijsPerMaand) {\n return true;\n } else {\n return false;\n }\n }", "function calculateCurrentRate( $zipcode )\n\t{\n\t\t$url = \"http://api.genability.com/rest/public/tariffs?appId=9a8e8699-e784-4d56-85be-becf6163a560&appKey=2ba657c1-95f1-48a2-9d28-284be8b17dc5&customerClasses=RESIDENTIAL&tariffTypes=DEFAULT&zipCode=\" . $zipcode;\n\t\t$json = file_get_contents($url);\n\t\t$jsonArray = json_decode($json, TRUE);\n\t\t\n\t\t$masterTariffId = $jsonArray['results'][0]['masterTariffId'];\n\t\t// Find master tariff schedule and assume 1000 kWh per month consumption\n\t\t$url = \"http://api.genability.com/rest/public/prices/\" . $masterTariffId . \n\t\t\t \"?appId=9a8e8699-e784-4d56-85be-becf6163a560&appKey=2ba657c1-95f1-48a2-9d28-284be8b17dc5&consumptionAmount=1000\";\n\t\t$jsonTariff = file_get_contents($url);\n\t\t$jsonTariffArray = json_decode($jsonTariff, TRUE);\n\t\t\n\t\t// Find which is the highest price for this average level of consumption\n\t\t$maxTariff = 0.0;\n\t\tforeach ($jsonTariffArray['results'] as &$tariff) {\n\t\t\tif ( $tariff['rateAmount'] > maxTariff )\n\t\t\t{\n\t\t\t\t$maxTariff = $tariff['rateAmount'];\n\t\t\t}\n\t\t}\n\t\techo \"You are currently paying \" . round( $maxTariff * 100, 2 ) . \" cents per kWh.\";\n\t}", "public function getBaseToGlobalRate();", "public function totalOfMonth() {\n\n $query = \"SELECT SUM(TOTAL) AS TOTAL_MONTH FROM BUY WHERE\" .\n \" MONTH(BUYDATE) = MONTH(NOW()) AND YEAR(BUYDATE) = YEAR(NOW()) \";\n\n $result = parent::query($query);\n\n if ($row = $result->fetch_assoc()) {\n return $row['TOTAL_MONTH'];\n }\n\n return null;\n }", "public function amount(): string\n {\n $amount = 0;\n if ($this->tier === Patreon::PLEDGE_OWLBEAR) {\n $amount = 5;\n } elseif ($this->tier === Patreon::PLEDGE_ELEMENTAL) {\n $amount = 25;\n }\n\n // Offer a free month for those who sub for a year\n if ($this->period === 'yearly') {\n $amount *= 11;\n }\n\n return $this->user->currencySymbol() . ' ' . $amount . '.00';\n }", "function obtain_month_profitable($acc_number)\n\t{\n\t return $this->db->select('AVG(pamm_tp_profitable) AS ptp,monthname(pamm_tp_timestamp) AS month, year(pamm_tp_timestamp) AS year')\n\t\t ->from('pamm_tp_results') \n\t\t ->where(\"pamm_tp_account\",$acc_number)\n\t\t ->group_by('monthname(pamm_tp_timestamp)')\n\t\t ->order_by('pamm_tp_timestamp','ASC')\n\t\t ->get()->result();\n\t}", "public function testTotalMonthlyPrice()\n {\n }", "public function getExchangeRate();", "protected function LiveDefaultRate()\n {\n $this->defaultTaxObjects();\n\n return self::$default_tax_objects_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 getRate()\n {\n return $this->rate;\n }", "public function getBaseToOrderRate();", "public function getAmountRate()\n {\n return $this->amountRate;\n }", "public function getShippingrate()\n\t{\n\t\tinclude_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/shipping.php';\n\t\t$shipping = new shipping;\n\t\techo $shipping->getShippingrate_calc();\n\t\texit;\n\t}", "function Monthly_Requests_Assignment($year) {\r\n $query2 = $this->db->query(\"SELECT DISTINCT(labref), MONTHNAME(date_issued) as month, YEAR(date_issued) as year,DATE_FORMAT(date_issued, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM sample_details\r\n WHERE DATE_FORMAT(date_issued, '%Y') = '$year' \r\n AND activity='Analysis'\r\n GROUP BY MONTHNAME(date_issued)\r\n ORDER BY MONTH(date_issued) ASC\");\r\n\r\n return $result = $query2->result();\r\n }", "public function indivMonthly(Request $request){\n $id = $request->SLAVE_ID;\n $year = date('Y');\n $month = [];\n for($i = 1; $i<=12; $i++){\n $perMonth = 0;\n $res = EMeterData::where('METER_ID',$id)\n ->whereMonth('CREATED_AT', '=', $i)\n ->whereYear('CREATED_AT','=',$year)->latest()->first();\n if (!empty($res) || $res == !null) {\n $perMonth += $res->CURRENT_MONTH_KWH;\n $perMonth = round($perMonth, 4);\n }\n $json = array(\n 'months' => date('D F d Y H:i:s O',mktime(0,0,0,$i,25)),\n 'usage' => $perMonth,\n );\n array_push($month,$json);\n }\n return $month;\n }", "public function showScheduleofPayments($data){\r\n\r\n $result = array();\r\n\r\n\t\t$member_id = $data['member_id'];\r\n\t\t$loan_id = $data['loan_id'];\r\n\t\t$terms = $data['terms'];\r\n\t\t$monthly = $data['monthly'];\r\n\t\t$date_approved = $data['date_approved'];\r\n\t\t$amount_payable = $data['amount_payable'];\r\n $principal = $data['principal'];\r\n\t\t$interest = $data['interest'];\r\n\t\t$interest_type = $data['interest_type'];\r\n\t\t$interest_term = $data['interest_term'];\r\n\t\t\r\n\t\t$accommulatedInterest = 0;\r\n $runningBalance = $amount_payable;\r\n $runningPrincipal = $principal;\r\n\t\t\r\n\t\t$monthlyrate = 0;\r\n\t\t$monthly_principal = 0;\r\n\t\t$monthly_interest = 0;\r\n\t\t\r\n\r\n for ($x = 1; $x <= $terms; $x++){\r\n\t\t\r\n\t\t\tif($interest_type == 1){ \t//flat interest rate\r\n\t\t\t\t$monthlyrate = ((($terms / $interest_term) * $interest) / 100);\r\n\t\t\t\t$monthly_principal = round(($principal / $terms), 2);\r\n $interestPerMonth = round(($amount_payable / $terms) - $monthly_principal, 2);\r\n\t\t\t}else {\t\t\t\t //diminishing interest rate\r\n\t\t\t\t$monthlyrate = (($terms / $interest_term) * $interest / 100) / $terms;\r\n\t\t\t\t$interestPerMonth = round($runningPrincipal * $monthlyrate, 2);\r\n\t\t\t\t$monthly_principal = round(($amount_payable / $terms) - $interestPerMonth, 2);\r\n $accommulatedInterest += round($interestPerMonth, 2); \r\n }\r\n \r\n $runningBalance -= $monthly;\r\n $runningPrincipal -= $monthly_principal;\r\n\t\t\r\n $date = new DateTime($date_approved);\r\n $date->add(new DateInterval('P'.$x.'M'));\r\n \r\n\t\t\t$row = array(\r\n 'member_id' => $member_id,\r\n 'loan_id' => $loan_id,\r\n 'period' => $x,\r\n 'date_due' => $date->format('Y-m-d'),\r\n 'amortization' => $monthly,\r\n 'principal' => $monthly_principal,\r\n 'interest' => $interestPerMonth,\r\n 'balance' => $runningBalance\t\t\t\r\n );\r\n\r\n $result[] = $row;\r\n }\r\n\r\n return $result;\r\n }", "public function iN_CurrentMonthTotalPremiumEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS MonthTotalEarnPremium FROM i_user_payments WHERE payment_type = 'post' AND payment_status = 'ok' AND MONTH(FROM_UNIXTIME(payment_time)) = MONTH(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['MonthTotalEarnPremium']) ? $row['MonthTotalEarnPremium'] : '0.00';\n\t}", "public static function totalPreMonth(){\n $data = DB::table('auctions')->select(DB::raw('substr(date,1,2) as month'), DB::raw('SUM(tax_amount) as total'))->groupBy(\"month\")->get();\n return $data;\n }", "public function loan_form_save(Request $request) {\n $all = $request->all();\n //dd($all);\n\n $rate_from = $request->f_rate_from;\n $rate_to = $request->f_rate_to;\n if($rate_from == NULL) {\n $rate_from = 0;\n } elseif ($rate_to == Null) {\n $rate_to = 0;\n }\n\n /*\n |--------------------------------------------------------------------------\n | Formula of Equated Monthly Installment\n | --------------------------------------\n | EMI = p*r*{(1+r)^n / [(1+r)^n - 1]}\n | p = principal_amount_or_loan_amount\n | d = duration_of_manths_or_years\n | r = periodic interest_rate\n | --------------------------\n | $f_f_p = formula_first_part = p*r\n | $f_s_p = formula_second_part = {(1+r)^n / [(1+r)^n - 1]}\n | --------------------------\n | value count 10 digit after dosomik number(.)\n |--------------------------------------------------------------------------\n */\n //rough information will add this formula\n\n //----Start_EMI_Calculation---------------------------------------------------------------------\n $p = $request->l_amount; //----p means principal_amount_or_loan_amount\n $d = $request->l_period; //----d means duration_of_manths_or_years\n $i_r = $request->l_interest_rate; //----i_r means interest_rate\n $n = $d*12; //----n means no_of_duration_month\n $i_r_n = $i_r/12; //----12 means 1_year_equal_is_12_month----calculate_by_month\n $r = $i_r_n/100; //----100 means rate_of_percent\n\n $f_f_p = $p * $r; //----$f_f_p means formula_first_part == p*r\n $f_s_p_1 = pow(1+$r,$n); //----$f_s_p_1 means formula_second_part_one\n $f_s_p = $f_s_p_1/($f_s_p_1 - 1); //----$f_s_p = formula_second_part =={(1+r)^n / [(1+r)^n - 1]}\n\n $f_f_p_r = round($f_f_p, 10);\n $f_s_p_r = round($f_s_p, 10);\n\n $e_m_i = round($f_f_p_r * $f_s_p_r, 0); //----calculate_round_figure_value\n //echo $e_m_i; exit();\n //----End_EMI_Calculation----------------------------------------------------------------------\n\n //----Start_Data_Insert---------------------------------------------------------------------\n $loan = array();\n $loan['loan_type'] = $request->l_type;\n $loan['loan_person_type'] = $request->l_person;\n $loan['loan_amount'] = $request->l_amount;\n $loan['loan_period'] = $request->l_period;\n $loan['loan_interest_rate'] = $request->l_interest_rate;\n $loan['loan_monthly_interest'] = $e_m_i;\n $loan['loan_interest_payable'] = 4525;\n $loan['loan_flating_rate_form'] = $rate_from;\n $loan['loan_flating_rate_to'] = $rate_to;\n $loan['loan_features_bfenefits'] = $request->l_fsr;\n $loan['loan_requirements'] = $request->l_req;\n $loan['loan_eligibility'] = $request->l_elig;\n $loan['bank_id'] = $request->bank_id;\n DB::table('loans')->insert($loan);\n\n Session::put('insert_suc', 'Data Inserted Successfully!');\n return redirect('form-loan');\n //----End_EMI_Data_Insert-------------------------------------------------------------------\n }", "public function getRatePeriod()\n {\n return $this->ratePeriod;\n }", "public function getRate() {\n return $this->rate;\n }", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "function it_finds_the_lowest_base_monthly_rate_in_the_absence_of_other_rates()\n {\n // daily rate - 10\n // daily rate - 10\n $baseRate = new Rate(null, Price::fromString('10', Currency::fromString('EUR')), 1);\n $equipment = new Equipment('Jack Hammer', $baseRate);\n $rentalPeriod = RentalPeriod::fromDateTime(new \\DateTime('2014-07-01'), new \\DateTime('2014-07-07'), 1);\n $rentalQuery = new RentalQuery($equipment, $rentalPeriod);\n\n // weekly rate - 60\n $weekPrice = Price::fromString('65', Currency::fromString('EUR'));\n $equipment->addRate(null, $weekPrice, 7);\n\n // 3 weekly + 5 daily = 250\n // monthly rate = 240\n $monthPrice = Price::fromString('240', Currency::fromString('EUR'));\n $equipment->addRate(null, $monthPrice, 30);\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($monthPrice);\n }", "function calculateProrate($recurring_amount, $current_date, $cycle)\n {\n $next_due_date = $this->utils->getXmonthsAfter($cycle, $this->utils->getDateArray($current_date));\n $prorate_array = array();\n $prorate_array['prorate_amount']= 0;\n $prorate_array['due_date'] = $current_date;\n $prorate_array['next_bill_date']= $next_due_date['year'] . \"-\" . $next_due_date['mon'] . \"-\" . $next_due_date['mday'];\n if ($this->BL->conf['en_prorate'])\n {\n $d1 = $this->utils->getDateArray($current_date);\n $d2 = $this->utils->getDateArray($prorate_array['next_bill_date']);\n $prorate_day = $d1['year'] . \"-\" . $d1['mon'] . \"-\" . $this->BL->conf['prorate_date'];\n if ($d1['mday'] > $this->BL->conf['prorate_date'])\n {\n $prorate_day = $this->utils->beginOfNextMonth($d1['mday'], $d1['mon'], $d1['year'], '%Y-%m') . \"-\" . $this->BL->conf['prorate_date'];\n }\n $d3 = $this->utils->getDateArray($prorate_day);\n $days_in_cycle = $this->utils->dateDiff($d1['mday'], $d1['mon'], $d1['year'], $d2['mday'], $d2['mon'], $d2['year']);\n $prorate_days = $this->utils->dateDiff($d1['mday'], $d1['mon'], $d1['year'], $d3['mday'], $d3['mon'], $d3['year']);\n $amount_per_day= $recurring_amount / $days_in_cycle;\n $next_due_date = $this->utils->getXmonthsAfter($cycle, $this->utils->getDateArray($prorate_day));\n $prorate_array['prorate_amount'] = $this->utils->toFloat($amount_per_day * $prorate_days);\n $prorate_array['due_date'] = $prorate_day;\n $prorate_array['next_bill_date'] = $next_due_date['year'] . \"-\" . $next_due_date['mon'] . \"-\" . $next_due_date['mday'];\n $prorate_array['prorate_day'] = $prorate_day;\n }\n return $prorate_array;\n }", "function totalHari($month,$year){\n $jumlah = cal_days_in_month(CAL_GREGORIAN,$month,$year);\n return $jumlah;\n}", "public function getStoreToBaseRate();", "public function getTotalPaid();", "public function getPricePerDayAttribute()\n {\n // Calculate price per day and return\n return $this->summary / Carbon::today()->addMonths($this->billingFrequency)->diffInDays(Carbon::today());\n }", "public function getTaxRate();", "public static function get_rate_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_rate = BooksRateStatisticQModel::get_book_rate_all($date, $month, $year);\n\t\tif ($book_rate == null) {\n\t\t\t$week = null;\n\t\t} else {\n\t\t\t$week = $book_rate->week;\n\t\t}\n\t\t// dd($week);\n\t\t$data['sum']\t\t\t= [];\n\t\t$data['sum']['day']\t\t= [];\n\t\t$data['sum']['week']\t= [];\n\t\t$data['sum']['month']\t= [];\n\t\t$data['sum']['season']\t= [];\n\t\t$data['sum']['year']\t= [];\n\t\t// get view day all\n\t\tfor ($i = 0; $i < 7; $i++) { \n\t\t\t$data['sum']['day'][$i] = [];\n\t\t\t// j is rate point\n\t\t\t$data['sum']['day'][$i][0] = 0;\n\t\t\tfor ($j = 1; $j <= 5; $j++) { \n\t\t\t\t$data['sum']['day'][$i][$j] = BooksRateStatisticQModel::get_book_rate_day_all($i,$week, $month, $year, $j);\n\t\t\t\tif ($data['sum']['day'][$i][$j] == null) {\n\t\t\t\t\t$data['sum']['day'][$i][$j] = $data['sum']['day'][$i][$j-1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$data['sum']['day'][$i][$j] = (int)$data['sum']['day'][$i][$j]->rate + $data['sum']['day'][$i][$j-1];\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\t// get view week all\n\t\tfor ($i = 0; $i < 5; $i++) { \n\t\t\t$data['sum']['week'][$i] = [];\n\t\t\t// j is rate point\n\t\t\t$data['sum']['week'][$i][0] = 0;\n\t\t\tfor ($j = 1; $j <= 5; $j++) { \n\t\t\t\t$data['sum']['week'][$i][$j] = BooksRateStatisticQModel::get_book_rate_week_all($i, $month, $year, $j);\n\t\t\t\tif ($data['sum']['week'][$i][$j] == null) {\n\t\t\t\t\t$data['sum']['week'][$i][$j] = $data['sum']['week'][$i][$j-1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$data['sum']['week'][$i][$j] = (int)$data['sum']['week'][$i][$j]->rate + $data['sum']['week'][$i][$j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get view month all\n\t\tfor ($i = 1; $i <= 12; $i++) { \n\t\t\t$data['sum']['month'][$i] = [];\n\t\t\t// j is rate point\n\t\t\t$data['sum']['month'][$i][0] = 0;\n\t\t\tfor ($j = 1; $j <= 5; $j++) { \n\t\t\t\t$data['sum']['month'][$i][$j] = BooksRateStatisticQModel::get_book_rate_month_all($i, $year, $j);\n\t\t\t\tif ($data['sum']['month'][$i][$j] == null) {\n\t\t\t\t\t$data['sum']['month'][$i][$j] = $data['sum']['month'][$i][$j-1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$data['sum']['month'][$i][$j] = (int)$data['sum']['month'][$i][$j]->rate + $data['sum']['month'][$i][$j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get view season all\n\t\tfor ($i = 1; $i <= 4; $i++) { \n\t\t\t$data['sum']['season'][$i] = [];\n\t\t\t// j is rate point\n\t\t\t$data['sum']['season'][$i][0] = 0;\n\t\t\tfor ($j = 1; $j <= 5; $j++) { \n\t\t\t\t$data['sum']['season'][$i][$j] = BooksRateStatisticQModel::get_book_rate_season_all($i, $year, $j);\n\t\t\t\tif ($data['sum']['season'][$i][$j] == null) {\n\t\t\t\t\t$data['sum']['season'][$i][$j] = $data['sum']['season'][$i][$j-1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$data['sum']['season'][$i][$j] = (int)$data['sum']['season'][$i][$j]->rate + $data['sum']['season'][$i][$j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get view year all\n\t\tfor ($i = 0; $i < 8; $i++) { \n\t\t\t$data['sum']['year'][$i] = [];\n\t\t\t// j is rate point\n\t\t\t$data['sum']['year'][$i][0] = 0;\n\t\t\tfor ($j = 1; $j <= 5; $j++) { \n\t\t\t\t$data['sum']['year'][$i][$j] = BooksRateStatisticQModel::get_book_rate_year_all($i+2012, $j);\n\t\t\t\tif ($data['sum']['year'][$i][$j] == null) {\n\t\t\t\t\t$data['sum']['year'][$i][$j] = $data['sum']['year'][$i][$j-1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$data['sum']['year'][$i][$j] = (int)$data['sum']['year'][$i][$j]->rate + $data['sum']['year'][$i][$j-1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// get data percent\n\t\t$data['percent']\t\t\t= [];\n\t\t$data['percent']['day']\t\t= [];\n\t\t$data['percent']['week']\t= [];\n\t\t$data['percent']['month']\t= [];\n\t\t$data['percent']['season']\t= [];\n\t\t$data['percent']['year']\t= [];\n\t\t// dd($data);\n\t\t// day\n\t\tforeach ($data['sum']['day'] as $key => $day) {\n\t\t\t$sum = 0;\n\t\t\t$data['percent']['day'][$key] = [];\n\t\t\tforeach ($day as $star => $number) {\n\t\t\t\t\n\t\t\t\t$data['percent']['day'][$key][$star] = $sum + $number;\n\n\t\t\t\t$sum += $number;\n\t\t\t}\n\t\t\tforeach ($day as $star => $number) {\n\t\t\t\tif ($sum != 0) {\n\t\t\t\t\t$value = $data['percent']['day'][$key][$star];\n\t\t\t\t\t$max = $data['percent']['day'][$key][5];\n\t\t\t\t\t$data['percent']['day'][$key][$star] = ($value / $max) * 100;\n\t\t\t\t} else {\n\t\t\t\t\tif ($star != 0)\n\t\t\t\t\t\t$data['percent']['day'][$key][$star] = 20 * $star;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// week\n\t\tforeach ($data['sum']['week'] as $key => $week) {\n\t\t\t$sum = 0;\n\t\t\t$data['percent']['week'][$key] = [];\n\t\t\tforeach ($week as $star => $number) {\n\t\t\t\t\n\t\t\t\t$data['percent']['week'][$key][$star] = $sum + $number;\n\n\t\t\t\t$sum += $number;\n\t\t\t}\n\t\t\tforeach ($week as $star => $number) {\n\t\t\t\t\n\t\t\t\tif ($sum != 0) {\n\t\t\t\t\t$value = $data['percent']['week'][$key][$star];\n\t\t\t\t\t$max = $data['percent']['week'][$key][5];\n\t\t\t\t\t$data['percent']['week'][$key][$star] = ($value / $max) * 100;\n\t\t\t\t} else {\n\t\t\t\t\tif ($star != 0)\n\t\t\t\t\t\t$data['percent']['week'][$key][$star] = 20 * $star;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// month\n\t\tforeach ($data['sum']['month'] as $key => $month) {\n\t\t\t$sum = 0;\n\t\t\t$data['percent']['month'][$key] = [];\n\t\t\tforeach ($month as $star => $number) {\n\t\t\t\t\n\t\t\t\t$data['percent']['month'][$key][$star] = $sum + $number;\n\n\t\t\t\t$sum += $number;\n\t\t\t}\n\t\t\tforeach ($month as $star => $number) {\n\t\t\t\tif ($sum != 0) {\n\t\t\t\t\t$value = $data['percent']['month'][$key][$star];\n\t\t\t\t\t$max = $data['percent']['month'][$key][5];\n\t\t\t\t\t$data['percent']['month'][$key][$star] = ($value / $max) * 100;\n\t\t\t\t} else {\n\t\t\t\t\tif ($star != 0)\n\t\t\t\t\t\t$data['percent']['month'][$key][$star] = 20 * $star;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// season\n\t\tforeach ($data['sum']['season'] as $key => $season) {\n\t\t\t$sum = 0;\n\t\t\t$data['percent']['season'][$key] = [];\n\t\t\tforeach ($season as $star => $number) {\n\t\t\t\t\n\t\t\t\t$data['percent']['season'][$key][$star] = $sum + $number;\n\n\t\t\t\t$sum += $number;\n\t\t\t}\n\t\t\tforeach ($season as $star => $number) {\n\t\t\t\tif ($sum != 0) {\n\t\t\t\t\t$value = $data['percent']['season'][$key][$star];\n\t\t\t\t\t$max = $data['percent']['season'][$key][5];\n\t\t\t\t\t$data['percent']['season'][$key][$star] = ($value / $max) * 100;\n\t\t\t\t} else {\n\t\t\t\t\tif ($star != 0)\n\t\t\t\t\t\t$data['percent']['season'][$key][$star] = 20 * $star;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// year\n\t\tforeach ($data['sum']['year'] as $key => $year) {\n\t\t\t$sum = 0;\n\t\t\t$data['percent']['year'][$key] = [];\n\t\t\tforeach ($year as $star => $number) {\n\t\t\t\t\n\t\t\t\t$data['percent']['year'][$key][$star] = $sum + $number;\n\n\t\t\t\t$sum += $number;\n\t\t\t}\n\t\t\tforeach ($year as $star => $number) {\n\t\t\t\tif ($sum != 0) {\n\t\t\t\t\t$value = $data['percent']['year'][$key][$star];\n\t\t\t\t\t$max = $data['percent']['year'][$key][5];\n\t\t\t\t\t$data['percent']['year'][$key][$star] = ($value / $max) * 100;\n\t\t\t\t} else {\n\t\t\t\t\tif ($star != 0)\n\t\t\t\t\t\t$data['percent']['year'][$key][$star] = 20 * $star;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function monthlyConsumption(Request $request){\n $year = date('Y');\n //List all registered ModBus Gateway\n $gateway = Gateway::where('MANUFACTURER_ID',2)->get();\n //Loop all registered ModBus Gateway\n foreach ($gateway as $modBusIP) {\n $gatewayID = $modBusIP->GATEWAY_ID;\n $floorID = $modBusIP->FLOOR_ID;\n //List all registered Electric Meters in a modbus gateway\n $meters = ElectricMeter::where('GATEWAY_ID',$gatewayID)\n ->where('REG_FLAG',1)->get();\n $months = [];\n //Loop 12times (January to December)\n for($i=1;$i<=12; $i++){\n $perMonthData = 0;\n // Get data of each electric meter per month\n foreach ($meters as $meter) {\n $meterID = $meter->SLAVE_ID;\n //Get the latest reading of electric meter in current month iteration\n $res = EMeterData::where('METER_ID', $meterID)\n ->whereMonth('CREATED_AT', '=', $i)\n ->whereYear('CREATED_AT', '=', $year)\n ->latest()->first();\n if(!empty($res) || $res == !null ){\n //Sum of electric meters\n $perMonthData += $res->CURRENT_MONTH_KWH;\n $perMonthData = round($perMonthData, 4);\n }\n }\n //Random floating number of 1.00 to 10.00 for no month data\n if($perMonthData == 0){\n // $perMonthData = number_format((float)(1 + mt_rand() / mt_getrandmax() * (10 - 1)), 2, '.', '');\n }\n $json = array('months' => substr(date('F', mktime(0, 0, 0,\n $i, 1)),0,3), 'floor_data' => $perMonthData);\n array_push($months, $json);\n }\n return $months;\n }\n }", "function totalDollarToCashMonth($date){\n \n \n$query_change_mony = \"SELECT doller_in, doller_out,date FROM `history` WHERE `date` like '%$date%' \"; \n \n if(@$query_run = mysql_query($query_change_mony)){\n \n $doll_out_total_cash = 0;\n $doll_in_total_cash = 0; \n while($sql_row = mysql_fetch_assoc($query_run)){\n $m_doller_in = $sql_row['doller_in'];\n $m_doller_out = $sql_row['doller_out']; \n $m_dayDate = explode(\"@\",$sql_row['date']); \n \n $currentRate = mysql_result(mysql_query(\"SELECT dollarRate FROM `oppen_day` WHERE `date` = '\".trim($m_dayDate['0']).\"' \"),0); \n // change all \n $doll_in_total_cash += $m_doller_in * $currentRate;\n $doll_out_total_cash += $m_doller_out * $currentRate;\n \n }\n\n }\n return array('dollarInToCash'=>$doll_in_total_cash,'dollarOutToCash'=>$doll_out_total_cash);\n}", "public function toMoney()\n {\n return $this->rate;\n }", "function Monthly_Requests_Pending($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year,DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year' AND assign_status = '0'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }", "function get_annual_period_balance($cur='IDR',$acc=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('YEAR(dates)', $eyear);\n $this->db->where('gls.currency', $cur);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "function monthlyStats($month, $conn){\n $query = $conn->query(\"SELECT * FROM viewer_tbl\");\n $counter = 0;\n while ($data = $query->fetch_array()) {\n $dbMonth = $data['visited_date'];\n if($month == date('F' , strtotime($dbMonth))){\n ++$counter;\n }\n }\n return $counter;\n }", "public function getNextMonth(){\n\t\tif($this->getMonth() == 12){return 1;}\n\t\telse{return $this->getMonth()+1;}\n\t}", "function NSNrate($SFR){ return 0.156*($SFR/(12.26*Msun)); }", "public function getStatForDonations() {\r\n // TODO: Move to config\r\n $requiredPerYear = 1000;\r\n $requiredPerMonth = 85;\r\n\r\n // Calculate donations received for current year\r\n $result = $this->dao->query(\"\r\n SELECT\r\n SUM(amount) AS YearDonation,\r\n year(NOW()) AS yearnow,\r\n month(NOW()) AS month,\r\n quarter(NOW()) AS quarter\r\n FROM\r\n donations\r\n WHERE\r\n created > CONCAT(CONCAT(year(NOW()), '-01'), '-01')\r\n \");\r\n $rowYear = $result->fetch(PDB::FETCH_OBJ);\r\n\r\n switch ($rowYear->quarter) {\r\n case 1:\r\n $start = $rowYear->yearnow . \"-01-01\";\r\n $end = $rowYear->yearnow . \"-04-01\";\r\n break;\r\n case 2:\r\n $start = $rowYear->yearnow . \"-04-01\";\r\n $end = $rowYear->yearnow . \"-07-01\";\r\n break;\r\n case 3:\r\n $start = $rowYear->yearnow . \"-07-01\";\r\n $end = $rowYear->yearnow . \"-10-01\";\r\n break;\r\n case 4:\r\n $start = $rowYear->yearnow . \"-10-01\";\r\n $end = $rowYear->yearnow . \"-12-31\";\r\n break;\r\n }\r\n\r\n $query = \"\r\n SELECT\r\n SUM(ROUND(amount)) AS Total,\r\n year(now()) AS year\r\n FROM\r\n donations\r\n WHERE\r\n created >= '$start'\r\n AND\r\n created < '$end'\r\n \";\r\n $result = $this->dao->query($query);\r\n\r\n $row = $result->fetch(PDB::FETCH_OBJ);\r\n $row->QuarterDonation = sprintf(\"%d\", $row->Total);\r\n $row->MonthNeededAmount = $requiredPerMonth;\r\n $row->YearNeededAmount = $requiredPerYear;\r\n $row->QuarterNeededAmount = $requiredPerMonth * 3;\r\n $row->YearDonation = $rowYear->YearDonation;\r\n\r\n return $row;\r\n }", "function getExchangeRate($currency);", "public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}", "public function bulanan()\n {\n $month = array();\n\n $this->db->select('SUM(hargatotal) as bulan');\n $this->db->from('bahanterpakai');\n $this->db->where('MONTH(tglpakai) = MONTH(NOW()) AND YEAR(tglpakai) = YEAR(NOW())');\n\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n $month = $query->result();\n }\n\n return $month;\n }", "public function getMonthlySchedule()\n {\n return $this->monthly_schedule;\n }", "function total_video_revenue() {\n return PayPerView::sum('amount');\n}", "public function getBaseTotalPaid();", "function Monthly_Requests($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year, DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }", "function Monthly_Requests_Urgent($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year,DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year' AND urgency = '1'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }", "function get_miss_recapitulation_based_fee($dept,$grade,$monthperiod,$year,$fee)\n {\n $bulan = $this->months_from_period($monthperiod);\n $tahun = $this->year_name($monthperiod, $year);\n \n $this->ci->db->select('id, student_id, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, financial_year');\n $this->ci->db->from('fee_payment_status, students');\n $this->ci->db->where('fee_payment_status.student_id = students.students_id');\n $this->ci->db->where('students.dept_id', $dept);\n $this->ci->db->where('students.grade_id', $grade);\n $this->ci->db->where('financial_year', $year);\n// $this->ci->db->where('students.active', 1);\n $this->ci->db->where('students.resign >', $tahun.'-'.$bulan.'-'.get_total_days($bulan));\n $this->ci->db->where('students.joined <=', $tahun.'-'.$bulan.'-'.get_total_days($bulan));\n \n $payments = $this->ci->db->get()->result(); \n \n $total = 0;\n $period = $this->months_from_period($monthperiod);\n foreach ($payments as $res)\n {\n $total = $total + $this->get_miss_student($res,$period,$monthperiod,$fee);\n }\n if ($total != null){ return $total; }else{ return 0; }\n\n }", "public function gettotalStoriesPerMonth() {\n $googleVis = new Googlevis();\n $columns = $googleVis->createColumns(\n array('Year/Month' => 'string', 'No. of Stories' => 'number')\n );\n\n $estimate_data = $this->getEstimateDataByMonth(\n $this->easybacklogClient->getStoriesFromTheme()\n );\n\n $row = $rows = $row_data = $row_label = array();\n\n foreach($estimate_data AS $year => $month) {\n foreach($month AS $month_no => $stories) {\n foreach($stories AS $story) {\n $counter = (!isset($counter) ? 0 : $counter);\n $counter += $story;\n }\n $rows[] = $googleVis->createDataRow(\n $year .\"/\". $month_no,\n $counter\n );\n $counter = 0;\n }\n }\n return array('cols' => $columns, 'rows' => $rows);\n }", "public function getShippingRate();", "public function getMaximumAmountPerMonth()\n {\n return $this->maximumAmountPerMonth;\n }", "public function calculate_end_month_bonus()\n {\n $year = (new DateTime)->format(\"Y\");\n $month = (new DateTime)->format(\"n\");\n\n if($month == 1){\n $month = 12;\n $year = $year - 1;\n } else {\n $month = $month - 1;\n }\n\n //count for DO Rank Members\n $do_members = ActiveDo::all();\n $sdo_members = ActiveSdo::all();\n //$userPurchases = UserPurchase::all(); // originall\n $userPurchases = UserPurchase::groupBy('user_id', 'product_id')\n ->selectRaw('user_id, product_id, sum(price) as price, sum(pv) as pv, count(*) as quantity')\n ->whereMonth('created_at', $month)\n ->whereYear('created_at', $year)\n ->get();\n //$userStores = Store::all(); // originall\n $userStores = Store::groupBy('user_id', 'product_id')\n ->selectRaw('user_id, product_id, sum(price) as price, sum(pv) as pv, count(*) as quantity')\n ->whereMonth('created_at', $month)\n ->whereYear('created_at', $year)\n ->get();\n \n $next_do_members= $do_members;\n $i = 0;\n $n = count($do_members);\n\n $total_sales1 = UserPurchase::sum('price');\n $total_sales2 = Store::sum('price');\n $total_sales = $total_sales1 + $total_sales2;\n\n $total_pv1 = UserPurchase::sum('pv');\n $total_pv2 = Store::sum('pv');\n $total_pv = $total_pv1 + $total_pv2;\n\n //$sale = Sale::where('year', $year)->where('month', $month)->first();\n $sale = Sale::firstOrCreate([]);\n $sale->re_total_sale = $total_sales;\n $sale->re_total_pv = $total_pv;\n $sale->save();\n\n // echo '<br>';\n // echo '<pre>';\n // print_r($userStores);\n // echo '<pre>';\n // echo '<br>';\n\n foreach ($userPurchases as $userPurchase) \n {\n $this->retail_price($userPurchase->user_id, $userPurchase->price, $userPurchase->product_id);\n //$this->upline_personal_rebate($userPurchase->user_id, $userPurchase->pv);\n $this->personal_rebate($userPurchase->user_id, $userPurchase->pv, $userPurchase->product_id);\n }\n\n foreach($userStores as $store)\n {\n $this->retail_price($store->user_id, $store->price, $store->product_id);\n //$this->pay_valid_upline_for_personal_rebate($store->user_id, $store->pv);\n //$this->upline_personal_rebate($store->user_id, $store->pv);\n $this->personal_rebate($store->user_id, $store->pv, $store->product_id);\n }\n\n foreach($do_members as $member)\n {\n $this->calculate_active_do_personal_gpv($member->user_id);\n // $this->group_bonus($member->user_id);\n }\n\n foreach($do_members as $member)\n {\n // $this->calculate_active_do_personal_gpv($member->user_id);\n $this->group_bonus($member->user_id);\n }\n\n $this->calculate_total_group_pv();\n\n foreach ($sdo_members as $smember) {\n $this->calculate_active_sdo_personal_gpv($smember->user_id);\n // $this->sdo_bonus($smember->user_id); //need to separate\n // $this->sdo_to_sdo_bonus($smember->user_id); //need to separate\n }\n\n foreach ($sdo_members as $smember) {\n $this->sdo_bonus($smember->user_id); \n $this->sdo_to_sdo_bonus($smember->user_id); \n }\n\n // foreach($next_do_members as $next_member)\n // {\n // //$this->calculate_active_do_personal_gpv($member->user_id);\n // $this->group_bonus($next_member->user_id);\n // }\n\n $ewallets = Wallet::all();\n\n foreach ($ewallets as $wallet) {\n //$this->direct_sponsor_bonus($wallet->user_id, $wallet->pv, $wallet->first_purchased);\n $this->direct_sponsor_bonus($wallet->user_id, $wallet->pv);\n }\n\n $do_cto_bonus = $this->do_cto_bonus();\n $sdo_cto_bonus = $this->sdo_cto_bonus();\n\n //$this->countTotalBonus();\n $this->recordUserBonuses();\n //$this->countTotalBonus();\n }", "function get_period_balance($cur='IDR',$acc=null,$month=null,$year=null,$emonth=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->cek_between_month($month, $emonth);\n $this->cek_between_year($year, $eyear);\n $this->db->where('gls.currency', $cur);\n// $this->db->where('MONTH(dates)', $month);\n// $this->db->where('YEAR(dates)', $year);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "private static function getAmortizationCoefficient(float $rate): float\n {\n // Life of assets (1/rate) Depreciation coefficient\n // Less than 3 years 1\n // Between 3 and 4 years 1.5\n // Between 5 and 6 years 2\n // More than 6 years 2.5\n $fUsePer = 1.0 / $rate;\n\n if ($fUsePer < 3.0) {\n return 1.0;\n } elseif ($fUsePer < 4.0) {\n return 1.5;\n } elseif ($fUsePer <= 6.0) {\n return 2.0;\n }\n\n return 2.5;\n }", "public function getMonthPartnersIncome($year, $month) {\n //$vydaje = $this->db->table('translator_project')->where('accounted', 1)->where('translator_id=? OR translator_id=?', 1, 2)->where('project_id', $this->db->table('project')->select('id')->where('invoice_date LIKE ?', $year.'-'.$month.'%'))->sum('payment');\n //return $prijmy - $vydaje;\n return 0;\n }", "public function computeSalary()\n {\n /**\n * Payments are done every 15th and 30th of every month\n * For 15th:\n * Day 1 to 14th of the month plus day 30 and 31st of the previous month\n * For 30th:\n * Day 15th to 29th\n */\n\n // check if today is the 15th or 30th / 28th for Feb\n $today = new \\DateTime();\n $day_today = $today->format( 'd' );\n $is_leap_year = intval( date('Y') ) % 4 == 0;\n\n // compute salary only on the 15th and the 30th\n if( $day_today == 15 ){\n // get teacher whose salary was not computed yet\n $teachers = ( new TeacherPivot )->getSalaryUnprocessedAsOf( $today->format('Y-m-d') );\n foreach( $teachers as $teacher ){\n $teacher->processDailyIncome();\n }\n }elseif( $day_today == 30 ){\n\n }elseif( $day_today == 28 && date('m') == 2 && !$is_leap_year ){\n\n }elseif( $day_today == 29 && date('m') == 2 && $is_leap_year ){\n\n }\n\n }", "public function view_total_student_payment()\n\t{\n\t\t$pay_month=$this->input->post('pay_month');\n\t\t$result=$this->Payment_model->view_total_payment($pay_month);\n\t\tif($result):\n\t\t\tif($result[0]->total_payment>0):\n ?>\n\t\t\t<div class=\"text-center\">\n\t\t\t <h3 class=\"p-5 bg-primary d-inline-block text-white \"><?= $result[0]->total_payment; ?> Tk</h3>\n\t\t\t</div>\n <?php\n\t\t\telse:\n\t\t\t\t?>\n\t\t\t\t\t<h6 class=\"text-center text-danger\">00 Tk </h6>\n\t\t\t\t<?php\n\t\t\t\tendif;\n else:\n\t\t\t?>\n\t\t\t<h6 class=\"text-center text-danger\">00 Tk </h6>\n <?php\n endif;\n\t}", "public function calculate_package_period($period)\n {\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 day\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +2 week\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +1 month\");\n // $date = strtotime(date(\"Y-m-d\", strtotime($date)) . \" +30 days\");\n $today=Date('Y-m-d');\n if($period==1){\n $date = strtotime(date(\"Y-m-d\", strtotime($today)) . \" +3 month\");\n $membership_end = date(\"Y-m-d\", $date);\n }else if($period==0){\n $membership_end='';\n }\n return array('membership_end'=>$membership_end);\n }", "public function monthlyReport($year, $month){\n\t\t$result = collect();\n\t\tforeach(Employee::getActiveEmployee(true, $year, $month) as $employee){\n\t\t\t$result->put($employee->nip, $employee->getAttendanceSummaryByMonth($year, $month));\n\t\t}\n\t\t\n\t\t$return = collect();\n\t\t$returnCount = $result->count();\n\t\tforeach($this->resutlKeys as $key){\n\t\t\t$val = collect($result->map(function($summary) use($key, $returnCount) {\n\t\t\t\t\t\treturn isset($summary[$key])? $summary[$key] : 0;\n\t\t\t\t\t}))->sum();\n\t\t\t$return->put($key, $val);\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "public function getTotalDiscount(): float;", "public function getAmountThisMonth(): float\n {\n return $this->amountThisMonth;\n }", "public function setMonthlyInstalment(float $monthlyInstalment): self\n {\n $this->monthlyInstalment = $monthlyInstalment;\n\n return $this;\n }", "public function retrieveRevenueThisMonth()\n {\n $query = \"SELECT SUM(exlAmount) as thisMonthTotal FROM payment WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()));\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "public function getEstimateSpreadPerMonth() {\n\n // Do the columns\n $googleVis = new Googlevis();\n $columns = $googleVis->createColumns(\n array(\n 'Month' => 'string', \n 'Size: 1' => 'number', \n 'Size: 2' => 'number', \n 'Size: 3' => 'number', \n 'Size: 5' => 'number', \n 'Size: 8' => 'number', \n 'Size: 13' => 'number', \n 'Size: 20' => 'number'\n )\n );\n \n $estimate_data = $this->getEstimateDataByMonth(\n $this->easybacklogClient->getStoriesFromTheme()\n );\n\n\n $rows = array();\n foreach($estimate_data AS $year => $month) {\n foreach($month AS $month_no => $estimates) {\n foreach (array(1, 2, 3, 5, 8, 13, 20) AS $est) {\n $row_data[] = (isset($estimates[$est]) ? $estimates[$est] : 0);\n }\n\n $rows[] = $googleVis->createDataRow(\n $year .\"/\". $month_no,\n $row_data\n );\n $row = $row_label = $row_data = array();\n }\n \n }\n\n return array('cols' => $columns, 'rows' => $rows);\n }", "public function getPeriod() {}", "function sales_report_month($month){\n \t\t$this->db->select('products.PRODUCT, SUM(sales.QUANTITY_SOLD) SALES, products.COST_PRICE, products.SALES_PRICE');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->where('MONTH(sales.SALES_DATE)', $month['MONTH']);\n \t\t$this->db->where('YEAR(sales.SALES_DATE)', $month['YEAR']);\n \t\t$this->db->where('sales.STATUS', 'Confirmed');\n \t\t$this->db->group_by('sales.PRODUCT_ID');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}" ]
[ "0.67783415", "0.67077565", "0.6666368", "0.6613046", "0.65895265", "0.64917725", "0.645638", "0.6337947", "0.6155035", "0.6042495", "0.59195554", "0.58932734", "0.58229834", "0.5814813", "0.5804146", "0.5789161", "0.57754105", "0.57588935", "0.5720379", "0.57112706", "0.5679862", "0.5663307", "0.5662081", "0.5654582", "0.5648555", "0.55804384", "0.55764335", "0.5570489", "0.5570489", "0.5549426", "0.5539334", "0.5533828", "0.55083704", "0.5506797", "0.55006534", "0.5498639", "0.5490167", "0.54838634", "0.5479978", "0.54782313", "0.54782313", "0.54782313", "0.54782313", "0.54782313", "0.5464942", "0.5455174", "0.54205924", "0.5420113", "0.5412019", "0.5403142", "0.54023695", "0.5394693", "0.5394498", "0.538906", "0.538766", "0.5380518", "0.53776795", "0.53572506", "0.5340679", "0.533519", "0.53277695", "0.53272426", "0.53192675", "0.5293311", "0.5275085", "0.5274502", "0.5264677", "0.5263969", "0.525652", "0.52526194", "0.5248288", "0.5237341", "0.52321804", "0.5230757", "0.5227154", "0.5221256", "0.5214244", "0.5207559", "0.519509", "0.5193422", "0.5182672", "0.51807886", "0.5179647", "0.51719093", "0.5166201", "0.5163038", "0.51628256", "0.51622766", "0.51567847", "0.51554966", "0.51471424", "0.5145605", "0.5131601", "0.51278293", "0.5125413", "0.51105833", "0.50797737", "0.50779235", "0.5060676", "0.5059789" ]
0.69513094
0
Returns number of months for instalment
public function getMonths();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumberOfMonths()\n {\n return $this->number_of_months;\n }", "public function months(): int\n {\n return $this->months;\n }", "function getNbDayInMonth()\n {\n return $this->nbDaysMonth;\n }", "public function getMonthlyInstalment();", "public function getCurrentMonthTotalOrder() : int;", "public function getMonthCardCount()\n {\n return $this->count(self::_MONTH_CARD);\n }", "public function getMonthCardCount()\n {\n return $this->count(self::_MONTH_CARD);\n }", "public function getTotalMonth()\n {\n $today = Carbon::now()->toDateString();\n $timezone = new Carbon();\n $last_thirty_days = $timezone->subDays(30);\n\n return $this->appUser->whereBetween('date_created', array($last_thirty_days, $today))->count();\n }", "function getCurrentMonthNumDays() {\n\t\treturn $this->_currentMonthNumDays;\n\t}", "public static function getMonth(){\n\t\t// this represents the number of seconds ni a month\n\t\t// editing this will lead to false values\n\t\treturn 2419200;\n\t}", "public function getMonth() : int\n {\n return $this->month;\n }", "public function get_month_permastruct()\n {\n }", "function monthLength($year, $mon)\n {\n $l = 28;\n while (checkdate($mon, $l + 1, $year)) $l++;\n return $l;\n }", "public function Months() {\r\n// $months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\r\n $months = array(1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');\r\n return $months;\r\n }", "private function _daysInMonth ()\n {\n return date('t', strtotime($this->currentYear.'-'.$this->currentMonth));\n }", "function getMonthTotal(){\n\t\t$total = $this->hhRentAmount;\n\t\tforeach ($this->members as $member){\n\t\t\tforeach ($member->getBills() as $bill){\n\t\t\t\t$total += $bill->getBillAmount();\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}", "function getCurrentMonthNumber ()\n\t{\n\t\treturn date('m');\n\t}", "public function countTotalDays($m = NULL){\n\t\t\t$count = 0;\n\t\t\t$first = true;\n\t\t\tforeach(array_reverse(array_keys($this->entries)) as $month){\n\t\t\t\tif($month == $m) $count = 0;\n\t\t\t\tif($first){\n\t\t\t\t\t$first = array_keys(array_reverse($this->entries[$month]));\n\t\t\t\t\t$first = explode(\"-\", $firstmonth[0]);\n\t\t\t\t\t$count += date(\"n\", strtotime($month)) - $first[2] - 1;\n\t\t\t\t\t$first = false;\n\t\t\t\t} else if(date(\"n\", strtotime($month)) == date(\"n\")) $count += date(\"j\") - (time() < strtotime($this->config->emailTime));\n\t\t\t\telse $count += date(\"t\", strtotime($month));\n\t\t\t\tif($month == $m) break;\n\t\t\t}\n\t\t\treturn $count;\n\t\t}", "function getDaysInMonth()\r\n {\r\n return Data_Calc::diasInMonth($this->mes, $this->ano);\r\n }", "public function getNumberOfDays($month = \"\"){ $month = ($month == \"\")? $this->getMonth(): $month; return cal_days_in_month(CAL_GREGORIAN,$month,$this->getYear());}", "public static function getNumberOfCurrentMonthDays(): int\n {\n $currentDate = self::getCurrentDateTime();\n\n return self::getNumberOfMonthDays($currentDate);\n }", "public static function getMonths() \n\t {\n\t\t $month=array(1,2,3,4,5,6,7,8,9,10,11,12);\n\t\t return $month;\n\t }", "static private function monthlength($year, $mon)\n\t{\n\t\t$l = 28;\n\t\twhile (checkdate($mon, $l+1, $year))\n\t\t{\n\t\t\t$l++;\n\t\t}\n\t\treturn $l;\n\t}", "public function totalOfMonth() {\n\n $query = \"SELECT SUM(TOTAL) AS TOTAL_MONTH FROM BUY WHERE\" .\n \" MONTH(BUYDATE) = MONTH(NOW()) AND YEAR(BUYDATE) = YEAR(NOW()) \";\n\n $result = parent::query($query);\n\n if ($row = $result->fetch_assoc()) {\n return $row['TOTAL_MONTH'];\n }\n\n return null;\n }", "public function ntc_months ($input) {\n $this->months_input = substr($input, -19, 2);\n return $this->months_output = date('m') - $this->months_input;\n }", "function monthlyStats($month, $conn){\n $query = $conn->query(\"SELECT * FROM viewer_tbl\");\n $counter = 0;\n while ($data = $query->fetch_array()) {\n $dbMonth = $data['visited_date'];\n if($month == date('F' , strtotime($dbMonth))){\n ++$counter;\n }\n }\n return $counter;\n }", "public function getNextMonth(){\n\t\tif($this->getMonth() == 12){return 1;}\n\t\telse{return $this->getMonth()+1;}\n\t}", "public static function month_num($month){\n if (is_numeric($month)){\n return $month;\n }\n\n $m = array();\n $ret_val = 0;\n if (is_string($month)){\n /* $m = array(1 => 'january', 'february', 'march', 'april', 'may', 'june', 'july',\n 'august', 'september', 'october', 'november', 'december',); */\n $month = drupal_strtolower($month);\n for($ctr = 1; $ctr <= 12; $ctr++){\n $m[$ctr] = drupal_strtolower(date('F', mktime(0, 0, 0, $ctr, 1, date('Y'))));\n if ($m[$ctr] == $month){\n $ret_val = $ctr;\n break;\n }\n }\n }\n\n return $ret_val;\n\n }", "public function is_month()\n {\n }", "public function getMonths()\r\n\t{\r\n \t$months = array();\r\n\t\t\r\n\t\tfor($i = 1; $i <= 12; $i++)\r\n\t\t{\r\n\t\t\t$label = ($i < 10) ? (\"0\" . $i) : $i;\r\n\t\t\t\r\n\t\t\t$months[] = array(\"num\" => $i, \"label\" => $this->htmlEscape($label));\r\n\t\t}\r\n\t\t\r\n\t\treturn $months;\r\n\t}", "public function getCounterOfMonth($month = 0) {\n\t\t$month = (0 === $month OR $month > 12 OR $month < 1) ? $this->Request->month : $month;\n\t\t$this->Db->query(\"SELECT COUNT(*) FROM `yp_stat` \n\t\t\tWHERE `month` = {$month}\n\t\t\t\tAND `year` = {$this->Request->year}\");\n\t\t$stat = $this->Db->fetch_field();\n\n\t\treturn (int) $stat[0];\n\t}", "public function countAllMonths(DateTime $start, DateTime $end) : int\n\t{\n\t\t$startYear = (int) $start->format('Y');\n\t\t$startMonth = (int) $start->format('m');\n\t\t$endYear = (int) $end->format('Y');\n\t\t$endMonth = (int) $end->format('m');\n\t\treturn ($endYear - $startYear) * 12 + ($endMonth - $startMonth) + 1;\n\t}", "public function getCcMonths()\r\n {\r\n $months = $this->getData('cc_months');\r\n if (is_null($months)) {\r\n $months[0] = $this->__('Month');\r\n $months = array_merge($months, Mage::getSingleton('payment/config')->getMonths());\r\n $this->setData('cc_months', $months);\r\n }\r\n return $months;\r\n }", "public function getDifferenceInMonths();", "public function getInstallmentCount()\r\n\t{\r\n\t\treturn $this->root->getAttribute('nbmensualites');\r\n\t}", "public function AvailableMonths() {\n\t\t$params = $this->parseParams();\n\n\t\treturn DatedUpdateHolder::ExtractMonths(\n\t\t\t$this->Updates($params['tag'], $params['from'], $params['to']),\n\t\t\tDirector::makeRelative($_SERVER['REQUEST_URI']),\n\t\t\t$params['year'],\n\t\t\t$params['month']\n\t\t);\n\t}", "public function listMonths()\n {\n return $this->ozioma->month->list();\n }", "function get_jumlah_hari_dlm_bln($bln,$thn)\n\t{\n\t\t$num = cal_days_in_month(CAL_GREGORIAN,$bln,$thn);\n\t\treturn $num;\n\t}", "public function gettotalStoriesPerMonth() {\n $googleVis = new Googlevis();\n $columns = $googleVis->createColumns(\n array('Year/Month' => 'string', 'No. of Stories' => 'number')\n );\n\n $estimate_data = $this->getEstimateDataByMonth(\n $this->easybacklogClient->getStoriesFromTheme()\n );\n\n $row = $rows = $row_data = $row_label = array();\n\n foreach($estimate_data AS $year => $month) {\n foreach($month AS $month_no => $stories) {\n foreach($stories AS $story) {\n $counter = (!isset($counter) ? 0 : $counter);\n $counter += $story;\n }\n $rows[] = $googleVis->createDataRow(\n $year .\"/\". $month_no,\n $counter\n );\n $counter = 0;\n }\n }\n return array('cols' => $columns, 'rows' => $rows);\n }", "function initMonth()\n {\n //! Si aucun mois ou année n'est recupéré on prend le mois et l'année actuel\n if (!$this->currentMonthName || !$this->year) {\n $this->currentMonthIndex = (int)date(\"m\", time()) - 1;\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n $this->year = (int)date(\"Y\", time());\n }\n // recalcule le premier jour pour ce mois et le nombre de jour total du mois\n $this->firstDayInMonth = strftime('%u', strtotime(strval($this->currentMonthIndex + 1) . '/01/' . strval($this->year)));\n $this->nbDaysMonth = cal_days_in_month(CAL_GREGORIAN, $this->currentMonthIndex + 1, $this->year);\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n }", "function month_number_vue(int $year, int $month): int{\r\n $total = 0;\r\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\r\n $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'counter-' . $year . '-' . $month . '-' . '*';\r\n $files = glob($file);\r\n foreach($files as $file){\r\n $total += (int)file_get_contents($file);\r\n }\r\n return $total;\r\n}", "public function takePostBaseOnMonth();", "function totalHari($month,$year){\n $jumlah = cal_days_in_month(CAL_GREGORIAN,$month,$year);\n return $jumlah;\n}", "protected function frequency()\n {\n return 'monthly';\n }", "public function GetNrOffWeeksInMonth() {\n $firstWeek = $this->GetFirstWeekOfMonth();\n $lastWeek = $this->GetLastWeekOfMonth();\n if ($firstWeek > $lastWeek) {\n // if january\n\t\t\tif ($this->GetMonth(true) == \"01\") {\n\t\t\t\treturn $lastWeek + 1;\n\t\t\t}\n // if december\n\t\t\telse {\n\t\t\t\treturn (((int)date(\"W\", strtotime($this->GetYear() . \"-\" . $this->GetMonth() . ($this->GetLastDayOfMonth() - 7))) + 1) - $firstWeek + 1);\n\t\t\t}\n\t\t}\n\t\treturn ($lastWeek - $firstWeek + 1);\n }", "public function getMonth()\n {\n return $this->_getDateValue('m');\n }", "public function getCcMonths()\n {\n $months = $this->getData('cc_months');\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $this->_getConfig()->getMonths());\n $this->setData('cc_months', $months);\n }\n return $months;\n }", "public function getCcMonths()\n {\n return $this->config->getMonths();\n }", "public static function getMonthlySales()\n\t{\n\t\tTools::displayAsDeprecated();\n\t\t$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('\n\t\tSELECT SUM(`total_paid`) as nb\n\t\tFROM `'._DB_PREFIX_.'orders`\n\t\tWHERE MONTH(`date_add`) = MONTH(NOW())\n\t\tAND YEAR(`date_add`) = YEAR(NOW())');\n\n\t\treturn isset($result['nb']) ? $result['nb'] : 0;\n\t}", "public function getMonthlyInstalment(): float\n {\n return $this->monthlyInstalment;\n }", "function getMonthIndex()\n {\n return $this->currentMonthIndex;\n }", "function getMonthLabels() {\n\t\treturn array('count_jan', 'count_feb', 'count_mar', 'count_apr', 'count_may', 'count_jun', 'count_jul', 'count_aug', 'count_sep', 'count_oct', 'count_nov', 'count_dec');\n\t}", "function getMonth()\r\n {\r\n return $this->mes;\r\n }", "function add_months(&$t, $m)\n{\n $t['tm_mon'] += $m;\n if ($t['tm_mon'] > 12) \n {\n $t['tm_mon'] -= 12;\n $t['tm_year'] ++;\n }\n elseif ($t['tm_mon'] < 1) \n {\n $t['tm_mon'] += 12;\n $t['tm_year'] --;\n }\n return;\n}", "public function getCcMonths()\n {\n $months = $this->getData('cc_months');\n if ($months === null) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $this->_getConfig()->getMonths());\n $this->setData('cc_months', $months);\n }\n\n return $months;\n }", "private function getMonth() {\n\t\treturn $this->month;\n\t}", "protected function getMonthsArray()\n\t{\n\t\t$ma = array_pad([], 13, null);\n\t\tunset($ma[0]);\n\t\tforeach ($this->_attr[self::MONTH_OF_YEAR] as $m) {\n\t\t\tif (is_numeric($m['moy'])) {\n\t\t\t\tfor ($i = $m['moy']; $i <= $m['end'] && $i <= 12; $i += $m['period']) {\n\t\t\t\t\t$ma[$i] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ma;\n\t}", "protected function month(){\n return $this->now->format('m');\n }", "private function _weeksInMonth ()\n {\n // find number of days in this month\n $daysInMonths = $this->_daysInMonth();\n\n $numOfweeks = ($daysInMonths % 7 == 0 ? 0 : 1) +\n intval($daysInMonths / 7);\n\n $monthEndingDay = date('N', strtotime($this->currentYear.'-'.$this->currentMonth.'-'.$daysInMonths));\n $monthStartDay = date('N', strtotime($this->currentYear.'-'.$this->currentMonth.'-01'));\n\n if ($monthEndingDay < $monthStartDay) $numOfweeks ++;\n\n return $numOfweeks;\n }", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "public function getExpMonth(): ?int\n {\n return $this->expMonth;\n }", "function addMonths( $n=0 ) {\n\t\t$an = abs( $n );\n\t\t$years = floor( $an / 12 );\n\t\t$months = $an % 12;\n\t\t\n\t\tif ($n < 0) {\n\t\t\t$this->year -= $years;\n\t\t\t$this->month -= $months;\n\t\t\tif ($this->month < 1) {\n\t\t\t\t$this->year--;\n\t\t\t\t$this->month = 12 - $this->month;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->year += $years;\n\t\t\t$this->month += $months;\n\t\t\tif ($this->month > 12) {\n\t\t\t\t$this->year++;\n\t\t\t\t$this->month -= 12;\n\t\t\t}\n\t\t}\n\t}", "public static function getMonths()\n {\n return [ \n CarbonInterface::JANUARY => 'January', \n CarbonInterface::FEBRUARY => 'February', \n CarbonInterface::MARCH => 'March', \n CarbonInterface::APRIL => 'April', \n CarbonInterface::MAY => 'May', \n CarbonInterface::JUNE => 'June', \n CarbonInterface::JULY => 'July', \n CarbonInterface::AUGUST => 'August', \n CarbonInterface::SEPTEMBER => 'September', \n CarbonInterface::OCTOBER => 'October', \n CarbonInterface::NOVEMBER => 'November', \n CarbonInterface::DECEMBER => 'December', \n ];\n }", "function getMonthlyOrdersCount($mounth){\n $id_user = Auth::user()->id;\n\n // Faccio una query al db per prendere tutti i ristoranti con l'id user dell'utente loggato\n $restaurants_list = Restaurant::select()->where('user_id', $id_user)->get();\n\n // Faccio una query al db Per prendermi dalla colonna delivery time solo il mese che voglio con la varibiale mounth\n $mounthly_orders_count = Order::whereMonth('delivery_time', $mounth)->whereIn('restaurant_id' , Restaurant::select('id')->where('user_id', $id_user))->whereIn('id' , Payment::select('order_id')->where('status', 'Accepted'))->get()->count();\n\n return $mounthly_orders_count;\n }", "public function getExpiryMonth()\n {\n return $this->expiry_month;\n }", "public function getMonthInfo()\n {\n return $this->currentMonth;\n }", "public function getTwelveMonth() {\n $result = array();\n $cur = strtotime(date('Y-m-01', time()));\n for ($i = 0; $i <= 11; $i++) {\n $result[$i] = date('M', $cur);\n $cur = strtotime('next month', $cur);\n }\n\n return $result;\n }", "public function getMonthEn() \n {\n $month = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\n \n return $month;\n }", "function getMonthsInYear($y=null)\n {\n return 12;\n }", "public function getNextMonth()\n {\n return $this->calendarMonth->getNextMonth();\n }", "public function getCcMonths() {\n $data = Mage::app()->getLocale()->getTranslationList('month');\n foreach ($data as $key => $value) {\n $monthNum = ($key < 10) ? '0' . $key : $key;\n $data[$key] = $monthNum . ' - ' . $value;\n }\n\n $months = $this->getData('cc_months');\n if (is_null($months)) {\n $months[0] = $this->__('Month');\n $months = array_merge($months, $data);\n $this->setData('cc_months', $months);\n }\n\n\n return $months;\n }", "public function countLastMonth()\n\t{\n\t\t$fromDate = Carbon::parse('Monday last month')->subMonth(1)->toDateString();\n\t\t// ambil tanggal di hari terakhir dalam bulan kemarin\n\t\t$tillDate = Carbon::parse('Monday last month')->subMonth(1)->endOfMonth()->toDateString();\n\t\treturn $this->model\n\t\t\t\t\t->whereBetween('tgl', [$fromDate, $tillDate])\t\t\n\t\t\t\t\t->count();\n\t}", "public function getMonth()\n\t\t{\n\t\t\t$date = new \\DateTime($this->created_at);\n\t\t\treturn $date->format('M');\n\t\t}", "function getMonthDir() {\n return date(\"Y_m\");\n }", "public function getMonth() \n {\n $month = array('Januar', 'Februar', 'Mart', 'April', 'Maj', 'Juni', 'Juli', 'Avgust', 'Septembar', 'Octobar', 'Novembar', 'Decembar');\n \n return $month;\n }", "public function inasistencias_mes(int $y,int $m):int{\n\t\t$faltas=0;\n\t\t$days_in_month=Timemanager::dias_transcurridos($y,$m);\n\t\tfor($d=1;$d<$days_in_month;$d++){\n\t\t\tif(Timemanager::is_laborable($d,$m,$y) && !$this->had_permission($y,$m,$d) && !Timemanager::is_holiday($y,$m,$d) && !$this->asistio($y,$m,$d)){\n\t\t\t\t$faltas=$faltas+1;\n\t\t\t}\n\t\t}\n\t\treturn $faltas;\n\t}", "function days_in_month($month, $year)\n\t{\n\t\tif(checkdate($month, 31, $year)) return 31;\n\t\tif(checkdate($month, 30, $year)) return 30;\n\t\tif(checkdate($month, 29, $year)) return 29;\n\t\tif(checkdate($month, 28, $year)) return 28;\n\t\treturn 0; // error\n\t}", "function prim_options_month() {\n $month = array(\n 'jan' => t('jan'),\n 'feb' => t('feb'),\n 'mar' => t('mar'),\n 'apr' => t('apr'),\n 'may' => t('maj'),\n 'jun' => t('jun'),\n 'jul' => t('jul'),\n 'aug' => t('aug'),\n 'sep' => t('sep'),\n 'oct' => t('okt'),\n 'nov' => t('nov'),\n 'dec' => t('dec'),\n );\n\n return $month;\n}", "public function get_month_choices()\n {\n }", "function getWeeksInMonth()\r\n {\r\n return Data_Calc::weeksInMonth($this->mes, $this->ano);\r\n }", "function get_month()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"mon\"];\n }", "function daysInMonth( $month=0, $year=0 ) {\n\t\t$month = intval( $month );\n\t\t$year = intval( $year );\n\t\tif (!$month) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$month = $this->month;\n\t\t\t} else {\n\t\t\t\t$month = date( \"m\" );\n\t\t\t}\n\t\t}\n\t\tif (!$year) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$year = $this->year;\n\t\t\t} else {\n\t\t\t\t$year = date( \"Y\" );\n\t\t\t}\n\t\t}\n\t\tif ($month == 2) {\n\t\t\tif (($year % 4 == 0 && $year % 100 != 0) || $year % 400 == 0) {\n\t\t\t\treturn 29;\n\t\t\t} else {\n\t\t\t\treturn 28;\n\t\t\t}\n\t\t} else if ($month == 4 || $month == 6 || $month == 9 || $month == 11) {\n\t\t\treturn 30;\n\t\t} else {\n\t\t\treturn 31;\n\t\t}\n\t}", "public function getCurrentMonth() {\n return date('m');\n }", "public function getMonth(){\n\t\treturn $this->_month;\n\t}", "function getMonthArray()\n{\n\t$arrMonths = array();\n\n\tfor ($i=1; $i<13; $i++)\n\t{\n\t\t$arrMonths[$i] = date('M', mktime(0, 0, 1, $i, 1));\n\t}\n\t\n\treturn $arrMonths;\n}", "public function monthly()\n {\n return $this->cron('0 0 1 * * *');\n }", "public function getExpiryMonth()\n {\n return $this->getParameter('expiryMonth');\n }", "public static function no_of_days_in_month(string $month, $year){\r\n $month = static::month_str_to_int($month);\r\n $number = cal_days_in_month(CAL_GREGORIAN, $month, $year); \r\n return $number;\r\n }", "public function perMonth (){\n $data = Auction::totalPreMonth();\n return view(\"welcome\")->with('totalPerMonth',$data); \n }", "public function isMonth() : bool {\n $monthsArr = $this->taskDetails['months'];\n $retVal = true;\n\n if ($monthsArr['every-month'] !== true) {\n $retVal = false;\n $current = TasksManager::getMonth();\n $ranges = $monthsArr['at-range'];\n\n foreach ($ranges as $range) {\n if ($current >= $range[0] && $current <= $range[1]) {\n $retVal = true;\n break;\n }\n }\n\n if ($retVal === false) {\n $months = $monthsArr['every-x-month'];\n $retVal = in_array($current, $months);\n }\n }\n\n return $retVal;\n }", "public function indivMonthly(Request $request){\n $id = $request->SLAVE_ID;\n $year = date('Y');\n $month = [];\n for($i = 1; $i<=12; $i++){\n $perMonth = 0;\n $res = EMeterData::where('METER_ID',$id)\n ->whereMonth('CREATED_AT', '=', $i)\n ->whereYear('CREATED_AT','=',$year)->latest()->first();\n if (!empty($res) || $res == !null) {\n $perMonth += $res->CURRENT_MONTH_KWH;\n $perMonth = round($perMonth, 4);\n }\n $json = array(\n 'months' => date('D F d Y H:i:s O',mktime(0,0,0,$i,25)),\n 'usage' => $perMonth,\n );\n array_push($month,$json);\n }\n return $month;\n }", "public static function getCurrentMonth() {\n return date('n');\n }", "public function getNumberOfEventsPerMonth () {\n\t\t$driver = strtolower(Doctrine_Manager::connection()->getDriverName());\n\n\t\t$q = $this->createQuery('e');\n\t\t$q->select('COUNT(e.id) as num');\n\n\t\tif ($driver == 'sqlite') {\n\t\t\t$q->addSelect(\"strftime('%Y-%m-01', e.startdate) as date\");\n\t\t} else {\n\t\t\t$q->addSelect(\"DATE_FORMAT(e.startdate, '%Y-%m-01') as date\");\n\t\t}\n\n\t\t$q->groupBy('date');\n\t\t$q->orderBy('date asc');\n\n\t\treturn $q;\n\t}", "public function getMontoPlanificado()\n {\n $montoPlanificado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n $moneda=$actividad->getMoneda();\n $montoPlanificado+=($actividad->getMonto()*$moneda->getPrecioBs());\n }\n }\n return $montoPlanificado;\n }", "function yourls_l10n_months(){\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\treturn $yourls_locale_formats->month;\n}", "public function getMonthlyDataCount($month, $id)\n {\n \t$copyright_count = DB::table('copyrights')\n \t\t->join('applicants', 'copyrights.int_applicant_id', '=', 'applicants.int_id')\n\t ->join('departments', 'applicants.int_department_id', '=', 'departments.int_id')\n\t ->join('colleges', 'departments.int_college_id', '=', 'colleges.int_id')\n\t ->join('branches', 'colleges.int_branch_id', '=', 'branches.int_id')\n\t ->select(DB::raw('copyrights.int_id'))\n\t ->whereMonth('copyrights.created_at', $month)\n\t ->where('departments.int_id', $id)\n\t ->get()\n ->count();\n return $copyright_count;\n }", "public function getMonthPartnersIncome($year, $month) {\n //$vydaje = $this->db->table('translator_project')->where('accounted', 1)->where('translator_id=? OR translator_id=?', 1, 2)->where('project_id', $this->db->table('project')->select('id')->where('invoice_date LIKE ?', $year.'-'.$month.'%'))->sum('payment');\n //return $prijmy - $vydaje;\n return 0;\n }", "function nb_mois($date1, $date2)\r\n\t{\r\n\t // $end = new DateTime( $date2 );\r\n\t // $end = $end->modify( '+1 month' );\r\n\r\n\t // $interval = DateInterval::createFromDateString('+ 1 month');\r\n\r\n\t // $period = new DatePeriod($begin, $interval, $end);\r\n\t // $counter = 0;\r\n\t // foreach($period as $dt) {\r\n\t // $counter++;\r\n\t // }\r\n\r\n\t // return $counter;\r\n\t\t// $date1 = '2000-01-25';\r\n\t\t// $date2 = '2010-02-20';\r\n\r\n\t\t$ts1 = strtotime($date1);\r\n\t\t$ts2 = strtotime($date2);\r\n\r\n\t\t$year1 = date('Y', $ts1);\r\n\t\t$year2 = date('Y', $ts2);\r\n\r\n\t\t$month1 = date('m', $ts1);\r\n\t\t$month2 = date('m', $ts2);\r\n\r\n\t\t$diff = (($year2 - $year1) * 12) + ($month2 - $month1);\r\n\t\treturn $diff;\r\n\t}", "function get_month_days_cm ($fecha) {\n $labels = array();\n $month = month_converter($fecha->month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $fecha->month, $fecha->year);\n $i = 0;\n while ($i < $monthdays) {\n $i++;\n $labels[] = $i;\n }\n return $labels;\n}", "public function months()\n {\n $input = $this->months;\n\n if (is_null($input) || in_array(0, $input)) { return 'Any month';}\n if (count($input) == 1 ) {return monthsList()[$input[0]];}\n\n sort($input);\n $output = collect($input)->map(function($month) {\n return monthsList()[$month];\n })\n ->implode(', ')\n ;\n\n return $output;\n }" ]
[ "0.7398492", "0.7302493", "0.7043116", "0.7013221", "0.6866557", "0.6717304", "0.6717304", "0.6699203", "0.6648021", "0.6620124", "0.6560028", "0.65507483", "0.64910173", "0.6488247", "0.64273345", "0.6421676", "0.6391839", "0.63759726", "0.6342208", "0.6327906", "0.63273346", "0.6289998", "0.62770087", "0.61932945", "0.6154442", "0.6118483", "0.60988164", "0.60986227", "0.60889405", "0.60860354", "0.60773724", "0.6057166", "0.60550773", "0.60477936", "0.6044767", "0.60412496", "0.6040841", "0.60354173", "0.6020314", "0.60120744", "0.60104257", "0.59954464", "0.5969142", "0.59646636", "0.5948069", "0.59436053", "0.5938893", "0.59284306", "0.59245557", "0.59222496", "0.5896271", "0.5888262", "0.58765936", "0.5867383", "0.5859705", "0.5858386", "0.58419245", "0.58376336", "0.58091915", "0.57948595", "0.5793631", "0.5789572", "0.57895327", "0.57565933", "0.575538", "0.5754135", "0.5748685", "0.57472104", "0.5742989", "0.5734356", "0.5723126", "0.5716896", "0.56996495", "0.5691367", "0.5677989", "0.5674411", "0.56736714", "0.56692904", "0.5667544", "0.5662177", "0.56554323", "0.56491464", "0.56369334", "0.5636564", "0.5632167", "0.5629324", "0.5627319", "0.5627312", "0.5618555", "0.56141454", "0.5610178", "0.5609482", "0.5606992", "0.5603744", "0.560272", "0.55962974", "0.55937266", "0.55936795", "0.55799854", "0.5578785" ]
0.67589575
5
Returns instalment text for frontend
public function getText();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomizeText(){\n\n $text = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALLMENT_TEXT);\n if(!empty($text)){\n return $text;\n }\n return __('Juros');\n }", "public function buildConfigText() {\n\t\t$this->setPrimaryDomain();\n\t\n\t\tob_start();\n\t\t$installation_path = $this->installation_path;\n\t\t$name = $this->sitename;\n\t\t$domains = array(\n\t\t\t$this->primary_domain\n\t\t);\n\t\t$redirrectdomains = array();\n\t\tinclude(SHARED_PATH . 'provisioning/httpd.tpl');\n\t\t$config_text = ob_get_clean ();\n\t\treturn $config_text;\n\t\t\n\t}", "function getDescription()\n {\n $description = '\n\t\tThis is the template installation type. Change this text within the file for this installation type.';\n return $description;\n }", "public function welcomInformations() {\n echo \"\\t\\t####################################\\t\\t\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t# \" . Utils::red(\"This is a Enterprise Backup Tool!\") . \"\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t####################################\\t\\t\\n\\n\";\n }", "public function get_text()\n {\n }", "public function get_default_additional_content()\n {\n\n return __('Thanks for reading.', 'subscriptio');\n }", "public function get_default_additional_content()\n {\n\n return __('Hope to see you back soon.', 'subscriptio');\n }", "public static function installation_page()\n\t{\n\t\tmz_Func::user_has_access();\n\n\t\techo '\n\n\t\t\t<div class=\"wrap\">\n\n\t\t\t\t<h2>Mentorz - Installation Guidelines</h2>\n\t\t\t\t<p>Installation.</p>\n\t\t\t\t<p>Create three pages.</p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>/'.PLUGIN_ROOT_PAGE.'</li>\n\t\t\t\t\t<li>/'.PLUGIN_CREATE_PAGE.'</li>\n\t\t\t\t\t<li>/'.PLUGIN_READ_PAGE.'</li>\n\t\t\t\t</ol>\n\n\t\t\t\t<p>\n\t\t\t\tThese pages can be modified in settings.php if required.\n\t\t\t\t</p>\n\n\t\t\t\t<h3>Users</h3>\n\t\t\t\t<p>The system uses two types of user.</p>\n\t\t\t\t<ol>\n\t\t\t\t\t<li>Mentor</li>\n\t\t\t\t\t<li>Student</li>\n\t\t\t\t</ol>\n\n\t\t\t\t<p>When managing users in the WordPress User module ensure that users have the proper role.</p>\n\n\n\t\t\t\t<h3>Tags</h3>\n\n\t\t\t\t<p>The following tags are designed to be placed inside the WordPress page content area</p>\n\n\t\t\t\t<p><input value=\"[mentorz_inbox]\"> can be placed in the page to generate the inbox view. Pages must be /inbox (Or defined above)</p>\n\n\t\t\t\t<p><input value=\"[mentorz_create]\"> can be placed in the page to generate the message creation form. Page must be /inbox/create (Or defined above)</p>\n\n\t\t\t\t<p><input value=\"[mentorz_show]\"> can be placed in the page to generate the message view. Page must be /inbox/show (Or defined above)</p>\n\n\t\t\t\t<h3>Emails</h3>\n\t\t\t\t<p>When a message is generated the system will email the relevant user to notify them of the message</p>\n\t\t\t\t<p>The message content is NOT emailed for security reasons.</p>\n\t\t\t\t<p>The email details can be modified in settings.php</p>\n\n\t\t\t</div>\n\n\t\t';\n\t}", "function anzeigen(){\n\techo '\n\t\t<b>Installation:</b><br>\n\t\tDie <a href=\"http://www.kis-fiktiv.bplaced.net/quellcode.zip\">Quellcodedateien</a> werden auf einen PHP- und datenbankfähigen Server kopiert, z.B. auf \n\t\t<a href=\"http://www.bplaced.net/\">http://www.bplaced.net/</a>. Die Datenbank wird erstellt indem die Datei gen.php\n\t\tauf dem Server ausgeführt wird. Dazu muss der Hostname, Benutzername, Passwort, Name der eigenen Datenbank vorher in \n\t\tdie Datei config.php eingetragen werden.<br><br>\n\t\t\n\t\t<b>Rollen und Rechtesystem:</b><br>\n\t\tDer Benutzer kann sich unter 3 verschiedenen Rollen in das System einwählen. Chefarzt, Arzthelfer, Admin.\n\t\tJe nach Rolle hat er dann ein Lese- und / oder Schreibrecht für das Formular.<br><br>\n\n\t\t<b>Funktionalität:</b><br>\n\t\tEin Patient wird ausgewählt, dann wird auf \"weiter\" geklickt. Es wird ein leeres Formular erstellt, falls noch kein Formular \t\t\tgespeichert ist. Andernfalls wird das Formular des Patienten angezeigt. Das Formular kann dann geändert oder gelöscht \t\t\t\twerden.<br><br>\n\n\t\t<b>Plausibilität der Eingaben:</b><br>\n\t\tBei Einigen Feldern im Formular ist die Eingabe nur mit bestimmten Datentypen und Werten möglich:<br>\n\t\t<div id=\"tab\">\n\t\t- Der PSA-Wert muss kleiner als 3,2 sein <br>\n\t\t- IPSS liegt zwischen 0 und 35 <br>\n\t\t- 1. und 2. Gleasonfeld muss Werte zwischen 1 und 5 haben <br><br>\n\t\t</div>\n\t\t<b>Tabellen der Datenbank:</b><br>\n\t\t<div id=\"tab\">\n\t\t\t- Formular<br>\n\t\t\t- Patient<br>\n\t\t\t- Rollen<br>\n\t\t\t- Users<br><br>\n\t\t</div>\n\t\t</div>';\t\t\n\t}", "public function showInstallerApp() {\n\t\t$doc = JFactory::getDocument();\n\t\t$this->loadJQuery($doc);\n\t\t$this->loadBootstrap($doc);\n\t\t$doc->addStylesheet ( JUri::root ( true ) . '/administrator/components/com_jmap/css/cpanel.css' );\n\t\t$doc->addScript ( JUri::root ( true ) . '/administrator/components/com_jmap/js/installer.js' );\n\t\n\t\t// Set layout\n\t\t$this->setLayout('default');\n\t\n\t\t// Format data\n\t\tparent::display ('installer');\n\t}", "function ams_woocommerce_missing() {\n $massing_text = esc_html__('Affiliate Management System - WooCommerce Amazon requires WooCommerce to be installed and active. You can download', 'ams-wc-amazon' );\n $translators_text = sprintf( '<div class=\"error\"><p><strong>%s <a href=\"https://wordpress.org/plugins/woocommerce/\" target=\"_blank\">%s</a> here.</strong></p></div>', $massing_text, esc_html__( 'WooCommerce', 'ams-wc-amazon' ) );\n echo $translators_text ;\n}", "function main() {\n\t\t$content = '';\n\t\t$objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n\t\t/** @var ClassCacheManager $classCacheManager */\n\t\t$classCacheManager = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Cache\\\\ClassCacheManager');\n\t\t$classCacheManager->reBuild();\n\n\t\t/** @var DatabaseUpdateUtility $databaseUpdateUtility */\n\t\t$databaseUpdateUtility = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Utility\\\\DatabaseUpdateUtility');\n\t\t$databaseUpdateUtility->doUpdate('static_info_tables_zh');\n\n\t\t$content .= '<p>' . \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables', ['static_info_tables_zh']) . '.</p>';\n\t\treturn $content;\n\t}", "function help()\n\t{\n\t\t/* check if all required plugins are installed */\n\t\t\n\t\t$text = \"<div class='center buttons-bar'><form method='post' action='\".e_SELF.\"?\".e_QUERY.\"' id='core-db-import-form'>\";\n\t\t$text .= e107::getForm()->admin_button('importThemeDemo', 'Install Demo', 'other');\n\t\t$text .= '</form></div>';\n \n\t \treturn $text;\n\t}", "private static function hypertext()\n {\n $files = ['Res', 'Html'];\n $folder = static::$root.'Hypertext'.'/';\n\n self::call($files, $folder);\n }", "public function main() {\n\t\t$content = '';\n\t\t/** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n\t\t$objectManager = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n\t\t// Clear the class cache\n\t\t/** @var \\SJBR\\StaticInfoTables\\Cache\\ClassCacheManager $classCacheManager */\n\t\t$classCacheManager = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Cache\\\\ClassCacheManager');\n\t\t$classCacheManager->reBuild();\n\n\t\t// Update the database\n\t\t/** @var \\SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility $databaseUpdateUtility */\n\t\t$databaseUpdateUtility = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Utility\\\\DatabaseUpdateUtility');\n\t\t$databaseUpdateUtility->doUpdate('static_info_tables_it');\n\n\t\t$content.= '<p>' . LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables') . ' static_info_tables_it.</p>';\n\t\treturn $content;\n\t}", "function ui_description() {\n return t('Extend Linkit with file support (Managed files).');\n }", "public function helperText()\n {\n return \"\";\n }", "function training_page_html() {\n return t('This is the landing page of the Training module');\n}", "public function getAlt(): string\n {\n return htmlspecialchars($this->getDescription(), ENT_QUOTES);\n }", "public function output() {\n\n\t\t$data = $this->get_alert_data();\n\n\t\tif ( empty( $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\n\t\t\t'<div id=\"wpforms-builder-license-alert\">\n\t\t\t\t<img src=\"%1$s\" />\n\t\t\t\t<h3>%2$s</h3>\n\t\t\t\t<p>%3$s</p>\n\t\t\t\t<div>\n\t\t\t\t\t<a href=\"%4$s\" class=\"button button-primary\">%5$s</a>\n\t\t\t\t\t<a href=\"%6$s\" class=\"button button-secondary\">%7$s</a>\n\t\t\t\t\t<button class=\"close\"></button>\n\t\t\t\t</div>\n\t\t\t</div>',\n\t\t\t\\esc_url( WPFORMS_PLUGIN_URL . 'assets/images/sullie-builder-mobile.png' ),\n\t\t\t\\esc_html( $data['heading'] ),\n\t\t\t\\esc_html( $data['description'] ),\n\t\t\t\\esc_url( $data['button-primary-url'] ),\n\t\t\t\\esc_html( $data['button-primary'] ),\n\t\t\t\\esc_url( $data['button-secondary-url'] ),\n\t\t\t\\esc_html( $data['button-secondary'] )\n\t\t);\n\n\t\t\\add_filter( 'wpforms_builder_output', '__return_false' );\n\t}", "protected function output() {\n\t\treturn \"<hr class=\\\"hr-text\\\" data-content=\\\"{$this->option( 'text', '' )}\\\"/>\";\n\t}", "protected function myDescription()\n {\n return _t('OrderStep.SENTINVOICE_DESCRIPTION', 'Invoice gets sent to the customer via e-mail. In many cases, it is better to only send a receipt and sent the invoice to the shop admin only so that they know an order is coming, while the customer only sees a receipt which shows payment as well as the order itself.');\n }", "public function getOutput()\n\t{\n\t\tif( ! IPSLib::appIsInstalled( 'calendar' ) )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t/* Load language */\n\t\t$this->registry->class_localization->loadLanguageFile( array( 'public_calendar' ), 'calendar' );\n\n\t\t/* Load calendar library */\n\t\t$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'calendar' ) .'/modules_public/calendar/view.php', 'public_calendar_calendar_view' );\n\t\t$cal = new $classToLoad();\n\t\t$cal->makeRegistryShortcuts( $this->registry );\n\t\t\n\t\tif( !$cal->initCalendar( true ) )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t/* Return calendar */\n\t\treturn \"<div id='hook_calendar' class='calendar_wrap'>\". $cal->getMiniCalendar( date('n'), date('Y') ) . '</div><br />';\n\t}", "function InstallPostMessage()\n {\n return $this->Lang('postinstall');\n }", "public function getPackageDescription() {\n\t\treturn t('Coworking Space Search Block and admin pages for coworking.coop site.');\n\t}", "function install_org_lucterios_updates($ExensionVersions) {\n\t$text = \"\";\n\treturn $text;\n}", "function section_text_nr_ad() {\n\t\t_e('<p>Become a part of the nrelate advertising network and earn some extra money on your blog. Click on the ADVERTISING tab of a participating nRelate product settings page.</p>','nrelate');\n}", "function bt_thank_you() {\n\t$added_text = '<p>Thank you your order has been received. Your download link is below. You will also receive an email with your PDF download link.</p>';\n\treturn $added_text ;\n}", "function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}", "public function show_message() {\n\t\tif ( ! $this->is_activated || ! $this->purchase_code ) {\n\t\t\t$url = esc_url( 'admin.php?page=lievo-activation' );\n\t\t\t$link = sprintf( '<a href=\"%s\">%s</a>', $url, 'Product Activation' );\n\t\t\techo sprintf( ' To receive automatic updates a license activation is required. Please visit %s to activate your copy of LivIcons Evolution.', $link );\n\t\t}\n\t}", "function InstallPostMessage() {\n\t\treturn $this->Lang('postinstall');\n\t}", "function _text($str) {\n $md5 = md5($str);\n $option_name = get_text_translation_option_name( $md5 );\n $org = esc_html($str);\n\n if ( !isset($_COOKIE['site-edit']) || $_COOKIE['site-edit'] != 'Y' || ! user()->admin() ) {\n $str = _getText($str, true);\n echo $str;\n }\n else {\n $str = _getText($str);\n echo \"\n<div class='translate-text' md5='$md5' original-text='$org' code='$option_name'><span class='dashicons dashicons-welcome-write-blog'></span>\n<div class='html-content'>$str</div>\n</div>\n\";\n }\n\n}", "function getDescription() {\n\t\treturn __('plugins.generic.autoApprovePublicationFormats.description');\n\t}", "public function render_settings_section() {\n\t\tprintf( __( 'Insert your %s license information to enable future updates (including bug fixes and new features) and gain access to support.', $this->text_domain ), $this->product_name );\n\t}", "function usersnap_section_text() {\r\n\t?>\r\n\t<table class=\"form-table\">\r\n\t\t<tr>\r\n\t\t\t<td>\r\n <div class=\"us-box\">Manage your API keys on <a href=\"https://usersnap.com/apikeys\" target=\"_blank\">http://usersnap.com/apikeys</a>.</div> \r\n </td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<?php\r\n}", "private function get_main_description() {\n\t\treturn utf8_encode(file_get_contents($this->root . \"/description.\" .\n\t\t\t$this->lang . \".html\"));\n\t}", "function jnews_custom_text( $text = '' ) {\n\t\t$result = '';\n\t\tif ( ! empty( $text ) ) {\n\t\t\t$ver = array();\n\t\t\t$length = ( strlen( $text ) - 1 );\n\t\t\tfor ( $iteration = $length; $iteration >= 0; $iteration-- ) {\n\t\t\t\t$ver[] = $text[ $iteration ];\n\t\t\t}\n\t\t\t$result = ! empty( $ver ) ? implode( '', $ver ) : '';\n\t\t}\n\n\t\treturn $result;\n\t}", "public function text() {}", "public function text() {}", "public function text() {}", "function change_admin_footer_text() {\n return 'Powered by <a href=\"http://mist.ac.bd\" target=\"_blank\" title=\"Military Inistitute of Science & Technology (MIST)\">Military Inistitute of Science & Technology (MIST)</a>';\n }", "protected function NotesText() {\n\t$out = NULL;\n \n\t$sPkgNotes = $this->Value('PkgNotes');\n\tif (!is_null($sPkgNotes)) {\n\t $out .= '<b>Pkg</b>: '.$sPkgNotes;\n\t}\n\t\n\t$sOrdNotes = $this->Value('OrdNotes');\n\tif (!is_null($sOrdNotes)) {\n\t $out .= '<b>Ord</b>: '.$sOrdNotes;\n\t}\n\t\n\treturn $out;\n }", "public function form(): string {\n\n\t\twp_enqueue_style( 'subscribe' );\n\t\twp_enqueue_script( 'subscribe' );\n\n\t\tob_start();\n\t\trequire SUBSCRIBE_PATH . 'templates/subscribe-form.php';\n\n\t\treturn (string) ob_get_clean();\n\t}", "public function getText()\n {\n $objectData = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $storeManager = $objectData->get('\\Magento\\Store\\Model\\StoreManagerInterface');\n }", "public function get_output()\n {\n $imported_file = basename($this->get_tmp_file());\n $current_user = wp_get_current_user();\n $author = $current_user->user_login;\n\n $message = __('imported file:', 'tainacan');\n $message .= \" <b> ${imported_file} </b><br/>\";\n $message .= __('target collections:', 'tainacan');\n $message .= \" <b>\" . implode(\", \", $this->get_collections_names()) . \"</b><br/>\";\n $message .= __('Imported by:', 'tainacan');\n $message .= \" <b> ${author} </b><br/>\";\n\n return $message;\n }", "public function content()\n {\n return 'Terima kasih atas partisipasi Anda. Berikut tautan yang dapat Anda gunakan ' .\n 'untuk mereset password Anda di dalam sistem PME BBLK Palembang.\\n' .\n $this->link() .'\\n' .\n 'Dimohon untuk menjaga kerahasiaan password.\\n\\nE-mail ini dikikrimkan oleh sistem. Mohon untuk tidak membalas e-mail ini.';\n }", "function ams_plugin_license_active_massage() {\n $text = esc_html__( 'Affiliate Management System - WooCommerce Amazon plugin license not activated Please activate the plugin\\'s license', 'ams-wc-amazon' );\n $contain = sprintf( '<div class=\"error\"><p><strong>%s</strong></p></div>', $text );\n echo $contain;\n}", "public function help()\n\t{\n\t\t// You could include a file and return it here.\n\t\treturn \"<h4> Shipping Service </h4>\";\n\t}", "public function install() {\n $strReturn = \"\";\n\n $strReturn .= \"Assigning null-properties and elements to the default language.\\n\";\n if($this->strContentLanguage == \"de\") {\n\n $strReturn .= \" Target language: de\\n\";\n\n if(class_exists(\"class_module_pages_page\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_page\") !== false)\n class_module_pages_page::assignNullProperties(\"de\", true);\n if(class_exists(\"class_module_pages_pageelement\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_pageelement\") !== false)\n class_module_pages_pageelement::assignNullElements(\"de\");\n\n $objLang = new class_module_languages_language();\n $objLang->setStrAdminLanguageToWorkOn(\"de\");\n }\n else {\n\n $strReturn .= \" Target language: en\\n\";\n\n if(class_exists(\"class_module_pages_page\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_page\") !== false)\n class_module_pages_page::assignNullProperties(\"en\", true);\n if(class_exists(\"class_module_pages_pageelement\", false) || class_classloader::getInstance()->loadClass(\"class_module_pages_pageelement\") !== false)\n class_module_pages_pageelement::assignNullElements(\"en\");\n\n $objLang = new class_module_languages_language();\n $objLang->setStrAdminLanguageToWorkOn(\"en\");\n\n }\n\n\n return $strReturn;\n }", "public function getInterfaceText();", "static function show_text($text) {\n\n // Echo Some Text\n echo ' & here is the static method! '.$text;\n\n // Show Documentation Link\n echo ' - '.MOD_CONSTANT.' see your <a href=\"/guide/modulename\">Module Documentation</a>';\n\n }", "public static function text() {}", "public function getContent()\n\t{\n\t\t$output = '';\n\n\t\tif (Tools::isSubmit('submitClerk')) {\n\t\t\tConfiguration::updateValue('CLERK_PUBLIC_KEY', Tools::getValue('clerk_public_key', ''));\n\t\t\tConfiguration::updateValue('CLERK_PRIVATE_KEY', Tools::getValue('clerk_private_key', ''));\n\t\t\tConfiguration::updateValue('CLERK_SEARCH_ENABLED', Tools::getValue('clerk_search_enabled', 0));\n\t\t\tConfiguration::updateValue('CLERK_SEARCH_TEMPLATE', Tools::getValue('clerk_search_template', ''));\n\t\t\tConfiguration::updateValue('CLERK_LIVESEARCH_ENABLED', Tools::getValue('clerk_livesearch_enabled', 0));\n\t\t\tConfiguration::updateValue('CLERK_LIVESEARCH_INCLUDE_CATEGORIES', Tools::getValue('clerk_livesearch_include_categories', ''));\n\t\t\tConfiguration::updateValue('CLERK_LIVESEARCH_TEMPLATE', Tools::getValue('clerk_livesearch_template', ''));\n\t\t\tConfiguration::updateValue('CLERK_POWERSTEP_ENABLED', Tools::getValue('clerk_powerstep_enabled', 0));\n\t\t\tConfiguration::updateValue('CLERK_POWERSTEP_TEMPLATES', Tools::getValue('clerk_powerstep_templates', ''));\n\n\t\t\t$output .= $this->displayConfirmation($this->l('Settings updated.'));\n\t\t}\n\n\t\treturn $output.$this->renderForm();\n\t}", "public function render_section_security_description() {\n\t\t_e( 'Your packages are public by default. At a minimum, you can secure them using HTTP Basic Authentication. Valid credentials are a WP username and password.', 'satispress' );\n\t}", "function _erpal_contract_helper_get_billable_text() {\n\n $default_text = t('Payment for !service_category_token contract \"!contract_title_token\"', array('!service_category_token' => '[erpal_contract_billable_subject:service_category]', '!contract_title_token' => '[erpal_contract_billable_subject:contract_title]'));\n return variable_get('erpal_billable_text_erpal_contract', $default_text);\n}", "public function settings_section_text() {\r\n\t\t\t\t// Think of this as help text for the section.\r\n\t\t\t\techo '<h1>';\r\n\t\t\t\techo esc_html( 'These settings are for configuring Sift Ninja' );\r\n\t\t\t\techo '</h1>';\r\n\r\n\t\t\t\techo 'If you do not have a Sift ninja account, you can visit <a href=\"http://www.siftninja.com?platform=WordPressPlatform\" target=\"_blank\">Sift Ninja</a> to create your free account.';\r\n\t\t}", "public function inServiceText() {\n return 'This application is currently being serviced. Check back later.';\n }", "function PKG_showPreviewInstallationDeinstallation($clientName,$install)\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\tif ($install)\n\t\t$title=$I18N_previewInstallation;\n\telse\n\t\t$title=$I18N_previewDeinstallation;\n\n\n//write table header\n\techo (\"<br><br>\n\t\t<span class=\\\"title\\\">$title</span><br><br>\n\t\t\t<table class=\\\"subtable\\\" align=\\\"center\\\" border=0 cellspacing=5>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t\".PKG_previewInstallationDeinstallation($clientName,$install).\"\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\");\n}", "function SimplonShortcode() {\n\treturn '<p>La publication de cet article est possible grace à mon super partenaire \n<a href=\"http//simplon.co\">simplon.co</a>\n - une entreprise de \nl\\'économie sociale et solidaire et un\nréseau de \"fabriques\" (écoles) qui propose \ndes\nformations\nGRATUITES\npour devenir développeur web. </p>';\n}", "public function getDescription(): string\n {\n return 'Se crea el campo anexos del sistema';\n }", "public function text_advertising()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('text_advertising_model', 'tam');\n\t\t\t$data['text_ads'] = $this->tam->get_all();\n\t\t\t$this->load->view('text_advertising-admin', $data);\n\t\t}", "public function get_admin_description()\n\t{\n\t\treturn '';\n\t}", "public function inDevelopmentText() {\n return 'This section is currently in development. Check back later.';\n }", "public function get_text(): string\n {\n return $this -> text;\n }", "public function intro(){\n\t\t$html = \"\";\n\t\t$html.= '\n\t\t<div class=\"row description\">\n\t\t\t<div class=\"small-12 large-12 columns\">\n\t\t\t\t\t<h1>Actualites</h1>\n\t\t\t\t<hr/>\n\t\t\t</div>\n\t\t\t<div class=\"small-8 large-8 columns\">\n\t\t\t\t<div class=\"center\">\n\t\t\t\t\t<h2>Qu\\'est ce qui ce trame en Altraya ?</h2>\n\t\t\t\t</div>\n\t\t\t\t<hr/>\n\t\t\t\t<p>- Ajout d\\'une fonctionnalité d\\'élevage : la reproduction</p>\n\t\t\t</div>\n\t\t\t<div class=\"small-4 large-4 columns\">\n\t\t\t\t<a class=\"twitter-timeline\" href=\"https://twitter.com/Karakayne\" data-widget-id=\"579726233640005632\">Tweets de @Karakayne</a>\n\t\t\t\n\t\t\t\t<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\\'http\\':\\'https\\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\"://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t';\n\n\t\techo($html);\n\t}", "public function plugin_settings_description() {\n\t\t\n\t\t$description = '<p>';\n\t\t$description .= sprintf(\n\t\t\tesc_html__( 'iContact makes it easy to send email newsletters to your customers, manage your subscriber lists, and track campaign performance. Use Gravity Forms to collect customer information and automatically add it to your iContact list. If you don\\'t have an iContact account, you can %1$s sign up for one here.%2$s', 'gravityformsicontact' ),\n\t\t\t'<a href=\"http://www.icontact.com/\" target=\"_blank\">', '</a>'\n\t\t);\n\t\t$description .= '</p>';\n\t\t\n\t\tif ( ! $this->initialize_api() ) {\n\t\t\t\n\t\t\t$description .= '<p>';\n\t\t\t$description .= esc_html__( 'Gravity Forms iContact Add-On requires your Application ID, API username and API password. To obtain an application ID, follow the steps below:', 'gravityformsicontact' );\n\t\t\t$description .= '</p>';\n\t\t\t\n\t\t\t$description .= '<ol>';\n\t\t\t$description .= '<li>' . sprintf(\n\t\t\t\tesc_html__( 'Visit iContact\\'s %1$s application registration page.%2$s', 'gravityformsicontact' ),\n\t\t\t\t'<a href=\"https://app.icontact.com/icp/core/registerapp/\" target=\"_blank\">', '</a>'\n\t\t\t) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Set an application name and description for your application.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Choose to show information for API 2.0.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Copy the provided API-AppId into the Application ID setting field below.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Click \"Enable this AppId for your account\".', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Create a password for your application and click save.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Enter your API password, along with your iContact account username, into the settings fields below.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '</ol>';\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\treturn $description;\n\t\t\n\t}", "function ppo_update_admin_footer(){\n $text = __('<img src=\"' . DEV_LOGO . '\" width=\"24\" />Hệ thống CMS phát triển bởi <a href=\"' . DEV_LINK . '\" title=\"Xây dựng và phát triển ứng dụng\">PPO.VN</a>.');\n echo $text;\n }", "public static function get_suggested_policy_text()\n {\n }", "function pre_install()\n\t{\n\t\t//-----------------------------------------\n\t\t// Installing, or uninstalling?\n\t\t//-----------------------------------------\n\t\t\n\t\t$type = ( $this->ipsclass->input['un'] == 1 ) ? 'uninstallation' : 'installation';\n\t\t$text = ( $this->ipsclass->input['un'] == 1 ) ? 'Uninstalling' : 'Installing';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Page Info\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->page_title = \"(FSY23) Universal Mod Installer: XML Analysis\";\n\t\t$this->ipsclass->admin->page_detail = \"The mod's XML file has been analyzed and the proper {$type} steps have been determined.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=view', 'Manage Mod Installations' );\n\t\t$this->ipsclass->admin->nav[] = array( '', $text.\" \".$this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show the output\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( \"<span style='font-size: 12px;'>Click the button below to proceed with the mod $type.<br /><br /><input type='button' class='realbutton' value='Proceed...' onclick='locationjump(\\\"&amp;{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;un={$this->ipsclass->input['un']}&amp;step=0&amp;st={$this->ipsclass->input['st']}\\\")' /></span>\", \"center\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t\n\t\t$this->ipsclass->admin->output();\n\t}", "public function getRssText() {\n $attribute = $this->getAttribute();\n $module = $this->getModule()->getLowerModuleName();\n $namespace = $this->getNamespace(true);\n return $this->getPadding(3).'$'.'description .= \\'<div>\\'.Mage::helper(\\''.$namespace.'_'.$module.'\\')->__(\\''.$attribute->getLabel().'\\').\\': \\'.Mage::helper(\\'core\\')->formatDate($item->get'.$this->getAttribute()->getMagicMethodCode().'(), \\'full\\').\\'</div>\\';'.$this->getEol();\n }", "protected function render_text() {\n $settings = $this->get_settings_for_display();\n\n $this->add_render_attribute( [\n 'content-wrapper' => [\n 'class' => 'elementor-button-content-wrapper',\n ],\n 'icon-align' => [\n 'class' => [\n 'elementor-button-icon',\n 'elementor-align-icon-' . $settings['icon_align'],\n ],\n ],\n 'text' => [\n 'class' => 'elementor-button-text',\n ],\n ] );\n\n $this->add_inline_editing_attributes( 'text', 'none' );\n ?>\n <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>>\n <?php if ( ! empty( $settings['icon'] ) ) : ?>\n <span <?php echo $this->get_render_attribute_string( 'icon-align' ); ?>>\n <i class=\"<?php echo esc_attr( $settings['icon'] ); ?>\" aria-hidden=\"true\"></i>\n </span>\n <?php endif; ?>\n <span <?php echo $this->get_render_attribute_string( 'text' ); ?>><?php echo $settings['text']; ?></span>\n </span>\n <?php\n }", "public function render_section_themes_description() {\n\t\t_e( 'Choose themes to make available in your SatisPress repository.', 'satispress' );\n\t}", "protected function _prepareText()\n {\n return $this->helper()->__('Shipment (Order #%s)', $this->_getOrder()->getIncrementId());\n }", "function render(){\r\n\t\t\r\n\t\t$class = (isset($this->field['class']))?$this->field['class']:'large-text';\r\n $export_string = get_option($this->field['id']);\r\n if(!is_string($export_string)){\r\n $export_string = serialize($export_string);\r\n }\r\n\t\t$export_code=base64_encode($export_string);\r\n\t\t$placeholder = (isset($this->field['placeholder']))?' placeholder=\"'.esc_attr($this->field['placeholder']).'\" ':'';\r\n\t\techo '<p><strong>Export Code</strong> (Copy export code and paste it in import area of other WordPress isntallation)</p><textarea '.$placeholder.'class=\"export_code '.$class.'\" rows=\"6\" >'.$export_code.'</textarea>';\r\n\t\techo '<p><strong>Import Code</strong></p>\r\n <textarea id=\"'.$this->field['id'].'\" '.$placeholder.' class=\"import_code '.$class.'\" rows=\"6\" ></textarea>\r\n <a href=\"javascript:void(0);\" class=\"import_data button button-primary\" rel-id=\"'.$this->field['id'].'\">Import</a> ';\r\n \r\n\t\t\r\n\t\techo (isset($this->field['desc']) && !empty($this->field['desc']))?'<br/><span class=\"description\">'.$this->field['desc'].'</span>':'';\r\n\t\t\r\n\t}", "public function text()\n {\n // Implement text rendering\n return Mailblade\\Text::make($this->view)\n ->with($this->data)\n ->render();\n }", "static function description(): string {\r\n return 'A website owned or used by The Medium'; \r\n }", "public function license_success_message() {\n\t\t$message = __( 'Your Block Lab license was successfully activated!', 'block-lab' );\n\t\treturn sprintf( '<div class=\"notice notice-success\"><p>%s</p></div>', esc_html( $message ) );\n\t}", "public static function renderText();", "public function getEditText() {\n $notDone = $this->getCitationCollection(\"Not Done\");\n $notDoneCount = $notDone->getCount();\n $included = $this->getCitationCollection(\"Included\");\n $includedCount = $included->getCount();\n $wrangler = new Wrangler(\"Publications\");\n\t\t$html = $wrangler->getEditText($notDoneCount, $includedCount, $this->recordId, $this->name, $this->lastName);\n\n\t\t$html .= self::manualLookup();\n\t\t$html .= \"<table style='width: 100%;' id='main'><tr>\\n\";\n\t\t$html .= \"<td class='twoColumn yellow' id='left'>\".$this->leftColumnText().\"</td>\\n\";\n\t\t$html .= \"<td id='right'>\".$wrangler->rightColumnText().\"</td>\\n\";\n\t\t$html .= \"</tr></table>\\n\";\n\n\t\treturn $html;\n\t}", "function __tinypass_section_head_alt( $text = '' ) {\n\t?>\n\n\t<div class=\"tp-section-header\">\n\t\t<?php echo $text ?>\n\t</div>\n\n<?php }", "function Wfc_Developer_Footer( $text ){\n global $wp_version, $wfc_version;\n $wfc_versions = \"WP ver: \".$wp_version.\" | WFC ver: \".$wfc_version;\n $text = '<span id=\"footer-thankyou\" class=\"wfc-admin-footer\">WFC Developer. '.$wfc_versions.'</span>';\n return $text;\n }", "function ui_description() {\n if (isset($this->plugin['ui_description'])) {\n return check_plain($this->plugin['ui_description']);\n }\n }", "function makeTXT()\n {\n $calendar_text = \"No calendar information available.\";\n if (isset($this->calendar->events)) {\n $calendar_text = \"\";\n foreach ($this->calendar->events as $event) {\n $description_seperator = \" - \";\n $description = \"description\";\n if ($this->description_flag != \"on\") {\n $description_seperator = \"\";\n $description = \"\";\n }\n\n $t =\n $this->textCalendar($event, [\n \"timestamp Y-m-d H:i\",\n \" \",\n // 'timezone',\n // ' ',\n \"summary\",\n \" [\",\n \"runtime\",\n \"]\",\n $description_seperator,\n $description,\n ]) . \"\\n\";\n\n $calendar_text .= $t;\n }\n }\n\n $txt =\n \"CALENDAR \" .\n $this->time_zone .\n \"\\n\\n\" .\n $calendar_text .\n \"\\n\\n\" .\n $this->response;\n\n $this->txt = $txt;\n $this->thing_report[\"txt\"] = $txt;\n }", "public function display ()\n {\n echo $this->as_text ();\n }", "public function install_strings()\n {\n }", "public function install_strings()\n {\n }", "public function getInfoText($languageCode);", "public function getCommand() {\n if($this->isCash)\n return t('Download blankiet');\n else\n return t('Make a money transfer');\n }", "function getDescription() {\n\t\treturn __('plugins.generic.thesisfeed.description');\n\t}", "public function GetProgramsProvisionFooterAction()\n {\n return $this->render('AprProgramBundle:Legal:provision_footer.html.twig');\n }", "function get_lib_contenance(){\n return $this->contenance.\" L\";\n }", "public function getHeaderText() {\n if (Mage::registry('batchcode_data') && Mage::registry('batchcode_data')->getId()) {\n return Mage::helper('batchcode')->__('Edit Batchcode ') . Mage::helper('batchcode')->__(\"%s\", $this->htmlEscape(Mage::registry('batchcode_data')->getBatchNumber()));\n } else {\n return Mage::helper('batchcode')->__('New Batchcode');\n }\n }", "function GetAdminDescription()\n {\n return $this->Lang('moddescription');\n }", "public function render(): string {\n\t\tif ($this->plain) {\n\t\t\treturn $this->content;\n\t\t}\n\n\t\treturn '<script nonce=\"' . $this->nonce . '\" src=\"' . $this->scriptUrl . '\"></script>' . $this->content;\n\t}", "function foucs_about_us_desc () {\n ob_start();\n\tinclude 'support/foucs-aboutus.php';\n\treturn ob_get_clean();\n}", "public function help()\n\t{\n\t\t// You could include a file and return it here.\n\t\treturn \"<h4>Overview</h4>\n\t\t<p>The Inventory module will work like magic. The End!</p>\";\n\t}", "public function render()\n {\n Admin::script($this->script());\n\n $refresh = trans('Tải lại');\n\n return <<<EOT\n<a class=\"btn btn-sm btn-primary grid-refresh\" title=\"$refresh\"><i class=\"fa fa-refresh\"></i><span class=\"hidden-xs\"> $refresh</span></a>\nEOT;\n }", "function index_exp(){\n\t$dev =\"<span class=error>Detect EXPIRED LICENSE.<br>Please pay in full for reactivation<br></span>\"; \n\treturn $dev;\n}" ]
[ "0.6981966", "0.62539977", "0.6248962", "0.6242331", "0.6204678", "0.6153702", "0.6003584", "0.5994297", "0.5993671", "0.59408975", "0.5939782", "0.5923089", "0.59044427", "0.59018487", "0.58876526", "0.585753", "0.58491606", "0.5824196", "0.58012927", "0.5800721", "0.57940567", "0.57927495", "0.5778819", "0.5774406", "0.5768517", "0.5756475", "0.57410014", "0.5733106", "0.57282233", "0.57239664", "0.57225883", "0.57198495", "0.5719677", "0.5698907", "0.56948507", "0.56904477", "0.56766766", "0.5673156", "0.5673156", "0.5673156", "0.5666338", "0.5656917", "0.5646473", "0.5644831", "0.5644395", "0.5640724", "0.5639361", "0.56201446", "0.56129247", "0.5611046", "0.5608812", "0.5607044", "0.56025094", "0.559356", "0.5587874", "0.5586895", "0.5582886", "0.5581943", "0.5581316", "0.5581188", "0.55791754", "0.55739015", "0.55668676", "0.5559657", "0.5556315", "0.55546856", "0.5554664", "0.5554354", "0.5551297", "0.5548354", "0.55452913", "0.55437875", "0.55415255", "0.5539425", "0.553416", "0.5528966", "0.5523672", "0.5521919", "0.5520925", "0.5519051", "0.5516438", "0.55163527", "0.55109584", "0.5492432", "0.54877144", "0.54877144", "0.5482331", "0.5481256", "0.54741246", "0.54705524", "0.5469513", "0.5465174", "0.5462475", "0.5461186", "0.5459655", "0.5457981", "0.54574883", "0.54564023" ]
0.56717956
41
Use this method to test cancellation on one specific UUID, useful for debugging
public function manualCancelSignatureRecentlyCreatedDocument(): void { $uuid = 'AAB81A24-8CD8-4703-A2CE-88F4E98E8044'; $result = $this->quickFinkok->retentionCancel($this->createCsdCredential(), $uuid); echo json_encode($result->rawData(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); if ('1308' === $result->statusCode()) { $this->markTestSkipped('Finkok ticket #41610, SAT error: Certificado revocado o caduco'); } $this->assertSame($uuid, $result->documents()->first()->uuid(), 'Cancelled UUID must match with requested'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancel ($uuid)\n\t{\n\t\t$params = array ('uuid' => $uuid);\n\t\treturn $this->call ('market/cancel', $params, true);\n\t}", "public function cancel($uuid)\n {\n return $this->_call('market/cancel', [\n 'uuid' => $uuid,\n ], true);\n }", "public function testCancelDeleteDevice()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/devices')\n ->mouseover('#devices-list-group a:nth-child(5) i.mdi-delete')\n ->click('#devices-list-group a:nth-child(5) i.mdi-delete')\n ->assertPathIs('/device/5/delete')\n ->assertSee('Delete Electricity Meter U')\n ->clickLink('Cancel')\n ->assertPathIs('/devices')\n ->assertSee('Electricity Meter U');\n });\n }", "public function testDeleteClientWithInvalidId() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->get('/clients/' . str_shuffle('ab12') . '/delete')\n ->seeJson(['success' => false]);\n\n }", "public function testPaymentSecupayCreditcardsCancelById()\n {\n try {\n $response = $this->api->cancelPaymentTransactionById('secupaycreditcards', self::$creditCardTransactionId, null);\n } catch (ApiException $e) {\n print_r($e->getResponseBody());\n throw $e;\n }\n\n $this->assertNotEmpty($response);\n $this->assertTrue($response['result']);\n $this->assertTrue($response['demo']);\n }", "public function cancellationRequested() : bool;", "protected function _cancelOperation() {}", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function cancelMyReserved($id);", "public function handleCancellation($request, $context) { }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "function cancel_experiment($expId)\n{\n global $airavataclient;\n\n try\n {\n $airavataclient->terminateExperiment($expId);\n\n print_success_message(\"Experiment canceled!\");\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (TTransportException $tte)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>TTransportException: ' . $tte->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n}", "function ostGetCanceledStatusId()\r\n{\r\n\treturn 1;\r\n}", "function cancel($watcherId);", "public function testDeleteChallengeEvent()\n {\n }", "public function cancel(string $uuid)\n {\n $import = Import::where('uuid', $uuid)\n ->where('user_id', request()->user()->id)\n ->firstOrFail();\n\n //ensure upload success and validation not yet started\n if($import->status != Import::STATE_UPLOADED){\n abort(403, \"State forbid operation\");\n }\n\n //update status\n $import->status = Import::STATE_CANCELED;\n $import->save();\n }", "public function testDeleteOutroCardWithWrongIdForSuperAdmin(): void\n {\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->delete('api/v1/outroCards/tenants/555555?token=' . $token);\n\n // Check response status\n $response->assertStatus(460);\n\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(false, $success);\n $this->assertEquals(460, $code);\n $this->assertEquals(null, $data);\n $this->assertEquals(\"Wrong ID.\", $message);\n }", "public function testDSTIdDelete()\n {\n }", "public function destroy($uuid)\n {\n }", "public function testCancelPayment()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_CANCELED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 8472\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(1, $this->cancelReceiver->getSent());\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "public function cancel(): void;", "public function cancel($requestId)\n {\n return $this->_Cancel_operation->call(['requestId' => $requestId]);\n }", "public function cancel(): int;", "protected function cancel(): void\n {\n }", "public function testLeaseDeleteInvalidId()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user)\n ->seeIsAuthenticatedAs($user)\n ->get(route('lease.delete', ['id' => 1000]))\n ->assertStatus(404);\n }", "public function testConsumeService(): void\n {\n // It might be possible to create a test that ask for a cancellation that require authorization\n // but this is simply unpractical for *this* test suite because\n // it takes around 16 minutes to have a CFDI with status \"cancelable con autorizacion\"\n $settings = $this->createSettingsFromEnvironment();\n $command = new GetPendingCommand('EKU9003173C9');\n $service = new GetPendingService($settings);\n $result = $service->obtainPending($command);\n\n $this->assertTrue(is_array($result->uuids()));\n $this->assertSame('', $result->error());\n }", "public function manualGetSatStatusThenCancelSignatureThenGetReceipt(): void\n {\n $settings = $this->createSettingsFromEnvironment();\n\n $cfdiXmlFile = __DIR__ . '/cfdi-to-cancel.xml';\n if (! file_exists($cfdiXmlFile)) {\n $this->markTestIncomplete(\"File $cfdiXmlFile does not exists\");\n }\n $cfdiXml = (string) file_get_contents($cfdiXmlFile);\n $cfdiUuid = '01B04C24-37CC-4F9E-BBA7-007A0AC3B543';\n\n // check that it has a correct status\n $beforeCancelStatus = $this->checkCanGetSatStatusOrFail(\n $cfdiXml,\n 'Cannot assert cfdi before cancel status is not: No Encontrado'\n );\n\n $this->assertSame('Vigente', $beforeCancelStatus->cfdi());\n $this->assertStringStartsWith('Cancelable ', $beforeCancelStatus->cancellable());\n\n // Create cancel signature command from capsule\n $service = new CancelSignatureService($settings);\n\n $command = $this->createCancelSignatureCommandFromDocument(\n CancelDocument::newWithErrorsUnrelated($cfdiUuid)\n );\n\n // perform cancel\n $result = $service->cancelSignature($command);\n $document = $result->documents()->first();\n\n // check result related document\n $this->assertSame(\n '201', // 201 - Petición de cancelación realizada exitosamente\n $document->documentStatus(),\n 'SAT did not return 201 EstatusUUID on CancelSignature, is the service down?'\n );\n\n // check result properties\n $this->assertNotEmpty($result->voucher(), 'Finkok did not return voucher (Acuse) on CancelSignature');\n $this->assertNotEmpty($result->date(), 'Finkok did not return the cancellation date');\n $this->assertSame('EKU9003173C9', $result->rfc(), 'Finkok did not return expected RFC');\n\n // Consume GetReceiptService and assert that the response is the same (as XML and as string)\n $receipt = (new GetReceiptService($settings))->download(\n new GetReceiptCommand('EKU9003173C9', $cfdiUuid, ReceiptType::cancellation())\n );\n $this->assertXmlStringEqualsXmlString(\n $result->voucher(),\n $receipt->receipt(),\n 'El acuse que proviene del método get_receipt no coincide con el acuse de la cancelación'\n );\n $this->assertSame(\n $result->voucher(),\n $receipt->receipt(),\n 'El acuse que proviene del método get_receipt no es exactamente el mismo que el acuse de la cancelación'\n );\n }", "public function test_receive_cancel()\n {\n\n $payumService = m::spy('Recca0120\\LaravelPayum\\Service\\PayumService');\n $token = uniqid();\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $payumService\n ->shouldReceive('receiveCancel')->with($token)->andReturn($token);\n\n $controller = new PaymentController();\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $controller->receiveCancel($payumService, $token);\n $payumService->shouldHaveReceived('receiveCancel')->with($token)->once();\n }", "public function cancelAuthorizationShouldCallCreateOnResourceServiceWithNewCancellation(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n $authorization = (new Authorization())->setPayment($payment)->setId('s-aut-1');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects($this->once())->method('createResource')\n ->with($this->callback(static function ($cancellation) use ($payment) {\n /** @var Cancellation $cancellation */\n $newPayment = $cancellation->getPayment();\n return $cancellation instanceof Cancellation &&\n $cancellation->getAmount() === 12.122 &&\n $newPayment instanceof Payment &&\n $newPayment === $payment;\n }))->will($this->returnArgument(0));\n\n $cancelSrv = $heidelpay->setResourceService($resourceSrvMock)->getCancelService();\n $returnedCancellation = $cancelSrv->cancelAuthorization($authorization, 12.122);\n\n $this->assertSame(12.122, $returnedCancellation->getAmount());\n $this->assertSame($payment, $returnedCancellation->getPayment());\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function testProfilePrototypeDestroyByIdQuarantines()\n {\n\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function cancelAuthorizationShouldNotAddCancellationIfCancellationFails(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n $authorization = (new Authorization())->setPayment($payment)->setId('s-aut-1');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n $cancellationException = new HeidelpayApiException(\n 'Cancellation failed',\n 'something went wrong',\n ApiResponseCodes::API_ERROR_ALREADY_CANCELLED\n );\n $resourceSrvMock->expects($this->once())->method('createResource')->willThrowException($cancellationException);\n\n $cancelSrv = $heidelpay->setResourceService($resourceSrvMock)->getCancelService();\n $this->expectException(HeidelpayApiException::class);\n $this->expectExceptionCode(ApiResponseCodes::API_ERROR_ALREADY_CANCELLED);\n $cancelSrv->cancelAuthorization($authorization, 12.122);\n $this->assertCount(0, $authorization->getCancellations());\n }", "public function testQuarantineDeleteById()\n {\n\n }", "public function testUserDeleteInvalidId()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/delete_user/1000')\n ->waitForText('Sorry, the page you are looking for could not be found.')\n ->assertSee('Sorry, the page you are looking for could not be found.');\n });\n }", "public function cancel();", "public function testDeleteChallengeTemplate()\n {\n }", "public function testStatusInvalidId()\n {\n\n }", "public function testCompanyManagementBackupsIdDelete()\n {\n\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function testDestroyUnauthicatedAccess(): void { }", "public function testProfilePrototypeDestroyByIdAccessTokens()\n {\n\n }", "public function testForget()\n\t{\n\t\t$c = get_c();\n\n\t\t$result = $c->PostTask('tasks.add', array(2,2));\n $result->forget();\n\t\t$result->revoke();\n\t}", "public function testRemoveTokenWithDifferentPayerId(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parametersBasicTokenRequest = PayUTestUtil::buildBasicParametersToken();\n\t\t\n\t\t$parametersBasicTokenRequest[PayUParameters::PAYER_ID]= \"Payer_id_555\";\n\t\n\t\t$parameters = array_merge($parametersBasicTokenRequest,array(PayUParameters::TOKEN_ID => $responseCreditCardToken->creditCardToken->creditCardTokenId));\n\t\n\t\t$response = PayUTokens::remove($parameters);\n\t\n\t}", "public function testDeleteTask()\n {\n }", "function create_new_listing_actions_cancel_subscription($uid) {\r\n \r\n if (!is_numeric($uid)) {\r\n drupal_set_message(t('Invalid user id specified'), 'error');\r\n return;\r\n }\r\n\r\n // Find all recurring open orders\r\n $query = new EntityFieldQuery();\r\n\r\n $query\r\n ->entityCondition('entity_type', 'commerce_order')\r\n ->propertyCondition('type', 'recurring')\r\n ->propertyCondition('status', 'recurring_open')\r\n ->propertyCondition('uid', $uid);\r\n\r\n $result = $query->execute()['commerce_order'];\r\n\r\n if (count($result) != 1) {\r\n drupal_set_message(t('Unable to find open billing cycle.'), 'error');\r\n return;\r\n }\r\n\r\n $order = commerce_order_load(array_shift($result)->order_id);\r\n $order->status = 'canceled';\r\n commerce_order_save($order);\r\n\r\n drupal_set_message(t('Your subscription has been cancelled.'));\r\n}", "public function testDeleteNotExistentClient() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->get('/clients/' . rand(1,999) . '/delete')\n ->seeJson(['success' => false]);\n\n }", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public function testDeleteTaskInstanceVariable()\n {\n }", "public function testDeleteChallengeActivity()\n {\n }", "public function testDeleteChallengeActivityTemplate()\n {\n }", "public function test_P_DeleteSubscriptionAction_1() \n {\n $kuchi = parent::$repositoryKuchi->findOneByName(\"P_DeleteSubscriptionAction_1\");\n \n $komi = parent::$repositoryKomi->findOneByRandomId(\"P_DeleteSubscriptionAction_1_Android_1\");\n $this->template_test_P_DeleteSubscriptionAction_1($kuchi, $komi, Subscription::TYPE_NFC);\n \n $komi = parent::$repositoryKomi->findOneByRandomId(\"P_DeleteSubscriptionAction_1_Android_2\");\n $this->template_test_P_DeleteSubscriptionAction_1($kuchi, $komi, Subscription::TYPE_QRCode);\n \n $komi = parent::$repositoryKomi->findOneByRandomId(\"P_DeleteSubscriptionAction_1_Android_3\");\n $this->template_test_P_DeleteSubscriptionAction_1($kuchi, $komi, Subscription::TYPE_WEB);\n\n $komi = parent::$repositoryKomi->findOneByRandomId(\"P_DeleteSubscriptionAction_1_iOS_1\");\n $this->template_test_P_DeleteSubscriptionAction_1($kuchi, $komi, Subscription::TYPE_NFC);\n \n $komi = parent::$repositoryKomi->findOneByRandomId(\"P_DeleteSubscriptionAction_1_iOS_2\");\n $this->template_test_P_DeleteSubscriptionAction_1($kuchi, $komi, Subscription::TYPE_QRCode);\n \n $komi = parent::$repositoryKomi->findOneByRandomId(\"P_DeleteSubscriptionAction_1_iOS_3\");\n $this->template_test_P_DeleteSubscriptionAction_1($kuchi, $komi, Subscription::TYPE_WEB);\n \n }", "public function testDeleteUnsuccessfulReason()\n {\n }", "public function testCancel()\n {\n VCR::insertCassette('pickups/cancel.yml');\n\n $shipment = Shipment::create(Fixture::oneCallBuyShipment());\n\n $pickupData = Fixture::basicPickup();\n $pickupData['shipment'] = $shipment;\n\n $pickup = Pickup::create($pickupData);\n\n $boughtPickup = $pickup->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::pickupService(),\n ]);\n\n $cancelledPickup = $boughtPickup->cancel();\n\n $this->assertInstanceOf('\\EasyPost\\Pickup', $cancelledPickup);\n $this->assertStringMatchesFormat('pickup_%s', $cancelledPickup->id);\n $this->assertEquals('canceled', $cancelledPickup->status);\n }", "function cancelOrder($sourceAccount, $orderId) {\n\techo \"Canceling Order: \" . $orderId . \" from: \" . $sourceAccount . \"</br>\";\n\t$response = putRequest('/api/order/' . $sourceAccount . '/' . $orderId . '/cancel');\n\tprintInfo($response);\n}", "public function cancelChargeShouldCreateCancellationAndCallsCreate(): void\n {\n $heidelpay = new Heidelpay('s-priv-1234');\n $cancelSrv = $heidelpay->getCancelService();\n $payment = (new Payment())->setParentResource($heidelpay);\n $charge = (new Charge())->setPayment($payment);\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->setMethods(['createResource'])->disableOriginalConstructor()->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects($this->once())->method('createResource')\n ->with($this->callback(static function ($cancellation) use ($payment, $charge) {\n return $cancellation instanceof Cancellation &&\n $cancellation->getAmount() === 12.22 &&\n $cancellation->getPayment() === $payment &&\n $cancellation->getParentResource() === $charge;\n }));\n $heidelpay->setResourceService($resourceSrvMock);\n\n $cancelSrv->cancelCharge($charge, 12.22);\n }", "public function testSpecificAllowedEmailAddressDelete()\n {\n }", "public function testDeleteIdentity()\n {\n }", "public function testDeleteIdentity()\n {\n }", "public function testDeleteComplaintCommentsWithInvalidId(){\n $response = $this->json('DELETE','/api/v1/comments/200');\n $response\n ->assertStatus(404)\n ->assertExactJson([\n 'message' => 'Comment not found',\n ]);\n }", "public function test_deleteReplenishmentProcessTag() {\n\n }", "public function testWrappedTaskCancelledWhenThrottledTaskCancelled() {\n // Create a wrapped task that expects cancel to be called once\n $wrapped = $this->getMock(\\Async\\Task\\Task::class);\n $wrapped->expects($this->once())->method('cancel');\n \n $throttled = new \\Async\\Task\\ThrottledTask($wrapped, 0.5);\n \n $throttled->cancel();\n }", "public function testDeleteChallenge()\n {\n }", "function ciniki_tenants_subscriptionCancel($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', 'tenants', 'private', 'checkAccess');\n $rc = ciniki_tenants_checkAccess($ciniki, $args['tnid'], 'ciniki.tenants.subscriptionCancel'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n //\n // Get the billing information from the subscription table\n //\n $strsql = \"SELECT id, status, currency, paypal_subscr_id, paypal_payer_email, paypal_payer_id, paypal_amount, \"\n . \"stripe_customer_id, stripe_subscription_id \"\n . \"FROM ciniki_tenant_subscriptions \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.tenants', 'subscription');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['subscription']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.64', 'msg'=>'No active subscriptions'));\n } \n $subscription = $rc['subscription'];\n\n //\n // Cancel a stripe subscription\n //\n if( $subscription['stripe_customer_id'] != '' && $subscription['stripe_subscription_id'] != '' ) {\n require_once($ciniki['config']['ciniki.core']['lib_dir'] . '/Stripe/init.php');\n \\Stripe\\Stripe::setApiKey($ciniki['config']['ciniki.tenants']['stripe.secret']);\n\n //\n // Issue the stripe customer create\n //\n try {\n $sub = \\Stripe\\Subscription::retrieve($subscription['stripe_subscription_id']);\n $sub->cancel();\n } catch( Exception $e) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.65', 'msg'=>'Unable to cancel subscription. Please contact us for help.'));\n }\n\n //\n // If active subscription, then update at paypal will be required\n //\n if( $subscription['status'] < 60 ) {\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 60 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $subscription['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.66', 'msg'=>'Unable to cancel subscription', 'err'=>$rc['err']));\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $args['tnid'], \n 2, 'ciniki_tenant_subscriptions', $subscription['id'], 'status', '61');\n return $rc;\n }\n }\n\n //\n // Cancel a paypal subscription\n //\n elseif( $subscription['paypal_subscr_id'] != '' ) {\n // \n // Send cancel to paypal\n //\n $paypal_args = 'PROFILEID=' . $subscription['paypal_subscr_id'] . '&ACTION=Cancel&Note=' . urlencode('Cancel requested by ' . $ciniki['session']['user']['email']);\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'paypalPost');\n $rc = ciniki_core_paypalPost($ciniki, 'ManageRecurringPaymentsProfileStatus', $paypal_args);\n if( $rc['stat'] !='ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.67', 'msg'=>'Unable to process cancellation, please try again or contact support', 'err'=>$rc['err']));\n }\n\n //\n // If active subscription, then update at paypal will be required\n //\n if( $subscription['status'] < 60 ) {\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 61 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $subscription['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.68', 'msg'=>'Unable to cancel subscription', 'err'=>$rc['err']));\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $args['tnid'], \n 2, 'ciniki_tenant_subscriptions', $subscription['id'], 'status', '61');\n return $rc;\n }\n } \n\n\n return array('stat'=>'ok');\n}", "public function testCompanyConfigurationsStatusesIdDelete()\n {\n\n }", "public function testInstrumentEditDiscard()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->type('@search', 'testinstrument1000')\n ->click('@searchtopresult')\n ->assertsee('View Instrument - TestInstrument1000')\n ->press('@actions-button')\n ->press('@actions-edit-menu')\n ->assertsee('Edit Instrument - TestInstrument1000')\n ->type('@code','TestInstrumentDiscard1000')\n ->type('@category', 'EditDiscard')\n ->press('@actions-button')\n ->press('@actions-discard-menu')\n ->assertsee('View Instrument - TestInstrument1000');\n });\n }", "public function executeCancelSenderId()\n {\n $sms = new Lib\\SMS();\n $result = $sms->cancelSenderId();\n if ( $result === false ) {\n wp_send_json_error( array( 'message' => current( $sms->getErrors() ) ) );\n } else {\n wp_send_json_success();\n }\n }", "public function canceled($id) {\n $curStatus = $this->field('status', array('CoJob.id' => $id));\n \n if(!$curStatus) {\n throw new InvalidArgumentException(_txt('er.notfound', array(_txt('ct.co_jobs.1'), $id)));\n }\n \n return ($curStatus == JobStatusEnum::Canceled);\n }", "public function testDeleteTaskInstanceIdentityLinks()\n {\n }", "public function testWorkflowsWorkflowIdDelete()\n {\n }", "public function testApiDestroy()\n {\n $user = User::find(1);\n $compte = Compte::where('name', 'compte22')->first();\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('DELETE', '/api/comptes/'.$compte->id);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]);\n \n\n\n }", "public function getCancellationEvents();", "public function test_deleteBillingCodeTypeTag() {\n\n }", "public function test_detachTagRequest() {\n\n }", "public function testHandleRemoveNoID()\n {\n $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/remove');\n \n $this->assertResponseStatus(404);\n }", "public function testShowSpecificOutroCardsWithWrongIdForSuperAdmin(): void\n {\n // Login via tenant-admin\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->get('api/v1/outroCards/tenants/1111111?token=' . $token);\n\n // Check response status\n $response->assertStatus(460);\n\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n\n $this->assertEquals(false, $success);\n $this->assertEquals(460, $code);\n $this->assertEquals('Wrong ID.', $message);\n }", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function testDeleteEvent()\n {\n }", "public function testUuid(): void\n {\n $regex = '/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i';\n $this->assertTrue((bool) preg_match($regex, $this->user->getUuid()));\n }", "public function testGetTokenWithTokenIdInvalid(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parametersBasicTokenRequest = PayUTestUtil::buildBasicParametersToken();\n\t\n\t\t$parameters = array_merge($parametersBasicTokenRequest, array(PayUParameters::TOKEN_ID=>\"1231312132-1231321321-12312132-12312\"));\n\t\n\t\t$response = PayUTokens::find($parameters);\n\t\n\t}", "public function testDeleteOutroCardForTenantAdmin(): void\n {\n $token = $this->loginByEmail(self::TENANT_ADMIN_1[0], self::TENANT_ADMIN_1[1]);\n\n // Request\n $response = $this->delete('api/v1/outroCards/tenants/2?token=' . $token);\n\n // Check response status\n $response->assertStatus(200);\n\n // Check response structure\n $response->assertJsonStructure(\n [\n 'success',\n 'code',\n 'data',\n 'message'\n ]\n );\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(true, $success);\n $this->assertEquals(200, $code);\n $this->assertEquals(null, $data);\n $this->assertEquals(\"Deleted The Outro Card.\", $message);\n\n $removedOutroCard = OutroCard::where('tenant_id', 2)->first();\n $this->assertEquals(null, $removedOutroCard->outro_card);\n }", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "public function testDeleteTask()\n {\n $userId = User::first()->value('id');\n $taskId = Task::orderBy('id', 'desc')->first()->id;\n\n echo '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId;\n\n $response = $this->json('DELETE', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId);\n $response->assertStatus(200);\n }", "abstract public function checkUUID(string $uuid);", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }", "public function testDeleteInvoice() {\n\t\t$randomInvoice = rand();\n\n\t\t$tokenizer = new Token($_SESSION['accessToken']);\n\n\t\t$tokenizer->ip('173.49.87.94')\n\t\t\t\t->expirationMonth(12)\n\t\t\t\t->expirationYear(30)\n\t\t\t\t->cardNumber('4321000000001119')\n\t\t\t\t->cvv('333')\n\t\t\t\t->cardType('VS')\n\t\t\t\t->name('John Smith')\n\t\t\t\t->zip('65000')\n\t\t\t\t->address('65 Main Street')\n\t\t\t\t->post();\n\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->total(100)\n\t\t\t\t->clerk('1')\n\t\t\t\t->invoiceNumber($randomInvoice)\n\t\t\t\t->tokenValue($tokenizer->getToken())\n\t\t\t\t->purchaseCard(array(\n\t\t\t\t\t'customerReference' => 412348,\n\t\t\t\t\t'destinationPostalCode' => 19134,\n\t\t\t\t\t'productDescriptors' => array('rent')\n\t\t\t\t))\n\t\t\t\t->sale();\n\n\t\t$output = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ': CARD AND TRANSACTION CREATION');\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $output\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Deleting an invoice requires the transaction be sent in the header\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->deleteInvoice($randomInvoice);\n\n\t\t$result = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__);\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ' INVOICE: ' . $_SESSION['invoiceForTest5']);\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $result\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\n\t\t$this->assertNotNull($result);\n\n\t}", "public function testComDayCrxSecurityTokenImplTokenCleanupTask()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.crx.security.token.impl.TokenCleanupTask';\n\n $crawler = $client->request('POST', $path);\n }", "public function testDeleteVendorComplianceSurveyTag()\n {\n }", "public function valid_uuid(): void\n {\n $uuid = UUID::generate();\n\n $pattern = '/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i';\n $this->assertNotFalse(preg_match_all($pattern, (string) $uuid));\n }", "public function testProfileDeleteById()\n {\n\n }", "protected function cancelRequest($upload_uuid)\n {\n // verify the required parameter 'upload_uuid' is set\n if ($upload_uuid === null || (is_array($upload_uuid) && count($upload_uuid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $upload_uuid when calling cancel'\n );\n }\n\n $resourcePath = '/api/v1/upload/{uploadUuid}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($upload_uuid !== null) {\n $resourcePath = str_replace(\n '{' . 'uploadUuid' . '}',\n ObjectSerializer::toPathValue($upload_uuid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\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 Bearer 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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testDeleteHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\r\n\t\t//Test HTTP status ok for id=1\r\n\t\t$response= $this->http->request('DELETE','api/v1/hospital/2');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t}", "public function checkPaymentCancellation()\n {\n $response = $this->client->request($this->methods['post'], 'pay' , [\n 'json' => [\n 'AGR_TRANS_ID' => $this->agr_trans_id,\n 'VENDOR_TRANS_ID' => $this->vendor_trans_id,\n 'SIGN_TIME' => $this->generateSignTime(),\n 'SIGN_STRING' => md5($this->SECRET_KEY. $this->agr_trans_id. $this->vendor_trans_id. $this->sign_time)\n ]\n ]);\n\n return json_decode($response->getBody());\n }", "public function testDeleteReplenishmentTag()\n {\n }", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "public function destroy($id)\n {\n $Son=Son::where('id',$id)->where('Is_agree',[0,2])->delete();\n return apiSuccess(null, 200,'smartbus.cancelled_successfully');\n\n }" ]
[ "0.61864793", "0.60204095", "0.5989569", "0.58189404", "0.5733375", "0.56805557", "0.5669344", "0.55719", "0.54567134", "0.5417351", "0.54147637", "0.53924793", "0.53587484", "0.52645785", "0.5256362", "0.52558064", "0.525226", "0.52174026", "0.52069384", "0.5183477", "0.5182995", "0.51710474", "0.5164769", "0.5148168", "0.51463", "0.5143814", "0.51229936", "0.511948", "0.5112102", "0.5111187", "0.51079017", "0.50865805", "0.5084218", "0.5084218", "0.5068604", "0.506627", "0.5065543", "0.50634515", "0.505563", "0.50537455", "0.5013165", "0.50041753", "0.50013757", "0.4998806", "0.49854133", "0.4974477", "0.49626505", "0.49626297", "0.49606785", "0.49601996", "0.49601996", "0.49535027", "0.4938485", "0.4934721", "0.4923375", "0.4917856", "0.4916544", "0.49141738", "0.48959252", "0.4879892", "0.48782673", "0.48782673", "0.4875774", "0.48749715", "0.48673683", "0.4854063", "0.48392424", "0.48365462", "0.48304468", "0.4830325", "0.4824251", "0.48116377", "0.48080537", "0.48050445", "0.4804357", "0.48019147", "0.4801818", "0.4799896", "0.47955003", "0.47901216", "0.4789278", "0.47655693", "0.4762976", "0.47568166", "0.4751587", "0.47406352", "0.47398108", "0.47391617", "0.47339863", "0.47215784", "0.47203675", "0.47112373", "0.4710821", "0.47051823", "0.470259", "0.469967", "0.46968824", "0.46928608", "0.46917647", "0.46897402" ]
0.51493967
23
\ Scripts and Styles \ Enqueue boom scripts
function boom_enqueue_scripts() { wp_enqueue_style( 'boom-styles', get_stylesheet_uri(), array(), '1.0' ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'main_js', get_template_directory_uri() . '/js/scripts.pack.js', array(), '1.0', true ); // LOCALIZE SCRIPT (References for Ajax Functions) global $wp_query, $post; $query = $wp_query; $section = getBlogSectionName(); if($section == 'home'){ $exlude_post_ids = []; // Exclude first 3 featured posts $featured_args = array( 'posts_per_page' => 3, 'meta_key' => 'featuredPost-checkbox', 'meta_value' => 'yes' ); $featured_posts = new WP_Query($featured_args); while($featured_posts->have_posts()): $featured_posts->the_post(); array_push($exlude_post_ids, get_the_ID()); endwhile; wp_reset_postdata(); // Exclude 3 'Latest' Posts $latest_args = array( 'posts_per_page' => 3, 'post__not_in' => $exlude_post_ids ); $latest_posts = new WP_Query($latest_args); while($latest_posts->have_posts()): $latest_posts->the_post(); array_push($exlude_post_ids, get_the_ID()); endwhile; wp_reset_postdata(); // Get All posts, except selected posts from above $args = array( 'post__not_in' => $exlude_post_ids ); $query = new WP_Query($args); } else if($section == 'single'){ $args = array( 'cat' => array(get_the_category($query->post->ID)[0]->term_id), 'posts_per_page' => 1, 'post__not_in' => array($post->ID) ); $query = new WP_Query($args); } else if($section == 'category'){ $args = array( 'cat' => array(get_category(get_query_var( 'cat' ))->cat_ID), 'posts_per_page' => 7, 'offset' => 10 ); $query = new WP_Query($args); } $reference_object = array( 'base' => get_template_directory_uri(), 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'query_vars' => json_encode( $query->query_vars ), 'actual_page' => get_query_var('paged') > 1 ? get_query_var('paged') : 1, 'total_pages' => $query->max_num_pages, 'section' => $section, 'isMobile' => wp_is_mobile() ? 'true' : 'false', 'category' => get_category($query->query_vars['cat'])->slug ); wp_localize_script('main_js', 'base_reference', $reference_object ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mandiberg_scripts() {\n\n\t\t//include bootstrap:\n\t\twp_register_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css' );\n\t\twp_enqueue_style( 'bootstrap-style');\n\n\n\n\t\t// Register the style like this for a theme:\n\t wp_register_style( 'mandiberg-style', get_template_directory_uri() . '/style.css', array(), '20120208', 'all' );\n\t\twp_enqueue_style( 'mandiberg-style');\n\n\t\t//barba js for transitions\n\n\t\t wp_register_script('barba', get_template_directory_uri() . '/build/barba.min.js', array ( 'jquery' ),'1.1', true);\n\t\t wp_enqueue_script('barba');\n\n\t\t//js\n\t\twp_register_script('js-file', get_template_directory_uri() . '/build/script.js', array ( 'jquery' ),'1.1', true);\n\t\t wp_enqueue_script('js-file');\n\n\t}", "function berry_scripts() {\n\n\twp_dequeue_style( 'seed-style');\n\twp_enqueue_style( 'berry-style', get_stylesheet_uri() );\n\twp_enqueue_script( 'berry-main', get_stylesheet_directory_uri() . '/js/main.js', array(), '2016-1', true );\n\n}", "public function enqueueScripts(){}", "function clea_base_enqueue_scripts() {\n\n\t/* Enqueue scripts. */\n\n}", "static function enqueue_scripts(){\n\t\tself::include_css();\n\t\tself::include_js();\n\t}", "function alpha_scripts() {\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\n\t\t// Register scripts\n\t\twp_register_script( 'bootstrap-js', 'http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js', array( 'jquery' ), false, true );\n\t\twp_register_script( 'alpha-custom', SCRIPTS . '/scripts.js', array( 'jquery' ), false, true );\n\n\t\t// Load the custom scripts\n\t\twp_enqueue_script( 'bootstrap-js' );\n\t\twp_enqueue_script( 'alpha-custom' );\n\n\t\t// Load the stylesheets\n\t\twp_enqueue_style( 'font-awesome', THEMEROOT . '/css/font-awesome.min.css' );\n\t\twp_enqueue_style( 'alpha-master', THEMEROOT . '/css/master.css' );\n\t}", "public function enqueue_scripts() {\n\t\t$this->styles();\n\t\t$this->scripts();\n\t}", "public function enqueue_scripts() {\r\n\r\n\t\t}", "public function enqueueScripts() {\n\t\t\twp_enqueue_script('jquery');\n//\t\t\twp_enqueue_script('owl', self::asset(\"node_modules/owl.carousel/dist/owl.carousel.min.js\"), ['jquery'], '1.0.0', ' all');\n// wp_enqueue_script('headroom', self::asset(\"node_modules/headroom.js/dist/headroom.min.js\"), ['jquery'], '1.0.0', ' all');\n// wp_enqueue_script('prettyPhoto', self::asset(\"js/vendor/jquery.prettyPhoto.js\"), ['jquery'], '1.0.0', ' all');\n//\t\t\twp_enqueue_script('navigo', self::asset(\"node_modules/navigo/lib/navigo.min.js\"), ['jquery'], '1.0.0', ' all')\\;\n\t\t\twp_enqueue_script('app', self::asset(\"js/app.min.js\"), ['jquery'], '1.0.0', ' all');\n\t\t}", "public function enqueue_scripts() {\n\n\t}", "function abyp_scripts() {\n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n wp_enqueue_script( 'comment-reply' );\n }\n\n // Register scripts \n wp_register_script( 'modernizr', SCRIPTS . '/vendor/modernizr.custom.25133.js', false, false, true );\n wp_register_script( 'tween-max', SCRIPTS . '/vendor/TweenMax.min.js', false, false, true );\n wp_register_script( 'jquery-abyp', SCRIPTS . '/vendor/jquery-2.1.1.min.js', false, false, true );\n wp_register_script( 'easing', SCRIPTS . '/vendor/jquery.easing.1.3.js', false, false, true );\n wp_register_script( 'lightbox', SCRIPTS . '/vendor/lightbox-2.6.min.js', false, false, true );\n wp_register_script( 'vendor-bundle', SCRIPTS . '/vendor/vendor.bundle.js', false, false, true );\n wp_register_script( 'abyp-main', SCRIPTS . '/main.js', false, false, true );\n\n // Load the custom scripts \n wp_enqueue_script( 'modernizr' );\n wp_enqueue_script( 'tween-max' );\n wp_enqueue_script( 'jquery-abyp' );\n wp_enqueue_script( 'easing' );\n wp_enqueue_script( 'lightbox' );\n wp_enqueue_script( 'vendor-bundle' );\n wp_enqueue_script( 'abyp-main' ); \n\n // Load the stylesheets \n wp_enqueue_style( 'lightbox', THEMEROOT . '/assets/css/lightbox.css' );\n wp_enqueue_style( 'abyp-master', THEMEROOT . '/assets/css/master.css' );\n }", "public function enqueue_scripts() {\n\n\t\t// Setup scripts array\n\t\t$scripts = array();\n\n\t\t// Always pull in jQuery for TinyMCE shortcode usage\n\t\tif ( bbp_use_wp_editor() ) {\n\t\t\t$scripts['bbpress-editor'] = array(\n\t\t\t\t'file' => 'js/editor.js',\n\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t);\n\t\t}\n\n\t\t// Forum-specific scripts\n\t\tif ( bbp_is_single_forum() ) {\n\t\t\t$scripts['bbpress-forum'] = array(\n\t\t\t\t'file' => 'js/forum.js',\n\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t);\n\t\t}\n\n\t\t// Topic-specific scripts\n\t\tif ( bbp_is_single_topic() ) {\n\n\t\t\t// Topic favorite/unsubscribe\n\t\t\t$scripts['bbpress-topic'] = array(\n\t\t\t\t'file' => 'js/topic.js',\n\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t);\n\n\t\t\t// Hierarchical replies\n\t\t\tif ( bbp_thread_replies() ) {\n\t\t\t\t$scripts['bbpress-reply'] = array(\n\t\t\t\t\t'file' => 'js/reply.js',\n\t\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// User Profile edit\n\t\tif ( bbp_is_single_user_edit() ) {\n\t\t\t$scripts['bbpress-user'] = array(\n\t\t\t\t'file' => 'js/user.js',\n\t\t\t\t'dependencies' => array( 'user-query' )\n\t\t\t);\n\t\t}\n\n\t\t// Filter the scripts\n\t\t$scripts = apply_filters( 'BBP_IOA_scripts', $scripts );\n\n\t\t// Enqueue the scripts\n\t\tforeach ( $scripts as $handle => $attributes ) {\n\t\t\tbbp_enqueue_script( $handle, $attributes['file'], $attributes['dependencies'], $this->version, 'screen' );\n\t\t}\n\t}", "public function enqueue_front_end_scripts() {}", "function blm_basic_scripts() {\n\twp_enqueue_style( 'style', get_stylesheet_uri() );\n\t\n\twp_enqueue_style('googleFonts', '//fonts.googleapis.com/css?family=Raleway:400,300,600' );\n\n\twp_enqueue_script( 'blm_navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n\t\n\twp_enqueue_script( 'blm-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}", "public function enqueue_scripts()\n {\n }", "public function enqueue_scripts()\n {\n }", "public function enqueue_scripts()\n {\n }", "function jakob_script_enqueue() {\r\n wp_enqueue_style('customstyle', get_template_directory_uri().'/css/jakob.css', false, '1.0.0', 'all');\r\n wp_enqueue_script('customjs-jakob', get_template_directory_uri().'/js/jakob.js', array(), '1.0.0', true);\r\n wp_enqueue_script('customjs-contact', get_template_directory_uri().'/js/contact-form.js', array(), '1.0.0', true);\r\n wp_enqueue_script('font-awesome', 'https://use.fontawesome.com/releases/v5.0.4/js/all.js', array(), '1.0.0', true);\r\n}", "function enqueue_scripts() {\n\t\tinclude $this->dir_path . 'scripts.php';\n\t}", "function boromeke_scripts() {\n\t//\n\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css',false,'3.3.5','all');\n\t\n\t// 引入 style.css.\n\twp_enqueue_style( 'boromeke-style', get_stylesheet_uri() );\n\t\n\t// 引入 font-awesome\n\twp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/font-awesome-4.4.0/css/font-awesome.min.css' );\n\n // 引入 JavaScript\n\tif (!is_admin()) {\n\twp_deregister_script('jquery');\n\twp_register_script('jquery', get_template_directory_uri() . '/js/jquery.min.js', false, '2.1.4');\n\twp_enqueue_script('jquery');\n\t}\n wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.5', true );\n\n /*\n\t * Adds JavaScript to pages with the comment form to support\n\t * sites with threaded comments (when in use).\n\t */\n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )\n\t\twp_enqueue_script( 'comment-reply' );\n\n }", "protected function enqueue_scripts()\n {\n\n }", "function bulmapress_scripts() {\n\t\twp_enqueue_style( 'bulmapress-style', get_stylesheet_uri() );\n\n\t\twp_enqueue_style( 'bulmapress-fontawesome', \"https://use.fontawesome.com/releases/v5.2.0/css/all.css\" );\n\n\t\twp_enqueue_style( 'bulmapress-bulma-style', get_template_directory_uri() . '/frontend/bulmapress/css/bulmapress.css' );\n\n\t\twp_enqueue_script( 'bulmapress-navigation', get_template_directory_uri() . '/frontend/js/navigation.js', array(), '20151215', true );\n\n\t\twp_enqueue_script( 'bulmapress-skip-link-focus-fix', get_template_directory_uri() . '/frontend/js/skip-link-focus-fix.js', array(), '20151215', true );\n\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n}", "function bfc_add_scripts() {\n\twp_register_script('principal', get_template_directory_uri() . '/js/vendor/jquery.js', array(), 'null', true);\n\twp_enqueue_script('principal');\n\twp_register_script('foundation', get_template_directory_uri() . '/js/vendor/foundation.js', array(), 'null', true);\n\twp_enqueue_script('foundation');\n\twp_register_script('modernizr', get_template_directory_uri() . '/js/modernizr.js', array(), 'null', true);\n\twp_enqueue_script('modernizr');\n\twp_register_script('app', get_template_directory_uri() . '/js/app.js', array(), 'null', true);\n\twp_enqueue_script('app');\n\twp_register_script('slick', get_template_directory_uri() . '/js/slick.js', array(), 'null', true);\n\twp_enqueue_script('slick');\n}", "public function enqueue_scripts()\n {\n }", "public function frontEndStyleScripts(): void\n {\n wp_enqueue_style('users-data-bootstrap', plugin_dir_url(dirname(__FILE__)) . 'assets/css/bootstrap.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-fontawsome', plugin_dir_url(dirname(__FILE__)) . 'assets/css/font-awesome.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-styles', plugin_dir_url(dirname(__FILE__)) . 'assets/css/users-data.css', [], UsersListing::getVersion());\n //\n wp_enqueue_script('jquery-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('jquery-popper', plugin_dir_url(dirname(__FILE__)) . 'assets/js/popper.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('bootstrap-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/bootstrap.min.js', ['jquery'], UsersListing::getVersion(), false);\n }", "function bp_lb_scripts_method() {\n\t\t//get initial resources\n\t\twp_enqueue_style( 'bp-lightbox-style', plugins_url('/css/style.css', __FILE__)); //styles\n\t\twp_enqueue_script( 'jquery' );\n\t\t//wp_enqueue_script( 'show-caregiving-now-lightbox', plugins_url('/js/bp-lightbox-script.js', __FILE__), array('thickbox', 'jquery'), false, true); //javascript\n\t}", "function innelyz_scripts() {\n wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.js', array('jquery'), '3.3.7', false);\n wp_enqueue_style( 'bootstrap', get_template_directory_uri() .'/assets/css/bootstrap.css', array(), false, 'all' );\n wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lora|Pacifico|Roboto');\n wp_enqueue_style( 'innelyz-style', get_stylesheet_uri() );\n }", "function admin_print_scripts() {\n wp_enqueue_script( \"{$this->namespace}-admin\" );\n wp_enqueue_script( 'media-upload' );\n wp_enqueue_script( 'slidedeck-fancy-form' );\n wp_enqueue_script( 'codemirror' );\n wp_enqueue_script( 'codemirror-mode-css' );\n wp_enqueue_script( 'codemirror-mode-javascript' );\n wp_enqueue_script( 'codemirror-mode-clike' );\n wp_enqueue_script( 'codemirror-mode-php' );\n }", "function scripts() {\n\n\t\t// Foundation core\n\t\twp_register_style( 'maera_zf', MAERA_FOUNDATION_SHELL_URL . '/assets/css/foundation.css' );\n\t\twp_enqueue_style( 'maera_zf' );\n\n\t\t// Foundation icons\n\t\twp_register_style( 'maera_foundation_icons', MAERA_FOUNDATION_SHELL_URL . '/assets/foundation-icons/foundation-icons.css' );\n\t\twp_enqueue_style( 'maera_foundation_icons' );\n\n\t\t// Add Foundation required scripts\n\t\twp_enqueue_script( 'fastclick', MAERA_FOUNDATION_SHELL_URL . '/assets/vendor/fastclick.js', false );\n\t\twp_enqueue_script( 'foundation', MAERA_FOUNDATION_SHELL_URL . '/assets/foundation.min.js', 'jquery' );\n\n\t\t// Add our custom styles\n\t\twp_register_style( 'maera_foundation_custom', MAERA_FOUNDATION_SHELL_URL . '/assets/css/style.css' );\n\t\twp_enqueue_style( 'maera_foundation_custom' );\n\n\t}", "public function scripts(){\n //Enqueue scripts\n /**\n * wp_enqueue_script('sample-script',$this->directory_uri . '/sample.min.js',array('jquery'),false,false);\n * ...\n * ....\n */\n }", "function barjeel_scripts() {\n\n\twp_enqueue_script( 'okzoom', get_template_directory_uri() . '/javascripts/build/okzoom.js', array( 'jquery' ), '20120206', true );\n\n\twp_enqueue_script( 'barjeel', get_template_directory_uri() . '/javascripts/build/barjeel.min.js', array( 'jquery' ), '20120206', true );\n\n\n}", "function accvent_scripts() {\n\t wp_enqueue_style( 'main', get_stylesheet_uri() );\n\t wp_enqueue_script( 'bundle', get_template_directory_uri() . '/js/build.min.js', array(), '1.0.0', true );\n\t}", "public function dequeue_scripts() {\n\n\t\t\\wp_dequeue_script( 'wpforms-flatpickr' );\n\t\t\\wp_dequeue_script( 'wpforms-jquery-timepicker' );\n\n\t\t\\wp_dequeue_style( 'wpforms-jquery-timepicker' );\n\t\t\\wp_dequeue_style( 'wpforms-flatpickr' );\n\n\t\t\\wp_dequeue_style( 'wpforms-full' );\n\t\t\\wp_dequeue_style( 'wpforms-base' );\n\t}", "function meatball_scripts() {\n\t// wp_enqueue_style( 'meatball-style', get_stylesheet_uri() );\n\n\twp_enqueue_style( 'meatball-style', get_template_directory_uri() . '/css/main.css' );\n\n\t// wp_enqueue_script( 'meatball-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n\n\t// wp_enqueue_script( 'meatball-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\t// if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t// \twp_enqueue_script( 'comment-reply' );\n\t// }\n}", "function enqueue_scripts() {\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 21 );\n\t\tadd_action( 'admin_init', array( $this, 'add_pagination' ) );\n\t\tadd_action( \"bc_plugin_browser_content_{$this->page_slug}\", array( $this, 'display_plugins_browser' ), 10, 2 );\n\t}", "function aitAdminEnqueueScriptsAndStyles()\n{\n\t$mapLanguage = get_locale();\n\taitAddScripts(array(\n\t\t'ait-googlemaps-api' => array(\n\t\t\t\t\t\t\t\t\t //'file' => 'https://maps.google.com/maps/api/js?key=AIzaSyC62AaIu5cD1nwSCmyO4-33o3DjkFCH4KE&sensor=false&amp;language='.$mapLanguage,\n\t\t\t\t\t\t\t\t\t 'file' => 'https://maps.google.com/maps/api/js?key=AIzaSyBL0QWiORKMYd585E4qvcsHcAR1R7wmdiY&sensor=false&amp;language='.$mapLanguage,\n\t\t\t\t\t\t\t\t\t 'deps' => array('jquery')\n\t\t\t\t\t\t\t\t\t ),\n\t\t'ait-jquery-gmap3' => array('file' => THEME_JS_URL . '/libs/gmap3.min.js', 'deps' => array('jquery', 'ait-googlemaps-api')),\n\t));\n}", "function aitEnqueueScriptsAndStyles(){\r\n\tif(!is_admin()){\r\n\t\t// just shortcuts\r\n\t\t$s = THEME_CSS_URL;\r\n\t\t$j = THEME_JS_URL;\r\n\r\n\t\taitAddStyles(array(\r\n\t\t\t'ait-colorbox' => array('file' => \"$s/libs/colorbox.css\"),\r\n\t\t\t'ait-fancybox' => array('file' => \"$s/libs/fancybox.css\"),\r\n\t\t\t'jquery-ui' \t => array('file' => \"$s/libs/jquery-ui.css\"),\r\n\t\t\t'prettysociable' => array('file' => \"$s/libs/prettySociable.css\"),\r\n\t\t\t'hoverzoom' \t => array('file' => \"$s/libs/hoverZoom.css\"),\r\n\t\t));\r\n\r\n\t\taitAddScripts(array(\r\n\t\t\t'jquery-ui-tabs' \t\t\t=> true,\r\n\t\t\t'jquery-ui-accordion' \t\t\t=> true,\r\n\t\t\t'jquery-infieldlabel' \t\t\t=> array('file' => \"$j/libs/jquery-infieldlabel.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-iconmenu' \t\t\t\t=> array('file' => \"$j/libs/jquery-iconmenu.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-plugins'\t \t\t\t=> array('file' => \"$j/libs/jquery-plugins.js\", 'deps' => array('jquery')),\r\n\t\t\t'modernizr'\t\t\t\t\t\t=> array('file' => \"$j/libs/modernizr-2.6.1-custom.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\r\n\t\t\t'ait-gridgallery' \t\t\t=> array('file' => \"$j/gridgallery.js\", 'deps' => array('jquery', 'jquery-plugins'), 'inFooter' => true),\r\n\t\t\t'ait-testimonials' \t\t\t=> array('file' => \"$j/testimonials.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'ait-script' \t\t\t=> array('file' => \"$j/script.js\", 'deps' => array('jquery', 'jquery-infieldlabel', 'jquery-iconmenu', 'jquery-plugins', 'modernizr'), 'inFooter' => true),\r\n\t\t));\r\n\t}\r\n}", "function bcm_add_scripts() {\t\r\n\t\tglobal $bcmDirPath;\r\n\t\tif (function_exists('wp_enqueue_script') && function_exists('wp_register_script')) {\r\n\t\t\twp_enqueue_script('bcm_edit_script', $bcmDirPath.'/editcomments.js.php');\r\n\t\t\twp_enqueue_script('prototype');\r\n\t\t\twp_enqueue_script('scriptaculous-effects');\r\n\t\t\twp_enqueue_script( 'admin-comments' );\r\n\t\t} else {\r\n\t\t\twpau_add_scripts_legacy();\r\n\t\t}\r\n\t}", "public function thm_enqueue_scripts() {\n\t\n\t\twp_enqueue_script( 'thm_blocksy_child', get_stylesheet_directory_uri() . '/admin/js/thm-blocksy-admin.js', array( 'jquery' ), null, false );\n\t\n\t}", "public function load_admin_scripts()\n {\n // Enqueue styles\n wp_enqueue_style('soccerpress', plugins_url('assets/css/soccerpress.css', __FILE__), array(), '1.0.0', false);\n wp_enqueue_style('bootstrap-css', plugins_url('assets/css/bootstrap.min.css', __FILE__), array(), '4.3.1', false);\n\n // Enqueue scripts\n wp_register_script('bootstrap-js', plugins_url('assets/js/bootstrap.min.js', __FILE__), array(), '4.3.1', false);\n }", "public function myScripts()\n {\n //wp_register_script('angularjs',plugins_url('bower_components/angular/angular.min.js', __FILE__));\n wp_enqueue_style('grimagecss', plugins_url('style.css', __FILE__));\n //wp_enqueue_script('grimagescripts',plugins_url('/app.js',__FILE__));\n }", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "function nuthemes_scripts() {\n\t// Load Bootstrap stylesheet.\n\twp_enqueue_style( 'nu-bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array() );\n\n\t// Add Genericons font, used in the main stylesheet.\n\twp_enqueue_style( 'nu-genericons', get_template_directory_uri() . '/css/genericons.css', array() );\n\n\t// Add Open Sans and Bitter fonts, used in the main stylesheet.\n\twp_enqueue_style( 'nu-fonts', nuthemes_fonts_url(), array(), '20131010' );\n\n\t// Loads our main stylesheet.\n\twp_enqueue_style( 'nu-style', get_stylesheet_uri(), array() );\n\n\t// Load Bootstrap JavaScript.\n\twp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ) );\n\n\t// Adds JavaScript to support threaded comments.\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}", "public function enqueueScripts()\n {\n wp_enqueue_style('gfbitpay-admin', $this->plugin->urlBase . 'style-admin.css', false, GFBITPAY_PLUGIN_VERSION);\n }", "function scripts() {\n\t/**\n\t * Flag whether to enable loading uncompressed/debugging assets. Default false.\n\t *\n\t * @param bool project_script_debug\n\t */\n\t$debug = apply_filters( 'project_script_debug', false );\n\t$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\twp_enqueue_script(\n\t\t'modernizr-custom',\n\t\tProject_TEMPLATE_URL . '/assets/js/vendor/modernizr-custom.min.js',\n\t\tfalse, '2.7.2'\n\t);\n\twp_enqueue_script(\n\t\t'project',\n\t\tProject_TEMPLATE_URL . \"/assets/js/project-theme{$min}.js\",\n\t\tarray(),\n\t\tProject_VERSION,\n\t\ttrue\n\t);\n}", "public function enqueue_scripts() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Fastnetmarketing_Admin_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Fastnetmarketing_Admin_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/fastnetmarketing-admin-admin.js', array( 'jquery' ), $this->version, false );\n\n\t}", "public function admin_print_scripts()\n\t\t{\n\t\t\tglobal $wp_version;\n\n\t\t\t//Check wp version and load appropriate scripts for colorpicker.\n\t\t\tif ( 3.5 <= $wp_version ) {\n\t\t\t\twp_enqueue_style( 'wp-color-picker' );\n\t\t\t\twp_enqueue_script( 'wp-color-picker' );\n\t\t\t} else {\n\t\t\t\twp_enqueue_style( 'farbtastic' );\n\t\t\t\twp_enqueue_script( 'farbtastic' );\n\t\t\t}\n\n\t\t\twp_enqueue_script( 'bootstrap-tooltip' );\n\t\t\twp_enqueue_script( 'select2' );\n\t\t\twp_enqueue_script( 'topgroupshops-media' );\n\t\t\twp_enqueue_script( 'sf-scripts' );\n\n\t\t\twp_enqueue_style( 'wp-color-picker' );\n\t\t\twp_enqueue_style( 'select2' );\n\t\t\twp_enqueue_style( 'sf-styles' );\n\t\t}", "function as_on_add_scripts() {\n // enqueue backbonejs, underscore\n add_existed_script('backbone');\n add_existed_script('underscore');\n if (as_option('as_option_smooth_scroll', '1')) {\n // Smoothscroll JS\n add_script('smoothscroll', TEMPLATEURL . '/js/smoothscroll.js', array(\n 'jquery'));\n }\n // Modernize JS\n add_script('modernizr', TEMPLATEURL . '/js/libs/modernizr.custom.js', array(\n 'jquery'));\n if (as_option('as_option_retina_img', '1')) {\n add_script('retina', TEMPLATEURL . '/js/libs/retina.min.js', array(\n 'jquery'));\n }\n add_script('front', TEMPLATEURL . '/js/front.js', array(\n 'jquery',\n 'backbone',\n 'underscore'));\n add_script('js-appear', TEMPLATEURL . '/js/libs/main.js', array(\n 'jquery',\n 'jquery'));\n //add js easing when plugin not active\n if (!(function_exists('dslc_register_modules'))) {\n //add js easing\n add_script('js-easing', TEMPLATEURL . '/js/libs/jquery.easing.js', array(\n 'jquery',\n 'jquery'));\n }\n wp_localize_script('front', 'as_globals', array(\n 'ajaxURL' => admin_url('admin-ajax.php'),\n 'imgURL' => get_template_directory_uri() . '/img/'\n ));\n // Custom\n add_script('main', TEMPLATEURL . '/js/main.js', array(\n 'jquery'));\n // add style demo\n if (file_exists(TEMPLATE_DIR . '/demo/js/custom_panel.js')) {\n add_script('custom_panel', TEMPLATEURL . '/demo/js/custom_panel.js', array(\n 'jquery'));\n }\n}", "public function enqueue_scripts() {\n\t\t// wp_enqueue_style( 'simple-grams', plugins_url( '/assets/css/simple-grams.css', __FILE__ ) );\n\t}", "public function scripts() {\n\t\tif ( get_post_type() == 'agenda' && ! is_single() ) {\n\t\t\twp_enqueue_script( 'jquery' );\n\t\t\twp_enqueue_script( 'events-calendar', plugins_url( 'assets/js/calendar.js', plugin_dir_path( __FILE__ ) ), array( 'jquery' ), '', true );\n\t\t\twp_enqueue_style( 'events-calendar-styles', plugins_url( 'assets/css/calendar.css', plugin_dir_path( __FILE__ ) ), array(), '' );\n\t\t}\n\n\t\twp_enqueue_style( 'timeline-styles', plugins_url( 'assets/css/timeline.css', plugin_dir_path( __FILE__ ) ), array(), '' );\n\t}", "public function enqueue_scripts() {\n wp_enqueue_script(\n 'moment',\n plugins_url('includes/moment.min.js', __FILE__),\n array(),\n VSPI_VERSION,\n false\n );\n wp_enqueue_script(\n 'minidaemon',\n plugins_url('includes/mdn-minidaemon.js', __FILE__),\n array(),\n VSPI_VERSION,\n false\n );\n wp_enqueue_script(\n 'vspi-admin',\n plugins_url('includes/vspi-admin.js', __FILE__),\n array('jquery'),\n VSPI_VERSION,\n false\n );\n }", "public static function enqueue_scripts() {\n\t\tif ( ! static::$enqueued && wp_script_is( 'cmb2-scripts', 'enqueued' ) ) {\n\t\t\twp_enqueue_script( 'wplibs-form' );\n\t\t\tstatic::$enqueued = true;\n\t\t}\n\t}", "function beluga_scripts()\n{\n\t$options = get_option('beluga_theme_settings');\n\tif (!empty($options['header_opacity'])) {\n\t\t$o = $options['header_opacity'];\n\t} else {\n\t\t$o = '0';\n\t}\n\n\twp_enqueue_style('theme-slug-fonts', beluga_fonts_url(), array(), null);\n\twp_enqueue_style('beluga-style', get_stylesheet_uri());\n\twp_enqueue_style('genericons', get_template_directory_uri() . '/css/genericons.css');\n\n\twp_enqueue_script('beluga-navigation', get_template_directory_uri() . '/js/navigation.js', array('jquery'), '2014', true);\n\twp_enqueue_script('beluga-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);\n\twp_enqueue_script('waypoints', get_template_directory_uri() . '/js/waypoints.min.js', array('jquery'), '2014', true);\n\twp_enqueue_script('fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), '2014', true);\n\n\twp_localize_script('beluga-navigation', 'belugaOptions', array('headerOpacity' => $o));\n\n\tif (is_singular() && comments_open() && get_option('thread_comments')) {\n\t\twp_enqueue_script('comment-reply');\n\t}\n}", "public function admin_enqueue_scripts()\n\t\t{\n\t\t\tglobal $pagenow; \n\t\t\tif (is_admin() || $pagenow === 'wc_prd_vendor') { \n\t\t\t\twp_register_script( 'bootstrap-tooltip', $this->assets_url . 'js/bootstrap-tooltip.js', array( 'jquery' ), '1.0' );\n\t\t\t\twp_register_script( 'select2', $this->assets_url . 'js/select2/select2.min.js', array( 'jquery' ), '3.5.2' );\n\t\t\t\twp_register_script( 'topgroupshops-media', $this->assets_url . 'js/topgroupshops-media.js', array( 'jquery' ), '1.0' );\n\t\t\t\twp_register_script( 'sf-scripts', $this->assets_url . 'js/sf-jquery.js', array( 'jquery' ), '1.0' );\n\t\t\t\twp_register_style( 'select2', $this->assets_url . 'js/select2/select2.css' );\n\t\t\t\twp_register_style( 'sf-styles', $this->assets_url . 'css/sf-styles.css' );\n\t\t\t}\n\t\t}", "public function scripts()\n\t{\n\n\t\twp_enqueue_script('jquery');\n\n\t\t// If using the regular comments of wordpress\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\t\t//put modernizr as late as possible\n\t\twp_enqueue_script('bootstrap',DION_THEME_URL.'/assets/js/bootstrap.min.js');\n\t\twp_enqueue_script('owl-carousel',DION_THEME_URL.'/assets/js/owl.carousel.min.js');\n\t\twp_enqueue_script('darkmode','https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js');\n\t\twp_enqueue_script('main',DION_THEME_URL.'/assets/js/main.min.js');\n\t}", "function cs_style_and_scripts() {\n \n\t\twp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri() .'/public/css/vendor.css' );\n\t\twp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri() .'/public/css/app.css' );\n wp_enqueue_style( 'main-css', get_stylesheet_uri() );\n\n /*wp_enqueue_script( 'myscripts', get_stylesheet_directory_uri() . '/assets/js/app.js', '', '1.0.0', true );\n wp_localize_script('myscripts', 'cs_obj', array(\n 'ajax_url' => admin_url('admin-ajax.php'),\n ));*/\n\n }", "public function enqueue_scripts() {\n\n /**\n * All styles goes here\n */\n wp_enqueue_style( 'wp-allmeta-styles', plugins_url( 'css/style.css', __FILE__ ), false, date( 'Ymd' ) );\n\n /**\n * All scripts goes here\n */\n wp_enqueue_script( 'wp-allmeta-scripts', plugins_url( 'js/script.js', __FILE__ ), array( 'jquery' ), false, true );\n\n\n /**\n * Example for setting up text strings from Javascript files for localization\n *\n * Uncomment line below and replace with proper localization variables.\n */\n // $translation_array = array( 'some_string' => __( 'Some string to translate', 'baseplugin' ), 'a_value' => '10' );\n // wp_localize_script( 'base-plugin-scripts', 'baseplugin', $translation_array ) );\n\n }", "function pbg_scripts() {\n\n\tglobal $wp_scripts;\n\t\twp_enqueue_style ( 'mbc_bootstrap_css', get_template_directory_uri() . '/css/bootstrap.css' );\n\t\twp_enqueue_style ( 'mbc_main_css', get_template_directory_uri() . '/css/app.css' );\n\t\twp_register_script ( 'html5_shiv', 'https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js', '', '', false );\n\t\twp_register_script ( 'respond_js', 'https://oss.maxcdn.com/respond/1.4.2/respond.min.js', '', '', false );\n\t\t$wp_scripts->add_data ( 'html5_shiv', 'conditional', 'lt IE 9' );\n\t\t$wp_scripts->add_data ( 'respond_js', 'conditional', 'lt IE 9' );\n\t\twp_enqueue_script ( 'bottstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true );\n\n}", "public function enqueue_scripts() {\n\t\tif ( is_singular() ) wp_enqueue_script( 'comment-reply' );\n\n\t\twp_enqueue_style( 'app', get_template_directory_uri().'/assets/css/app.css', false, '1.0.0', 'all' );\n\t\twp_enqueue_script( 'foundation-modernizr', get_template_directory_uri().'/bower_components/foundation/js/vendor/modernizr.js', false, '', false );\n\t\twp_enqueue_script( 'foundation-fastclick', get_template_directory_uri().'/bower_components/foundation/js/vendor/fastclick.js', false, '', true );\n\t\twp_enqueue_script( 'foundation', get_template_directory_uri().'/bower_components/foundation/js/foundation.min.js', array('jquery'), '', true );\n\t\twp_enqueue_script( 'main', get_template_directory_uri().'/assets/js/main.js', array('jquery', 'foundation'), '1.0.0', true );\n\t}", "public function enqueue_scripts() {\n\t\twp_add_inline_style( 'at-main', $this->inline_css() );\n\t}", "function scripts()\n\t\t{\n//\t\t \twp_enqueue_script( 'jQuery' );\n//\t\t\twp_enqueue_script( 'WPVM_Admin_JS', WPVM_URL . '/js/wpvm_admin.js', array('jquery') );\n\t\t}", "function hugomitoire_scripts() {\n wp_enqueue_style( 'appStyles', get_template_directory_uri() . '/dist/css/style.min.css' );\n wp_enqueue_script( 'Js', get_template_directory_uri() . '/dist/js/all.js', array(), '1.0.0', true );\n wp_enqueue_script( 'Swiper', get_template_directory_uri() . '/dis/js/all.js', array(), '4.4.2', true);\n}", "function coc_scripts() {\r\n\t\t\r\n\t\twp_enqueue_script( 'script1', get_template_directory_uri() . '../bootstrap/js/bootstrap.js', array ( 'jquery' ), 1, true);\t\t\r\n\t\t\r\n\t\twp_enqueue_script( 'script2', get_template_directory_uri() . '../bootstrap/js/bootstrap.min.js', array ( 'jquery' ), 1, true);\t\r\n\t}", "function aurum_wp_enqueue_scripts() {\n\t// Styles\n\t$rtl_include = '';\n\n\twp_enqueue_style( 'icons-entypo' );\n\twp_enqueue_style( 'icons-fontawesome' );\n\twp_enqueue_style( 'bootstrap' );\n\twp_enqueue_style( 'aurum-main' );\n\t\n\tif ( ! is_child_theme() ) {\n\t\twp_enqueue_style( 'style' );\n\t}\n\n\t// Right to left bootstrap\n\tif ( is_rtl() ) {\n\t\twp_enqueue_style( array( 'bootstrap-rtl' ) );\n\t}\t\n\n\t// Custom Skin\n\tif ( get_data( 'use_custom_skin' ) ) {\n\t\tif ( false == apply_filters( 'aurum_use_filebased_custom_skin', aurum_use_filebased_custom_skin() ) ) {\n\t\t\twp_enqueue_style( 'custom-skin', site_url( '?custom-skin=1' ), null, null );\n\t\t}\n\t}\n\n\t// Scripts\n\twp_enqueue_script( array( 'jquery', 'bootstrap', 'tweenmax' ) );\n}", "function scripts() {\n\t/**\n\t * Flag whether to enable loading uncompressed/debugging assets. Default false.\n\t *\n\t * @param bool additive_script_debug\n\t */\n\t$debug = apply_filters( 'additive_script_debug', false );\n\t$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\twp_enqueue_script(\n\t\t'additive',\n\t\tADDITIVE_TEMPLATE_URL . \"/assets/js/additive{$min}.js\",\n\t\tarray(),\n\t\tADDITIVE_VERSION,\n\t\ttrue\n\t);\n}", "function scripts(){\n\n\t\t// this handy function checks a post or page to see if your component exists beore enqueueing assets\n\t\tif ( function_exists('aesop_component_exists') && aesop_component_exists('reveal') ) {\n\n\t\t\twp_enqueue_style('reveal-style', \t\tAESOP_REVEAL_URL.'/css/twentytwenty.css', AESOP_REVEAL_VERSION );\n\t\t\twp_enqueue_script('reveal-script', \t\tAESOP_REVEAL_URL.'/js/jquery.event.move.js', array('jquery'), AESOP_REVEAL_VERSION, true);\n\t\t\twp_enqueue_script('reveal-script-more', AESOP_REVEAL_URL.'/js/jquery.twentytwenty.js', array('jquery'), AESOP_REVEAL_VERSION, true);\n\n\t\t}\n\n\t}", "function pramble_script_enqueue() {\n\t\t\t\t// wp_enqueue_script( 'jquery', get_template_directory_uri() . '/bootstrap/js/jquery.min.js', array(), '1.0.0', true);\n\t\t\t\t// wp_enqueue_script( 'customjs1', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js/', array(), '1.0.0', true );\n\t\t\t\t// wp_enqueue_script( 'ieviewportbugworkaround', get_template_directory_uri() . '/assets/js/ie10-viewport-bug-workaround.js', array(), null, true);\n\t\t\t\t// wp_enqueue_style( 'customstyle', get_template_directory_uri() . '/css/pramble.css', array(), '1.0.0', 'all' ); \n\t\t\t\t// wp_enqueue_style( 'customstyle2', get_template_directory_uri() . '/bootstrap/css/bootstrap.css', array(), '1.0.0', 'all' );\n\t\t\t\t// //wp_enqueue_style( 'customstyle1', get_template_directory_uri() . '/css/foundation.css', array(), '6.0.0', 'all' );\n\t\t\t\t// //wp_enqueue_script( 'customjs', get_template_directory_uri() . '/js/pramble.js/', array(), '1.0.0', true );\n\n\t\t\t // enqueue the scripts for the site//\n\t\t\t\t\t\twp_deregister_script( 'jquery' );\n\t\t\t wp_enqueue_script( 'jquery', get_template_directory_uri() . '/assets/js/jquery.min.js', false, null, true);// the true arg tells wordpress to load the js in before the closing head tag\n\n\t\t\t wp_deregister_script( 'bootstrap' );\n\t\t\t wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', false, null, true);\n\n\t\t\t wp_deregister_script( 'ieviewportbugworkaround' );\n\t\t\t wp_enqueue_script( 'ieviewportbugworkaround', get_template_directory_uri() . '/assets/js/ie10-viewport-bug-workaround.js', false, null, true);\n\n\t \n\n\t wp_deregister_style( 'bootstrap' );\n\t wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/bootstrap/css/bootstrap.css', false, null, 'all');\n\t wp_enqueue_style( 'customstyle', get_template_directory_uri() . '/css/pramble.css', array(), '1.0.0', 'all' ); \n\t\t\t\t\n\t\t}", "function starkers_script_enqueuer() {\n\t\twp_register_script( 'site', get_template_directory_uri().'/js/scripts.min.js', array( 'jquery' ) );\n\t\twp_enqueue_script( 'site' );\n\n\t\twp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css', '', '', 'screen' );\n\t\twp_enqueue_style( 'screen' );\n\t}", "function rhapsody_scripts() {\n\twp_enqueue_style( 'rhapsody-style', get_stylesheet_uri() );\n\n if (!is_admin()) add_action(\"wp_enqueue_scripts\", \"wrmc_jquery_enqueue\", 11);\n function wrmc_jquery_enqueue() {\n wp_deregister_script('jquery');\n wp_register_script('jquery', \"http\" . ($_SERVER['SERVER_PORT'] == 443 ? \"s\" : \"\") . \"://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\", false, null);\n wp_enqueue_script('jquery');\n }\n\n wp_enqueue_script( 'rhapsody-modernizr', get_template_directory_uri() . '/assets/js/modernizr.custom.js',array(), '3.3.1', false);\n wp_enqueue_script( 'rhapsody-app', get_template_directory_uri() . '/assets/js/all.js', array(), '1.0.0', true );\n\n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}", "public function add_scripts_and_styles()\n {\n // Estilos css \n wp_register_style( 'wiAjustesStyles', WI_PLUGIN_URL . '/style.css', null, WI_VERSION );\n wp_enqueue_style( 'wiAjustesStyles' );\n\n // Scripts de javascript\n wp_enqueue_script('wiAjustesStylesJs', WI_PLUGIN_URL . '/script.js' , array('jquery'));\n }", "function wordpressboilerplate_scripts (){\n wp_enqueue_style( 'wordpressboilerplate-style', get_stylesheet_uri() );\n wp_enqueue_script( 'wordpressboilerplate-script', get_template_directory_uri() . 'js/main.js', array( 'jquery' ) );\n\n wp_register_style('animate.css', get_stylesheet_uri() . 'assets/vendor/font-awesome/css/font-awesome.min.css');\n}", "public function enqueue_scripts() {\n wp_enqueue_style( $this->name, plugins_url( '/assets/css/admin.css', IMFILE ), '', $this->version, 'all' );\n \n wp_enqueue_script( 'jquery' );\n wp_enqueue_script( $this->name, plugins_url( '/assets/js/admin.js', IMFILE ), array( 'jquery' ), $this->version, true );\n }", "function artistpress_scripts() {\n\t\twp_enqueue_style( 'reset', get_template_directory_uri() . '/css/reset.css', array(), '2.0' );\n\t\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.7' );\n\t\twp_enqueue_style( 'main_style', get_template_directory_uri() . '/style.css' );\n\t\twp_enqueue_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', array(), '1.11.3', true );\n\t\twp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.6', true );\n\t\twp_register_script( 'load', get_template_directory_uri() . '/js/load.js' );\n\n\t\t//localize params for use in load.js\n\t\t$theme_params = array(\n\t\t 'backround_image' => get_option('backround_image'),\n\t\t 'action_url' => get_option('action_url'),\n\t\t);\n\n\t\twp_localize_script( 'load', 'themeParams', $theme_params );\n\n\t\twp_enqueue_script( 'load', get_template_directory_uri() . '/js/load.js', array( 'jquery' ,'bootstrap'), '1', true );\n\t}", "function flexiauto_scripts_loader() {\n\t\t/* Load custom styles */\n\t\twp_enqueue_style('reset', TPL_DIR . '/assets/css/vendor/reset.css');\n\t\twp_enqueue_style('bootstrap-styles', TPL_DIR . '/assets/css/vendor/bootstrap.min.css');\n\t\twp_enqueue_style('flexi-styles', TPL_DIR . '/assets/css/flexi.min.css');\n\n\t\t/* Load custom scripts */\n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery', TPL_DIR . '/assets/js/vendor/jquery.min.js', array(), false, true);\n\t\twp_enqueue_script('jquery');\n\n\t\twp_enqueue_script('bootstrap-scripts', TPL_DIR . '/assets/js/vendor/bootstrap.min.js', array(), false, true);\n\t\twp_enqueue_script('nicescroll', TPL_DIR . '/assets/js/vendor/jquery.nicescroll.min.js', array(), false, true);\n\t\twp_enqueue_script('jquery-validate', TPL_DIR . '/assets/js/vendor/jquery.validate.min.js', array(), false, true);\n\t\twp_enqueue_script('match-height', TPL_DIR . '/assets/js/vendor/jquery.matchHeight.min.js', array(), false, true);\n\t\twp_enqueue_script('flexi-scripts', TPL_DIR . '/assets/js/flexi.min.js', array(), false, true);\n\n\t}", "public function public_enqueue_scripts() {\n wp_enqueue_script( 'jquery_focuspoint', plugin_dir_url( __FILE__ ) . 'js/jquery.focuspoint.min.js', array('jquery'), $this->version, true );\n wp_enqueue_script( 'wp_focuslock', plugin_dir_url( __FILE__ ) . 'js/wp-focuslock.js', array('jquery', 'jquery_focuspoint'), $this->version, true );\n }", "function boiler_scripts_styles() {\n\t// style.css just initializes the theme. This is compiled from /sass\n\twp_enqueue_style( 'main-style', get_template_directory_uri() . '/css/main.css');\n\n\twp_enqueue_script( 'jquery' , array(), '', true );\n\n\twp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/vendor/flowtype.js', '2.6.2', true );\n\t\n\twp_enqueue_script( 'flowtype', get_template_directory_uri() . '/js/vendor/modernizr-2.6.2.min.js', '1.1', true );\n\n\twp_enqueue_script( 'boiler-plugins', get_template_directory_uri() . '/js/plugins.js', array(), '20120206', true );\n\n\twp_enqueue_script( 'boiler-main', get_template_directory_uri() . '/js/main.js', array(), '20120205', true );\n\n}", "function scripts() {\n\twp_register_script(\n\t\t'bootstrap',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/bootstrap/dist/js/bootstrap.min.js\",\n\t\tarray( 'jquery' ),\n\t\tVINCENTRAGOSTA_COM_VERSION,\n\t\ttrue\n\t);\n\n\twp_enqueue_script(\n\t\t'vincentragosta_com',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/js/vincentragosta---twenty-seventeen.js\",\n\t\tarray( 'jquery', 'bootstrap' ),\n\t\tVINCENTRAGOSTA_COM_VERSION,\n\t\ttrue\n\t);\n\n\twp_localize_script( 'vincentragosta_com', 'themeUrl', VINCENTRAGOSTA_COM_TEMPLATE_URL );\n}", "static function print_scripts(){\n\t\twp_register_style('athlates-board-white-board', ATHLATESWHITEBOARD_URL . 'css/white-board.css');\n\t\twp_enqueue_style('athlates-board-white-board');\n\t\t\n\t\t//js\n\t\twp_enqueue_script('jquery');\n\t\twp_register_script('athlates_white_board_jquery', ATHLATESWHITEBOARD_URL . 'js/Cf-front-end.js', array('jquery'));\n\t\twp_enqueue_script('athlates_white_board_jquery');\n\t\t\n\t\twp_localize_script('athlates_white_board_jquery', 'AthlatesAjax', array( \n\t\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' )\n\t\t));\n\t}", "function grd_scripts() {\n\twp_enqueue_style( 'main-style', get_stylesheet_uri() );\n\tif( !is_admin() ) {\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'modernizr', get_template_directory_uri() . '/bower_components/modernizr/modernizr.js', array('jquery'), NULL, true );\n\t\twp_enqueue_script( 'plugins', get_template_directory_uri() . '/assets/scripts/plugins.min.js', array('jquery'), NULL, true );\n\t\twp_enqueue_script( 'scripts', get_template_directory_uri() . '/assets/scripts/main.min.js', array('jquery'), NULL, true );\n\t\tif( DEV ) {\n\t\t\twp_enqueue_script( 'livereload', '//localhost:35729/livereload.js', NULL, NULL, true);\n\t\t}\n\t}\n}", "function theme_scripts() {\n\t\twp_enqueue_style('bootstrap-css', get_template_directory_uri().'/styles/bootstrap/css/bootstrap.min.css');\n\t\twp_enqueue_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js');\n\t\twp_enqueue_script('bootstrap-js', get_template_directory_uri().'/styles/bootstrap/js/bootstrap.min.js');\n\t\twp_enqueue_script('custom-js', get_template_directory_uri().'/js/functions.js');\n\t}", "function green_shortcodes_vc_scripts_admin() {\n\t\t// Include CSS \n\t\tgreen_enqueue_style ( 'shortcodes_vc-style', green_get_file_url('shortcodes/shortcodes_vc_admin.css'), array(), null );\n\t\t// Include JS\n\t\tgreen_enqueue_script( 'shortcodes_vc-script', green_get_file_url('shortcodes/shortcodes_vc_admin.js'), array(), null, true );\n\t}", "function _s_scripts() {\n\twp_enqueue_style( '_s-style', get_stylesheet_uri() );\n\n\twp_enqueue_script( '_s-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\n wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array( 'jquery' ), 'v3.3.5', true );\n}", "public function admin_scripts() {\n wp_enqueue_script('jquery-ui-sortable');\n wp_enqueue_script('postbox');\n wp_enqueue_script('jquery-form-validation', SWPM_FORM_BUILDER_URL . '/js/jquery.validate.min.js', array('jquery'), '1.9.0', true);\n wp_enqueue_script('swpm-admin', SWPM_FORM_BUILDER_URL . \"/js/swpm-admin$this->load_dev_files.js\", array('jquery', 'jquery-form-validation'), '20140412', true);\n wp_enqueue_script('nested-sortable', SWPM_FORM_BUILDER_URL . \"/js/jquery.ui.nestedSortable$this->load_dev_files.js\", array('jquery', 'jquery-ui-sortable'), '1.3.5', true);\n\n wp_enqueue_style('swpm-form-builder-style', SWPM_FORM_BUILDER_URL . \"/css/swpm-form-builder-admin$this->load_dev_files.css\", array(), '20140412');\n\n wp_localize_script('swpm-admin', 'SwpmAdminPages', array('swpm_pages' => $this->_admin_pages));\n }", "public function enqueue_scripts() {\n\n\t\t$pointers = array();\n\n\t\tforeach ( $this->pointers as $pointer ) {\n\n\t\t\tif ( current_user_can( $pointer['cap'] ) ) {\n\n\t\t\t\t$pointers[] = $pointer;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( ! $pointers ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t$suffix = SCRIPT_DEBUG ? '' : '.min';\n\n\t\twp_enqueue_style( 'wp-pointer' );\n\n\t\twp_enqueue_script( 'wp-pointer' );\n\t\twp_enqueue_script(\n\t\t\t'bb-booster-pointers',\n\t\t\tFL_BUILDER_BOOSTER_URL . \"assets/js/pointers{$suffix}.js\",\n\t\t\tarray( 'jquery', 'wp-pointer' ),\n\t\t\t'0.0.1',\n\t\t\ttrue\n\t\t);\n\n\t\t$js_vars = array(\n\t\t\t'pointers' => $pointers,\n\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' ),\n\t\t);\n\n\t\twp_localize_script( 'bb-booster-pointers', 'bb_booster', $js_vars );\n\n\t}", "function ka_enqueue_scripts() {\n\n /* Adiciona o script principal do tema */\n wp_enqueue_script( 'main', get_bundle_file( 'assets/js/dist/', 'index.*.js' ) , null, null, true );\n }", "function prosody_plugin_queue_scripts ()\n{\n\n wp_enqueue_style(\n 'poem-css',\n plugin_dir_url( __FILE__ ) . 'css/poem.css',\n array(),\n null,\n false\n );\n\n wp_register_script(\n 'handlers.js',\n plugins_url('js/handlers.js', __FILE__),\n array(),\n null,\n true\n );\n // Localize the script to pass in the siteurl\n wp_localize_script('handlers.js', 'WPURLS', array( 'siteurl' => home_url() ));\n wp_enqueue_script( 'handlers.js' );\n}", "function bootstrap_scripts() {\n\t\t\tif ( ! is_admin() ) {\n\n\t\t\t\t// Twitter Bootstrap CSS.\n\t\t\t\twp_register_style( 'bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', '', null, 'all' );\n\t\t\t\twp_enqueue_style( 'bootstrap' );\n\n\t\t\t\t// Load jQuery.\n\t\t\t\twp_enqueue_script( 'jquery' );\n\n\t\t\t\t// Twitter Bootstrap Javascript.\n\t\t\t\twp_register_script( 'bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', 'jquery', null, true );\n\t\t\t\twp_enqueue_script( 'bootstrap' );\n\n\t\t\t\t// Google Webfont.\n\t\t\t\twp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', null, null, true );\n\t\t\t\twp_enqueue_script( 'webfont' );\n\n\t\t\t\t// Load Font Awesome via Google Webfont.\n\t\t\t\twp_add_inline_script( 'webfont', 'WebFont.load({custom:{families:[\"font-awesome\"],urls:[\"https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css\"]}});' );\n\n\t\t\t}\n\t\t}", "function asc_enqueue_scripts() {\n\t/**\n\t * Fires when scripts and styles are enqueued.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'asc_enqueue_scripts' );\n}", "public function enqueue_scripts() {\n\t\twp_enqueue_style( 'pt-style', plugins_url( 'assets/css/style.css', __FILE__ ), array(), '1.0.0', false );\n\n\t\twp_enqueue_script( 'pt-script', plugins_url( 'assets/js/script.js', __FILE__ ), array(), '1.0.0', true );\n\t}", "function pulcherrimum_scripts()\n {\n\n // Add custom fonts, used in the main stylesheet.\n wp_enqueue_style('pulcherrimum-fonts', pulcherrimum_fonts_url(), array(), null);\n\n // Theme stylesheet.\n wp_enqueue_style('pulcherrimum-style', get_stylesheet_uri(), array(), '20190507');\n\n // Bootstrap & Fonts\n wp_enqueue_script('jquery', get_theme_file_uri('/assets/js/jquery.js'), array( 'jquery' ), null, true);\n wp_enqueue_style('bootstrap-css', get_theme_file_uri('/assets/css/bootstrap.min.css'), array( 'pulcherrimum-style' ), '1.0.0', 'all');\n wp_enqueue_style('font-css', get_theme_file_uri('/assets/css/fonts.css'), array( 'pulcherrimum-fonts' ), null);\n wp_enqueue_script('bootstrap-js', get_theme_file_uri('/assets/js/bootstrap.bundle.min.js'), array( 'jquery' ), null, true);\n wp_enqueue_script('jquery-easing', get_theme_file_uri('/assets/js/jquery.easing.min.js'), array( 'jquery' ), null, true);\n wp_enqueue_script('main-js', get_theme_file_uri('/assets/js/main.js'), array( 'jquery' ), null, true);\n }", "function enqueue_script() {\n\t\twp_enqueue_script( 'aztec-vendors-script', get_stylesheet_directory_uri() . '/assets/vendor.js', [], false, true );\n\t\twp_enqueue_script( 'aztec-script', get_stylesheet_directory_uri() . '/assets/app.js', [ 'aztec-vendors-script', 'jquery' ], false, true );\n\t}", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "function basel_enqueue_scripts() {\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) )\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t\n\t\twp_register_script( 'maplace', get_template_directory_uri() . '/js/maplace-0.1.3.min.js', array('jquery', 'google.map.api'), '', true );\n\t\t\n\t\tif( ! basel_woocommerce_installed() )\n\t\t\twp_register_script( 'jquery-cookie', get_template_directory_uri() . '/js/jquery.cookie.js', array('jquery'), '1.4.1', true );\n\n\t\twp_enqueue_script( 'basel_html5shiv', get_template_directory_uri() . '/js/html5.js' );\n\t\twp_script_add_data( 'basel_html5shiv', 'conditional', 'lt IE 9' );\n\n\t\twp_dequeue_script( 'flexslider' );\n\t\twp_dequeue_script( 'photoswipe-ui-default' );\n\t\twp_dequeue_script( 'prettyPhoto-init' );\n\t\twp_dequeue_style( 'photoswipe-default-skin' );\n\n\t\tif( basel_get_opt( 'image_action' ) != 'zoom' ) {\n\t\t\twp_dequeue_script( 'zoom' );\n\t\t}\n\n\t\twp_enqueue_script( 'isotope', get_template_directory_uri() . '/js/isotope.pkgd.min.js', array( 'jquery' ), '', true );\n\t\twp_enqueue_script( 'waypoints' );\n\t\twp_enqueue_script( 'wpb_composer_front_js' );\n\n\t\tif( basel_get_opt( 'minified_js' ) ) {\n\t\t\twp_enqueue_script( 'basel-theme', get_template_directory_uri() . '/js/theme.min.js', array( 'jquery', 'jquery-cookie' ), '', true );\n\t\t} else {\n\t\t\twp_enqueue_script( 'basel-libraries', get_template_directory_uri() . '/js/libraries.js', array( 'jquery', 'jquery-cookie' ), '', true );\n\t\t\twp_enqueue_script( 'basel-functions', get_template_directory_uri() . '/js/functions.js', array( 'jquery', 'jquery-cookie' ), '', true );\n\t\t}\n\n\t\t// Add virations form scripts through the site to make it work on quick view\n\t\tif( basel_get_opt( 'quick_view_variable' ) ) {\n\t\t\twp_enqueue_script( 'wc-add-to-cart-variation' );\n\t\t}\n\n\n\t\t$translations = array(\n\t\t\t'adding_to_cart' => esc_html__('Processing', 'basel'),\n\t\t\t'added_to_cart' => esc_html__('Product was successfully added to your cart.', 'basel'),\n\t\t\t'continue_shopping' => esc_html__('Continue shopping', 'basel'),\n\t\t\t'view_cart' => esc_html__('View Cart', 'basel'),\n\t\t\t'go_to_checkout' => esc_html__('Checkout', 'basel'),\n\t\t\t'loading' => esc_html__('Loading...', 'basel'),\n\t\t\t'countdown_days' => esc_html__('days', 'basel'),\n\t\t\t'countdown_hours' => esc_html__('hr', 'basel'),\n\t\t\t'countdown_mins' => esc_html__('min', 'basel'),\n\t\t\t'countdown_sec' => esc_html__('sc', 'basel'),\n\t\t\t'loading' => esc_html__('Loading...', 'basel'),\n\t\t\t'wishlist' => ( class_exists( 'YITH_WCWL' ) ) ? 'yes' : 'no',\n\t\t\t'cart_url' => ( basel_woocommerce_installed() ) ? esc_url( WC()->cart->get_cart_url() ) : '',\n\t\t\t'ajaxurl' => admin_url('admin-ajax.php'),\n\t\t\t'add_to_cart_action' => ( basel_get_opt( 'add_to_cart_action' ) ) ? esc_js( basel_get_opt( 'add_to_cart_action' ) ) : 'widget',\n\t\t\t'categories_toggle' => ( basel_get_opt( 'categories_toggle' ) ) ? 'yes' : 'no',\n\t\t\t'enable_popup' => ( basel_get_opt( 'promo_popup' ) ) ? 'yes' : 'no',\n\t\t\t'popup_delay' => ( basel_get_opt( 'promo_timeout' ) ) ? (int) basel_get_opt( 'promo_timeout' ) : 1000,\n\t\t\t'popup_event' => basel_get_opt( 'popup_event' ),\n\t\t\t'popup_scroll' => ( basel_get_opt( 'popup_scroll' ) ) ? (int) basel_get_opt( 'popup_scroll' ) : 1000,\n\t\t\t'popup_pages' => ( basel_get_opt( 'popup_pages' ) ) ? (int) basel_get_opt( 'popup_pages' ) : 0,\n\t\t\t'promo_popup_hide_mobile' => ( basel_get_opt( 'promo_popup_hide_mobile' ) ) ? 'yes' : 'no',\n\t\t\t'product_images_captions' => ( basel_get_opt( 'product_images_captions' ) ) ? 'yes' : 'no',\n\t\t\t'all_results' => __('View all results', 'basel'),\n\t\t\t'product_gallery' => basel_get_product_gallery_settings(),\n\t\t\t'zoom_enable' => ( basel_get_opt( 'image_action' ) == 'zoom') ? 'yes' : 'no',\n\t\t\t'ajax_scroll' => ( basel_get_opt( 'ajax_scroll' ) ) ? 'yes' : 'no',\n\t\t\t'ajax_scroll_class' => apply_filters( 'basel_ajax_scroll_class' , '.main-page-wrapper' ),\n\t\t\t'ajax_scroll_offset' => apply_filters( 'basel_ajax_scroll_offset' , 100 ),\n\t\t\t'product_slider_auto_height' => ( apply_filters( 'basel_product_slider_auto_height' , false ) ) ? 'yes' : 'no',\n\t\t);\n\n\t\twp_localize_script( 'basel-functions', 'basel_settings', $translations );\n\t\twp_localize_script( 'basel-theme', 'basel_settings', $translations );\n\t\t\n\t\tif( ( is_home() || is_singular( 'post' ) || is_archive() ) && basel_get_opt('blog_design') == 'masonry' ) {\n\t\t\t// Load masonry script JS for blog\n\t\t\twp_enqueue_script( 'masonry' );\n\t\t}\n\n\t}", "function load_custom_scripts() {\n\t//slidebars\n\twp_enqueue_script('slidebars', THEMEROOT . '/js/slidebars.min.js', array('jquery'), '0.13.3', true);\n\t//bootstrap\n\twp_enqueue_script('bootstrap', THEMEROOT . '/js/bootstrap.min.js', array('jquery'), '3.3.6', true);\n\t//fancybox\n\twp_enqueue_script('fancybox', THEMEROOT . '/js/jquery.fancybox.pack.js', array('jquery'), '2.1.5', true);\n\t//valitate\n\twp_enqueue_script('validate', THEMEROOT . '/js/jquery.validate.min.js', array('jquery'), '1.15', true);\n\t\n\t//script\n\twp_enqueue_script('custom_script', THEMEROOT . '/js/scripts.js', array('jquery'), false, true);\n}" ]
[ "0.8028386", "0.79055953", "0.7874491", "0.7796937", "0.77163374", "0.7711536", "0.77052784", "0.7704426", "0.76657087", "0.7638913", "0.7585113", "0.7577145", "0.7539598", "0.75367844", "0.7527145", "0.75268215", "0.7526797", "0.7494318", "0.7468796", "0.7452899", "0.7438439", "0.7427703", "0.74203175", "0.74065495", "0.7399407", "0.737834", "0.73767465", "0.7364669", "0.7364002", "0.7358584", "0.7358471", "0.73479337", "0.73422885", "0.733687", "0.73285806", "0.7327767", "0.730938", "0.73092246", "0.73089325", "0.7285587", "0.72843164", "0.72810686", "0.72810686", "0.72762364", "0.72752124", "0.7273003", "0.72652847", "0.726299", "0.72579736", "0.7257267", "0.72532094", "0.7245193", "0.7235937", "0.72352356", "0.7231969", "0.72256374", "0.7223696", "0.7223626", "0.7214831", "0.7210007", "0.72098684", "0.7208092", "0.7199649", "0.7192109", "0.7191392", "0.7191", "0.7188285", "0.71744716", "0.71743935", "0.7171407", "0.7171319", "0.71710336", "0.71700263", "0.71699846", "0.7160582", "0.71592295", "0.7157273", "0.7156156", "0.7148039", "0.71407557", "0.7140358", "0.7137694", "0.7135456", "0.7129655", "0.71287066", "0.71270573", "0.7126214", "0.71259636", "0.712426", "0.71158", "0.7101435", "0.70987064", "0.7097998", "0.7097998", "0.7097998", "0.7097998", "0.7097998", "0.7097998", "0.7097998", "0.70936245", "0.7091541" ]
0.0
-1
\ Content functions \ Displays meta information for a post
function boom_post_meta() { if ( get_post_type() == 'post' ) { echo sprintf( __( 'Posted %s in %s%s by %s. ', 'boom' ), get_the_time( get_option( 'date_format' ) ), get_the_category_list( ', ' ), get_the_tag_list( __( ', <b>Tags</b>: ', 'boom' ), ', ' ), get_the_author_link() ); } edit_post_link( __( ' (edit)', 'boom' ), '<span class="edit-link">', '</span>' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function et_divi_post_meta() {\n\t\t$pages = array(\n\t\t\tintval( \\SermonManager::getOption( 'smp_archive_page', 0 ) ),\n\t\t\tintval( \\SermonManager::getOption( 'smp_tax_page', 0 ) ),\n\t\t);\n\t\tif ( in_array( get_the_ID(), $pages ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$postinfo = is_single() ? et_get_option( 'divi_postinfo2' ) : et_get_option( 'divi_postinfo1' );\n\n\t\tif ( $postinfo ) :\n\t\t\techo '<p class=\"post-meta\">';\n\t\t\techo et_pb_postinfo_meta( $postinfo, et_get_option( 'divi_date_format', 'M j, Y' ), esc_html__( '0 comments', 'Divi' ), esc_html__( '1 comment', 'Divi' ), '% ' . esc_html__( 'comments', 'Divi' ) );\n\t\t\techo '</p>';\n\t\tendif;\n\t}", "function fumseck_pagemeta() {\n\t\n\t// Initialize\n\t\n\t$output = '';\n\tglobal $post;\n\t$post_id = $post->ID;\n\t\n\t\n\t// Get metadata for the page from WordPress\n\t\n\t$post_title = get_the_title($post_id);\n\t$post_permalink = get_permalink($post_id);\n\t\n\t$post_has_featured_image = has_post_thumbnail( $post_id );\n\t\n\tif( $post_has_featured_image ) {\n\t\t$post_featured_image_large = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large'); // [URL, w, h, resized?]\n\t};\n\t\n\t$post_summary = wp_strip_all_tags( get_field( '_summary', $post_id, true ));\n\t\n\t\n\tif ( ! $post_summary ) {\t\t// if no summary, try a manual excerpt\n\t\t$post_summary = $post->post_excerpt;\n\t};\t// TODO: do something if there's no manual excerpt either\n\n\t\n\t// Static metadata\n\t\n\t$output .= '<meta name=\"twitter:site\" content=\"@gpaumier\"><meta name=\"twitter:creator\" content=\"@gpaumier\">';\t\n\t$output .= '<meta name=\"twitter:domain\" content=\"guillaumepaumier.com\">';\t\n\t$output .= '<meta property=\"fb:admins\" content=\"710543474\" />';\n\t//$output .= '<meta property=\"fb:admins\" content=\"579323492087704\" />';\n\t$output .= '<meta property=\"article:author\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t$output .= '<meta property=\"article:publisher\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t\n\t$output .= '<meta property=\"og:type\" content=\"article\" />'; // TODO: be more specific\n\t\n\t// Common metadata\n\t\n\t$output .= '<meta property=\"og:site_name\" content=\"' . get_bloginfo( 'name' ) . '\"/>';\n\t\n\t$output .= '<meta name=\"twitter:title\" content=\"' . $post_title . '\">';\n\t$output .= '<meta property=\"og:title\" content=\"' . $post_title . '\"/>';\n\t\n\t\n\t$output .= '<meta property=\"og:url\" content=\"' . $post_permalink . '\" />';\n\t\n\t\n\t$output .= '<meta property=\"og:description\" content=\"' . $post_summary . '\" />';\n\t\n\t// TODO: add locale\n\t\n\tif ( get_post_format( $post_id ) === 'image' ) {\n\t\t\n\t\t$output .= '<meta name=\"twitter:card\" content=\"photo\">';\n\t\t$output .= '<meta name=\"twitter:image\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:width\" content=\"' . $post_featured_image_large[1] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:height\" content=\"' . $post_featured_image_large[2] . '\">';\n\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\n\t} else {\t// Not a photo\n\t\t\n\t\t$output .= '<meta name=\"twitter:description\" content=\"' . $post_summary . '\">';\n\t\t\n\t\tif( $post_has_featured_image ) {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary_large_image\">';\n\t\t\t$output .= '<meta name=\"twitter:image:src\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t\t$output .= '<meta property=\"og:image\" content=\"' . $post_featured_image_large[0] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary\">';\n\t\t}\n\t\t\n\t};\n\t\n\n\techo $output;\n}", "function tcsn_post_meta() {\n\n\tglobal $post;\n\tif ( ! is_page() && 'page' != $post->post_type ) {\n\t\t$post_footer_metadata = ( get_post_format() ? '<a class=\"post-format-meta\" href=\"' . get_post_format_link( get_post_format() ) . '\">' . get_post_format_string( get_post_format() ) . '</a>' : '' \t\t);\n\t} \n\t\techo '<span class=\"post-meta\">' . $post_footer_metadata. '</span>'; \n\t\t\n\t// Post author\n\tif ( 'post' == get_post_type() ) {\n\t\tprintf( 'By <span class=\"author vcard margin-less\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span><span class=\"text-sep\">/</span>',\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'tcsn_theme' ), get_the_author() ) ),\n\t\t\tget_the_author()\n\t\t);\n\t}\n\t\n\t// Post date\n\tif ( ! has_post_format( 'link' ) && 'post' == get_post_type() )\n\t\ttcsn_post_date();\n\t\t\n\t// Categories\n\t$categories_list = get_the_category_list( __( ', ', 'tcsn_theme' ) );\n\tif ( $categories_list ) {\n\t\techo 'in <span class=\"categories-links\">' . $categories_list . '</span>';\n\t}\n\t\n\t// Tags\n\tif ( ! is_single() ) {\n\t\t$tag_list = get_the_tag_list( '', __( ', ', 'tcsn_theme' ) );\n\t\tif ( $tag_list ) {\n\t\t\techo '<span class=\"text-sep\">/</span> tags <span class=\"tags-links\">' . $tag_list . '</span>';\n\t\t}\n\t}\n\t\n\telse {\n\t\t$tag_list = get_the_tag_list( '', __( ', ', 'tcsn_theme' ) );\n\t if ( $tag_list ) {\n\t\techo '<span class=\"text-sep\">/</span> tags <span class=\"tags-links\">' . $tag_list . '</span>';\n\t } \n\t}\n}", "function meta_html($post)\n {\n $view = new Xby2BaseView(get_post_meta($post->ID));\n $view->addInput('text', 'link-label', 'Label: ', 'label', 'regular-text');\n $view->addInput('text', 'link-link', 'Link: ', 'link', 'large-text');\n $view->addInput('text', 'link-priority', 'Priority: ', 'priority', 'regular-text');\n $view->displayForm();\n }", "function gos_post_meta() {\n if ( get_post_type() == 'post' ) {\n echo sprintf(\n __( 'Posted %s in %s%s by %s. ', 'gos' ),\n get_the_time( get_option( 'date_format' ) ),\n get_the_category_list( ', ' ),\n get_the_tag_list( __( ', <b>Tags</b>: ', 'gos' ), ', ' ),\n get_the_author_link()\n );\n }\n edit_post_link( __( ' (edit)', 'gos' ), '<span class=\"edit-link\">', '</span>' );\n}", "function fl_blog_post_meta() {\n\tif(is_page()) return; // don't do post-meta on pages\n?>\t\t\n<div class=\"content-bar iconfix\">\n\t<p class=\"meta\">\n\t\t<span><i class=\"icon-calendar\"></i><?php echo get_the_date(get_option('date_format')); ?></span>\n\t\t<span><i class=\"icon-folder-open\"></i><?php the_category(', '); ?></span>\n\t</p>\n\t<p class=\"comment-count\"><i class=\"icon-comments\"></i><?php comments_popup_link( __( '0 Comments', APP_TD ), __( '1 Comment', APP_TD ), __( '% Comments', APP_TD ) ); ?></p>\n</div>\n<?php\n}", "function absolvution_post_meta() {\n if ( get_post_type() == 'post' ) {\n echo sprintf(\n __( '<div class=\"meta-container date-posted\">Posted %s </div><div class=\"meta-container cat\"><span class=\"sep cat\"></span> %s </div><div class=\"meta-container tag \"><span class=\"sep tag\"></span> %s </div>', 'absolvution' ),\n get_the_time( get_option( 'date_format' ) ),\n get_the_category_list( ', ' ),\n get_the_tag_list( __( '', 'absolvution' ), ', ' )\n );\n }\n edit_post_link( __( ' (edit)', 'absolvution' ), '<span class=\"edit-link\">', '</span>' );\n}", "function tc_post_metas() {\r\n global $post;\r\n //when do we display the metas ?\r\n //1) we don't show metas on home page, 404, search page by default\r\n //2) +filter conditions\r\n $post_metas_bool = ( tc__f('__is_home') || is_404() || 'page' == $post -> post_type ) ? false : true ;\r\n $post_metas_bool = apply_filters('tc_show_post_metas', $post_metas_bool ); \r\n \r\n if ( ! $post_metas_bool )\r\n return;\r\n\r\n ob_start();\r\n ?>\r\n\r\n <div class=\"entry-meta\">\r\n <?php\r\n if ( 'attachment' == $post -> post_type ) {\r\n $metadata = wp_get_attachment_metadata();\r\n printf( '%1$s <span class=\"entry-date\"><time class=\"entry-date updated\" datetime=\"%2$s\">%3$s</time></span> %4$s %5$s',\r\n '<span class=\"meta-prep meta-prep-entry-date\">'.__('Published' , 'customizr').'</span>',\r\n apply_filters('tc_use_the_post_modified_date' , false ) ? esc_attr( get_the_date( 'c' ) ) : esc_attr( get_the_modified_date('c') ),\r\n esc_html( get_the_date() ),\r\n ( isset($metadata['width']) && isset($metadata['height']) ) ? __('at dimensions' , 'customizr').'<a href=\"'.esc_url( wp_get_attachment_url() ).'\" title=\"'.__('Link to full-size image' , 'customizr').'\"> '.$metadata['width'].' &times; '.$metadata['height'].'</a>' : '',\r\n __('in' , 'customizr').'<a href=\"'.esc_url( get_permalink( $post->post_parent ) ).'\" title=\"'.__('Return to ' , 'customizr').esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ).'\" rel=\"gallery\"> '.get_the_title( $post->post_parent ).'</a>.'\r\n );\r\n }\r\n\r\n else {\r\n\r\n $categories_list = $this -> tc_category_list();\r\n\r\n $tag_list = $this -> tc_tag_list();\r\n\r\n $date = apply_filters( 'tc_date_meta',\r\n sprintf( '<a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date updated\" datetime=\"%3$s\">%4$s</time></a>' ,\r\n esc_url( get_day_link( get_the_time( 'Y' ), get_the_time( 'm' ), get_the_time( 'd' ) ) ),\r\n esc_attr( get_the_time() ),\r\n apply_filters('tc_use_the_post_modified_date' , false ) ? esc_attr( get_the_date( 'c' ) ) : esc_attr( get_the_modified_date('c') ),\r\n esc_html( get_the_date() )\r\n )\r\n );//end filter\r\n\r\n $author = apply_filters( 'tc_author_meta',\r\n sprintf( '<span class=\"author vcard\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>' ,\r\n esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\r\n esc_attr( sprintf( __( 'View all posts by %s' , 'customizr' ), get_the_author() ) ),\r\n get_the_author()\r\n )\r\n );//end filter\r\n\r\n // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.\r\n $utility_text = '';\r\n if ( $tag_list ) {\r\n $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class=\"by-author\"> by %4$s</span>.' , 'customizr' );\r\n } elseif ( $categories_list ) {\r\n $utility_text = __( 'This entry was posted in %1$s on %3$s<span class=\"by-author\"> by %4$s</span>.' , 'customizr' );\r\n } else {\r\n $utility_text = __( 'This entry was posted on %3$s<span class=\"by-author\"> by %4$s</span>.' , 'customizr' );\r\n }\r\n $utility_text = apply_filters( 'tc_meta_utility_text', $utility_text );\r\n\r\n //echoes every metas components\r\n printf(\r\n $utility_text,\r\n $categories_list,\r\n $tag_list,\r\n $date,\r\n $author\r\n );\r\n }//endif attachment\r\n ?>\r\n\r\n </div><!-- .entry-meta -->\r\n\r\n <?php\r\n $html = ob_get_contents();\r\n if ($html) ob_end_clean();\r\n echo apply_filters( 'tc_post_metas', $html );\r\n }", "function cosmetics_post_meta() {\n?>\n\n <div class=\"site-post-meta\">\n <span class=\"site-post-author\">\n <?php echo esc_html__('Author:','cosmetics');?>\n <a href=\"<?php echo get_author_posts_url( get_the_author_meta('ID') );?>\">\n <?php the_author();?>\n </a>\n </span>\n\n <span class=\"site-post-date\">\n <?php esc_html_e( 'Post date: ','cosmetics' ); the_date(); ?>\n </span>\n\n <span class=\"site-post-comments\">\n <?php\n comments_popup_link( '0 '. esc_html__('Comment','cosmetics'),'1 '. esc_html__('Comment','cosmetics'), '% '. esc_html__('Comments','cosmetics') );\n ?>\n </span>\n </div>\n\n<?php\n }", "function roots_entry_meta() {\n echo '<em class=\"meta-entry\"><i class=\"icon-calendar pull-left\"></i><time class=\"updated pull-left\" datetime=\"'. get_the_time('c') .'\" pubdate>'. sprintf(__('Posted on %s at %s.', 'roots'), get_the_date(), get_the_time()) .'</time><span class=\"pull-right\">' .comments_number( 'No comments', 'One comment', '% comment' ) .'</span></em>';\n\n //echo '<p class=\"byline author vcard\">'. __('Written by', 'roots') .' <a href=\"'. get_author_posts_url(get_the_author_meta('ID')) .'\" rel=\"author\" class=\"fn\">'. get_the_author() .'</a></p>';\n}", "function thememount_entry_meta($echo = true) {\n\t$return = '';\n\t\n\tglobal $post;\n\t\n\tif( isset($post->post_type) && $post->post_type=='page' ){\n\t\treturn;\n\t}\n\t\n\t\n\t$postFormat = get_post_format();\n\t\n\t// Post author\n\t$categories_list = get_the_category_list( __( ', ', 'howes' ) ); // Translators: used between list items, there is a space after the comma.\n\t$tag_list = get_the_tag_list( '', __( ', ', 'howes' ) ); // Translators: used between list items, there is a space after the comma.\n\t$num_comments = get_comments_number();\n\t\n\t$return .= '<div class=\"thememount-meta-details\">';\n\t\t// Date\n\t\t$return .= '<span class=\"tm-date-wrapper\"><i class=\"tmicon-fa-clock-o\"></i> ' . get_the_date() . '</span>';\n\n\t\tif ( 'post' == get_post_type() ) {\n\t\t\tif( !is_single() ){\n\t\t\t\t$return .= sprintf( '<div class=\"thememount-post-user\"><span class=\"author vcard\"><i class=\"tmicon-fa-user\"></i> <a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span></div>',\n\t\t\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'howes' ), get_the_author() ) ),\n\t\t\t\t\tget_the_author()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif ( $tag_list ) { $return .= '<span class=\"tags-links\"><i class=\"tmicon-fa-tags\"></i> ' . $tag_list . '</span>'; };\n\t\tif ( $categories_list ) { $return .= '<span class=\"categories-links\"><i class=\"tmicon-fa-folder-open\"></i> ' . $categories_list . '</span>'; };\n\t\tif( !is_sticky() && comments_open() && ($num_comments>0) ){\n\t\t\t$return .= '<span class=\"comments\"><i class=\"tmicon-fa-comments\"></i> ';\n\t\t\t$return .= $num_comments;\n\t\t\t$return .= '</span>';\n\t\t}\n\n\t$return .= '</div>';\n\t\n\tif( $echo == true ){\n\t\techo $return;\n\t} else {\n\t\treturn $return;\n\t}\n\t\n\t\n}", "function _themename_post_meta() {\n printf(\n esc_html__('Published on %s', '_themename'),\n '<a href=\"' . esc_url(get_permalink()) . '\"><time datetime=\"' . esc_attr(get_the_date('c')) . '\">' . esc_html(get_the_date()) . '</time></a>'\n );\n /* translators: %s: Post Author */\n printf(\n esc_html__(' by %s', '_themename'),\n esc_html(get_the_author())\n );\n}", "function the_meta()\n {\n }", "public static function display_meta_box($post) {\r\n\t\t\t$force_hide = get_post_meta($post->ID, self::FORCE_HIDE_KEY, true);\r\n\t\t\t$moderation_url = self::_get_moderation_url($post->ID);\r\n\t\t\t$results_url = self::_get_results_url($post->ID);\r\n\r\n\t\t\tinclude('views/backend/meta-boxes/meta-box.php');\r\n\t\t}", "function jn_post_meta() {\n printf( __( 'Posted on <time class=\"entry-date\" datetime=\"%3$s\" pubdate>%4$s</time><span class=\"byline\"> by <span class=\"author vcard\"><a class=\"url fn n\" href=\"%5$s\" title=\"%6$s\" rel=\"author\">%7$s</a></span></span>', 'jn' ),\n esc_url( get_permalink() ),\n esc_attr( get_the_time() ),\n esc_attr( get_the_date( 'c' ) ),\n esc_html( get_the_date() ),\n esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n esc_attr( sprintf( __( 'View all posts by %s', 'jn' ), get_the_author() ) ),\n esc_html( get_the_author() )\n );\n}", "public static function metaDate($post = null)\n {\n echo __METHOD__;\n $meta = get_post_meta($post->ID);\n echo '<pre>';\n print_r($meta);\n echo '</pre>';\n /*\n * repeat_start\n * repeat_end\n */\n print_r($post);\n }", "public function getMeta($post, $additional=array())\n {\n if(!is_array($additional))\n throw new \\Exception(\"Error in Content::getMeta(), additional meta tags must be an array\");\n\n // Get description\n if(!empty($post->post_excerpt))\n $description = $post->post_excerpt;\n elseif(!empty($post->custom_fields['erdiko_seo_description'][0]))\n $description = $post->custom_fields['erdiko_seo_description'][0];\n else\n $description = $post->post_title;\n\n // Get formatted post dates\n $postDate = date('c', strtotime($post->post_date));\n $updateDate = date('c', strtotime($post->post_modified));\n \n // Description & author\n $meta['description'] = $description;\n $meta['author'] = $post->author->display_name;\n\n // Open Graph\n // $meta['og:locale'] = 'en_US'; // coming from application.json now\n $meta['og:type'] = 'blog';\n $meta['og:title'] = $post->post_title;\n $meta['og:description'] = $description;\n // @todo remove 'http://' and set dynamically somehow\n $meta['og:url'] = \"http://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n $meta['og:updated_time'] = $updateDate;\n $meta['og:image'] = $post->feat_image;\n\n // Article\n // $meta['article:publisher'] = \"https://www.facebook.com/yoast\";\n // $meta['article:author'] = \"https://www.facebook.com/jdevalk\";\n $meta['article:section'] = 'Blog';\n $meta['article:published_time'] = $postDate;\n $meta['article:modified_time'] = $updateDate;\n\n // Article Tags\n $tags = array();\n\t if(!empty($post->tags)) {\n\t\t foreach ( $post->tags as $tag ) {\n\t\t\t $tags[] = $tag->name;\n\t\t } // $tag->slug\n\t\t if ( count( $tags ) > 0 ) {\n\t\t\t $meta['article:tag'] = $tags;\n\t\t }\n\t }\n\n // Twitter Card\n $meta['twitter:card'] = \"summary_large_image\";\n $meta['twitter:description'] = $description;\n $meta['twitter:title'] = $post->post_title;\n $meta['twitter:image'] = $post->feat_image;\n // $meta['twitter:creator'] = \"@erdiko\";\n\n // Override any default meta values (from post) with $additional meta supplied\n $meta = array_merge($meta, $additional);\n\n return $meta;\n }", "public function print_metadata_box($post) {\n // presses save, the application will check that the nonce field is still declared and\n // that is the same that the one provided here. If they don't match, probably something\n // nasty happened (or maybe just there was a bug).\n wp_nonce_field('makigas_metabox_video', 'makigas_metabox_nonce');\n\n // Put the fields.\n $this->print_field( $post, '_video_id', __( 'Video ID', 'makigas-videoman' ) );\n $this->print_field( $post, '_episode', __( 'Episode Number', 'makigas-videoman' ) );\n $this->print_field( $post, '_length', __( 'Length', 'makigas-videoman' ) );\n }", "function _display_unitinfo_meta( $post ) {\n\t\tinclude( 'includes/metaboxes/unit-info.php' );\n\t}", "public function video_meta_information( $post ) {\n wp_nonce_field( 'video_meta_save', 'video_meta_box' );\n\n $provider = get_post_meta($post->ID, 'provider', true);\n $videoid = get_post_meta($post->ID, 'videoid', true);\n $season = get_post_meta($post->ID, 'season', true);\n $episode = get_post_meta($post->ID, 'episode', true);\n\n require_once(PLUGIN_ROOT. 'includes/tpl/video-meta.tpl.php');\n }", "function agilespirit_entry_meta() {\n if ( is_sticky() && is_home() && ! is_paged() )\n echo '<span class=\"featured-post\">' . __( 'Sticky', 'agilespirit' ) . '</span>';\n\n if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )\n agilespirit_entry_date();\n\n // Translators: used between list items, there is a space after the comma.\n $categories_list = get_the_category_list( __( ', ', 'agilespirit' ) );\n if ( $categories_list ) {\n echo ' ' . __('in', 'agilespirit') . ' <span class=\"categories-links\">' . $categories_list . '</span>';\n }\n\n // Translators: used between list items, there is a space after the comma.\n $tag_list = get_the_tag_list( '', __( ', ', 'agilespirit' ) );\n if ( $tag_list ) {\n echo '<span class=\"tags-links\">' . ' ' . __(' concerning ', 'agilespirit') . ' ' . $tag_list . '</span>';\n }\n\n // Post author\n if ( 'post' == get_post_type() ) {\n _e(' by ', 'agilespirit');\n printf( '<span class=\"author\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>',\n esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n esc_attr( sprintf( __( 'View all posts by %s', 'agilespirit' ), get_the_author() ) ),\n get_the_author()\n );\n }\n}", "public function meta($name = \"\", $content =\"\") {\n echo \"<meta name='\" . $name . \"' content ='\" . $content . \"'>\";\n }", "function __themename_post_meta(){\n printf(\n esc_html__( 'posted on %s', 'Cypher Nex' ),\n '<a href=\"' . esc_url(get_permalink()) . '\" >\n <time datetime=\"' . esc_attr(get_the_date('c')) .'\"> '. get_the_date() .'</time></a>'\n );\n /* translators: %s Post Author */\n printf(\n esc_html__( ' By %s', 'Cypher Nex' ),\n '<a href=\"'. esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '\"> '. esc_html(get_the_author()) .'</a>'\n );\n}", "function cosmo_get_site_meta() {\n\n ob_start();\n ob_clean();\n\n if( is_single() || is_page() ){ \n global $post; ?>\n <meta name=\"description\" content=\"<?php echo strip_tags( post::get_excerpt( $post, $ln=150 ) ); ?>\" /> \n <meta property=\"og:title\" content=\"<?php the_title() ?>\" />\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name'); ?>\" />\n <meta property=\"og:url\" content=\"<?php the_permalink() ?>\" />\n <meta property=\"og:type\" content=\"article\" />\n <meta property=\"og:locale\" content=\"en_US\" /> \n <meta property=\"og:description\" content=\"<?php echo get_bloginfo('description'); ?>\"/>\n <?php\n\n } else { ?>\n <meta name=\"description\" content=\"<?php echo get_bloginfo('description'); ?>\" /> \n <meta property=\"og:title\" content=\"<?php echo get_bloginfo('name'); ?>\"/>\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name'); ?>\"/>\n <meta property=\"og:url\" content=\"<?php echo home_url() ?>/\"/>\n <meta property=\"og:type\" content=\"blog\"/>\n <meta property=\"og:locale\" content=\"en_US\"/>\n <meta property=\"og:description\" content=\"<?php echo get_bloginfo('description'); ?>\"/>\n <?php\n }\n\n return ob_get_clean();\n\n }", "function hybrid_entry_meta() {\n\n\t$meta = '';\n\n\tif ( 'post' == get_post_type() )\n\t\t$meta = '<p class=\"entry-meta\">' . __( '[entry-terms taxonomy=\"category\" before=\"Posted in \"] [entry-terms taxonomy=\"post_tag\" before=\"| Tagged \"] [entry-comments-link before=\"| \"]', 'hybrid' ) . '</p>';\n\n\telseif ( is_page() && current_user_can( 'edit_page', get_the_ID() ) )\n\t\t$meta = '<p class=\"entry-meta\">[entry-edit-link]</p>';\n\n\techo apply_atomic_shortcode( 'entry_meta', $meta );\n}", "function wprt_entry_meta() {\n\t// Get meta items from theme mod\n\t$meta_item = wprt_get_mod( 'blog_entry_meta_items', array( 'date', 'author', 'comments' ) );\n\n\t// If blocks are 100% empty return defaults\n\t$meta_item = $meta_item ? $meta_item : 'date,author,comments';\n\n\t// Turn into array if string\n\tif ( $meta_item && ! is_array( $meta_item ) ) {\n\t\t$meta_item = explode( ',', $meta_item );\n\t}\n\n\t// Set keys equal to values\n\t$meta_item = array_combine( $meta_item, $meta_item );\n\n\t// Loop through items\n\tforeach ( $meta_item as $item ) :\n\t\tif ( 'author' == $item ) { \n\t\t\tprintf( '<span class=\"post-by-author item\"><span class=\"inner\">By <a href=\"%s\" title=\"%s\" rel=\"author\">%s</a></span></span>',\n\t\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\t\tesc_attr( sprintf( esc_html__( 'View all posts by %s', 'fundrize' ), get_the_author() ) ),\n\t\t\t\tget_the_author()\n\t\t\t\t);\n\t\t}\n\t\telseif ( 'date' == $item ) {\n\t\t\tprintf( '<span class=\"post-date item\"><span class=\"inner\"><span class=\"entry-date\">%1$s</span></span></span>',\n\t\t\t\tget_the_date()\n\t\t\t);\n\t\t}\n\t\telseif ( 'comments' == $item ) {\n\t\t\tif ( comments_open() || get_comments_number() ) {\n\t\t\t\techo '<span class=\"post-comment item\"><span class=\"inner\">';\n\t\t\t\tcomments_popup_link( esc_html__( '0 comment', 'fundrize' ), esc_html__( '1 Comment', 'fundrize' ), esc_html__( '% Comments', 'fundrize' ) );\n\t\t\t\techo '</span></span>';\n\t\t\t}\n\t\t}\n\t\telseif ( 'categories' == $item ) {\n\t\t\techo '<span class=\"post-meta-categories item\"><span class=\"inner\">';\n\t\t\tthe_category( ', ', get_the_ID() );\n\t\t\techo '</span></span>';\n\t\t}\n\tendforeach;\n}", "function addMeta() {\n\t\n\tif( class_exists('acf') ) {\n\n\t$meta_description = get_field('meta_description', 'option');\n\t$meta_keywords = get_field('meta_keywords', 'option');\n\t$meta_author = get_field('meta_author', 'option');\n\t$meta_og_image = get_field('meta_og_img', 'option');\n\t$meta_img_full = $meta_og_image['url'];\n\n\t}\n\n\tif ( $meta_description ) {\n\t\techo '<meta name=\"description\" content=\"'.$meta_description.'\">'; \n\t}\n\n\tif ( $meta_keywords ) {\n\t\techo '<meta name=\"keywords\" content=\"'.$meta_keywords.'\">'; \n\t}\n\n\tif ( $meta_author ) {\n\t\techo '<meta name=\"author\" content=\"'.$meta_author.'\">'; \n\t}\n\n\tif ( $meta_og_image ) {\n\t\techo '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\techo '<meta property=\"og:image\" content=\"'.$meta_img_full.'\" />';\n\t}\n\n}", "function acitpo_entry_meta() {\n\tglobal $post;\n\tif (is_page()) { return; }\n\t$categories = get_the_category_list(__(', ', 'acitpo'));\n\n\tprintf('<span class=\"date-link\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>', esc_attr(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_time('c')), esc_html(get_the_date()));\n\tif ($categories) {\n\t\tprintf('<span class=\"category-links\">%s</span>', $categories);\n\t}\n\tprintf('<span class=\"author-link vcard\"><a href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>', esc_attr(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'acitpo'), get_the_author())), esc_html(get_the_author()));\n}", "function generate_post_meta()\n {\n $post_types = apply_filters('generate_entry_meta_post_types', array(\n 'post',\n ));\n\n if (in_array(get_post_type(), $post_types)): ?>\n<div class=\"entry-meta\">\n <?php generate_posted_on();?>\n</div><!-- .entry-meta -->\n<?php endif;\n }", "public function post_metabox_display( $post ) {\n\n\t\t$sailthru_post_expiration = get_post_meta( $post->ID, 'sailthru_post_expiration', true );\n\t\t$sailthru_meta_tags = get_post_meta( $post->ID, 'sailthru_meta_tags', true );\n\n\t\twp_nonce_field( plugin_basename( __FILE__ ), $this->nonce );\n\n\t\t// post expiration\n\t\t$html = '<p><strong>Sailthru Post Expiration</strong></p>';\n\t\t$html .= '<input id=\"sailthru_post_expiration\" type=\"text\" placeholder=\"YYYY-MM-DD\" name=\"sailthru_post_expiration\" value=\"' . esc_attr( $sailthru_post_expiration ) . '\" size=\"25\" class=\"datepicker\" />';\n\t\t$html .= '<p class=\"description\">';\n\t\t$html .= 'Flash sales, events and some news stories should not be recommended after a certain date and time. Use this Sailthru-specific meta tag to prevent Horizon from suggesting the content at the given point in time. <a href=\"http://docs.sailthru.com/documentation/products/horizon-data-collection/horizon-meta-tags\" target=\"_blank\">More information can be found here</a>.';\n\t\t$html .= '</p><!-- /.description -->';\n\n\t\t// post meta tags\n\t\t$html .= '<p>&nbsp;</p>';\n\t\t$html .= '<p><strong>Sailthru Meta Tags</strong></p>';\n\t\t$html .= '<input id=\"sailthru_meta_tags\" type=\"text\" name=\"sailthru_meta_tags\" value=\"' . esc_attr( $sailthru_meta_tags ) . '\" size=\"25\" />';\n\t\t$html .= '<p class=\"description\">';\n\t\t$html .= 'Tags are used to measure user interests and later to send them content customized to their tastes.';\n\t\t$html .= '</p><!-- /.description -->';\n\t\t$html .= '<p class=\"howto\">Separate tags with commas</p>';\n\n\t\techo esc_html( $html );\n\n\t}", "public function render_meta_box_content( $post ) {\n\t\tinclude_once $this->plugin->path . 'views/view-metabox-publish.php';\n\t}", "function yeti_entry_meta() {\n echo '<p class=\"byline\"><time class=\"updated\" datetime=\"'. get_the_time('c') .'\" pubdate>'. sprintf(__('Posted on %s at %s.', 'yeti'), get_the_time('l, F jS, Y'), get_the_time()) .'</time></p>';\n //echo '<p class=\"byline author\">'. __('Written by', 'reverie') .' <a href=\"'. get_author_posts_url(get_the_author_meta('ID')) .'\" rel=\"author\" class=\"fn\">'. get_the_author() .'</a></p>';\n}", "function m_custom_meta() {\r\n add_meta_box( 'sm_meta', __( 'Featured Posts', 'sm-textdomain' ), 'sm_meta_callback', 'post' );\r\n add_meta_box( 'mm_meta', __( 'Main Posts', 'sm-textdomain' ), 'mm_meta_callback', 'post' );\r\n\r\n}", "public function display($post);", "public function show( $post ) {\n\t\t\tif ( ! $post ) global $post;\n\n\t\t\t$pageTpl = null;\n\t\t\t$tabbed = ( $this->_meta_box['tabs'] ) ? ( ' jquery-ui-tabs' ) : ( '' );\n\t\t\t$metaFields = $this->_fields;\n\n\t\t\tif ( 'page' == $post->post_type ) {\n\t\t\t\t$pageTpl = get_post_meta( $post->ID, '_wp_page_template', true );\n\t\t\t\tif ( $post->ID == get_option( 'page_for_posts' ) )\n\t\t\t\t\t$pageTpl = 'blog-page';\n\t\t\t}\n\n\t\t\twp_nonce_field( 'wm-' . $post->post_type . '-metabox-nonce', $post->post_type . '-metabox-nonce' );\n\n\t\t\t//display meta box form HTML\n\t\t\t$out = '<div class=\"wm-wrap meta' . $tabbed . '\">';\n\n\t\t\t\t//tabs\n\t\t\t\tif ( $tabbed ) {\n\t\t\t\t\t$out .= '<ul class=\"tabs no-js\">';\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ( $metaFields as $tab ) {\n\t\t\t\t\t\tif ( 'section-open' == $tab['type'] ) {\n\t\t\t\t\t\t\t++$i;\n\t\t\t\t\t\t\t$out .= '<li class=\"item-' . $i . ' ' . $tab['section-id'] . '\"><a href=\"#wm-meta-' . $tab['section-id'] . '\">' . $tab['title'] . '</a></li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$out .= '</ul> <!-- /tabs -->';\n\t\t\t\t}\n\n\t\t\t\techo $out;\n\n\t\t\t\t//Content\n\t\t\t\twm_render_form( $metaFields, 'meta', $pageTpl );\n\n\t\t\techo '<div class=\"modal-box\"><a class=\"button-primary\" data-action=\"stay\">' . __( 'Wait, I need to save my changes first!', 'clifden_domain_adm' ) . '</a><a class=\"button\" data-action=\"leave\">' . __( 'OK, leave without saving...', 'clifden_domain_adm' ) . '</a></div></div> <!-- /wm-wrap -->';\n\t\t}", "function writeMetatags($description) {\r\n echo '<meta name=\"author\" content=\"Stephen Wallace\">' . \"\\n\";\r\n echo \"<meta name=\\\"description\\\" content=\\\"$description\\\">\\n\";\r\n}", "function article_meta($postID) {\r\n\t$articlemeta = '<div class=\"article-meta contain\">'.\"\\n\";\r\n\r\n\t// add to favorites\r\n\tif ( is_user_logged_in() ) {\r\n\r\n\t\t$articlemeta .= '<p class=\"user-meta\">';\r\n\r\n\t\t// if ( indagare\\users\\User::hasFavorite($postID) ) {\r\n\t\t// \t$articlemeta .= '<a href=\"'.get_bloginfo('stylesheet_directory').'/favorite.php?action=remove&postid='.$postID.'\"><b class=\"icon\" data-icon=\"&#xf097;\"></b> Remove from Wish List</a>';\r\n\t\t// } else {\r\n\t\t// \t$articlemeta .= '<a href=\"'.get_bloginfo('stylesheet_directory').'/favorite.php?action=add&postid='.$postID.'\"><b class=\"icon\" data-icon=\"&#xf097;\"></b> Add to Wish List</a>';\r\n\t\t// }\r\n\r\n//\t\t$articlemeta .= ' <a href=\"#\"><b class=\"icon\" data-icon=\"&#xf08a;\"></b> Like</a> (19 likes)';\r\n\r\n\t\t$articlemeta .= '</p>'.\"\\n\";\r\n\t}\r\n\r\n\t$articlemeta .= '<p class=\"social-meta\">';\r\n\t$articlemeta .= '<span class=\"icon-label\">Share:</span>';\r\n\t$articlemeta .= ' <span id=\"social-facebook\"><b class=\"icon custom-icon\" data-icon=\"&#xe003;\"><span class=\"st_facebook\"displayText=\"\"></span></b></span>';\r\n\t$articlemeta .= ' <span id=\"social-twitter\"><b class=\"icon custom-icon\" data-icon=\"&#xe001;\"><span class=\"st_twitter\"></span></b></span>';\r\n\t$articlemeta .= ' <span id=\"social-pinterest\"><b class=\"icon custom-icon\" data-icon=\"&#xe007;\"><span class=\"st_pinterest\"></span></b></span>';\r\n\t$articlemeta .= ' <a id=\"social-email\" class=\"contact lightbox-inline\" href=\"#lightbox-contact-friend\"><b class=\"icon custom-icon\" data-icon=\"&#xe614;\"></b></a>';\r\n\t$articlemeta .= '</p>'.\"\\n\";\r\n\t$articlemeta .= '</div>'.\"\\n\";\r\n\r\n\treturn $articlemeta;\r\n\r\n}", "function woo_post_meta( ) { ?>\n<aside class=\"post-meta\">\n\t<ul>\n\t\t<li class=\"post-date\">\n\t\t\t<span><?php the_time( get_option( 'date_format' ) ); ?></span>\n\t\t</li>\n\t\t<li class=\"post-author\">\n\t\t\t<?php the_author_posts_link(); ?>\n\t\t</li>\n\t\t<li class=\"post-category\">\n\t\t\t<?php the_category( ', ') ?>\n\t\t</li>\n\t\t<?php edit_post_link( __( '{ Edit }', 'woothemes' ), '<li class=\"edit\">', '</li>' ); ?>\n\t</ul>\n</aside>\n<?php\n}", "function page_attributes_meta_box($post)\n {\n }", "public function getMeta(){\n // $this->meta();\n }", "function _display_maps_meta( $post ) {\n\t\tinclude( 'includes/metaboxes/maps.php' );\n\t}", "function _display_gallery_meta( $post ) {\n\t\tinclude( 'includes/metaboxes/gallery.php' );\n\t}", "function bajweb_custom_meta_des(){\n if( is_single() ) {\n $des = get_post_meta( get_the_id(), 'description', true );\n if( ! empty( $des ) ){\n $des = esc_html( $des );\n echo \"<meta name='description' content='$des'>\";\n }\n }\n}", "public function render_screen_meta()\n {\n }", "public function getMeta();", "public function getMeta();", "function sm_custom_meta() {\n\tadd_meta_box('sm_meta', __( 'Post Destacado', 'sm-textdomain' ), 'sm_meta_callback', 'post' );\n}", "function classiera_entry_meta() {\r\n\tif ( is_sticky() && is_home() && ! is_paged() )\r\n\t\techo '<span class=\"featured-post\">' . esc_html_e( 'Sticky', 'classiera' ) . '</span>';\r\n\r\n\tif ( ! has_post_format( 'link' ) && 'post' == get_post_type() )\r\n\t\tclassiera_entry_date();\r\n\r\n\t// Translators: used between list items, there is a space after the comma.\r\n\t$categories_list = get_the_category_list( esc_html_e( ',', 'classiera' ) );\r\n\tif ( $categories_list ) {\r\n\t\techo '<span class=\"categories-links\">' . $categories_list . '</span>';\r\n\t}\r\n\r\n\t// Translators: used between list items, there is a space after the comma.\r\n\t$tag_list = get_the_tag_list( '', esc_html_e( ',', 'classiera' ) );\r\n\tif ( $tag_list ) {\r\n\t\techo '<span class=\"tags-links\">' . $tag_list . '</span>';\r\n\t}\r\n\r\n\t// Post author\r\n\tif ( 'post' == get_post_type() ) {\r\n\t\tprintf( '<span class=\"author vcard\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>',\r\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\r\n\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'classiera' ), get_the_author() ) ),\r\n\t\t\tget_the_author()\r\n\t\t);\r\n\t}\r\n}", "function thd_re_post_info_show_box() {\n\tthd_meta_box_callback(thd_re_post_meta_box_fields(), 'post');\n}", "function acf_get_metadata($post_id = 0, $name = '', $hidden = \\false)\n{\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}", "function add_meta($post_id)\n {\n }", "private function do_meta_box( $title = '', $contents = '' ) {\n\t\t?>\n\t\t<div class=\"postbox\">\n\t\t\t<h3 class=\"hndle\"><?php echo $title ?></h3>\n\t\t\t<div class=\"inside\">\n\t\t\t\t<?php echo $contents; ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "public static function render_meta_box($post)\n {\n // Use nonce for verification\n wp_nonce_field(plugin_basename(__DIR__), 'dxw_content_review_nonce');\n\n $args = array();\n\n // Get settings data\n $args['dxw_review_email'] = get_post_meta($post->ID, '_dxw_review_email', true);\n $args['dxw_review_length'] = get_post_meta($post->ID, '_dxw_review_length', true);\n $args['dxw_review_action'] = get_post_meta($post->ID, '_dxw_review_action', true);\n\n // Include fields meta view\n dxw_get_view('content-review-meta', $args);\n }", "function sb_slideshow_shortcode_meta() {\n\tglobal $post;\n\techo sb_slideshow_embed_input( $post->ID );\n}", "function headmeta() {\n\tglobal $posts;\n\n\t// only act when viewing a single post or a page. Else, exit.\n\tif ( !(is_single() || is_page() ) ) return;\n\t\n\t// Get the post\n\t$post = $posts[0];\n\t\n\t// Get the keys and values of the custom fields:\n\t$id = $post->ID;\n\t$metavals = get_post_meta($id, 'head_meta', false);\n\tif (! is_array($metavals)) {\n\t\t$metavals = (array) $metavals;\n\t}\n\t$linkvals = get_post_meta($id, 'head_link', false);\n\tif (! is_array($linkvals)) {\n\t\t$linkvals = (array) $linkvals;\n\t}\n\n\t// A key of either 'keyword' or 'keywords' will generate a \n\t// standard 'keywords' meta tag. Both variants are used for\n\t// compatibility with other plugins, such as Related Posts.\n\t$keyword = get_post_meta($id, 'keyword', false);\n\t$keywords = get_post_meta($id, 'keywords', false);\n\t\n\t// This will turn each into a (possibly empty) string:\n\tif (is_array($keyword)) {\n\t\t$keyword = implode(',', $keyword);\n\t}\n\n\tif (is_array($keywords)) {\n\t\t$keywords = implode(',', $keywords);\n\t}\n\t\n\tif (! (empty($keyword) || empty($keywords))) {\n\t\t// both populated, combine with a comma:\n\t\t$keys = $keyword . ', ' . $keywords;\n\t} else if (! empty($keyword)) {\n\t\t// only 'keyword' populated\n\t\t$keys = $keyword;\n\t} else if (! empty($keywords)) {\n\t\t// only 'keywords' populated\n\t\t$keys = $keywords;\n\t}\n\t\n\t// Generate the tags\n\tif (count($metavals)) {\n\t\tforeach ($metavals as $meta) {\n\t\t\tif (! empty($meta)) {\n\t\t\t\t$tag = \"<meta $meta />\";\n\t\t\t\tprint \"$tag\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (count($linkvals)) {\n\t\tforeach ($linkvals as $link) {\n\t\t\tif (! empty($link)) {\n\t\t\t\t$tag = \"<link $link />\";\n\t\t\t\tprint \"$tag\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Output the keywords meta tag if we have keywords\n\tif (! empty($keys)) {\n\t\t$keys = wp_specialchars($keys);\n\t\t$tag = \"<meta name='keywords' content='$keys' />\";\n\t\tprint \"$tag\\n\";\n\t}\n\n\t// Shortcut for description meta tag:\n\t$description = get_post_meta($id, 'description', false);\n\t\n\t// If it's an array, implode it into a string\n\tif (is_array($description)) {\n\t\t$description = implode('; ', $description);\n\t}\n\t\n\tif (! empty($description)) {\n\t\t$description = wp_specialchars($description);\n\t\t$tag = \"<meta name='description' content='$description' />\";\n\t\tprint \"$tag\\n\";\n\t}\n\n}", "function quasar_entry_meta() {\n\t$return = '';\n\t\n\tif ( is_sticky() && is_home() && ! is_paged() )\n\t\t$return .= '<span class=\"featured-post\">' . __( 'Sticky', 'quasar' ) . '</span>';\n\n\t/*\n\tCurrently Disabled. We have used the Date in the right side\n\tif ( ! has_post_format( 'link' ) && 'post' == get_post_type() )\n\t\t$return .= quasar_entry_date(false);\n\t\n\t*/\n\n\t// Translators: used between list items, there is a space after the comma.\n\t$categories_list = get_the_category_list( __( ', ', 'quasar' ) );\n\tif ( $categories_list ) {\n\t\t$return .= '<span class=\"categories-links\">' . $categories_list . '</span>';\n\t}\n\n\t// Translators: used between list items, there is a space after the comma.\n\t$tag_list = get_the_tag_list( '', __( ', ', 'quasar' ) );\n\tif ( $tag_list ) {\n\t\t$return .= '<span class=\"tags-links\">' . $tag_list . '</span>';\n\t}\n\n\t// Post author\n\tif ( 'post' == get_post_type() ) {\n\t\t/*\n\t\tLinking to Author's archive currently disabled\n\t\t\n\t\t$return .= sprintf( '<span class=\"author vcard\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span>',\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'quasar' ), get_the_author() ) ),\n\t\t\tget_the_author()\n\t\t);\n\t\t*/\n\t\t$return .= sprintf( '<span class=\"author vcard\"><a class=\"url fn n\" title=\"%2$s\" rel=\"author\">%3$s</a></span>',\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'quasar' ), get_the_author() ) ),\n\t\t\tget_the_author()\n\t\t);\n\t}\n\t\n\treturn $return;\n}", "public function render_meta_box_content( $post ) {\n\t\n\t\t// Add an nonce field so we can check for it later.\n\t\twp_nonce_field( 'question_author', 'question_author_nonce' );\n\n\t\t// Display the form, using the current value.\n\t\techo '<input type=\"text\" id=\"question_author\" name=\"question_author\" value=\"'.esc_attr(get_post_meta( $post->ID, 'question_author', true )).'\" />';\n\t\t//echo '&nbsp;<label for=\"question_author\">'.__( 'Autore domanda', 'piananotizie' ).'</label>';\n\t}", "function program_meta_display($date = false,$time=false,$venue=false, $artist=false,$price=false,$eventbrite_link=false,$concession_link=false,$id=false){\n\t$return = '<div class=\"post-details\">';\n\t$return .= '<div class=\"date\"><h4>Date:&nbsp;</h4><span>'.$date.'</span></div>';\n\t$return .= '<div class=\"time\"><h4>Time:&nbsp;</h4><span>'.$time.'</span></div>';\n\t$return .= '<div class=\"venue\"><h4>Venue:&nbsp;</h4><a href=\"'. get_permalink($venue->ID).'\">'.$venue->post_title.'</a></div>';\n\tif ($artist && count($artist)>0):\t\t\n\t\t$return .= '<ul class=\"meta artist\"><h4>Artists:</h4>';\n\t\tforeach($artist as $artist):\n\t\t\t$return .= '<li><a href=\"'.get_permalink($artist->ID).'\">'.$artist->post_title.'</a></li>';\n\t\tendforeach;\n\t$return .= '</ul>';\n\tendif;\n\t//Start\n\t//Get Taxonomy\n\t\n\t$meta_list = array();\n\t$args = array(\n\t\t\t\t'type' => 'Elements',\n\t\t);\n\t$meta = get_the_term_list($id,'Elements','<li>','</li><li>','</li>');\n\t\n\tif ($meta){//check if there is any meta data returns (get_the_term_list returns false if empty)\n\t\t$return .= '<ul class=\"elements\">';\n\t\t$return .= '<h4>Elements</h4>';\n\t\t$meta_stripped = strip_tags($meta,'<li>'); \n\t\t$_SESSION['meta'] = $meta_stripped;\n\t\t$return .= $meta_stripped;\n\t\t$return .= '</ul>';\n\t}\n\t//Get Taxonomy\n\t//End\n\t$return .= '<ul class=\"price\">';\n\t$return .= '<h4>Price</h4>';\n\t\tif (strtolower($price) == \"free\"){ \n\t\t\t$return .='<li><span>'.$price.'</span></li>'; \n\t\t} elseif ($price != \"\") {\n\t\t\t$return .='<li><span>£'.$price.'</span></li>'; \n\t\t}\n\t\tif ($eventbrite_link != \"\")\n\t\t{ $return .='<li class=\"tickets\"><a href=\"'. $eventbrite_link.'\" target=\"_blank\"><img src=\"'.get_bloginfo('template_url').'/style/images/tickets.png\" /></a></li>';\n\t\t}\n\t\t\n\t\tif ($concession_link != \"\") \n\t\t\n\t\t{$return .='<li class=\"tickets\"><a href=\"'. $concession_link .'\" target=\"_blank\">Concessions</a></li>'; \n\t\t} \n\t$return .='</ul>';\n\t\n\t\n\t$return .= '</ul>';\n\t$return .= '</div>';\n\t\n\treturn $return;\n\t\n}", "function prfx_custom_meta() {\r\n add_meta_box( 'prfx_meta', __( 'SEO\\'s H1 Title', 'prfx-textdomain' ), 'prfx_meta_callback', 'page', $context = 'normal', $priority = 'high' );\r\n}", "function meta($key) {\n return get_post_meta($post->ID, $key, true);\n}", "public function show(post $post)\n {\n //\n }", "public function show(post $post)\n {\n //\n }", "function accouk_display_post_meta() {\n\n global $main_category;\n echo '<div class=\"published-date\">Published on '; the_date();\n echo ' in <a href=\"' . $main_category['link'] . '\" class=\"breadcrumb\">' . $main_category['name'] . '</a></div>';\n\n}", "function _display_status_meta( $post ) {\n\t\tinclude( 'includes/metaboxes/unit-status.php' );\n\t}", "public function linkages_meta_box() {\n\t\tglobal $post;\n\t\t\n\t\tif ( isset( $_GET['post'] ) )\n\t\t\t$post_ID = (int) $_GET['post'];\n\t\telse\n\t\t\t$post_ID = '';\n\t\t\n\t\techo '<input type=\"hidden\" name=\"_lingo_hidden\" id=\"_lingo_hidden\" value=\"1\" />';\n\t\t\n\t\tforeach( $this->post_meta as $key => $value ) {\n\t\t\techo '\n\t\t<p>\n\t\t\t<label for=\"' . $key . '\">' . $value . '</label>\n\t\t\t<br />\n\t\t\t<input type=\"text\" name=\"' . $key . '\" id=\"' . $key . '\" value=\"' . get_post_meta( $post_ID, $key, true ) . '\" />\n\t\t</p>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}", "function meta_box($post) {\r\n\t\t$map = get_post_meta($post->ID, '_mapp_map', true);\r\n\t\t$pois = get_post_meta($post->ID, '_mapp_pois', true);\r\n\r\n\t\t// Load the edit map\r\n\t\t// Note that mapTypes is hardcoded = TRUE (so user can change type, even if not displayed in blog)\r\n\t\t$map['maptypes'] = 1;\r\n\t\t$this->map($map, $pois, true);\r\n\r\n\t\t// The <div> will be filled in with the list of POIs\r\n\t\t//echo \"<div id='admin_poi_div'></div>\";\r\n\t}", "function greenfields_display_post_meta()\n{\n if (get_post_type() != 'post') {\n edit_post_link(__('Edit', \"greenfields\"), '<span class=\"glyphicon glyphicon-pencil\"></span> ', '');\n return false;\n }\n\n ?>\n <ul class=\"meta list-inline\">\n <li>\n <a href=\"<?php the_permalink() ?>\">\n <span class=\"glyphicon glyphicon-time\"></span>\n <?php the_date(); ?>\n </a>\n </li>\n <li>\n <a href=\"<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>\">\n <span class=\"glyphicon glyphicon-user\"></span>\n <?php the_author(); ?>\n </a>\n </li>\n <?php if (!post_password_required() && (comments_open() || get_comments_number())) : ?>\n <li>\n <?php\n $sp = '<span class=\"glyphicon glyphicon-comment\"></span> ';\n comments_popup_link($sp . __('Leave a comment', \"greenfields\"), $sp . __('1 Comment', \"greenfields\"), $sp . __('% Comments', \"greenfields\"));\n ?>\n </li>\n <?php endif; ?>\n <?php edit_post_link(__('Edit', \"greenfields\"), '<li><span class=\"glyphicon glyphicon-pencil\"></span> ', '</li>'); ?>\n </ul>\n\n <?php\n}", "function projectpentagon_tastingnotes() {\n\t wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );\n\t $post_idinhere\t=\t$_GET['post']; //GET THE ID OUTSIDE OF THE LOOP\n\t \n\t $get_field_name\t=\t get_option('projectpentagon-titleonpages');\n\t $meta_value_field = get_post_meta($post_idinhere, 'tasting-notes', true); \n\tif($meta_value_field1)\n\t\t{\n\t\t \t//echo \"we're at debut point a\";//debug\n\t\t \t$display1 = $meta_value_field1; \n\t\t}\n\telse \n\t\t{\n\t\t \t//echo \"we're at debut point b\". $meta_value_field1 .\"\";//debug\n\t\t \t$display1 = \"enter value here.\";\n\t\t}\n\n\t\t// we're not using _e because its user input text we're retrieving.\n\t // we'll assume that the user put it in the database in their preferred language\n\t\t\t echo '<label for=\"'. $get_field_name .'\">';\n\t\t\techo $get_field_name;\n\t\t \techo '</label> <br /> ';\n\t\t\techo '<textarea id=\"tasting-notes\" name=\"tasting-notes\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;\">'. $meta_value_field .'</textarea>';\t\n}", "public static function getHtmlMeta($type='post', $postdata='', $listurl='', $tag='')\n {\n \t$meta = \"\";\n \t\n \tif ($type == 'post' || $type == 'list') {\n \t\tif ($type == 'post') {\n \t\t\t// encode ' \" < > from title and description\n \t\t\t$pagetitle = htmlspecialchars($postdata[\"title\"]);\n \t\t\t$postdescription = htmlspecialchars($postdata[\"description\"]);\n \t\t\t$url = \"http://\".env(\"DOMAINNAME\").\"/post/\".$postdata[\"id\"];\n \t\t\t$canonicalurl = $url.\"/\".$pagetitle;\n \t\t\t$title = Config::get('weixin.defaulthtmltitle').\" \".$pagetitle;\n \t\t\t$desc = $postdescription;\n \t\t\t$image = $postdata[\"ogimage\"];\n \t\t\t$pagetype = \"article\";\n \t\t} else {\n \t\t\t$url = \"http://\".env(\"DOMAINNAME\").$listurl;\n \t\t\t$canonicalurl = $url;\n \t\t\t$title = Config::get('weixin.defaulthtmltitle').\" \".$tag;\n \t\t\t$pagetitle = $title;\n \t\t\t$desc = Config::get('weixin.defaulthtmldescription');\n \t\t\t$image = Config::get('weixin.defaulthtmlogimage');\n \t\t\t$pagetype = \"website\";\t\t\n \t\t}\n \t\n \t$meta = $meta.\"<meta name='keywords' content='\".Config::get('weixin.defaulthtmlkeywords').\"' />\\n\";\n \t$meta = $meta.\"<meta name='description' content='\".$title.\" \".$desc.\"' />\\n\";\n \t$meta = $meta.\"<meta name='robots' content='index,follow' />\\n\";\n \t\n \t$meta = $meta.\"<meta property='og:type' content='\".$pagetype.\"' />\\n\";\n \t$meta = $meta.\"<meta property='og:url' content='\".$url.\"' />\\n\";\n \t$meta = $meta.\"<meta property='og:title' content='\".$title.\"' />\\n\";\n \t$meta = $meta.\"<meta property='og:description' content='\".$desc.\"' />\\n\";\n \t$meta = $meta.\"<meta property='og:image' content='\".$image.\"' />\\n\";\n \t$meta = $meta.\"<meta property='og:site_name' content='\".env(\"DOMAINNAME\").\"'/>\\n\";\n \t$meta = $meta.\"<meta property='fb:app_id' content='\".env(\"FB_CLIENT_ID\").\"' />\\n\";\n \t\n \t$meta = $meta.\"<title>\".$pagetitle.\"</title>\\n\";\n \t\n \t$meta = $meta.\"<link rel='canonical' href='\".$canonicalurl.\"' />\\n\";\n \t}\n \t\n \treturn $meta;\n }", "function get_post_meta($post_id, $key = '', $single = \\false)\n {\n }", "public function render_app_details_meta_box( $post ) {\n\n\t\t$html = '';\n\n\t\t$app_post_title = $post->post_title;\n\t\t$app_type = get_post_meta( $post->ID, 'app_type', true );\n\t\t$parent_post_id = get_post_meta( $post->ID, 'parent_post_id', true );\n\n\t\t/* Get some data about the server so that the metabox template can use it*/\n\t\t$ipv4 = WPCD_SERVER()->get_ipv4_address( $parent_post_id );\n\t\t$server_name = WPCD_SERVER()->get_server_name( $parent_post_id );\n\t\t$server_provider = WPCD_SERVER()->get_server_provider( $parent_post_id );\n\n\t\tob_start();\n\t\trequire wpcd_path . 'includes/templates/app_details.php';\n\t\t$html = ob_get_contents();\n\t\tob_end_clean();\n\n\t\techo $html;\n\n\t}", "public function show( Post $post )\n {\n //\n }", "public function meta_box() {\r\n\t\tglobal $post;\r\n\t\t\r\n\t\t// \r\n\t\tif ( isset( $_GET['post'] ) )\r\n\t\t\t$post_ID = (int) $_GET['post'];\r\n\t\telse\r\n\t\t\t$post_ID = '';\r\n\r\n\t\tforeach( $this->post_meta as $key => $value ) {\r\n\t\t\tif (\r\n\t\t\t\t'previous_start' == $key ||\r\n\t\t\t\t'previous_end' == $key ||\r\n\t\t\t\t'total_start' == $key ||\r\n\t\t\t\t'total_end' == $key\r\n\t\t\t) {\r\n\t\t\t\t$time_value = get_post_meta( $post_ID, '_' . $key, true );\r\n\t\t\t\t$time = date( 'h:m d M Y', $time_value );\r\n\t\t\t} else {\r\n\t\t\t\t$time = '';\r\n\t\t\t}\r\n\r\n\t\t\techo '\r\n\t\t\t<p>\r\n\t\t\t\t<label for=\"_' . $key . '\">' . $value . '</label>\r\n\t\t\t\t<br />\r\n\t\t\t\t<input type=\"text\" name=\"_' . $key . '\" id=\"_' . $key . '\" value=\"' . get_post_meta( $post_ID, '_' . $key, true ) . '\" />\r\n\t\t\t\t<br />\r\n\t\t\t\t<small>' . $time . '</small>\r\n\t\t\t</p>';\r\n\t\t\tunset( $time );\r\n\t\t}\r\n\t}", "public static function meta();", "function add_custom_meta() {\n global $post;\n }", "function show_my_meta_box( $post ) {\n\t\t\n\t\tglobal $wpdb;\n\t\t$table_name = $wpdb->prefix . 'civ_slider';\n\t\t$row_count = $wpdb->get_var( 'select count(*) from $table_name' );\n\t\t$slide_count = $row_count + 1;\n\t\t$post_id_check = $post->ID;\n\n\t\t$box_check = $wpdb->get_row($wpdb->prepare(\"select * from $table_name where post_id=%d\", $post_id_check));\n?>\n\t<form method=\"post\" >\n\t\t<label>Check here to add post to homepage slider: </label>\n\t\t<input type=\"checkbox\" name=\"chkd\" <?php if($box_check != null ){echo \"checked\";} ?> />\n\t\t<input type=\"hidden\" value=\"<?php echo $post->ID; ?>\" name=\"post_id\" />\n\t\t<input type=\"hidden\" value=\"<?php echo $slide_count; ?>\" name=\"slide_order\" />\n\t</form>\n\t\t<?php\n\t}", "function display_facebook_og(){\n global $post;\n $img_array=get_field('design_image');\n //echo '<meta property=\"og:url\" content=\"'.get_permalink($post->ID).'\"/>';\n echo '<meta property=\"og:image\" content=\"'.$img_array[\"sizes\"][\"medium\"].'\"/>';\n}", "function thinkup_input_postmeta() {\n\n// Get theme options values.\n$thinkup_post_date = thinkup_var ( 'thinkup_post_date' );\n$thinkup_post_author = thinkup_var ( 'thinkup_post_author' );\n$thinkup_post_comment = thinkup_var ( 'thinkup_post_comment' );\n$thinkup_post_category = thinkup_var ( 'thinkup_post_category' );\n$thinkup_post_tag = thinkup_var ( 'thinkup_post_tag' );\n$thinkup_post_title = thinkup_var ( 'thinkup_post_title' );\n\n// Reset variable values to avoid php error\n$class_comment = NULL;\n\n\tif ( $thinkup_post_date !== '1' or \n\t\t$thinkup_post_author !== '1' or \n\t\t$thinkup_post_comment !== '1' or \n\t\t$thinkup_post_category !== '1' or \n\t\t$thinkup_post_tag !== '1' or \n\t\t$thinkup_post_title !== '1') {\n\n\n\t\t\t// Only output for blog layout 1\n\t\t\tif ( '0' != get_comments_number() and $thinkup_post_comment !== '1' ) {\n\t\t\t\t$class_comment = ' comment-icon';\n\t\t\t}\n\n\t\t\techo '<header class=\"entry-header' . $class_comment . '\">';\n\n\t\t\tif ($thinkup_post_title !== '1') { echo '<h3 class=\"post-title\">' . get_the_title() . '</h3>'; }\n\n\t\t\techo '<div class=\"entry-meta\">';\n\t\t\t\tif ($thinkup_post_date !== '1') { thinkup_input_blogdate(); }\n\t\t\t\tif ($thinkup_post_author !== '1') { thinkup_input_blogauthor(); }\n\t\t\t\tif ($thinkup_post_comment !== '1') { thinkup_input_blogcomment(); }\t\n\t\t\t\tif ($thinkup_post_category !== '1') { thinkup_input_blogcategory(); }\n\t\t\t\tif ($thinkup_post_tag !== '1') { thinkup_input_blogtag(); }\n\t\t\techo '</div>';\n\n\t\t\techo '<div class=\"clearboth\"></div></header><!-- .entry-header -->';\n\t}\n}", "function post_custom_meta_box($post)\n {\n }", "function render_meta_box_content( $post ) {\n $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );\n $user_analytics_info = get_post_meta( $post->ID, 'user_analytics_info', true ) ? get_post_meta( $post->ID, 'user_analytics_info', true ) : array();\n ?>\n <table class=\"form-table wpuf-user-analytics-listing\">\n <thead>\n <tr>\n <th><?php _e( 'User info title', 'wpuf-pro' ); ?></th>\n <th><?php _e( 'Value', 'wpuf-pro' ); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php foreach ( $user_analytics_info as $key => $value ): ?>\n <tr>\n <td><strong><?php echo ucfirst( str_replace( '_', ' ', $key ) ); ?></strong></td>\n <td><?php echo $value; ?></td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n <style>\n .wpuf-user-analytics-listing td {\n font-size: 13px;\n }\n .wpuf-user-analytics-listing td, .wpuf-user-analytics-listing th {\n padding: 5px 8px;\n }\n </style>\n <?php\n }", "public function getMetaTitle();", "function wpv_post_meta($post_id, $meta='', $single=false) {\n\t$real_id = wpv_get_the_ID();\n\n\tif ($real_id && $post_id != $real_id)\n\t\t$post_id = $real_id;\n\n\treturn get_post_meta( $post_id, $meta, $single );\n}", "public function show(PostType $postType, Post $post)\n\t{\n\t\t\n\t\t MetaTag::setTitle($post->seo->meta_title);\n MetaTag::setDescription($post->seo->meta_description);\n MetaTag::setKeywords($post->seo->meta_keywords);\n MetaTag::setFacebookTags([\n \t'title' => $post->seo->facebook_title, \n \t'description' => $post->seo->facebook_description, \n \t'image' => url($post->getFirstMediaURL( $post->getMediaCollectionName(), 'facebook')) , \n \t'url' => route('posts.show', [$postType->slug, $post->slug]) \n ]);\n MetaTag::setTwitterDescription($post->seo->twitter_description);\n\n\n\t\t$related_posts = $this->postRepos->getAllRelated($post);\n\n //check if youtube url and id exist in the post:\n $youtubeid = \"\";\n if($post->youtube_url != \"\")\n {\n preg_match('/[\\\\?\\\\&]v=([^\\\\?\\\\&]+)/', $post->youtube_url, $matches);\n $youtubeid = $matches[1];\n }\n\n //check the lang availability\n if(Lang::getLocale() ==\"ar\" && !$post->is_ar)\n \treturn view('front.notavailable_ar');\n if(Lang::getLocale() ==\"en\" && !$post->is_en)\n \treturn view('front.notavailable_en');\n\n\t\t//get the view name\n\t\tif( File::exists($this->viewsPath.\"/show-\".$postType->slug.\".blade.php\" ))\n\t\t\t$viewName = \"front.posts.show-\".$postType->slug;\n\t\telse\n\t\t\t$viewName = \"front.posts.show\";\n\t\t\n\t\treturn view($viewName, ['post' => $post, 'related_posts' => $related_posts, 'youtube_id'=>$youtubeid]);\n\n\n\n\n\t}", "public static function meta_box_info( $post, $args ) {\n\t\tif ( Registrations::get_post_type() !== get_post_type( $post ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$photo_id = get_post_thumbnail_id();\n\t\t$photo = get_post( $photo_id );\n\n\t\t$uploaded_on = sprintf(\n\t\t\t/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */\n\t\t\t__( '%1$s at %2$s' ),\n\t\t\t/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */\n\t\t\tdate_i18n( _x( 'M j, Y', 'publish box date format', 'wporg-photos' ), strtotime( $photo->post_date ) ),\n\t\t\t/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */\n\t\t\tdate_i18n( _x( 'H:i', 'publish box time format', 'wporg-photos' ), strtotime( $photo->post_date ) )\n\t\t);\n\n\t\t$info = [];\n\n\t\t// Certain fields shouldn't be shown unless in contexts where a photo is expected.\n\t\tif ( $photo_id ) {\n\t\t\t$photo_file = get_attached_file( $photo_id );\n\t\t\t$meta = wp_get_attachment_metadata( $photo_id );\n\n\t\t\t$file_size = false;\n\n\t\t\tif ( isset( $meta['filesize'] ) ) {\n\t\t\t\t$file_size = $meta['filesize'];\n\t\t\t} elseif ( file_exists( $photo_file ) ) {\n\t\t\t\t$file_size = filesize( $photo_file );\n\t\t\t}\n\n\t\t\tif ( isset( $meta['width'], $meta['height'] ) ) {\n\t\t\t\t$file_dims = \"<span id='media-dims-$photo_id'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> \";\n\t\t\t} else {\n\t\t\t\t$file_dims = __( 'unknown', 'wporg-photos' );\n\t\t\t}\n\n\t\t\t$info = [\n\t\t\t\t'dimensions' => [\n\t\t\t\t\t'label' => __( 'Dimensions', 'wporg-photos' ),\n\t\t\t\t\t'value' => $file_dims,\n\t\t\t\t],\n\t\t\t\t'filesize' => [\n\t\t\t\t\t'label' => __( 'File size', 'wporg-photos' ),\n\t\t\t\t\t'value' => $file_size ? size_format( $file_size ) : __( 'unknown', 'wporg-photos' ),\n\t\t\t\t],\n\t\t\t\t'filetype' => [\n\t\t\t\t\t'label' => __( 'File type', 'wporg-photos' ),\n\t\t\t\t\t'value' => get_post_mime_type( $photo_id ),\n\t\t\t\t],\n\t\t\t\t'filename' => [\n\t\t\t\t\t'label' => __( 'File name', 'wporg-photos' ),\n\t\t\t\t\t'value' => sprintf(\n\t\t\t\t\t\t'<a href=\"%s\">%s</a>',\n\t\t\t\t\t\tesc_url( wp_get_original_image_url( $photo_id ) ),\n\t\t\t\t\t\tesc_html( wp_basename( $photo_file ) )\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t];\n\t\t}\n\n\t\t$info = array_merge( $info, [\n\t\t\t'orig-filename' => [\n\t\t\t\t'label' => __( 'Original file name', 'wporg-photos' ),\n\t\t\t\t'value' => esc_html( get_post_meta( $post->ID, Registrations::get_meta_key( 'original_filename' ), true ) ),\n\t\t\t],\n\t\t\t'uploaded-at' => [\n\t\t\t\t'label' => __( 'Uploaded on', 'wporg-photos' ),\n\t\t\t\t'value' => $uploaded_on,\n\t\t\t],\n\t\t] );\n\n\t\techo '<dl>';\n\t\tforeach ( $info as $key => $data ) {\n\t\t\techo \"<dt>{$data['label']}</dt>\\n\";\n\t\t\techo \"<dd>{$data['value']}</dd>\\n\";\n\t\t}\n\t\techo \"</dl>\\n\";\n\t}", "public function render_meta_box_content( $post ) {\n\n\t\t// Add an nonce field so we can check for it later.\n\t\twp_nonce_field( 'customify_page_settings', 'customify_page_settings_nonce' );\n\t\t$values = array();\n\t\tforeach ( $this->field_builder->get_all_fields() as $key => $f ) {\n\t\t\tif ( 'multiple_checkbox' == $f['type'] ) {\n\t\t\t\tforeach ( (array) $f['choices'] as $_key => $label ) {\n\t\t\t\t\t$value = get_post_meta( $post->ID, '_customify_' . $_key, true );\n\t\t\t\t\t$values[ $_key ] = $value;\n\t\t\t\t}\n\t\t\t} elseif ( $f['name'] ) {\n\t\t\t\t$values[ $f['name'] ] = get_post_meta( $post->ID, '_customify_' . $f['name'], true );\n\t\t\t}\n\t\t}\n\n\t\t$this->field_builder->set_values( $values );\n\t\t$this->field_builder->render();\n\n\t}", "public static function meta() {\n //echo $this->keywords ? '<meta name=\"keywords\" content=\"'.$this->keywords.'\" />'.\"\\r\\n\" : '';\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />', \"\\r\\n\";\n\n ksort(self::$css);\n foreach (self::$css as $css_arr) {\n foreach ($css_arr as $css) {\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"', $css, '\" />', \"\\r\\n\";\n }\n }\n ksort(self::$js);\n foreach (self::$js as $js_arr) {\n foreach ($js_arr as $js) {\n echo '<script type=\"text/javascript\" src=\"', $js, '\"></script>', \"\\r\\n\";\n }\n }\n }", "function Display_description( $post ) \n{\n // Display code/markup goes here. Don't forget to include nonces!\n ?>\n <div>\n <div>\n <p>\n <label for=\"image_url\"><strong>Image</strong></label>\n </p>\n <p>\n <input placeholder=\"set an image\" name=\"image_url\" id=\"image_url\" value=\"<?php echo get_post_meta($post->ID, \"image_url_value\", true); ?>\" >\n\n </p>\n <p>\n <input type=\"button\" name=\"upload-button\" id=\"upload-button-id\" class=\"button-secondary\" value=\"Upload Image\">\n </p>\n </div>\n </div>\n <div>\n <p>\n <strong>Select Flip Transition</strong>\n </p>\n <p>\n <select name=\"transition\" >\n <option>Left-to-Right</option>\n <option>Top-to-bottom</option>\n </select>\n </p>\n </div>\n <div>\n <p>\n <strong>Enter backside Text</strong>\n </p>\n <p>\n <textarea name=\"description\" placeholder=\"Enter description here...\" rows=\"5\" cols=\"35\"><?php echo get_post_meta($post->ID, \"description_value\", true); ?></textarea>\n </p>\n </div>\n <?php \n}", "function simple_bootstrap_display_post_meta($short=true) {\n?>\n\n <ul class=\"meta text-muted list-inline\">\n <li class=\"list-inline-item\">\n <a href=\"<?php the_permalink() ?>\">\n <i class=\"fas fa-clock\"></i>\n <span class=\"sr-only\"><?php echo __( 'Posted on', 'simple-bootstrap' ) ?></span>\n <?php echo get_the_date(); ?>\n </a>\n </li>\n <li class=\"list-inline-item\">\n <a href=\"<?php echo get_author_posts_url(get_the_author_meta('ID'));?>\">\n <i class=\"fas fa-user\"></i>\n <span class=\"sr-only\"><?php echo __( 'Posted by', 'simple-bootstrap' ) ?></span>\n <?php the_author(); ?>\n </a>\n </li>\n <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?>\n <li class=\"list-inline-item\">\n <?php\n $sp = '<i class=\"fas fa-comment\"></i> ';\n comments_popup_link($sp . __( 'Leave a comment', \"simple-bootstrap\"), $sp . __( '1 Comment', \"simple-bootstrap\"), $sp . __( '% Comments', \"simple-bootstrap\"));\n ?>\n </li>\n <?php endif; ?>\n <?php if (! $short) : ?>\n\n <?php $categories_list = get_the_category_list(', '); ?>\n <?php if ( $categories_list ) : ?>\n <li class=\"list-inline-item\">\n <i class=\"fas fa-folder\"></i>\n <span class=\"sr-only\"><?php echo __( 'Posted in', 'simple-bootstrap' ) ?></span>\n <?php echo $categories_list ?>\n </li>\n <?php endif ?>\n <?php $tags_list = get_the_tag_list('', ', '); ?>\n <?php if ( $tags_list ) : ?>\n <li class=\"list-inline-item\">\n <i class=\"fas fa-tag\"></i>\n <span class=\"sr-only\"><?php echo __( 'Tags:', 'simple-bootstrap' ) ?></span>\n <?php echo $tags_list ?>\n </li>\n <?php endif ?>\n\n <?php edit_post_link(__( 'Edit', \"simple-bootstrap\"), '<li class=\"list-inline-item\"><i class=\"fas fa-pencil-alt\"></i> ', '</li>'); ?>\n <?php endif ?>\n </ul>\n\n<?php\n}", "public function render_meta_box_content( $post ) {\n\t\t// Use nonce for verification\n\t\twp_nonce_field( 'save_related_posts', 'mc_related_posts_nonce' );\n\n\t\t// The actual fields for data entry\n\t\t// Use get_post_meta to retrieve an existing value from the database and use the value for the form\n\t\t$value = get_post_meta( $post->ID, '_mc_related_posts', true );\n\t\techo '<table width=\"100%\"><tr><td width=\"33%\" valign=\"top\">';\n\n\t\techo '<label for=\"show_mc_related_posts\">Chosen posts:</label> ';\n\t\techo '<input type=\"hidden\" id=\"mc_related_posts\" name=\"mc_related_posts\" value=\"'. $value . '\" />';\n\t\techo '<span id=\"show_mc_related_posts\"><br/>loading...</span><br/>';\n\n\t\techo '</td><td width=\"33%\" valign=\"top\">';\n\t\t\n\t\techo '<label for=\"similar_tags\">Add a post with similar tags</label>';\n\t\t\n\t\techo $this->get_suggested_related_posts(null);\n//\t\techo $this->get_titles('');\n\n\t\techo '</td><td width=\"33%\" valign=\"top\">';\n\t\t\n\t\techo '<label for=\"similar_tags\">search posts by title</label><br/>';\n\t\t\n\t\techo '<input type=\"text\" id=\"mc_rp_search\" value=\"\" />';\n\t\techo '<span id=\"mc_rp_search_results\"><br/></span><br/>';\n\n\t\techo '</td></tr></table>';\n\t}", "public function getMetaContent($metaName, ContentInfo $contentInfo);", "public function get_post_metadata($value, $post_id, $meta_key, $single)\n {\n }", "public static function meta_tags() {\n\n\t\t\t$meta_tags_html = '';\n\n\t\t\t$description = get_bloginfo( 'description' );\n\t\t\t$site_name = get_bloginfo( 'name' );\n\t\t\t$logo = \\App\\Madara::getOption( 'logo_image', get_template_directory_uri() . '/images/logo.png' );\n\n\t\t\tif ( is_single() ) {\n\n\t\t\t\tglobal $post;\n\n\t\t\t\t$post_format = get_post_format( $post->ID ) != '' && get_post_format( $post->ID ) == 'video' ? 'video.movie' : 'article';\n\t\t\t\t$url = get_permalink( $post->ID );\n\t\t\t\t$title = get_the_title( $post->ID );\n\t\t\t\t$post_title = $title;\n\n\t\t\t\t$description = $post->post_excerpt;\n\n\t\t\t\tif ( $description == '' ) {\n\t\t\t\t\t$description = substr( strip_tags( $post->post_content ), 0, 165 );\n\t\t\t\t}\n\n\t\t\t\t$thumbnail_url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );\n $image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array(1200, 630) );\n\t\t\t\t$image = $image_attributes ? $image_attributes[0] : null;\n\n\t\t\t\tglobal $_wp_additional_image_sizes;\n\n\t\t\t\t$width = 696;\n\t\t\t\t$height = 391;\n\n\t\t\t\tif ( isset( $_wp_additional_image_sizes['thumbnail'] ) ) {\n\t\t\t\t\t$width = $_wp_additional_image_sizes['thumbnail']['width'];\n\t\t\t\t\t$height = $_wp_additional_image_sizes['thumbnail']['height'];\n\t\t\t\t}\n\n\t\t\t\tif( function_exists( 'madara_manga_meta_tags' ) ){\n\t\t\t\t\t// get manga meta tags\n\t\t\t\t\t$manga_meta_tags = madara_manga_meta_tags( $title, $description, $site_name );\n\n\t\t\t\t\tif( !empty( $manga_meta_tags['title'] ) ){\n\t\t\t\t\t\t$title = $manga_meta_tags['title'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif( !empty( $manga_meta_tags['description'] ) ){\n\t\t\t\t\t\t$description = $manga_meta_tags['description'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif( !empty( $manga_meta_tags['url'] ) ){\n\t\t\t\t\t\t$url = $manga_meta_tags['url'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\t\t<script type=\"application/ld+json\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"@context\": \"http://schema.org\",\n\t\t\t\t\t\t\t\"@type\": \"Article\",\n\t\t\t\t\t\t\t\"mainEntityOfPage\": {\n\t\t\t\t\t\t\t\t\"@type\": \"WebPage\",\n\t\t\t\t\t\t\t\t\"@id\": \"https://google.com/article\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"headline\": \"<?php echo esc_attr( get_the_title( $post->ID ) ); ?>\",\n\t\t\t\t\t\t\t\"image\": {\n\t\t\t\t\t\t\t\t\"@type\": \"ImageObject\",\n\t\t\t\t\t\t\t\t\"url\": \"<?php echo esc_attr( $thumbnail_url ); ?>\",\n\t\t\t\t\t\t\t\t\"height\": <?php echo esc_attr( $height ); ?>,\n\t\t\t\t\t\t\t\t\"width\": <?php echo esc_attr( $width ); ?>\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"datePublished\": \"<?php echo esc_js( $post->post_date_gmt ); ?>\",\n\t\t\t\t\t\t\t\"dateModified\": \"<?php echo esc_js( $post->post_modified_gmt ); ?>\",\n\t\t\t\t\t\t\t\"author\": {\n\t\t\t\t\t\t\t\t\"@type\": \"Person\",\n\t\t\t\t\t\t\t\t\"name\": \"<?php\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$meta_type = Madara::getOption('manga_single_meta_author', 'wp_author');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($meta_type == 'wp_author'){\n\t\t\t\t\t\t\t\t\t$author = get_user_by( 'id', $post->post_author );\n\t\t\t\t\t\t\t\t\tif ( $author ) {\n\t\t\t\t\t\t\t\t\t\techo esc_attr( $author->display_name );\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\tglobal $wp_manga_functions;\n\t\t\t\t\t\t\t\t\t$mangaAuthors = $wp_manga_functions->get_manga_authors($post->ID);\n\t\t\t\t\t\t\t\t\techo esc_attr(strip_tags($mangaAuthors));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t?>\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"publisher\": {\n\t\t\t\t\t\t\t\t\"@type\": \"Organization\",\n\t\t\t\t\t\t\t\t\"name\": \"<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>\",\n\t\t\t\t\t\t\t\t\"logo\": {\n\t\t\t\t\t\t\t\t\t\"@type\": \"ImageObject\",\n\t\t\t\t\t\t\t\t\t\"url\": \"<?php if ( $logo != '' ) {\n\t\t\t\t\t\t\t\t\t\techo esc_attr( $logo );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\techo esc_attr( $thumbnail_url );\n\t\t\t\t\t\t\t\t\t} ?>\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"description\": \"<?php echo esc_attr( strip_shortcodes( $description ) ); ?>\"\n\t\t\t\t\t\t}\n\t\t\t\t\t</script>\n\t\t\t\t<?php\n\n\t\t\t\t$meta_tags_html .= '<meta property=\"og:type\" content=\"' . esc_attr( $post_format ) . '\"/>' . PHP_EOL;\n\n\t\t\t} elseif( is_tax() ){\n\t\t\t\t$term = get_queried_object();\n\n\t\t\t\tif( isset( $term->term_id ) ){\n\t\t\t\t\t$description = term_description( $term->term_id, $term->taxonomy );\n\t\t\t\t\t$description = substr( strip_tags( $description ), 0, 165 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( empty( $image ) ){\n\t\t\t\t$image = $logo;\n\t\t\t}\n\n\t\t\tif( empty( $title ) ){\n\t\t\t\t$title = $site_name . wp_title( '|', false );\n\t\t\t}\n\n\t\t\t$meta_tags_html .= '<meta property=\"og:image\" content=\"' . esc_attr( apply_filters( 'madara_meta_image', $image ) ) . '\"/>' . PHP_EOL;\n\t\t\t$meta_tags_html .= '<meta property=\"og:site_name\" content=\"' . esc_attr( $site_name ) . '\"/>' . PHP_EOL;\n\t\t\t$meta_tags_html .= '<meta property=\"fb:app_id\" content=\"' . \\App\\Madara::getOption( 'facebook_app_id' ) . '\" />' . PHP_EOL;\n\t\t\t$meta_tags_html .= '<meta property=\"og:title\" content=\"' . esc_attr( apply_filters( 'madara_meta_title', $title ) ) . '\"/>' . PHP_EOL;\n\n\t\t\tif( !empty( $url ) ){\n\t\t\t\t$meta_tags_html .= '<meta property=\"og:url\" content=\"' . esc_url( $url ) . '\"/>' . PHP_EOL;\n\t\t\t}\n\n\t\t\tif( !empty( $description ) ){\n\t\t\t\t$meta_tags_html .= '<meta property=\"og:description\" content=\"' . esc_attr( strip_shortcodes( $description ) ) . '\"/>' . PHP_EOL;\n\t\t\t}\n\n\t\t\tif( !empty( $keywords ) ){\n\t\t\t\t$meta_tags_html .= '<meta name=\"keywords\" content=\"' . $keywords . '\"/>' . PHP_EOL;\n\t\t\t}\n\n\t\t\t// Meta for twitter\n\t\t\t$meta_tags_html .= '<meta name=\"twitter:card\" content=\"summary\" />' . PHP_EOL;\n\t\t\t$meta_tags_html .= '<meta name=\"twitter:site\" content=\"@' . esc_attr( $site_name ) . '\" />' . PHP_EOL;\n\t\t\t$meta_tags_html .= '<meta name=\"twitter:title\" content=\"' . esc_attr( $title ) . '\" />' . PHP_EOL;\n\n\t\t\tif( !empty( $description ) ){\n\t\t\t\t$meta_tags_html .= '<meta name=\"twitter:description\" content=\"' . esc_attr( strip_shortcodes( $description ) ) . '\" />' . PHP_EOL;\n\t\t\t}\n\n\t\t\tif( !empty( $url ) ){\n\t\t\t\t$meta_tags_html .= '<meta name=\"twitter:url\" content=\"' . esc_url( $url ) . '\" />' . PHP_EOL;\n\t\t\t}\n\n\t\t\t$meta_tags_html .= '<meta name=\"twitter:image\" content=\"' . esc_attr( $image ) . '\" />' . PHP_EOL;\n\t\t\t\n\t\t\t$meta_tags_html .= '<meta name=\"description\" content=\"' . esc_attr( strip_shortcodes( $description ) ) . '\" />';\n\n\t\t\t$meta_tags_html .= '<meta name=\"generator\" content=\"' . esc_attr( esc_html__( 'Powered by Madara - A powerful multi-purpose theme by Madara', 'madara' ) ) . '\" />' . PHP_EOL;\n\n\t\t\techo apply_filters( 'madara-meta-tags', $meta_tags_html );\n\n\t\t\tdo_action( 'madara-meta-tags' );\n\t\t}", "public static function mb_info( $post ) {\n global $post;\n $tdata = array(\n 'registrar' => Domain::get_registrar( $post->ID ),\n 'expiration' => Domain::get_expiration( $post->ID ),\n 'username' => Domain::get_username( $post->ID ),\n 'password' => Domain::get_password( $post->ID )\n );\n Template::make( 'domain/mb-info', $tdata );\n }", "function render_meta_box( $post ) {\n\t\t$nonce_action = $this->nonce['action'].$post->ID;\n\t\twp_nonce_field( $nonce_action, $this->nonce['name'] );\n\t\t// Load template\n\t\t$file_path = trailingslashit(__DIR__).'views/'.$this->meta_box['file'];\n\t\tif( is_file( $file_path ) && is_readable( $file_path ) ) {\n\t\t\tinclude( $file_path );\n\t\t}\n\t}", "function display_metabox( $post ) {\n\t\t$originType = $this->core->reference_exists( null, $post->ID );\n\n\t\t// Search the references to the files\n\t\tif ( !$originType ) {\n\t\t\t$paths = $this->core->get_paths_from_attachment( $post->ID );\n\t\t\tforeach ( $paths as $path ) {\n\t\t\t\t$originType = $this->core->reference_exists( $path, null );\n\t\t\t\tif ( $originType ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Resolve the readable name for this issue (if exists)\n\t\tif ( $originType ) {\n\t\t\tif ( array_key_exists( $originType, $this->foundTypes ) )\n\t\t\t\techo $this->foundTypes[ $originType ];\n\t\t\telse\n\t\t\t\techo \"It seems to be used as: \" . $originType;\n\t\t}\n\t\t// Otherwise just display the un-readable name\n\t\telse {\n\t\t\techo \"Doesn't seem to be used.\";\n\t\t}\n\t}", "function fiorello_mikado_header_meta() { ?>\n\n\t\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\"/>\n\t\t<link rel=\"profile\" href=\"http://gmpg.org/xfn/11\"/>\n\t\t<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>\n\t\t\t<link rel=\"pingback\" href=\"<?php bloginfo( 'pingback_url' ); ?>\">\n\t\t<?php endif; ?>\n\n\t<?php }", "function honeycomb_post_meta() {\n\t\t?>\n\t\t<aside class=\"entry-meta\">\n\t\t\t<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search.\n\n\t\t\t?>\n\t\t\t<div class=\"author\">\n\t\t\t\t<?php\n\t\t\t\t\techo get_avatar( get_the_author_meta( 'ID' ), 128 );\n\t\t\t\t\techo '<div class=\"label\">' . esc_attr( __( 'Written by', 'honeycomb' ) ) . '</div>';\n\t\t\t\t\tthe_author_posts_link();\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\t/* translators: used between list items, there is a space after the comma */\n\t\t\t$categories_list = get_the_category_list( __( ', ', 'honeycomb' ) );\n\n\t\t\tif ( $categories_list ) : ?>\n\t\t\t\t<div class=\"cat-links\">\n\t\t\t\t\t<?php\n\t\t\t\t\techo '<div class=\"label\">' . esc_attr( __( 'Posted in', 'honeycomb' ) ) . '</div>';\n\t\t\t\t\techo wp_kses_post( $categories_list );\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t<?php endif; // End if categories. ?>\n\n\t\t\t<?php\n\t\t\t/* translators: used between list items, there is a space after the comma */\n\t\t\t$tags_list = get_the_tag_list( '', __( ', ', 'honeycomb' ) );\n\n\t\t\tif ( $tags_list ) : ?>\n\t\t\t\t<div class=\"tags-links\">\n\t\t\t\t\t<?php\n\t\t\t\t\techo '<div class=\"label\">' . esc_attr( __( 'Tagged', 'honeycomb' ) ) . '</div>';\n\t\t\t\t\techo wp_kses_post( $tags_list );\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t<?php endif; // End if $tags_list. ?>\n\n\t\t<?php endif; // End if 'post' == get_post_type(). ?>\n\n\t\t\t<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>\n\t\t\t\t<div class=\"comments-link\">\n\t\t\t\t\t<?php echo '<div class=\"label\">' . esc_attr( __( 'Comments', 'honeycomb' ) ) . '</div>'; ?>\n\t\t\t\t\t<span class=\"comments-link\"><?php comments_popup_link( __( 'Leave a comment', 'honeycomb' ), __( '1 Comment', 'honeycomb' ), __( '% Comments', 'honeycomb' ) ); ?></span>\n\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t</aside>\n\t\t<?php\n\t}", "public function swt_render_meta_box_content( $post ) {\n\t\n\t\t// Add an nonce field so we can check for it later.\n\t\twp_nonce_field( 'swt_testimonial_nonce', 'swt_testimonial_nonce_nonce' );\n\n\t\t// Use get_post_meta to retrieve an existing value from the database.\n\t\t$value = get_post_meta( $post->ID, 'swt_testimonial_text', true );\n\n\t\t// Display the form, using the current value.\n\t\techo '<p><label for=\"swt_testimonial_text\">';\n\t\t_e( 'Enter Your Testimonial Text Here.', 'swt' );\n\t\techo '</label> </p>';\n\t\techo '<textarea id=\"swt_testimonial_text\" rows=\"5\" name=\"swt_testimonial_text\">'.esc_attr( $value ).'</textarea>';\n\t}", "function education_information_meta_box() {\n\t// P1: CSS id\n\t// P2: mata box title\n\t// P3: callback function\n\t// P4: post type this meta box is associated with\n\t// P5: priority level (optional)\n\t// P6: callback function arguments (optional)\n add_meta_box( 'education-information-meta-box', 'Education Information', 'education_information_meta_box_callback', 'education' );\n}" ]
[ "0.7678935", "0.76153183", "0.75185114", "0.73106444", "0.7301531", "0.72853297", "0.72778004", "0.7268532", "0.7203399", "0.710013", "0.7057284", "0.70221335", "0.69878346", "0.6981914", "0.695175", "0.692633", "0.690987", "0.6854962", "0.6841516", "0.6817306", "0.68082416", "0.6806152", "0.6791687", "0.6788581", "0.67451644", "0.6737397", "0.673371", "0.6709686", "0.6686698", "0.6682117", "0.6662313", "0.6657309", "0.66521865", "0.66414", "0.6622318", "0.6618024", "0.6615239", "0.6609952", "0.6598993", "0.6576479", "0.6552063", "0.65228623", "0.65209055", "0.6510634", "0.6499959", "0.6499959", "0.64972734", "0.6476373", "0.6472034", "0.6449311", "0.6448941", "0.6446458", "0.6442493", "0.6439512", "0.6437884", "0.6433978", "0.64323294", "0.64218163", "0.64151525", "0.6406359", "0.6398205", "0.6373099", "0.6373099", "0.6364401", "0.6359673", "0.6357698", "0.6353854", "0.6349223", "0.63411593", "0.63387704", "0.63361967", "0.6325968", "0.63217694", "0.63146746", "0.63092715", "0.63092667", "0.63061273", "0.6297957", "0.62937725", "0.62906647", "0.6282534", "0.62733316", "0.6269762", "0.62586516", "0.6247366", "0.6246529", "0.6236753", "0.6236113", "0.62350756", "0.62345505", "0.62277645", "0.6217334", "0.62098795", "0.62079144", "0.6204871", "0.62023795", "0.62013566", "0.6201147", "0.619904", "0.619897" ]
0.770635
0
filter the tags from the images and iFrame
function filter_ptags_on_images($content){ $content = preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); return preg_replace('/<p>\s*(<iframe .*>*.<\/iframe>)\s*<\/p>/iU', '\1', $content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function thinkup_extract_images_filter( $tu_post ) {\n $regex = '/<img[^>]+>/i';\n\n if ( $tu_post->body && preg_match_all($regex, $tu_post->body, $matches) ) {\n\n $matches = $matches[0];\n\n foreach ( $matches as $match ) {\n\n $regex = '/(src)=(\"[^\"]*\")/i';\n if ( preg_match_all($regex, $match, $src, PREG_SET_ORDER) ) {\n $src = $src[0];\n $tu_post->images[] = trim($src[2], '\"');\n }\n\n }\n\n }\n\n return $tu_post;\n\n}", "function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }", "function wpgrade_filter_ptags_on_images($content){\r\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function baindesign324_filter_ptags_on_images($content){\n\t return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n\t}", "function cardealer_filter_ptags_on_images($content){\r\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function custom_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function po_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function mdwpfp_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function quadro_filter_ptags_on_portfimages($content) {\n\tglobal $post;\n\tif ( $post->post_type != 'quadro_portfolio') return $content;\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function spartan_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function theme_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function bones_filter_ptags_on_images($content)\n{\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function tlh_filter_ptags_on_images( $content ) {\n\treturn preg_replace( '/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content );\n}", "function filter_ptags_on_images($content) {\n // do a regular expression replace...\n // find all p tags that have just\n // <p>maybe some white space<img all stuff up to /> then maybe whitespace </p>\n // replace it with just the image tag...\n return preg_replace('/<p>(\\s*)(<img .* \\/>)(\\s*)<\\/p>/iU', '\\2', $content);\n}", "function filter_ptags_on_images($content) {\n return preg_replace('/<p[^>]*>\\\\s*?(<a .*?><img.*?><\\\\/a>|<img.*?>)?\\\\s*<\\/p>/', '<div class=\"post-image\">$1</div>', $content);\n}", "function tdd_oembed_filter($html, $url, $attr, $post_ID) {\n $return = '<figure class=\"video_container\">'.$html.'</figure>';\n return $return;\n}", "function tac_oembed_filter( $html, $url, $attr, $post_id ) {\n\t$return = '<figure class=\"flexible-container item-margin\">' . $html . '</figure>';\n\treturn $return;\n}", "function images_for_tag($tag=\"global\")\n{\n global $header_images;\n $ret=array();\n foreach($header_images as $img => $tags){\n if(in_array($tag, $tags))\n $ret[] = $img;\n }\n return $ret;\n}", "function wpfme_remove_img_ptags($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function wp_filter_content_tags($content, $context = \\null)\n {\n }", "function jpk_remove_unwanted_tags() {\n\tremove_filter( 'jetpack_open_graph_tags', 'wpcom_twitter_cards_tags' );\n\tremove_filter( 'jetpack_open_graph_tags', 'change_twitter_site_param' );\n}", "function wiziapp_cincopa_filter($content){\n //cincopa\n if(function_exists('WpMediaCincopa_init') || function_exists('_cpmp_WpMediaCincopa_init')){\n $matches = array();\n preg_match_all('/\\[\\s*cincopa\\s*([a-zA-Z0-9_-]*)\\s*\\]/', $content, $matches);\n \n if(empty($matches[1])) {\n return $content;\n }\n \n foreach($matches[1] as $match_key=>$code) {\n $out = $video_out = '';\n\n// $xml_string = file_get_contents(wiziapp_cincopaUrl('rss') . urlencode($code));\n $xml_string = wiziapp_general_http_request('', wiziapp_cincopaUrl('rss') . urlencode($code), 'GET');\n $xml_string = str_replace('jwplayer:', 'jwplayer_', $xml_string);\n $xml = simplexml_load_string($xml_string['body']);\n// $images = wiziapp_cincopaJson($code);\n $images = $xml->channel;\n $counter = 1;\n if ($images) {\n foreach ($images->item as $image){\n $link = $image->enclosure->attributes()->url;\n // $image->content_url = htmlspecialchars_decode($image->content_url);\n // $image->thumbnail_url = htmlspecialchars_decode($image->thumbnail_url);\n if($image->jwplayer_type != 'image'){\n $video_class = ' class=\"unsupported_video_format\" data-wiziapp-type=video';\n $link = $image->jwplayer_image;\n }\n // $out.='<a href=\"http://'.(string)$image->filename.'\">';\n // $out.='<img src=\"http://'.(string)$image->filename.'\" '.($counter == 1?'data-wiziapp-cincopa-id=\"'.$code.'\"':'').' />';\n // $out.='</a>';\n \n else {\n /** We dont resize images anymore!!! Only thumbnails, on demand.\n $image = new WiziappImageHandler($link);\n $size = wiziapp_getImageSize('full_image');\n $url_to_full_sized_image = $image->getResizedImageUrl($link, $size['width'], $size['height'], 'resize');\n\n $size = wiziapp_getImageSize('multi_image');\n $urlToMultiSizedImage = $image->getResizedImageUrl($link, $size['width'], $size['height'], 'resize');\n \n $width = $image->getNewWidth();\n $height = $image->getNewHeight(); */ \n\n $out .= '<a href=\"' . $link . '\" class=\"wiziapp_gallery wiziapp_cincopa_plugin\">';\n $out .= '<img src=\"' . $link . '\" data-wiziapp-cincopa-id=\"' . $code . '\"' . $video_class . ' />';\n $out .= '</a>';\n } \n \n // }elseif($image->jwplayer_type == 'audio'){\n // }else{\n // $video_out .='\n // <object width=\"512\" height=\"430\">\n // <embed width=\"512\" height=\"430\" flashvars=\"&amp;file='.urlencode($link).'&amp;controlbar=bottom&amp;icons=true&amp;playlist=none&amp;autostart=false&amp;linktarget=_blank&amp;repeat=none&amp;stretching=fill\" allowscriptaccess=\"always\" allowfullscreen=\"true\" bgcolor=\"#C0C0C0\" wmode=\"transparent\" src=\"http://www.cincopa.com/media-platform/runtime/player44/player44c.swf\">\n // </object>';\n // ;\n // $video_out .='\n // <object src=\"'.$link.'\" width=\"300\">\n // <param name=\"thumb\" value=\"'.$thumb.'\" />\n // <param name=\"title\" value=\"'.(string)$image->title.'\" />\n // <param name=\"description\" value=\"'.(string)$image->description.'\" />\n // <embed src=\"'.$link.'\" type=\"application/x-shockwave-flash\"></embed>\n // </object>';\n // ;\n // }\n }\n } \n $content = str_replace($matches[0][$match_key], '<p>' . $out . '</p>', $content);\n// $content = str_replace($matches[0][$match_key], '<p>' . $out . '</p><p>' . $video_out . '</p>', $content);\n }\n }\n return $content;\n}", "function filterTags($source) {\n\t\t// filter pass setup\n\t\t$preTag = NULL;\n\t\t$postTag = $source;\n\t\t// find initial tag's position\n\t\t$tagOpen_start = strpos($source, '<');\n\t\t// interate through string until no tags left\n\t\twhile($tagOpen_start !== FALSE) {\n\t\t\t// process tag interatively\n\t\t\t$preTag .= substr($postTag, 0, $tagOpen_start);\n\t\t\t$postTag = substr($postTag, $tagOpen_start);\n\t\t\t$fromTagOpen = substr($postTag, 1);\n\t\t\t// end of tag\n\t\t\t$tagOpen_end = strpos($fromTagOpen, '>');\n\t\t\tif ($tagOpen_end === false) break;\n\t\t\t// next start of tag (for nested tag assessment)\n\t\t\t$tagOpen_nested = strpos($fromTagOpen, '<');\n\t\t\tif (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) {\n\t\t\t\t$preTag .= substr($postTag, 0, ($tagOpen_nested+1));\n\t\t\t\t$postTag = substr($postTag, ($tagOpen_nested+1));\n\t\t\t\t$tagOpen_start = strpos($postTag, '<');\n\t\t\t\tcontinue;\n\t\t\t} \n\t\t\t$tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1);\n\t\t\t$currentTag = substr($fromTagOpen, 0, $tagOpen_end);\n\t\t\t$tagLength = strlen($currentTag);\n\t\t\tif (!$tagOpen_end) {\n\t\t\t\t$preTag .= $postTag;\n\t\t\t\t$tagOpen_start = strpos($postTag, '<');\t\t\t\n\t\t\t}\n\t\t\t// iterate through tag finding attribute pairs - setup\n\t\t\t$tagLeft = $currentTag;\n\t\t\t$attrSet = array();\n\t\t\t$currentSpace = strpos($tagLeft, ' ');\n\t\t\t// is end tag\n\t\t\tif (substr($currentTag, 0, 1) == \"/\") {\n\t\t\t\t$isCloseTag = TRUE;\n\t\t\t\tlist($tagName) = explode(' ', $currentTag);\n\t\t\t\t$tagName = substr($tagName, 1);\n\t\t\t// is start tag\n\t\t\t} else {\n\t\t\t\t$isCloseTag = FALSE;\n\t\t\t\tlist($tagName) = explode(' ', $currentTag);\n\t\t\t}\t\t\n\t\t\t// excludes all \"non-regular\" tagnames OR no tagname OR remove if xssauto is on and tag is blacklisted\n\t\t\tif ((!preg_match(\"/^[a-z][a-z0-9]*$/i\",$tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) { \t\t\t\t\n\t\t\t\t$postTag = substr($postTag, ($tagLength + 2));\n\t\t\t\t$tagOpen_start = strpos($postTag, '<');\n\t\t\t\t// don't append this tag\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// this while is needed to support attribute values with spaces in!\n\t\t\twhile ($currentSpace !== FALSE) {\n\t\t\t\t$fromSpace = substr($tagLeft, ($currentSpace+1));\n\t\t\t\t$nextSpace = strpos($fromSpace, ' ');\n\t\t\t\t$openQuotes = strpos($fromSpace, '\"');\n\t\t\t\t$closeQuotes = strpos(substr($fromSpace, ($openQuotes+1)), '\"') + $openQuotes + 1;\n\t\t\t\t// another equals exists\n\t\t\t\tif (strpos($fromSpace, '=') !== FALSE) {\n\t\t\t\t\t// opening and closing quotes exists\n\t\t\t\t\tif (($openQuotes !== FALSE) && (strpos(substr($fromSpace, ($openQuotes+1)), '\"') !== FALSE))\n\t\t\t\t\t\t$attr = substr($fromSpace, 0, ($closeQuotes+1));\n\t\t\t\t\t// one or neither exist\n\t\t\t\t\telse $attr = substr($fromSpace, 0, $nextSpace);\n\t\t\t\t// no more equals exist\n\t\t\t\t} else $attr = substr($fromSpace, 0, $nextSpace);\n\t\t\t\t// last attr pair\n\t\t\t\tif (!$attr) $attr = $fromSpace;\n\t\t\t\t// add to attribute pairs array\n\t\t\t\t$attrSet[] = $attr;\n\t\t\t\t// next inc\n\t\t\t\t$tagLeft = substr($fromSpace, strlen($attr));\n\t\t\t\t$currentSpace = strpos($tagLeft, ' ');\n\t\t\t}\n\t\t\t// appears in array specified by user\n\t\t\t$tagFound = in_array(strtolower($tagName), $this->tagsArray);\t\t\t\n\t\t\t// remove this tag on condition\n\t\t\tif ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) {\n\t\t\t\t// reconstruct tag with allowed attributes\n\t\t\t\tif (!$isCloseTag) {\n\t\t\t\t\t$attrSet = $this->filterAttr($attrSet);\n\t\t\t\t\t$preTag .= '<' . $tagName;\n\t\t\t\t\tfor ($i = 0; $i < count($attrSet); $i++)\n\t\t\t\t\t\t$preTag .= ' ' . $attrSet[$i];\n\t\t\t\t\t// reformat single tags to XHTML\n\t\t\t\t\tif (strpos($fromTagOpen, \"</\" . $tagName)) $preTag .= '>';\n\t\t\t\t\telse $preTag .= ' />';\n\t\t\t\t// just the tagname\n\t\t\t } else $preTag .= '</' . $tagName . '>';\n\t\t\t}\n\t\t\t// find next tag's start\n\t\t\t$postTag = substr($postTag, ($tagLength + 2));\n\t\t\t$tagOpen_start = strpos($postTag, '<');\t\t\t\n\t\t}\n\t\t// append any code after end of tags\n\t\t$preTag .= $postTag;\n\t\treturn $preTag;\n\t}", "function filter_single_image_atts( $out, $pairs, $atts ){\n\t\t\t\n\t\t\tif( isset( $out['photo_frame'] ) && filter_var( $out['photo_frame'], FILTER_VALIDATE_BOOLEAN ) === true )\n\t\t\t\t$out['el_class'] = $out['el_class'] . ' photo-frame';\n\t\t\t\n\t\t\tif( isset( $out['zoomify'] ) && filter_var( $out['zoomify'], FILTER_VALIDATE_BOOLEAN ) === true ){\n\t\t\t\t\n\t\t\t\tif( ! wp_script_is('curly-picture-zoom' ) ) { \n\t\t\t\t\t\n\t\t\t\t\twp_enqueue_script('curly-picture-zoom');\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$out['el_class'] = $out['el_class'] . ' zoom-picture-container photo-frame';\n\t\t\t\t\n\t\t\t}\t\n\t\t \n\t\t return $out;\n\t\t\t\n\t\t}", "function thinkup_opengraph_filter ( $tu_post ) {\n\n if ( $tu_post->html ) {\n $doc = new DomDocument();\n $doc->loadHTML($tu_post->html);\n $xpath = new DOMXPath($doc);\n $query = '//*/meta[starts-with(@property, \\'og:\\')]';\n $metas = $xpath->query($query);\n foreach ($metas as $meta) {\n $property = $meta->getAttribute('property');\n $content = $meta->getAttribute('content');\n $tu_post->metadata['opengraph'][$property] = $content;\n }\n }\n\n return $tu_post;\n}", "function limit_content() {\n $content = get_the_content();\n $content = preg_replace('/(<)([img])(\\w+)([^>]*>)/', \"\", $content);\n $content = apply_filters('the_content', $content);\n $content = str_replace(']]>', ']]&gt;', $content);\n echo $content;\n}", "public function removeAllTags() {}", "function extract_embedded_images_from_post_content() {\n // be consistent with media_images.\n // http://stackoverflow.com/a/20861974/6763239\n $embedded_images = array();\n\n $img_nodes = $this->dom->getElementsByTagName('img');\n\n foreach ( $img_nodes as $img_node ) {\n $embedded_images[] = new EmbeddedImage($img_node, $this);\n }\n\n return $embedded_images;\n }", "function remove_tags_intra_tags() {\r\n\t\t$ct_intra_tags = 0;\r\n\t\t$ct2 = -1;\r\n\t\twhile($ct2 != 0) {\r\n\t\t\t/*preg_match_all('/(<[^>]*)<[^<>]+?>/is', $this->code, $debug_matches);\r\n\t\t\tprint('$debug_matches: ');var_dump($debug_matches);*/\r\n\t\t\t$this->code = preg_replace('/(<(![^\\-][^<>]+|[^!<>]+))<[^<>]+?>/is', '$1', $this->code, -1, $ct2); // changed (2012-01-25)\r\n\t\t\t$ct_intra_tags += $ct2;\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags intra tags removed\", $ct_intra_tags);\r\n\t\t// we must also ignore the <head>!\r\n\t\t// the only tag that has content in the head that I can think of is <title>, so:\r\n\t\tpreg_match_all('/<title>(.*?)<\\/title>/is', $this->code, $title_matches);\r\n\t\tif(sizeof($title_matches[0]) > 1) {\r\n\t\t\tprint(\"Well, that's not good; found more than one (\" . sizeof($title_matches[0]) . \") &lt;title&gt; tags on this page!\");exit(0);\r\n\t\t}\r\n\t\tif(sizeof($title_matches[0]) === 0) {\r\n\t\t\t// nothing to do\r\n\t\t} else {\r\n\t\t\t$ct_title = 0;\r\n\t\t\t$initial_title_string = $title_string = $title_matches[0][0];\r\n\t\t\t$ct1 = -1;\r\n\t\t\r\n\t\t\twhile($ct1 != 0) {\r\n\t\t\t\t$title_string = preg_replace('/<title>(.*?)<[^<>]+?>(.*?)<\\/title>/is', '<title>$1$2</title>', $title_string, -1, $ct1);\r\n\t\t\t\t$ct_title += $ct1;\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_title_string, $title_string, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags removed from title tag\", $ct_title);\r\n\t\t// this should only happen if something exists in both the acronyms and abbr files (erroneously) or if\r\n\t\t// an bbreviation is a substring of another abbreviation but we'll still clean it up\r\n\t\t//$this->code = preg_replace('/<(abbr|acronym) title=\"([^\"]*?)\"><(abbr|acronym) title=\"([^\"]*?)\">(.*?)<\\/(abbr|acronym)><\\/(abbr|acronym)>/is', '<$1 title=\"$2\">$4</$5>', $this->code, -1, $ct_redundant_acro);\r\n\t\t$ct_redundant_acro = 0;\r\n\t\t$array_tags = array('abbr', 'acronym');\r\n\t\t$tagNamesString = implode('|', $array_tags);\r\n\t\tforeach($array_tags as $tagName) {\r\n\t\t\t$OStrings = OM::getAllOStrings($this->code, '<' . $tagName, '</' . $tagName . '>');\r\n\t\t\t//var_dump($OStrings);exit(0);\r\n\t\t\t$counter = sizeof($OStrings) - 1;\r\n\t\t\twhile($counter >= 0) {\r\n\t\t\t\t$OString = $OStrings[$counter][0];\r\n\t\t\t\t$opening_tag = substr($OString, 0, strpos($OString, '>') + 1);\r\n\t\t\t\t$closing_tag = substr($OString, ReTidy::strpos_last($OString, '<'));\r\n\t\t\t\t$code_to_clean = substr($OString, strlen($opening_tag), strlen($OString) - strlen($opening_tag) - strlen($closing_tag));\r\n\t\t\t\t$needs_to_be_cleaned = false;\r\n\t\t\t\tforeach($array_tags as $tagName2) {\r\n\t\t\t\t\tif(strpos($code_to_clean, '<' . $tagName2) !== false) {\r\n\t\t\t\t\t\t$needs_to_be_cleaned = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($needs_to_be_cleaned) {\r\n\t\t\t\t\t$offset = $OStrings[$counter][1];\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<(' . $tagNamesString . ')[^<>]*?>/is', '', $code_to_clean);\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<\\/(' . $tagNamesString . ')>/is', '', $code_to_clean);\r\n\t\t\t\t\t$new_OString = $opening_tag . $code_to_clean . $closing_tag;\r\n\t\t\t\t\t$this->code = substr($this->code, 0, $offset) . $new_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t$ct_redundant_acro += 1;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logMsgIf(\"redundant acronyms applications removed\", $ct_redundant_acro);\r\n\t}", "function filter($content){\n$content=str_replace(\"Try it Yourself\",\"Run\",$content);\n$content=str_replace('Exercise','Lesson',$content);\n$content=str_replace('colormap.gif','/images/colormap.gif',$content);\n$content=str_replace('objectExplained.gif','http://www.w3schools.com/js/objectExplained.gif',$content);\n$content=str_replace('pic_chart.jpg','http://www.w3schools.com/browsers/pic_chart.jpg',$content);\n$content=str_replace('pic_ie.jpg','http://www.w3schools.com/html/pic_ie.jpg',$content);\n$content=str_replace('pic_ie128.jpg','http://www.w3schools.com/browsers/pic_ie128.jpg',$content);\n$content=str_replace('pic_chrome128.gif','http://www.w3schools.com/browsers/pic_chrome128.gif',$content);\n$content=str_replace('pic_firefox128.png','http://www.w3schools.com/browsers/pic_firefox128.png',$content);\n$content=str_replace('pic_safari128.gif','http://www.w3schools.com/browsers/pic_safari128.gif',$content);\n$content=str_replace('pic_opera128.jpg','http://www.w3schools.com/browsers/pic_opera128.jpg',$content);\n$content=str_replace('pic_iphone.jpg','http://www.w3schools.com/browsers/pic_iphone.jpg',$content);\n$content=str_replace('/cert/pic_html_cert_small.gif','/images/avatar-hat-240.png',$content);\n$content=str_replace('mov_bbb.mp4','http://www.w3schools.com/html/mov_bbb.mp4',$content);\n$content=str_replace('mov_bbb.ogg','http://www.w3schools.com/html/mov_bbb.ogg',$content);\n$content=str_replace('pic_video.jpg','http://www.w3schools.com/html/pic_video.jpg',$content);\n$content=str_replace('tryhtml5_canvas_coordinates.htm','http://www.w3schools.com/html/tryhtml5_canvas_coordinates.htm',$content);\n$content=str_replace('pic_mountain.jpg','http://www.w3schools.com/html/pic_mountain.jpg',$content);\n$content=str_replace('pic_graph.png','http://www.w3schools.com/html/pic_graph.png',$content);\n$content=str_replace('pic_notepad.jpg','http://www.w3schools.com/html/pic_notepad.jpg',$content);\n$content=str_replace('iphone5.png','http://www.w3schools.com/jquerymobile/iphone5.png',$content);\n$content=str_replace('icons/','http://www.w3schools.com/jquerymobile/icons/',$content);\n$content=str_replace('tryjqmob_touch.htm','http://www.w3schools.com/jquerymobile/tryjqmob_touch.htm',$content);\n$content=str_replace('tryjqmob_switch.htm','http://www.w3schools.com/jquerymobile/tryjqmob_switch.htm',$content);\n$content=str_replace('tryjqmob_slider.htm','http://www.w3schools.com/jquerymobile/tryjqmob_slider.htm',$content);\n$content=str_replace('selectmenu.jpg','http://www.w3schools.com/jquerymobile/selectmenu.jpg',$content);\n$content=str_replace('tryjqmob_forms.htm','http://www.w3schools.com/jquerymobile/tryjqmob_forms.htm',$content);\n$content=str_replace('tryjqmob_filters_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_filters_app.htm',$content);\n$content=str_replace('tryjqmob_lists.htm','http://www.w3schools.com/jquerymobile/tryjqmob_lists.htm',$content);\n$content=str_replace('tryjqmob_lists_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_lists_app.htm',$content);\n$content=str_replace('tryjqmob_collapsible_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_collapsible_app.htm',$content);\n$content=str_replace('tryjqmob_panels_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_panels_app.htm',$content);\n$content=str_replace('tryjqmob_navbars_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_navbars_app.htm',$content);\n$content=str_replace('tryjqmob_toolbars.htm','http://www.w3schools.com/jquerymobile/tryjqmob_toolbars.htm',$content);\n$content=str_replace('tryjqmob_default.htm','http://www.w3schools.com/jquerymobile/tryjqmob_default.htm',$content);\n$content=str_replace('tryjqmob_popup_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_popup_app.htm',$content);\n$content=str_replace('tryjqmob_icon_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_icon_app.htm',$content);\n$content=str_replace('tryjqmob_button_app.htm','http://www.w3schools.com/jquerymobile/jqmsupport.jpg',$content);\n$content=str_replace('<img src=\"/images/w3cert.gif\"','<div class=\"bottom-ads\"',$content);\n$content=str_replace('src=\"selector.gif\"','src=\"http://www.w3schools.com/css/selector.gif\"',$content);\n$content=str_replace('href','data-href',$content);\n$content=str_replace('W3Schools','Website myweb.pro.vn',$content);\n$content=str_replace('pic_html5.gif','/images/pic_html5.gif',$content);\n$content=str_replace('bs.png','http://www.w3schools.com/bootstrap/bs.png',$content);\n$content=str_replace('transforms.gif','http://www.w3schools.com/css/transforms.gif',$content);\n$content=str_replace('pic_angular.jpg','http://www.w3schools.com/angular/pic_angular.jpg',$content);\n$content=str_replace('pic_appml.jpg','http://www.w3schools.com/appml/pic_appml.jpg',$content);\n$content=str_replace('nodetree.gif','http://www.w3schools.com/dom/nodetree.gif',$content);\n$content=str_replace('Customers.html','http://www.w3schools.com/website/Customers.html',$content);\n$content=str_replace('pic_browsers_pie.png','http://www.w3schools.com/browsers/pic_browsers_pie.png',$content);\n$content=str_replace('pic_chrome50.gif','http://www.w3schools.com/browsers/pic_chrome50.gif',$content);\n$content=str_replace('pic_firefox50.png','http://www.w3schools.com/browsers/pic_firefox50.png',$content);\n$content=str_replace('pic_ie50.png','http://www.w3schools.com/browsers/pic_ie50.png',$content);\n$content=str_replace('pic_safari50.gif','http://www.w3schools.com/browsers/pic_safari50.gif',$content);\n$content=str_replace('pic_opera50.gif','http://www.w3schools.com/browsers/pic_opera50.gif',$content);\n$content=str_replace('http://www.w3schools.com/html/demo_html.asp','http://myweb.pro.vn/',$content);\n$content=str_replace('http://www.w3schools.com/stdtheme.css','http://myweb.pro.vn/css/font-awesome.css',$content);\n$content=str_replace('http://www.w3schools.com/html/demo_xhtml.asp','http://myweb.pro.vn/toefl/index',$content);\n$content=str_replace('http://www.w3schools.com/dom/note.xml','http://myweb.pro.vn/game/',$content);\nreturn $content;\n}", "public function tags();", "public static function filter_the_content( $content ) {\n\t\t$images = static::parse_images_from_html( $content );\n\n\t\tif ( ! empty( $images ) ) {\n\t\t\t$content_width = isset( $GLOBALS['content_width'] ) ? $GLOBALS['content_width'] : false;\n\n\t\t\t$image_sizes = self::image_sizes();\n\t\t\t$upload_dir = wp_upload_dir();\n\t\t\t$attachment_ids = [];\n\n\t\t\tforeach ( $images[0] as $tag ) {\n\t\t\t\tif ( preg_match( '/wp-image-([0-9]+)/i', $tag, $class_id ) && absint( $class_id[1] ) ) {\n\t\t\t\t\t// Overwrite the ID when the same image is included more than once.\n\t\t\t\t\t$attachment_ids[ $class_id[1] ] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( count( $attachment_ids ) > 1 ) {\n\t\t\t\t/*\n\t\t\t\t * Warm the object cache with post and meta information for all found\n\t\t\t\t * images to avoid making individual database calls.\n\t\t\t\t */\n\t\t\t\t_prime_post_caches( array_keys( $attachment_ids ), false, true );\n\t\t\t}\n\n\t\t\tforeach ( $images[0] as $index => $tag ) {\n\t\t\t\t// Default to resize, though fit may be used in certain cases where a dimension cannot be ascertained.\n\t\t\t\t$transform = 'resize';\n\n\t\t\t\t// Start with a clean size and attachment ID each time.\n\t\t\t\t$attachment_id = false;\n\t\t\t\tunset( $size );\n\n\t\t\t\t// Flag if we need to munge a fullsize URL.\n\t\t\t\t$fullsize_url = false;\n\n\t\t\t\t// Identify image source.\n\t\t\t\t$src = $src_orig = $images['img_url'][ $index ];\n\n\t\t\t\t/**\n\t\t\t\t * Allow specific images to be skipped by Tachyon.\n\t\t\t\t *\n\t\t\t\t * @since 2.0.3\n\t\t\t\t *\n\t\t\t\t * @param bool false Should Tachyon ignore this image. Default to false.\n\t\t\t\t * @param string $src Image URL.\n\t\t\t\t * @param string $tag Image Tag (Image HTML output).\n\t\t\t\t */\n\t\t\t\tif ( apply_filters( 'tachyon_skip_image', false, $src, $tag ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Support Automattic's Lazy Load plugin.\n\t\t\t\t// Can't modify $tag yet as we need unadulterated version later.\n\t\t\t\tif ( preg_match( '#data-lazy-src=[\"|\\'](.+?)[\"|\\']#i', $images['img_tag'][ $index ], $lazy_load_src ) ) {\n\t\t\t\t\t$placeholder_src = $placeholder_src_orig = $src;\n\t\t\t\t\t$src = $src_orig = $lazy_load_src[1];\n\t\t\t\t} elseif ( preg_match( '#data-lazy-original=[\"|\\'](.+?)[\"|\\']#i', $images['img_tag'][ $index ], $lazy_load_src ) ) {\n\t\t\t\t\t$placeholder_src = $placeholder_src_orig = $src;\n\t\t\t\t\t$src = $src_orig = $lazy_load_src[1];\n\t\t\t\t}\n\n\t\t\t\t// Check if image URL should be used with Tachyon.\n\t\t\t\tif ( self::validate_image_url( $src ) ) {\n\t\t\t\t\t// Find the width and height attributes.\n\t\t\t\t\t$width = $height = false;\n\n\t\t\t\t\t// First, check the image tag.\n\t\t\t\t\tif ( preg_match( '#width=[\"|\\']?([\\d%]+)[\"|\\']?#i', $images['img_tag'][ $index ], $width_string ) ) {\n\t\t\t\t\t\t$width = $width_string[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( preg_match( '#height=[\"|\\']?([\\d%]+)[\"|\\']?#i', $images['img_tag'][ $index ], $height_string ) ) {\n\t\t\t\t\t\t$height = $height_string[1];\n\t\t\t\t\t}\n\n\t\t\t\t\t// If image tag lacks width or height arguments, try to determine from strings WP appends to resized image filenames.\n\t\t\t\t\tif ( ! $width || ! $height ) {\n\t\t\t\t\t\t$size_from_file = static::parse_dimensions_from_filename( $src );\n\t\t\t\t\t\t$width = $width ?: $size_from_file[0];\n\t\t\t\t\t\t$height = $height ?: $size_from_file[1];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Can't pass both a relative width and height, so unset the height in favor of not breaking the horizontal layout.\n\t\t\t\t\tif ( false !== strpos( $width, '%' ) && false !== strpos( $height, '%' ) ) {\n\t\t\t\t\t\t$width = $height = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Detect WP registered image size from HTML class.\n\t\t\t\t\tif ( preg_match( '#class=[\"|\\']?[^\"\\']*size-([^\"\\'\\s]+)[^\"\\']*[\"|\\']?#i', $images['img_tag'][ $index ], $matches ) ) {\n\t\t\t\t\t\t$size = array_pop( $matches );\n\n\t\t\t\t\t\tif ( false === $width && false === $height && isset( $size ) && array_key_exists( $size, $image_sizes ) ) {\n\t\t\t\t\t\t\t$size_from_wp = wp_get_attachment_image_src( $attachment_id, $size );\n\t\t\t\t\t\t\t$width = $size_from_wp[1];\n\t\t\t\t\t\t\t$height = $size_from_wp[2];\n\t\t\t\t\t\t\t$transform = $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// WP Attachment ID, if uploaded to this site.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreg_match( '#class=[\"|\\']?[^\"\\']*wp-image-([\\d]+)[^\"\\']*[\"|\\']?#i', $images['img_tag'][ $index ], $class_attachment_id ) &&\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t0 === strpos( $src, $upload_dir['baseurl'] ) ||\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Filter whether an image using an attachment ID in its class has to be uploaded to the local site to go through Tachyon.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @since 2.0.3\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @param bool false Was the image uploaded to the local site. Default to false.\n\t\t\t\t\t\t\t * @param array $args {\n\t\t\t\t\t\t\t * Array of image details.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @type $src Image URL.\n\t\t\t\t\t\t\t * @type tag Image tag (Image HTML output).\n\t\t\t\t\t\t\t * @type $images Array of information about the image.\n\t\t\t\t\t\t\t * @type $index Image index.\n\t\t\t\t\t\t\t * }\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tapply_filters( 'tachyon_image_is_local', false, compact( 'src', 'tag', 'images', 'index' ) )\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$class_attachment_id = intval( array_pop( $class_attachment_id ) );\n\n\t\t\t\t\t\tif ( $class_attachment_id ) {\n\t\t\t\t\t\t\t$attachment = get_post( $class_attachment_id );\n\t\t\t\t\t\t\t// Basic check on returned post object.\n\t\t\t\t\t\t\tif ( is_object( $attachment ) && ! is_wp_error( $attachment ) && 'attachment' === $attachment->post_type ) {\n\t\t\t\t\t\t\t\t$attachment_id = $attachment->ID;\n\n\t\t\t\t\t\t\t\t// If we still don't have a size for the image, use the attachment_id\n\t\t\t\t\t\t\t\t// to lookup the size for the image in the URL.\n\t\t\t\t\t\t\t\tif ( ! isset( $size ) ) {\n\t\t\t\t\t\t\t\t\t$meta = wp_get_attachment_metadata( $attachment_id );\n\t\t\t\t\t\t\t\t\tif ( $meta['sizes'] ) {\n\t\t\t\t\t\t\t\t\t\t$sizes = wp_list_filter( $meta['sizes'], [ 'file' => basename( $src ) ] );\n\t\t\t\t\t\t\t\t\t\tif ( $sizes ) {\n\t\t\t\t\t\t\t\t\t\t\t$size_names = array_keys( $sizes );\n\t\t\t\t\t\t\t\t\t\t\t$size = array_pop( $size_names );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// If we still don't have a size for the image but know the dimensions,\n\t\t\t\t\t\t\t\t// use the attachment sources to determine the size. Tachyon modifies\n\t\t\t\t\t\t\t\t// wp_get_attachment_image_src() to account for sizes created after upload.\n\t\t\t\t\t\t\t\tif ( ! isset( $size ) && $width && $height ) {\n\t\t\t\t\t\t\t\t\t$sizes = array_keys( $image_sizes );\n\t\t\t\t\t\t\t\t\tforeach ( $sizes as $size ) {\n\t\t\t\t\t\t\t\t\t\t$size_per_wp = wp_get_attachment_image_src( $attachment_id, $size );\n\t\t\t\t\t\t\t\t\t\tif ( $width === $size_per_wp[1] && $height === $size_per_wp[2] ) {\n\t\t\t\t\t\t\t\t\t\t\t$transform = $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tunset( $size ); // Prevent loop from polluting $size if it's incorrect.\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( isset( $size ) && false === $width && false === $height && array_key_exists( $size, $image_sizes ) ) {\n\t\t\t\t\t\t\t\t\t$width = (int) $image_sizes[ $size ]['width'];\n\t\t\t\t\t\t\t\t\t$height = (int) $image_sizes[ $size ]['height'];\n\t\t\t\t\t\t\t\t\t$transform = $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * If size is still not set the dimensions were not provided by either\n\t\t\t\t\t\t\t\t * a class or by parsing the URL. Only the full sized image should return\n\t\t\t\t\t\t\t\t * no dimensions when returning the URL so it's safe to assume the $size is full.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$size = isset( $size ) ? $size : 'full';\n\n\t\t\t\t\t\t\t\t$src_per_wp = wp_get_attachment_image_src( $attachment_id, $size );\n\n\t\t\t\t\t\t\t\tif ( self::validate_image_url( $src_per_wp[0] ) ) {\n\t\t\t\t\t\t\t\t\t$src = $src_per_wp[0];\n\t\t\t\t\t\t\t\t\t$fullsize_url = true;\n\n\t\t\t\t\t\t\t\t\t// Prevent image distortion if a detected dimension exceeds the image's natural dimensions.\n\t\t\t\t\t\t\t\t\tif ( ( false !== $width && $width > $src_per_wp[1] ) || ( false !== $height && $height > $src_per_wp[2] ) ) {\n\t\t\t\t\t\t\t\t\t\t$width = false === $width ? false : min( $width, $src_per_wp[1] );\n\t\t\t\t\t\t\t\t\t\t$height = false === $height ? false : min( $height, $src_per_wp[2] );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// If no width and height are found, max out at source image's natural dimensions.\n\t\t\t\t\t\t\t\t\t// Otherwise, respect registered image sizes' cropping setting.\n\t\t\t\t\t\t\t\t\tif ( false === $width && false === $height ) {\n\t\t\t\t\t\t\t\t\t\t$width = $src_per_wp[1];\n\t\t\t\t\t\t\t\t\t\t$height = $src_per_wp[2];\n\t\t\t\t\t\t\t\t\t\t$transform = 'fit';\n\t\t\t\t\t\t\t\t\t} elseif ( isset( $size ) && array_key_exists( $size, $image_sizes ) && isset( $image_sizes[ $size ]['crop'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$transform = (bool) $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tunset( $attachment );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// If width is available, constrain to $content_width.\n\t\t\t\t\tif ( false !== $width && false === strpos( $width, '%' ) && is_numeric( $content_width ) ) {\n\t\t\t\t\t\tif ( $width > $content_width && false !== $height && false === strpos( $height, '%' ) ) {\n\t\t\t\t\t\t\t$height = round( ( $content_width * $height ) / $width );\n\t\t\t\t\t\t\t$width = $content_width;\n\t\t\t\t\t\t} elseif ( $width > $content_width ) {\n\t\t\t\t\t\t\t$width = $content_width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set a width if none is found and $content_width is available.\n\t\t\t\t\t// If width is set in this manner and height is available, use `fit` instead of `resize` to prevent skewing.\n\t\t\t\t\tif ( false === $width && is_numeric( $content_width ) ) {\n\t\t\t\t\t\t$width = (int) $content_width;\n\n\t\t\t\t\t\tif ( false !== $height ) {\n\t\t\t\t\t\t\t$transform = 'fit';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Detect if image source is for a custom-cropped thumbnail and prevent further URL manipulation.\n\t\t\t\t\tif ( ! $fullsize_url && preg_match_all( '#-e[a-z0-9]+(-\\d+x\\d+)?\\.(' . implode( '|', self::$extensions ) . '){1}$#i', basename( $src ), $filename ) ) {\n\t\t\t\t\t\t$fullsize_url = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Build URL, first maybe removing WP's resized string so we pass the original image to Tachyon.\n\t\t\t\t\tif ( ! $fullsize_url ) {\n\t\t\t\t\t\t$src = self::strip_image_dimensions_maybe( $src );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Build array of Tachyon args and expose to filter before passing to Tachyon URL function.\n\t\t\t\t\t$args = [];\n\n\t\t\t\t\tif ( false !== $width && false !== $height && false === strpos( $width, '%' ) && false === strpos( $height, '%' ) ) {\n\t\t\t\t\t\tif ( ! isset( $size ) || $size !== 'full' ) {\n\t\t\t\t\t\t\t$args[ $transform ] = $width . ',' . $height;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set the gravity from the registered image size.\n\t\t\t\t\t\t// Crop weight array values are in x, y order but the value `westsouth` will\n\t\t\t\t\t\t// cause Sharp to error and Tachyon to return a 404, it needs to be `southwest`\n\t\t\t\t\t\t// so we reverse the crop array to y, x order.\n\t\t\t\t\t\tif ( 'resize' === $transform && isset( $size ) && $size !== 'full' && array_key_exists( $size, $image_sizes ) && is_array( $image_sizes[ $size ]['crop'] ) ) {\n\t\t\t\t\t\t\t$args['gravity'] = implode( '', array_map( function ( $v ) {\n\t\t\t\t\t\t\t\t$map = [\n\t\t\t\t\t\t\t\t\t'top' => 'north',\n\t\t\t\t\t\t\t\t\t'center' => '',\n\t\t\t\t\t\t\t\t\t'bottom' => 'south',\n\t\t\t\t\t\t\t\t\t'left' => 'west',\n\t\t\t\t\t\t\t\t\t'right' => 'east',\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\treturn $map[ $v ];\n\t\t\t\t\t\t\t}, array_reverse( $image_sizes[ $size ]['crop'] ) ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( false !== $width ) {\n\t\t\t\t\t\t$args['w'] = $width;\n\t\t\t\t\t} elseif ( false !== $height ) {\n\t\t\t\t\t\t$args['h'] = $height;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Final logic check to determine the size for an unknown attachment ID.\n\t\t\t\t\tif ( ! isset( $size ) ) {\n\t\t\t\t\t\tif ( $width ) {\n\t\t\t\t\t\t\t$filter['width'] = $width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $height ) {\n\t\t\t\t\t\t\t$filter['height'] = $height;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $filter ) ) {\n\t\t\t\t\t\t\t$sizes = wp_list_filter( $image_sizes, $filter );\n\t\t\t\t\t\t\tif ( empty( $sizes ) ) {\n\t\t\t\t\t\t\t\t$sizes = wp_list_filter( $image_sizes, $filter, 'OR' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( ! empty( $sizes ) ) {\n\t\t\t\t\t\t\t\t$size = reset( $sizes );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! isset( $size ) ) {\n\t\t\t\t\t\t// Custom size, send an array.\n\t\t\t\t\t\t$size = [ $width, $height ];\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filter the array of Tachyon arguments added to an image when it goes through Tachyon.\n\t\t\t\t\t * By default, only includes width and height values.\n\t\t\t\t\t *\n\t\t\t\t\t * @see https://developer.wordpress.com/docs/photon/api/\n\t\t\t\t\t *\n\t\t\t\t\t * @param array $args Array of Tachyon Arguments.\n\t\t\t\t\t * @param array $args {\n\t\t\t\t\t * Array of image details.\n\t\t\t\t\t *\n\t\t\t\t\t * @type $tag Image tag (Image HTML output).\n\t\t\t\t\t * @type $src Image URL.\n\t\t\t\t\t * @type $src_orig Original Image URL.\n\t\t\t\t\t * @type $width Image width.\n\t\t\t\t\t * @type $height Image height.\n\t\t\t\t\t * @type $attachment_id Attachment ID.\n\t\t\t\t\t * }\n\t\t\t\t\t */\n\t\t\t\t\t$args = apply_filters( 'tachyon_post_image_args', $args, compact( 'tag', 'src', 'src_orig', 'width', 'height', 'attachment_id', 'size' ) );\n\n\t\t\t\t\t$tachyon_url = tachyon_url( $src, $args );\n\n\t\t\t\t\t// Modify image tag if Tachyon function provides a URL\n\t\t\t\t\t// Ensure changes are only applied to the current image by copying and modifying the matched tag, then replacing the entire tag with our modified version.\n\t\t\t\t\tif ( $src !== $tachyon_url ) {\n\t\t\t\t\t\t$new_tag = $tag;\n\n\t\t\t\t\t\t// If present, replace the link href with a Tachyoned URL for the full-size image.\n\t\t\t\t\t\tif ( ! empty( $images['link_url'][ $index ] ) && self::validate_image_url( $images['link_url'][ $index ] ) ) {\n\t\t\t\t\t\t\t$new_tag = preg_replace( '#(href=[\"|\\'])' . $images['link_url'][ $index ] . '([\"|\\'])#i', '\\1' . tachyon_url( $images['link_url'][ $index ] ) . '\\2', $new_tag, 1 );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Supplant the original source value with our Tachyon URL.\n\t\t\t\t\t\t$tachyon_url = esc_url( $tachyon_url );\n\t\t\t\t\t\t$new_tag = str_replace( $src_orig, $tachyon_url, $new_tag );\n\n\t\t\t\t\t\t// If Lazy Load is in use, pass placeholder image through Tachyon.\n\t\t\t\t\t\tif ( isset( $placeholder_src ) && self::validate_image_url( $placeholder_src ) ) {\n\t\t\t\t\t\t\t$placeholder_src = tachyon_url( $placeholder_src );\n\n\t\t\t\t\t\t\tif ( $placeholder_src !== $placeholder_src_orig ) {\n\t\t\t\t\t\t\t\t$new_tag = str_replace( $placeholder_src_orig, esc_url( $placeholder_src ), $new_tag );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tunset( $placeholder_src );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Remove the width and height arguments from the tag to prevent distortion.\n\t\t\t\t\t\tif ( apply_filters( 'tachyon_remove_size_attributes', true ) ) {\n\t\t\t\t\t\t\t$new_tag = preg_replace( '#(?<=\\s)(width|height)=[\"|\\']?[\\d%]+[\"|\\']?\\s?#i', '', $new_tag );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Tag an image for dimension checking.\n\t\t\t\t\t\t$new_tag = preg_replace( '#(\\s?/)?>(\\s*</a>)?$#i', ' data-recalc-dims=\"1\"\\1>\\2', $new_tag );\n\n\t\t\t\t\t\t// Replace original tag with modified version.\n\t\t\t\t\t\t$content = str_replace( $tag, $new_tag, $content );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( preg_match( '#^http(s)?://i[\\d]{1}.wp.com#', $src ) && ! empty( $images['link_url'][ $index ] ) && self::validate_image_url( $images['link_url'][ $index ] ) ) {\n\t\t\t\t\t$new_tag = preg_replace( '#(href=[\"|\\'])' . $images['link_url'][ $index ] . '([\"|\\'])#i', '\\1' . tachyon_url( $images['link_url'][ $index ] ) . '\\2', $tag, 1 );\n\n\t\t\t\t\t$content = str_replace( $tag, $new_tag, $content );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}", "public function getImageTag();", "public function filtering();", "protected function getVideoTags()\n {\n $sql = \"SELECT t.tag, count(t.tag) as cnt FROM tags t\n INNER JOIN video_tag vt ON t.id = vt.tag_id GROUP BY t.tag ORDER BY Random()\";\n\n $rs = $this->sqliteQuery($sql);\n $str = \"\";\n foreach($rs as $row)\n {\n if($row['cnt']<=2){$tagStyle = \"tag1\";}\n if($row['cnt']>=2){$tagStyle = \"tag2\";}\n\n $str .= \"<a class='tag $tagStyle' href='\".DOMAIN.\"video-tags/\".$this->stringToURL($row['tag']).\".html'>{$row['tag']}</a>\";\n }\n $this->buffer = str_replace(\"{VIDEOTAGS}\", $str, $this->buffer);\n }", "function clean_inside_tags($txt,$tags){\n\t\t\t$txt =removeemptytags($txt);\n\t\t\tpreg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n\t\t\n\t\t\tforeach ($allTags[1] as $tag){\n\t\t\t\t$txt = preg_replace(\"/<\".$tag.\"[^>]*>/i\",\"<\".$tag.\">\",$txt);\n\t\t\t}\n\t\t\treturn $txt;\n\t\t}", "function customTagReplace($html)\r\n\t{\r\n\t\t//ensure all tags can be found\r\n\t\t$html = str_replace(\"<IMG\",\"<img\",$html);\r\n\t\t$html = str_replace(\"SRC=\",\"src=\",$html);\r\n\t\t$html = str_replace(\"ALT=\",\"alt=\",$html);\r\n\t\t$html = str_replace(\"<SPAN\",\"<span\",$html);\r\n\r\n\t\t$html = replaceIMG($html); //CSS format img tags\r\n\t\t$html = youtubeEmbed($html); //custom include youtube embeds\r\n\t\t$html = apostrapheFix($html); //apostraphe fix for sql INSERT statements\r\n\t\treturn $html;\r\n\t}", "function ja_filter_bbpress_allowed_tags() {\n\n\treturn array(\n\n\n\n\t// Links\n\n\t\t\t'a' => array(\n\n\t\t\t\t\t'href' => array(),\n\n\t\t\t\t\t'title' => array(),\n\n\t\t\t\t\t'rel' => array()\n\n\t\t\t),\n\n\n\n\t\t\t// Quotes\n\n\t\t\t'blockquote' => array(\n\n\t\t\t\t\t'cite' => array()\n\n\t\t\t),\n\n\n\n\t\t\t// Code\n\n\t\t\t'code' => array(),\n\n\t\t\t'pre' => array(),\n\n\n\n\t\t\t// Formatting\n\n\t\t\t'em' => array(),\n\n\t\t\t'strong' => array(),\n\n\t\t\t'del' => array(\n\n\t\t\t\t\t'datetime' => true,\n\n\t\t\t),\n\n\n\n\t\t\t// Lists\n\n\t\t\t'ul' => array(),\n\n\t\t\t'ol' => array(\n\n\t\t\t\t\t'start' => true,\n\n\t\t\t),\n\n\t\t\t'li' => array(),\n\n\n\n\t\t\t// Images\n\n\t\t\t'img' => array(\n\n\t\t\t\t\t'src' => true,\n\n\t\t\t\t\t'border' => true,\n\n\t\t\t\t\t'alt' => true,\n\n\t\t\t\t\t'height' => true,\n\n\t\t\t\t\t'width' => true,\n\n\t\t\t)\n\n\t);\n\n}", "function noTag($temp){\n\t$data\t= strip_tags($temp, \"<img \");\n\t$data\t= strip_tags($temp, \"<table \");\n\t$data\t= strip_tags($temp, \"<font \");\n\t$data\t= strip_tags($temp, \"<span \");\t\n\t$data\t= strip_tags($temp, \"<p \");\t\t\n\treturn $data;\n}", "private function filters() {\n\n\n\t}", "function gtags_make_tags( $urlencode=false, $exclude_tags='', $include_tags='' ) {\n\tglobal $bp, $wpdb;\n\tglobal $pageProjets;\n\t\n\t$all_group_tags = $wpdb->get_col( \"SELECT meta_value FROM \" . $bp->groups->table_name_groupmeta . \" WHERE meta_key = 'gtags_group_tags'\" );\n\n\t//count the occurances\t\n\t$all_tags = array();\t\n\n\tforeach( $all_group_tags as $group_tags ) {\n\t\t$items = explode( ',', $group_tags );\n\t\t\n\t\tforeach( $items as $item ) {\n\t\t\t$item = trim( strtolower( $item ) );\n\t\t\t\n\t\t\tif ( $item=='' ) \n\t\t\t\tcontinue;\n\n\t\t\tif ( isset( $all_tags[ $item ] ) ) { \n\t\t\t\t$all_tags[ $item ] += 1;\n\t\t\t} else { \n\t\t\t\t$all_tags[ $item ] = 1; \n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t\n\tif ( !$exclude_tags && !$include_tags ) { // get the defaults if nothing is set by the widget\n\t\t$exclude_tags = get_option( 'gtags_exclude' );\n\t\t$include_tags = get_option( 'gtags_include' );\n\t}\n\t\t\n\tif ( $exclude_tags ) { // exclude takes precidence\n\t\t$exclude_tags = explode( ',', $exclude_tags );\n\t\tforeach( (array)$exclude_tags as $exclude ) {\n\t\t\tunset( $all_tags[ trim( $exclude ) ] );\n\t\t}\t\n\t} elseif ( $include_tags ) {\n\t\t$include_tags = explode( ',', $include_tags );\n\t\tforeach( (array)$include_tags as $include ) {\n\t\t\t$include = trim( $include );\n\t\t\tif ($all_tags[ $include ])\n\t\t\t\t$include_array[ $include ] = $all_tags[ $include ];\n\t\t}\n\t\t$all_tags = $include_array;\t\n\t}\n\t\n\t$tags = array();\n\tforeach( (array)$all_tags as $tag => $count ) {\n\t\t$tag = stripcslashes( $tag );\n\t\t$link = $bp->root_domain . '/' . $pageProjets . '/tag/' . urlencode( $tag ) ;\n\t\t$tags[ $tag ] = (object)array( 'name' => $tag, 'count' => $count, 'link' => $link );\n\t}\n\n\treturn $tags;\n}", "function pixtulate_type_filter ( $content ) {\r\n\t$post_type = get_post_type();\r\n\r\n\tif($post_type == 'page' || $post_type == 'post') {\r\n\t\t$pixtulate_connector = get_option ( 'pixtulate_connector' );\r\n\t\t$base_url = get_site_url();\r\n\r\n\t\t$base_url_arr = parse_url($base_url);\r\n\r\n\t\tif ($base_url_arr[path]) {\r\n\t\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host]. '\\\\' .$base_url_arr[path];\r\n\t\t} else {\r\n\t\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host];\r\n\t\t}\r\n\r\n\t\tif($pixtulate_connector == $base_url)\r\n\t\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(\".$base_url_mod.\"\\/)/\", \"data-$1$2$3\", $content);\r\n\t\t\t// return preg_replace(\"/(src=\\\")(.*)([^>]*)/\", \"data-$1$2$3\", $content);\r\n\t\telse\r\n\t\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(uploads\\/)/\", \"data-$1$3\", $content);\r\n\t}\r\n}", "function wp_filter_oembed_iframe_title_attribute($result, $data, $url)\n {\n }", "public function tagSearch($search){\n\n $images = [];\n\n /* @var IConnector $connector */\n foreach($this->connectors as $key => $connector) {\n $images = array_merge($images, $connector->tagSearch($search));\n }\n\n return $images;\n }", "public function getTags()\n {\n $resultArray = [];\n $tagConnects = TagConnect::photo($this->id);\n if($tagConnects->isEmpty()) {return [];}\n foreach($tagConnects as $tagConnect) {\n $idsArray[] = $tagConnect->id;\n }\n $tags = Tag::whereIn('id', $idsArray)->get();\n foreach($tags as $tag) {\n $resultArray[] = $tag->word;\n }\n return $resultArray;\n }", "function new_img_shortcode_filter($val, $attr, $content = null) {\n\n\textract(shortcode_atts(array(\n\t\t'id'\t=> '',\n\t\t'align'\t=> '',\n\t\t'width'\t=> '',\n\t\t'caption' => '',\n\t\t'src' => ''\n\t), $attr));\n\n $find = 'attachment_';\n $cust_id = str_replace($find, '', $id);\n $post_custom = get_post_custom($cust_id);\n // print_r($content);\n // $isrc = $src;\n\n\n\tif ( 1 > (int) $width || empty($caption) )\n\t\treturn $val;\n\n\t$capid = '';\n\tif ( $id ) {\n\t\t$id = esc_attr($id);\n\t\t$capid = 'id=\"figcaption_'. $id . '\" ';\n\t\t$id = 'id=\"' . $id . '\"';\n\t}\n\n\n\n\tif ($width == 60 || $width == 140 || $width == 300 ){ // if image is circle\n\t return '<div class=\"circle photo w'.(0 + (int) $width).'\">' . do_shortcode( $content ) . '<p class=\"caption\">' . $caption . '</p></div>';\n } else if ($width == 30) { // if image doesn't need a caption\n return '<div class=\"photo w'.(0 + (int) $width).'\">' . do_shortcode( $content ) . '</div>';\n } else { // all other images\n return '<div class=\"photo w'.(0 + (int) $width).'\">' . do_shortcode( $content ) . '<p class=\"caption\">' . $caption . '</p></div>';\n }\n}", "function wph_remove_p_images($content) {\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function pixtulate_filter ( $content ) {\r\n\t$pixtulate_connector = get_option ( 'pixtulate_connector' );\r\n\t$base_url = get_site_url();\r\n\r\n\t$base_url_arr = parse_url($base_url);\r\n\tif ($base_url_arr[path]) {\r\n\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host]. '\\\\' .$base_url_arr[path];\r\n\t} else {\r\n\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host];\r\n\t}\r\n\r\n\tif($pixtulate_connector == $base_url)\r\n\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(\".$base_url_mod.\"\\/)/\", \"data-$1$2$3\", $content);\r\n\telse\r\n\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(uploads\\/)/\", \"data-$1$3\", $content);\r\n}", "public function findCategories(&$body){\n $bodyArray = $this->getBodyArray($body);\n $rep = [\n 'tags:' => '',\n 'tag:' => '',\n ', ' => ',',\n \"\\n\" => '',\n \"\\r\" => ''\n ];\n $tags = false;\n foreach($bodyArray as $lines){\n $cleanLine = _j::replaceAll($rep, $line);\n if(_j::find(['tags:', 'tag:'], $cleanLine)){\n $tags = explode(',', $cleanLine);\n $body = str_replace($line, '', $body);\n break;\n }\n }\n return $tags;\n }", "private function remove_self_closing_tags() {\n\t\tadd_filter('get_avatar', [$this, 'remove_self_closing_tag']); // <img]/>\n\t\tadd_filter('comment_id_fields', [$this, 'remove_self_closing_tag']); // <input]/>\n\t\tadd_filter('post_thumbnail_html', [$this, 'remove_self_closing_tag']); // <img]/>\n\t}", "public function filters()\n {\n return [\n 'src' => \"trim\"\n ];\n }", "private function processTags()\n {\n $dollarNotationPattern = \"~\" . REGEX_DOLLAR_NOTATION . \"~i\";\n $simpleTagPattern = \"~\" . REGEX_SIMPLE_TAG_PATTERN . \"~i\";\n $bodyTagPattern = \"~\" . REGEX_BODY_TAG_PATTERN . \"~is\";\n \n $tags = array();\n preg_match_all($this->REGEX_COMBINED, $this->view, $tags, PREG_SET_ORDER);\n \n foreach($tags as $tag)\n { \n $result = \"\";\n \n $tag = $tag[0];\n \n if (strlen($tag) == 0) continue;\n \n if (preg_match($simpleTagPattern, $tag) || preg_match($bodyTagPattern, $tag))\n {\n $this->handleTag($tag);\n }\n else if (preg_match($dollarNotationPattern, $tag))\n {\n $this->logger->log(Logger::LOG_LEVEL_DEBUG, 'View: processTags', \"Found ExpLang [$tag]\");\n $result = $this->EL_Engine->parse($tag);\n }\n \n if (isset ($result))\n {\n $this->update($tag, $result);\n }\n }\n }", "function bethel_remove_filter_from_gallery_images ($edit) {\n remove_filter ('wp_get_attachment_image_attributes', 'bethel_filter_image_attributes_for_gallery', 10, 2);\n remove_filter ('wp_get_attachment_link', 'bethel_filter_attachment_link_for_gallery', 10, 6);\n return $edit;\n}", "public function filter();", "protected function getImageCandidates()\n\t{\n\t\t$result = array();\n\t\tforeach ($this->imgElements as $imgElement)\n\t\t{\n\t\t\t$imageDimensions = $this->getImageDimensions($imgElement);\n\t\t\tif($imageDimensions['width'] >= self::MIN_IMAGE_WIDTH && $imageDimensions['height'] >= self::MIN_IMAGE_HEIGHT)\n\t\t\t{\n\t\t\t\t$result[] = $imgElement['src'];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getTags($string='',$tag='img'){\r\n $string=strtolower($string);\r\n if($string!=''){\r\n $oriString = $string;\r\n //find next tag in string code\r\n $string = stristr($string,'<'.$tag);\r\n $safetyLimit = 10000;\r\n $i=0;\r\n $tags=array();\r\n while($string && $i<$safetyLimit){\r\n //find end of tag\r\n $tagEndPos = strpos($string,'>')+1;\r\n //get tag string\r\n $tagString = substr($string,0,$tagEndPos);\r\n //get tag start.\r\n $tagStartPos = strpos($oriString,$tagString);\r\n //Put tag information into array.\r\n $tags[] = array('string'=>$tagString,'start'=>$tagStartPos,'end'=>$tagStartPos+strlen($tagString));\r\n //gets the next tag from string\r\n $string = stristr(substr($string,1),'<'.$tag);\r\n $i++;\r\n }\r\n }else{\r\n $tags = array();\r\n }\r\n return $tags;\r\n }", "function embedly_embed_thumbnails(&$feed) {\n\t$matched_urls = array();\n\t$embedly_re = \"/http:\\/\\/(.*yfrog\\..*\\/.*|tweetphoto\\.com\\/.*|www\\.flickr\\.com\\/photos\\/.*|flic\\.kr\\/.*|twitpic\\.com\\/.*|www\\.twitpic\\.com\\/.*|twitpic\\.com\\/photos\\/.*|www\\.twitpic\\.com\\/photos\\/.*|.*imgur\\.com\\/.*|.*\\.posterous\\.com\\/.*|post\\.ly\\/.*|twitgoo\\.com\\/.*|i.*\\.photobucket\\.com\\/albums\\/.*|s.*\\.photobucket\\.com\\/albums\\/.*|phodroid\\.com\\/.*\\/.*\\/.*|www\\.mobypicture\\.com\\/user\\/.*\\/view\\/.*|moby\\.to\\/.*|xkcd\\.com\\/.*|www\\.xkcd\\.com\\/.*|imgs\\.xkcd\\.com\\/.*|www\\.asofterworld\\.com\\/index\\.php\\?id=.*|www\\.asofterworld\\.com\\/.*\\.jpg|asofterworld\\.com\\/.*\\.jpg|www\\.qwantz\\.com\\/index\\.php\\?comic=.*|23hq\\.com\\/.*\\/photo\\/.*|www\\.23hq\\.com\\/.*\\/photo\\/.*|.*dribbble\\.com\\/shots\\/.*|drbl\\.in\\/.*|.*\\.smugmug\\.com\\/.*|.*\\.smugmug\\.com\\/.*#.*|emberapp\\.com\\/.*\\/images\\/.*|emberapp\\.com\\/.*\\/images\\/.*\\/sizes\\/.*|emberapp\\.com\\/.*\\/collections\\/.*\\/.*|emberapp\\.com\\/.*\\/categories\\/.*\\/.*\\/.*|embr\\.it\\/.*|picasaweb\\.google\\.com.*\\/.*\\/.*#.*|picasaweb\\.google\\.com.*\\/lh\\/photo\\/.*|picasaweb\\.google\\.com.*\\/.*\\/.*|dailybooth\\.com\\/.*\\/.*|brizzly\\.com\\/pic\\/.*|pics\\.brizzly\\.com\\/.*\\.jpg|img\\.ly\\/.*|www\\.tinypic\\.com\\/view\\.php.*|tinypic\\.com\\/view\\.php.*|www\\.tinypic\\.com\\/player\\.php.*|tinypic\\.com\\/player\\.php.*|www\\.tinypic\\.com\\/r\\/.*\\/.*|tinypic\\.com\\/r\\/.*\\/.*|.*\\.tinypic\\.com\\/.*\\.jpg|.*\\.tinypic\\.com\\/.*\\.png|meadd\\.com\\/.*\\/.*|meadd\\.com\\/.*|.*\\.deviantart\\.com\\/art\\/.*|.*\\.deviantart\\.com\\/gallery\\/.*|.*\\.deviantart\\.com\\/#\\/.*|fav\\.me\\/.*|.*\\.deviantart\\.com|.*\\.deviantart\\.com\\/gallery|.*\\.deviantart\\.com\\/.*\\/.*\\.jpg|.*\\.deviantart\\.com\\/.*\\/.*\\.gif|.*\\.deviantart\\.net\\/.*\\/.*\\.jpg|.*\\.deviantart\\.net\\/.*\\/.*\\.gif|plixi\\.com\\/p\\/.*|plixi\\.com\\/profile\\/home\\/.*|plixi\\.com\\/.*|www\\.fotopedia\\.com\\/.*\\/.*|fotopedia\\.com\\/.*\\/.*|photozou\\.jp\\/photo\\/show\\/.*\\/.*|photozou\\.jp\\/photo\\/photo_only\\/.*\\/.*|instagr\\.am\\/p\\/.*|skitch\\.com\\/.*\\/.*\\/.*|img\\.skitch\\.com\\/.*|https:\\/\\/skitch\\.com\\/.*\\/.*\\/.*|https:\\/\\/img\\.skitch\\.com\\/.*|share\\.ovi\\.com\\/media\\/.*\\/.*|www\\.questionablecontent\\.net\\/|questionablecontent\\.net\\/|www\\.questionablecontent\\.net\\/view\\.php.*|questionablecontent\\.net\\/view\\.php.*|questionablecontent\\.net\\/comics\\/.*\\.png|www\\.questionablecontent\\.net\\/comics\\/.*\\.png|picplz\\.com\\/user\\/.*\\/pic\\/.*\\/|twitrpix\\.com\\/.*|.*\\.twitrpix\\.com\\/.*|www\\.someecards\\.com\\/.*\\/.*|someecards\\.com\\/.*\\/.*|some\\.ly\\/.*|www\\.some\\.ly\\/.*|pikchur\\.com\\/.*|achewood\\.com\\/.*|www\\.achewood\\.com\\/.*|achewood\\.com\\/index\\.php.*|www\\.achewood\\.com\\/index\\.php.*)/i\";\n\n\tforeach ($feed as &$status) { // Loop through the feed\n\t\tif ($status->entities) { // If there are entities\n\t\t\t$entities = $status->entities;\n\n\t\t\tforeach ($entities->urls as $urls) {\t// Loop through the URL entities\n\t\t\t\tif ($urls->expanded_url != \"\") { // Use the expanded URL, if it exists, to pass to Embedly\n\t\t\t\t\tif (preg_match($embedly_re, $urls->expanded_url) > 0) { // If it matches an Embedly supported URL\n\t\t\t\t\t\t$matched_urls[$urls->expanded_url][] = $status->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Make a single API call to Embedly.\n\t$justUrls = array_keys($matched_urls);\n\t$count = count($justUrls);\n\n\tif ($count == 0) return;\n\tif ($count > 20) {\n\t\t// Embedly has a limit of 20 URLs processed at a time. Not ideal for @dabr, but fair enough to ignore images after that.\n\t\t$justUrls = array_chunk($justUrls, 20);\n\t\t$justUrls = $justUrls[0];\n\t}\n\n\t$url = 'http://api.embed.ly/1/oembed?key='.EMBEDLY_KEY.'&urls=' . implode(',', $justUrls) . '&format=json';\n\t$embedly_json = twitter_fetch($url);\n\t$oembeds = json_decode($embedly_json);\n\n\t// Put the thumbnails into the $feed\n\tforeach ($justUrls as $index => $url) {\n\t\tif ($thumb = $oembeds[$index]->thumbnail_url) {\n\t\t\tforeach ($matched_urls[$url] as $statusId) {\n\t\t\t\t$feed[$statusId]->text .= \"<br /><a href=\\\"$url\\\"><img src=\\\"\";\n\n\t\t\t\tif (IMGPROXY == 1) {\n\t\t\t\t\t$feed[$statusId]->text .= BASE_URL.\"img.php?u=\".base64_encode(base64_encode($thumb));\n\t\t\t\t} else {\n\t\t\t\t\t$feed[$statusId]->text .= $thumb;\n\t\t\t\t}\n\n\t\t\t\t$feed[$statusId]->text .= \"\\\" /></a>\";\n\t\t\t}\n\t\t}\n\t}\n}", "function extract_attrib_2($html) {\n\tpreg_match_all('/<a[^>]*\\>/', $html, $matcha); //匹配img标签\n\tforeach ($matcha[0] as $k => $vala) {\n\t\tpreg_match_all('/(href)=(\"[^\"]*\")/i', $vala, $matchesa);\n\t\t$zh = substr(trim($matchesa[2][0], '\"'), -3);\n\t\t// dd($zh,in_array($zh, ['png','jpg','peg','gif','bmp','et/']));\n\t\tif (in_array($zh, ['png', 'jpg', 'peg', 'gif', 'bmp'])) {\n\t\t\t$vala2 = str_insert($vala, 3, ' class=\"gallery-item-hook\"');\n\t\t\t$html = str_replace($vala, $vala2, $html);\n\t\t}\n\t\t// dd($val,$k,$matches[2][0]);\n\t\t// dd($matches);\n\t}\n\tpreg_match_all('/<img[^>]*\\>/', $html, $match); //匹配img标签\n\t// dd($match);\n\tforeach ($match[0] as $k => $val) {\n\t\tpreg_match_all('/(id|alt|title|src)=(\"[^\"]*\")/i', $val, $matches);\n\t\t$html = str_replace($val, '<a href=' . $matches[2][0] . ' class=\"gallery-item-hook\">' . $val . '</a>', $html);\n\t\t// dd($val, $k, $matches[2][0]);\n\t\t// dd($matches);\n\t}\n\treturn ['html' => $html];\n}", "function testRemoveTag_UsingCleanTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('something', 'another', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "public function getUserTags($imageID) {\n $sql = \"SELECT fk_pk_tags FROM t_tags_included WHERE fk_pk_bild_id=?\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"s\", $imageID);\n $select->execute();\n $result = $select->get_result();\n $tags = array();\n while ($row = $result->fetch_assoc()) {\n array_push($tags, $row[\"fk_pk_tags\"]);\n }\n $select->close();\n return $tags;\n }", "public function test_gather_tag_media() {\n\n $client = new GuzzleHttp\\Client();\n $crawler = new InstagramCrawler($client,$this->access_token,['russia'],[/*no users*/]);\n\n $data = $crawler->crawl();\n\n $this->assertNotEmpty($data['tags']);\n $this->assertTrue(array_key_exists('russia',$data['tags']));\n\n }", "abstract public function filters();", "public function filterImages($text)\n {\n return preg_replace_callback(\"/(<img[^>]*src *= *[\\\"']?)([^\\\"']*)/i\", function ($matches) {\n $originalImageUrl = $matches[2];\n $imageUrl = $this->isAmazon($originalImageUrl) ?\n $originalImageUrl :\n call_user_func([$this, $this->uploadAmazon], /*params...*/\n $originalImageUrl);\n return $matches[1] . \" $imageUrl\";\n }, $text);\n }", "function the_content_without_images() {\n\n $innerHTML = \"XX\";\n $html = \"\";\n\n // Buffer the HTML\n ob_start();\n the_content();\n $html = ob_get_contents();\n ob_end_clean();\n\n // Manipulate DOM\n $doc = new DOMDocument();\n $doc->loadHTML($html);\n $doc->encoding = 'UTF-8';\n\n $xpath = new DOMXPath( $doc );\n $childs = $xpath->query(\".//div\");\n foreach ( $childs as $node ) {\n if ( $node->getElementsByTagName(\"img\")->length ) {\n $node->parentNode->removeChild($node);\n }\n }\n\n // Return only the body contents of DOM\n return utf8_decode($doc->saveHTML($doc->getElementsByTagName(\"body\")->item(0)));\n}", "public function getTags() {\n\t\t$tags = array();\n\t\tforeach ($this->photo->tags->tag as $tag) {\n\t\t\t$tags[] = (string) $tag;\n\t\t}\n\t\t\n\t\treturn $tags;\n\t}", "function sandbox_tag_ur_it($glue) {\n\t$current_tag = single_tag_title( '', '', false );\n\t$separator = \"\\n\";\n\t$tags = explode( $separator, get_the_tag_list( \"\", \"$separator\", \"\" ) );\n\n\tforeach ( $tags as $i => $str ) {\n\t\tif ( strstr( $str, \">$current_tag<\" ) ) {\n\t\t\tunset($tags[$i]);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( empty($tags) )\n\t\treturn false;\n\n\treturn trim(join( $glue, $tags ));\n}", "protected function find_tags(){\n\t\tpreg_match_all(\"/%(.+?)%/\", $this->default, $this->tags );\n\t}", "function get_images($content){\r\n\t$images = array();\r\n\tlibxml_use_internal_errors(true);\r\n\t$doc = new DOMDocument();\r\n\t$doc->loadHTML($content);\r\n\tlibxml_clear_errors();\r\n\t$imageTags = $doc->getElementsByTagName(\"img\"); // FIX IMAGES ATTRIBUTES\r\n\tforeach ($imageTags as $tag)\r\n\t{\r\n\t\t$images[] = $tag->getAttribute(\"src\"); // FIX SRC ATTRIBUTES\r\n\t}\r\n\treturn $images;\r\n}", "function tag_ur_it($glue) {\n\t $current_tag = single_tag_title( '', '', false );\n\t $separator = \"\\n\";\n\t $tags = explode( $separator, get_the_tag_list( \"\", \"$separator\", \"\" ) );\n\t foreach ( $tags as $i => $str ) {\n\t if ( strstr( $str, \">$current_tag<\" ) ) {\n\t unset($tags[$i]);\n\t break;\n\t }\n\t }\n\t if ( empty($tags) )\n\t return false;\n\n\t return trim(join( $glue, $tags ));\n\t}", "function tag_ur_it($glue) {\n\t $current_tag = single_tag_title( '', '', false );\n\t $separator = \"\\n\";\n\t $tags = explode( $separator, get_the_tag_list( \"\", \"$separator\", \"\" ) );\n\t foreach ( $tags as $i => $str ) {\n\t if ( strstr( $str, \">$current_tag<\" ) ) {\n\t unset($tags[$i]);\n\t break;\n\t }\n\t }\n\t if ( empty($tags) )\n\t return false;\n\n\t return trim(join( $glue, $tags ));\n\t}", "function blog_content_filter($content){\n\n if ( is_home() ){\n $content = preg_replace(\"/<img[^>]+\\>/i\", \"\", $content);\n }\n\n return $content;\n}", "public function getImageSourceFromTagReturnsStringDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'<img class=\"tx-srfreecap-image\" id=\"tx_srfreecap_captcha_image_6ac99\" ',\n\t\t\t\t\t'src=\"http://powermail.localhost.de/index.php?eID=sr_freecap_EidDispatcher&amp;',\n\t\t\t\t\t'id=111&amp;extensionName=SrFreecap&amp;pluginName=ImageGenerator&amp;controllerName=ImageGenerator',\n\t\t\t\t\t'&amp;actionName=show&amp;formatName=png&amp;set=6ac99\" alt=\"CAPTCHA-Bild zum Spam-Schutz \"/>',\n\t\t\t\t\t'<span class=\"tx-srfreecap-cant-read\">Wenn Sie das Wort nicht lesen können, ',\n\t\t\t\t\t'<a href=\"#\" onclick=\"this.blur();SrFreecap.newImage(\\'6ac99\\', \\'Entschuldigung, wir können nicht ',\n\t\t\t\t\t'automatisch ein neues Bild zeigen. Schicken Sie das Formular ab und ein neues Bild wird geladen.\\');',\n\t\t\t\t\t'return false;\">bitte hier klicken</a>.</span>'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'http://powermail.localhost.de/index.php?eID=sr_freecap_EidDispatcher&amp;',\n\t\t\t\t\t'id=111&amp;extensionName=SrFreecap&amp;pluginName=ImageGenerator&amp;controllerName=ImageGenerator',\n\t\t\t\t\t'&amp;actionName=show&amp;formatName=png&amp;set=6ac99'\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'abcd <img src=\"/abc/pic.png\" /> adsa ',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'/abc/pic.png'\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'<b> <img src=\"http://d.org/pic.bmp\" /> ads <img src=\"xyz.php\" /> </b>adsa',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'http://d.org/pic.bmp'\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}", "function closetags($html) {\n\t\tpreg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);\n\t\t$openedtags = $result[1]; #put all closed tags into an array\n\t\tpreg_match_all('#</([a-z]+)>#iU', $html, $result);\n\t\t$closedtags = $result[1];\n\t\t$len_opened = count($openedtags);\n\t\t# all tags are closed\n\t\tif (count($closedtags) == $len_opened) {\n\t\t\treturn $html;\n\t\t}\n\t\t\n\t\t$openedtags = array_reverse($openedtags);\n\t\t# close tags\n\t\tfor ($i=0; $i < $len_opened; $i++) {\n\t\t\tif (!in_array($openedtags[$i], $closedtags)){\n\t\t\t $html .= '</'.$openedtags[$i].'>';\n\t\t\t} else {\n\t\t\t unset($closedtags[array_search($openedtags[$i], $closedtags)]); }\n\t\t\t} \n\t\t\treturn $html;\n\t\t}", "private function handleTagFilter()\n {\n $this->tagFilterEnabled = false;\n\n switch ($this->enableTagFilter) {\n // fall-through is intentional here, setting of tagFilterEnabled to true is valid for both cases\n case self::TAG_FILTER_ON_OVERFLOW:\n if (!($this->totalCount > $this->limit)) {\n break;\n }\n case self::TAG_FILTER_ALWAYS:\n $this->tagFilterEnabled = true;\n }\n\n if ($this->tagFilterEnabled) {\n $this->addJs('/plugins/' . Plugin::DIRECTORY_KEY . '/assets/js/jquery.mark.min.js');\n }\n }", "function get_tags_clean()\n{\n $tmp_tags = array();\n $tags = get_tags();\n foreach ($tags as $tag) {\n array_push($tmp_tags, $tag['name']);\n }\n $tags = $tmp_tags;\n\n return $tags;\n}", "public function tags()\n\t{\n\t\t$tags = '';\n\n\t\tif ($this->collection->shouldCombine())\n\t\t{\n\t\t\t$tags = $this->tag($this->collection->cacheFileUrl);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($this->collection->items as $asset)\n\t\t\t{\n\t\t\t\t$tags .= $this->tag($asset->url);\n\t\t\t}\n\t\t}\n\n\t\treturn $tags;\n\t}", "function allowed_tags()\n {\n }", "function wgom_get_featured_overlay() {\n\t$tag_images = array(\n\t\t'Guest DJ' => '<img class=\"overlay\" width=\"249\" height=\"71\" src=\"/wp-content/uploads/2013/12/guest-dj.jpg\" />',\n\t\t'Theme Week' => '<img class=\"overlay\" src=\"/wp-content/uploads/2014/06/TmWk.png\" />',\n\t\t'e-6 bait' => '<img class=\"overlay\" src=\"/wp-content/uploads/2014/01/e-6-bait.jpg\" />',\n\t\t'facebook watch game' => '<img class=\"overlay\" src=\"/wp-content/uploads/2018/12/fb-watch-game.png\" />',\n\t\t'new music' => '<img class=\"overlay\" src=\"/wp-content/uploads/2018/07/NewMusic.png\" />',\n\t\t'RIP' => '<img class=\"overlay\" src=\"/wp-content/uploads/2015/06/candle.png\" />',\n\t\t'SXSW 2014' => '<img class=\"overlay\" src=\"/wp-content/uploads/2014/03/SXSW.png\" />',\n\t\t'SXSW 2015' => '<img class=\"overlay\" src=\"/wp-content/uploads/2015/04/SXSW-2015.png\" />',\n\t\t'MLB.TV Free Game Of The Day' => '<img class=\"overlay\" src=\"/wp-content/uploads/2018/07/MLBFGotD.png\" />',\n\t\t'NSFW' => '<img class=\"overlay-left\" src=\"/wp-content/uploads/2015/08/NSFW.jpg\" />',\n\t\t'Best of' => '<img class=\"overlay-left\" src=\"/wp-content/uploads/2015/12/best-of-fs8.png\" />',\n\t);\n\n\t$the_tags = get_the_tags();\n\t$tags = array();\n\tif (!empty($the_tags)) {\n\t\tforeach ($the_tags as $t) {\n\t\t\tif (array_key_exists($t->name, $tag_images)) {\n\t\t\t\techo $tag_images[$t->name];\n\t\t\t}\n\t\t}\n\t}\n}", "function dizzy_featured_ogimg () { \n\t $thumb = get_the_post_thumbnail($post->ID);\n\t\t$pattern= \"/(?<=src=['|\\\"])[^'|\\\"]*?(?=['|\\\"])/i\";\n\t\tpreg_match($pattern, $thumb, $thePath);\n\t\t$theSrc = $thePath[0];\n}", "function attachment_image_link_remove_filter($content) {\n $content = preg_replace(array('{<a(.*?)(wp-att|wp-content\\/uploads)[^>]*><img}', '{ wp-image-[0-9]*\" /></a>}'), array('<img', '\" />'), $content);\n return $content;\n}", "function thinkup_extract_hashtags_filter ( $tu_post ) {\n\n $regex = \"/(^|[^&\\w'\\\"]+)\\#([a-zA-Z0-9_]+)/\";\n\n if ( preg_match_all($regex, $tu_post->wp_post->post_content, $matches) ) {\n\n $tu_post->tags = array_merge($tu_post->tags, $matches[2]);\n\n }\n\n return $tu_post;\n\n}", "public function getImages(){\n\t\t@$dom = new DOMDocument();\n\t\t@$dom->loadHTML($this->html);\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// Create DOMXpath and get images\n\t\t$xpath = new DOMXpath($dom);\n\t\t$imgs = $xpath->query(\"//img\");\n\t\t\n\t\t// Return array\n\t\t$ret = array();\n\t\t\n\t\t// Loop results and return\n\t\tfor ($i = 0; $i < $imgs->length; $i++) {\n\t\t\t$img = $imgs->item($i);\n\t\t\t$src = $img->getAttribute(\"src\");\n\t\t\t\n\t\t\t// Make sure it's a complete URL\n\t\t\t$src = self::filterUrl($src);\n\t\t\tif($src === false) continue;\n\t\t\t\n\t\t\tarray_push($ret, $src);\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "function _get_non_wysiwyg_tags()\n{\n\t$ret=array('indent','del','ins','u','highlight','abbr','cite','samp','q','var','dfn','address','contents','include','concepts','concept','staff_note','menu','surround','tt','no_parse','overlay','random','pulse','ticker','shocker','jumping','sections','big_tabs','tabs','carousel','hide','tooltip','currency','if_in_group','flash','upload','exp_thumb','exp_ref','thumb','reference','snapback','post','topic','attachment');\n\treturn $ret;\n}", "function fett_process_html_tag(&$vars) {\n if (theme_get_setting('fett_html_tags')) {\n $el = &$vars['element'];\n\n // Remove type=\"...\" and CDATA prefix/suffix.\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\n unset($el['#attributes']['media']);\n }\n }\n}", "public function ogTags()\n {\n include $this->partial_selector( 'head/og' );\n }", "public function filterContent($asset)\r\n {\r\n $images = array();\r\n $content = $asset->getContent();\r\n\r\n // get images and the related path\r\n if (preg_match_all('/url\\(\\s*[\\'\"]?([^\\'\"]+)[\\'\"]?\\s*\\)/Ui', $asset->getContent(), $matches)) {\r\n foreach ($matches[0] as $i => $url) {\r\n if ($path = realpath($asset['base_path'].'/'.ltrim(preg_replace('/'.preg_quote($asset['base_url'], '/').'/', '', $matches[1][$i], 1), '/'))) {\r\n $images[$url] = isset($images[$url]) ? false : $path;\r\n }\r\n }\r\n }\r\n\r\n // check if image exists and filesize < 5kb\r\n foreach ($images as $url => $path) {\r\n if ($path && filesize($path) <= 5120 && preg_match('/\\.(gif|png|jpg|svg)$/i', $path, $extension)) {\r\n $content = str_replace($url, sprintf('url(data:image/%s;base64,%s)', str_replace(array('jpg','svg'), array('jpeg','svg+xml'), strtolower($extension[1])), base64_encode(file_get_contents($path))), $content);\r\n }\r\n }\r\n\r\n $asset->setContent($content);\r\n }", "public function getTags() {}", "public function getWebTags() {\n\t\t$tags = $this->getTags();\n\t\t$webTags = array();\n\n\t\tfor($i = 0; $i < count($tags); $i++) {\n\t\t\tif($tags[$i] != 'spider') {\n\t\t\t\t$webTags[] = $tags[$i];\n\t\t\t}\n\t\t}\n\n\t\treturn $webTags;\n\t}", "private function parseForTags($content) {\n $files = [];\n // image and link files\n if (preg_match_all('/<(a|img) [^>]*>/i', $content, $matches)) {\n foreach ($matches[1] as $key => $tag) {\n if ($uri = $this->extractUri($tag, $matches[0][$key])) {\n $source_uri = (!preg_match('/https?:\\/\\//', $uri) ? $this->source_domain : '') . $uri;\n //\n list($ignore, $filename) = D7Utils::filePathAndName($uri);\n $filename = D7Utils::niceFileName($filename);\n //\n $target_uri = $this->target_folder . $filename;\n $target_file = \\Drupal::service('file_system')->realpath($target_uri);\n //\n $files[$source_uri] = [\n 'file' => $target_file,\n 'uri' => $target_uri,\n //'replace' => $source_uri,\n ];\n }\n }\n }\n return $files;\n }", "function img_p_class_content_filter($content) {\n $content = preg_replace(\"/(<p[^>]*)(\\>.*)(\\<img.*)(<\\/p>)/im\", \"\\$1 class='content-img-wrap'\\$2\\$3\\$4\", $content);\n\n return $content;\n}", "public function getTags();", "public function getTags();" ]
[ "0.72098565", "0.72098565", "0.66952026", "0.6674728", "0.66632783", "0.66617215", "0.66617215", "0.66617215", "0.66617215", "0.66617215", "0.66617215", "0.6661173", "0.66301674", "0.65832156", "0.6579503", "0.65528077", "0.6528508", "0.65041566", "0.6501746", "0.6442931", "0.63922536", "0.6157264", "0.6100989", "0.5864195", "0.58446413", "0.57830036", "0.5740115", "0.5714813", "0.5615303", "0.5608016", "0.5572352", "0.5539004", "0.55340475", "0.5434166", "0.542757", "0.5422865", "0.5417799", "0.54171103", "0.5379428", "0.53620476", "0.5356889", "0.53434986", "0.5272093", "0.52640224", "0.5237847", "0.5228917", "0.5222935", "0.5217742", "0.52126986", "0.5174912", "0.5154877", "0.5154215", "0.51520205", "0.5145104", "0.51433986", "0.51337403", "0.511589", "0.51128495", "0.509264", "0.5092444", "0.50844616", "0.5081284", "0.5080105", "0.50772274", "0.5075355", "0.50722104", "0.50705796", "0.50593853", "0.5052929", "0.50508744", "0.50500375", "0.5042818", "0.5035843", "0.50210905", "0.5017156", "0.50096947", "0.50074154", "0.50074154", "0.5005293", "0.50011444", "0.49838942", "0.49801853", "0.4974646", "0.4972287", "0.49713507", "0.4964717", "0.49630857", "0.49462038", "0.49443886", "0.49430096", "0.4942014", "0.49360785", "0.4923132", "0.49222076", "0.4919738", "0.49161696", "0.49131557", "0.4910242", "0.48983046", "0.48983046" ]
0.7472433
0
Wraps Embedded content on a DIV element
function tdd_oembed_filter($html, $url, $attr, $post_ID) { $return = '<figure class="video_container">'.$html.'</figure>'; return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap_embed_with_div($html, $url, $attr) {\n\n return '<div class=\"video_wrapper\"><div class=\"video-container\">' . $html . '</div></div>';\n\n}", "function embed_wrap( $cache ) {\n\treturn '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function newenglish_embed_wrap($cache) {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public function embed_wrap($cache) {\n\t\treturn '<div class=\"entry-content-asset\">' . $cache . '</div>';\n\t}", "protected function wrapEmbeds()\n {\n add_filter( 'embed_oembed_html', function($html){\n $isYouTube = strpos($html, 'youtube.com/embed') !== false;\n $isVimeo = strpos($html, 'player.vimeo.com/video') !== false;\n\n if ($isYouTube || $isVimeo) {\n return '<div class=\"wp-embed wp-embed-video\"><div class=\"wp-embed-inner\">' . $html . '</div></div>';\n } else {\n return '<div class=\"wp-embed\"><div class=\"wp-embed-inner\">' . $html . '</div></div>';\n }\n }, 10);\n }", "function roots_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function fabric_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function sc_wrap($atts, $content){\n\t\t$wrap_def = shortcode_atts(\n\t\t\tarray(\n\t\t\t\t'position' => 'center',\n\t\t\t\t'class' \t => 'txt-wrap'\n\t\t\t),\n\t\t\t$atts\n\t\t);\n\n\t\t$wrap_text = sprintf('<div class=\"'.$wrap_def['class'].'\" align=\"'.$wrap_def['position'].'\">'. $content .'</div>');\n\t\treturn do_shortcode($wrap_text);\n\n\t}", "private function renderInWrapper () {\n\t\t//open the generic application wrapper template\n\t\t/*\n\t\t$C = __CLASS__;\n\t\t$st = new $C();\n\t\t$st->init(null, \"wrapper\");\n\t\t$st->set(\"content\", $this->fetch());\n\t\t$st->render(true);\n\t\t*/\n\t}", "public function wrap_content_into_entry_container($content)\r\n {\r\n if ( !cuar_is_customer_area_page(get_queried_object(), $this->get_slug())) {\r\n return $content;\r\n }\r\n\r\n if (empty($content)) {\r\n return '';\r\n }\r\n\r\n return '<div class=\"cuar-single-entry ml-sm mr-sm mt-sm\">' . $content . '</div>';\r\n }", "public function wrap($source)\n\t{\n\t\treturn $this->_wrap_div($this->_wrap_pre($source));\n\t}", "public function wrap($element, $nowrap = false) {\n\n //This is for cases where a hidden element needs to be before a normal element.\n //With this I can just specify that I do not want it to wrapped\n if (!$nowrap) {\n $id_element = $element->getAttribute('name');\n $element_type = ($element->getAttribute('type') ? 'form_' . $element->getAttribute('type') : null);\n\n $wrapper_id = ($id_element ? $id_element . $this->_wrapper_suffix : null);\n\n $output = null;\n\n $outter_div = new div();\n $outter_div->setId($wrapper_id);\n $outter_div->setClass($this->_outter_div_class);\n\n if ($element->_label) {\n $label_div = new div();\n\n $label_div->setId($id_element . '_label')\n ->setClass($this->_label_class);\n\n //TODO: Create label element\n\n\n $outter_div->add($label_div->addThis(new form_label($id_element, $element->_label)));\n //'<label for=\"' . $id_element . '\">' . $element->_label . '</label>'));\n\n }\n\n $element_div = new div();\n //$element_div->setId( 'form_' . $this->_fname . '_element_' .$id_element . '_wrapper')\n $element_div->setId( $id_element . '_div')\n ->setClass($this->_element_div_class);\n\n $output = $outter_div->addThis($element_div->addThis($element))->html();\n\n\n //$outter_div->html();\n }\n else\n $output = (is_object($element) ? $element->html() : $element);\n\n $this->_output[] = $output;\n }", "public function fau_oembed_wrap_oembed_div($html, $url, $attr)\n {\n return '<div class=\"oembed\">' . $html . '</div>';\n }", "function envolve_embed($html, $url, $attr, $post_id) {\n return '<div class=\"video\">' . $html . '</div>';\n}", "function envolve_embed($html, $url, $attr, $post_id) {\n return '<div class=\"video\">' . $html . '</div>';\n}", "function metawrap_content_div( $content ){\n global $post;\n if($post->post_type == 'post') {\n $custom_fields = get_post_custom();\n $premetacontent = '<div class=\"meta-tags-content\"><div class=\"well\"><ul>';\n $postmetacontent = '';\n if ($custom_fields[\"workout_date\"][0] || $custom_fields[\"qic\"][0] || $custom_fields[\"the_pax\"][0]) {\n if ($custom_fields[\"qic\"][0]) {\n $premetacontent = $premetacontent . '<li><strong>QIC:</strong> <span class=\"qic\">' . $custom_fields[\"qic\"][0] . ' </span></li>';\n }\n if ($custom_fields[\"workout_date\"][0]) {\n $premetacontent = $premetacontent . '<li><strong>When:</strong> <span class=\"workout_date\">' . $custom_fields[\"workout_date\"][0] . ' </span></li>';\n }\n if ($custom_fields[\"the_pax\"][0]) {\n $premetacontent = $premetacontent . '<li><strong>Pax:</strong> ' . $custom_fields[\"the_pax\"][0] . ' </li>';\n }\n }\n $premetacontent = $premetacontent . get_the_tag_list('<li><strong>Pax:</strong> <span class=\"the_pax\">', ', ', ' </span></li> ');\n $premetacontent = $premetacontent . format_categories();\n $premetacontent = $premetacontent . '</ul></div>';\n $postmetacontent = $postmetacontent . tclaps_snippet() . '</div>';\n $postmetacontent = $postmetacontent . '<div style=\"display:none\" id=\"jv_tests\">' . get_stylesheet_directory_uri() . '/styles/style.css' . '</div>';\n $content = $premetacontent . $content . $postmetacontent;\n }\n return $content;\n}", "function acf_render_field_wrap($field, $element = 'div', $instruction = 'label')\n{\n}", "function inline_content_structure_start() {\n\necho '<div id=\"main-content\">';\n\techo '<div class=\"wrap\">';\n\t\n\t\tdo_action( 'inline_before_content_sidebar_wrapper' );\n\t\n\t\techo '<div class=\"content-sidebar-wrapper\">';\n\t\t\n\t\tdo_action( 'inline_before_content' ); // This hook fires right before the content div\n\t\t\n\t\techo '<div id=\"content\">';\n\n}", "public function embed()\n {\n global $page_output, $registry;\n\n /* First, determine the type of view we are asking for */\n $view = $this->vars->view;\n\n /* The DOM container to put the HTML in on the remote site */\n $container = $this->vars->container;\n\n /* The share_name of the calendar to display */\n $calendar = $this->vars->calendar;\n\n /* Deault to showing only 1 month when we have a choice */\n $count_month = $this->vars->get('months', 1);\n\n /* Default to no limit for the number of events */\n $max_events = $this->vars->get('maxevents', 0);\n\n /* Default to one week */\n $count_days = $this->vars->get('days', 7);\n\n if ($this->vars->css == 'none') {\n $nocss = true;\n }\n\n /* Build the block parameters */\n $params = array(\n 'calendar' => $calendar,\n 'maxevents' => $max_events,\n 'months' => $count_month,\n 'days' => $count_days\n );\n\n /* Call the Horde_Block api to get the calendar HTML */\n $title = $registry->call('horde/blockTitle', array('kronolith', $view, $params));\n $results = $registry->call('horde/blockContent', array('kronolith', $view, $params));\n\n /* Some needed paths */\n $js_path = $registry->get('jsuri', 'kronolith');\n\n /* Local js */\n $jsurl = Horde::url($js_path . '/embed.js', true);\n\n /* Horde's js */\n $hjs_path = $registry->get('jsuri', 'horde');\n $hjsurl = Horde::url($hjs_path . '/tooltips.js', true);\n $pturl = Horde::url($hjs_path . '/prototype.js', true);\n\n /* CSS */\n if (empty($nocss)) {\n $page_output->addThemeStylesheet('embed.css');\n\n Horde::startBuffer();\n $page_output->includeStylesheetFiles(array('nobase' => true), true);\n $css = Horde::endBuffer();\n } else {\n $css = '';\n }\n\n /* Escape the text and put together the javascript to send back */\n $container = Horde_Serialize::serialize($container, Horde_Serialize::JSON);\n $results = Horde_Serialize::serialize('<div class=\"kronolith_embedded\"><div class=\"title\">' . $title . '</div>' . $results . '</div>', Horde_Serialize::JSON);\n\n $js = <<<EOT\nif (typeof kronolith == 'undefined') {\n if (typeof Prototype == 'undefined') {\n document.write('<script type=\"text/javascript\" src=\"$pturl\"></script>');\n }\n if (typeof Horde_ToolTips == 'undefined') {\n Horde_ToolTips_Autoload = false;\n document.write('<script type=\"text/javascript\" src=\"$hjsurl\"></script>');\n }\n kronolith = new Object();\n kronolithNodes = new Array();\n document.write('<script type=\"text/javascript\" src=\"$jsurl\"></script>');\n document.write('$css');\n}\nkronolithNodes[kronolithNodes.length] = $container;\nkronolith[$container] = $results;\nEOT;\n\n return new Horde_Core_Ajax_Response_Raw($js, 'text/javascript');\n }", "static function div($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content);\n\t}", "public function content()\n {\n $wrapper = new Brick('div');\n $wrapper->addClass('selector');\n $wrapper->data(array(\n 'field' => 'selector',\n 'name' => $this->name(),\n 'page' => $this->page(),\n 'mode' => $this->mode,\n 'autoselect' => $this->autoselect(),\n 'size' => $this->size,\n 'editable' => $this->editable,\n ));\n $wrapper->html(tpl::load(__DIR__ . DS . 'template.php', array('field' => $this)));\n\n return $wrapper;\n }", "private function _wrapElement($element, $output) {\n if (!empty($element['#inline'])) {\n return $output;\n }\n $classes = array();\n $classes[] = 'form-item';\n $classes[] = 'form-item-' . $element['#type'];\n $classes[] = $this->css_class . '-item';\n $classes[] = $this->css_class . '-item-' . $element['#type'];\n if ($this->form_settings['use_bootstrap']) {\n $classes[] = 'form-group';\n }\n if (preg_match('/_hidden$/', $element['#id']) && !is_admin()) {\n $classes[] = 'wpt-form-hide-container';\n }\n if (is_admin()) {\n return sprintf(\n '<div id=\"%s-wrapper\" class=\"%s\">%s</div>', $element['#id'], implode(' ', $classes), $output\n );\n }\n return $output;\n }", "function sc_container( $attr, $content='' ) {\n\t$class = isset( $attr['class'] ) ? $attr['class'] : '';\n\tob_start();\n\t?>\n\t<div class=\"container <?php echo $class; ?>\">\n\t\t<?php echo do_shortcode( $content ); ?>\n\t</div>\n\t<?php\n\treturn ob_get_clean();\n}", "private function wrap($html){\n return ($this->ie->is_active()) ? $this->ie->wrap($html) : $html;\n }", "function add_html () {\n //Adds a html block\n return '<div class=\"black\">Lorem ipsum dolor</div>';\n }", "function content_addDivToImage( $content ) {\n $pattern = '/(<img([^>]*)>)/i';\n $replacement = '<div class=\"image_wrapper\">$1</div>';\n $content = preg_replace( $pattern, $replacement, $content );\n\n return $content;\n}", "function wpg_embedded_content($type=array()) {\n\n\t\tif (!empty($type)){\n\n\t\t\t$content = apply_filters( 'the_content', get_the_content() );\n\t\t\t$media = get_media_embedded_in_content($content, $type);\n\n\t\t\techo !empty($media) ? $media[0] : '';\n\n\t\t}\n}", "public function autoembed($content)\n {\n }", "function ninja_the_content( $content ) {\r\n\t\t\r\n\t\t$id = get_the_ID();\r\n\t\t\r\n\t\t// ad wrapping div if shortcode used\r\n\t\tif ( ninja_has_shortcode('columnbreak', $content) ) {\r\n\t\t\t$content = '<div class=\"ninja_columns colsid_'.$id.'\"><div class=\"ninja_col\">'.$content;\r\n\t\t\t$content .= '</div></div>';\r\n\t\t}\r\n\t\t\r\n\t\treturn $content;\r\n\t\t\r\n\t}", "public function getAfterElementHtml()\n {\n // here you can write your code.\n $customDiv = '<div style=\"width:600px;height:200px;margin:10px 0;border:2px solid #000\" id=\"customdiv\"><h1 style=\"margin-top: 12%;margin-left:40%;\">Custom Div</h1></div>';\n return $customDiv;\n }", "static function div_open($arguments=false, $content='') {\n\t\treturn self::tag('div', $arguments, $content, true);\n\t}", "static function div($content, $id = Null, $class = Null) \n {\n return '<div ' . self::_id($id).self::_class($class) . '>'\n .self::$_nl.$content.'</div>'.self::$_nl;\n }", "public function render_content() {\n\t\t\t$allowed_html = array(\n\t\t\t\t'a' => array(\n\t\t\t\t\t'href' => array(),\n\t\t\t\t\t'title' => array(),\n\t\t\t\t\t'class' => array(),\n\t\t\t\t\t'target' => array(),\n\t\t\t\t),\n\t\t\t\t'br' => array(),\n\t\t\t\t'em' => array(),\n\t\t\t\t'strong' => array(),\n\t\t\t\t'i' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t);\n\t\t\t?>\n\t\t\t<div class=\"single-accordion-custom-control\">\n\t\t\t\t<div class=\"single-accordion-toggle\"><?php echo esc_html( $this->label ); ?><span class=\"accordion-icon-toggle dashicons dashicons-plus\"></span></div>\n\t\t\t\t<div class=\"single-accordion customize-control-description\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $this->description ) ) {\n\t\t\t\t\t\techo '<ul class=\"single-accordion-description\">';\n\t\t\t\t\t\tforeach ( $this->description as $key => $value ) {\n\t\t\t\t\t\t\techo '<li>' . esc_attr( $key ) . wp_kses( $value, $allowed_html ) . '</li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</ul>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo wp_kses( $this->description, $allowed_html );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "function crmpress_content_structure_start() {\n\necho '<div id=\"main-content\">';\n\techo '<div class=\"wrap\">';\n\t\n\t\tdo_action( 'crmpress_before_content_sidebar_wrapper' );\n\t\n\t\techo '<div class=\"content-sidebar-wrapper\">';\n\t\t\n\t\tdo_action( 'crmpress_before_content' ); // This hook fires right before the content div\n\t\t\n\t\techo '<div id=\"content\">';\n\n}", "public function add_content($type=\"div\",$content=\"\",$attr=array(),$unique_id=False,$self_closing=False){\n\t\tarray_push($this->content,new elem($type,$content,$attr,$unique_id,$self_closing));\t\n\t\treturn $this->content[sizeof($this->content)-1];// \n\t}", "function group_of_gadgets_shortcode( $atts, $content = null ) {\r\n return '<div style=\"width:100%;float:left;\">' . do_shortcode($content) . '</div>';\r\n}", "function venus_structural_wrap( $output, $original_output ) {\n\n\tswitch ( $original_output ) {\n\t\tcase 'open':\n\t\t\t$output = '<div class=\"container\"><div class=\"row\">';\n\t\t\tbreak;\n\t\tcase 'close':\n\t\t\t$output = '</div></div>';\n\t\t\tbreak;\n\t}\n\n\treturn $output;\n}", "function sc_sidebar_content( $attr, $content ) {\n\t$content = do_shortcode( $content );\n\n\tob_start();\n\t?>\n\t<div class=\"page-sidebar-content\">\n\t\t<?php echo( $content ); ?>\n\t</div>\n\t<?php\n\treturn ob_get_clean();\n}", "public static function wrap_row( $content ) {\n\t\treturn \"<div class=\\\"formlift-row\\\">$content</div>\";\n\t}", "function meetup_istanbul_the_content($output)\n{\n\n $output .= '<div style=\"border:1px solid red;\">Bu Icerik Kaynak Gosterilmeden Kullanilamaz</div>';\n\n return $output;\n}", "function be_div_shortcode( $atts ) {\n\textract( shortcode_atts( array(\n\t\t'class' => '', \n\t\t'id' => '' \n\t), $atts) );\n\n\t$return = '<div';\n\tif ( !empty( $class ) )\n\t\t$return .= ' class=\"'.$class.'\"';\n\tif ( !empty( $id ) )\n\t\t$return .= ' id=\"'.$id.'\"';\n\t$return .= '>';\n\t\n\treturn $return;\n}", "private function\n\t\twrap_element_with_class_and_add_to_div(\n\t\t\t$div, $content, $class_name\n\t\t)\n\t{\n\t\t$div->append_tag_to_content(\n\t\t\tself::wrap_in_div_with_class(\n\t\t\t\t$content,\n\t\t\t\t$class_name\n\t\t\t)\n\t\t);\n\t}", "public function appendSlide(mixed $content): Div {\n $slide = new Div($content);\n $this->append($slide);\n return $slide;\n }", "public function add_responsive_wrap_to_oembeds( $html, $url, $attr, $post_id ) {\n\t\t$html = '<div class=\"responsive-video-wrap entry-video\">' . $html . '</div>';\n\t\treturn $html;\n\t}", "public function embed() {\r\n if( $this->browser_none() ) {\r\n } else if( $this->browser_limited() ) {\r\n $this->embed_images();\r\n } else {\r\n $this->embed_images();\r\n $this->embed_styles();\r\n $this->embed_scripts();\r\n }\r\n// if( $this->_config['minify'] ) {\r\n// $this->_minify();\r\n// }\r\n return $this;\r\n }", "private function generate_dd_content($wrapper_id, $icon_t_l_class, $icon_b_r_class, $include_name = true) {\n \n //create main wrapper with given unique id\n echo html_writer::start_tag(\"div\", array('id' => $wrapper_id));\n \n //left/top icon\n echo html_writer::start_tag(\"div\", array('class' => 'dd_content_left'));\n //jquery based icon\n echo html_writer::start_tag(\"span\", array('class' => 'ui-icon '.$icon_t_l_class));\n echo html_writer::end_tag(\"span\");\n echo html_writer::end_tag(\"div\");\n\n //main menu container\n echo html_writer::start_tag(\"div\", array('class' => 'dd_content_container'));\n //get all mod information\n \n $this->generate_mod_options($include_name);\n \n echo html_writer::end_tag(\"div\");\n\n //create right icon\n echo html_writer::start_tag(\"div\", array('class' => 'dd_content_right'));\n //jquery based icon\n echo html_writer::start_tag(\"span\", array('class' => 'ui-icon '.$icon_b_r_class));\n echo html_writer::end_tag(\"span\");\n echo html_writer::end_tag(\"div\");\n \n \n echo html_writer::end_tag(\"div\");\n }", "function adace_before_content_add_wrap_to_query( $result, $slot_id ) {\n\tif ( adace_get_before_content_slot_id() !== $slot_id ) {\n\t\treturn $result;\n\t}\n\t$adace_ad_slots = adace_access_ad_slots();\n\t$slot_register = $adace_ad_slots[ adace_get_before_content_slot_id() ];\n\t$slot_options = get_option( 'adace_slot_' . adace_get_before_content_slot_id() . '_options' );\n\t$result['wrap'] = $slot_register['custom_options']['wrap_the_content_editable'] && isset( $slot_options['wrap_the_content'] ) ? $slot_options['wrap_the_content'] : $slot_register['custom_options']['wrap_the_content'];\n\treturn $result;\n}", "function _container($instance) {\n $output = '<div id=\"' . $this->CI->ciwy->component_config[$instance]['outerContainer'] . '\">' . $this->new_line;\n $output .= ' '. form_input($this->CI->ciwy->component_config[$instance]['inputAttributes']) . $this->new_line;\n $output .= ' <div id=\"' . $this->CI->ciwy->component_config[$instance]['containerId'] . '\"></div>' . $this->new_line;\n $output .= '</div>' . $this->new_line;\n return $output;\n }", "function tac_oembed_filter( $html, $url, $attr, $post_id ) {\n\t$return = '<figure class=\"flexible-container item-margin\">' . $html . '</figure>';\n\treturn $return;\n}", "function ubc_collab_responsive_embed ($return) {\n\treturn '<div class=\"responsive-media\">'.$return.'</div>';\n}", "public function generateHtmlDivData()\n\t{\n\t\t// TODO : to be implemented\n\t}", "public function buildLightbox(){\n\n\t\t$fields = $this->getFields();\n\n\t\techo '<div class=\"main-content\">';\n\t\t\n\t\t\tforeach( $fields as $field ){\n\n\t\t\t\t$field->render();\n\n\t\t\t\tif( method_exists( $field, 'renderTemplate' ) )\n\t\t\t\t\techo $field->renderTemplate();\n\n\t\t\t}\n\n\t\techo '</div>';\n\t\techo '<div class=\"side-content\">';\n\t\t\t\n\t\t\t$this->saveButton();\n\n\t\techo '</div>';\n\t}", "function jma_yt_video_wrap_html($atts, $video_id){\n global $api_code;\n $atts = jmayt_sanitize_array($atts);\n $yt_video = new JMAYtVideo(sanitize_text_field($video_id), $api_code);\n $style = $yt_video->process_display_atts($atts);\n $attributes = array(\n 'id' => $atts['id'],\n 'class' => $atts['class'] . ' jmayt-outer jmayt-single-item clearfix',\n 'style' => $style['display'] . $atts['style']\n );\n echo '<div ';\n foreach($attributes as $name => $attribute){\n echo $name . '=\"' . $attribute . '\" ';\n\n }\n echo '>';\n echo $yt_video->markup();\n echo '</div><!--jmayt-item-wrap-->';\n}", "public static function renderContent() {}", "protected function getContentPart()\n {\n ?>\n <div class=\"container-non-responsive\" style=\"margin-top: 15px\">\n <div class=\"row chitiet-breadcrumb\">\n <div class=\"col-xs-12\">\n <?= $this->getBreadcrumbsPart() ?>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-8 vn-lienhe-left\">\n <!-- title-->\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <h2 class=\"title\" style=\"text-transform: uppercase\">\n <small>\n <?= $this->getContentTitle() ?>\n </small>\n </h2>\n </div>\n </div>\n\n <!-- title-->\n <div class=\"row\" style=\"margin-top: 20px;\">\n <div class=\"col-xs-12\">\n <?= $this->getContentMain() ?>\n </div>\n </div>\n\n <div class=\"row\" style=\"margin-top: 100px;\">\n <div class=\"col-xs-12\">\n Share +\n </div>\n </div>\n\n </div>\n <div class=\"col-xs-4 vn-lienhe-right\">\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <?php\n //get_sidebar('right-menu-dichvu');\n $this->genRightMenu();\n ?>\n </div>\n <?= $this->getBannerServicePage() ?>\n </div>\n </div>\n </div>\n </div>\n\n <?php\n }", "function boxContent($content, $id = '') {\n\t\tif ($id) {\n\t\t\t$id = $this->toSlug($id);\n\t\t\t$idcont = $id.'-content\"';\n\t\t} else {\n\t\t\t$idcont = \"\";\n\t\t}\n\n\t\treturn html_e('div', array('id' => $idcont, 'class' => 'box-content'), $content, false);\n\t}", "public function render( ) { ?>\n <div id=\"<?php echo esc_attr($this->get_id()); ?>-container\" class=\"rwc-metabox-field-media\">\n <input type=\"hidden\"\n name=\"<?php echo esc_attr($this->get_id()); ?>\"\n id=\"<?php echo esc_attr($this->get_id()); ?>\"\n value=\"<?php echo esc_attr( $this->get_value() ); ?>\" />\n <div class=\"image-container\">\n <span class=\"add-new-image-btn\">+</span>\n </div>\n </div>\n <?php wp_enqueue_media(); ?>\n <?php wp_enqueue_script( 'rwc-metabox-field-media',\n $this->get_metabox()->get_library()->get_uri() .\n '/js/rwc/metabox/field/media.js', array( 'jquery' ) ); ?>\n <?php wp_enqueue_style( 'rwc-metabox-field-media-css',\n $this->get_metabox()->get_library()->get_uri() .\n '/css/rwc/metabox/field/media.css' ); ?>\n <?php }", "function tz_one_third( $atts, $content = null ) {\n return '<div class=\"one_third\">' . do_shortcode($content) . '</div>';\n}", "function tag_wrap($tag, $content = \"\", $class = NULL){\n\t$result = (is_block($tag)) ? \"\\r<\" : \"<\" ;\n\t$result .= $tag;\n\t$result .= (!empty($class)) ? ' class=\"'.$class.'\">' : '>' ;\n\t$result .= $content;\n\t$result .= (is_block($tag)) ? \"\\r</$tag>\\n\" : \"</$tag>\" ;\n\t\n\treturn $result;\n}", "function child_div()\r\n {\r\n \r\n $display_content = '<div class=\"opml-browser-children\" id=\"opml-browser-children' . $this->name . $this->nextid;\r\n if ($this->margin != '')\r\n $display_content .= '\" style=\"margin-left:' . $this->margin . ';'; // Indent with a margin\r\n $display_content .= '\">';\r\n return $display_content;\r\n }", "function main($content, $conf)\t{\n\t\t$this->init($conf);\n\n\t\t$calendar = $this->getCalendar();\n\n\t\t$content = $this->cObj->stdWrap($calendar, $this->conf['header_stdWrap.']);\n\n\t\tif($this->conf['dontWrapInDiv'] == 1) {\n\t\t\treturn $content;\n\t\t} else {\n\t\t\treturn $this->pi_wrapInBaseClass($content);\n\t\t}\n\t}", "public function render($content)\n {\n $element = $this->getElement();\n $view = $element->getView();\n if (null === $view) {\n return $content;\n }\n\n $jQueryParams = $this->getJQueryParams();\n\n //Combine element attribs and decorator options!!\n $attribs = array_merge($this->getAttribs(), $this->getOptions());\n\n $helper = $this->getHelper();\n $id = $element->getId() . '-container';\n\n return $view->$helper($id, $jQueryParams, $attribs);\n }", "function the_content($content) {\n if (is_single() || is_page()) {\n global $post;\n $saved_data = get_post_meta($post->ID, 'hoverable', true);\n\n if (!empty($saved_data)) {\n foreach ($saved_data as $key => $item) {\n $hover_title = $item['hover_title'];\n $hover_desc = $item['hover_desc'];\n $content = str_replace($hover_title, \"<a href=\\\"#hov$key\\\" class=\\\"facebox\\\">$hover_title</a>\", $content);\n $hidden_divs[$key] = \"<div id=\\\"hov$key\\\">$hover_desc</div>\";\n }\n }\n if (isset($hidden_divs)) {\n return $content . '<div class=\"hov-modal\">' . implode('', $hidden_divs) . '</div>';\n }\n }\n return $content;\n }", "public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"sortable_repeater_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<input type=\"hidden\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-sortable-repeater\" <?php $this->link(); ?> />\n\t\t\t\t<div class=\"sortable_repeater sortable\">\n\t\t\t\t\t<div class=\"repeater\">\n\t\t\t\t\t\t<input type=\"text\" value=\"\" class=\"repeater-input\" placeholder=\"https://\" /><span class=\"dashicons dashicons-sort\"></span><a class=\"customize-control-sortable-repeater-delete\" href=\"#\"><span class=\"dashicons dashicons-no-alt\"></span></a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<button class=\"button customize-control-sortable-repeater-add\" type=\"button\"><?php echo wp_kses_post( $this->button_labels['add'] ); ?></button>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public static function make_gallery_container( $html ) {\n global $post;\n\n if ( isset( $post ) ) {\n $blog_id = (int) get_current_blog_id();\n\n $extra_data = array(\n 'data-carousel-extra' => array(\n 'blog_id' => $blog_id,\n 'permalink' => get_permalink( $post->ID ),\n )\n );\n foreach ( (array) $extra_data as $data_key => $data_values ) {\n $html = str_replace( '<div ', '<div ' . esc_attr( $data_key ) . \"='\" . json_encode( $data_values ) . \"' \", $html );\n }\n }\n\n return $html;\n }", "public function render_content() {\n\t\t\t$allowed_html = array(\n\t\t\t\t'a' => array(\n\t\t\t\t\t'href' => array(),\n\t\t\t\t\t'title' => array(),\n\t\t\t\t\t'class' => array(),\n\t\t\t\t\t'target' => array(),\n\t\t\t\t),\n\t\t\t\t'br' => array(),\n\t\t\t\t'em' => array(),\n\t\t\t\t'strong' => array(),\n\t\t\t\t'i' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t\t'span' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t\t'code' => array(),\n\t\t\t);\n\t\t\t?>\n\t\t\t<div class=\"simple-notice-custom-control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo wp_kses( $this->description, $allowed_html ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function buildElement()\n\t{\n\t\t$e = $this->getElement();\n\t\t$view = $e->getView();\n\t\t$helper = $e->helper;\t\t\n\t\t\n\t\t$type = $e->getType();\n\t\t\n\t\t$attribs = $e->getAttribs();\n\t\t\n\t\t/*$mode = self::MODE_FILE;\n\t\tif (is_string($attribs['selector_mode']) && in_array($attribs['selector_mode'], $this->_modes)) {\n\t\t\t$mode = $attribs['selector_mode'];\n\t\t}\n\t\t$attribs['selector_mode'] = $mode;*/\n\t\t\n\t\t$buttonLabel = '';\n\t\t\n\t\t$selectMultiple = 'false';\n\t\t$jsMethod = 'mainImageRenderer';\n\t\tif (isset($attribs['selectMultiple']) && !!$attribs['selectMultiple']) {\n\t\t\t$selectMultiple = 'true';\n\t\t\t$jsMethod = 'imagesRenderer';\n\t\t}\n\t\t\n\t\t$imgType = '';\n\t\tif (is_string($attribs['media-type'])) {\n\t\t\t$imgType = $attribs['media-type'];\n\t\t\tunset ($attribs['media-type']);\n\t\t}\n\t\t\n\t\t$xhtml = '<div class=\"' . $this->_namespace . '-tag\">'\n\t\t\t . $view->formHidden($e->getName(), $e->getValue(), array('media-type' => $imgType, 'select-multiple' => $selectMultiple, 'autocomplete' => \"off\"))\n\t\t\t . $view->$helper($e->getName(), $buttonLabel, $attribs, $e->options)\n\t\t\t . '<script>$(document).ready(function(){ $.fn.cmsManager(\\'' . $jsMethod . '\\', null, \\'' . $e->getName() . '\\'); })</script>'\n\t\t\t . '</div>';\t\t\t\n\t\n\t\treturn $xhtml;\n\t}", "public function stdWrap_innerWrap($content = '', $conf = [])\n {\n return $this->wrap($content, $conf['innerWrap']);\n }", "public function div($content)\n {\n return (new Builder($this))\n ->tag('a')\n ->content($content);\n }", "function wrapWithForm($content) {\n\t\t$output = '\n\t\t\t<form action=\"'.$this->formAction.'\" method=\"'.$this->formMethod.'\" enctype=\"multipart/form-data\" class=\"tx-frontendformslib-form\">\n\t\t\t\t'.$content.'\n\t\t\t\t'.$this->additionalHiddenFields.'\n\t\t\t</form>\n\t\t';\n\n\t\treturn $output;\n\t}", "public function embed();", "function ucf_post_list_display_gallery_before($content, $posts, $atts)\n{\n ob_start();\n ?>\n <div class=\"ucf-post-list card-layout\" id=\"post-list-<?php echo $atts['list_id']; ?>\">\n <?php\n return ob_get_clean();\n}", "abstract protected function RenderContent();", "function element_div($text='', $xmlUrl='', $htmlUrl='', $type='rss', $tooltip=null, $hasChildren = false)\r\n {\r\n $this->nextid++; // Get a unique ID\r\n $folder = $this->name . $this->nextid;\r\n $display_content = '<div class=\"opml-browser-element\" id=\"opml-browser-element' . $folder .'\" >';\r\n $display_content .= '<span class=\"opml-browser-buttondiv\">';\r\n if (!is_null($xmlUrl) && ($xmlUrl != '')) // Use a feed icon if we have an XML source for this entry\r\n $display_content .= '<a href=\"' . htmlspecialchars($xmlUrl, ENT_COMPAT, \"UTF-8\", false) . '\"><img id=\"opml-browser-button' . $folder . '\" class=\"opml-browser-button opml-browser-item\" src=\"' . $this->image_link($type) .'\" alt=\"Subscribe\" /></a>';\r\n if ($hasChildren && $this->show_folders) // A folder icon for categories\r\n {\r\n $display_content .= '<img id=\"opml-browser-folder' . $folder . '\" class=\"opml-browser-button opml-browser-category\" src=\"' . $this->image_link('folderopen'). '\" alt=\"Category\" />';\r\n $this->folders[] = $folder; // Save to the list of folders for the close_all() method\r\n }\r\n $display_content .= '</span><span class=\"opml-browser-text'; // Common class for all elements for styling\r\n if ($hasChildren)\r\n $display_content .= ' opml-browser-category'; // Class for category entries to allow custom styling\r\n else\r\n $display_content .= ' opml-browser-item'; // And a different one for line items\r\n $display_content .= '\" >';\r\n if (!is_null($htmlUrl) && ($htmlUrl != ''))\r\n $display_content .= '<a href=\"' . htmlspecialchars($htmlUrl, ENT_COMPAT, \"UTF-8\", false) . '\">'; // Link the HTML\r\n $display_content .= htmlspecialchars($text, ENT_COMPAT, \"UTF-8\", false);\r\n if (!is_null($htmlUrl) && ($htmlUrl != ''))\r\n $display_content .= '</a>';\r\n $display_content .= '</span>';\r\n if (isset($tooltip)) {\r\n $display_content .= '<span class=\"opml-browser-tooltip opml-browser-invisible\">' .\r\n htmlspecialchars($tooltip, ENT_COMPAT, \"UTF-8\", false) . '</span>';\r\n }\r\n return $display_content;\r\n }", "function module_callout_box_function($atts, $content, $tag){\r\n\treturn '<div class=\"mod-section-block-callout\">' . do_shortcode($content) . '</div>';\r\n}", "function render_lightbox_element($atts, $content)\n{\n $settings = RMSettings::plugin_settings('lighbox', true);\n\n $options = RMCustomCode::get()->atts($atts, [\n 'rel' => 'false',\n 'name' => 'lightbox-container',\n 'transition' => $settings->transition,\n 'speed' => $settings->speed,\n 'maxWidth' => $settings->width,\n 'maxHeight' => $settings->height,\n 'scalePhotos' => $settings->scale ? 'true' : 'false',\n 'slideshow' => $settings->slideshow ? 'true' : 'false',\n 'slideshowSpeed' => $settings->slspeed,\n 'slideshowAuto' => $settings->slauto ? 'true' : 'false',\n 'slideshowStart' => __('Start Slideshow', 'lightbox'),\n 'slideshowStop' => __('Stop Slideshow', 'lightbox'),\n ]);\n\n $ret = '<div class=\"' . $options['name'] . '\">' . $content . '</div>';\n\n RMLightbox::get()->add_element(\".$options[name] > a\");\n\n foreach ($options as $option => $value) {\n RMLightbox::get()->add_option($option, $value);\n }\n\n return $ret;\n}", "public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"toggle-switch-control\">\n\t\t\t\t<div class=\"toggle-switch\">\n\t\t\t\t\t<input type=\"checkbox\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" class=\"toggle-switch-checkbox\" value=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->link();\n\t\t\t\t\tchecked( $this->value() );\n\t\t\t\t\t?>\n\t\t\t\t\t>\n\t\t\t\t\t<label class=\"toggle-switch-label\" for=\"<?php echo esc_attr( $this->id ); ?>\">\n\t\t\t\t\t\t<span class=\"toggle-switch-inner\"></span>\n\t\t\t\t\t\t<span class=\"toggle-switch-switch\"></span>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function stdWrap_outerWrap($content = '', $conf = [])\n {\n return $this->wrap($content, $conf['outerWrap']);\n }", "function shortcode_content_box( $atts, $content = null ) {\n\t\t$variables = array( 'class' => '' );\n\t\textract( shortcode_atts( $variables, $atts ) );\n\t\t$class = empty( $class )?'':' ' . $class;\n\t\t$result = '<article class=\"box' . esc_attr( $class ) .'\">';\n\t\t$result .= do_shortcode( $content );\n\t\t$result .= '</article>';\n\t\treturn $result;\n\t}", "public function getWrapperElement();", "function pendrell_image_wrap_inner( $html, $width, $height ) {\n $padding = ubik_imagery_sizes_percent( $width, $height );\n if ( !empty( $padding ) )\n $html = '<div class=\"ubik-wrap-inner\" style=\"padding-bottom: ' . $padding . '%;\">' . $html . '</div>';\n return $html;\n}", "function inline_archive_structure_start() {\n\n\techo '<div id=\"archive\">';\n\t\n}", "public function div($innerHTML, $options = [])\n {\n return $this->addSingleField(\n '',\n '',\n Widget::getDivWidget($innerHTML, $options)\n );\n }", "public function processContainer()\n {\n $class = \"container\";\n if ($this->hasFluid()) $class .= \"-fluid\";\n $this->add($this->createWrapper('div', ['class' => $class], $this->stringifyHeader() . $this->stringifyCollapse()));\n }", "function bunchy_woocommerce_content_wrapper_start() {\n\t?>\n\t<div class=\"g1-row g1-row-layout-page g1-row-padding-m\">\n\t<div class=\"g1-row-inner\">\n\t<div class=\"g1-column g1-column-2of3\">\n\n\t<?php\n}", "public function render_content() {\n\t\t\t?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<span class=\"description customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t</label>\n\t\t\t<div class=\"wds-customize-text-editor\">\n\t\t\t\t<?php\n\t\t\t\t// Setttings for the editor.\n\t\t\t\t$settings = array(\n\t\t\t\t\t'textarea_name' => $this->id,\n\t\t\t\t\t'textarea_rows' => 4,\n\t\t\t\t\t'media_buttons' => true,\n\t\t\t\t);\n\n\t\t\t\t// Add the editor.\n\t\t\t\twp_editor( $this->value(), $this->id, $settings );\n\n\t\t\t\t// Only enqueue scripts once.\n\t\t\t\tif ( 0 === self::$count ) {\n\t\t\t\t\t$this->enqueue_scripts();\n\t\t\t\t}\n\n\t\t\t\t// add the footer scripts.\n\t\t\t\t$this->add_footer_scripts();\n\n\t\t\t\t// Increment count.\n\t\t\t\t++self::$count;\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "private function wrapHtml($content): string\n {\n return <<<HTML\n<html>\n <head>\n <style>\n body {color: #545454; font:14px/22px ''; margin: 20px;}\n div.message {margin-bottom: 10px; padding: 6px 12px;}\n div.step {display: flex;}\n span.index {display: block; flex: 0 0 20px; padding: 6px 12px;}\n span.detail {display: block; flex: 0 1 auto; padding: 6px 12px;}\n span.execution {color: #B71C1C; display: block;}\n span.argument {color: #545454;}\n span.position {display: block; font-size: 12px;}\n span.file {color: #F57F17;}\n </style>\n </head>\n <body>\n $content\n </body>\n</html>\nHTML;\n }", "public function render_content()\n\t\t{ ?>\n\t\t\t<label><p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?>\n </span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() );?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span></p></label> <?php // WPCS: XSS ok. ?>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "protected function wrap($innerHtml) {\n $errorMessage = NULL;\n $requiredField = NULL;\n\n if($this->required && $this->errorOccured() && $this->form->isSubmitted()) {\n $errorMessage = (bool)$this->errorMessage? $this->errorMessage : FORMWIZARD_ERROR_MESSAGE;\n $errorMessage = str_replace('{errorMessage}', $errorMessage, FORMWIZARD_UNFILLED_REQUIRED_FIELD);\n }\n\n if($this->required && $this->markIfRequired) {\n $requiredField = FORMWIZARD_REQUIRED_FIELD;\n }\n\n $this->text = (bool)$this->text ? $this->text : '&nbsp;';\n $text = $this->doNotWrapDescription ? '<nobr>'.$this->text.'</nobr>' : $this->text;\n\n if($this->focus) {\n $this->javascripts = 'document.forms[\\''.$this->form->getName().'\\'].'.$this->name.'.focus();';\n }\n\n $html = FORMWIZARD_PRE_ELEMENT.\"\\n\".$text.$requiredField.\"\\n\".FORMWIZARD_SEPARATE_ELEMENT;\n $html .= \"\\n\".$innerHtml.$errorMessage.\"\\n\".FORMWIZARD_POST_ELEMENT;\n\n return $html;\n }", "public function renderContent() {}", "public function output_html($data, $query='') {\n return '<div id=\"'. $this->get_id() .'\"/>'.$this->description.'</div>';\n }", "function div($text, $options = array()) {\n\t\treturn $this->Html->div(null, $text, $options).\"\\n\";\n\t}", "protected function buildEmbedded($a_content, $a_nav)\n\t{\n\t\t$wtpl = new ilTemplate(\"tpl.blog_embedded.html\", true, true, \"Modules/Blog\");\n\t\t$wtpl->setVariable(\"VAL_LIST\", $a_content);\n\t\t$wtpl->setVariable(\"VAL_NAVIGATION\", $a_nav);\t\t\t\t\t\t\t\n\t\treturn $wtpl->get();\n\t}", "public function render_content()\n\t\t{ ?>\n\t\t\t<label>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->description ); ?></span>\n <p class=\"description\">\n <span class=\"typography-size-label\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\"><input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "public function run()\n {\n return \\yii\\helpers\\Html::tag($this->container, $this->content, $this->getOptions());\n }", "public function escape()\n\t{\n\t\treturn ! $this->escaped ? esc_html($this->content) : $this->content;\n\t}", "function landContent($arr)\n\t{ \n\t\t$output='';\n\t\tif($arr[0]['html_content']!='')\n\t\t\t$output='<div id=\"product_tbbg\" style=\"padding:2px;border: 1px solid rgb(201, 73, 51); margin-top: 14px;\">'.$arr[0]['html_content'].'</div>';\n\t\treturn $output;\n\t}", "function adace_after_paragraph_3_add_wrap_to_query( $result, $slot_id ) {\n\tif ( adace_get_after_paragraph_3_slot_id() !== $slot_id ) {\n\t\treturn $result;\n\t}\n\t$adace_ad_slots = adace_access_ad_slots();\n\t$slot_register = $adace_ad_slots[ adace_get_after_paragraph_3_slot_id() ];\n\t$slot_options = get_option( 'adace_slot_' . adace_get_after_paragraph_3_slot_id() . '_options' );\n\t$result['wrap'] = $slot_register['custom_options']['wrap_the_content_editable'] && isset( $slot_options['wrap_the_content'] ) ? $slot_options['wrap_the_content'] : $slot_register['custom_options']['wrap_the_content'];\n\treturn $result;\n}", "public function mobi2GoContainer() {\n\n $data = \"<div id=\\\"mobi2go-container\\\"></div>\n <script>\n document.getElementsByTagName('head')[0].appendChild(function(s){\n var d=document,\n m2g=d.createElement('script'),\n l=function(){\n Mobi2Go.load(s.container,s.ready);\n },\n jq=window.jQuery&&+window.jQuery.fn.jquery.substring(0,3)>=1.7,\n qs=window.location.search.substring(1),\n re='=(.*?)(?:;|$)',\n c=d.cookie.match('MOBI2GO_SESSIONID'+re),\n w=window.innerWidth;\n\n m2g.src='https://www.mobi2go.com/store/embed/\" . $this->settings->storeName .\n \".js?'+qs+(jq?'&no_jquery':'')+(c?'&s='+c[1]:'')+'&device_width='+w;\n \n if(m2g.onload!==undefined)m2g.onload=l;\n else m2g.onreadystatechange=function(){\n if(m2g.readyState!=='loaded'&&m2g.readyState!=='complete')\n return;m2g.onreadystatechange=null;l();\n }\n return m2g;\n }({\n container: 'mobi2go-container',\n ready: function() {}\n }));\n </script>\";\n\n return TemplateHelper::getRaw($data);\n }", "public function innerHTML($parameters){\n $innerHTML = '';\n if ($this->validate($parameters) !== false){\n $innerHTML .= '<div data-post-element-type=\"Pure.Mana.Icon.A.Container\" '.\n 'data-engine-mana-element=\"Container.Template\" '.\n 'data-engine-mana-objectID=\"[object_id]\" '.\n 'data-engine-mana-object=\"[object_type]\" '.\n 'data-engine-mana-field=\"[field]\" '.\n 'style=\"display:none;\">';\n if ($parameters->has_permit !== false){\n $innerHTML .= '<label for=\"mana.A.[object_id]\">'.\n '<input data-post-element-type=\"Pure.Mana.Icon.A.Switcher\" type=\"checkbox\" name=\"Pure.Mana.Icon.A.Switcher\" id=\"mana.A.[object_id]\"/>';\n }\n $innerHTML .= '<div data-post-element-type=\"Pure.Mana.Icon.A.Switcher\">'.\n '<canvas data-post-element-type=\"Pure.Mana.Icon.A.Switcher\" '.\n 'data-engine-mana-element=\"Switcher\" '.\n 'data-engine-mana-plus=\"[plus]\" '.\n 'data-engine-mana-minus=\"[minus]\" '.\n 'data-engine-mana-canvas-width=\"3em\" '.\n 'data-engine-mana-canvas-height=\"3em\" '.\n 'data-engine-mana-color-plus=\"rgb(50, 150, 0)\" '.\n 'data-engine-mana-color-minus=\"rgb(150, 50, 0)\" '.\n 'width=\"64\" height=\"64\">'.\n '</canvas>'.\n '<p data-post-element-type=\"Pure.Mana.Icon.A.Switcher\" data-engine-mana-element=\"Label.Total\">[total]</p>'.\n '</div>';\n if ($parameters->has_permit !== false){\n $innerHTML .= '<div data-post-element-type=\"Pure.Mana.Icon.A.Controls\">'.\n '<a data-post-element-type=\"Pure.Mana.Icon.A.Controls.Button\" data-button-type=\"Minus\" data-engine-mana-element=\"Button.Minus\"></a>'.\n '<div data-post-element-type=\"Pure.Mana.Icon.A.Controls.Labels\">'.\n '<p data-post-element-type=\"Pure.Mana.Icon.A.Controls.Labels.Total\" data-engine-mana-element=\"Label.Total\">[total]</p>'.\n '<p data-post-element-type=\"Pure.Mana.Icon.A.Controls.Labels.Plus\" data-engine-mana-element=\"Label.Plus\">[plus]</p>'.\n '<p data-post-element-type=\"Pure.Mana.Icon.A.Controls.Labels.Minus\" data-engine-mana-element=\"Label.Minus\">[minus]</p>'.\n '</div>'.\n '<a data-post-element-type=\"Pure.Mana.Icon.A.Controls.Button\" data-button-type=\"Plus\" data-engine-mana-element=\"Button.Plus\"></a>'.\n '</div>';\n }\n if ($parameters->has_permit !== false){\n $innerHTML .= '</label>';\n }\n $innerHTML .= '</div>';\n \\Pure\\Components\\Attacher\\Module\\Initialization::instance()->attach();\n \\Pure\\Components\\Attacher\\Module\\Attacher::instance()->addSETTING(\n 'pure.mana.icon.templates.A',\n base64_encode($innerHTML),\n false,\n true\n );\n }\n return $innerHTML;\n }" ]
[ "0.6995212", "0.6769315", "0.6544479", "0.6488717", "0.63941824", "0.6388175", "0.63330024", "0.6310973", "0.62995464", "0.6212384", "0.6157201", "0.61063373", "0.60965896", "0.6025274", "0.6025274", "0.59491146", "0.592711", "0.59202445", "0.5919399", "0.5901291", "0.58683234", "0.5816746", "0.580992", "0.57996273", "0.5797059", "0.57432085", "0.5725835", "0.5712238", "0.5688628", "0.56469744", "0.5581883", "0.55528545", "0.5528406", "0.55245924", "0.5503925", "0.5498277", "0.5493445", "0.54746723", "0.54582965", "0.5456648", "0.5440884", "0.5415086", "0.5413883", "0.53991216", "0.53667694", "0.53511816", "0.53385967", "0.53304005", "0.5325445", "0.53189796", "0.53131443", "0.53044534", "0.5298097", "0.5294972", "0.52943105", "0.52941334", "0.5287333", "0.5280432", "0.5269962", "0.5266751", "0.5262907", "0.52610236", "0.52507806", "0.52426356", "0.5241681", "0.52184176", "0.52140105", "0.5205135", "0.5204218", "0.51961666", "0.51942825", "0.5188962", "0.51885533", "0.51853347", "0.5181705", "0.5180237", "0.5179264", "0.51766825", "0.51754755", "0.5175102", "0.51705164", "0.5167348", "0.5165663", "0.5163758", "0.516079", "0.51598656", "0.5158565", "0.5147059", "0.5146741", "0.51317024", "0.5128229", "0.5126708", "0.51261735", "0.5122821", "0.5112501", "0.5104104", "0.51026475", "0.510264", "0.5101971", "0.5101175" ]
0.52120304
67
Wraps Images content on a DIV element
function content_addDivToImage( $content ) { $pattern = '/(<img([^>]*)>)/i'; $replacement = '<div class="image_wrapper">$1</div>'; $content = preg_replace( $pattern, $replacement, $content ); return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function image_wrap() {\r\n add_filter('the_content', array('cwp', 'filter_images'));\r\n }", "public function asHtml(): string {\n\n $resultsHtml = \"<div class='img-grid'>\";\n $count = 0;\n\n foreach ($this->results as $image) {\n $count++;\n $title = $image->getTitle();\n $alt = $image->getAlt();\n $displayText = ($title) ? $title : ($alt) ? $alt : $image->getImageUrl();\n\n $resultsHtml .= \"\n <div class='item image{$count}'>\n <a href='{$image->getImageUrl()}' data-fancybox data-caption='{$displayText}' data-siteurl='{$image->getSiteUrl()}'>\n <script >\n $(document).ready(function() {\n loadImage(\\\"{$image->getImageUrl()}\\\", \\\"image{$count}\\\")\n });\n </script>\n <span class='details'>$displayText</span>\n </a>\n </div>\";\n }\n\n $resultsHtml .= \"</div>\";\n return $resultsHtml;\n }", "function pendrell_image_wrap_inner( $html, $width, $height ) {\n $padding = ubik_imagery_sizes_percent( $width, $height );\n if ( !empty( $padding ) )\n $html = '<div class=\"ubik-wrap-inner\" style=\"padding-bottom: ' . $padding . '%;\">' . $html . '</div>';\n return $html;\n}", "protected function fetchImagesInContent(){\n if(isset($this->images)){\n return;\n }\n $texts = array(\n 'text' => $this->Article->text, \n 'full' => $this->Article->fulltext, \n 'intro' => $this->Article->introtext);\n $images = array();\n foreach ($texts as $key => $text) {\n if($text != ''){\n $fetchedImages = $this->extractImageFromHTML($text, $key);\n if($fetchedImages){\n $images = array_merge($images, $fetchedImages);\n }\n }\n }\n if(!empty($images)){\n $this->images = $images;\n }\n }", "function buildHtmlPhotos($data) {\r\n $photos = null;\r\n foreach ($data as $photo) {\r\n $image = '<img src=\"' . $photo['square_image_url'] .'\" title=\"' . $photo['title'] . '\" alt=\"' . $photo['title'] .'\" />';\r\n $photos .= '<div class=\"image-container\"><div class=\"image\">' . '<a href=\"/view-photo/' . $photo['id'] . '\" target=\"_blank\">' . $image . '</a></div></div>';\r\n }\r\n return $photos;\r\n }", "function kalium_image_placeholder_wrap_element( $image ) {\n\tif ( false !== strpos( $image, '<img' ) ) {\n\t\treturn kalium()->images->get_image( $image );\n\t}\n\n\treturn $image;\n}", "function extract_embedded_images_from_post_content() {\n // be consistent with media_images.\n // http://stackoverflow.com/a/20861974/6763239\n $embedded_images = array();\n\n $img_nodes = $this->dom->getElementsByTagName('img');\n\n foreach ( $img_nodes as $img_node ) {\n $embedded_images[] = new EmbeddedImage($img_node, $this);\n }\n\n return $embedded_images;\n }", "function outputWrappedImage( $row, $wrapperClass, $linkBase, $size ) {\n\tglobal $CFG;\n\n\tif( isset( $CFG->thumbSize ))\n\t\t$thumbMax = $CFG->thumbSize;\n\telse\n\t\t$thumbMax = 120;\n\n\t$maxChars = 20;\n\t$ellipses = \" ...\";\n\t$eLen = strlen($ellipses);\n\t$imageOutput = \"<div class=\\\"\".$wrapperClass.\"\\\"><div class=\\\"thumb_img_wrapper\".$size.\"\\\">\";\n\tif( $size <= $thumbMax )\n\t\t$pathToImg = $CFG->image_thumb . \"/\" . $row['img_path'];\n\telse\n\t\t$pathToImg = $CFG->image_medium . \"/\" . $row['img_path'];\n\t$pathToDetails = $linkBase.$row['id'];\n\n\tif( $row['img_ar'] <= 0 ) {\n\t\t$imageOutput .= \"<a href=\\\"\".$pathToDetails.\"\\\"><img src=\\\"\".$pathToImg.\"\\\" \"\n\t\t\t\t\t\t\t\t\t\t\t.\" class=\\\"thumb_unk\".$size.\"\\\" \"\n\t\t\t\t\t\t\t\t\t\t\t.\" alt=\\\"\".$row['name'].\"\\\" /></a>\";\n\t} else {\n\t\t$imageOutput .= \"<div class=\\\"shift\\\" style=\\\"position:relative;\";\n\t\tif( $row['img_ar'] > 1 ) {\t// Horizontal/landscape\n\t\t\t// y offset = ($size-(height))/2 == ($size-($size/img_ar))/2\n\t\t\t$imageOutput .= \"left:0px;top:\".(($size-$size/$row['img_ar'])/2).\"px;\\\">\";\n\t\t\t$imageOutput .= \"<a href=\\\"\".$pathToDetails.\"\\\"><img width=\\\"$size\\\"\";\n\t\t} else { // Vertical/portrait\n\t\t\t// x offset = ($size-(width))/2 == ($size-($size*img_ar))/2\n\t\t\t$imageOutput .= \"top:0px;left:\".(($size-$size*$row['img_ar'])/2).\"px;\\\">\";\n\t\t\t$imageOutput .= \"<a href=\\\"\".$pathToDetails.\"\\\"><img height=\\\"$size\\\"\";\n\t\t}\n\t\t$imageOutput .= \" src=\\\"\".$pathToImg.\"\\\" class=\\\"thumb\\\" \"\n\t\t\t\t\t\t\t\t\t\t.\" alt=\\\"\".$row['name'].\"\\\" /></a></div>\";\n\t}\n\t$imageOutput .= \"</div>\"; // close shift wrapper divs\n\n\tif( isset($row['name']) ) {\n\t\t$text = $row['name'];\n\n\t\tif (strlen($text) > $maxChars) {\n\t\t\t$text = substr($text,0,$maxChars-$eLen);\n\t\t\t$text = substr($text,0,strrpos($text,' '));\n\t\t\t$text .= $ellipses;\n\t\t}\n\n\t\t$textOutput = \"<div class=\\\"thumbLabel\\\"><a href=\\\"\"\n\t\t\t\t\t\t\t\t\t\t.$pathToDetails.\"\\\"><abbr title=\\\"\".$row['name'].\"\\\">\"\n\t\t\t\t\t\t\t\t\t\t.$text.\"</abbr></a></div>\";\n\t\t$imageOutput .= $textOutput;\n\t}\n\n\tif( isset($row['owner']) ) {\n\t\t$text = $row['owner'];\n\n\t\tif (strlen($text) > $maxChars) {\n\t\t\t$text = substr($text,0,$maxChars-$eLen);\n\t\t\t$text = substr($text,0,strrpos($text,' '));\n\t\t\t$text .= $ellipses;\n\t\t}\n\n\t\t$textOutput = \"<div class=\\\"ownerLabel\\\">Created by <span class=\\\"ownerName\\\">\"\n\t\t\t\t\t\t\t\t\t\t.$text.\"</span></div>\";\n\t\t$imageOutput .= $textOutput;\n\t}\n\n\t$imageOutput .= \"</div>\"; // close wrapper div\n\n\treturn $imageOutput;\n\n}", "function gallery_image($element)\n\t\t{\n\t\t\t$prevImg = $extraClass = \"\";\n\t\t\t$real_id = explode('-__-', $element['id']);\n\t\t\t$real_id = $real_id[0];\n\t\t\t\n\t\t\tglobal $post_ID;\n\t\t\tif(empty($post_ID) && isset($element['apply_all'])) $post_ID = $element['apply_all'];\n\t\t\t\n\t\t\tif(!is_numeric($element['std']) || $element['std'] == '')\n\t\t\t{\n\t\t\t\t$prevImg = '<img src=\"'.ACE_IMG_URL.'icons/video_insert_image.png\" alt=\"\" />';\n\t\t\t\t$extraClass = \" ace_gallery_image_vid\";\n\t\t\t}\n\t\t\telse if($element['std'] != '')\n\t\t\t{\n\t\t\t\t$prevImg = wp_get_attachment_image($element['std'], array(100,100));\n\t\t\t\t$extraClass = \" ace_gallery_image_img\";\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t$output =\"\";\n\t\t\t$output .=' <div class=\"ace_gallery_image'.$extraClass.'\">';\n\t\t\t\n\t\t\t\t//generate the upload link\n\t\t\t\t\t$output .= '<a href=\"#\" class=\"ace_gallery_uploader\" title=\"'.$element['name'].'\" id=\"ace_gallery_image '.$element['id'].'\"';\n\t\t\t\t\t$output .= 'data-label=\"'.$element['label'].'\" ';\n\t\t\t\t\t$output .= 'data-this-id=\"'.$element['id'].'\" ';\n\t\t\t\t\t$output .= 'data-attach-to-post = \"'.$post_ID.'\" ';\n\t\t\t\t\t$output .= 'data-real-id=\"'.$real_id.'\" ';\n\t\t\t\t\t$output .= 'data-overwrite=\"true\" ';\n\t\t\t\t\t$output .= '>'.$prevImg.'</a>';\n\t\t\t\t\t$output .= '<input type=\"text\" class=\"ace_gallery_image_value '.$element['class'].'\" value=\"'.$element['std'].'\" name=\"'.$element['id'].'\" id=\"'.$element['id'].'\" />';\n\t\t\t\t//end link\n\t\t\t\n\t\t\t$output .= '</div>';\n\t\t\treturn $output;\n\t\t}", "public static function make_gallery_container( $html ) {\n global $post;\n\n if ( isset( $post ) ) {\n $blog_id = (int) get_current_blog_id();\n\n $extra_data = array(\n 'data-carousel-extra' => array(\n 'blog_id' => $blog_id,\n 'permalink' => get_permalink( $post->ID ),\n )\n );\n foreach ( (array) $extra_data as $data_key => $data_values ) {\n $html = str_replace( '<div ', '<div ' . esc_attr( $data_key ) . \"='\" . json_encode( $data_values ) . \"' \", $html );\n }\n }\n\n return $html;\n }", "function pd_img_unautop($imgWrap)\n{\n $imgWrap = preg_replace('/<p>\\\\s*?(<a .*?><img.*?><\\\\/a>|<img.*?>)?\\\\s*<\\\\/p>/s', '<figure>$1</figure>', $imgWrap);\n return $imgWrap;\n}", "function pendrell_image_wrap_attributes( $attributes, $html, $id, $caption, $class, $align, $contents, $context, $width, $height ) {\n if ( ubik_imagery_context( $context, 'related' ) && isset( $attributes['schema'] ) )\n $attributes['schema'] = str_replace( ' itemprop=\"image\"', '', $attributes['schema'] );\n if ( !empty( $width ) )\n $attributes['style'] = 'style=\"width: ' . $width . 'px;\"'; // Setting an explicit width for use with the intrinsic ratio technique\n return $attributes;\n}", "function outputImages($collectionObject) {\r\n\t$results = $collectionObject->getArray();\r\n\r\n\tfor($i=0;$i<$collectionObject->getCount();$i++){\r\n\t\techo '<div class=\"col-md-3\">';\r\n\t\techo '<a href=\"single-image.php?id=' . $results[$i]->getImageID() . '\">';\r\n\t\techo '<img src=\"travel-images/square-medium/'. $results[$i]->getPath() . '\" title=\"\" class=\"thumbnail\" />';\r\n\t\techo '</a>';\r\n\t\techo \"</div>\";\r\n\t}\r\n}", "public function wrap($source)\n\t{\n\t\treturn $this->_wrap_div($this->_wrap_pre($source));\n\t}", "function ppom_generate_html_for_images( $images ) {\n\t\n\t\n\t$ppom_html\t= '<table class=\"table table-bordered\">';\n\tforeach($images as $id => $images_meta) {\n\t\t\n\t\t$images_meta\t= json_decode(stripslashes($images_meta), true);\n\t\t$image_url\t\t= stripslashes($images_meta['link']);\n\t\t$image_label\t= $images_meta['title'];\n\t\t$image_html \t= '<img class=\"img-thumbnail\" style=\"width:'.esc_attr(ppom_get_thumbs_size()).'\" src=\"'.esc_url($image_url).'\" title=\"'.esc_attr($image_label).'\">';\n\t\t\n\t\t$ppom_html\t.= '<tr><td><a href=\"'.esc_url($image_url).'\" class=\"lightbox\" itemprop=\"image\" title=\"'.esc_attr($image_label).'\">' . $image_html . '</a></td>';\n\t\t$ppom_html\t.= '<td>' .esc_attr(ppom_files_trim_name( $image_label )) . '</td>';\n\t\t$ppom_html\t.= '</tr>';\n\t\t\n\t}\n\t\n\t$ppom_html .= '</table>';\n\t\n\treturn apply_filters('ppom_images_html', $ppom_html);\n}", "public static function add_image_placeholders( $content ) {\n\t\tif( is_preview() || is_feed() || is_attachment() || ( function_exists( 'jetpack_is_mobile' ) && ! jetpack_is_mobile() ) )\n\t\t\treturn $content;\n\n\t\t// In case you want to change the placeholder image\n\t\t$placeholder_image = apply_filters( 'responsive_images_placeholder_image', self::get_url( 'images/1x1.trans.gif' ) );\n\n\t\tpreg_match_all( '#<img[^>]+?[\\/]?>#', $content, $images, PREG_SET_ORDER );\n\n\t\tif ( empty( $images ) )\n\t\t\treturn $content;\n\n\t\tforeach ( $images as $image ) {\n\t\t\t$attributes = wp_kses_hair( $image[0], array( 'http', 'https' ) );\n\t\t\t$new_image = '<img';\n\t\t\t$new_image_src = '';\n\n\t\t\tforeach ( $attributes as $attribute ) {\n\t\t\t\t$name = $attribute['name'];\n\t\t\t\t$value = $attribute['value'];\n\n\t\t\t\t// Remove the width and height attributes\n\t\t\t\tif ( in_array( $name, array( 'width', 'height' ) ) )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Move the src to a data attribute and replace with a placeholder\n\t\t\t\tif ( 'src' == $name ) {\n\t\t\t\t\t$new_image_src = html_entity_decode( urldecode( $value ) );\n\n\t\t\t\t\tparse_str( parse_url( $new_image_src, PHP_URL_QUERY ), $image_args );\n\n\t\t\t\t\t$new_image_src = remove_query_arg( 'h', $new_image_src );\n\t\t\t\t\t$new_image_src = remove_query_arg( 'w', $new_image_src );\n\t\t\t\t\t$new_image .= sprintf( ' data-full-src=\"%s\"', esc_url( $new_image_src ) );\n\n\t\t\t\t\tif ( isset( $image_args['w'] ) )\n\t\t\t\t\t\t$new_image .= sprintf( ' data-full-width=\"%s\"', esc_attr( $image_args['w'] ) );\n\t\t\t\t\tif ( isset( $image_args['h'] ) )\n\t\t\t\t\t\t$new_image .= sprintf( ' data-full-height=\"%s\"', esc_attr( $image_args['h'] ) );\n\n\t\t\t\t\t// replace actual src with our placeholder\n\t\t\t\t\t$value = $placeholder_image;\n\t\t\t\t}\n\n\t\t\t\t$new_image .= sprintf( ' %s=\"%s\"', $name, esc_attr( $value ) );\n\t\t\t}\n\t\t\t$new_image .= '/>';\n\t\t\t$new_image .= sprintf( '<noscript><img src=\"%s\" /></noscript>', $new_image_src ); // compat for no-js and better crawling\n\n\t\t\t$content = str_replace( $image[0], $new_image, $content );\n\t\t}\n\n\t\treturn $content;\n\t}", "function lazy_imgs($html, $id, $caption, $title, $align, $url, $size, $alt) {\n\n $imgNew = '<img data-original=\"' . $url . '\" ';\n $html = str_replace('<img ', $imgNew, $html);\n return $html;\n}", "function spiplistes_corrige_img_pack ($img) {\n\tif(preg_match(\",^<img src='dist/images,\", $img)) {\n\t\t$img = preg_replace(\",^<img src='dist/images,\", \"<img src='../dist/images\", $img);\n\t}\n\treturn($img);\n}", "protected function combineImages() {}", "function druplex_field__field_blog_images($variables) {\n\n $output = '<div class=\"flexslider\"><ul class=\"slides\">';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul></div>';\n \n return $output;\n}", "function addImage($path,$title,$description,$thumb,$lightbox,$uniqueID,$limitImages=0) {\n\t // count of images\n\t if ($limitImages > 1 || $limitImages==0) {\n $this->config['count']++;\n\t }\n // just add the wraps if there is a text for it\n $title = (!$title) ? '' : \"<h3>$title</h3>\";\n $description = (!$description) ? '' : \"<p>$description</p>\";\n \n // generate images\n if ($this->config['watermark']) {\n $imgTSConfigBig = $this->conf['big2.'];\n $imgTSConfigBig['file.']['10.']['file'] = $path;\n $imgTSConfigLightbox = $this->conf['lightbox2.'];\n $imgTSConfigLightbox['file.']['10.']['file'] = $path; \n } else {\n $imgTSConfigBig = $this->conf['big.'];\n $imgTSConfigBig['file'] = $path;\n $imgTSConfigLightbox = $this->conf['lightbox.'];\n $imgTSConfigLightbox['file'] = $path; \n } \n $bigImage = $this->cObj->IMG_RESOURCE($imgTSConfigBig);\n\n $lightbox = ($lightbox=='#' || $lightbox=='' || $this->config['showLightbox']!=1) ? 'javascript:void(0)' : $this->cObj->IMG_RESOURCE($imgTSConfigLightbox);\n \t$lightBoxImage='<a href=\"'.$lightbox.'\" title=\"'.$this->pi_getLL('textOpenImage').'\" class=\"open\"></a>';\n\n if ($thumb) {\n $imgTSConfigThumb = $this->conf['thumb.'];\n $imgTSConfigThumb['file'] = $path; \n $thumbImage = '<img src=\"'.$this->cObj->IMG_RESOURCE($imgTSConfigThumb).'\" class=\"thumbnail\" />';\n }\n\n\t // if just 1 image should be returned\n if ($limitImages==1) {\n \treturn '<img src=\"'.$bigImage.'\" class=\"full\" />';\n }\n\n // build the image element \n $singleImage .= '\n <div class=\"imageElement\">'.$title.$description.\n $lightBoxImage.'\n <img src=\"'.$bigImage.'\" class=\"full\" />\n '.$thumbImage.'\n </div>';\n\n\t\t// Adds hook for processing the image\n\t\t$config['path'] = $path;\n $config['title'] = $title;\n\t\t$config['description'] = $description;\n\t\t$config['uniqueID'] = $uniqueID;\n\t\t$config['thumb'] = $thumb;\n\t\t$config['large'] = $large;\n\t\t$config['lightbox'] = $lightbox;\n\t\t$config['limitImages'] = $limitImages;\n\t\t$config['lightBoxCode'] = $lightBoxImage;\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraImageHook'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraImageHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$singleImage = $_procObj->extraImageProcessor($singleImage,$config, $this);\n\t\t\t}\n\t\t} \n \n return $singleImage;\n }", "public static function buildContent($attachments) {\r\n $args = foogallery_gallery_template_arguments();\r\n\r\n echo '<div class=\"gallery\">';\r\n\r\n $ind = 1;\r\n\r\n foreach ($attachments as $attachment) {\r\n $url = static::getURL($attachment, $args);\r\n\r\n if ($url !== '') {\r\n echo '<a';\r\n echo ' href=\"', esc_url($url), '\" ';\r\n echo ' data-pswp-width=\"', esc_attr($attachment->width), '\"';\r\n echo ' data-pswp-height=\"', esc_attr($attachment->height), '\"';\r\n echo ' data-cropped=\"true\"';\r\n echo '>';\r\n }\r\n \r\n $alt = $attachment->alt;\r\n\r\n if ($alt === '')\r\n $alt = \"Bild $ind\";\r\n\r\n $title = $attachment->caption;\r\n\r\n echo '<img src=\"', foogallery_attachment_html_image_src($attachment, $args), '\"';\r\n echo ' alt=\"', esc_attr($alt), '\"';\r\n\r\n if ($title !== '' && $title !== $alt)\r\n echo ' title=\"', esc_attr($title), '\"';\r\n\r\n if (!empty($args['width']) && !empty($args['height']))\r\n echo \" style=\\\"width: {$args['width']}px; height: {$args['height']}px\\\"\";\r\n\r\n echo '>';\r\n\r\n if ($url !== '')\r\n echo '</a>';\r\n\r\n ++$ind;\r\n }\r\n\r\n echo '</div>';\r\n }", "function getImageDifferentPlaces($limitImages=0) {\n \tif ($this->config['mode']=='DIRECTORY') {\n \t\t$content.=$this->getImagesDirectory($limitImages);\n \t} elseif ($this->config['mode']=='RECORDS') {\n \t\t$content.=$this->getImagesRecords($limitImages);\n } elseif ($this->config['mode']=='DAM') {\n \t\t$content.=$this->getImagesDam($limitImages);\n } elseif ($this->config['mode']=='DAMCAT') {\n \t\t$content.=$this->getImagesDamCat($limitImages);\n } \n \n // hook\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraDifferentPlaces'])) {\n foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraDifferentPlaces'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$content = $_procObj->extraBeginGalleryProcessor($content, $limitImages,$this);\n }\n } \n \treturn $content;\n }", "function new_img_shortcode_filter($val, $attr, $content = null) {\n\n\textract(shortcode_atts(array(\n\t\t'id'\t=> '',\n\t\t'align'\t=> '',\n\t\t'width'\t=> '',\n\t\t'caption' => '',\n\t\t'src' => ''\n\t), $attr));\n\n $find = 'attachment_';\n $cust_id = str_replace($find, '', $id);\n $post_custom = get_post_custom($cust_id);\n // print_r($content);\n // $isrc = $src;\n\n\n\tif ( 1 > (int) $width || empty($caption) )\n\t\treturn $val;\n\n\t$capid = '';\n\tif ( $id ) {\n\t\t$id = esc_attr($id);\n\t\t$capid = 'id=\"figcaption_'. $id . '\" ';\n\t\t$id = 'id=\"' . $id . '\"';\n\t}\n\n\n\n\tif ($width == 60 || $width == 140 || $width == 300 ){ // if image is circle\n\t return '<div class=\"circle photo w'.(0 + (int) $width).'\">' . do_shortcode( $content ) . '<p class=\"caption\">' . $caption . '</p></div>';\n } else if ($width == 30) { // if image doesn't need a caption\n return '<div class=\"photo w'.(0 + (int) $width).'\">' . do_shortcode( $content ) . '</div>';\n } else { // all other images\n return '<div class=\"photo w'.(0 + (int) $width).'\">' . do_shortcode( $content ) . '<p class=\"caption\">' . $caption . '</p></div>';\n }\n}", "public static function filter_the_content( $content ) {\n\t\t$images = static::parse_images_from_html( $content );\n\n\t\tif ( ! empty( $images ) ) {\n\t\t\t$content_width = isset( $GLOBALS['content_width'] ) ? $GLOBALS['content_width'] : false;\n\n\t\t\t$image_sizes = self::image_sizes();\n\t\t\t$upload_dir = wp_upload_dir();\n\t\t\t$attachment_ids = [];\n\n\t\t\tforeach ( $images[0] as $tag ) {\n\t\t\t\tif ( preg_match( '/wp-image-([0-9]+)/i', $tag, $class_id ) && absint( $class_id[1] ) ) {\n\t\t\t\t\t// Overwrite the ID when the same image is included more than once.\n\t\t\t\t\t$attachment_ids[ $class_id[1] ] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( count( $attachment_ids ) > 1 ) {\n\t\t\t\t/*\n\t\t\t\t * Warm the object cache with post and meta information for all found\n\t\t\t\t * images to avoid making individual database calls.\n\t\t\t\t */\n\t\t\t\t_prime_post_caches( array_keys( $attachment_ids ), false, true );\n\t\t\t}\n\n\t\t\tforeach ( $images[0] as $index => $tag ) {\n\t\t\t\t// Default to resize, though fit may be used in certain cases where a dimension cannot be ascertained.\n\t\t\t\t$transform = 'resize';\n\n\t\t\t\t// Start with a clean size and attachment ID each time.\n\t\t\t\t$attachment_id = false;\n\t\t\t\tunset( $size );\n\n\t\t\t\t// Flag if we need to munge a fullsize URL.\n\t\t\t\t$fullsize_url = false;\n\n\t\t\t\t// Identify image source.\n\t\t\t\t$src = $src_orig = $images['img_url'][ $index ];\n\n\t\t\t\t/**\n\t\t\t\t * Allow specific images to be skipped by Tachyon.\n\t\t\t\t *\n\t\t\t\t * @since 2.0.3\n\t\t\t\t *\n\t\t\t\t * @param bool false Should Tachyon ignore this image. Default to false.\n\t\t\t\t * @param string $src Image URL.\n\t\t\t\t * @param string $tag Image Tag (Image HTML output).\n\t\t\t\t */\n\t\t\t\tif ( apply_filters( 'tachyon_skip_image', false, $src, $tag ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Support Automattic's Lazy Load plugin.\n\t\t\t\t// Can't modify $tag yet as we need unadulterated version later.\n\t\t\t\tif ( preg_match( '#data-lazy-src=[\"|\\'](.+?)[\"|\\']#i', $images['img_tag'][ $index ], $lazy_load_src ) ) {\n\t\t\t\t\t$placeholder_src = $placeholder_src_orig = $src;\n\t\t\t\t\t$src = $src_orig = $lazy_load_src[1];\n\t\t\t\t} elseif ( preg_match( '#data-lazy-original=[\"|\\'](.+?)[\"|\\']#i', $images['img_tag'][ $index ], $lazy_load_src ) ) {\n\t\t\t\t\t$placeholder_src = $placeholder_src_orig = $src;\n\t\t\t\t\t$src = $src_orig = $lazy_load_src[1];\n\t\t\t\t}\n\n\t\t\t\t// Check if image URL should be used with Tachyon.\n\t\t\t\tif ( self::validate_image_url( $src ) ) {\n\t\t\t\t\t// Find the width and height attributes.\n\t\t\t\t\t$width = $height = false;\n\n\t\t\t\t\t// First, check the image tag.\n\t\t\t\t\tif ( preg_match( '#width=[\"|\\']?([\\d%]+)[\"|\\']?#i', $images['img_tag'][ $index ], $width_string ) ) {\n\t\t\t\t\t\t$width = $width_string[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( preg_match( '#height=[\"|\\']?([\\d%]+)[\"|\\']?#i', $images['img_tag'][ $index ], $height_string ) ) {\n\t\t\t\t\t\t$height = $height_string[1];\n\t\t\t\t\t}\n\n\t\t\t\t\t// If image tag lacks width or height arguments, try to determine from strings WP appends to resized image filenames.\n\t\t\t\t\tif ( ! $width || ! $height ) {\n\t\t\t\t\t\t$size_from_file = static::parse_dimensions_from_filename( $src );\n\t\t\t\t\t\t$width = $width ?: $size_from_file[0];\n\t\t\t\t\t\t$height = $height ?: $size_from_file[1];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Can't pass both a relative width and height, so unset the height in favor of not breaking the horizontal layout.\n\t\t\t\t\tif ( false !== strpos( $width, '%' ) && false !== strpos( $height, '%' ) ) {\n\t\t\t\t\t\t$width = $height = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Detect WP registered image size from HTML class.\n\t\t\t\t\tif ( preg_match( '#class=[\"|\\']?[^\"\\']*size-([^\"\\'\\s]+)[^\"\\']*[\"|\\']?#i', $images['img_tag'][ $index ], $matches ) ) {\n\t\t\t\t\t\t$size = array_pop( $matches );\n\n\t\t\t\t\t\tif ( false === $width && false === $height && isset( $size ) && array_key_exists( $size, $image_sizes ) ) {\n\t\t\t\t\t\t\t$size_from_wp = wp_get_attachment_image_src( $attachment_id, $size );\n\t\t\t\t\t\t\t$width = $size_from_wp[1];\n\t\t\t\t\t\t\t$height = $size_from_wp[2];\n\t\t\t\t\t\t\t$transform = $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// WP Attachment ID, if uploaded to this site.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreg_match( '#class=[\"|\\']?[^\"\\']*wp-image-([\\d]+)[^\"\\']*[\"|\\']?#i', $images['img_tag'][ $index ], $class_attachment_id ) &&\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t0 === strpos( $src, $upload_dir['baseurl'] ) ||\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Filter whether an image using an attachment ID in its class has to be uploaded to the local site to go through Tachyon.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @since 2.0.3\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @param bool false Was the image uploaded to the local site. Default to false.\n\t\t\t\t\t\t\t * @param array $args {\n\t\t\t\t\t\t\t * Array of image details.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @type $src Image URL.\n\t\t\t\t\t\t\t * @type tag Image tag (Image HTML output).\n\t\t\t\t\t\t\t * @type $images Array of information about the image.\n\t\t\t\t\t\t\t * @type $index Image index.\n\t\t\t\t\t\t\t * }\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tapply_filters( 'tachyon_image_is_local', false, compact( 'src', 'tag', 'images', 'index' ) )\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t$class_attachment_id = intval( array_pop( $class_attachment_id ) );\n\n\t\t\t\t\t\tif ( $class_attachment_id ) {\n\t\t\t\t\t\t\t$attachment = get_post( $class_attachment_id );\n\t\t\t\t\t\t\t// Basic check on returned post object.\n\t\t\t\t\t\t\tif ( is_object( $attachment ) && ! is_wp_error( $attachment ) && 'attachment' === $attachment->post_type ) {\n\t\t\t\t\t\t\t\t$attachment_id = $attachment->ID;\n\n\t\t\t\t\t\t\t\t// If we still don't have a size for the image, use the attachment_id\n\t\t\t\t\t\t\t\t// to lookup the size for the image in the URL.\n\t\t\t\t\t\t\t\tif ( ! isset( $size ) ) {\n\t\t\t\t\t\t\t\t\t$meta = wp_get_attachment_metadata( $attachment_id );\n\t\t\t\t\t\t\t\t\tif ( $meta['sizes'] ) {\n\t\t\t\t\t\t\t\t\t\t$sizes = wp_list_filter( $meta['sizes'], [ 'file' => basename( $src ) ] );\n\t\t\t\t\t\t\t\t\t\tif ( $sizes ) {\n\t\t\t\t\t\t\t\t\t\t\t$size_names = array_keys( $sizes );\n\t\t\t\t\t\t\t\t\t\t\t$size = array_pop( $size_names );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// If we still don't have a size for the image but know the dimensions,\n\t\t\t\t\t\t\t\t// use the attachment sources to determine the size. Tachyon modifies\n\t\t\t\t\t\t\t\t// wp_get_attachment_image_src() to account for sizes created after upload.\n\t\t\t\t\t\t\t\tif ( ! isset( $size ) && $width && $height ) {\n\t\t\t\t\t\t\t\t\t$sizes = array_keys( $image_sizes );\n\t\t\t\t\t\t\t\t\tforeach ( $sizes as $size ) {\n\t\t\t\t\t\t\t\t\t\t$size_per_wp = wp_get_attachment_image_src( $attachment_id, $size );\n\t\t\t\t\t\t\t\t\t\tif ( $width === $size_per_wp[1] && $height === $size_per_wp[2] ) {\n\t\t\t\t\t\t\t\t\t\t\t$transform = $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tunset( $size ); // Prevent loop from polluting $size if it's incorrect.\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( isset( $size ) && false === $width && false === $height && array_key_exists( $size, $image_sizes ) ) {\n\t\t\t\t\t\t\t\t\t$width = (int) $image_sizes[ $size ]['width'];\n\t\t\t\t\t\t\t\t\t$height = (int) $image_sizes[ $size ]['height'];\n\t\t\t\t\t\t\t\t\t$transform = $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t * If size is still not set the dimensions were not provided by either\n\t\t\t\t\t\t\t\t * a class or by parsing the URL. Only the full sized image should return\n\t\t\t\t\t\t\t\t * no dimensions when returning the URL so it's safe to assume the $size is full.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t$size = isset( $size ) ? $size : 'full';\n\n\t\t\t\t\t\t\t\t$src_per_wp = wp_get_attachment_image_src( $attachment_id, $size );\n\n\t\t\t\t\t\t\t\tif ( self::validate_image_url( $src_per_wp[0] ) ) {\n\t\t\t\t\t\t\t\t\t$src = $src_per_wp[0];\n\t\t\t\t\t\t\t\t\t$fullsize_url = true;\n\n\t\t\t\t\t\t\t\t\t// Prevent image distortion if a detected dimension exceeds the image's natural dimensions.\n\t\t\t\t\t\t\t\t\tif ( ( false !== $width && $width > $src_per_wp[1] ) || ( false !== $height && $height > $src_per_wp[2] ) ) {\n\t\t\t\t\t\t\t\t\t\t$width = false === $width ? false : min( $width, $src_per_wp[1] );\n\t\t\t\t\t\t\t\t\t\t$height = false === $height ? false : min( $height, $src_per_wp[2] );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// If no width and height are found, max out at source image's natural dimensions.\n\t\t\t\t\t\t\t\t\t// Otherwise, respect registered image sizes' cropping setting.\n\t\t\t\t\t\t\t\t\tif ( false === $width && false === $height ) {\n\t\t\t\t\t\t\t\t\t\t$width = $src_per_wp[1];\n\t\t\t\t\t\t\t\t\t\t$height = $src_per_wp[2];\n\t\t\t\t\t\t\t\t\t\t$transform = 'fit';\n\t\t\t\t\t\t\t\t\t} elseif ( isset( $size ) && array_key_exists( $size, $image_sizes ) && isset( $image_sizes[ $size ]['crop'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$transform = (bool) $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tunset( $attachment );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// If width is available, constrain to $content_width.\n\t\t\t\t\tif ( false !== $width && false === strpos( $width, '%' ) && is_numeric( $content_width ) ) {\n\t\t\t\t\t\tif ( $width > $content_width && false !== $height && false === strpos( $height, '%' ) ) {\n\t\t\t\t\t\t\t$height = round( ( $content_width * $height ) / $width );\n\t\t\t\t\t\t\t$width = $content_width;\n\t\t\t\t\t\t} elseif ( $width > $content_width ) {\n\t\t\t\t\t\t\t$width = $content_width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set a width if none is found and $content_width is available.\n\t\t\t\t\t// If width is set in this manner and height is available, use `fit` instead of `resize` to prevent skewing.\n\t\t\t\t\tif ( false === $width && is_numeric( $content_width ) ) {\n\t\t\t\t\t\t$width = (int) $content_width;\n\n\t\t\t\t\t\tif ( false !== $height ) {\n\t\t\t\t\t\t\t$transform = 'fit';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Detect if image source is for a custom-cropped thumbnail and prevent further URL manipulation.\n\t\t\t\t\tif ( ! $fullsize_url && preg_match_all( '#-e[a-z0-9]+(-\\d+x\\d+)?\\.(' . implode( '|', self::$extensions ) . '){1}$#i', basename( $src ), $filename ) ) {\n\t\t\t\t\t\t$fullsize_url = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Build URL, first maybe removing WP's resized string so we pass the original image to Tachyon.\n\t\t\t\t\tif ( ! $fullsize_url ) {\n\t\t\t\t\t\t$src = self::strip_image_dimensions_maybe( $src );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Build array of Tachyon args and expose to filter before passing to Tachyon URL function.\n\t\t\t\t\t$args = [];\n\n\t\t\t\t\tif ( false !== $width && false !== $height && false === strpos( $width, '%' ) && false === strpos( $height, '%' ) ) {\n\t\t\t\t\t\tif ( ! isset( $size ) || $size !== 'full' ) {\n\t\t\t\t\t\t\t$args[ $transform ] = $width . ',' . $height;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set the gravity from the registered image size.\n\t\t\t\t\t\t// Crop weight array values are in x, y order but the value `westsouth` will\n\t\t\t\t\t\t// cause Sharp to error and Tachyon to return a 404, it needs to be `southwest`\n\t\t\t\t\t\t// so we reverse the crop array to y, x order.\n\t\t\t\t\t\tif ( 'resize' === $transform && isset( $size ) && $size !== 'full' && array_key_exists( $size, $image_sizes ) && is_array( $image_sizes[ $size ]['crop'] ) ) {\n\t\t\t\t\t\t\t$args['gravity'] = implode( '', array_map( function ( $v ) {\n\t\t\t\t\t\t\t\t$map = [\n\t\t\t\t\t\t\t\t\t'top' => 'north',\n\t\t\t\t\t\t\t\t\t'center' => '',\n\t\t\t\t\t\t\t\t\t'bottom' => 'south',\n\t\t\t\t\t\t\t\t\t'left' => 'west',\n\t\t\t\t\t\t\t\t\t'right' => 'east',\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\treturn $map[ $v ];\n\t\t\t\t\t\t\t}, array_reverse( $image_sizes[ $size ]['crop'] ) ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( false !== $width ) {\n\t\t\t\t\t\t$args['w'] = $width;\n\t\t\t\t\t} elseif ( false !== $height ) {\n\t\t\t\t\t\t$args['h'] = $height;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Final logic check to determine the size for an unknown attachment ID.\n\t\t\t\t\tif ( ! isset( $size ) ) {\n\t\t\t\t\t\tif ( $width ) {\n\t\t\t\t\t\t\t$filter['width'] = $width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $height ) {\n\t\t\t\t\t\t\t$filter['height'] = $height;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! empty( $filter ) ) {\n\t\t\t\t\t\t\t$sizes = wp_list_filter( $image_sizes, $filter );\n\t\t\t\t\t\t\tif ( empty( $sizes ) ) {\n\t\t\t\t\t\t\t\t$sizes = wp_list_filter( $image_sizes, $filter, 'OR' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( ! empty( $sizes ) ) {\n\t\t\t\t\t\t\t\t$size = reset( $sizes );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! isset( $size ) ) {\n\t\t\t\t\t\t// Custom size, send an array.\n\t\t\t\t\t\t$size = [ $width, $height ];\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Filter the array of Tachyon arguments added to an image when it goes through Tachyon.\n\t\t\t\t\t * By default, only includes width and height values.\n\t\t\t\t\t *\n\t\t\t\t\t * @see https://developer.wordpress.com/docs/photon/api/\n\t\t\t\t\t *\n\t\t\t\t\t * @param array $args Array of Tachyon Arguments.\n\t\t\t\t\t * @param array $args {\n\t\t\t\t\t * Array of image details.\n\t\t\t\t\t *\n\t\t\t\t\t * @type $tag Image tag (Image HTML output).\n\t\t\t\t\t * @type $src Image URL.\n\t\t\t\t\t * @type $src_orig Original Image URL.\n\t\t\t\t\t * @type $width Image width.\n\t\t\t\t\t * @type $height Image height.\n\t\t\t\t\t * @type $attachment_id Attachment ID.\n\t\t\t\t\t * }\n\t\t\t\t\t */\n\t\t\t\t\t$args = apply_filters( 'tachyon_post_image_args', $args, compact( 'tag', 'src', 'src_orig', 'width', 'height', 'attachment_id', 'size' ) );\n\n\t\t\t\t\t$tachyon_url = tachyon_url( $src, $args );\n\n\t\t\t\t\t// Modify image tag if Tachyon function provides a URL\n\t\t\t\t\t// Ensure changes are only applied to the current image by copying and modifying the matched tag, then replacing the entire tag with our modified version.\n\t\t\t\t\tif ( $src !== $tachyon_url ) {\n\t\t\t\t\t\t$new_tag = $tag;\n\n\t\t\t\t\t\t// If present, replace the link href with a Tachyoned URL for the full-size image.\n\t\t\t\t\t\tif ( ! empty( $images['link_url'][ $index ] ) && self::validate_image_url( $images['link_url'][ $index ] ) ) {\n\t\t\t\t\t\t\t$new_tag = preg_replace( '#(href=[\"|\\'])' . $images['link_url'][ $index ] . '([\"|\\'])#i', '\\1' . tachyon_url( $images['link_url'][ $index ] ) . '\\2', $new_tag, 1 );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Supplant the original source value with our Tachyon URL.\n\t\t\t\t\t\t$tachyon_url = esc_url( $tachyon_url );\n\t\t\t\t\t\t$new_tag = str_replace( $src_orig, $tachyon_url, $new_tag );\n\n\t\t\t\t\t\t// If Lazy Load is in use, pass placeholder image through Tachyon.\n\t\t\t\t\t\tif ( isset( $placeholder_src ) && self::validate_image_url( $placeholder_src ) ) {\n\t\t\t\t\t\t\t$placeholder_src = tachyon_url( $placeholder_src );\n\n\t\t\t\t\t\t\tif ( $placeholder_src !== $placeholder_src_orig ) {\n\t\t\t\t\t\t\t\t$new_tag = str_replace( $placeholder_src_orig, esc_url( $placeholder_src ), $new_tag );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tunset( $placeholder_src );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Remove the width and height arguments from the tag to prevent distortion.\n\t\t\t\t\t\tif ( apply_filters( 'tachyon_remove_size_attributes', true ) ) {\n\t\t\t\t\t\t\t$new_tag = preg_replace( '#(?<=\\s)(width|height)=[\"|\\']?[\\d%]+[\"|\\']?\\s?#i', '', $new_tag );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Tag an image for dimension checking.\n\t\t\t\t\t\t$new_tag = preg_replace( '#(\\s?/)?>(\\s*</a>)?$#i', ' data-recalc-dims=\"1\"\\1>\\2', $new_tag );\n\n\t\t\t\t\t\t// Replace original tag with modified version.\n\t\t\t\t\t\t$content = str_replace( $tag, $new_tag, $content );\n\t\t\t\t\t}\n\t\t\t\t} elseif ( preg_match( '#^http(s)?://i[\\d]{1}.wp.com#', $src ) && ! empty( $images['link_url'][ $index ] ) && self::validate_image_url( $images['link_url'][ $index ] ) ) {\n\t\t\t\t\t$new_tag = preg_replace( '#(href=[\"|\\'])' . $images['link_url'][ $index ] . '([\"|\\'])#i', '\\1' . tachyon_url( $images['link_url'][ $index ] ) . '\\2', $tag, 1 );\n\n\t\t\t\t\t$content = str_replace( $tag, $new_tag, $content );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "function embed_wrap( $cache ) {\n\treturn '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function editor_insert_image($html, $id, $caption, $title, $align, $url, $size) {\r\n\tlist($imgsrc) = image_downsize($id, 'hero-review');\r\n//\tlist($imgsrc) = image_downsize($id, $size);\r\n\r\n\t$html = \"<div class=\\\"photo-gallery\\\">\";\r\n\t$html .= \"<img src=\\\"$imgsrc\\\" alt=\\\"$caption\\\">\";\r\n\tif ($caption) {\r\n\t\t$html .= \"<div class=\\\"caption\\\">$caption</div>\";\r\n\t}\r\n\t$html .= \"</div><!-- photo-gallery -->\";\r\n\treturn $html;\r\n}", "public function addContentGallery($image_folders, $image_base_dir = '', $image_base_url = '', $gallery_class = ''){\n\n // Include the gallery markup generator and collect output\n ob_start();\n include(LEGACY_MMRPG_ROOT_DIR.'markup/image-gallery.php');\n $html_markup = ob_get_clean();\n\n // Add generated gallery markup to the page\n $this->addContentMarkup($html_markup);\n\n }", "function adapt_image( $id=0, $width=0, $height=0, $link=false, $attr=null, $circle=false, $blank=false ) {\n\n $html = '';\n\n if ( $circle !== false ) :\n if ( $width > $height ) : \n $width = $height;\n elseif ( $width <= $height ) : \n $height = $width;\n endif;\n\n $html .= '<div class=\"is-circle\">';\n endif;\n\n $link_attrs = $link ? \"href='{$link}'\" : \"href='#.'\";\n $link_attrs .= $blank ? \" target='_blank'\" : '';\n\n $html .= $link ? \"<a {$link_attrs}>\" : '';\n $html .= wp_get_attachment_image( $id, array( $width, $height ), true, $attr );\n $html .= $link ? '</a>' : '';\n\n if ( $circle !== false )\n $html .= '</div>'; \n\n}", "function filter_ptags_on_images($content) {\n return preg_replace('/<p[^>]*>\\\\s*?(<a .*?><img.*?><\\\\/a>|<img.*?>)?\\\\s*<\\/p>/', '<div class=\"post-image\">$1</div>', $content);\n}", "function beginGallery($uniqueId,$limitImages=0) {\n\t\tif ($limitImages==1) {\n\t\t\t$content = '<div class=\"content\"><div class=\"myGallery-NoScript\" id=\"myGallery-NoScript'.$uniqueId.'\">';\n\t\t}\n\t\telse {\n\t\t\t$content = '<div class=\"content\"><div class=\"myGallery\" id=\"myGallery'.$uniqueId.'\">';\n\t\t}\n\t\t\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraBeginGalleryHook'])) {\n foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraBeginGalleryHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$content = $_procObj->extraBeginGalleryProcessor($content, $limitImages,$this);\n }\n } \n return $content; \n }", "function ucf_post_list_display_gallery_before($content, $posts, $atts)\n{\n ob_start();\n ?>\n <div class=\"ucf-post-list card-layout\" id=\"post-list-<?php echo $atts['list_id']; ?>\">\n <?php\n return ob_get_clean();\n}", "function ciniki_web_processGalleryImage(&$ciniki, $settings, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'processURL');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'processContent');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'getScaledImageURL');\n\n $content = '';\n $quality = 60;\n if( isset($block['quality']) && $block['quality'] == 'high' ) {\n $quality = 90;\n }\n $height = 600;\n if( isset($block['size']) && $block['size'] == 'large' ) {\n $height = 1200;\n }\n if( isset($settings['default-image-height']) && $settings['default-image-height'] > $height ) {\n $height = $settings['default-image-height'];\n }\n\n if( !isset($args['item']['images']) || count($args['item']['images']) < 1 ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.web.121', 'msg'=>\"I'm sorry, but we don't seem to have the image your requested.\"));\n }\n\n $first = NULL;\n $last = NULL;\n $img = NULL;\n $next = NULL;\n $prev = NULL;\n foreach($args['item']['images'] as $iid => $image) {\n if( $first == NULL ) {\n $first = $image;\n }\n if( $image['permalink'] == $args['image_permalink'] ) {\n $img = $image;\n } elseif( $next == NULL && $img != NULL ) {\n $next = $image;\n } elseif( $img == NULL ) {\n $prev = $image;\n }\n $last = $image;\n }\n\n if( count($args['item']['images']) == 1 ) {\n $prev = NULL;\n $next = NULL;\n } elseif( $prev == NULL ) {\n // The requested image was the first in the list, set previous to last\n $prev = $last;\n } elseif( $next == NULL ) {\n // The requested image was the last in the list, set previous to last\n $next = $first;\n }\n\n if( $img == NULL ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.web.122', 'msg'=>\"I'm sorry, but we don't seem to have the image your requested.\"));\n }\n\n if( $img['title'] != '' ) {\n $args['article_title'] .= ' - ' . $img['title'];\n }\n\n //\n // Load the image\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'getScaledImageURL');\n $rc = ciniki_web_getScaledImageURL($ciniki, $img['image_id'], 'original', 0, $height, $quality);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $img_url = $rc['url'];\n\n // Setup the og image\n $ciniki['response']['head']['og']['image'] = $rc['domain_url'];\n\n //\n // Set the page to wide if possible\n //\n $ciniki['request']['page-container-class'] = 'page-container-wide';\n\n $svg_prev = '';\n $svg_next = '';\n if( isset($settings['site-layout']) && $settings['site-layout'] == 'twentyone' ) {\n $ciniki['request']['inline_javascript'] = '';\n $ciniki['request']['onresize'] = \"\";\n $ciniki['request']['onload'] = \"\";\n $svg_prev = '<svg viewbox=\"0 0 80 80\" stroke=\"#fff\" fill=\"none\"><polyline stroke-width=\"5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" points=\"50,70 20,40 50,10\"></polyline></svg>';\n $svg_next = '<svg viewbox=\"0 0 80 80\" stroke=\"#fff\" fill=\"none\"><polyline stroke-width=\"5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" points=\"30,70 60,40 30,10\"></polyline></svg>';\n } else {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'generateGalleryJavascript');\n $rc = ciniki_web_generateGalleryJavascript($ciniki, isset($block['next'])?$block['next']:NULL, isset($block['prev'])?$block['prev']:NULL);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $ciniki['request']['inline_javascript'] = $rc['javascript'];\n $ciniki['request']['onresize'] = \"gallery_resize_arrows();\";\n $ciniki['request']['onload'] = \"scrollto_header();\";\n }\n\n $content .= \"<article class='page'>\\n\"\n . \"<header class='entry-title'><h1 id='entry-title' class='entry-title'>\" \n . $args['article_title'] . \"</h1></header>\\n\"\n . \"<div class='entry-content'>\\n\"\n . \"\";\n $content .= \"<div id='gallery-image' class='gallery-image'>\";\n $content .= \"<div id='gallery-image-wrap' class='gallery-image-wrap'>\";\n if( $prev != null ) {\n $content .= \"<a id='gallery-image-prev' class='gallery-image-prev' href='\" . (isset($args['gallery_url'])?$args['gallery_url'].'/':'') . $prev['permalink'] . \"'><div id='gallery-image-prev-img'>{$svg_prev}</div></a>\";\n }\n if( $next != null ) {\n $content .= \"<a id='gallery-image-next' class='gallery-image-next' href='\" . (isset($args['gallery_url'])?$args['gallery_url'].'/':'') . $next['permalink'] . \"'><div id='gallery-image-next-img'>{$svg_next}</div></a>\";\n }\n $content .= \"<img id='gallery-image-img' title='\" . $img['title'] . \"' alt='\" . $img['title'] . \"' src='\" . $img_url . \"' onload='javascript: gallery_resize_arrows();' />\";\n $content .= \"</div><br/>\"\n . \"<div id='gallery-image-details' class='gallery-image-details'>\"\n . \"<span class='image-title'>\" . $img['title'] . '</span>'\n . \"<span class='image-details'></span>\";\n if( $img['description'] != '' ) {\n $content .= \"<span class='image-description'>\" . preg_replace('/\\n/', '<br/>', $img['description']) . \"</span>\";\n }\n $content .= \"</div></div>\";\n $content .= \"</div></article>\";\n\n return array('stat'=>'ok', 'content'=>$content);\n}", "function replace_images_with_placeholders( string $content ) : string {\n\tif ( filter_input( INPUT_GET, 'noscript-load-images', FILTER_VALIDATE_BOOLEAN ) ) {\n\t\treturn $content;\n\t}\n\tif ( ! preg_match_all( '/<img [^>]+>/', $content, $images ) ) {\n\t\treturn $content;\n\t}\n\tforeach ( $images[0] as $image ) {\n\t\t$attachment_id = null;\n\t\t$image_attr = preg_match_all( '/\\s([\\w-]+)([=\\s]([\\'\\\"])((?!\\3).+?[^\\\\\\])\\3)?/', $image, $match_attr ) ? array_combine( array_map( 'esc_attr', $match_attr[1] ), array_map( 'esc_attr', $match_attr[4] ) ) : [];\n\t\tif ( ! empty( $image_attr['class'] ) && preg_match( '/wp-image-([0-9]+)/i', $image_attr['class'], $class_id ) ) {\n\t\t\t$attachment_id = absint( $class_id[1] );\n\t\t}\n\t\tif ( ! $attachment_id ) {\n\t\t\t$attachment_id = url_to_attachment_id( $image_attr['src'] );\n\t\t}\n\t\tif ( ! $attachment_id ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$svg_string = get_placeholder_svg( $attachment_id, $image_attr, apply_filters( 'lazy_load_images_svg_placeholder_style', 'color-block-grid', $image, $image_attr, $attachment_id ) );\n\t\tif ( ! $svg_string ) {\n\t\t\tcontinue;\n\t\t}\n\t\twp_enqueue_script( 'lazy-load-images' );\n\t\tif ( isset( $image_attr['src'] ) ) {\n\t\t\t$image_attr['data-src'] = $image_attr['src'];\n\t\t\t$image_attr['src'] = 'data:image/svg+xml;charset=UTF-8,' . rawurlencode( $svg_string );\n\t\t}\n\t\tif ( isset( $image_attr['srcset'] ) ) {\n\t\t\t$image_attr['data-srcset'] = $image_attr['srcset'];\n\t\t\tunset( $image_attr['srcset'] );\n\t\t}\n\t\tif ( isset( $image_attr['sizes'] ) ) {\n\t\t\t$image_attr['data-sizes'] = $image_attr['sizes'];\n\t\t\tunset( $image_attr['sizes'] );\n\t\t}\n\t\t$content = str_replace(\n\t\t\t$image, apply_filters(\n\t\t\t\t'lazy_load_images_placeholder_image', '<img ' . implode(\n\t\t\t\t\t' ', array_map(\n\t\t\t\t\t\tfunction( string $key, string $value ) : string {\n\t\t\t\t\t\t\t\treturn esc_attr( $key ) . '=\"' . esc_attr( $value ) . '\"';\n\t\t\t\t\t\t}, array_keys( $image_attr ), $image_attr\n\t\t\t\t\t)\n\t\t\t\t) . ' /><noscript><form><button name=\"noscript-load-images\" value=\"true\">Load Images</button></form></noscript>', $image, $image_attr, $svg_string\n\t\t\t), $content\n\t\t);\n\t}\n\treturn $content;\n}", "function AsImgBox($strImg,$strClass,$strStyle,$oCaption,$strHref='')\n{\n if ( !is_string($strImg) ) die('AsImgBox: Missing image');\n if ( is_array($oCaption) )\n {\n $strCaption = QTconv($oCaption[0],'5');\n if ( !empty($strHref) ) $strCaption = '<a href=\"'.$strHref.'\">'.$strCaption.'</a>';\n if ( !empty($oCaption[1]) ) $strCaption .= '<br/>('.QTconv($oCaption[1],'5').')';\n if ( !empty($oCaption[2]) ) $strCaption .= '<br/>'.QTconv($oCaption[2],'5');\n }\n else\n {\n $strCaption = QTconv(strval($oCaption),'5');\n if ( !empty($strHref) ) $strCaption = '<a href=\"'.$strHref.'\">'.$strCaption.'</a>';\n }\n return '<div'.(isset($strClass) ? ' class=\"'.$strClass.'\"' : '').(isset($strStyle) ? ' style=\"'.$strStyle.'\"' : '').'>'.$strImg.(isset($strCaption) ? '<span class=\"small\"><br/>'.$strCaption.'</span>' : '').'</div>';\n}", "protected function renderImages($content)\r\n\t{\r\n\t\t$matches = array();\r\n\t\tpreg_match_all($this->_patterns['image'], $content, $matches);\r\n\r\n\t\t$pairs = array();\r\n\t\tforeach ($matches[1] as $index => $id)\r\n\t\t{\r\n\t\t\t/** @var CmsAttachment $attachment */\r\n\t\t\t$attachment = CmsAttachment::model()->findByPk($id);\r\n\t\t\tif ($attachment instanceof CmsAttachment && strpos($attachment->mimeType, 'image') !== false)\r\n\t\t\t{\r\n\t\t\t\t$url = $attachment->getUrl();\r\n\t\t\t\t// TODO: Add a image:id:walloftext pattern so we can manually specify the alt attribute\r\n\t\t\t\t$pairs[$matches[0][$index]] = CHtml::image($url, '');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!empty($pairs) )\r\n\t\t\t$content = strtr($content, $pairs);\r\n\r\n\t\treturn $content;\r\n\t}", "public function getHTMLNode($xml, &$data) {\n\t\t$node = parent::getHTMLNode($xml, $data);\n\t\t$imageDiv = $xml->createElement('div', array('class' => 'image-container'));\n\t\t$imageDiv->appendChild($xml->createImgElement($this->getImageURL('image'), 'image', $this->imageSize));\n\t\t$node->appendChild($imageDiv);\n\t\treturn $node;\n\t}", "function bethel_add_image_to_stories() {\n\tglobal $post;\n\tif ($post && ($post->post_type=='bethel_stories' || $post->page_template == 'stories.php')) {\n\t\techo \"<div class=\\\"bethel-featured-image-wrapper\\\">\";\n\t\tthe_post_thumbnail('bethel_column_width');\n\t\t$caption = apply_filters ('bethel_featured_image_caption', '');\n\t\tif ($caption != '') {\n\t\t\techo \"<div class=\\\"bethel-featured-image-caption\\\">{$caption}</div>\";\n\t\t}\n\t\tdo_action ('bethel_after_featured_image');\n\t\techo \"</div>\";\n\t}\n}", "function GetImage()\n {\n //Obtient les images par défaut de chaque produit de la fiche\n $ficheProduct = new EeCommerceFicheProductProduct($this->Core);\n $ficheProduct->AddArgument(new Argument(\"EeCommerceFicheProductProduct\", \"FicheId\", EQUAL, $this->IdEntite));\n $products = $ficheProduct->GetByArg();\n \n $html = \"<div>\";\n \n foreach($products as $product)\n {\n $img = new Image($product->Product->Value->ImageDefault->Value);\n $img->Alt = $img->Title = $product->Product->Value->NameProduct->Value;\n \n $html .= \"<div class='col-md-4' >\" . $img->Show().\"</div>\"; \n }\n \n $html .= \"</div>\";\n \n return $html;\n \n }", "function htmlImages($src)\n{\n\treturn '<img src=' . $src . '>';\n}", "function imageObj($OA) {\n \n // check isset\n if(!isset($OA['alt'])) $OA['alt'] = '';\n if(!isset($OA['file'])) $OA['file'] = '';\n if(!isset($OA['title'])) $OA['title'] = '';\n \n // wrap before\n if (isset($OA['wrapB'])) echo $OA['wrapB'].\"\\n\";\n \n // link begin\n if (isset($OA['link'])) {\n echo '<a href=\"'. $OA['link'] .'\"';\n if(isset($OA['linkT'])) echo ' target=\"'. $OA['linkT'] .'\"';\n echo '>';\n }\n \n // check for absolute path\n if (substr($OA['file'],0,4) == 'http') $pT = '';\n else $pT = THEMEPATH;\n \n // check width and height and echo tag\n if (isset($OA['width'])) {\n echo '<img src=\"'. $pT . $OA['file'] .'\"';\n if ($OA['width'] != 'auto') echo ' width=\"'. $OA['width'] .'\"';\n if ($OA['height'] != 'auto') echo ' height=\"'. $OA['height'] .'\"';\n echo ' alt=\"'. $OA['alt'] .'\"';\n if ($OA['title']) echo ' title=\"'. $OA['title'] .'\"';\n echo '>';\n } else {\n echo '<img src=\"'. $pT . $OA['file'] .'\" alt=\"'. $OA['alt'] .'\"';\n if ($OA['title']) echo ' title=\"'. $OA['title'] .'\"';\n echo '>';\n }\n \n // if 'link' exists\n if (isset($OA['link'])) echo '</a>';\n \n // 'wrap' after\n if (isset($OA['wrapA'])) echo \"\\n\".$OA['wrapA'];\n echo \"\\n\\n\";\n}", "public function formGalleryHtml($images){\n $html = \"\";\n foreach($images as $photo){\n $name_corto = substr($photo->getName(), 0, 10) . \"...\";\n $imageSize = \"\";\n if (is_file(APPLICATION_PATH . \"/../public\" . $photo->getUrlSmall())) {\n $imageInfo = getimagesize(APPLICATION_PATH . \"/../public\" . $photo->getUrlSmall());\n $imageWidth = 112;\n $imageHeight = ($imageInfo[1] * $imageWidth) / $imageInfo[0];\n $imageSize = sprintf(\"width=\\\"%d\\\" heigth=\\\"%d\\\"\", $imageWidth, $imageHeight);\n }\n\n $html .= \"<li class=\\\"item-gallery\\\" indice=\\\"\".$photo->getId().\"\\\" uploadname=\\\"\".$this->getName().\"\\\">\n <div class=\\\"imgholder\\\">\n <img \".$imageSize.\" id=\\\"img-gallery-\".$photo->getId().\"\\\" src=\\\"\".$photo->getUrlSmall().\"\\\">\n </div>\n <p>\n <span data-placement=\\\"top\\\" data-toggle=\\\"tooltip\\\" data-original-title=\\\"\".$photo->getName().\"\\\">\".$name_corto.\"</span>\n </p>\n </li>\";\n \n \n }\n return $html;\n }", "function wp_make_content_images_responsive($content)\n {\n }", "function ShowGallery($folder, $mask,$thumbWidth,$thumbHeight)\r\n{\r\n\t$images = ListFiles($folder, $mask);\r\n\t?>\r\n\t<div id=\"gallery\" class=\"ad-gallery\" >\r\n\t\t<div class=\"ad-image-wrapper\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-controls\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-nav\">\r\n\t\t\t<div class=\"ad-thumbs\">\r\n\t\t\t\t<ul class=\"ad-thumb-list\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$counter = 0; // for the imageX class (image0,image1,...)\r\n\t\t\t\tforeach ($images as $image)\r\n\t\t\t\t{\r\n\t\t\t\t\t$alt = basename($image,substr($mask,1)); // cut the folder and extension (mask as a \"*\" at begining so without it) \r\n\t\t\t\t\t$alt = str_replace(\"_\", \" \", $alt); // alt is name without underscore\r\n\t\t\t\t\techo\t\"<li>\";\r\n\t\t\t\t\techo \t\t\"<a href='$image'>\";\r\n\t\t\t\t\techo \t\"<img src='$image' alt='$alt' class='image\".$counter.\"' style='width:\".$thumbWidth.\"px; height:\".$thumbHeight.\"px;'/>\";\r\n\t\t\t\t\techo \t\"</a>\";\r\n\t\t\t\t\techo \t\"</li>\";\t\t\t\t\r\n\t\t\t\t}\t// foreach close\r\n\t\t\t\t?>\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<?php \r\n}", "function the_content_without_images() {\n\n $innerHTML = \"XX\";\n $html = \"\";\n\n // Buffer the HTML\n ob_start();\n the_content();\n $html = ob_get_contents();\n ob_end_clean();\n\n // Manipulate DOM\n $doc = new DOMDocument();\n $doc->loadHTML($html);\n $doc->encoding = 'UTF-8';\n\n $xpath = new DOMXPath( $doc );\n $childs = $xpath->query(\".//div\");\n foreach ( $childs as $node ) {\n if ( $node->getElementsByTagName(\"img\")->length ) {\n $node->parentNode->removeChild($node);\n }\n }\n\n // Return only the body contents of DOM\n return utf8_decode($doc->saveHTML($doc->getElementsByTagName(\"body\")->item(0)));\n}", "function limit_content() {\n $content = get_the_content();\n $content = preg_replace('/(<)([img])(\\w+)([^>]*>)/', \"\", $content);\n $content = apply_filters('the_content', $content);\n $content = str_replace(']]>', ']]&gt;', $content);\n echo $content;\n}", "public static function content_images_replace_tag( $content ) {\n\n // Defining the args\n $args = array(\n 'class' => 'image',\n 'tag' => 'img'\n );\n\n // Returning the filter\n return self::content_media_replace_tag( $content, $args );\n }", "function get_html_listing( $options=array() )\n\t{\n\t\t/**\n\t\t* Set a default for how many columns to show\n\t\t**/\n\t\t$options['imgs_per_col'] = ( isset( $options['imgs_per_col'] ) ) ? $options['imgs_per_col'] : 5;\n\n\t\t/**\n\t\t* Do we actually have images to show?\n\t\t**/\n\t\tif( $this->total_images )\n\t\t{\n\t\t\t/**\n\t\t\t* Output the beginning of the row\n\t\t\t**/\n\t\t\t$output .= $this->img_html->view_begin_row();\n\t\t\t\n\n\t\t\t/**\n\t\t\t* Loop through and display images\n\t\t\t**/\n\t\t\twhile( $i = $this->ipsclass->DB->fetch_row( $this->res ) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* Reset some variables\n\t\t\t\t**/\t\t\t\t\n\t\t\t\t$alt = \"\";\n\t\t\t\t$img_view_elements = array();\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* If we're showing 4 or more cols per row, shorten the caption\n\t\t\t\t**/\n\t\t\t\t\n\t\t\t\tif ( $options['imgs_per_col'] >= 4 )\n\t\t\t\t{\n\t\t\t\t\t$i['caption'] = $this->ipsclass->txt_truncate( $i['caption'], 25 );\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Do we need to start listing images on the next row?\n\t\t\t\t**/\t\t\t\t\t\n\t\t\t\tif( $col_count >= $options['imgs_per_col'] )\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_end_row();\n\t\t\t\t\t$output .= $this->img_html->view_begin_row();\n\t\t\t\t\t$col_count = 0;\n\t\t\t\t}\n\t\t\t\t$col_count++;\n\n\t\t\t\t/**\n\t\t\t\t* Make an image tag\n\t\t\t\t**/\n\t\t\t\t$i['image'] = $this->glib->make_image_link( $i, $i['thumbnail'] );\t\t\t\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Figure out ordering\n\t\t\t\t**/\n\t\t\t\tfor( $j = 1; $j <=6; $j++ )\n\t\t\t\t{\n\t\t\t\t\tswitch( $this->_idx_order( $j ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* User Name\n\t\t\t\t\t\t**/\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'gallery_img_order_username':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_user'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$name = $this->glib->make_name_link( $i['mid'], ( $i['name'] ) ? $i['name'] : $this->ipsclass->lang['guest'] );\t\t\t\t\t\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['uploaded_by'], $name );\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Date\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_date':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_date'] )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['on'], $this->ipsclass->get_date( $i['date'], 'LONG' ) );\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Filesize\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_size':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_filesize'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['filesize'], $this->glib->byte_to_kb( $i['file_size'] ) );\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Comment Count\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_comment':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_comments'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['l_comments'], $i['comments'] );\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* View Count\n\t\t\t\t\t\t**/\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'gallery_img_order_view':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_views'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $this->ipsclass->lang['l_views'], $i['views'] );\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Ratings\n\t\t\t\t\t\t**/\t\n\t\t\t\t\t\tcase 'gallery_img_order_rating':\n\t\t\t\t\t\t\tif( $this->ipsclass->vars['gallery_img_show_rate'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( ! class_exists( \"rate\" ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\trequire( $this->ipsclass->gallery_root . 'rate.php' );\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$rate = new rate;\n $rate->ipsclass =& $this->ipsclass;\n $rate->glib =& $this->glib;\n\t\t\t\t\t\t\t\t$img_view_elements[] = array( $rate->rating_display( $this->img_html, $i ), \"\", 'rate' );\n\t\t\t\t\t\t\t}\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\n\t\t\t\t/**\n\t\t\t\t* Multi-moderation\n\t\t\t\t**/\t\n\t\t\t\t\n\t\t\t\tif( $this->mod && ( $this->ipsclass->input['cmd'] == 'sc' || $this->ipsclass->input['cmd'] == 'si' ) )\n\t\t\t\t{\n\t\t\t\t\t$i['extra'] = \"<a href='#' title='' onclick='gallery_toggle_img(\\\"{$i['id']}\\\"); return false;'><img name='img{$i['id']}' src='style_images/{$this->ipsclass->skin['_imagedir']}/topic_unselected.gif' /></a>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Display the remove link if this is a favorite image\n\t\t\t\t**/\t\n\t\t\t\tif( $this->favorite )\n\t\t\t\t{\n\t\t\t\t\t$i['extra'] = \"<div class='fauxbutton' style='width:auto' align='center'><img src='{$this->ipsclass->vars['img_url']}/aff_cross.gif' style='vertical-align:middle' alt='x' /> <a href='{$this->ipsclass->base_url}automodule=gallery&cmd=favs&op=del&img={$i['id']}'>{$this->ipsclass->lang['rem_fav']}</a></div>\";\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t* Loop through the image information and add it to our output\n\t\t\t\t**/\t\n\t\t\t\tforeach( $img_view_elements as $element )\n\t\t\t\t{\n\t\t\t\t\t$alt = ( $alt == 'class=\"alt\"' ) ? '' : 'class=\"alt\"';\n\t\t\t\t\t\n\t\t\t\t\t# Matt hack to make sure rating display is the same height as the rating dropdown\n\t\t\t\t\t$alt .= ( $element[2] == 'rate' AND ! strstr( $element[0], 'menu_build_menu(') ) ? \" style='height:25px'\" : \"\";\n\t\t\t\t\t\n\t\t\t\t\t$i['info'] .= $this->img_html->image_info_line( $element[0], $element[1], $alt );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t* What kind of image are we displaying?\n\t\t\t\t**/\t\n\t\t\t\tif( $i['pinned'] && $this->pin )\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_row_img_pinned( $i );\n\t\t\t\t}\n\t\t\t\telse if( $i['approved'] )\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_row_img( $i );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output .= $this->img_html->view_row_img_hidden( $i );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $col_count != 0 )\n\t\t\t{\n\t\t\t\t$output .= $this->img_html->view_end_row();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output .= $this->img_html->basic_row( 'none_found' );\n\t\t}\n\n\t\treturn $output;\n\t}", "function wrap_embed_with_div($html, $url, $attr) {\n\n return '<div class=\"video_wrapper\"><div class=\"video-container\">' . $html . '</div></div>';\n\n}", "function druplex_field__field_portfolio_images($variables) {\n\n $output = '<div class=\"flexslider\"><ul class=\"slides\">';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul></div>';\n \n return $output;\n}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "function cardealer_filter_ptags_on_images($content){\r\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function roots_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "public function build()\n {\n if ($this->_inline) {\n $encoded_image = base64_encode(file_get_contents($this->_attributes['src']));\n $mime_type = image_type_to_mime_type($this->_image_type);\n $this->_attributes['src'] = \"data:{$mime_type};base64,{$encoded_image}\";\n\n if (isset($this->_attributes['async'])) {\n unset($this->_attributes['async']);\n }\n }\n\n $attributes = join(' ', $this->_makeAttributesArr());\n if (!empty($attributes)) {\n $attributes = ' ' . $attributes;\n }\n return \"<img{$attributes}>\";\n }", "protected function _build() {\n $alt_title = $this->isXhtml ? tep_output_string_protected( str_replace ( '&amp;', '&', $this->attributes['alt'] ) ) : tep_output_string( $this->attributes['alt'] );\n $parameters = tep_not_null( $this->parameters ) ? tep_output_string( $this->parameters ) : false;\n $width = (int)$this->_calculated_width;\n $height = (int)$this->_calculated_height;\n $this->_html = '<img width=\"' . $width . '\" height=\"' . $height . '\" src=\"' . $this->src . '\" title=\"' . $alt_title . '\" alt=\"' . $alt_title . '\"';\n if ( false !== $parameters ) $this->_html .= ' ' . html_entity_decode(tep_output_string( $parameters ));\n $this->_html .= $this->isXhtml ? ' />' : '>'; \n }", "function my_acf_result_result( $html, $post )\n{\n\t$image = get_field('thumbnail', $post->ID);\n \n\tif( $image )\n\t{\n\t\t$html = '<img src=\"' . $image['url'] . '\" />' . $html;\n\t}\n \n return $html;\n}", "function _gallery($data){\n global $conf;\n global $lang;\n $ret = '';\n\n $files = $this->_findimages($data);\n\n //anything found?\n if(!count($files)){\n $ret .= '<div class=\"nothing\">'.$lang['nothingfound'].'</div>';\n return $ret;\n }\n\n // prepare alignment\n $align = '';\n $xalign = '';\n if($data['align'] == 1){\n $align = ' gallery_right';\n $xalign = ' align=\"right\"';\n }\n if($data['align'] == 2){\n $align = ' gallery_left';\n $xalign = ' align=\"left\"';\n }\n if($data['align'] == 3){\n $align = ' gallery_center';\n $xalign = ' align=\"center\"';\n }\n if(!$data['_single']){\n if(!$align) $align = ' gallery_center'; // center galleries on default\n if(!$xalign) $xalign = ' align=\"center\"';\n }\n\n $page = 0;\n\n // build gallery\n if($data['_single']){\n $ret .= $this->_image($files[0],$data);\n $ret .= $this->_showname($files[0],$data);\n $ret .= $this->_showtitle($files[0],$data);\n }elseif($data['cols'] > 0){ // format as table\n $close_pg = false;\n\n $i = 0;\n foreach($files as $img){\n\n // new page?\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '<div class=\"gallery_page gallery__'.$data['galid'].'\" id=\"gallery__'.$data['galid'].'_'.(++$page).'\">';\n $close_pg = true;\n }\n\n // new table?\n if($i == 0 || ($data['paginate'] && ($i % $data['paginate'] == 0))){\n $ret .= '<table>';\n\n }\n\n // new row?\n if($i % $data['cols'] == 0){\n $ret .= '<tr>';\n }\n\n // an image cell\n $ret .= '<td>';\n $ret .= $this->_image($img,$data);\n $ret .= $this->_showname($img,$data);\n $ret .= $this->_showtitle($img,$data);\n $ret .= '</td>';\n $i++;\n\n // done with this row? cloase it\n $close_tr = true;\n if($i % $data['cols'] == 0){\n $ret .= '</tr>';\n $close_tr = false;\n }\n\n // close current page and table\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n if ($close_tr){\n // add remaining empty cells\n while($i % $data['cols']){\n $ret .= '<td></td>';\n $i++;\n }\n $ret .= '</tr>';\n }\n $ret .= '</table>';\n $ret .= '</div>';\n $close_pg = false;\n }\n\n }\n\n if ($close_tr){\n // add remaining empty cells\n while($i % $data['cols']){\n $ret .= '<td></td>';\n $i++;\n }\n $ret .= '</tr>';\n }\n\n if(!$data['paginate']){\n $ret .= '</table>';\n }elseif ($close_pg){\n $ret .= '</table>';\n $ret .= '</div>';\n }\n }else{ // format as div sequence\n $i = 0;\n $close_pg = false;\n foreach($files as $img){\n\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '<div class=\"gallery_page gallery__'.$data['galid'].'\" id=\"gallery__'.$data['galid'].'_'.(++$page).'\">';\n $close_pg = true;\n }\n\n $ret .= '<div>';\n $ret .= $this->_image($img,$data);\n $ret .= $this->_showname($img,$data);\n $ret .= $this->_showtitle($img,$data);\n $ret .= '</div> ';\n\n $i++;\n\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '</div>';\n $close_pg = false;\n }\n }\n\n if($close_pg) $ret .= '</div>';\n\n $ret .= '<br style=\"clear:both\" />';\n }\n\n // pagination links\n $pgret = '';\n if($page){\n $pgret .= '<div class=\"gallery_pages\"><span>'.$this->getLang('pages').' </span>';\n for($j=1; $j<=$page; $j++){\n $pgret .= '<a href=\"#gallery__'.$data['galid'].'_'.$j.'\" class=\"gallery_pgsel button\">'.$j.'</a> ';\n }\n $pgret .= '</div>';\n }\n\n return '<div class=\"gallery'.$align.'\"'.$xalign.'>'.$pgret.$ret.'<div class=\"clearer\"></div></div>';\n }", "public static function add_data_img_tags_and_enqueue_assets( $content ) {\n if ( ! preg_match_all( '/<img [^>]+>/', $content, $matches ) ) {\n return $content;\n }\n $selected_images = array();\n\n foreach( $matches[0] as $image_html ) {\n if ( preg_match( '/wp-image-([0-9]+)/i', $image_html, $class_id ) &&\n ( $attachment_id = absint( $class_id[1] ) ) ) {\n\n /*\n * If exactly the same image tag is used more than once, overwrite it.\n * All identical tags will be replaced later with 'str_replace()'.\n */\n $selected_images[ $attachment_id ] = $image_html;\n }\n }\n\n foreach ( $selected_images as $attachment_id => $image_html ) {\n $attachment = get_post( $attachment_id );\n\n if ( ! $attachment ) {\n continue;\n }\n\n $attributes = $this->add_data_to_images( array(), $attachment );\n $attributes_html = '';\n foreach( $attributes as $k => $v ) {\n $attributes_html .= esc_attr( $k ) . '=\"' . esc_attr( $v ) . '\" ';\n }\n $image_html_with_data = str_replace( '<img ', \"<img $attributes_html\", $image_html );\n $content = str_replace( $image_html, $image_html_with_data, $content );\n }\n // $this->enqueue_assets();\n \n \n return $content;\n }", "function createImage($idName) { //TODO: Add parameter for passing image files to use instead \n echo '<img src=\"/php/cms-img/file2.png\" id=\"' . $idName . '\" class=\"nested\"/>';\n }", "function dfd_post_inner_custom_box( $post ) {\n\n // Add an nonce field so we can check for it later.\n wp_nonce_field( 'dfd_post_inner_custom_box', 'dfd_post_inner_custom_box_nonce' );\n\n\n ?>\n\n <div id=\"my_post_images_container\">\n <ul class=\"my_post_images\">\n <?php\n if ( metadata_exists( 'post', $post->ID, '_my_post_image_gallery' ) ) {\n $my_post_image_gallery = get_post_meta( $post->ID, '_my_post_image_gallery', true );\n } else {\n // Backwards compat\n $attachment_ids = get_posts( 'post_parent=' . $post->ID . '&numberposts=-1&post_type=attachment&orderby=menu_order&order=ASC&post_mime_type=image&fields=ids' );\n $attachment_ids = array_diff( $attachment_ids, array( get_post_thumbnail_id() ) );\n $my_post_image_gallery = implode( ',', $attachment_ids );\n }\n\n $attachments = array_filter( explode( ',', $my_post_image_gallery ) );\n\n if ( $attachments ) {\n foreach ( $attachments as $attachment_id ) {\n echo '<li class=\"image\" data-attachment_id=\"' . esc_attr($attachment_id) . '\">\n\t\t\t\t\t\t\t\t' . wp_get_attachment_image( $attachment_id, 'thumbnail' ) . '\n\t\t\t\t\t\t\t\t<ul class=\"actions\">\n\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"delete tips\" data-tip=\"' . esc_attr__( 'Delete image', 'dfd' ) . '\">' . esc_attr__( 'Delete', 'dfd' ) . '</a></li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</li>';\n }\n\t\t\t} ?>\n </ul>\n\n <input type=\"hidden\" id=\"my_post_image_gallery\" name=\"my_post_image_gallery\" value=\"<?php echo esc_attr( $my_post_image_gallery ); ?>\" />\n\n </div>\n <p class=\"add_my_post_images hide-if-no-js\">\n <a class=\"button\" href=\"#\"><?php _e( 'Add gallery images', 'dfd' ); ?></a>\n </p>\n <script type=\"text/javascript\">\n jQuery(document).ready(function($){\n\t\t\t\"use strict\";\n // Uploading files\n var my_post_gallery_frame;\n var $image_gallery_ids = $('#my_post_image_gallery');\n var $my_post_images = $('#my_post_images_container ul.my_post_images');\n\n jQuery('.add_my_post_images').on( 'click', 'a', function( event ) {\n\n var $el = $(this);\n var attachment_ids = $image_gallery_ids.val();\n\n event.preventDefault();\n\n // If the media frame already exists, reopen it.\n if ( my_post_gallery_frame ) {\n my_post_gallery_frame.open();\n return;\n }\n\n // Create the media frame.\n my_post_gallery_frame = wp.media.frames.downloadable_file = wp.media({\n // Set the title of the modal.\n title: '<?php _e( 'Add Images to post Gallery', 'dfd' ); ?>',\n button: {\n text: '<?php _e( 'Add to gallery', 'dfd' ); ?>'\n },\n multiple: true\n });\n\n // When an image is selected, run a callback.\n my_post_gallery_frame.on( 'select', function() {\n\n var selection = my_post_gallery_frame.state().get('selection');\n\n selection.map( function( attachment ) {\n\n attachment = attachment.toJSON();\n\n if ( attachment.id ) {\n attachment_ids = attachment_ids ? attachment_ids + \",\" + attachment.id : attachment.id;\n\n $my_post_images.append('\\\n\t\t\t\t\t\t\t\t\t<li class=\"image\" data-attachment_id=\"' + attachment.id + '\">\\\n\t\t\t\t\t\t\t\t\t\t<img src=\"' + attachment.url + '\" />\\\n\t\t\t\t\t\t\t\t\t\t<ul class=\"actions\">\\\n\t\t\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"delete\" title=\"<?php _e( 'Delete image', 'dfd' ); ?>\"><?php _e( 'Delete', 'dfd' ); ?></a></li>\\\n\t\t\t\t\t\t\t\t\t\t</ul>\\\n\t\t\t\t\t\t\t\t\t</li>');\n }\n\n } );\n\n $image_gallery_ids.val( attachment_ids );\n });\n\n // Finally, open the modal.\n my_post_gallery_frame.open();\n });\n\n // Image ordering\n $my_post_images.sortable({\n items: 'li.image',\n cursor: 'move',\n scrollSensitivity:40,\n forcePlaceholderSize: true,\n forceHelperSize: false,\n helper: 'clone',\n opacity: 0.65,\n placeholder: 'wc-metabox-sortable-placeholder',\n start:function(event,ui){\n ui.item.css('background-color','#f6f6f6');\n },\n stop:function(event,ui){\n ui.item.removeAttr('style');\n },\n update: function(event, ui) {\n var attachment_ids = '';\n\n $('#my_post_images_container ul li.image').css('cursor','default').each(function() {\n var attachment_id = jQuery(this).attr( 'data-attachment_id' );\n attachment_ids = attachment_ids + attachment_id + ',';\n });\n\n $image_gallery_ids.val( attachment_ids );\n }\n });\n\n // Remove images\n $('#my_post_images_container').on( 'click', 'a.delete', function() {\n\n $(this).closest('li.image').remove();\n\n var attachment_ids = '';\n\n $('#my_post_images_container ul li.image').css('cursor','default').each(function() {\n var attachment_id = jQuery(this).attr( 'data-attachment_id' );\n attachment_ids = attachment_ids + attachment_id + ',';\n });\n\n $image_gallery_ids.val( attachment_ids );\n\n return false;\n } );\n\n });\n </script>\n\n\n<?php\n\n}", "function content($content, $data, $select, $from, $tag, $k){\n\n\n\n\t//move \n\t$attributes = array();\n\tif($tag == 'figure'){ \t\n\t\t\t\t\t\t\tif(isset($data[$from][$select])){ if(!is_array($data[$from][$select])){ $attributes = array(\"class\"=> $data[$from][$select] ); $select = ''; } }\n\t\t\t\t\t\t\t//else { } place content for multiple images with class (tag div)\n\t\t\t\t\t\t}\n\n\tif(!is_array($select)){ \t\n\t\t\t\t\t\t\t\t\t\t\n\t\tif(isset($data[$from][$select])){\n\t\t\t\tif(!is_array($data[$from][$select])){ $content .= $data[$from][$select]; } //string data comes here\n\t\t\t\telse { //if(isset($data['prefix'])){ $content .= 'prefix'; }\n\t\t\t\t\t\tif(isset($_SESSION['list'][$select])) { foreach ($data[$from][$select] as $k2 => $val) {\n\t\t\t\t\t\t\t\t\t\tif(isset($_SESSION['list'][$select][$k2]['image'])){ $content .= '<img src=\"gallery/'.$_SESSION['list'][$select][$val]['image'].'\" >'; }\n\t\t\t\t\t\t\t\t\t\telse {\t$content .= '<span>'.$_SESSION['list'][$select][$val]['name'].'</span>';\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse { foreach ($data[$from][$select] as $k2 => $val) { $content .= '<span>'.$val.'</span>'; } }\n\t\t\t\t }\n\t\t\t\t}\n\t\telse{ if(empty($from)){$content .= $select; } /*$select.'uio';*/ }\n\t}\n\n\telse{ $content .=disher('', $select, $data, $k); }\n\n\t$output = array('content' =>$content , 'attributes'=> $attributes);\n\treturn $output;\n}", "function hc_include_hc_image_box(&$Y_NOW,$EXTRA) {\n $img = hc_get_img_arr($Y_NOW['image']);\n $css_classes = \"img-box \" . $Y_NOW['icon_position'] . \" \" . $Y_NOW[\"css_classes\"] . \" \" . $Y_NOW[\"custom_css_classes\"]. \" \";\n $img_style = $Y_NOW['style'];\n if ($img_style == \"square_thumbnail\") $css_classes .= \"thumbnail \";\n if ($img_style == \"circle\") $css_classes .= \"circle \";\n if ($img_style == \"circle_thumbnail\") $css_classes .= \"circle thumbnail \";\n if ($Y_NOW['img_box_inner_caption'] == \"true\") $css_classes .= \"inner \";\n if (strlen($Y_NOW[\"image_animation\"]) > 0) $css_classes .= \"img-\" . $Y_NOW[\"image_animation\"];\n?>\n<a id=\"<?php echo esc_attr($Y_NOW[\"id\"]); ?>\" <?php hc_set_link_settings($Y_NOW, $css_classes);\n if (strlen($Y_NOW['icon_animation']) > 0) echo ' data-anima=\"'. esc_attr($Y_NOW['icon_animation']) . '\" data-trigger=\"hover\" ';\n if ($Y_NOW['icon_hidden'] == \"true\") echo ' data-anima-out=\"hide\"';\n ?> style=\"<?php echo esc_attr($Y_NOW[\"custom_css_styles\"]); ?>\">\n <span>\n <?php if (strlen($Y_NOW['icon']) > 0) echo '<i class=\"' . esc_attr($Y_NOW[\"icon\"]) . ' ' . ((strlen($Y_NOW['icon_animation']) > 0) ? 'anima':'') .'\"></i>'; ?>\n <img alt=\"<?php echo esc_attr(hc_get_now($Y_NOW,'alt')) ?>\" src=\"<?php echo hc_get_img($Y_NOW['image'],hc_get_now($Y_NOW,\"thumb_size\",\"large\")); ?>\" data-width=\"<?php echo esc_attr($img[2]); ?>\" data-height=\"<?php echo esc_attr($img[1]); ?>\">\n </span>\n <?php\n if (strlen($Y_NOW['caption_img_box']) > 0) {\n if ($img_style != \"circle\" && $img_style != \"circle_thumbnail\")\n if ($Y_NOW['img_box_inner_caption'] == \"true\") echo '<span class=\"caption-box\"><span class=\"caption\">' . strip_tags($Y_NOW['caption_img_box'],'<b><span><br>') . '</span></span></a>';\n else echo '<span class=\"caption\">'. esc_attr($Y_NOW['caption_img_box']) .'</span></a>';\n else {\n if ($Y_NOW['img_box_inner_caption'] == \"true\") echo '<span class=\"caption\">'. strip_tags($Y_NOW['caption_img_box'],'<b><span><br>') .'</span></a>';\n else echo '</a><span class=\"caption caption-out\">'. esc_attr($Y_NOW['caption_img_box']) .'</span>';\n }\n } else echo \"</a>\";\n hc_set_content_lightbox($Y_NOW);\n}", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n ?>\n\t\t<div class=\"happyden-feature-image\">\n\t\t\t\t<?php the_post_thumbnail( get_the_Id(), 'full' ); ?>\n\t\t</div>\n\t\t<?php\n\t}", "function img_responsive($content){\n return str_replace('<img class=\"','<img class=\"lazyload ',$content);\n}", "function img_p_class_content_filter($content) {\n $content = preg_replace(\"/(<p[^>]*)(\\>.*)(\\<img.*)(<\\/p>)/im\", \"\\$1 class='content-img-wrap'\\$2\\$3\\$4\", $content);\n\n return $content;\n}", "public function embed_wrap($cache) {\n\t\treturn '<div class=\"entry-content-asset\">' . $cache . '</div>';\n\t}", "function showpics_func($atts, $content = null) { ?>\n\t\t<?php\n extract(shortcode_atts(array(\n \"showpics\" => '',\n\t\t\t\t\"order\" => 'ASC',\n\t\t\t\t\"orderby\" => 'menu_order'\n ), $atts));\n global $post;\n $lrgpics = get_children('numberposts=-1&order='.$order.'&orderby='.$orderby.'&post_type=attachment&post_mime_type=image&post_parent='.$post->ID);\n\t\t$return='';\n foreach($lrgpics as $lrgpic) :\n\t\t\tif (strtoupper($lrgpic->post_name) != strtoupper($lrgpic->post_title)) { // If the picture hasn't been given a new name, it won't show up.\n\t\t\t$image = wp_get_attachment_image_src($lrgpic->ID, 'full'); \n\t\t\t$lrgimage = wp_get_attachment_image_src($lrgpic->ID, 'large');\n\t\t\t$imgwidth = $lrgimage[1] + 10;\n\t\t\t$theimage = wp_get_attachment_image($lrgpic->ID, 'large');\n\t $return.='<div style=\"width:'.$imgwidth.'px;\" id=\"attachment_'.$lrgpic->ID.'\" class=\"wp-caption alignnone\"><a href=\"'. $image[0].'\">'.$theimage.'</a>';\n\t\t\t\tif($lrgpic->post_content) {\n\t\t\t\t\t$return.='<p class=\"wp-caption-text\"><small>'.$lrgpic->post_content.'</small></p></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$return.='<p class=\"wp-caption-text\">'.$lrgpic->post_title.'</p></div>';\n\t\t\t\t}\n\t\t\t// if title has been given, show title, if description has been given, show description\n\t\t\t// if no title has been given, just show the image\n \t} else { \n\t\t\t$image = wp_get_attachment_image_src($lrgpic->ID, 'full'); \n\t\t\t$theimage = wp_get_attachment_image($lrgpic->ID, 'large');\n\t $return.='<p class=\"imgcontainer\"><a href=\"'. $image[0].'\">'.$theimage.'</a></p>';\n\t\t\t} // end check to see if title has been given\n\t\tendforeach;\n return $return;\n}", "function gallery(){\n $str=\"\";\n $str.= \"<div class='gallery'>\";\n foreach (glob(\"*.{jpg,png,gif,JPG,jpeg}\",GLOB_BRACE) as $filename) {\n echo '<a data-fancybox=\"gallery\" href=\"'.$filename.'\"><img class=\"thumbnail\" src=\"'.$filename.'\"></a>';\n }\n $str.= \"</div>\";\n echo $str;\n}", "function custom_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function druplex_field__field_image($variables) {\n\n $output = '<div class=\"flexslider\"><ul class=\"slides\">';\n\n foreach ($variables['items'] as $delta => $item) {\n $output .= '<li>' . drupal_render($item) . '</li>';\n }\n\n $output .= '</ul></div>';\n \n return $output;\n}", "function fabric_embed_wrap($cache, $url, $attr = '', $post_ID = '') {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function add_images_meta_box($post) {\n $images = get_post_meta($post->ID, 'imagegallery_images', true);\n\t$count = 1;\n\tif (!empty($images) ) {\n\t\tforeach($images as $image) {\n\t\t\toutput_image_add_box($count++, $image);\n\t\t}\n\t}\n\techo '<div id=\"admin-list-end-marker\" style=\"clear: both;\"></div><a rel=\"image\" href=\"#\" id=\"add-admin-list\" name=\"add-admin-list\">Add Images</a>';\n}", "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function bones_filter_ptags_on_images($content)\n{\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "public function replaceImage()\n {\n $args = func_get_args();\n\n $domDocument = new DomDocument();\n $domDocument->loadXML(self::$_document);\n\n $domImages = $domDocument->getElementsByTagNameNS('http://schemas.openxmlformats.org/drawingml/2006/' .\n 'wordprocessingDrawing', 'docPr');\n $domImagesId = $domDocument->getElementsByTagNameNS(\n 'http://schemas.openxmlformats.org/drawingml/2006/main',\n 'blip'\n );\n\n for ($i = 0; $i < $domImages->length; $i++) {\n if ($domImages->item($i)->getAttribute('descr') ==\n self::$_templateSymbol . $args[0] . self::$_templateSymbol) {\n $ind = $domImagesId->item($i)->getAttribute('r:embed');\n self::$placeholderImages[$ind] = $args[1];\n }\n }\n }", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "function shop_uc_product_image($variables) {\n static $rel_count = 0;\n $images = $variables['images'];\n\n // Get the current product image widget.\n $image_widget = uc_product_get_image_widget();\n\n $first = array_shift($images);\n\n //$output = '<div class=\"product-image\"><div class=\"main-product-image\">'; // Sudhakar\n $output = '<div class=\"product_img_big\">';\n $output .= '<a href=\"' . image_style_url('uc_product_full', $first['uri']) . '\" title=\"' . $first['title'] . '\"';\n if ($image_widget) {\n $image_widget_func = $image_widget['callback'];\n $output .= $image_widget_func($rel_count);\n } \n $output .= '>';\n $output .= theme('image_style', array(\n 'style_name' => 'uc_product',\n 'path' => $first['uri'],\n 'alt' => $first['alt'],\n 'title' => $first['title'],\n\t'width' => 100, // Sudhakar\n\t'height' => 92, // Sudhakar\n ));\n // $output .= '</a></div>'; // Sudhakar\n $output .= '</a>';\n\n if (!empty($images)) {\n $output .= '<div class=\"more-product-images\">';\n foreach ($images as $thumbnail) {\n // Node preview adds extra values to $images that aren't files.\n if (!is_array($thumbnail) || empty($thumbnail['uri'])) {\n continue;\n }\n $output .= '<a href=\"' . image_style_url('uc_product_full', $thumbnail['uri']) . '\" title=\"' . $thumbnail['title'] . '\"';\n if ($image_widget) {\n $output .= $image_widget_func($rel_count);\n }\n $output .= '>';\n $output .= theme('image_style', array(\n 'style_name' => 'uc_thumbnail',\n 'path' => $thumbnail['uri'],\n 'alt' => $thumbnail['alt'],\n 'title' => $thumbnail['title'],\n ));\n $output .= '</a>';\n }\n $output .= '</div>';\n }\n\n $output .= '</div>';\n $rel_count++;\n\n return $output;\n}", "public function make_content_images_responsive( $content ) \n\t\t{\n\t\t\tglobal $wp_version;\n\t\t\t\n\t\t\tif( ! $this->responsive_images_active() )\n\t\t\t{\n\t\t\t\treturn $content;\n\t\t\t}\n\t\t\t\n\t\t\t//\tStay backwards comp.\n\t\t\tif( version_compare( $wp_version, '5.4.99999', '<' ) && ! function_exists( 'wp_make_content_images_responsive' ) )\n\t\t\t{\n\t\t\t\treturn $content;\n\t\t\t}\n\t\t\t\n\t\t\t$matches = array();\n\t\t\tif ( ! preg_match_all( '/<img [^>]+>/', $content, $matches ) ) \n\t\t\t{\n\t\t\t\treturn $content;\n\t\t\t}\n\t\t\t\n\t\t\tforeach ( $matches[0] as $image ) \n\t\t\t{\n\t\t\t\t$new_image = $this->ensure_attr_enclosure( $image );\n\t\t\t\tif( $new_image != $image )\n\t\t\t\t{\n\t\t\t\t\t$pos = strpos( $content, $image );\n\t\t\t\t\t\n\t\t\t\t\tif( false !== $pos )\n\t\t\t\t\t{\n\t\t\t\t\t\t$content = substr_replace( $content, $new_image, $pos, strlen( $image ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif( version_compare( $wp_version, '5.4.99999', '<' ) )\n\t\t\t{\n\t\t\t\t$return = wp_make_content_images_responsive( $content );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$return = wp_filter_content_tags( $content );\n\t\t\t}\n\t\t\t\n\t\t\treturn $return;\n\t\t}", "function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }", "function my_post_image_html( $html, $post_id, $post_image_id )\r\n{\r\n\t$src = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post_id ));\r\n\t\r\n\t$html = '<img src=\"'.$src[0].'\" alt=\"'.esc_attr( get_post_field( 'post_title', $post_id ) ).'\">';\r\n\t\r\n\treturn $html;\r\n}", "function getImagesDam($limitImages=0) {\n # echo t3lib_div::view_array($images);\n \n // get all the files\n $images = tx_dam_db::getReferencedFiles('tt_content',$this->cObj->data['uid'],'rgsmoothgallery','tx_dam_mm_ref');\n\n // randomise and limit image items returned from images array\n // also useful to limit items in array to 1 item for use when no javascript in browser\n // if $limitImages=0 then this if statement is bypassed and all images in images array returned for processing\n if ($limitImages>0) {\n $test = ($images['files']);\n $test = $this->getSlicedRandomArray($test,0,$limitImages);\n $images['files'] = $test;\n }\n # echo t3lib_div::view_array($images['files']); \n \t $content.=$this->beginGallery($this->cObj->data['uid'],$limitImages);\n \t \n \t // add image\n foreach ($images['files'] as $key=>$path) { \n // get data from the single image\n $fields = 'title,description';\n $tables = 'tx_dam';\n $temp_where='uid = '.$key;\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tables, $temp_where);\n $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\n // add element to slideshow\n $content.=$this->addImage(\n\t\t\t $path,\n $row['title'], \n $row['description'], \n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\n }\n \n $content.=$this->endGallery();\n return $content;\n }", "public function listadoHijosNietosImagenes($content){\n $contador = 0;\n $vectorImagenes = array();\n $dom = new DOMDocument();\n $dom->loadHTML(\"$content\");\n $xpath = new DOMXPath($dom);\n $tag = \"div\";\n $class = \"widget em-widget-new-products-grid\";\n $consulta = \"//\".$tag.\"[@class='\".$class.\"']\";\n $widget = $xpath->query($consulta);\n //var_dump($widget);\n if ($widget->length > 0){\n foreach($widget as $res){\n if ($contador == 0){\n $resultados = $res->getElementsByTagName(\"img\");\n if ($resultados->length > 0){\n foreach($resultados as $img){\n $urlImagen = $img->getAttribute(\"src\");\n array_push($vectorImagenes,$urlImagen);\n }\n }\n }\n $contador++;\n }\n }\n return $vectorImagenes;\n }", "function replaceIMG($html)\r\n\t{\r\n\t\t$iStart = stripos($html,\"<img\");\r\n\t\twhile((string)$iStart != null) //string typecast to handle \"0\" which equates to FALSE in PHP...\r\n\t\t{\r\n\t\t\t//get entire IMG tag\r\n\t\t\t$iEnd = stripos($html,\">\",$iStart)+1;\r\n\t\t\t$imgTag = substr($html,$iStart,($iEnd-$iStart));\r\n\t\t\t\r\n\t\t\t//get src\r\n\t\t\t$iSrcStart = stripos($imgTag,\"src=\");\r\n\t\t\tif(substr($imgTag,($iSrcStart+4),1) == \"'\")\r\n\t\t\t{\r\n\t\t\t\t//single quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,\"'\",$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//double quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,'\"',$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\t$imgSrc = substr($imgTag,$iSrcStart+5,($iSrcEnd-($iSrcStart+5)));\r\n\t\t\t\r\n\t\t\t//get alt\r\n\t\t\t$iAltStart = stripos($imgTag,\"alt=\");\r\n\t\t\tif($iAltStart != null)\r\n\t\t\t{\r\n\t\t\t\tif(substr($imgTag,($iAltStart+4),1) == \"'\")\r\n\t\t\t\t{\r\n\t\t\t\t\t//single quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,\"'\",$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//double quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,'\"',$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\t$imgAlt = substr($imgTag,$iAltStart+5,($iAltEnd-($iAltStart+5)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//replace HTML\r\n\t\t\tif((string)stripos($imgSrc,\"scripts/CLEditor/images/icons/\") == null) //exclude icons from rich text editor\r\n\t\t\t{\r\n\t\t\t\t$replacementHTML = \"<div class='table comicborder popupshadow-margin'><div class='table-row'><div class='table-cell'><a href='\" . $imgSrc . \"'>\" . $imgTag . \"</a></div></div>\";\r\n\t\t\t\tif($iAltStart != null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$replacementHTML = $replacementHTML . \"<div class='table-row'><div class='table-cell comicimagecaption'>\" . $imgAlt . \"</div></div>\";\r\n\t\t\t\t}\r\n\t\t\t\t$replacementHTML = $replacementHTML . \"</div>\";\r\n\t\t\t\t$html = substr_replace($html,$replacementHTML,$iStart,($iEnd-$iStart));\r\n\t\t\t\t\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($replacementHTML)));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($imgTag)));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $html;\r\n\t}", "function spip2odt_convertir_images($texte,$dossier){\n\t$dir = sous_repertoire($dossier,'Pictures');\n\tinclude_spip('inc/distant');\n\t$split = preg_split(',(<[a-z]+\\s[^<>]*spip_documents[^<>]*>),Uims',$texte,null,PREG_SPLIT_DELIM_CAPTURE);\n\t$class = \"\";\n\t$texte = \"\";\n\twhile (count($split)){\n\t\t$frag = array_shift($split);\n\t\tif (preg_match_all(\n\t\t ','\n\t\t .'(<([b-z][a-z]*)(\\s[^<>]*)?>)?' # ne pas attraper les <text:p > qui precedent une image\n\t\t .'(<a [^<>]*>)?\\s*(<img\\s[^<>]*>)(\\s*</a>)?'\n\t\t .'(\\s*</\\\\2>)?'\n\t\t .'(\\s*<([a-z]+)[^<>]*spip_doc_titre[^<>]*>(.*?)</\\\\9>)?'\n\t\t .'(\\s*<([a-z]+)[^<>]*spip_doc_descriptif[^<>]*>(.*?)</\\\\12>)?'\n\t\t .',imsS',\n\t\t $frag, $regs,PREG_SET_ORDER)!==FALSE) {\n\t\t #if (count($regs)) {var_dump($frag);var_dump($regs);die;}\n\t\t\t#if ($class && count($regs) && !count($split)) {var_dump($frag);var_dump($regs);die;}\n\t\t\tforeach($regs as $reg){\n\t\t\t\t// En cas de span spip_documents_xx recuperer la class\n\t\t\t\t$align = 'left'; // comme ca c'est bon pour les puces :)\n\t\t\t\t$href = \"\";\n\t\t\t\t$title = \"\";\n\t\t\t\tif ($class AND preg_match(',spip_documents_(left|right|center),i',$class,$match))\n\t\t\t\t\t$align = $match[1];\n\t\t\t\tif ($reg[4]){\n\t\t\t\t\t$href = extraire_attribut($reg[4],'href');\n\t\t\t\t\t$title = extraire_attribut($reg[4],'title');\n\t\t\t\t}\n\t\t\t\t$insert = spip2odt_imagedraw($dir,$reg[5],$align,isset($reg[10])?$reg[10]:\"\",isset($reg[13])?$reg[13]:\"\",$href,$title);\n\t\t\t\t$frag = str_replace($reg[0], $insert, $frag);\n\t\t\t\t$class=\"\";\n\t\t\t}\n\t\t}\n\t\t$texte .= $frag;\n\t\t$texte .= $tag=array_shift($split);\n\t\t$class = extraire_attribut($tag, 'class');\n\t}\n\treturn $texte;\n}", "function wpgrade_filter_ptags_on_images($content){\r\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function baindesign324_filter_ptags_on_images($content){\n\t return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n\t}", "function TS_VCSC_Add_Posts_Image_Lean() {\r\n\t\t\t\tvc_lean_map('TS_VCSC_Posts_Image_Grid_Standalone',\t\t\tarray($this, 'TS_VCSC_Add_Posts_Image_Elements'), null);\r\n\t\t\t}", "function fielding_post_gallery($output, $attr) {\n\tglobal $post;\n\n\t$gallery_id = 'gallery_' . uniqid();\n\n\tif ( isset( $attr['orderby'] ) ) {\n\t\t$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );\n\t\tif ( ! $attr['orderby'] ) {\n\t\t\tunset( $attr['orderby'] );\n\t\t}\n\t}\n\n\textract( shortcode_atts( array(\n\t\t'order' => 'ASC',\n\t\t'orderby' => 'menu_order ID',\n\t\t'id' => $post->ID,\n\t\t'itemtag' => 'dl',\n\t\t'icontag' => 'dt',\n\t\t'captiontag' => 'dd',\n\t\t'columns' => 3,\n\t\t'size' => 'thumbnail',\n\t\t'include' => '',\n\t\t'exclude' => '',\n\t), $attr ) );\n\n\t$id = intval( $id );\n\n\tif ( 'RAND' == $order ) {\n\t\t$orderby = 'none';\n\t}\n\n\tif ( ! empty( $include ) ) {\n\t\t$include = preg_replace( '/[^0-9,]+/', '', $include );\n\t\t$_attachments = get_posts(\tarray(\n\t\t\t'include' => $include,\n\t\t\t'post_status' => 'inherit',\n\t\t\t'post_type' => 'attachment',\n\t\t\t'post_mime_type' => 'image',\n\t\t\t'order' => $order,\n\t\t\t'orderby' => $orderby,\n\t\t) );\n\n\t\t$attachments = array();\n\t\tforeach ( $_attachments as $key => $val ) {\n\t\t\t$attachments[ $val->ID ] = $_attachments[ $key ];\n\t\t}\n\t}\n\n\tif ( empty( $attachments ) ) {\n\t\treturn '';\n\t}\n\n\t$count = count( $attachments );\n\t$image = array_shift( $attachments );\n\t$meta = fielding_lightbox_meta( array(\n\t\t\"id\" => $image->ID,\n\t\t\"title\" => $image->post_title,\n\t\t\"caption\" => $image->post_excerpt\n\t) );\n\n\t$output = '</div>';\n\n\t$output .= '<div class=\"gallery_large margined_md\">';\n\t$output .= '<a class=\"js-lightbox gallery_large_link\" href=\"' . $image->guid . '\" title=\"' . $image->post_excerpt . '\" data-lightbox-gallery=\"' . $gallery_id . '\" data-lightbox-meta=\"' . fielding_json_attribute( $meta, false ) . '\">';\n\t$output .= '<figure class=\"gallery_large_figure\">';\n\t$output .= fielding_responsive_image( fielding_image_gallery_large( $image->ID ), 'gallery_large_image', '', false );\n\t$output .= '<figcaption class=\"gallery_large_caption\">' . $image->post_excerpt . '</figcaption>';\n\t$output .= '</figure>';\n\t$output .= '<div class=\"gallery_large_meta image_count\">';\n\t$output .= '<span class=\"icon icon_expand\"></span>';\n\t$output .= '<span class=\"image_count_data\">';\n\t$output .= '<span class=\"image_count_text\">View Photos</span>';\n\t$output .= '<span class=\"image_count_number\">' . $count . ' Photos</span>';\n\t$output .= '</span>';\n\t$output .= '</div>';\n\t$output .= '</a>';\n\t$output .= '<div class=\"visually_hidden\">';\n\n\tforeach ( $attachments as $id => $image ) {\n\t\t$meta = fielding_lightbox_meta( array(\n\t\t\t\"id\" => $image->ID,\n\t\t\t\"title\" => $image->post_title,\n\t\t\t\"caption\" => $image->post_excerpt\n\t\t) );\n\t\t$output .= '<a href=\"' . $image->guid . '\" title=\"' . $image->post_excerpt . '\" data-lightbox-gallery=\"' . $gallery_id . '\" data-lightbox-meta=\"' . fielding_json_attribute( $meta, false ) . '\">' . $image->post_excerpt . '</a>';\n\t}\n\n\t$output .= '</div>';\n\t$output .= '</div>';\n\n\t$output .= '<div class=\"typography padded_content margined_md_bottom\">';\n\n\treturn $output;\n}", "function origami_gallery($contents, $attr){\n\tif(!siteorigin_setting('display_gallery')) return $contents;\n\n\tif(!empty($attr['type']) && $attr['type'] == 'default') return '';\n\n\tif(siteorigin_panels_is_home() && empty($attr['ids'])){\n\t\t// Display the default Origami gallery\n\t\treturn origami_gallery_default();\n\t}\n\n\tglobal $post;\n\t\n\tstatic $instance = 0;\n\t$instance++;\n\n\t// We're trusting author input, so let's at least make sure it looks like a valid orderby statement\n\tif ( isset( $attr['orderby'] ) ) {\n\t\t$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );\n\t\tif ( !$attr['orderby'] )\n\t\t\tunset( $attr['orderby'] );\n\t}\n\n\t/**\n\t * @var $order\n\t * @var $orderby\n\t * @var $id\n\t * @var $itemtag\n\t * @var $icontag\n\t * @var $captiontag\n\t * @var $size\n\t * @var $include\n\t * @var $exclude\n\t * @var $wp_default\n\t * @var $target_blank\n\t */\n\textract(shortcode_atts(array(\n\t\t'order' => 'ASC',\n\t\t'orderby' => 'menu_order ID',\n\t\t'id' => $post->ID,\n\t\t'itemtag' => 'dl',\n\t\t'icontag' => 'dt',\n\t\t'captiontag' => 'dd',\n\t\t'columns' => 3,\n\t\t'size' => 'origami-slider',\n\t\t'include' => '',\n\t\t'exclude' => '',\n\t\t'wp_default' => false,\n\t\t'target_blank' => false,\n\t), $attr));\n\t\n\t// This gallery has requested to use the WordPress default gallery\n\tif($wp_default) return $contents;\n\n\t$id = intval($id);\n\tif ( 'RAND' == $order )\n\t\t$orderby = 'none';\n\n\tif ( !empty($include) ) {\n\t\t$include = preg_replace( '/[^0-9,]+/', '', $include );\n\t\t$_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );\n\n\t\t$attachments = array();\n\t\tforeach ( $_attachments as $key => $val ) {\n\t\t\t$attachments[$val->ID] = $_attachments[$key];\n\t\t}\n\t}\n\telseif ( !empty($exclude) ) {\n\t\t$exclude = preg_replace( '/[^0-9,]+/', '', $exclude );\n\t\t$attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );\n\t}\n\telse {\n\t\t$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );\n\t}\n\n\tif ( empty($attachments) ) return '';\n\n\t// This is the custom stuff\n\n\t// Create the gallery content\n\t$return = '';\n\t$return .= '<div class=\"flexslider-wrapper\">';\n\t$return .= '<div class=\"flexslider\">';\n\t$return .= '<ul class=\"slides\">';\n\tforeach($attachments as $attachment){\n\t\t$return .= '<li>';\n\t\t$return .= apply_filters('origami_slide_before', '', $attachment, $target_blank);\n\t\t$return .= wp_get_attachment_image($attachment->ID, $size, false, array('class' => 'slide-image'));\n\t\tif($attachment->post_excerpt){\n\t\t\t$return .= '<div class=\"flex-caption\">' . $attachment->post_excerpt . '</div>';\n\t\t}\n\t\t$return .= apply_filters('origami_slide_after', '', $attachment, $target_blank);\n\t\t$return .= '</li>';\n\t}\n\t$return .= '</ul>';\n\t$return .= '</div>';\n\t$return .= '</div>';\n\n\treturn $return;\n}", "function showcaseGallery($groupId, $title) {\n\t$config = new ConfigReader();\n\t$config->loadConfigFile('assets/core/config/widgets/showGroup/gallery.properties');\n\t\n\t$maxDisplay = $config->readValue('maxDisplay');\n\t$maxPerRow = $config->readValue('maxPerRow');\n\t$w = $config->readValue('maxImageSizeX');\n\t$h = $config->readValue('maxImageSizeY');\n\t\n\t//if the user is not an admin, validate that the user is a member of this group\n\t$result = mysql_query(\"SELECT parentId, imageUrl FROM imagesGroups WHERE parentId = '{$groupId}' AND inSeriesImage = 1 ORDER BY RAND() LIMIT $maxDisplay\");\n\t$total = mysql_num_rows($result);\n\t\n\tif ($total > 0) {\n\t\t\n\t\t$urlCategory =urlencode($row->category);\n\t\t$caption = htmlentities($row->caption);\n\t\t\n\t\t$x = 0;\n\t\t$count = 0;\n\t\t\n\t\t//adjust maxPerRow is it's greater than the returned number of objects\n\t\tif ($maxPerRow > $total) {\n\t\t\t\n\t\t\t$maxPerRow = $total;\n\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"\t\t\t\t<div id=\\\"gallery_container\\\">\\n\";\n\t\t$return .= \"\t\t\t\t\t<div class=\\\"header\\\"><a href=\\\"/groupgalleries/id/$groupId\\\">$title</a></div>\\n\";\n\t\t$return .= \"\t\t\t\t\t<div class=\\\"body\\\">\\n\";\n\t\t\n\t\twhile ($row = mysql_fetch_object($result)) {\n\t\t\t\n\t\t\t//count this row's column itteration\n\t\t\t$x++;\n\t\t\t\n\t\t\t//keep track of total displayed so far\n\t\t\t$count++;\n\t\t\t\n\t\t\t//determine if separator class is applied\n\t\t\tif ($x % $maxPerRow != 0) {\n\t\t\t\t\n\t\t\t\t$separator = \" separator\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$separator = \"\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return .= \"<div class=\\\"gallery_image_container$separator\\\">\\n\";\n\t\t\t$return .= \"\t<a href=\\\"/groupgalleries/id/$groupId\\\"><img src=\\\"/file.php?load=$row->imageUrl&w=$w&h=$h\\\" border=\\\"0\\\"></a>\\n\";\n\t\t\t$return .= \"</div>\\n\";\n\t\t\t\n\t\t\t//row separator\n\t\t\tif ($x == $maxPerRow && $count < $total) {\n\t\t\t\t\n\t\t\t\t$return .= \"\t\t\t<div class=\\\"gallery_image_row_separator\\\"></div>\\n\";\n\t\t\t\t$x = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"\t\t\t\t\t</div>\\n\";\n\t\t$return .= \"\t\t\t\t</div>\\n\";\n\t\t\n\t}\t\n\t\n\treturn($return);\n\t\n}", "function filter_ptags_on_images($content){\n$content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\nreturn preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function listing_image_add_metabox () {\n\t\tadd_meta_box( 'listingimagediv', __( 'Image Containers Loop', 'text-domain' ), 'listing_image_metabox', 'product', 'side', 'low');\n\t}", "function ciniki_web_processBlockAsideImage(&$ciniki, $settings, $tnid, $block) {\n\n if( !isset($block['image_id']) ) {\n return array('stat'=>'ok', 'content'=>'');\n }\n\n $quality = 60;\n $width = 500;\n\n if( isset($settings['default-image-quality']) && $settings['default-image-quality'] > 0 ) {\n $quality = $settings['default-image-quality'];\n }\n if( isset($block['quality']) && $block['quality'] == 'high' ) {\n $quality = 90;\n $width = 1000;\n }\n if( isset($settings['default-image-width']) && $settings['default-image-width'] > $width ) {\n $width = $settings['default-image-width'];\n }\n\n\n //\n // Generate the image url\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'getScaledImageURL');\n $rc = ciniki_web_getScaledImageURL($ciniki, $block['image_id'], 'original', $width, 0, $quality);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $content = \"<aside><div \"\n . (isset($block['cssid']) && $block['cssid'] != '' ? \" id='\" . $block['cssid'] . \"'\" : '')\n . \"class='image-wrap'><div class='image'>\"\n . \"<img title='' alt=\\\"\" . (isset($block['title'])?preg_replace(\"/\\\"/\", \"&quot;\", $block['title']):'') . \"\\\" src='\" . $rc['url'] . \"' />\"\n . \"</div>\";\n if( isset($block['caption']) && $block['caption'] != '' ) {\n $content .= \"<div class='image-caption'>\" . $block['caption'] . \"</div>\";\n }\n $content .= \"</div></aside>\";\n\n //\n // Check if this image should be used as the primary when linked from other sites eg: facebook\n //\n if( isset($block['primary']) && $block['primary'] == 'yes' ) {\n $ciniki['response']['head']['og']['image'] = $rc['domain_url'];\n }\n\n return array('stat'=>'ok', 'content'=>$content);\n}", "public function render_content() { ?>\n\t\t\t<div class=\"image_checkbox_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php\t$chkbox_values = explode( ',', esc_attr( $this->value() ) ); ?>\n\t\t\t\t<input type=\"hidden\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-multi-image-checkbox\" <?php $this->link(); ?> />\n\t\t\t\t<?php foreach ( $this->choices as $key => $value ) { ?>\n\t\t\t\t\t<label class=\"checkbox-label\">\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( in_array( esc_attr( $key ), $chkbox_values, true ), 1 ); ?> class=\"multi-image-checkbox\"/>\n\t\t\t\t\t\t<img src=\"<?php echo esc_attr( $value['image'] ); ?>\" alt=\"<?php echo esc_attr( $value['name'] ); ?>\" title=\"<?php echo esc_attr( $value['name'] ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t<?php\t} ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "private function parse_html_images( $content ) {\n\n\t\t$images = array();\n\n\t\tif ( ! class_exists( 'DOMDocument' ) ) {\n\t\t\treturn $images;\n\t\t}\n\n\t\tif ( empty( $content ) ) {\n\t\t\treturn $images;\n\t\t}\n\n\t\t// Prevent DOMDocument from bubbling warnings about invalid HTML.\n\t\tlibxml_use_internal_errors( true );\n\n\t\t$post_dom = new DOMDocument();\n\t\t$post_dom->loadHTML( '<?xml encoding=\"' . $this->charset . '\">' . $content );\n\n\t\t// Clear the errors, so they don't get kept in memory.\n\t\tlibxml_clear_errors();\n\n\t\t/** @var DOMElement $img */\n\t\tforeach ( $post_dom->getElementsByTagName( 'img' ) as $img ) {\n\n\t\t\t$src = $img->getAttribute( 'src' );\n\n\t\t\tif ( empty( $src ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$class = $img->getAttribute( 'class' );\n\n\t\t\tif ( // This detects WP-inserted images, which we need to upsize. R.\n\t\t\t\t! empty( $class )\n\t\t\t\t&& false === strpos( $class, 'size-full' )\n\t\t\t\t&& preg_match( '|wp-image-(?P<id>\\d+)|', $class, $matches )\n\t\t\t\t&& get_post_status( $matches['id'] )\n\t\t\t) {\n\t\t\t\t$src = $this->image_url( $matches['id'] );\n\t\t\t}\n\n\t\t\t$src = $this->get_absolute_url( $src );\n\n\t\t\tif ( strpos( $src, $this->host ) === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $src !== esc_url( $src ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$images[] = array(\n\t\t\t\t'src' => $src,\n\t\t\t\t'title' => $img->getAttribute( 'title' ),\n\t\t\t\t'alt' => $img->getAttribute( 'alt' ),\n\t\t\t);\n\t\t}\n\n\t\treturn $images;\n\t}", "function newenglish_embed_wrap($cache) {\n return '<div class=\"entry-content-asset\">' . $cache . '</div>';\n}", "function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}", "function cs_target_image($size=medium,$num=1,$lighbox=1) {\n\tif ( $images = get_children(array(\n\t\t'post_parent' => get_the_ID(),\n\t\t'post_type' => 'attachment',\n\t\t'numberposts' => $num,\n\t\t'order' => 'DESC',\n\t\t'orderby' => 'menu_order ID',\n\t\t'post_mime_type' => 'image',)))\n\t{\n\t\tforeach( $images as $image ) {\n\t\t\t$attachmenturl=wp_get_attachment_url($image->ID);\n\t\t\t$attachmentimage=wp_get_attachment_link($image->ID, $size );\n\t\t\t$img_title = $image->post_title;\n\t\t\t$img_desc = $image->post_content;\n\t\t\t$img_capt = $image->post_excerpt;\n\t\t\techo \"\\n\";\n\t\t\techo \"\\t<div class='cs-main-image'>\".$attachmentimage.\"</div>\\n\";\n\t\t\techo \"\\t\\t<p class='cs-main-description'>\" . $img_desc . \"</p>\\n\";\n\t\t\techo \"\\t\\t<p class='cs-main-caption'>\" . $img_capt . \"</p>\\n\";\n\t\t}\n\t} else {\n\t\techo \"No Image\";\n\t}\n}" ]
[ "0.70296353", "0.62475896", "0.6192706", "0.61710554", "0.60392153", "0.5983281", "0.58517945", "0.5844741", "0.57071084", "0.5691835", "0.5685138", "0.56612575", "0.56366354", "0.56049633", "0.5560673", "0.55400383", "0.55104524", "0.55083305", "0.5495247", "0.54838276", "0.5476866", "0.54665107", "0.5464913", "0.54628134", "0.5456346", "0.5453455", "0.5450661", "0.5449952", "0.543047", "0.5412088", "0.5406387", "0.54011065", "0.5397719", "0.5393624", "0.53824806", "0.5375387", "0.5370233", "0.5369099", "0.5348673", "0.53437364", "0.5343153", "0.5329649", "0.5316729", "0.53160644", "0.5308255", "0.5297958", "0.5294903", "0.52890646", "0.5269517", "0.5259625", "0.52529496", "0.524854", "0.52459145", "0.52432007", "0.5241222", "0.5224778", "0.52098846", "0.5208737", "0.5208194", "0.520406", "0.520257", "0.5198935", "0.51984537", "0.5198256", "0.5192223", "0.5188634", "0.51857793", "0.51843023", "0.5182984", "0.51720065", "0.5171706", "0.51676077", "0.5164963", "0.5162291", "0.5162291", "0.51605976", "0.5157083", "0.51504666", "0.5146537", "0.51407456", "0.5135788", "0.5134135", "0.5131216", "0.5130998", "0.5117648", "0.5108167", "0.51055735", "0.51032734", "0.50984997", "0.5094669", "0.50946665", "0.5094493", "0.5092187", "0.5087048", "0.50866365", "0.5085054", "0.5079666", "0.50745964", "0.50732315", "0.50622594" ]
0.7396228
0
\ FEATURED CONTENT CHECKBOX \
function sm_custom_meta() { add_meta_box('sm_meta', __( 'Post Destacado', 'sm-textdomain' ), 'sm_meta_callback', 'post' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }", "function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}", "function theme_simple_features_checkbox_element($variables) {\n $element = $variables['element'];\n // This is also used in the installer, pre-database setup.\n $t = get_t();\n\n // Add element's #type and #name as class to aid with JS/CSS selectors.\n $class = array('form-item');\n if (!empty($element['#type'])) {\n $class[] = 'form-type-' . strtr($element['#type'], '_', '-');\n }\n if (!empty($element['#name'])) {\n $class[] = 'form-item-' . strtr($element['#name'], array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));\n }\n\n // If #title is not set, we don't display any label or required marker.\n if (!isset($element['#title'])) {\n $element['#title_display'] = 'none';\n }\n\n $output = '<div class=\"' . implode(' ', $class) . '\">' . \"\\n\";\n\n $output .= ' <div class=\"features-checkbox\">';\n $output .= ' ' . $element['#children'];\n $output .= \" </div>\\n\";\n\n // Add preview image.\n $output .= theme('simple_features_preview_image', array('path' => $element['#preview_image'], 'width' => 194, 'height' => 144));\n\n // Add more details.\n $output .= ' <div class=\"features-detail\">';\n $output .= ' ' . theme('form_element_label', $variables) . \"\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n // Print price.\n $output .= theme('simple_features_price', array('price' => $element['#price']));\n\n // Sample content links.\n $output .= theme('simple_features_sample_links', array('links' => $element['#sample_links']));\n\n $output .= \" </div>\\n\";\n $output .= \"</div>\\n\";\n\n return $output;\n}", "function wpzoom_page_options() {\n global $post;\n\n ?>\n <fieldset>\n <p class=\"wpz_border\">\n <?php $isChecked = ( get_post_meta($post->ID, 'wpzoom_is_featured', true) == 1 ? 'checked=\"checked\"' : '' ); // we store checked checkboxes as 1 ?>\n <input type=\"checkbox\" name=\"wpzoom_is_featured\" id=\"wpzoom_is_featured\" value=\"1\" <?php echo esc_attr($isChecked); ?> /> <label for=\"wpzoom_is_featured\"><?php _e('Feature in Homepage Slider', 'wpzoom'); ?></label>\n </p>\n\n </fieldset>\n <?php\n}", "public function hookConfigForm()\n {\n?>\n<div class=\"field\">\n <label for=\"collection_tree_alpha_order\">Order the collection tree alphabetically?</label>\n <div class=\"inputs\">\n <?php echo __v()->formCheckbox('collection_tree_alpha_order', \n null, \n array('checked' => (bool) get_option('collection_tree_alpha_order'))); ?>\n <p class=\"explanation\">This does not affect the order of the collections \n browse page.</p>\n </div>\n</div>\n<?php\n }", "function wpzoom_post_embed_info() {\n global $post;\n\n ?>\n <fieldset>\n\n <?php if (option::get('featured_type') == 'Featured Posts') { ?>\n\n <p class=\"wpz_border\">\n <?php $isChecked = ( get_post_meta($post->ID, 'wpzoom_is_featured', true) == 1 ? 'checked=\"checked\"' : '' ); // we store checked checkboxes as 1 ?>\n <input type=\"checkbox\" name=\"wpzoom_is_featured\" id=\"wpzoom_is_featured\" value=\"1\" <?php echo esc_attr($isChecked); ?> /> <label for=\"wpzoom_is_featured\"><?php _e('Feature in Homepage Slider', 'wpzoom'); ?></label>\n </p>\n\n <hr />\n\n <?php } ?>\n\n </fieldset>\n <?php\n}", "function checkbox_init(){\n add_meta_box(\"closing\", \"Closed ?\", \"closing\", \"closings\", \"normal\", \"high\");\n add_meta_box(\"delayed\", \"Delayed / Message ?\", \"delayed\", \"closings\", \"normal\", \"high\");\n add_meta_box(\"message_delayed\", \"Message:\", \"message_delayed\", \"closings\", \"normal\", \"high\");\n}", "function theme_webform_edit_file($form) {\r\n $javascript = '\r\n <script type=\"text/javascript\">\r\n function check_category_boxes () {\r\n var checkValue = !document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[1]).checked;\r\n for(var i=1; i < arguments.length; i++) {\r\n document.getElementById(\"edit-extra-filtering-types-\"+arguments[0]+\"-\"+arguments[i]).checked = checkValue;\r\n }\r\n }\r\n </script>\r\n ';\r\n drupal_set_html_head($javascript);\r\n\r\n // Format the components into a table.\r\n $per_row = 5;\r\n $rows = array();\r\n foreach (element_children($form['extra']['filtering']['types']) as $key => $filtergroup) {\r\n $row = array();\r\n $first_row = count($rows);\r\n if ($form['extra']['filtering']['types'][$filtergroup]['#type'] == 'checkboxes') {\r\n // Add the title.\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n $row[] = '&nbsp;';\r\n // Convert the checkboxes into individual form-items.\r\n $checkboxes = expand_checkboxes($form['extra']['filtering']['types'][$filtergroup]);\r\n // Render the checkboxes in two rows.\r\n $checkcount = 0;\r\n $jsboxes = '';\r\n foreach (element_children($checkboxes) as $key) {\r\n $checkbox = $checkboxes[$key];\r\n if ($checkbox['#type'] == 'checkbox') {\r\n $checkcount++;\r\n $jsboxes .= \"'\". $checkbox['#return_value'] .\"',\";\r\n if ($checkcount <= $per_row) {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n elseif ($checkcount == $per_row + 1) {\r\n $rows[] = array('data' => $row, 'style' => 'border-bottom: none;');\r\n $row = array(array('data' => '&nbsp;'), array('data' => '&nbsp;'));\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n else {\r\n $row[] = array('data' => drupal_render($checkbox));\r\n }\r\n }\r\n }\r\n // Pretty up the table a little bit.\r\n $current_cell = $checkcount % $per_row;\r\n if ($current_cell > 0) {\r\n $colspan = $per_row - $current_cell + 1;\r\n $row[$current_cell + 1]['colspan'] = $colspan;\r\n }\r\n // Add the javascript links.\r\n $jsboxes = drupal_substr($jsboxes, 0, drupal_strlen($jsboxes) - 1);\r\n $rows[] = array('data' => $row);\r\n $select_link = ' <a href=\"javascript:check_category_boxes(\\''. $filtergroup .'\\','. $jsboxes .')\">(select)</a>';\r\n $rows[$first_row]['data'][1] = array('data' => $select_link, 'width' => 40);\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n }\r\n elseif ($filtergroup != 'size') {\r\n // Add other fields to the table (ie. additional extensions).\r\n $row[] = $form['extra']['filtering']['types'][$filtergroup]['#title'];\r\n unset($form['extra']['filtering']['types'][$filtergroup]['#title']);\r\n $row[] = array(\r\n 'data' => drupal_render($form['extra']['filtering']['types'][$filtergroup]),\r\n 'colspan' => $per_row + 1,\r\n );\r\n unset($form['extra']['filtering']['types'][$filtergroup]);\r\n $rows[] = array('data' => $row);\r\n }\r\n }\r\n $header = array(array('data' => t('Category'), 'colspan' => '2'), array('data' => t('Types'), 'colspan' => $per_row));\r\n\r\n // Create the table inside the form.\r\n $form['extra']['filtering']['types']['table'] = array(\r\n '#value' => theme('table', $header, $rows)\r\n );\r\n\r\n $output = drupal_render($form);\r\n\r\n // Prefix the upload location field with the default path for webform.\r\n $output = str_replace('Upload Directory: </label>', 'Upload Directory: </label>'. file_directory_path() .'/webform/', $output);\r\n\r\n return $output;\r\n}", "function checkbox($args = '', $checked = false) {\r\n $defaults = array('name' => '', 'id' => false, 'class' => false, 'group' => '', 'special' => '', 'value' => '', 'label' => false, 'maxlength' => false);\r\n extract(wp_parse_args($args, $defaults), EXTR_SKIP);\r\n\r\n $return = '';\r\n // Get rid of all brackets\r\n if (strpos(\"$name\", '[') || strpos(\"$name\", ']')) {\r\n $replace_variables = array('][', ']', '[');\r\n $class_from_name = $name;\r\n $class_from_name = \"wpi_\" . str_replace($replace_variables, '_', $class_from_name);\r\n } else {\r\n $class_from_name = \"wpi_\" . $name;\r\n }\r\n // Setup Group\r\n $group_string = '';\r\n if ($group) {\r\n if (strpos($group, '|')) {\r\n $group_array = explode(\"|\", $group);\r\n $count = 0;\r\n foreach ($group_array as $group_member) {\r\n $count++;\r\n if ($count == 1) {\r\n $group_string .= \"$group_member\";\r\n } else {\r\n $group_string .= \"[$group_member]\";\r\n }\r\n }\r\n } else {\r\n $group_string = \"$group\";\r\n }\r\n }\r\n // Use $checked to determine if we should check the box\r\n $checked = strtolower($checked);\r\n if ($checked == 'yes' ||\r\n $checked == 'on' ||\r\n $checked == 'true' ||\r\n ($checked == true && $checked != 'false' && $checked != '0')) {\r\n $checked = true;\r\n } else {\r\n $checked = false;\r\n }\r\n $id = ($id ? $id : $class_from_name);\r\n $insert_id = ($id ? \" id='$id' \" : \" id='$class_from_name' \");\r\n $insert_name = ($group_string ? \" name='\" . $group_string . \"[$name]' \" : \" name='$name' \");\r\n $insert_checked = ($checked ? \" checked='checked' \" : \" \");\r\n $insert_value = \" value=\\\"$value\\\" \";\r\n $insert_class = \" class='$class_from_name $class wpi_checkbox' \";\r\n $insert_maxlength = ($maxlength ? \" maxlength='$maxlength' \" : \" \");\r\n // Determine oppositve value\r\n switch ($value) {\r\n case 'yes':\r\n $opposite_value = 'no';\r\n break;\r\n case 'true':\r\n $opposite_value = 'false';\r\n break;\r\n }\r\n // Print label if one is set\r\n if ($label)\r\n $return .= \"<label for='$id'>\";\r\n // Print hidden checkbox\r\n $return .= \"<input type='hidden' value='$opposite_value' $insert_name />\";\r\n // Print checkbox\r\n $return .= \"<input type='checkbox' $insert_name $insert_id $insert_class $insert_checked $insert_maxlength $insert_value $special />\";\r\n if ($label)\r\n $return .= \" $label</label>\";\r\n return $return;\r\n }", "function render_checkbox( $args ) {\n\t\t\t$optionValue = Link_WP_LinkID::get_option_value( $args['key'] );\n\t\t\t$checked = $optionValue === null ? '' : checked( 1, $optionValue, false );\n\n\t\t\t?>\n\t\t\t<input type=\"checkbox\" value=\"1\"\n\t\t\t name=\"<?php echo \"link_linkid_settings[\" . $args['key'] . \"]\" ?>\" <?php echo $checked ?>>\n\t\t\t<p class=\"description\"><?php echo $args[\"description\"] ?></p>\n\t\t\t<?php\n\t\t}", "function clix_uppe_meta_box(){\r\n\tglobal $post;\r\n\t// Use nonce for verification\r\n\techo '<input type=\"hidden\" name=\"clix_uppe_nonce\" id=\"clix_uppe_nonce\" value=\"' .\r\n\twp_create_nonce( plugin_basename(__FILE__) ) . '\" />';\r\n\t// Output checkboxes\r\n\t$options = array(\r\n\t\t'disable_home' \t\t\t=> 'Disable Listing on Home Page',\r\n\t\t'disable_tag' \t\t\t=> 'Disable on Tag Listings',\r\n\t\t'disable_archive' \t\t=> 'Disable Listing in Archives',\r\n\t\t'disable_search' \t\t=> 'Disable Listing in Search',\r\n\t\t'disable_unlesslogin' \t=> 'Disable Listing for Users Not Logged In',\r\n\t\t'disable_unlessshow'\t=> 'Disable but show available if Logged In'\r\n\t\t);\r\n\tforeach( $options as $option=>$legend ){\r\n?>\r\n<label for=\"clix_uppe_<?php echo $option; ?>\">\r\n\t<input type=\"checkbox\" name=\"_clix_uppe_<?php echo $option; ?>\" id=\"clix_uppe_<?php echo $option; ?>\" <?php\r\n\t\tif ( get_post_meta( $post->ID, \"_clix_uppe_$option\", true ) == '1' )\r\n\t\t\techo ' checked=\"checked\"';\r\n\t?>/>\r\n\t<?php echo $legend; ?>\r\n</label>\r\n<br /><?php\r\n\t}\r\n}", "public function render_content() { ?>\n\t\t\t<div class=\"image_checkbox_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php\t$chkbox_values = explode( ',', esc_attr( $this->value() ) ); ?>\n\t\t\t\t<input type=\"hidden\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-multi-image-checkbox\" <?php $this->link(); ?> />\n\t\t\t\t<?php foreach ( $this->choices as $key => $value ) { ?>\n\t\t\t\t\t<label class=\"checkbox-label\">\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( in_array( esc_attr( $key ), $chkbox_values, true ), 1 ); ?> class=\"multi-image-checkbox\"/>\n\t\t\t\t\t\t<img src=\"<?php echo esc_attr( $value['image'] ); ?>\" alt=\"<?php echo esc_attr( $value['name'] ); ?>\" title=\"<?php echo esc_attr( $value['name'] ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t<?php\t} ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public static function renderCheckbox();", "abstract public function checkboxOnClick();", "function check ( $id , $texto , $plus = \"\" , $size = 3 ) {\r\n if ( is_numeric ( $plus ) ) {\r\n $size = $plus;\r\n $plus = '';\r\n }\r\n conf::$pkj_uid_comp ++;\r\n\r\n $idREF = \"pkj\" . conf::$pkj_uid_comp;\r\n $value = \"value = '$texto'\";\r\n\r\n if ( contains ( $plus , \"value\" ) ) {\r\n $value = \"\"; //melhor ficar quieto\r\n }\r\n $html = \"<label onclick='$(\\\"input[data-pkj-id=\\\\\\\"{$idREF}\\\\\\\"]\\\").trigger(\\\"click\\\")' style='margin-top:5px'><input data-pkj-id='$idREF' name='$id' type='checkbox' $value $plus /> {$texto}</label>\";\r\n echo div ( $html , $size );\r\n}", "public function render_content() {\n\t\t\t$reordered_choices = array();\n\t\t\t$saved_choices = explode( ',', esc_attr( $this->value() ) );\n\n\t\t\t// Order the checkbox choices based on the saved order\n\t\t\tif ( $this->sortable ) {\n\t\t\t\tforeach ( $saved_choices as $key => $value ) {\n\t\t\t\t\tif ( isset( $this->choices[ $value ] ) ) {\n\t\t\t\t\t\t$reordered_choices[ $value ] = $this->choices[ $value ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$reordered_choices = array_merge( $reordered_choices, array_diff_assoc( $this->choices, $reordered_choices ) );\n\t\t\t} else {\n\t\t\t\t$reordered_choices = $this->choices;\n\t\t\t}\n\t\t\t?>\n\t\t\t<div class=\"pill_checkbox_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<input type=\"hidden\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-sortable-pill-checkbox\" <?php $this->link(); ?> />\n\t\t\t\t<div class=\"sortable_pills<?php echo ( $this->sortable ? ' sortable' : '' ) . ( $this->fullwidth ? ' fullwidth_pills' : '' ); ?>\">\n\t\t\t\t<?php foreach ( $reordered_choices as $key => $value ) { ?>\n\t\t\t\t\t<label class=\"checkbox-label\">\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( in_array( esc_attr( $key ), $saved_choices, true ), true ); ?> class=\"sortable-pill-checkbox\"/>\n\t\t\t\t\t\t<span class=\"sortable-pill-title\"><?php echo esc_attr( $value ); ?></span>\n\t\t\t\t\t\t<?php if ( $this->sortable && $this->fullwidth ) { ?>\n\t\t\t\t\t\t\t<span class=\"dashicons dashicons-sort\"></span>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t</label>\n\t\t\t\t<?php\t} ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "function drawOptionLeftWork() {\r\n global $saveShowWork;?>\r\n <table width=\"100%\">\r\n <tr class=\"checkboxLabel\">\r\n <td >\r\n <?php echo ucfirst(i18n(\"labelShowLeftWork\".((isNewGui()?'':'Short'))));?>\r\n </td>\r\n <td style=\"width:36px\">\r\n <div title=\"<?php echo i18n('showLeftWork')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowLeftWork\" name=\"listShowLeftWork\" class=\"whiteCheck\"\r\n <?php if ($saveShowWork=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowWork',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div>&nbsp;\r\n </td>\r\n </tr>\r\n </table>\r\n<?php \r\n}", "function ed_setting_show_editor_callback(){\n\techo '<input\n\tname=\"ed_setting_show_editor\"\n\tid=\"ed_setting_show_editor\"\n\ttype=\"checkbox\"\n\tvalue=\"1\"\n\tclass=\"code\"\n\n\t' . checked(1, get_option('ed_setting_show_editor'), false).' />\n\tChoose if details should be in editor';\n}", "function acf_checkbox_input($attrs = array())\n{\n}", "function classiera_featured_post(){\r\n\tglobal $post;\r\n\t\r\n\t// Noncename needed to verify where the data originated\r\n\techo '<input type=\"hidden\" name=\"eventmeta_noncename\" id=\"eventmeta_noncename\" value=\"' . \r\n\twp_create_nonce( plugin_basename(__FILE__) ) . '\" />';\r\n\t\r\n\t// Get the location data if its already been entered\r\n\t$featured_post = get_post_meta($post->ID, 'featured_post', true);\r\n\t\r\n\t// Echo out the field\r\n\techo '<span class=\"text overall\" style=\"margin-right: 20px;\">Check to have this as featured post:</span>';\r\n\t\r\n\t$checked = get_post_meta($post->ID, 'featured_post', true) == '1' ? \"checked\" : \"\";\r\n\t\r\n\techo '<input type=\"checkbox\" name=\"featured_post\" id=\"featured_post\" value=\"1\" '. $checked .'/>';\r\n\r\n}", "function tbc_swiper_custom_box_html( $post ) {\n $swiper_value = get_post_meta( $post->ID, '_swiper_meta_key', true );\n ?>\n <p class=\"meta-options\">\n\t <label for=\"swiper_status\" class=\"selectit\"><input name=\"swiper_status\" type=\"checkbox\" id=\"swiper_status\" value=\"open\" <?php checked( $swiper_value, 'open' ); ?> /> <?php _e( 'Enable SwiperJS' ); ?></label><br />\n </p>\n\t<?php\n}", "function construction_realestate_posttype_cs_meta_callback( $post ) {\n wp_nonce_field( basename( __FILE__ ), 'construction_realestate_posttype_cs_nonce' );\n $cs_stored_meta = get_post_meta( $post->ID );\n ?>\n\t<div id=\"agent_custom_stuff\">\n <div class=\"Checkbox-home\">\n\t <label for=\"show_home\"><?php esc_html_e( 'Show it on home page' ); ?></label><?php \n\t \t$construction_realestate_posttype_upcars_status=get_post_meta($post->ID, \"construction_realestate_posttype_agents_featured\", true); \n\t \tif($construction_realestate_posttype_upcars_status==1){ ?>\n\t\t \t\t<input type=\"checkbox\" checked=\"checked\" name=\"construction_realestate_posttype\" id=\"construction_realestate_posttype_agents_featured\" ><?php\n\t\t \t}else{ ?>\t\n\t\t \t\t<input type=\"checkbox\" name=\"construction_realestate_posttype_agents_featured\" id=\"construction_realestate_posttype_agents_featured\" ><?php\n\t\t \t} ?>\t\n </div>\n\t</div>\n <?php\n}", "function ffw_port_checkbox_callback( $args ) {\n global $ffw_port_settings;\n\n $checked = isset($ffw_port_settings[$args['id']]) ? checked(1, $ffw_port_settings[$args['id']], false) : '';\n $html = '<input type=\"checkbox\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" value=\"1\" ' . $checked . '/>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}", "function ifWrap($content) {\n // If all checkboxes unchecked, don't need to wrap\n if (is_main_query() AND is_single() AND \n (\n get_option('wcp_wordcount', '1') OR \n get_option('wcp_charcount', '1') OR \n get_option('wcp_readtime', '1')\n )) {\n return $this->createHTML($content);\n }\n return $content;\n }", "public function AddCheckboxToComment()\n\t{\n\t\t$checked = get_option($this->GrOptionDbPrefix . 'comment_checked');\n\t\t?>\n\t\t<p>\n\t\t\t<input class=\"GR_checkbox\" value=\"1\" id=\"gr_comment_checkbox\" type=\"checkbox\" name=\"gr_comment_checkbox\"\n\t\t\t\t <?php if ($checked)\n\t\t\t\t { ?>checked=\"checked\"<?php } ?>/>\n\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'comment_label'); ?>\n\t\t</p><br/>\n\t\t<?php\n\t}", "function output_checkbox_row( string $label, string $key, bool $checked = false ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t?>\n\t<div class=\"wpinc-meta-field-single checkbox\">\n\t\t<label>\n\t\t\t<span class=\"checkbox\"><input <?php name_id( $key ); ?> type=\"checkbox\" <?php echo esc_attr( $checked ? 'checked' : '' ); ?>></span>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t</label>\n\t</div>\n\t<?php\n}", "public function AddCheckboxToBpRegistrationPage()\n\t{\n\t\t$bp_checked = get_option($this->GrOptionDbPrefix . 'bp_registration_checked');\n\t\t?>\n\t\t<div class=\"gr_bp_register_checkbox\">\n\t\t\t<label>\n\t\t\t\t<input class=\"input-checkbox GR_bpbox\" value=\"1\" id=\"gr_bp_checkbox\" type=\"checkbox\"\n\t\t\t\t name=\"gr_bp_checkbox\" <?php if ($bp_checked)\n\t\t\t\t{ ?> checked=\"checked\"<?php } ?> />\n\t\t\t\t<span\n\t\t\t\t\tclass=\"gr_bp_register_label\"><?php echo get_option($this->GrOptionDbPrefix . 'bp_registration_label'); ?></span>\n\t\t\t</label>\n\t\t</div>\n\t\t<?php\n\t}", "function wpct_menu_checkbox_render ( $args ) {\n\t\t$settings = get_option( 'wpct_settings' );\n\t\tob_start();\n\t\tinclude( plugin_dir_path(__FILE__).\"/templates/tpl-checkbox-render.php\" );\n\t\techo ob_get_clean();\n\t}", "public function AddCheckboxToCheckoutPage()\n\t{\n\t\t$checked = get_option($this->GrOptionDbPrefix . 'checkout_checked');\n\t\t?>\n\t\t<p class=\"form-row form-row-wide\">\n\t\t\t<input class=\"input-checkbox GR_checkoutbox\" value=\"1\" id=\"gr_checkout_checkbox\" type=\"checkbox\"\n\t\t\t name=\"gr_checkout_checkbox\" <?php if ($checked)\n\t\t\t { ?>checked=\"checked\"<?php } ?> />\n\t\t\t<label for=\"gr_checkout_checkbox\" class=\"checkbox\">\n\t\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'checkout_label'); ?>\n\t\t\t</label>\n\t\t</p>\n\t\t<?php\n\t}", "function idem_pop_up_inner_meta_box_cb( $post )\n{ \n $checked = ($post->ID == getDefault() ) ? \"checked\" : \"\";\n $check = \"<label>Par default</label><input type='checkbox' \" . $checked . \" name='idem_pop_up_default' value='1' >\";\n echo $check;\n}", "function collapsiblebox ($name, $title, $help, $needed=false, $collapsed=false, $width=100, $title2=false) {\n\n echo '<div class=\"elgg-module elgg-module elgg-module-widget elgg-widget-instance-online_users\" style=\"float:left;width:'.$width.'%;\">';\n echo '<div class=\"elgg-head\">';\n echo '<div class=\"elgg-widget-handle clearfix\">';\n if ($title) {\n echo '<h3><a href=\"#' . $name . '\" rel=\"toggle\">';\n echo elgg_echo($title);\n if ($needed) {\n echo elgg_echo('resume:*');\n }\n echo '</a></h3>';\n if ($title2) {\n echo '<div style=\"position:relative;float:right;padding-top:4px;margin-right:40px;\">';\n echo $title2;\n echo '</div>';\n }\n }\n echo '<ul class=\"elgg-menu elgg-menu-widget elgg-menu-hz elgg-menu-widget-default\">';\n echo '<li class=\"elgg-menu-item-collapse\"><a href=\"#' . $name . '\" class=\"elgg-widget-collapse-button\" rel=\"toggle\"> </a></li>';\n if ($help) {\n echo '<li class=\"elgg-menu-item-settings\"><a href=\"#help-' . $name . '\" title=\"Help\" class=\"elgg-widget-edit-button\" rel=\"toggle\"><span class=\"elgg-icon elgg-icon-settings-alt \"></span></a></li>';\n }\n echo '</ul>';\n echo '</div></div>';\n echo '<div class=\"elgg-body\">';\n if ($collapsed) $hidden = \"hidden\";\n echo '<div class=\"elgg-widget-content ' . $hidden . '\" id=\"' . $name . '\">';\n if ($help) {\n echo '<div class=\"hidden clearfix\" id=\"help-' . $name . '\">';\n echo elgg_echo($help);;\n echo '</div>';\n }\n\n}", "function wpopal_themer_enable_faq_callback()\r\n{\r\n\t$options = get_option( 'wpopal_themer_posttype' );\r\n printf(\r\n '<input type=\"checkbox\" id=\"enable_faq\" name=\"wpopal_themer_posttype[enable_faq]\" %s />',\r\n isset( $options['enable_faq'] ) && $options['enable_faq'] ? 'checked=\"checked\"' : ''\r\n );\r\n}", "function checkbox_control_display($form, $mform, $customdata, $field, $as_filter = false, $contextname = 'system') {\n if (!($form instanceof moodleform)) {\n $mform = $form;\n $form->_customdata = null;\n }\n $manual = new field_owner($field->owners['manual']);\n $manual_params = unserialize($manual->params);\n if (!empty($manual_params['options_source']) || !empty($manual_params['options'])) {\n if ($as_filter || $field->multivalued) {\n// require_once(CURMAN_DIRLOCATION.'/plugins/manual/field_controls/menu.php');\n require_once elis::plugin_file('elisfields_manual', 'field_controls/menu.php');\n return menu_control_display($form, $mform, $customdata, $field, $as_filter);\n }\n $options = array();\n if (!empty($manual_params['options'])) {\n $options = explode(\"\\n\", $manual_params['options']);\n }\n $source = '';\n if (!empty($manual_params['options_source'])) {\n $source = $manual_params['options_source'];\n }\n if (!empty($source)) {\n $srcfile = elis::plugin_file('elisfields_manual', \"sources/{$source}.php\");\n if (file_exists($srcfile)) {\n require_once elis::plugin_file('elisfields_manual','sources.php');\n require_once($srcfile);\n $classname = \"manual_options_{$source}\";\n $plugin = new $classname();\n if ($plugin && $plugin->is_applicable($contextname)) {\n $options = $plugin->get_options($customdata);\n }\n }\n }\n $controls = array();\n foreach ($options as $option) {\n $option = trim($option);\n if ($field->multivalued) {\n // FIXME: this doesn't work\n $cb = $controls[] = &$mform->createElement('checkbox', \"field_{$field->shortname}\", null, $option);\n $cb->updateAttributes(array('value'=>$option));\n } else {\n $controls[] = &$mform->createElement('radio', \"field_{$field->shortname}\", null, $option, $option);\n }\n }\n $mform->addGroup($controls, \"field_{$field->shortname}\", $field->name, '<br />', false);\n } else {\n $checkbox = $mform->addElement('advcheckbox', \"field_{$field->shortname}\", $field->name);\n }\n manual_field_add_help_button($mform, \"field_{$field->shortname}\", $field);\n}", "public function callback_checkbox( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n\n $html_condtions = '';\n\n if ( isset($args['conditions']) && $args['conditions'] === true ) {\n $name_id .= '[value]';\n $value = isset($value['value']) ? $value['value'] : 'off';\n $args['name_id'] .= '[options]';\n $html_condtions = $this->get_field_conditions_modal( $args );\n }\n\n $html = '<fieldset>';\n $html .= sprintf( '<label for=\"wpuf-%1$s\">', $name_id );\n $html .= sprintf( '<input type=\"hidden\" name=\"%1$s\" value=\"off\" />', $name_id );\n $html .= sprintf( '<input type=\"checkbox\" class=\"checkbox\" id=\"wpuf-%1$s\" name=\"%1$s\" value=\"on\" %2$s %3$s/>', $name_id, checked( $value, 'on', false ), $disable );\n $html .= sprintf( '%1$s</label>', $args['desc'] );\n $html .= $html_condtions;\n $html .= '</fieldset>';\n\n echo $html;\n }", "public function render_content()\n {\n CustomizerAddon::view( 'controls.switch', ['control' => &$this] );\n }", "public function form_field_checkbox ( $args ) {\n\t\t$options = $this->get_settings();\n\n\t\t$has_description = false;\n\t\tif ( isset( $args['data']['description'] ) ) {\n\t\t\t$has_description = true;\n\t\t\techo '<label for=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\">' . \"\\n\";\n\t\t}\n\t\techo '<input id=\"' . $args['key'] . '\" name=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\" type=\"checkbox\" value=\"1\"' . checked( esc_attr( $options[$args['key']] ), '1', false ) . ' />' . \"\\n\";\n\t\tif ( $has_description ) {\n\t\t\techo $args['data']['description'] . '</label>' . \"\\n\";\n\t\t}\n\t}", "function wpct_settings_section_render( $args ) {\n\t\techo __(\"Select checkboxes below for any toolbar sections to hide for the {$args['title']} role.\");\n\t}", "function callback_checkbox(array $args)\n {\n }", "private function display_checkbox_field($name, $value) {\n?>\n<input type=\"checkbox\" name=\"<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]\" id=\"http_authentication_<?php echo htmlspecialchars($name); ?>\"<?php if ($value) echo ' checked=\"checked\"' ?> value=\"1\" /><br />\n<?php\n }", "function acf_get_checkbox_input($attrs = array())\n{\n}", "function learndash_plus_page_box( $post ) {\r\n\r\n\t// Use nonce for verification\r\n\twp_nonce_field( plugin_basename( __FILE__ ), 'learndash_plus_nonce' );\r\n\r\n\t// The actual fields for data entry\r\n\t// Use get_post_meta to retrieve an existing value from the database and use the value for the form\r\n\r\n\t$data = get_post_meta( $post->ID, $key = '_learndash_plus', $single = true );\r\n\r\n\t$protect_checked = !empty($data['protect'])? \"CHECKED\":\"\";\r\n\t$showlevels = !empty($data['protect'])? \"display:block;\":\"display:none;\";\r\n\t\r\n\t$selectedlevels = !empty($data['selectedlevels'])? $data['selectedlevels']:array();\r\n\r\n\t$levels = learndash_plus_get_levels();\r\n\t\r\n\t?>\r\n\t<script>\r\n\tfunction ld_mem_showhide()\r\n\t{\r\n\t\tvar protect = document.getElementById('learndash_plus_protect').checked;\r\n\t\tif(protect)\r\n\t\tdocument.getElementById('learndash_plus_levels').style.display = \"block\";\r\n\t\telse\r\n\t\tdocument.getElementById('learndash_plus_levels').style.display = \"none\";\r\n\t}\r\n\t</script>\r\n\t<label for=\"learndash_plus_protect\">\r\n <b><?php echo _e(\"Enable protection for this post \", 'learndash-plus' ); ?> </b> \r\n\t</label>\r\n\t<input type=\"checkbox\" id=\"learndash_plus_protect\" name=\"learndash_plus_protect\" <?php echo $protect_checked; ?> onClick=\"ld_mem_showhide();\"/>\r\n\t<br><br>\r\n\t<div id=\"learndash_plus_levels\" style=\"<?php echo $showlevels; ?>\">\r\n\t<label for=\"learndash_plus_levels\">\r\n <b><?php echo _e(\"Allow access to \", 'learndash-plus' ); ?> </b> \r\n\t</label>\r\n\t<br><br>\r\n\t\t<div style=' margin-left: 10px;'>\r\n\t\t<?php foreach($levels as $level) { \r\n\t\t\t$checked = in_array($level['id'],$selectedlevels)? 'checked=\"checked\"':\"\";\r\n\t\t?>\r\n\t\t<input type=\"checkbox\" name=\"learndash_plus_levels[<?php echo $level['id']; ?>]\" <?php echo $checked; ?> /> <?php echo $level['name']; ?><br>\r\n\t\t<?php } ?>\r\n\t\t</div>\r\n\t</div>\r\n\t<?php \r\n}", "function bb_hello_world_init(){\n if (!is_admin()){\n //loads the state of Form Item One into a variable\n $hello_world= get_option('item_one');\n //if the box is checked, it will return a value of \"1\"\n //if the box is not checked, it will return a value of \"false\"\n if ($hello_world == 1){ \n \n //simple Genesis hook to echo \"Hello World\" above the content area\n //note: if you do not use Genesis, you can still use this method\n //you just need to find a relevant hook for your theme or Framework\n add_action('genesis_before_content','hello_world');\n}\n }\n}", "function audioman_is_featured_content_active( $control ) {\n\t\t$enable = $control->manager->get_setting( 'audioman_featured_content_option' )->value();\n\n\t\treturn ( audioman_check_section( $enable ) );\n\t}", "function wpvideocoach_show_introduction()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function create_sitewide_metabox() {\n\t\t$post_types = apply_filters( 'be_title_toggle_post_types', array( 'page' ) );\n\t\tforeach ( $post_types as $post_type )\n\t\t\techo '<p><input type=\"checkbox\" name=\"' . GENESIS_SETTINGS_FIELD . '[be_title_toggle_' . $post_type . ']\" id=\"' . GENESIS_SETTINGS_FIELD . '[be_title_toggle_' . $post_type . ']\" value=\"1\" ' . checked( genesis_get_option( 'be_title_toggle_' . $post_type ), false ) .' /> <label for=\"' . GENESIS_SETTINGS_FIELD . '[be_title_toggle_' . $post_type . ']\"> ' . sprintf( __( 'By default, remove titles in the <strong>%s</strong> post type.', 'genesis-title-toggle' ), $post_type ) .'</label></p>';\n\n\t\n\t}", "function calendar_meta_box() { ?>\n\n\t\t<div>\n\t\t\t<label for=\"is-group-calendar\"><input type=\"checkbox\" name=\"is-group-calendar\" value=\"true\"> This calendar is for a BuddyPress group.</label>\n\t\t\t<p class=\"description\">A calendar may be associated with a BuddyPress group by assigning it the same slug as the slug of the group.</p>\t\n\t\t</div><?php \n\t}", "function productMark($post)\r\n{\r\n ?>\r\n <p>\r\n <span>Признак(новинка): </span>\r\n\r\n <input type=\"checkbox\" <?php if(get_post_meta($post->ID, \"mark\", 1)){\r\n echo \"checked\";\r\n } ?> name='extra[mark]' value=\"1\">\r\n </p>\r\n <?php\r\n}", "function wpvideocoach_hide_introduction()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function taxonomy_checklist_checked_ontop_filter ($args){\n $args['checked_ontop'] = false;\n return $args;\n\n}", "function render_field_checkbox($field)\n {\n }", "public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"toggle-switch-control\">\n\t\t\t\t<div class=\"toggle-switch\">\n\t\t\t\t\t<input type=\"checkbox\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" class=\"toggle-switch-checkbox\" value=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->link();\n\t\t\t\t\tchecked( $this->value() );\n\t\t\t\t\t?>\n\t\t\t\t\t>\n\t\t\t\t\t<label class=\"toggle-switch-label\" for=\"<?php echo esc_attr( $this->id ); ?>\">\n\t\t\t\t\t\t<span class=\"toggle-switch-inner\"></span>\n\t\t\t\t\t\t<span class=\"toggle-switch-switch\"></span>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "function aerospace101_build_meta_box( $post ) {\n\twp_nonce_field( basename( __FILE__ ), 'aerospace101_meta_box_nonce' );\n\n\n // Retrieve current value of fields\n $current_sources = get_post_meta( $post->ID, '_post_sources', true );\n\t$current_is_featured = get_post_meta( $post->ID, '_post_is_featured', true );\n\n\n\t?>\n\n\t<div class='inside'>\n\t\t<h3><?php _e( 'Is Featured?', 'aerospace' ); ?></h3>\n\t\t<p>\n\t\t\t<input type=\"checkbox\" name=\"is_featured\" value=\"1\" <?php checked( $current_is_featured, '1' ); ?> /> Is Featured?\n\t\t</p>\n\n\t\t<h3><?php esc_html_e( 'Sources', 'aerospace' ); ?></h3>\n\t\t<p>\n\t\t\t<?php\n\t\t\t\twp_editor(\n\t\t\t\t\t$current_sources,\n\t\t\t\t\t'post_sources',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'media_buttons' => false,\n\t\t\t\t\t\t'textarea_name' => 'sources',\n\t\t\t\t\t\t'teeny' => false,\n\t\t\t\t\t\t'tinymce' => array(\n\t\t\t\t\t\t\t'menubar' => false,\n\t\t\t\t\t\t\t'toolbar1' => 'bold,italic,underline,strikethrough,subscript,superscript,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink',\n\t\t\t\t\t\t\t'toolbar2' => false,\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\n\n\t</div>\n\t<?php\n}", "private function in_widget() {\n\t\t$this->section_data['general_in_widget'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_in_widget',\n\t\t\t'label' \t\t\t\t=> __( 'Display In Widget', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> '',\n\t\t\t'type' \t\t\t\t\t=> 'checkbox',\n\t\t\t'des'\t\t\t\t\t\t=> sprintf( \n\t\t\t\t\t\t\t\t\t\t\t\t\t__( 'Ensure that you have added the Fixed TOC widget in the <a href=\"%s\" target=\"_blank\">admin widgets page</a>.', 'fixedtoc' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\tesc_attr( admin_url( 'widgets.php' ) )\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t);\n\t}", "function sb_slideshow_checkbox( $value, $key, $name, $checked = array() ) {\n\treturn '<input type=\"checkbox\" name=\"sb_' . esc_attr( $name ) . '[]\" id=\"' . esc_attr( $name . '_' . $value ) . '\"\n\t\tvalue=\"' . esc_attr( $value ) . '\"' . (in_array( $value, (array)$checked ) ? 'checked=\"checked\"' : '') . ' />\n\t\t<label for=\"' . esc_attr( $name . '_' . $value ) . '\">' . $key . '</label><br />';\n}", "function question_category_form_checkbox($name, $checked) {\n echo '<div><input type=\"hidden\" id=\"' . $name . '_off\" name=\"' . $name . '\" value=\"0\" />';\n echo '<input type=\"checkbox\" id=\"' . $name . '_on\" name=\"' . $name . '\" value=\"1\"';\n if ($checked) {\n echo ' checked=\"checked\"';\n }\n echo ' onchange=\"getElementById(\\'displayoptions\\').submit(); return true;\" />';\n echo '<label for=\"' . $name . '_on\">';\n print_string($name, 'quiz');\n echo \"</label></div>\\n\";\n}", "function html_checkbox($variable, $checked='') {\n\n\t$variable .= '_ishtml';\n\n\treturn '<div style=\"padding:3px; width:110px; border: 1px #CCCCCC solid;\">' . form_checkbox($variable, 1, $checked) . \"&nbsp;&nbsp;&nbsp<label for=\\\"$variable\\\">Treat as HTML</label></div>\";\n\n}", "function gssettings_function_box() { ?>\n \n <p><?php _e( 'Check any of the following functions you want to apply to your theme.', 'genesis' ); ?></p>\n <table class=\"form-table gssettings-social\">\n <tbody>\n <tr valign=\"top\">\n <th scope=\"row\">\n <input type=\"checkbox\" name=\"<?php echo GSSETTINGS_SETTINGS_FIELD; ?>[gssettings_move_primary_nav]\" id=\"<?php echo GSSETTINGS_SETTINGS_FIELD; ?>[gssettings_move_primary_nav]\" value=\"1\" <?php checked( 1, genesis_get_option( 'gssettings_move_primary_nav', GSSETTINGS_SETTINGS_FIELD ) ); ?> /> <label for=\"<?php echo GSSETTINGS_SETTINGS_FIELD; ?>[gssettings_move_primary_nav]\"><?php _e( 'Move the Primary Navigation above the header?', 'genesis' ); ?></label>\n </th>\n </tr>\n <tr valign=\"top\">\n <th scope=\"row\">\n <input type=\"checkbox\" name=\"<?php echo GSSETTINGS_SETTINGS_FIELD; ?>[gssettings_move_subnav]\" id=\"<?php echo GSSETTINGS_SETTINGS_FIELD; ?>[gssettings_move_subnav]\" value=\"1\" <?php checked( 1, genesis_get_option( 'gssettings_move_subnav', GSSETTINGS_SETTINGS_FIELD ) ); ?> /> <label for=\"<?php echo GSSETTINGS_SETTINGS_FIELD; ?>[gssettings_move_subnav]\"><?php _e( 'Move the sub navigation above the header?', 'genesis' ); ?></label>\n </th>\n </tr> \n </tbody>\n </table>\n \n <?php }", "function getFieldPortalAddressCheckboxLink(){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_checkboxSamePostal');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_checkboxSamePostal');\n\t\t$tooltip = setToolTipNotification(\"checkboxSamePostal\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= '</br><input id=\"postal-link\" value=\"\" type=\"checkbox\" > '.$dataTitle.$tooltip.'</br>';\t\n\t\t}\n\t\treturn $form_ret;\n\t}", "function snax_admin_setting_video_show_featured_media() {\n\t$checked = snax_video_show_featured_media();\n\t?>\n\t<input name=\"snax_video_show_featured_media\" id=\"snax_video_show_featured_media\" value=\"standard\" type=\"checkbox\" <?php checked( $checked ); ?> />\n\t<?php\n}", "function taxonomy_checklist_checked_ontop_filter ($args)\n{\n\n $args['checked_ontop'] = false;\n return $args;\n\n}", "function user_login_edit()\n{\n\t$Feul = new Feul;\n\t$member_checkbox = '';\n\tif($Feul->showMembersPermBox() == true)\n\t{\n\t\t$member_checkbox = \"checked\";\t\n\t}\n\t?>\n\t\t<div style=\"margin-top:20px;\">\n\t\t\t<p>\n\t\t\t\t<label style=\"display:inline!important; margin-right:10px;\" for=\"member-only\">Только для зарегистрированных:</label>\n\t\t\t\t<input style=\"width:auto;\" type=\"checkbox\" value=\"yes\" name=\"member-only\" <?php echo $member_checkbox; ?> />\n\t\t\t</p>\n\t\t</div> \n\t<?php\n}", "function activate_bitwise_sidebar_content() {\n\trequire_once __DIR__ . '/includes/class-bitwise-sidebar-content-activator.php';\n\tBitwise_Sidebar_Content_Activator::activate();\n}", "function action_custom_box()\n {\n add_meta_box(\n $this->plugin->config['meta']['box-name'],\n 'Protect Content',\n [$this, 'custom_box_html'],\n ['page', 'post'],\n 'normal',\n 'high'\n );\n }", "function rs_focus($post)\n{\n wp_nonce_field('rs_meta_box', 'rs_meta_box_nonce');\n $value = get_post_meta($post->ID, '_focus', true);\n echo '<label for=\"rs_focus\"><input type=\"checkbox\" name=\"rs_focus\" id=\"rs_focus\" value=\"1\" ' . (!empty($value) ? 'checked' : '') . '> Post destacado</label>';\n}", "function fillPostIconEnabled(){\n\t\t\t$enabled = (int) get_option( 'post_icon_enabled' );\n\t\t?>\n\t\t\t<input type=\"checkbox\" name='post_icon_enabled' value=\"1\" <?php checked( 1, $enabled, true ); ?> >\n\n\t\t<?php\n\t}", "function DisplayFeatures()\r\n\t{\r\n\t\tif (! $this->m_news->GetID ())\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$newsID = $this->m_news->GetID ();\r\n\t\t// language strings \r\n\t\t$doneS = $this->GetNameString ( 'done' );\r\n\t\t$optionsS = $this->GetNameString ( 'options' );\r\n\t\t\r\n\t\t$NameS = 'Tab Name'; //$this->GetNameString('Name');\r\n\t\t\r\n\r\n\t\t// values\r\n\t\t$NameV = $this->m_news->GetName ();\r\n\t\t\r\n\t\t//Display title\r\n\t\t$name = $this->m_news->GetName ();\r\n\t\t$this->DisplayTitle ( $name, null, false );\r\n\t\t//////////////////////////////////////\r\n\t\t$panelIndex = 0;\r\n\t\t\r\n\t\tprint ( \"<div class='someGTitleBox'>$optionsS</div>\" );\r\n\t\tprint ( '<div class=\"someGBox\">' );\r\n\t\t\r\n\t\t//Forms\r\n\t\t$updating = true;\r\n\t\t$reading = false;\r\n\t\t\r\n\t\tif (CMSObject::$controller)\r\n\t\t{\r\n\t\t\t$reading = CMSObject::$controller->IsRecReadable ( $this->m_news, 'name' );\r\n\t\t\t$updating = CMSObject::$controller->IsRecUpdatable ( $this->m_news, 'name' );\r\n\t\t}\r\n\t\t\r\n\t\tif ($reading || $updating)\r\n\t\t{\r\n\t\t\t// tab header\r\n\t\t\t$this->DisplayTabHeader ( ++ $panelIndex, $NameS );\r\n\t\t\t\r\n\t\t\tif ($updating)\r\n\t\t\t{\r\n\t\t\t\t$this->DisplayFormHeadr ( 'changeName' );\r\n\t\t\t\t$this->DisplayHidden ( 'newsID', $newsID );\r\n\t\t\t\tprint ( \"<input type='text' value='$NameV' name='Name' id='Name' size='40' maxlength='32' />\\n\" );\r\n\t\t\t\t$this->DisplayFormFooter ( $doneS );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tprint ( $NameV );\r\n\t\t\t}\r\n\t\t\t// tab footer\r\n\t\t\t$this->DisplayTabFooter ();\r\n\t\t}\r\n\t\tprint ( '</div>' );\r\n\t\t\r\n\t\t// display javascript\r\n\t\tprint ( '<script type=\"text/javascript\"><!--' );\r\n\t\t\r\n\t\tfor($index = 0; $index <= $panelIndex; $index ++)\r\n\t\t\tprint ( \"var CollapsiblePanel$index = new Spry.Widget.CollapsiblePanel(\\\"CollapsiblePanel$index\\\", {contentIsOpen:false});\\n\" );\r\n\t\tprint ( '//--></script>' );\r\n\t}", "function ffw_port_multicheck_callback( $args ) {\n global $ffw_port_settings;\n\n foreach( $args['options'] as $key => $option ):\n if( isset( $ffw_port_settings[$args['id']][$key] ) ) { $enabled = $option; } else { $enabled = NULL; }\n echo '<input name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\" type=\"checkbox\" value=\"' . $option . '\" ' . checked($option, $enabled, false) . '/>&nbsp;';\n echo '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\">' . $option . '</label><br/>';\n endforeach;\n echo '<p class=\"description\">' . $args['desc'] . '</p>';\n}", "public function render_features_box ( $post )\n {\n /* validate that the contents of the form request */\n wp_nonce_field( 'mtk_testimonial_author' , 'mtk_testimonial_author_nonce' );\n /* Get the data */\n $data = get_post_meta ( $post->ID , '_mtk_testimonial_key' , true );\n\n /* Create the variables where we are going to sort the information */\n /* Author Name */\n $name = isset($data['name']) ? $data['name'] : '';\n /* Email */\n $email = isset($data['email']) ? $data['email'] : '';\n /* approved */\n $approved = isset($data['approved']) ? $data['approved'] : false;\n /* featured */\n $featured = isset($data['featured']) ? $data['featured'] : false;\n ?>\n <label class=\"meta-label\" for=\"mtk_testimonial_author\">Author Name</label>\n <input type=\"text\" id=\"mtk_testimonial_author\" name=\"mtk_testimonial_author\" value=\"<?php echo ( esc_attr( $name ) ); ?>\"\n <label class=\"meta-label\" for=\"mtk_testimonial_author\">Author Email</label>\n <input type=\"text\" id=\"mtk_testimonial_author\" name=\"mtk_testimonial_email\" value=\"<?php echo ( esc_attr( $email ) ); ?>\"\n <div class=\"meta-container\">\n\t\t\t<label class=\"meta-label w-50 text-left\" for=\"mtk_testimonial_approved\">Approved</label>\n\t\t\t<div class=\"text-right w-50 inline\">\n\t\t\t\t<div class=\"ui-toggle inline\"><input type=\"checkbox\" id=\"mtk_testimonial_approved\" name=\"mtk_testimonial_approved\" value=\"1\" <?php echo $approved ? 'checked' : ''; ?>>\n\t\t\t\t\t<label for=\"mtk_testimonial_approved\"><div></div></label>\n\t\t\t\t</div>\n\t\t\t</div>\n <label class=\"meta-label w-50 text-left\" for=\"mtk_testimonial_featured\">Featured</label>\n\t\t\t<div class=\"text-right w-50 inline\">\n\t\t\t\t<div class=\"ui-toggle inline\"><input type=\"checkbox\" id=\"mtk_testimonial_featured\" name=\"mtk_testimonial_featured\" value=\"1\" <?php echo $featured ? 'checked' : ''; ?>>\n\t\t\t\t\t<label for=\"mtk_testimonial_featured\"><div></div></label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n <?php\n }", "function wpvideocoach_show_toolbar_link()\r\n{\r\n\tglobal $wpvideocoach_toolbar_link;\r\n\tif( $wpvideocoach_toolbar_link == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function print_checkbox($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\techo '<div class=\"on-off\"><span></span></div>';\n\t\tif($input_value=='true'){\n\t\t\t$input_value='on';\n\t\t}\n\t\tif($input_value=='false'){\n\t\t\t$input_value='off';\n\t\t}\n\t\techo '<input name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"hidden\" value=\"'.$input_value.'\" />';\n\t\t$this->close_option($value);\n\t}", "public function metabox_content() {\n\t\t\n\t\t\n\t\t\n\t}", "function custom_meta_box($object)\n {\n wp_nonce_field(basename(__FILE__), \"meta-box-nonce\");\n\n ?>\n <div class=\"MetaHeader\"><p><b>Appear Post</b></p>\n <div>\n\n <label for=\"Main_Posts\">Main Posts</label>\n <?php\n /*------- Add CheckBox To Appear The Post In Main Posts Area --------*/\n $Main_value = get_post_meta($object->ID, \"Main_Posts\", true);\n\n if($Main_value == \"\")\n {\n ?>\n <input name=\"Main_Posts\" type=\"checkbox\" value=\"main\">\n <?php\n }\n else if($Main_value == \"main\")\n {\n ?> \n <input name=\"Main_Posts\" type=\"checkbox\" value=\"main\" checked>\n <?php\n }\n ?>\n </div>\n\n <div>\n\n <label for=\"Features_Posts\">Features Posts</label>\n <?php\n /*------- Add CheckBox To Appear The Post In Feature Posts Area --------*/\n $Feature_value = get_post_meta($object->ID, \"Features_Posts\", true);\n\n if($Feature_value == \"\")\n {\n ?>\n <input name=\"Features_Posts\" type=\"checkbox\" value=\"feature\">\n <?php\n }\n else if($Feature_value == \"feature\")\n {\n ?> \n <input name=\"Features_Posts\" type=\"checkbox\" value=\"feature\" checked>\n <?php\n }\n ?>\n </div>\n <p><b>Type Of Post</b></p>\n <div>\n\n <label for=\"Local_Posts\">Local Posts</label>\n <?php\n /*------- Add CheckBox To Check If The Type Of The Post Is Local --------*/\n $Local_value = get_post_meta($object->ID, \"Local_Posts\", true);\n\n if($Local_value == \"\")\n {\n ?>\n <input name=\"Local_Posts\" type=\"checkbox\" value=\"local\">\n <?php\n }\n else if($Local_value == \"local\")\n {\n ?> \n <input name=\"Local_Posts\" type=\"checkbox\" value=\"local\" checked>\n <?php\n }\n ?>\n </div>\n\n <div>\n\n <label for=\"World_Posts\">World Posts</label>\n <?php\n /*------- Add CheckBox To Check If The Type Of The Post Is World --------*/\n $World_value = get_post_meta($object->ID, \"World_Posts\", true);\n \n if($World_value == \"\")\n {\n ?>\n <input name=\"World_Posts\" type=\"checkbox\" value=\"world\">\n <?php\n }\n else if($World_value == \"world\")\n {\n ?> \n <input name=\"World_Posts\" type=\"checkbox\" value=\"world\" checked>\n <?php\n }\n ?>\n </div>\n </div>\n <?php \n }", "public function callback_multicheck( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $html = '<fieldset>';\n\n foreach ( $args['options'] as $key => $label ) {\n $checked = isset( $value[$key] ) ? $value[$key] : '0';\n $html .= sprintf( '<label for=\"wpuf-%1$s[%2$s]\">', $name_id, $key );\n $html .= sprintf( '<input type=\"checkbox\" class=\"checkbox\" id=\"wpuf-%1$s[%2$s]\" name=\"%1$s[%2$s]\" value=\"%2$s\" %3$s %4$s/>', $name_id, $key, checked( $checked, $key, false ), $disable );\n $html .= sprintf( '%1$s</label><br>', $label );\n }\n\n $html .= $this->get_field_description( $args );\n $html .= '</fieldset>';\n\n echo $html;\n }", "function surgeon_add_checkbox_heading_fields($post, $addon, $loop) {\n echo '<th class=\"checkbox_column\"><span class=\"column-title\">Image</span></th>';\n}", "public function question_content() {\r\n $this->check_permission(19);\r\n $content_data['add'] = $this->check_page_action(19, 'add');\r\n\r\n $this->quick_page_setup(Settings_model::$db_config['adminpanel_theme'], 'adminpanel', $this->lang->line('question_content'), 'operation/question_content', 'header', 'footer', '', $content_data);\r\n }", "function on_contentbox_1_content($splashgate_options) { \n\t\t\t\n\t\t\t// Can't do query_posts for meta_key, must use custom db query\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t$sql = \"\n\t\t SELECT wposts.* \n\t\t FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta\n\t\t WHERE wposts.ID = wpostmeta.post_id \n\t\t AND wpostmeta.meta_key = '_splashgate_splashable' \n\t\t AND wpostmeta.meta_value = 'on' \n\t\t AND wposts.post_status = 'publish' \n\t\t AND wposts.post_type = 'page' \n\t\t ORDER BY wposts.post_date DESC;\n\t\t \";\n\t\t\n\t\t\t$pageposts = $wpdb->get_results($sql, OBJECT);\n \n\t\t\tif ($pageposts){\n\t\t\t\tglobal $post;?>\n\t\t\t\t\n\t\t\t\t<p>Choose the page you'd like to splash from the list of splashable pages below:</p>\n\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" class=\"widefat page splashable-list\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"col\" id=\"cb\" class=\"manage-column column-cb check-column\"></th>\n\t\t\t\t\t\t<th scope=\"col\" id=\"title\" class=\"manage-column column-title\">Title</th>\n\t\t\t\t\t\t<th scope=\"col\" id=\"author\" class=\"manage-column column-author\">Author</th>\n\t\t\t\t\t\t<th scope=\"col\" id=\"date\" class=\"manage-column column-date\">Date</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead><?php\n\t\t\t\t\n\t\t\t\t$zebra = '';\n\t\t\t\tforeach ($pageposts as $post){\n\t\t\t\t\tsetup_postdata($post);\n\t\t\t\t\t\n\t\t\t\t\t$checked = \"\";\n\t\t\t\t\tif($post->ID == $splashgate_options['splashpage_id']){\n\t\t\t\t\t\t$checked = \"checked=\\\"checked\\\"\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($zebra == \" alternate\"){\n\t\t\t\t\t\t$zebra = \"\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$zebra = \" alternate\";\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t\n\t\t\t\t\t<tr class=\"<?php echo $zebra;?>\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"check-column\"><input type=\"radio\" name=\"splashgate_options[splashpage_id]\" value=\"<?php echo $post->ID;?>\" <?php echo $checked; ?>/></th>\n\t\t\t\t\t\t<td><a href=\"<?php the_permalink();?>\"><?php the_title(); ?></a></td>\n\t\t\t\t\t\t<td><?php the_author(); ?></td>\n\t\t\t\t\t\t<td><?php the_time('F jS, Y') ?></td>\n\t\t\t\t\t</tr><?php\n\t\t\t\t\t\n \t\t\t\t} // end foreach ?>\n \t\t\t\t\n \t\t\t\t</table>\n \t\t\t\t<p style=\"color:#777;\">Pages have to be made 'splashable' in order to use them. To add a new page to this list, go <a href=\"<?php echo admin_url('/edit.php?post_type=page',__FILE__);?>\">edit the page</a> you'd like to use and check the 'Splashable' checkbox available in the right sidebar. Then come back here to finish the set up.</p><?php\n \t\t\t\t\n \t\t\t} else { ?>\n \t\t<p style=\"display:block;color:#922;\">There are no pages available for use.</p>\n \t\t<p style=\"color:#777;\">Pages have to be made 'splashable' in order to use them. To make a page splashable, go <a href=\"<?php echo admin_url('/edit.php?post_type=page',__FILE__);?>\">edit the page</a> you'd like to use and check the 'Splashable' checkbox available in the right sidebar. Then come back here to finish the set up.</p><?php\n \t\t\t}\n \t\t\t\n\t\t}", "function tpl_add_content()\n\t{\n\t\treturn true;\n\t}", "public function testSearchboxCheckboxWidget() {\n $facet_storage = \\Drupal::entityTypeManager()->getStorage('facets_facet');\n $id = 'sc';\n\n // Create and save a facet with a checkbox widget on the 'type' field.\n $facet_storage->create([\n 'id' => $id,\n 'name' => strtoupper($id),\n 'url_alias' => $id,\n 'facet_source_id' => 'search_api:views_page__search_api_test_view__page_1',\n 'field_identifier' => 'type',\n 'empty_behavior' => ['behavior' => 'none'],\n 'widget' => [\n 'type' => 'searchbox_checkbox',\n 'config' => [\n 'show_numbers' => TRUE,\n ],\n ],\n 'processor_configs' => [\n 'url_processor_handler' => [\n 'processor_id' => 'url_processor_handler',\n 'weights' => ['pre_query' => -10, 'build' => -10],\n 'settings' => [],\n ],\n ],\n ])->save();\n $this->createBlock($id);\n\n // Go to the views page.\n $this->drupalGet('search-api-test-fulltext');\n\n // Make sure the block is shown on the page.\n $page = $this->getSession()->getPage();\n $block = $page->findById('block-sc-block');\n $this->assertTrue($block->isVisible());\n\n // Make sure the searchbox input exists.\n $this->assertSession()->elementExists('css', '.facets-widget-searchbox');\n // Make sure the searchbox link list exists.\n $this->assertSession()->elementExists('css', '.facets-widget-searchbox-list');\n }", "function taxonomy_meta_box_sanitize_cb_checkboxes($taxonomy, $terms)\n {\n }", "function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }", "function cd_meta_box_cb($post)\n\t{\n\t\tglobal $post;\n\t\t$values = get_post_custom( $post->ID );\n\t\t$text = isset( $values['my_meta_box_text'] ) ? esc_attr( $values['my_meta_box_text'][0] ) : '';\n\t\t$selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : '';\n\t\t$check = isset( $values['my_meta_box_check'] ) ? esc_attr( $values['my_meta_box_check'][0] ) : '';\n\t\t \n\t\t// We'll use this nonce field later on when saving.\n\t\twp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"my_meta_box_text\">Text Label</label>\n\t\t\t<input type=\"text\" name=\"my_meta_box_text\" id=\"my_meta_box_text\" value=\"<?php echo $text; ?>\" />\n\t\t</p>\n\t\t \n\t\t<p>\n\t\t\t<label for=\"my_meta_box_select\">Color</label>\n\t\t\t<select name=\"my_meta_box_select\" id=\"my_meta_box_select\">\n\t\t\t\t<option value=\"red\" <?php selected( $selected, 'red' ); ?>>Red</option>\n\t\t\t\t<option value=\"blue\" <?php selected( $selected, 'blue' ); ?>>Blue</option>\n\t\t\t</select>\n\t\t</p>\n\t\t \n\t\t<p>\n\t\t\t<input type=\"checkbox\" id=\"my_meta_box_check\" name=\"my_meta_box_check\" <?php checked( $check, 'on' ); ?> />\n\t\t\t<label for=\"my_meta_box_check\">Do not check this</label>\n\t\t</p>\n\t\t<?php \n\t}", "function agnosia_post_block_advanced_options( $post, $box ) { \r\n\r\n\t\tglobal $post;\r\n\r\n\t\twp_nonce_field( basename( __FILE__ ), 'agnosia_post_block_advanced_options_nonce' );\r\n\r\n\t\t$meta_value = get_post_meta( $post->ID, 'agnosia_post_meta' , true ) ;\r\n\r\n\t\tfunction is_checked_block_advanced_option( $option , $value ) {\r\n\t\t\t$checked = ( isset( $value[$option] ) and $value[$option] ) ? 'checked=\"checked\"' : '';\r\n\t\t\techo $checked; \r\n\t\t}\r\n\r\n\t\t?>\r\n\r\n\t\t<div class=\"agnosia-post-block-advanced-options\">\r\n\t\t\t\r\n\t\t\t<p>\r\n\t\t\t\t<input type=\"checkbox\" id=\"agnosia-post-block-options[0]\" name=\"agnosia_post_meta[block_custom_stylesheet]\" value=\"true\" <?php is_checked_block_advanced_option( 'block_custom_stylesheet' , $meta_value ); ?> />\r\n\t\t\t\t<label for=\"agnosia-post-block-options[0]\"><?php _e( 'Block custom stylesheet option' , 'agnosia' ); ?></label><br />\r\n\r\n\t\t\t\t<?php if ( function_exists( 'agnosia_ac_post_additional_html' ) ) : ?>\r\n\t\t\t\t\t<input type=\"checkbox\" id=\"agnosia-post-block-options[1]\" name=\"agnosia_post_meta[block_additional_html]\" value=\"true\" <?php is_checked_block_advanced_option( 'block_additional_html' , $meta_value ); ?> />\r\n\t\t\t\t\t<label for=\"agnosia-post-block-options[1]\"><?php _e( 'Block additional HTML option' , 'agnosia' ); ?></label><br />\r\n\t\t\t\t<?php endif; ?>\r\n\r\n\t\t\t\t<input type=\"checkbox\" id=\"agnosia-post-block-options[2]\" name=\"agnosia_post_meta[block_featured_image_position]\" value=\"true\" <?php is_checked_block_advanced_option( 'block_featured_image_position' , $meta_value ); ?> />\r\n\t\t\t\t<label for=\"agnosia-post-block-options[2]\"><?php _e( 'Block featured image position option' , 'agnosia' ); ?></label><br />\r\n\r\n\t\t\t\t<input type=\"checkbox\" id=\"agnosia-post-block-options[3]\" name=\"agnosia_post_meta[block_override_default_settings]\" value=\"true\" <?php is_checked_block_advanced_option( 'block_override_default_settings' , $meta_value ); ?> />\r\n\t\t\t\t<label for=\"agnosia-post-block-options[3]\"><?php _e( 'Block override default settings option' , 'agnosia' ); ?></label>\r\n\t\t\t</p>\r\n\r\n\r\n\t\t</div>\r\n\r\n\t\t<?php\r\n\t\t\r\n\t}", "function snoc_marquee_meta_box_option() {\r\n global $post;\r\n wp_nonce_field( basename( __FILE__ ), 'wpse_our_nonce' );\r\n $checkbox_value = get_post_meta($post->ID, '_marquee_latest_news', true);\r\n ?>\r\n <p>Please select option for text rotation on black bar.</p>\r\n <label><input name=\"marquee_news_check\" type=\"radio\" value=\"Yes\" <?php if($checkbox_value == \"Yes\"){ echo 'checked'; }?>>Yes&nbsp;&nbsp;</label>\r\n <label><input name=\"marquee_news_check\" type=\"radio\" value=\"No\" <?php if($checkbox_value != \"Yes\"){ echo 'checked'; }?>>No</label>\r\n <?php \r\n}", "public static function include_confirmation_checkbox() {\n\n $address = edd_get_customer_address();\n $taxamo = taxedd_get_country_code();\n $stylecss = \"\";\n\n if ( isset($taxamo) ) {\n if ($taxamo->country_code == $address['country'] ) {\n $stylecss = ' style=\"display: none;\"';\n }\n }\n\n ?>\n\n\n <p id=\"edd-confirmation-checkbox\" <?php echo $stylecss; ?>>\n <label for=\"edd-vat-confirm\" class=\"edd-label\">\n <?php _e( 'By clicking this checkbox, I can confirm my billing address is valid and is located in my usual country of residence.', 'taxamoedd' ); ?>\n <input class=\"edd-self-declaration\" type=\"checkbox\" name=\"edd_self_declaration\" id=\"edd-self-declaration\" value=\"true\" />\n </label>\n <?php\n }", "function __tinypass_misc_display( TPPaySettings $ps ) {\n\t?>\n\t<div class=\"tp-section\">\n\t\t<div class=\"info\">\n\t\t\t<div class=\"heading\">Customize</div>\n\t\t\t<div class=\"desc\">Enable / disable these features of additional behavior</div>\n\t\t</div>\n\t\t<div class=\"body\">\n\t\t\t<div class=\"postbox\"> \n\t\t\t\t<h3><?php echo _e( \"&nbsp;\" ) ?></h3>\n\t\t\t\t<div class=\"inside\"> \n\t\t\t\t\t<input type=\"checkbox\" id=\"cb_track_homepage\" name=\"tinypass[mlite_track_homepage]\" value=\"1\" <?php echo checked( $ps->isTrackHomePage() ) ?>>\n\t\t\t\t\t<label for=\"cb_track_homepage\"><?php echo _e( \"Track on home page visit - visiting your homepage will count as a view\" ) ?></label>\n\t\t\t\t\t<br> <br>\n\t\t\t\t\t<input type=\"checkbox\" id=\"cb_disabled_for_admins\" name=\"tinypass[mlite_disabled_for_admins]\" value=\"1\" <?php echo checked( $ps->isDisabledForPriviledgesUsers() ) ?>>\n\t\t\t\t\t<label for=\"cb_disabled_for_admins\"><?php echo _e( \"Disable Tinypass for privileges users - TinyPass will be skipped for all non Subscriber users\" ) ?></label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"clear\"></div>\n\t</div>\n<?php\n}", "public function render_content() {\n\t\tif ( ! defined( 'WPFORMS_VERSION' ) ) {\n\n\t\t\techo '<span class=\"customize-control-title\">' . esc_html__( 'Instructions', 'hestia' ) . '</span>';\n\t\t\techo $this->create_plugin_install_button(\n\t\t\t\t'wpforms-lite',\n\t\t\t\tarray(\n\t\t\t\t\t'redirect' => admin_url( 'customize.php' ) . '?autofocus[control]=hestia_contact_form_shortcode',\n\t\t\t\t\t'plugin_name' => 'WPForms Lite',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "function wiki_shown_hidden($post){\n\t\t\n\t\t$status = get_post_meta($post->ID,'wiki-contributons-status',true);\n\t\t\n\t?>\t\n\t\tTo hide the table check the box &nbsp;\n\t\t\n\t\t<input type=\"checkbox\" value=\"hide\" name=\"wiki-tabel-shownorhide\" <?php checked('hide',$status); ?> /> \n\t\n\t<?php\t\n\t}", "function barnelli_wp_checkbox( $field ) {\n\tglobal $thepostid, $post;\n\n\t$thepostid \t\t\t\t= empty( $thepostid ) ? $post->ID : $thepostid;\n\t$field['class'] \t\t= isset( $field['class'] ) ? $field['class'] : 'checkbox';\n\t$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';\n\t$field['value'] \t\t= isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true );\n\t$field['cbvalue'] \t\t= isset( $field['cbvalue'] ) ? $field['cbvalue'] : 'yes';\n\n\techo '<p class=\"form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '\"><label for=\"' . esc_attr( $field['id'] ) . '\">' . wp_kses_post( $field['label'] ) . '</label><input type=\"checkbox\" class=\"' . esc_attr( $field['class'] ) . '\" name=\"' . esc_attr( $field['id'] ) . '\" id=\"' . esc_attr( $field['id'] ) . '\" value=\"' . esc_attr( $field['cbvalue'] ) . '\" ' . checked( $field['value'], $field['cbvalue'], false ) . ' /> ';\n\n\tif ( ! empty( $field['description'] ) ) echo '<span class=\"description\">' . wp_kses_post( $field['description'] ) . '</span>';\n\n\techo '</p>';\n}", "function AttribCheckbox( $id, $value, $name )\n\t{\n\t\t$checkbox = \"\";\n\t\t$checked = \"\";\n if ($value == 'on')\n {\n \t$checked = \"checked='checked'\";\n }\n $checkbox .= \"<input type='checkbox' name='\".$name.\"' \" . $checked . \" />\";\n\t\treturn $checkbox;\n\t}", "function option_checkbox($label, $name, $value='', $comment='') {\r\n\t\tif ($value)\r\n\t\t\t$checked = \"checked='checked'\";\r\n\t\telse\r\n\t\t\t$checked = \"\";\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td><input type='hidden' id='$name' name='$name' value='0' /><input type='checkbox' name='$name' value='1' $checked />\";\r\n\t\techo \" $comment</td></tr>\";\r\n\t}", "function r_userclass_check($fieldname, $curval = '', $optlist = \"\")\n{\n// echo \"Call r_userclass_check: {$curval}<br />\";\n global $e_userclass;\n if (!is_object($e_userclass)) $e_userclass = new user_class;\n $ret = $e_userclass->uc_checkboxes($fieldname,$curval,$optlist);\n if ($ret) $ret = \"<div class='check-block'>\".$ret.\"</div>\";\n return $ret;\n}", "function setting_admin_include_cpt() {\n\t$options = get_option('nrelate_admin_options');\n\t\n\t$selected = isset( $options['admin_include_post_types'] ) ? $options['admin_include_post_types'] : array( 'post' );\n\t\n\t$post_types = get_post_types( \n\t\tarray(\n\t\t\t'public'=>true, \n\t\t\t//'publicly_queryable'=>true,\n\t\t\t//'capability_type'=> array('post','page'),\n\t\t\t'show_ui'=>true\n\t\t), 'object' \n\t);\n\t\n\techo \"<div id='nrelate-include-cpts' class='cptdiv'><ul id='posttypeschecklist' class='list:posttypes categorychecklist form-no-clear'>\";\n\t\n\tforeach ( $post_types as $id => $post_type ) {\n\t\t$checked = in_array( $id, $selected ) ? \"checked='checked'\" : \"\";\n\t\techo \"<li id='post-type-{$id}'><label class='selectit'><input type='checkbox' value='{$id}' name='nrelate_admin_options[admin_include_post_types][]' {$checked} id='in-post-type-{$id}' /> {$post_type->name}</label></li>\";\n\t}\n\t\n\techo '</ul></div>';\n\n\n$javascript_cpt = <<< JAVA_SCRIPT\njQuery(document).ready(function(){\n\tvar nrel_include_cpts_changed = false;\n\t\n\tjQuery('#nrelate-include-cpts :checkbox').change(function(){\n\t\tvar me= jQuery(this);\n\t\tif (!nrel_include_cpts_changed) {\n\t\t\tif (confirm(\"Any changes to this section will require a site reindex. Are you sure you want to continue?\\u000AIf Yes, press OK, SAVE CHANGES and press the REINDEX button (Reindexing may take a while, please be patient).\"))\n\t\t\t{\n\t\t\t\tnrel_include_cpts_changed = true;\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tme.attr('checked', !me.is(':checked'));\n\t\t\t}\n\t\t}\n\t});\t\t\t\t\t\t\t\t\n});\nJAVA_SCRIPT;\n\n\techo \"<script type='text/javascript'>{$javascript_cpt}</script>\";\n}", "function ep_bp_feature_box_summary() {\n\techo esc_html_e( 'Index BuddyPress content like groups and members.', 'elasticpress-buddypress' );\n}", "public function getTitleCheckboxHtml() : string\n {\n return '<label class=\"kt-checkbox kt-checkbox--single kt-checkbox--all kt-checkbox--solid\">\n <input type=\"checkbox\" class=\"select-all\" onclick=\"select_all()\">\n <span></span>\n </label>';\n }", "function theme_checkbox(&$item) {\n\n\t\t$class = array('form-checkbox');\n\t\t_form_set_class($item, $class);\n\n\t\t$checked = \"\";\n\t\tif (!empty($item[\"#value\"])) {\n\t\t\t$checked = \"checked=\\\"checked\\\" \";\n\t\t}\n\n\t\t$retval = '<input '\n\t\t\t. 'type=\"checkbox\" '\n\t\t\t. 'name=\"'. $item['#name'] .'\" '\n\t\t\t. 'id=\"'. $item['#id'].'\" ' \n\t\t\t. 'value=\"'. $item['#return_value'] .'\" '\n\t\t\t. $checked\n\t\t\t. drupal_attributes($item['#attributes']) \n\t\t\t. ' />';\n\n\t\treturn($retval);\n\n\t}", "public function checklist() {\n\t\t$pageTitle = 'Checklist';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/checklist.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n }", "function zen_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {\n return zen_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);\n }", "function MetaBox()\n\t{\n\t\t\n\t\t// wordpress global\n\t\tglobal $post;\n\n\t\t// grab meta data, if it exists\n\t\t$tlsp_text = get_post_meta( $post->ID, 'tlsp_text', true );\n\n\t\t// use a nonce for verification\n\t\twp_nonce_field( plugin_basename(__FILE__), 'tlsp_noncename' );\n\t\t\n\t\t// this is the html for the metabox\n\t\t$security = 1;\n\t\tinclude( 'metabox-html.php' );\n\t\t$security = 0;\n\t\t\n\t}", "public function render_content() {\n\n\t\tif ( empty( $this->choices ) ) {\n\t\t\treturn;\n\t\t} ?>\n\n\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t<span class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t<?php endif; ?>\n\n\t\t<?php $multi_values = ! is_array( $this->value() ) ? explode( ',', $this->value() ) : $this->value(); ?>\n\n\t\t<ul>\n\t\t\t<?php foreach ( $this->choices as $value => $label ) : ?>\n\n\t\t\t\t<li>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\"\n\t\t\t\t\t\t value=\"<?php echo esc_attr( $value ); ?>\" <?php checked( in_array( $value, $multi_values ) ); ?> />\n\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\n\t\t\t<?php endforeach; ?>\n\t\t</ul>\n\n\t\t<input type=\"hidden\" <?php $this->link(); ?> value=\"<?php echo esc_attr( implode( ',', $multi_values ) ); ?>\"/>\n\t<?php }", "function my_gform_editor_js(){\n\t\t?>\n\t\t<script>\n\t\t//binding to the load field settings event to initialize the checkbox\n\t\tjQuery(document).bind(\"gform_load_field_settings\", function(event, field, form){\n\t\t\tjQuery(\"#field_placeholder\").val(field[\"placeholder\"]);\n\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "function fbm_options_content(){\nob_start(); ?>\n<div class=\"wrap\">\n<h2><?php _e('Facebook Me Settings', 'fbm_domain')?></h2>\n<p><?php _e('Settings For The Facebook Me Link Plugin', 'fbm_domain')?></p>\n\n<form action=\"options.php\" method=\"post\">\n<?php settings_fields('fbm_settings_group'); ?>\n<table class=\"form-table\">\n<tbody>\n<tr>\n<th scope=\"row\"> <label for=\"fbm_settings[enable]\"><?php _e('Enable', 'fbm_domain')?></label></th>\n<!-- <td> <input type='checkbox' name = 'fbm_settings[enable]' value = '1' <?php checked(\"1\", $fbm_options['enable']) ?>></td> -->\n</tr></tbody>\n</table>\n</form>\n</div>\n<?php\necho ob_get_clean();\n}" ]
[ "0.6655481", "0.65950525", "0.64366275", "0.63501453", "0.6198757", "0.616798", "0.61650294", "0.6161946", "0.615659", "0.61272544", "0.6122701", "0.61221194", "0.6088823", "0.60589707", "0.60174596", "0.600176", "0.59926414", "0.5988498", "0.5961757", "0.5961007", "0.5954555", "0.59442145", "0.5936517", "0.5924819", "0.5921097", "0.5915947", "0.5902261", "0.59009814", "0.5881643", "0.5873191", "0.58715624", "0.5865284", "0.5863849", "0.58619905", "0.5839423", "0.583235", "0.5830328", "0.58235955", "0.5817361", "0.58137894", "0.5813686", "0.57928056", "0.57844955", "0.574704", "0.57409656", "0.57211614", "0.5718025", "0.57157815", "0.5711726", "0.57101697", "0.5693388", "0.56863296", "0.56852853", "0.5680609", "0.5671731", "0.5664756", "0.56647295", "0.5661592", "0.56615067", "0.5644367", "0.5637972", "0.5633696", "0.56167966", "0.5611924", "0.5604376", "0.55934936", "0.55886793", "0.5587835", "0.55869406", "0.5566149", "0.5555557", "0.55555105", "0.55484605", "0.55460453", "0.55350876", "0.55305713", "0.552989", "0.55222994", "0.55218625", "0.5509974", "0.5496241", "0.54942405", "0.54936767", "0.5492666", "0.5489257", "0.54866076", "0.54837763", "0.5472905", "0.547119", "0.54632515", "0.54542685", "0.5454103", "0.54481804", "0.5445389", "0.5427487", "0.5421975", "0.5421082", "0.5417832", "0.5412198", "0.5410925", "0.5410375" ]
0.0
-1
/////////////////////////////////////////////////////////// AJAX CALLS ///////////////////////////////////////////////////////////
function template_ajax_pagination_home() { // CONSTRUCT QUERY $query_vars = json_decode( stripslashes( $_GET['query_vars'] ), true ); //$query_vars['paged'] = $_GET['page']; $query_vars['category_name'] = $_GET['category']; $query_vars['post_status'] = 'publish'; // MAKE QUERY $posts = new WP_Query( $query_vars ); $GLOBALS['wp_query'] = $posts; print_r($posts); // FORM RETURN STRING FROM SEARCH RESULTS if( $posts->have_posts() ) { $counter = 1; while ( $posts->have_posts() ) { $posts->the_post(); // get_template_part( 'loop', get_post_format() ); // $counter++; } } //finish die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleAjaxRequest();", "public function ajax_function()\n\t{\n\t}", "public function ajax_response()\n {\n }", "function ajax_query()\n {\n }", "protected function processGetRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'get'\n ]));\n }", "abstract public function HighAjax();", "abstract public function LowAjax();", "public function ajax() {\n \n // Get action's get input\n $action = $this->CI->input->get('action');\n\n if ( !$action ) {\n $action = $this->CI->input->post('action');\n }\n \n try {\n\n // Call method if exists\n (new MidrubBaseAdminCollectionFrontendControllers\\Ajax)->$action();\n\n } catch (Exception $ex) {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $ex->getMessage()\n );\n\n echo json_encode($data);\n\n }\n \n }", "public function ajax_backend_call()\n {\n\n // Security check\n check_ajax_referer('referer_id', 'nonce');\n\n $response = 'OK';\n // Send response in JSON format\n // wp_send_json( $response );\n // wp_send_json_error();\n wp_send_json_success($response);\n\n die();\n }", "private function ajaxController()\n {\n\n switch ($this->request['action']) {\n case 'add_task':\n $result = $this->addTask($this->request);\n break;\n case 'task_edit_popup':\n $result = $this->getEditTaskPopupData($this->request['task_id']);\n break;\n case 'edit_task':\n $result = $this->editTask($this->request);\n break;\n default:\n return false;\n }\n\n echo json_encode($result);\n exit();\n }", "function ajaxList() {\r\n $this->rdAuth->noStudentsAllowed();\r\n // Set up the list\r\n $this->setUpAjaxList();\r\n // Process the request for data\r\n $this->AjaxList->asyncGet();\r\n }", "public function ajax_frontend_call()\n {\n\n // Security check\n check_ajax_referer('referer_id', 'nonce');\n\n $response = 'OK';\n // Send response in JSON format\n // wp_send_json( $response );\n // wp_send_json_error();\n wp_send_json_success($response);\n\n die();\n }", "public function ajaxCall() {\n return json_encode('asdf');\n }", "public function ajaxCall() {\n return json_encode('asdf');\n }", "public function ajaxCall() {\n return json_encode('asdf');\n }", "protected function ajax() {\n\t\t// Ignore invalid AJAX requests, AJAX requests should always contain a vote\n\t\tif ( ! $this->is_ajax or empty( $this->new_vote ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load results and vote feedback\n\t\t$this->load_results();\n\t\t$this->load_vote();\n\n\t\t// Send the item back in JSON format\n\t\techo json_encode( $this->item );\n\t}", "public function ajax()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n $post = $this->request->request->all();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n\n $user = array_pop($user);\n\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'User Data Found;';\n\n switch($post['action']) {\n\n case 'update' : $result = $this->user_logic->ajaxUpdate($user,$post['unit_id'],$post['fields'],$post['values']);\n $ajax_data['message'] = $result;\n break;\n\n default : $ajax_data['message'] .= ' Processing unit_id: '. $post['unit_id'] . ';';\n $ajax_data['message'] .= ' Action: '. $post['action'] . ';';\n\n }\n\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "public static function handle_ajax() {\n\t\tHelpers::ajax_wrapper( array( self::class, 'ajax_handler_body' ) );\n\t}", "public function loadAjax() {\n\t \n\t\t$this->classificationFacade->loadAjax($_GET);\n\t\t\n\t}", "public function initAjax()\n {\n }", "function wp_doing_ajax()\n {\n }", "public function ExecuteAjax()\r {\r \r \r $return = 0; // initialize variable\r $QDATA = GetEncryptQuery('eq'); // decode the encrypted query passed in\r $action = Get('action'); // determine what action we're trying to do\r \r \r // ----- output debug variables to screen - this will probably kill the return values - but good for debug\r //$_GET['show'] = true;\r if (Get('show')) {\r echo \"<br />QDATA = \" . ArrayToStr($QDATA);\r echo \"<br />action = $action\";\r }\r \r \r switch ($action) {\r \r default:\r $result = '';\r $return = ($result) ? 1 : 0;\r break;\r \r }\r \r echo $return;\r }", "public function ajaxmethod()\n {\n $result = [\n \"csrfTokenName\" => $this->security->get_csrf_token_name(),\n \"csrfHash\" => $this->security->get_csrf_hash(),\n ];\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "function handleRequest(){\n\n check_ajax_referer( 'mvc-ajax' );\n \n $class = apply_filters( 'mvc_theme_ajax_handle_class', $this->getControllerObject( $_POST['controller'] ), $_POST );\n\n if( !$this->no_priv ){\n if( !isset( $class->ajax_allow ) || !in_array( $_POST['method'], $class->ajax_allow ) ){\n echo 'This method has not been added to the ajax_allow allowed list';\n exit();\n } \n }\n\n $data = $class->{$_POST['method']}($_POST['args']);\n \n if( !is_string( $data ) ){\n echo json_encode( $data );\n } else {\n echo $data;\n }\n exit(); \n }", "function ajaxGetEmployeeDataById() {\n $employeeId = $_GET['employeeId'];\n $result = getEmployeeDataById($employeeId);\n echo json_encode($result);\n }", "public function ajaxSendRequest()\n\t{\n\t\t$request = FriendshipRequest::saveRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "public function ajax_response()\n {\n $this->ajax_data_return['data'] = (object) $this->ajax_data_return['data'];\n echo json_encode($this->ajax_data_return);\n }", "public function ajax_content()\n\t{\n\t\t$return_struct = array(\n\t\t\t'status' => 0,\n\t\t\t'code'\t => 501,\n\t\t\t'msg'\t => 'Not Implemented'\n\t\t);\n\t\tif(request::is_ajax())\n\t\t{\n\t\t\t$id = intval($this->input->get('id')); \n $value = $this->single($id);\n \n\t\t\t$return_template = $this->template = new View('template_blank');\n\t\t\t$this->template->content = $value;\n\t\t\t$return_str = $return_template->render();\n\t\t\t$return_struct['status'] = 1;\n\t\t\t$return_struct['code'] = 200;\n\t\t\t$return_struct['msg'] = 'Success';\n\t\t\t$return_struct['content'] = $return_str;\n\t\t\texit(json_encode($return_struct));\n\t\t}\n\t}", "public function ajaxpingAction()\r\n\t{\r\n\t\t$sid = $this->request->getParam(\"session\");\r\n\t\t$arr['live'] = $this->engine->ping($sid);\r\n $this->request->setParam(\"format\", \"json\");\r\n $this->request->setParam(\"render\", \"false\");\r\n $response = $this->getResponse(); \r\n $response->setContent(json_encode($arr)); \r\n // returned to View\\Listener\r\n return $response;\r\n\t}", "public function ajaxGuion() {\n\t\t\tif($this->peticion->ajax() == true):\n\t\t\t\t$this->existenciaDatos();\n\t\t\telse:\n\t\t\t\texit('Guión no fue creado por Error en petición Ajax');\n\t\t\tendif;\n\t\t}", "private function ajaxResponse()\n {\n echo json_encode($this->response);\n die(1);\n }", "function ajaxQueryServiceStatusDetails()\n {\n $serviceId = $_POST[\"serviceStatusId\"];\n\n if (!empty($serviceId)) {\n if (!is_numeric($serviceId)) {\n echo \"{}\";\n return;\n }\n\n $no = $this->NetworkOutage_model->getNetworkOutageById($serviceId);\n //header('Content-Type: text/javascript');\n $expNO = $this->exportNetworkOutageDetail($no->next());\n\n $exptNOResp = json_encode($expNO);\n if (is_null($_GET['callback'])) {\n echo $exptNOResp;\n } else {\n echo $_GET['callback']. '('. $exptNOResp .');';\n }\n } else {\n // return empty object\n echo \"{}\";\n }\n }", "public function gr_webforms_ajax_request()\n\t{\n\t\t$forms = $this->grApiInstance->getWebforms(array('sort' => array('name' => 'asc')));\n\t\t$response = json_encode(array('success' => $forms));\n\t\theader(\"Content-Type: application/json\");\n\t\techo $response;\n\t\texit;\n\t}", "public function _ajax()\n\t{\n\t\tswitch($this->action)\n\t\t{\t\t\t\t\n\t\t\tcase 'category':\t\t\t\t\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->posts_wrapper();\n\t\t\t\treturn $this->get_posts_list();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'view':\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->comments_wrapper();\n\t\t\t\treturn $this->get_comments_list($this->filter);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'submit':\n\t\t\t\treturn $this->add_post();\n\t\t\t\tbreak;\n\n\t\t\tcase 'vote':\n\t\t\t\treturn $this->vote();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'edit':\n\t\t\t\treturn $this->edit();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'my':\n\t\t\t\t# no sorter default to posts.\n\t\t\t\tif(empty($_GET['sort']))\n\t\t\t\t\treturn $this->my($this->filter);\n\t\t\t\t\n\t\t\t\t# has sorter, so we fetch raw content lists\n\t\t\t\tif('posts' == $this->filter)\n\t\t\t\t\treturn $this->my_posts_list();\n\t\t\t\tif('comments' == $this->filter)\n\t\t\t\t\treturn $this->my_comments_list();\n\t\t\t\tif('starred' == $this->filter)\n\t\t\t\t\treturn $this->my_starred_list();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn 'invalid url parameters';\n\t}", "public function ajaxVisuaDocente(){\n $item =\"id\";\n $valor = $this->idDocente;\n $respuesta = ControladorDocentes::ctrMostrarDocentes($item,$valor);\n echo json_encode($respuesta);\n\n}", "public function AJAX() {\n if (isset($_POST['fungsi'])) {\n if ($_POST['fungsi'] == 'encode') {\n echo $this->M_Divisi->AJAXencode($_POST['idDivisi']);\n } if ($_POST['fungsi'] == 'formatDateTime') {\n echo $this->M_Divisi->AJAX_formatDateTime($_POST);\n }\n } else if (!isset($_POST['fungsi'])) {\n echo $this->M_Divisi->getDivisi();\n }\n }", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "public function index_ajax()\n {\n $this->department->getDepartmentAjax();\n }", "function ajaxGetEmployeeStatusHistory() {\n $empId = $_GET['empId'];\n\n $employeeHistory = getEmployeeStatusHistory($empId);\n\n echo json_encode($employeeHistory);\n }", "abstract public function ajaxAction(): string;", "public function doing_ajax($action = \\null)\n {\n }", "public function doRequests();", "public function mp_hook_smsabo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('smsabo');\n\t\t}", "public function ajaxGetAction()\n {\n $this->view->disable();\n $response = new \\Phalcon\\Http\\Response();\n if (!$this->request->isAjax()) {\n echo \"is not Ajax ! \";\n }\n if (!$this->request->isPost()) {\n echo \"is not Post ! \";\n }\n $tokuisaki_bunrui4 = TokuisakiBunrui4Kbns::find(array(\n 'order' => 'cd',\n 'conditions' => ' cd LIKE ?1 ',\n 'bind' => array(1 => $this->request->getPost('cd').'%')\n ));\n $res_flds = [\"id\",\"cd\",\"name\",];\n $resData = array();\n foreach ($tokuisaki_bunrui4 as $bunrui4) {\n $resAdata = array();\n foreach ($res_flds as $res_fld) {\n $resAdata[$res_fld] = $bunrui4->$res_fld;\n }\n $resData[] = $resAdata;\n }\n $response->setContent(json_encode($resData));\n return $response;\n }", "function fatherly_fcr_handle_ajax()\n{\n include_once(__DIR__ . '/inc/classes/ContentRecirculation.php');\n $FCRInstance = FCR\\ContentRecirculation::init();\n switch ($_REQUEST['operation']) {\n case 'add':\n $results = $FCRInstance->addNewPostToRecirculation($_REQUEST['post_id']);\n break;\n case 'delete':\n $results = $FCRInstance->deletePostFromRecirculation($_REQUEST['post_id']);\n break;\n case 'reset':\n $results = $FCRInstance->resetPostProcessedStatus($_REQUEST['post_id']);\n break;\n }\n echo wp_json_encode($results);\n wp_die();\n}", "public function ajax(){\n\t\t//$where = \"author_id = 1 AND status = 'active'\";\n\t\t//$str = $this->db->update_string('table_name', $data, $where);\n\t\t//$this->db->get_where()\n\t\t//$this->db->get_where('mytable', array('id' => $id));\n\t\t//$this->db->get_where(\"clinc_meta\", \"meta_name\", \"1\")\n\t\t//count of record $this->db->count_all('clinc_meta')\n\t\t\n\t\techo json_encode(array (\n\t\t\t\"msg\" => \"ahmed\"\n\t\t\n\t\t));\n\t}", "public function ajax()\n {\n /*if($name!=\"\"){\n switch($name){\n case 'change_active':\n $post['active'] = $status;\n $this->User_model->update($post, $id); \n break;\n } \n exit;\n }*/\n \n $this->app->get_table_data('users'); \n }", "function ajax()\n {\n $json = \"\";\n $registros = $this->model->getRegistros();\n \n if($registros){\n $url_modificar = \"'\".base_url().\"index.php/\".$this->_subject.\"/abm/\";\n $btn_class = \"'btn btn-default'\";\n $icon_class = \"'fa fa-pencil-square-o'\";\n foreach ($registros as $row) {\n $url_final = $row->id_log.\"'\";\n \n $buttons = '<a class='.$btn_class.' href='.$url_modificar.$url_final.'><i class='.$icon_class.'></i></a> ';\n \n $registro = array(\n $row->date_add,\n $row->accion,\n $row->user_add,\n $row->programa,\n $buttons,\n );\n \n $json .= setJsonContent($registro);\n }\n } \n \n $json = substr($json, 0, -2);\n \n echo '{ \"data\": ['.$json.' ] }';\n }", "function ajaxGetEmployeeStatusFromDB() {\n $firstName = $_GET['firstName'];\n $lastName = $_GET['lastName'];\n $employeePin = $_GET['employeePin'];\n\n $employeeStatus = getEmployeeStatus($firstName, $lastName, $employeePin);\n\n echo json_encode($employeeStatus);\n }", "public static function ajax_callback(){\r\n\t\tif(empty($_GET['hid'])){ wp_die('hid is required'); }\r\n\t\tunset($_GET['action']);\r\n\t\tdie(file_get_contents(SpecialOffersSnippet::calculate_url($_GET)));\r\n\t}", "function ajaxCall($phpevent, $params=array(), $comps=array())\r\n {\r\n $jcomps=\"\";\r\n\r\n reset($comps);\r\n while(list($key, $val)=each($comps))\r\n {\r\n if ($jcomps!='') $jcomps.=',';\r\n $jcomps.='\"'.$val.'\"';\r\n }\r\n\r\n $jcomps=\"[$jcomps]\";\r\n\r\n $result =\" xajax_ajaxProcess('\".$this->owner->Name.\"','\".$this->Name.\"',params,'$phpevent',xajax.getFormValues('\".$this->owner->Name.\"'),$jcomps);\\n \";\r\n\r\n return($result);\r\n }", "public function adminAjax()\r\n\t{\r\n\t\treturn;\r\n\t}", "function ajaxUpdateEmployeeInDb() {\n $firstName = $_GET['firstName'];\n $lastName = $_GET['lastName'];\n $admin=$_GET['admin'];\n $loginName=$_GET['loginName'];\n $password=$_GET['password'];\n $employeeId=$_GET['employeeId'];\n $pin=$_GET['pin'];\n $result = updateEmployeeInDb($firstName, $lastName, $admin, $loginName, $password, $employeeId, $pin);\n echo json_encode($result);\n\n }", "function verify_ajax()\n {\n }", "public function echoAjaxContent() {\n\t\t\n\t\t$sSection = trim( $_GET[ 'section' ] );\n\t\t$sMethod = '';\n\t\t\n\t\tif ( $sSection ) {\n\t\t\t$sMethod = sprintf( 'get%sAjax', Geko_Inflector::camelize( $sSection ) );\n\t\t\tif ( !method_exists( $this, $sMethod ) ) $sMethod = '';\n\t\t}\n\t\t\n\t\tif ( $sMethod ) {\n\t\t\t$aAjaxResponse = $this->$sMethod();\n\t\t\techo Zend_Json::encode( $aAjaxResponse );\n\t\t}\n\t}", "public function ajax($name) {\n \n // Verify if session exists and if the user is admin\n $this->if_session_exists($this->user_role,0);\n \n // Verify if helper exists\n if ( file_exists( APPPATH . '/helpers/' . $name . '_helper.php' ) ) {\n \n // Get action's get input\n $action = $this->input->get('action');\n\n if ( !$action ) {\n $action = $this->input->post('action');\n }\n\n try {\n\n // Load Helper\n $this->load->helper($name . '_helper');\n \n // Call the function\n $action();\n\n } catch (Exception $ex) {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $ex->getMessage()\n );\n\n echo json_encode($data);\n\n }\n \n } else {\n \n show_error('Invalid parameters');\n \n }\n \n }", "public function ProcessAjax()\n {\n exit; // <<----------- this should exit\n }", "public function ajaxProcessSearchCustomers()\n {\n }", "public function requestAction()\n {\n return $this->returnAjaxResponse(self::REQUEST);\n }", "public function consultaColaboradoresPuestosAjax(){\n\t\t//$post_data = $this->input->post(NULL, TRUE);\n\t\t$this->output->set_content_type('application/json');\n\t\t$post_data = json_decode(file_get_contents(\"php://input\"), true);\n \tif($post_data!=null){\n \t\t$result = $this->m_colaborador->consultaPuestos($post_data);\n\t\t\tdie(json_encode($result));\n \t}\n\t}", "public function displayAjax()\n {\n http_response_code(400);\n $this->ajaxRenderJson(['error' => 'Invalid endpoint']);\n }", "public function ajaxAction() {\n $request = $this->getRequest()->getPost();\n\n //referring to the index\n //gets value from ajax request\n $message = $request['message'];\n\n // makes disable renderer\n $this->_helper->viewRenderer->setNoRender();\n\n //makes disable layout\n $this->_helper->getHelper('layout')->disableLayout();\n\n\n //return callback message to the function javascript\n $db = new Zend_Db_Adapter_Pdo_Mysql(array(\n 'host' => 'localhost',\n 'username' => 'root',\n 'password' => 'mysql',\n 'dbname' => 'database',\n 'charset' => 'utf8'\n ));\n $limit = $message;\n $stmt = $db->query(\n 'SELECT\n ts_prijmy_id AS id,\n datum_prijmu_d AS datum,\n nazov_skladu AS sklad,\n nazov_podskladu AS podsklad,\n nazov_spolocnosti AS dodavatel,\n prepravci.meno AS prepravca,\n prepravca_spz AS spz,\n q_tony_merane AS tony,\n q_m3_merane AS m3,\n q_vlhkost AS vlhkost,\n q_tony_nadrozmer AS nadrozmer,\n doklad_cislo AS doklad_cislo,\n materialy_typy.nazov AS typ,\n chyba,\n stav_transakcie AS stav,\n merna_jednotka_enum AS merna_jednotka\n FROM\n ts_prijmy\n LEFT JOIN sklady ON ts_prijmy.sklad_enum=sklady.sklady_id\n LEFT JOIN podsklady ON ts_prijmy.podsklad_enum=podsklady.podsklady_id\n LEFT JOIN dodavatelia ON ts_prijmy.dodavatel_enum=dodavatelia.dodavatelia_id\n LEFT JOIN prepravci ON ts_prijmy.prepravca_enum=prepravci.prepravci_id\n LEFT JOIN materialy_typy ON ts_prijmy.material_typ_enum=materialy_typy.materialy_typy_id\n LEFT JOIN materialy_druhy ON ts_prijmy.material_druh_enum=materialy_druhy.materialy_druhy_id'\n// LIMIT '.$limit\n );\n\n $vystup = (array) $stmt->fetchAll();\n $data = array('data' => $vystup);\n //print_r($vystup);\n echo json_encode($data, JSON_UNESCAPED_UNICODE);\n\n //print_r($vystup);\n /*\n echo \"\n <table style=\\\"width:100%\\\">\n \";\n echo\n \"<tr>\".\n \"<th>\".\"id\".\"</th>\".\n \"<th>\".\"datum\".\"</th>\".\n \"<th>\".\"sklad\".\"</th>\".\n \"<th>\".\"podsklad\".\"</th>\".\n \"<th>\".\"dodavatel\".\"</th>\".\n \"<th>\".'prepravca'.\"</th>\".\n \"<th>\".'spz'.\"</th>\".\n \"<th>\".'tony'.\"</th>\".\n \"<th>\".'m3'.\"</th>\".\n \"<th>\".'prm'.\"</th>\".\n \"<th>\".'listok'.\"</th>\".\n \"<th>\".'typ'.\"</th>\".\n \"<th>\".'druh'.\"</th>\".\n \"<th>\".'poznamka'.\"</th>\".\n \"<th>\".'chyba'.\"</th>\".\n \"<th>\".'stav'.\"</th>\".\n \"</tr>\";\n\n while ($row = $stmt->fetch()) {\n echo\n \"<tr>\".\n \"<td>\".$row['id'].\"</td>\".\n \"<td>\".$row['datum'].\"</td>\".\n \"<td>\".$row['sklad'].\"</td>\".\n \"<td>\".$row['podsklad'].\"</td>\".\n \"<td>\".$row['dodavatel'].\"</td>\".\n \"<td>\".$row['prepravca'].\"</td>\".\n \"<td>\".$row['spz'].\"</td>\".\n \"<td>\".$row['tony'].\"</td>\".\n \"<td>\".$row['m3'].\"</td>\".\n \"<td>\".$row['prm'].\"</td>\".\n \"<td>\".$row['listok'].\"</td>\".\n \"<td>\".$row['typ'].\"</td>\".\n \"<td>\".$row['druh'].\"</td>\".\n \"<td>\".$row['poznamka'].\"</td>\".\n \"<td>\".$row['chyba'].\"</td>\".\n \"<td>\".$row['stav'].\"</td>\".\n \"</tr>\";\n\n }\n\n echo \"\n </table>\n \";*/\n\n //return $message.\" + upgrade\";\n //print_r($stmt) ;\n //echo 'negga negga tnegga!';\n //print_r($jsonData);\n }", "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this->table[$id])) {\n return;\n }\n\n ob_get_clean();\n ob_start();\n header(\"Content-Type: application/json\");\n\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $settings = $this->settings[$id];\n\n if (isset($_POST['pageNum'])) {\n $settings['pageNum'] = $_POST['pageNum'];\n }\n\n if (isset($_POST['searchTxt'])) {\n $settings['searchTxt'] = $_POST['searchTxt'];\n }\n\n if (isset($_POST['sortKey'])) {\n $settings['sortKey'] = $_POST['sortKey'];\n }\n\n if (isset($_POST['sortDir'])) {\n $settings['sortDir'] = $_POST['sortDir'];\n }\n\n $this->settings[$id] = $settings;\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n $this->buildRows($id, $rows);\n\n exit;\n }", "public function actionAjax()\n {\n $url = $_POST['url'];\n $video_id = VideoLibrary::get_video_id($url);\n //check if link was parsed succesfully\n if ( $video_id ) \n {\n $json_output = VideoLibrary::get_json_output($video_id);\n $title = VideoLibrary::get_info($json_output,'title');\n $description = VideoLibrary::get_info($json_output,'description');\n $image = VideoLibrary::get_info($json_output,'thumbnails')->high->url;\n $video_url = \"http://www.youtube.com/embed/\" . $video_id;\n $json_array = [\"title\"=>$title, \"description\"=>$description, \"image\"=>$image, \"video_url\"=> $video_url ];\n echo json_encode($json_array);\n\n }\n }", "public function ajax()\n\t{\n\t\tif (is_ajax())\n\t\t{\n\t\t\t$this->load->helper('simplepie');\n\t\t\t$this->load->module_model(SAISAI_FOLDER, 'saisai_pages_model');\n\t\t\t$this->load->module_model(SAISAI_FOLDER, 'saisai_logs_model');\n\t\t\t$vars['recently_modifed_pages'] = $this->saisai_pages_model->find_all_array(array(), 'last_modified desc', 10);\n\t\t\t$vars['latest_activity'] = $this->saisai_logs_model->latest_activity(10);\n\t\t\tif (file_exists(APPPATH.'/views/_docs/saisai'.EXT))\n\t\t\t{\n\t\t\t\t$vars['docs'] = $this->load->module_view(NULL, '_docs/saisai', $vars, TRUE);\n\t\t\t}\n\t\t\t$feed = $this->saisai->config('dashboard_rss');\n\n\t\t\t$limit = 3;\n\t\t\t$feed_data = simplepie($feed, $limit);\n\n\t\t\t// check for latest version\n\t\t\tif (array_key_exists('latest_saisai_version', $feed_data) AND version_compare($feed_data['latest_saisai_version'], SAISAI_VERSION, '>'))\n\t\t\t{\n\t\t\t\t$vars['latest_saisai_version'] = $feed_data['latest_saisai_version'];\n\t\t\t}\n\t\t\tunset($feed_data['latest_saisai_version']);\n\t\t\t$vars['feed'] = $feed_data;\n\t\t\t$this->load->view('dashboard_ajax', $vars);\n\t\t}\n\t}", "private function send_ajax_request_info($result)\n {\n // Check if action was fired via Ajax call. If yes, JS code will be triggered, else the user is redirected to the user page\n if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {\n $result = json_encode($result);\n echo $result;\n } else {\n header(\"Location: \".$_SERVER[\"HTTP_REFERER\"]);\n }\n\n // don't forget to end your scripts with a die() function - very important\n die();\n }", "public function callAjaxUpdate () {\n return $this->callAjaxInit();\n }", "final public function ajax_response($data = array())\n\t{\n\t\t$data = array_merge($this->data, $data);\n\t\tsend_json_reponse($data);\n\t}", "public function ajaxevents() {\n\t\t$pageTitle = 'Events';\n\t\t$this->autoRender = false;\n\t\t$this->viewBuilder()->setLayout(false);\n\t\t$this->loadModel('Events');\n\t\t$today = date(\"Y-m-d\");\n\t\tif ($this->request->is('ajax')) {\n\n\t\t\t$events = $this->Events->find()->where(['Events.published' => 1, 'DATE(Events.start_date) >' => $today])->order(['Events.start_date' => 'ASC'])->limit(3)->offset($this->request->getData()['offset'])->all();\n\t\t\techo json_encode(array(\"status\" => \"success\", \"data\" => $events));\n\t\t\texit;\n\n\t\t}\n\n\t}", "function ajax_add()\n {\n\t\n }", "public function ejecutaAjax() {\n \n $ajaxController = new \\controllers\\ajaxController();\n $respuestaAjax = $ajaxController->addProducto($this->codigo, $this->producto, $this->cantidad, $this->valor);\n echo $respuestaAjax;\n }", "function ListPage_Ajax(&$params) \n\t{\n\t\t// call parent constructor\n\t\tparent::ListPage ($params);\t\n\t}", "public function ajaxGetStats()\n {\n $amount_of_employees = $this->model->getAmountOfEmployees();\n\n // simply echo out something. A supersimple API would be possible by echoing JSON here\n echo $amount_of_employees;\n }", "function ajaxToggleEmployeeStatusInDB() {\n $firstName = $_GET['firstName'];\n $lastName = $_GET['lastName'];\n $comment = $_GET['comment'];\n\n $result = toggleEmployeeStatus($firstName, $lastName, $comment);\n\n echo $result;\n }", "function ajaxRequest($url, $post=null)\n{\n $d = httpRequest($url, $post);\n return json_decode($d['data'], false); // return Object\n}", "public function get_all_items_ajax()\r\n {\r\n if ($this->input->is_ajax_request()) {\r\n echo json_encode($this->invoice_items_model->get_all_items_ajax());\r\n }\r\n }", "function ajaxQueryServiceStatuses()\n {\n $suburb = $_POST[\"serviceStatusSuburb\"];\n if (is_null($suburb)) {\n $suburb = \"\";\n }\n\n // only 'Online' accessible.\n $status = 3;\n $nos = $this->NetworkOutage_model->getBySuburb($suburb, $status);\n $planned = array();\n $unexpected = array();\n while($no = $nos->next())\n {\n //echo json_encode($no);\n $expNO = $this->exportNetworkOutageBrief($no);\n if ($expNO['type'] === \"Planned\") {\n $planned[] = $expNO;\n } else {\n $expNO['type'] = \"Unplanned\";\n $unexpected[] = $expNO;\n }\n }\n\n $networkOutages = array();\n $networkOutages[\"Planned\"] = $planned;\n $networkOutages[\"Unexpected\"] = $unexpected;\n\n $jsonResp = json_encode($networkOutages);\n if (is_null($_GET['callback'])) {\n echo $jsonResp;\n } else {\n echo $_GET['callback']. '('. $jsonResp .');';\n }\n }", "function wp_ajax_fetch_list()\n {\n }", "public function ajaxAction() {\n $result = $this->_auth->authenticate($this->_adapter);\n if ($result->isValid()) {\n $this->_auth->getStorage()->write(array(\"identity\" => $result->getIdentity(), \"user\" => new Josh_Auth_User($this->_type, $result->getMessages())));\n\n $ident = $this->_auth->getIdentity();\n\n $loggedIn = $this->view->partial('partials/userLoggedIn.phtml', array('userObj' => $ident['user']));\n $alert = $this->view->partial('partials/alert.phtml', array('alert' => 'Successful Login', 'alertClass' => 'alert-success'));\n\n $html = array(\"#userButton\" => $loggedIn, \"alert\" => $alert);\n $this->jsonResponse('success', 200, $html);\n } else {\n $errorMessage = $result->getMessages();\n $alert = $this->view->partial('partials/alert.phtml', array('alert' => $errorMessage['error'], 'alertClass' => 'alert-error'));\n\n $html = array(\"alert\" => $alert);\n $this->jsonResponse('error', 401, $html, $errorMessage['error']);\n }\n }", "function training_ajax_callback() {\n ctools_include('ajax');\n $output = ctools_ajax_text_button('Click me!', 'training/ctools/ajax/callback-text', 'Click');\n\n return $output;\n}", "public function compAjaxUpdate() {\r\n $req = $this->input->post('req');\r\n updateComponentDetails($req);\r\n }", "function ajaxWriteCommentIntoDB() {\n $firstName = $_GET['firstName'];\n $lastName = $_GET['lastName'];\n $comment = $_GET['comment'];\n\n $result = writeComment($firstName, $lastName, $comment);\n\n echo json_encode($result);\n }", "function getRegistroAJAX() {\n if (@$_POST['operacao']) {\n switch ($_POST['operacao']) {\n /**\n * Retorna quantidade de permissões por departamento cadastrado.\n */\n case 'getEstatisticaPermissaoDepartamento':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getQuantidadePermissaoPadraoDepartamento(15);\n print_r(json_encode($retorno));\n die();\n /**\n * Efetua edição do registro informado por parametro.\n */\n case 'getListaControleRegistro':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getListaRegistroControle($_POST['pesquisa']);\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna quantidade de registros cadastrados dentro do sistema\n */\n case 'getTotalRegistro':\n $permissaoDAO = new PermissaoDAO();\n print_r(json_encode($permissaoDAO->getTotalCadastro()));\n die();\n /**\n * Retorna registro solicitado por parametro.\n */\n case 'getRegistro':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getRegistroVetor(@$_POST['idPermissao']);\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna os cargos que possuem permissão informada.\n */\n case 'getDepartamentoPermissao':\n $retorno = [];\n $departamentoDAO = new DepartamentoDAO();\n $retorno = $departamentoDAO->getListaDepartamentoPermissao(@$_POST['idPermissao']);\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna lista de permissões do usuário.\n */\n case 'getPermissaoUsuario':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getListaUsuarioPermissao(@$_POST['idPermissao']);\n print_r(json_encode($retorno));\n die();\n /**\n * Lista de registros vinculados ao departamento informado.\n */\n case 'getListaDepartamentoRegistroPadrao':\n $retorno = [];\n if (@$_POST['id']) {\n $departamentoDAO = new DepartamentoDAO();\n $resultado = $departamentoDAO->getListaDepartamentoPermissao(intval($_POST['id']));\n foreach ($resultado as $value) {\n $registro['id'] = $value->getId();\n $registro['nome'] = $value->getNome();\n array_push($retorno, $registro);\n }\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna estatistica do controle de permissões.\n */\n case 'getEstatisticaControle':\n $permissaoDAO = new PermissaoDAO();\n print_r(json_encode($permissaoDAO->getRegistroControle()));\n die();\n /**\n * Retorna lista de permissoes disponiveis de acordo com o \n * departamento do usuario.\n */\n case 'getListaPermissaoDisponivel':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1) {\n $retorno = $permissaoDAO->getListaPermissaoVetor();\n } else {\n $retorno = $permissaoDAO->getListaPermissaoVetor(Sessao::getUsuario()->getId());\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna lista de permissoes do usuario informado por parametro.\n */\n case 'getListaPermissaoUsuario':\n $retorno = [];\n if (@$_POST['idUsuario']) {\n $permissaoDAO = new PermissaoDAO();\n $usuarioDAO = new UsuarioDAO();\n if ($usuarioDAO->getUsuarioAdministrador($_POST['idUsuario'])) {\n $retorno = $permissaoDAO->getListaPermissaoVetor();\n } else {\n $retorno = $permissaoDAO->getListaPermissaoVetor($_POST['idUsuario']);\n }\n }\n print_r(json_encode($retorno));\n die();\n }\n }\n echo 1;\n }", "function processRequests()\n\t{\n\n\t\t$requestMode = -1;\n\t\t$sFunctionName = \"\";\n\t\t$bFoundFunction = true;\n\t\t$bFunctionIsCatchAll = false;\n\t\t$sFunctionNameForSpecial = \"\";\n\t\t$aArgs = array();\n\t\t$sPreResponse = \"\";\n\t\t$bEndRequest = false;\n\t\t$sResponse = \"\";\n\n\t\t$requestMode = $this->getRequestMode();\n\t\tif ($requestMode == -1) return;\n\n\t\tif ($requestMode == XAJAX_POST)\n\t\t{\n\t\t\t$sFunctionName = $_POST[\"xajax\"];\n\n\t\t\tif (!empty($_POST[\"xajaxargs\"]))\n\t\t\t\t$aArgs = $_POST[\"xajaxargs\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t\theader (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n\t\t\theader (\"Cache-Control: no-cache, must-revalidate\");\n\t\t\theader (\"Pragma: no-cache\");\n\n\t\t\t$sFunctionName = $_GET[\"xajax\"];\n\n\t\t\tif (!empty($_GET[\"xajaxargs\"]))\n\t\t\t\t$aArgs = $_GET[\"xajaxargs\"];\n\t\t}\n\n\t\t// Use xajax error handler if necessary\n\t\tif ($this->bErrorHandler) {\n\t\t\t$GLOBALS['xajaxErrorHandlerText'] = \"\";\n\t\t\tset_error_handler(\"xajaxErrorHandler\");\n\t\t}\n\n\t\tif ($this->sPreFunction) {\n\t\t\tif (!$this->_isFunctionCallable($this->sPreFunction)) {\n\t\t\t\t$bFoundFunction = false;\n\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t$objResponse->addAlert(\"Unknown Pre-Function \". $this->sPreFunction);\n\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t}\n\t\t}\n\t\t//include any external dependencies associated with this function name\n\t\tif (array_key_exists($sFunctionName,$this->aFunctionIncludeFiles))\n\t\t{\n\t\t\tob_start();\n\t\t\tinclude_once($this->aFunctionIncludeFiles[$sFunctionName]);\n\t\t\tob_end_clean();\n\t\t}\n\n\t\tif ($bFoundFunction) {\n\t\t\t$sFunctionNameForSpecial = $sFunctionName;\n\t\t\tif (!array_key_exists($sFunctionName, $this->aFunctions))\n\t\t\t{\n\t\t\t\tif ($this->sCatchAllFunction) {\n\t\t\t\t\t$sFunctionName = $this->sCatchAllFunction;\n\t\t\t\t\t$bFunctionIsCatchAll = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$bFoundFunction = false;\n\t\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t\t$objResponse->addAlert(\"Unknown Function $sFunctionName.\");\n\t\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($this->aFunctionRequestTypes[$sFunctionName] != $requestMode)\n\t\t\t{\n\t\t\t\t$bFoundFunction = false;\n\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t$objResponse->addAlert(\"Incorrect Request Type.\");\n\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t}\n\t\t}\n\n\t\tif ($bFoundFunction)\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($aArgs); $i++)\n\t\t\t{\n\t\t\t\t// If magic quotes is on, then we need to strip the slashes from the args\n\t\t\t\tif (get_magic_quotes_gpc() == 1 && is_string($aArgs[$i])) {\n\n\t\t\t\t\t$aArgs[$i] = stripslashes($aArgs[$i]);\n\t\t\t\t}\n\t\t\t\tif (stristr($aArgs[$i],\"<xjxobj>\") != false)\n\t\t\t\t{\n\t\t\t\t\t$aArgs[$i] = $this->_xmlToArray(\"xjxobj\",$aArgs[$i]);\n\t\t\t\t}\n\t\t\t\telse if (stristr($aArgs[$i],\"<xjxquery>\") != false)\n\t\t\t\t{\n\t\t\t\t\t$aArgs[$i] = $this->_xmlToArray(\"xjxquery\",$aArgs[$i]);\n\t\t\t\t}\n\t\t\t\telse if ($this->bDecodeUTF8Input)\n\t\t\t\t{\n\t\t\t\t\t$aArgs[$i] = $this->_decodeUTF8Data($aArgs[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->sPreFunction) {\n\t\t\t\t$mPreResponse = $this->_callFunction($this->sPreFunction, array($sFunctionNameForSpecial, $aArgs));\n\t\t\t\tif (is_array($mPreResponse) && $mPreResponse[0] === false) {\n\t\t\t\t\t$bEndRequest = true;\n\t\t\t\t\t$sPreResponse = $mPreResponse[1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$sPreResponse = $mPreResponse;\n\t\t\t\t}\n\t\t\t\tif (is_a($sPreResponse, \"xajaxResponse\")) {\n\t\t\t\t\t$sPreResponse = $sPreResponse->getXML();\n\t\t\t\t}\n\t\t\t\tif ($bEndRequest) $sResponse = $sPreResponse;\n\t\t\t}\n\n\t\t\tif (!$bEndRequest) {\n\t\t\t\tif (!$this->_isFunctionCallable($sFunctionName)) {\n\t\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t\t$objResponse->addAlert(\"The Registered Function $sFunctionName Could Not Be Found.\");\n\t\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($bFunctionIsCatchAll) {\n\t\t\t\t\t\t$aArgs = array($sFunctionNameForSpecial, $aArgs);\n\t\t\t\t\t}\n\t\t\t\t\t$sResponse = $this->_callFunction($sFunctionName, $aArgs);\n\t\t\t\t}\n\t\t\t\tif (is_a($sResponse, \"xajaxResponse\")) {\n\t\t\t\t\t$sResponse = $sResponse->getXML();\n\t\t\t\t}\n\t\t\t\tif (!is_string($sResponse) || strpos($sResponse, \"<xjx>\") === FALSE) {\n\t\t\t\t\t$objResponse = new xajaxResponse();\n\t\t\t\t\t$objResponse->addAlert(\"No XML Response Was Returned By Function $sFunctionName.\");\n\t\t\t\t\t$sResponse = $objResponse->getXML();\n\t\t\t\t}\n\t\t\t\telse if ($sPreResponse != \"\") {\n\t\t\t\t\t$sNewResponse = new xajaxResponse($this->sEncoding, $this->bOutputEntities);\n\t\t\t\t\t$sNewResponse->loadXML($sPreResponse);\n\t\t\t\t\t$sNewResponse->loadXML($sResponse);\n\t\t\t\t\t$sResponse = $sNewResponse->getXML();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$sContentHeader = \"Content-type: text/xml;\";\n\t\tif ($this->sEncoding && strlen(trim($this->sEncoding)) > 0)\n\t\t\t$sContentHeader .= \" charset=\".$this->sEncoding;\n\t\theader($sContentHeader);\n\t\tif ($this->bErrorHandler && !empty( $GLOBALS['xajaxErrorHandlerText'] )) {\n\t\t\t$sErrorResponse = new xajaxResponse();\n\t\t\t$sErrorResponse->addAlert(\"** PHP Error Messages: **\" . $GLOBALS['xajaxErrorHandlerText']);\n\t\t\tif ($this->sLogFile) {\n\t\t\t\t$fH = @fopen($this->sLogFile, \"a\");\n\t\t\t\tif (!$fH) {\n\t\t\t\t\t$sErrorResponse->addAlert(\"** Logging Error **\\n\\nxajax was unable to write to the error log file:\\n\" . $this->sLogFile);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfwrite($fH, \"** xajax Error Log - \" . strftime(\"%b %e %Y %I:%M:%S %p\") . \" **\" . $GLOBALS['xajaxErrorHandlerText'] . \"\\n\\n\\n\");\n\t\t\t\t\tfclose($fH);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sErrorResponse->loadXML($sResponse);\n\t\t\t$sResponse = $sErrorResponse->getXML();\n\n\t\t}\n\t\tif ($this->bCleanBuffer) while (@ob_end_clean());\n\t\tprint $sResponse;\n\t\tif ($this->bErrorHandler) restore_error_handler();\n\n\t\tif ($this->bExitAllowed)\n\t\t\texit();\n\t}", "public function mp_hook_abo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('abo');\n\t\t}", "function handleGetInteractionAjaxEndpoint(array $params) {\r\n $serviceRequestID = $params['sr_id'];\r\n $extServerType = $params['ext_server_type'];\r\n\r\n // switch to different function based on external server type\r\n if ($extServerType === 'MOCK') {\r\n // Mock Server specific\r\n } else if ($extServerType === 'SIEBEL') {\r\n echo $this->getDataForSiebel($serviceRequestID);\r\n } else {\r\n echo $this->getAjaxJsonResponse(null, 'Invalid External Server type');\r\n }\r\n }", "public static function ajaxRequest($params){\n $response='$.ajax({';\n // $response='$.ajax({';\n if(array_key_exists('url',$params))\n {\n $response.='url:\"' .$params['url'].'\",';\n }\n if(array_key_exists('type',$params))\n {\n $response.='method:\"' .$params['type'].'\",';\n }\n if(array_key_exists('data',$params))\n {\n $val='';\n $i=0;\n foreach($params['data'] as $k=>$v){\n if($i==0)\n {\n $val .= ''.$k.':'.'\"'.$v.'\"'; \n }\n else{\n $val .=',';\n $val .= ''.$k.':'.'\"'.$v.'\"'; \n }\n $i++; \n }\n $response.='data:{' .$val.'},';\n }\n $response .='success:function(response){'; \n if(array_key_exists('update', $params))\n {\n $response .= '$(\"#'.$params['update'].'\").html(response);'; \n \n }\n else\n {\n $response .= 'console.log(response);';\n }\n $response .='}';\n $response .= '});';\n return $response;\n \n }", "public function xhrGetListings()\n {\n $result = $this->db->select(\"SELECT * FROM data\");\n echo json_encode($result);\n }", "public function ajax_details()\n\t{\n\t\t$member_id = $this->input->post(\"id\");\n\t\t\n\t\t$returnAJAX = $this->members_model->read_form($member_id);\n\n\t\techo json_encode($returnAJAX);\n\t}", "public function apps_ajax($app) {\n \n // Verify if session exists and if the user is admin\n $this->if_session_exists($this->user_role,0);\n \n // Prepare the app\n $app = str_replace('-', '_', $app);\n \n // Verify if the app exists\n if ( is_dir( APPPATH . '/apps/collection/' . $app . '/' ) ) {\n \n // Require the Apps class\n $this->load->file( APPPATH . '/apps/main.php' );\n\n // Call the apps class\n $apps = new MidrubApps\\MidrubApps();\n \n // Call the ajax controller\n $apps->ajax_init($app);\n \n } else {\n \n show_error('App not found');\n \n }\n \n }", "abstract public function updateAjax($ajax_id, $id);", "public function ajaxCallback($type);", "public function shared_ajax() {\n\t\tif (empty($_POST['subaction']) || empty($_POST['nonce']) || !is_user_logged_in() || !wp_verify_nonce($_POST['nonce'], 'tfa_shared_nonce')) die('Security check (3).');\n\n\t\tif ($_POST['subaction'] == 'refreshotp') {\n\n\t\t\tglobal $current_user;\n\n\t\t\t$tfa_priv_key_64 = get_user_meta($current_user->ID, 'tfa_priv_key_64', true);\n\n\t\t\tif (!$tfa_priv_key_64) {\n\t\t\t\techo json_encode(array('code' => ''));\n\t\t\t\tdie;\n\t\t\t}\n\n\t\t\techo json_encode(array('code' => $this->getTFA()->generateOTP($current_user->ID, $tfa_priv_key_64)));\n\t\t\texit;\n\t\t}\n\n\t}", "public function ajaxProcessSearchProduct()\n {\n }", "public function sendAjax($data){\n header(\"Content-Type:application/json\"); // Cabecera que indica el tipo de datos que recibe.\n echo json_encode($data); // Imprime los datos dentro de objetos JSON.\n }", "public function get_ajax_request() {\n\t\t$result = new stdClass;\n\n\t\tif ($this->type === 'list') {\n\t\t\t$result->categories = $this->get_addon_categories($this->addons);\n\t\t}\n\n\t\t$result->type = $this->type;\n\t\t$result->rowIndex \t\t= $this->row_index;\n\t\t$result->columnIndex \t= $this->column_index;\n\t\t$result->addonIndex \t= $this->addon_index;\n\t\t$result->addonName \t\t= $this->addon_name;\n\t\t$result->data \t \t\t\t= $this->get_settings_result();\n\t\t$result->status = true;\n\n\t\treturn json_encode($result);\n\t}", "public function ajaxCartAction()\r\n\t{\r\n\r\n\t\t$result = $this->_model->ajaxCart($this->_arrParam);\r\n\t\techo json_encode($result);\r\n\t}", "public function isAjax();", "function jsonAction()\n {\n $this->disableLayout();\n $this->_helper->viewRenderer->setNoRender();\n\n $request_data = $this->_getAllParams();\n\n $method_name = $this->_getParam('method');\n if(!isset($method_name))\n {\n echo \"Inconsistent request\";\n exit;\n }\n\n $request_data = $this->_getAllParams();\n // Handle XML-RPC request\n $this->kwWebApiCore = new KwWebApiRestCore($this->apiSetup, $this->apicallbacks, array_merge($request_data, array('format' => 'json')));\n }", "public function ajax_call(): void\n {\n $order_number = filter_input(INPUT_POST, 'orderNumber');\n $email = filter_input(INPUT_POST, 'email');\n $widget_id = filter_input(INPUT_POST, 'widgetId');\n $options = get_option($this->option_name);\n\n [\n 'wordpress_url' => $wordpress_url,\n 'woocommerce_ck' => $woocommerce_ck,\n 'woocommerce_cs' => $woocommerce_cs\n ] = $options[$widget_id];\n\n $response = wp_remote_get(\"{$wordpress_url}/wp-json/wc/v2/orders/{$order_number}\", [\n 'headers' => [\n 'Authorization' => 'Basic ' . base64_encode(\n sprintf('%s:%s', $woocommerce_ck, $woocommerce_cs)\n )\n ]\n ]);\n\n $response_body = json_decode(wp_remote_retrieve_body($response), true);\n\n if (\n (isset($response_body['billing']['email']) && $response_body['billing']['email'] !== $email) ||\n wp_remote_retrieve_response_code($response) !== 200\n ) {\n echo esc_html__('Given order could not be found. ', self::NAMESPACE);\n exit;\n }\n\n echo sprintf(\n '%s: <b>%s</b>',\n esc_html__('Your order status is', self::NAMESPACE),\n mb_strtoupper($response_body['status'])\n );\n\n exit;\n }", "protected function getAjaxUri() {}" ]
[ "0.7756016", "0.7429026", "0.7399784", "0.72049713", "0.71762925", "0.71163887", "0.7108627", "0.71058875", "0.70323986", "0.70308363", "0.6992741", "0.6980777", "0.6840029", "0.6778799", "0.6778799", "0.6769117", "0.67611665", "0.67447984", "0.668518", "0.6681877", "0.65852225", "0.6571697", "0.65662825", "0.65619886", "0.65591985", "0.65397054", "0.65025985", "0.6488736", "0.6484509", "0.648417", "0.6475428", "0.64738566", "0.6469927", "0.64502037", "0.6446472", "0.6431458", "0.6424866", "0.6409723", "0.64059967", "0.6400379", "0.63900965", "0.6386651", "0.6384266", "0.6382162", "0.63769484", "0.63455474", "0.633064", "0.63066286", "0.62959725", "0.6291954", "0.6285406", "0.62753904", "0.6273394", "0.62665266", "0.62658733", "0.62534535", "0.62508917", "0.62321866", "0.6227646", "0.62217855", "0.6215908", "0.621363", "0.6211867", "0.6209714", "0.6201575", "0.6177672", "0.6167085", "0.61530596", "0.61521244", "0.6151876", "0.6143108", "0.611952", "0.6109664", "0.6107539", "0.61028886", "0.6094575", "0.6085665", "0.6084543", "0.6084047", "0.60661966", "0.6064302", "0.60633385", "0.6060875", "0.6045025", "0.6043205", "0.6038246", "0.60377234", "0.603426", "0.6025524", "0.60139275", "0.60021216", "0.59981865", "0.5988858", "0.59869725", "0.59849083", "0.5983173", "0.5974246", "0.5974024", "0.59738344", "0.59721315", "0.5969521" ]
0.0
-1
/////////////////////////////////////////////////////////////////////////////// Adds a metarefresh tag in the header of the site to redirect all traffic to a specific URL every X seconds. ///////////////////////////////////////////////////////////////////////////////
function add_metarefresh() { $post_url; // Redirects to a custom URL if(METAREFRESH_CUSTOM_URL){ $post_url = METAREFRESH_URL ? METAREFRESH_URL : get_bloginfo('url'); // Redirects to a random address within an array or URL } else if(METAREFRESH_CUSTOM_URL_ARRAY){ $url_array = unserialize(METAREFRESH_URL_ARRAY); $post_url = $url_array[ rand(0, count($url_array)-1) ]; // Redirects to 'previous post' } else { $prev_post = get_previous_post(true); if (!empty( $prev_post )){ $post_url = get_permalink($prev_post->ID); } else { $recent_post = wp_get_recent_posts( array('numberposts' => 1), ARRAY_A ); $post_url = get_permalink($recent_post[0]['ID']); } } // Print Refresh HTML tag echo '<meta http-equiv="refresh" content="' . METAREFRESH_LENGTH . '; url=' . $post_url . '">'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function app_auto_refresh(int $delay)\n{\n header('Refresh: ' . $delay . '; ' . $_SERVER['REQUEST_URI']);\n}", "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}", "function redirect($url)\n{\n echo '<meta http-equiv=\"Refresh\" content=\"0; URL=' . $url . '\">';\n}", "function redirect($url,$delay) {\n\t\techo '<meta http-equiv=\"refresh\" content=\"'.$delay.';url='.$url.'\">'; \n\t}", "function refreshPage($tiempo,$url)\n{\n print \"<META HTTP-EQUIV=\\\"Refresh\\\" CONTENT=\\\"$tiempo; URL=$url\\\">\";\n if($tiempo==0)\n exit();\n}", "function DvRedirect($url, $time)\n{\n header('refresh:'.$time.';url='.$url);\n}", "function refresh($cooldown){\r\n\t\techo(\"<meta http-equiv='refresh' content='0'>\"); \r\n\r\n\t}", "public static function refresh(int $interval): MetaTag {\n return static::httpEquiv('refresh', $interval);\n }", "function send_future_expire_header($offset=2600000)\n{\n if (headers_sent())\n return;\n\n header(\"Expires: \".gmdate(\"D, d M Y H:i:s\", mktime()+$offset).\" GMT\");\n header(\"Cache-Control: max-age=$offset\");\n header(\"Pragma: \");\n}", "public static function custom_page($page)\n {\n $page_to_redirect = HTTPS_SERVER.$page;\n echo '<meta http-equiv=\"refresh\" content=\"1;url='. $page_to_redirect .'\" />';\n header('Refresh: 1;url=' . $page_to_redirect);\n }", "function print_redirect_header($redirect_url) {\n?><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 TRANSITIONAL//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<title>lint_php</title>\n\t<meta http-equiv=\"refresh\" content=\"0;url=<?php echo $redirect_url; ?>\" />\n</head>\n<body>\n</body>\n</html>\n<?php\n}", "public function refresh() {\n\t\t$this->redirect( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/' );\n\t}", "public static function refresh($seconds, $route)\n {\n return header(\"refresh:{$seconds}; url='{$route}'\");\n }", "function refreshIntervalHeader() {\n\t\techo \"<h3>\".__('Adjust cache update interval (student)', lepress_textdomain).\"</h3>\";\n\t}", "function forwardJSP($newPage,$title) {\r\n echo \"<html>\";\r\n echo \"<head>\";\r\n echo \"<meta http-equiv=refresh content=1;url=\".$newPage.\" >\";\r\n echo \"<link rel=stylesheet type=\\\"text/css\\\" href=\\\"/css/site.css\\\">\";\r\n echo \"<title>\".$title.\"</title>\";\r\n echo \"</head>\";\r\n echo \"<h1>The page &quot;\".$title.\"&quot; has been converted to JSP</h1>\";\r\n echo \"<body >I am redirecting you to the new version at <A href=\".$newPage.\" >\".$newPage.\"</A>\";\r\n echo \"</body>\";\r\n echo \"</html>\";\r\n}", "function genMetaRefresh($jobId) {\n $this->printDebugMessage('genMetaRefresh', 'Begin', 2);\n $statusUrl = \"?jobId=$jobId\";\n $retVal = \"<meta http-equiv=\\\"refresh\\\" content=\\\"10;url=$statusUrl\\\">\";\n $this->printDebugMessage('genMetaRefresh', 'Begin', 2);\n return $retVal;\n }", "function redirectPage($Msg ,$url = null,$seconds = 3){\n if($url === null){\n $url = \"index.php\";\n $link = \"Home Page\";\n }else{\n if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ){\n $url = $_SERVER['HTTP_REFERER'];\n $link = 'previes Page';\n }else{\n $url = \"index.php\";\n $link = \"Home Page\";\n }\n }\n echo $Msg ;\n echo \"<div class = 'alert alert-info'> You will be redirect to $link after $seconds Seconds </div>\";\n header(\"Refresh:$seconds ; url=$url\");\n exit();\n}", "function boink_it($url)\n\t{\n\t\t// Ensure &amp;s are taken care of\n\t\t\n\t\t$url = str_replace( \"&amp;\", \"&\", $url );\n\t\t\n\t\tif ($this->vars['header_redirect'] == 'refresh')\n\t\t{\n\t\t\t@header(\"Refresh: 0;url=\".$url);\n\t\t}\n\t\telse if ($this->vars['header_redirect'] == 'html')\n\t\t{\n\t\t\t$url = str_replace( '&', '&amp;', str_replace( '&amp;', '&', $url ) );\n\t\t\techo(\"<html><head><meta http-equiv='refresh' content='0; url=$url'></head><body></body></html>\");\n\t\t\texit();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@header(\"Location: \".$url);\n\t\t}\n\t\texit();\n\t}", "private function refreshCache()\n {\n\n\t\t// any valid date in the past\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t// always modified right now\n\t\theader(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n\t\t// HTTP/1.1\n\t\theader(\"Cache-Control: private, no-store, max-age=0, no-cache, must-revalidate, post-check=0, pre-check=0\");\n\t\t// HTTP/1.0\n\t\theader(\"Pragma: no-cache\");\n\t}", "function refresh($loc = null) {\n header('Location: ' . ($loc != null ? $loc : 'showAllPlaylists.php'));\n die();\n}", "function redirect($url,$time=0) {\r\n\techo \"<p>Transaction en cours</p>\";\r\n\techo \"<img src=\\\"images/ajax-loader.gif\\\" alt=\\\"loader\\\">\";\r\n\r\n\t// message de confirmation\r\n\techo(\"<script>alert(\\\"Commande effectuée !\\\")</script>\");\r\n\techo \"<meta http-equiv=\\\"refresh\\\" content=\\\"$time; URL=$url\\\" />\";\r\n\r\n\texit();\r\n}", "function redirectTo($theMsg, $url = null, $seconds = 3) {\n\n if ($url === null) {\n $url = 'index.php';\n } else {\n if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ) {\n $url = $_SERVER['HTTP_REFERER'];\n } else {\n $url = 'index.php';\n }\n }\n echo '<div class=\"container\">';\n echo $theMsg;\n echo \"<div class='alert alert-info'>Redirect After $seconds Seconds</div>\";\n echo '</div>';\n header(\"refresh:$seconds;url=$url\");\n\n exit();\n}", "private function reload() {\r\n\r\n \t\t$timestamp = (int) (microtime(true) * 1000);\r\n\r\n \t\t// if the value is empty\r\n \t\tif ($this->NEXT_REQUEST_TIMESTAMP > $timestamp) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\t$this->load();\r\n \t}", "public function gheader($url) \n\t{\n\t//echo '<!DOCTYPE HTML>\n//<html lang=\"en-US\">\n//<head>\n // <meta charset=\"UTF-8\">\n //<title></title>\n//</head>\n//<body>\n // <a id=\"links\" href=\"#\" style=\"display:none;\"></a>\n // <script type=\"text/javascript\">\n // var obj = document.getElementById(\"links\");\n // obj.href = \"'.$url.'\";\n // obj.click();\n // </script>\n//</body>\n//</html>';\t\n\techo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"refresh\" content=\"0;url='.$url.'\"/> \n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />\n<title></title>\n<style type=\"text/css\">\n\n</style>\n</head>\n<body>\n</body>\n</html>';\n\texit(); \n\t}", "function redirect($pagePath){\n\theader(\"Location: \" . $pagePath);\n\techo '<META HTTP-EQUIV=\"Refresh\" Content=\"0; URL='.$pagePath.'\">';\n\techo \"<script type='text/javascript'>window.location = '\".$pagePath.\"'</script>\";\n}", "public function incrementExpiresAt();", "function redirect ($url)\n{\n\t// Behave as per HTTP/1.1 spec for cool webservers\n\theader('Location: ' . $url);\n\n\t// Redirect via an HTML form for un-cool webservers\n\tprint(\n\t\t'<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">'\n\t\t. '<html>'\n\t\t\t. '<head>'\n\t\t\t\t. '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">'\n\t\t\t\t. '<meta http-equiv=\"refresh\" content=\"0; url=' . $url . '\">'\n\t\t\t\t. '<title>Redirecting...</title>'\n\t\t\t. '</head>'\n\t\t\t. '<body>'\n\t\t\t\t. 'If you are not redirected in 5 seconds, please click <a href=\"' . $url . '\">here</a>.'\n\t\t\t. '</body>'\n\t\t. '</html>'\n\t);\n\t\n\t// Exit\n\texit;\n}", "public static function expires($date)\n {\n $expires = 60*60*24*14;\n header(\"Pragma: public\");\n header(\"Cache-Control: maxage=\".$expires);\n header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');\n }", "function aggregator_refresh($feed) {\n global $channel, $image, $db;\n\n // Generate conditional GET headers.\n $headers = array();\n if ($feed->etag) {\n $headers['If-None-Match'] = $feed->etag;\n }\n if ($feed->modified) {\n $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed->modified) .' GMT';\n }\n\n // Request feed.\n $result = http_request($feed->category_feed, $headers);\n\n // Process HTTP response code.\n switch ($result->code) {\n case 304:\n // No new syndicated content from site\n $db->query('UPDATE feed_data SET checked = ' . time() . ' WHERE id = '. $feed->id);\n break;\n case 301:\n // Updated URL for feed\n $feed->category_feed = $result->redirect_url;\n $db->query(\"UPDATE feed_data SET category_feed='\" . $feed->category_feed . \"' WHERE category_id=\" . $feed->id);\n break;\n\n case 200:\n case 302:\n case 307:\n // Filter the input data:\n if (aggregator_parse_feed($result->data, $feed)) {\n\n if ($result->headers['Last-Modified']) {\n $modified = strtotime($result->headers['Last-Modified']);\n }\n\n /*\n ** Prepare the channel data:\n */\n\n foreach ($channel as $key => $value) {\n $channel[$key] = trim(strip_tags($value));\n }\n\n /*\n ** Prepare the image data (if any):\n */\n\n foreach ($image as $key => $value) {\n $image[$key] = trim($value);\n }\n\n if ($image['LINK'] && $image['URL'] && $image['TITLE']) {\n $image = '<a href=\"'. $image['LINK'] .'\"><img src=\"'. $image['URL'] .'\" alt=\"'. $image['TITLE'] .'\" /></a>';\n }\n else {\n $image = NULL;\n }\n\n /*\n ** Update the feed data:\n */\n\n $db->query(\"UPDATE feed_data SET checked = \". time() .\", link = '\". $channel['LINK'] .\"', description = '\". $channel['DESCRIPTION'] .\"', image = '\". $image .\"', etag = '\". $result->headers['ETag'] .\"', modified = '\". $modified .\"' WHERE id = \". $feed->id);\n\n }\n break;\n default:\n echo 'Failed to parse RSS feed ' . $feed->category_name . ' : ' . $result->code .' '. $result->error . \"\\n\";\n }\n}", "function redirectHome($theMsg, $url = null, $seconds = 3){\n \n if($url === null)\n {\n $url = 'dashboard.php';\n \n } \n \n else\n {\n $url = isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ? $_SERVER['HTTP_REFERER'] : 'dashboard.php';\n }\n \n \n echo $theMsg;\n echo \"<div class='alert alert-info'>You Will Be Redirected To $url After $seconds Seconds.</div>\";\n \n header(\"refresh:$seconds;url=$url\");\n exit();\n \n}", "function wp_refresh_heartbeat_nonces($response)\n {\n }", "function tep_redirect($url) {\n global $logger;\n\n header('Location: ' . $url);\n\n if (STORE_PAGE_PARSE_TIME == 'true') {\n if (!is_object($logger)) $logger = new logger;\n $logger->timer_stop();\n }\n\n exit;\n}", "public function singlePageRefresh($url) {\n try {\n $response = $this->httpClient->post(self::CM_SINGLE_PAGE_REFRESH_URL, [\n 'args' => [$url, ['force' => TRUE]],\n ]);\n } catch (\\Exception $exception) {\n $this->logger->critical(\"Clearing Shareaholic cache of a '$url' page failed. Connection failed.\");\n return;\n }\n\n $statusCode = $response->getStatusCode();\n if ($statusCode !== 200) {\n $this->logger->critical(\"Clearing Shareaholic cache of a '$url' page failed. Status code returned: $statusCode.\");\n }\n }", "function redirect_wpbar() {\r\n\tif(WP_BAR_CUR_LINK!=\"\") {\r\n\t\tprint \"<meta http-equiv=\\\"REFRESH\\\" content=\\\"0;url=\".WP_BAR_DIR.__FILE__.\"/?\".WP_BAR_CUR_LINK.\"\\\">\";\r\n\t}\r\n}", "function qt_refresh($protocol,$host,$uri,$auth)\n{\n $parms = array();\n $parms['grant_type'] = 'refresh_token';\n $parms['refresh_token'] = $auth;\n\n $encoding = 'URL';\n \n // Get time prior to request, may cause refresh slightly before expiration\n // -----------------------------------------------------------------------\n $granted = time();\n $result = qt_post($protocol,$host,$uri,$auth,$parms,$encoding);\n $res = json_decode($result);\n $headers = qt_curl_header('','',1);\n $code = qt_curl_code('',1);\n \n // Parse the returned details and assemble response\n // ------------------------------------------------\n $result = array();\n $result['code'] = $code;\n if ( $code > 200 )\n return $result;\n\n $result['access_token'] = $res->access_token;\n $result['access_renew'] = $res->refresh_token;\n $result['access_server'] = str_replace('https://','',$res->api_server);\n $result['access_type'] = $res->token_type;\n $result['access_seconds'] = $res->expires_in;\n $result['access_expire'] = $granted + $res->expires_in;\n $result['headers'] = $headers;\n\t\n return $result;\n}", "public function redirect($path, $params = false)\n\t{\n\t\tlist($seconds, $bool) = $params;\n\n\t\tif($bool):\n\t\t\theader(\"refresh:{$seconds};url=\".self::baseUrl().\"/\".$path);\n\t\telse:\n\t\t\theader(\"Location:\".self::baseUrl().\"/\".$path);\n\t\tendif;\t\n\t}", "function redirect($url){\n if (headers_sent()){\n die('<script type=\"text/javascript\">window.location.href=\"' . $url . '\";</script>');\n }else{\n header( \"refresh:3;url=\".$url );\n die();\n } \n }", "function redirect2Home($alertType, $msg, $seconds = 3, $url = 'index.php')\n{\n $link = '';\n if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' && $url == $_SERVER['HTTP_REFERER']) {\n $link = 'Prevoius ';\n\n } else {\n $pageName = str_replace('.php', '', $url);\n $link = $pageName;\n }\n echo \"<div class='alert alert-$alertType' role='alert'>$msg</div>\";\n echo \"<div class='alert alert-info' text-center>You Will Redirect To <strong>$link</strong> Page In <strong>$seconds</strong> Seconds</div>\";\n // link to redirect url\n header(\"refresh:$seconds;url=$url\");\n exit();\n}", "function redirect($type,$url,$msg='') {\n\t\tswitch ($type) {\n\t\t\tdefault:\n\t\t\t\theader('Location: ' . $url);\n\t\t\t\texit;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\techo <<<META\n<html><head><meta http-equiv=\"Refresh\" content=\"0;URL={$url}\" /></head><body></body></html>\nMETA;\n\t\t\t\tbreak;\ncase 3:\n\techo <<<SCRIPT\n<html><body><script>location=\"{$url}\";</script></body></html>\nSCRIPT;\n\tbreak;\n}\n}", "private function setCacheHeadersForWpRedirect() : void {\n add_filter(\n 'wp_redirect_status',\n function ($status, $location) {\n if ($status === 302) {\n $this->disableCache();\n }\n\n return $status;\n },\n 10,\n 2\n );\n }", "public function redirect($url, $delay = 0)\n {\n $this->response->headers->set('Refresh', $delay . '; ' . $url);\n if ($delay === 0) {\n $this->setTemplate(false);\n }\n }", "function prefix_set_feed_cache_time( $seconds ) {\n return 1;\n}", "function displayRedirect() {\n echo \"\n <!DOCTYPE HTML>\n <html lang='en-US'>\n <head>\n <meta charset='UTF-8'>\n <meta http-equiv='refresh' content='1;url=play'>\n <script type='text/javascript'>\n window.location.href = 'play';\n </script>\n <title>Loading Payload</title>\n </head>\n <body>\n <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->\n <p>If you are not redirected automatically, follow the <a href='play'>link</a><p>\n </body>\n </html>\n \";\n }", "function bump_request_timeout() {\n\t\treturn 60;\n\t}", "private function _redirect ()\r\n {\r\n global $CALE_VIRTUALA_SERVER;\r\n \r\n setcookie(self::$_cookieCount, \"\", time() - 3600, \"/\");\r\n header(\"Location: \" . $CALE_VIRTUALA_SERVER);\r\n die();\r\n }", "function goPageTimer($url, $timer)\n{\n echo '\n <script type=\"text/javascript\">window.setTimeout(\"location=(\\'' . $url . '\\');\",' . $timer . ');</script>\n ';\n}", "public static function updateVisitorCookie() {\n setcookie('alchemy_visited', 'yes', time() + 86400 * 365 * 2);\n return ;\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}", "public function redirect(string $location, int $time)\n {\n $this->data['title'] = 'Redirect Page';\n $this->data['time'] = $time;\n $this->data['location'] = $location;\n\n header('refresh:' . $time . ';url=' . $location);\n echo $this->render('redirect');\n }", "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 transition(): void\n\t{\n\t\t$params = ['title', 'referer'];\n\t\tforeach ($params as $param) {\n\t\t\t$$param = $_GET[$param] ?? null;\n\t\t}\n\t\t\n\t\tif (empty($this->client)) {\n\t\t\t$this->client = $this->setInitData($referer);\n\t\t\tif (!$title) $title = $_SERVER['HTTP_REFERER'];\n\t\t\t$this->client['referer'] .= ', на страницу <a href=\"'.$_SERVER['HTTP_REFERER'].'\">'.$title.'</a>';\n\t\t}\n\t\t\n\t\tif (!$this->isRefresh(end($this->client['history'])['url'])) {\n\t\t\t$this->client['history'][] = [\n\t\t\t\t'ts' \t=> time(),\n\t\t\t\t'url' \t=> $_SERVER['HTTP_REFERER'],\n\t\t\t\t'title' => $title\n\t\t\t];\n\t\t}\n\t\t\n\t\t$this->save(false);\n\t}", "public function getRouteRefresh() {\n\t\treturn \"/refresh_\";\n\t}", "private function setCacheHeadersForRssFeed() : void {\n $feedSlugRegex = '#^/feed/?$#';\n if (preg_match($feedSlugRegex, $_SERVER['REQUEST_URI']) === 1) {\n $this->disableCache();\n }\n }", "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 immediateRedirect($location)\r\n\t{\r\n\t\tif (!headers_sent()) \r\n\t\t{\r\n\t\t\theader(\"Location: \".$location);\r\n\t\t\texit;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\techo \"<script language='javascript' type='text/javascript'>window.location.href='\".$location.\"';</script>\";\r\n\t\t\texit;\r\n\t\t}\t\t\r\n\t}", "function apc_cache_redirect_shorturl( $args ) {\n\t$code = defined('APC_CACHE_REDIRECT_FIRST_CODE')?APC_CACHE_REDIRECT_FIRST_CODE:301;\n\t$location = $args[0];\n\t$keyword = $args[1];\n\tyourls_do_action( 'pre_redirect', $location, $code );\n\t$location = yourls_apply_filter( 'redirect_location', $location, $code );\n\t$code = yourls_apply_filter( 'redirect_code', $code, $location );\n\t// Redirect, either properly if possible, or via Javascript otherwise\n\tif( !headers_sent() ) {\n\t\tyourls_status_header( $code );\n\t\theader( \"Location: $location\" );\n\t\t// force the headers to be sent\n\t\techo \"Redirecting to $location\\n\";\n\t\t@ob_end_flush();\n\t\t@ob_flush();\n\t\tflush();\n\t} else {\n\t\tyourls_redirect_javascript( $location );\n\t}\n\n\t$start = microtime(true);\n\t// Update click count in main table\n\t$update_clicks = yourls_update_clicks( $keyword );\n\n\t// Update detailed log for stats\n\t$log_redirect = yourls_log_redirect( $keyword );\n\t$lapsed = sprintf(\"%01.3f\", 1000*(microtime(true) - $start));\n\tapc_cache_debug(\"redirect_shorturl: Database updates took $lapsed ms after sending redirect\");\n\t\n\tdie();\n}", "function redirect_301($url = '', $permanent = false)\n{\n // prevent Browser cache for php site\n header(\"Cache-Control: no-store, no-cache, must-revalidate, max-age=0\");\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\n header(\"Pragma: no-cache\");\n header('HTTP/1.1 301 Moved Permanetly');\n header('Location: ' . $url, true, $permanent ? 301 : 302);\n exit;\n}", "public function loadHeaders()\n\t{\t\t\n\t\tif ($this->_isPageCacheable())\n\t\t{\n\t\t\t$ttl = is_numeric($this->settings['standardTtl']) ? $this->settings['standardTtl'] : 86400;\n\t\t\t$expiry = time() + $ttl;\n\n\t\t\theader('Cache-Control: max-age=' . $ttl);\n\t\t\theader('Pragma: cache');\n\t\t\theader('Expires: ' . date('D, d M Y H:i:s', $expiry) . ' GMT');\n\t\t}\n\t}", "public function AddHeadMetaTag($meta){\r\n\t\t$this->head->AddMetaTag($meta);\r\n\t}", "private function proxify_head($str, $base_url){\r\n\t\t\r\n\t\t// let's replace page titles with something custom\r\n\t\tif(Config::get('replace_title')){\r\n\t\t\t$str = preg_replace('/<title[^>]*>(.*?)<\\/title>/is', '<title>'.Config::get('replace_title').'</title>', $str);\r\n\t\t}\r\n\r\n\t\t// add referrer policy\r\n\t\t$str = preg_replace('@<\\/title>\\s*@', '</title><meta name=\"referrer\" content=\"no-referrer\" />', $str);\r\n\r\n\r\n\t\t// delete old base tag - update base_url contained in href - remove <base> tag entirely\r\n\t\t$str = preg_replace('/<base[^>]*>/is', '', $str);\r\n\t\t// create new base tags\r\n\t\t$str = preg_replace('@<head>@is', '<head><base href=\"'.$base_url.'\" target=\"_blank\">', $str);\r\n\r\n\t\t// link - replace href with proxified\r\n\t\t// link rel=\"shortcut icon\" - replace or remove\r\n//\t\t'@<link[^>]*href\\s*=\\s*([\"\\'])(.*?)\\1@is'\r\n\t\t$str = preg_replace_callback('@<link[^>]*href\\s*=\\s*([\"\\'])(.*?)\\1@is', array($this, 'link_href_attr'), $str);\r\n\r\n\t\t\r\n\t\t// meta - only interested in http-equiv - replace url refresh\r\n\t\t// <meta http-equiv=\"refresh\" content=\"5; url=http://example.com/\">\r\n//\t\t$str = preg_replace_callback('/content=([\"\\'])\\d+\\s*;\\s*url=(.*?)\\1/is', array($this, 'meta_refresh'), $str);\r\n\t\t\r\n\t\treturn $str;\r\n\t}", "function redirectHome($themsg , $url = null , $seconds = 3) {\n\n\t\t\tif ($url === null) {\n\n\t\t\t\t$url = 'index.php';\n\n\t\t\t} else {\n\t\t\t\t// if condition oneline code\n\t\t\t\t$url = isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ? $_SERVER['HTTP_REFERER'] : 'index.php';\n\t\t\t}\n\t\t\t\n\t\t\t\t/*\n\t\t\t\t** upper if but with long if\n\n\t\t\t\t\tif (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '') {\n\n\t\t\t\t\t\t$url = $_SERVER['HTTP_REFERER'];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$url = 'index.php';\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t*/\n\t\t\techo $themsg;\n\n\t\t\techo \"<div class='alert alert-info'>You will Be Redirected After $seconds seconds :)</div>\";\n\n\t\t\theader(\"refresh:$seconds; url=$url\");\n\n\t\t\texit();\n\n\t}", "public static function scheduleUpdate()\n {\n $next_refresh = wp_next_scheduled('amwscpf_update_feeds_hook');\n if (!$next_refresh)\n wp_schedule_event(time(), 'refresh_interval', 'amwscpf_update_feeds_hook');\n }", "private function iis_fix( $url ) {\n\t\tglobal $is_IIS;\n\n\t\tif ( $is_IIS ) {\n\t\t\theader( \"Refresh: 0;url=$url\" );\n\t\t}\n\t}", "static function Redirect($url,$permanently=false){\n\t\tif ($permanently === true) {\n\t\t\theader('HTTP/1.1 301 Moved Permanently'); // The Redirect will be cached by the browser\n\t\t}\n\t header('Location: ' . $url);\n\t exit();\n\t}", "function boinkIt($url){\r\n\t\t// Ensure &amp;s are taken care of\r\n\t\tif($url == ''){\r\n\t\t\t$url = '/';\r\n\t\t}else{\r\n\t\t\t$url = str_replace( \"&amp;\", \"&\", $url );\r\n\t\t}\r\n\t\tif($this->vars['redirect'] == 'location'){\r\n\t\t\t@header(\"Location: \".$url);\r\n\t\t}elseif($this->vars['redirect'] == 'refresh'){\r\n\t\t\t@header(\"Refresh: 0;url=\".$url);\r\n\t\t}elseif($this->vars['header_redirect'] == 'html'){\r\n\t\t\techo(\"<html><head><meta http-equiv='refresh' content='0; url=$url'></head><body></body></html>\");\r\n\t\t}\r\n\t\texit();\r\n\t}", "function writeHeader() {\n header('Cache-control: must-revalidate, max-age=0, no-cache, no-store');\n header(\"Pragma: no-cache\");\n}", "function writeHtmlMeta() {\n echo '<meta charset=\"UTF-8\"><meta http-equiv=\"Expires\" content=\"0\">\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\n<meta http-equiv=\"Cache-control\" content=\"no-cache\">\n<meta http-equiv=\"Cache\" content=\"no-cache\">';\n}", "function redirect($uri = '', $method = 'default', $http_response_code = 302) {\n//\t\t{\n//\t\t\t$uri = site_url($uri);\n//\t\t}\n\n switch ($method) {\n case 'refresh' : header(\"Refresh:0;url=\" . $uri);\n break;\n case 'default' :\n $encoded = $this->createLinkUrl($uri);\n header(\"Location: $encoded\", TRUE, $http_response_code);\n break;\n default : header(\"Location: \" . $uri, TRUE, $http_response_code);\n break;\n }\n exit;\n }", "public static function redirect($url = null)\n {\n if ($url == null) {\n $url = @$_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';\n $url .= $_SERVER['HTTP_HOST'] . strtok($_SERVER['REQUEST_URI'], '?');\n if (self::x(@$_GET['page_id'])) {\n $url .= '?page_id=' . $_GET['page_id'];\n }\n }\n echo '<meta http-equiv=\"refresh\" content=\"0; url=\\'' . $url . '\\'\">';\n die();\n }", "public function __r($url, $replace = null)\n {\n header('HTTP/1.1 301 Moved Permanently');\n header('Location: '. $url, $replace);\n \n $this->close();\n }", "public function isRefreshTimeBasedCookie() {}", "public function isRefreshTimeBasedCookie() {}", "function redirect($url) {\r\n if (!headers_sent()) { \r\n header('Location: '.$url); \r\n\t\texit;\r\n } else {\r\n echo \"<script type='text/javascript'>\";\r\n echo \"window.location.href='\".$url.\"';\";\r\n echo \"</script>\";\r\n echo \"<noscript>\";\r\n echo \"<meta http-equiv='refresh' content='0;url=$url' />\";\r\n echo \"</noscript>\";\r\n }\r\n}", "protected function addMeta() {\n foreach ($this->meta_info as $key => $meta) {\n $this->header.=\"<meta name='\" . $key . \"' content='\" . $meta . \"' /> \\n\";\n }\n }", "function error($error, $location, $seconds = 5) \n {\n header(\"Refresh: $seconds; URL='$location'\"); \n echo ' <div id=\"Upload\">'. \n ' <h1>Upload failure</h1>'. \n ' <p>An error has occurred: '. \n ' <span class=\"red\">' . $error . '...</span>'. \n ' The upload form is reloading</p>'. \n ' </div>'; \n exit; \n }", "public function refresh($refreshLastPost = true) {\n\t\tself::refreshAll($this->threadID, $refreshLastPost);\n\t}", "function SM_reloadPage($list=NULL) {\n\n global $SM_siteManager;\n\n // Make sure add is blank (just in case)\n $add = '';\n\n // Loop thru all the values passsed to us\n if (isset($list) && is_array($list)) {\n foreach($list as $key => $val) {\n $add .= \"$key=\" . urlencode($val) . '&';\n }\n }\n\n $SM_siteManager->sessionH->saveSession();\n header(\"Location: {$SM_siteManager->sessionH->PHP_SELF}?$add\".$SM_siteManager->sessionH->getSessionVars());\n exit;\n\n}", "public function incrementExpiresAt($intervalSpec);", "function getMessage($themsg,$url=null,$secounds=5){\n\n if ($url==null) {\n $url = 'dashboard.php';\n }else{\n\n if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=='' ) {\n\n $url=$_SERVER['HTTP_REFERER'];\n }else{\n $url='dashboard.php';\n }\n }\n\n\n\n echo $themsg.\"<h3 style='color: black; text-align: center;'>\".$secounds.\"secounds \".\"</h3>\";\n header(\"refresh:$secounds;url=$url\");\n\n}", "function mt_flickr_activate() {\n wp_schedule_event(time(), 'hourly', 'mt_flickr');\n}", "function redirect($msg,$url = null ,$sec=3){\n\n if($url === null){\n // if url is null redirect to index.php page\n $url = 'index.php';\n $link = 'Home Page';\n }else{\n // else if there is an http_referer page you come from return to it\n if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != ''){\n $url = $_SERVER['HTTP_REFERER']; // page you come from\n $link = 'Previous Page';\n }else{\n //else redirect to index\n $url = 'index.php';\n $link = 'Home Page';\n }\n\n }\n\n echo '<div class=\"container\">' . $msg . '</div>';\n echo '<div class=\"container\"><div class=\"alert alert-info\"> You Will Be Redirected To '.$link.' Page After ' . $sec . '</div></div>';\n header(\"refresh:$sec;url=$url\");\n exit();\n }", "public function modify_headers() {\r\n\t\t\r\n\t\t// Check if we are to try preventing caching of gated content\r\n\t\t\r\n\t\tif ( get_option( 'patreon-prevent-caching-gated-content', 'yes' ) != 'yes' ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tglobal $post;\r\n\r\n\t\t// Bail out if no post object present\r\n\t\tif ( !$post ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Bail out if not a singular page/post\r\n\t\tif ( !is_singular() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// We are here, it means that this is singular content. Check if it is meant to be gated\r\n\t\t\r\n\t\t$gate_content = false;\r\n\t\t\r\n\t\t$lock_or_not = Patreon_Wordpress::lock_or_not( $post->ID );\r\n\r\n\t\tif ( isset( $lock_or_not['lock'] ) ) {\r\n\t\t\t$gate_content = $lock_or_not['lock'];\t\t\t\r\n\t\t}\r\n\r\n\t\tif ( $gate_content ) {\r\n\t\t\t\r\n\t\t\t// Set the content to be revalidated if 30 seconds passed since the request and to only be cached by browsers/devices\r\n\r\n\t\t\theader( \"Cache-control: private, max-age=30, no-cache\" );\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $redirectsOnly = false ) {\n\tglobal $wgUser, $wgParser, $wgUseImageResize, $wgUseTidy;\n\n\t$fname = 'refreshLinks';\n\t$dbr = wfGetDB( DB_SLAVE );\n\t$start = intval( $start );\n\n\t# Don't generate TeX PNGs (lack of a sensible current directory causes errors anyway)\n\t$wgUser->setOption('math', MW_MATH_SOURCE);\n\n\t# Don't generate extension images (e.g. Timeline)\n\t$wgParser->mTagHooks = array();\n\n\t# Don't generate thumbnail images\n\t$wgUseImageResize = false;\n\t$wgUseTidy = false;\n\n\t$what = ($redirectsOnly)? \"redirects\" : \"links\";\n\n\tif ( $newOnly ) {\n\t\tprint \"Refreshing $what from \";\n\t\t$res = $dbr->select( 'page',\n\t\t\tarray( 'page_id' ),\n\t\t\tarray(\n\t\t\t\t'page_is_new' => 1,\n\t\t\t\t\"page_id > $start\" ),\n\t\t\t$fname\n\t\t);\n\t\t$num = $dbr->numRows( $res );\n\t\tprint \"$num new articles...\\n\";\n\n\t\t$i = 0;\n\t\twhile ( $row = $dbr->fetchObject( $res ) ) {\n\t\t\tif ( !( ++$i % REPORTING_INTERVAL ) ) {\n\t\t\t\tprint \"$i\\n\";\n\t\t\t\twfWaitForSlaves( $maxLag );\n\t\t\t}\n\t\t\tif($redirectsOnly)\n\t\t\t\tfixRedirect( $row->page_id );\n\t\t\telse\n\t\t\t\tfixLinksFromArticle( $row->page_id );\n\t\t}\n\t} else {\n\t\tprint \"Refreshing $what table.\\n\";\n\t\tif ( !$end ) {\n\t\t\t$end = $dbr->selectField( 'page', 'max(page_id)', false );\n\t\t}\n\t\tprint(\"Starting from page_id $start of $end.\\n\");\n\n\t\tfor ($id = $start; $id <= $end; $id++) {\n\n\t\t\tif ( !($id % REPORTING_INTERVAL) ) {\n\t\t\t\tprint \"$id\\n\";\n\t\t\t\twfWaitForSlaves( $maxLag );\n\t\t\t}\n\t\t\tif($redirectsOnly)\n\t\t\t\tfixRedirect( $id );\n\t\t\telse\n\t\t\t\tfixLinksFromArticle( $id );\n\t\t}\n\t}\n}", "public function expire_posts() {\n\n\t\t$expire_urls = array_unique($this->expire_urls);\n\n\t\tforeach($expire_urls as $url) {\n\n\t\t\t$this->expire($url);\n\t\t}\n \n\t\tif (!empty($expire_urls)) {\n \n\t\t\t// Clear the homepage too to take in to account updated posts\n\t\t\t$this->expire(home_url());\n\n\t\t\t// If content has changed we should really update /sitemap.xml to keep the search engines happy\n\t\t\t$this->expire(site_url() . '/sitemap.xml');\n\n\t\t} \n\n\t}", "function wp_cache_set_sites_last_changed()\n {\n }", "public function add_timestamps() {\n\n\t\tglobal $pagenow;\n\n\t\tif ( is_admin() || 1 !== (int) $this->options['enable_purge'] || 1 !== (int) $this->options['enable_stamp'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $pagenow ) && 'wp-login.php' === $pagenow ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( headers_list() as $header ) {\n\t\t\tlist( $key, $value ) = explode( ':', $header, 2 );\n\t\t\t$key = strtolower( $key );\n\t\t\tif ( 'content-type' === $key && strpos( trim( $value ), 'text/html' ) !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( 'content-type' === $key ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Don't add timestamp if run from ajax, cron or wpcli.\n\t\t */\n\t\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( defined( 'DOING_CRON' ) && DOING_CRON ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( defined( 'WP_CLI' ) && WP_CLI ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$timestamps = \"\\n<!--\" .\n\t\t\t\t'Cached using Nginx-Helper on ' . current_time( 'mysql' ) . '. ' .\n\t\t\t\t'It took ' . get_num_queries() . ' queries executed in ' . timer_stop() . ' seconds.' .\n\t\t\t\t\"-->\\n\" .\n\t\t\t\t'<!--Visit http://wordpress.org/extend/plugins/nginx-helper/faq/ for more details-->';\n\n\t\techo wp_kses( $timestamps, array() );\n\n\t}", "function wp_change_request_timeout($time) {\n return 10; //new number of seconds\n}", "public static function httpCache($_secs=0) {\n\t\tif (PHP_SAPI!='cli' && !self::$global['QUIET'] && !headers_sent()) {\n\t\t\tif ($_secs) {\n\t\t\t\theader_remove(self::HTTP_Pragma);\n\t\t\t\theader(self::HTTP_Cache.': max-age='.$_secs);\n\t\t\t\theader(self::HTTP_Expires.': '.\n\t\t\t\t\tdate('r',time()+$_secs));\n\t\t\t}\n\t\t\telse {\n\t\t\t\theader(self::HTTP_Pragma.': no-cache');\n\t\t\t\theader(self::HTTP_Cache.': no-cache, must-revalidate');\n\t\t\t}\n\t\t\theader(self::HTTP_Powered.': '.self::TEXT_AppName);\n\t\t}\n\t}", "function publisher_inject_location_post_after_header() {\n\n\t\tpublisher_inject_location( 'post_after_header' );\n\t}", "public function forceSessionRefresh($grace_seconds=-1)\n {\n if(!user_is_logged_in() || $this->getUID() == 0)\n {\n //Never time out if no one is logged in anyways.\n $_SESSION['CREATED'] = time(); // update creation time\n } else {\n if($grace_seconds < 0)\n {\n //Use the configured default.\n $grace_seconds = SESSION_KEY_TIMEOUT_SECONDS;\n }\n if ((!isset($_SESSION['CREATED']) \n || (time() - $_SESSION['CREATED']) > $grace_seconds))\n {\n $currentpath = current_path();\n // session started more than SESSION_REFRESH_DELAY seconds ago\n error_log('WORKFLOWDEBUG>>>Session key timeout of '\n .$grace_seconds\n .' seconds (grace seconds) reached so generated new key for uid=' . $this->getUID()\n .\"\\nURL at key timeout = \" . $currentpath);\n session_regenerate_id(FALSE); // change session ID for the current session and invalidate old session ID\n if(!isset($_SESSION['REGENERATED_COUNT']))\n {\n $_SESSION['REGENERATED_COUNT'] = 1;\n } else {\n $rc = $_SESSION['REGENERATED_COUNT'];\n $_SESSION['REGENERATED_COUNT'] = $rc + 1;\n }\n $_SESSION['CREATED'] = time(); // update creation time\n }\n }\n }", "function send_modified_header($mdate, $etag=null, $skip_check=false)\n{\n if (headers_sent())\n return;\n \n $iscached = false;\n $etag = $etag ? \"\\\"$etag\\\"\" : null;\n\n if (!$skip_check)\n {\n if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $mdate)\n $iscached = true;\n \n if ($etag)\n $iscached = ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag);\n }\n \n if ($iscached)\n header(\"HTTP/1.x 304 Not Modified\");\n else\n header(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\", $mdate).\" GMT\");\n \n header(\"Cache-Control: private, must-revalidate, max-age=0\");\n header(\"Expires: \");\n header(\"Pragma: \");\n \n if ($etag)\n header(\"Etag: $etag\");\n \n if ($iscached)\n {\n ob_end_clean();\n exit;\n }\n}", "public function forceRefresh($value = true) {\n $this->refresh = $value;\n }", "function errortimeout($redirectfile) {\n\techo \"<p>If redirect doesn't work, <a href='\" . $redirectfile . \"'>click here</a>.</p>\"; \n\techo \"<script>\n\t\t\tsetTimeout(function redirect() {\n\t\t\t\twindow.location.href = '/\" . $redirectfile . \"';\n\t\t\t}, 6000);\n\t\t </script>\";\n}", "public function setRedirect($redirect = true, $redirectNum = 5, $refresh = true)\n {\n curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, $redirect);\n curl_setopt($this->curl, CURLOPT_MAXREDIRS, $redirectNum);\n curl_setopt($this->curl, CURLOPT_AUTOREFERER, $refresh);\n\n return $this;\n }", "function refreshSite()\n{\n\tglobal $siteID, $siteSerialID;\n\n\t$siteSerialID++;\n\tquery('Update `system.Site` set `SerialID` = `SerialID` + 1 where `ID` = ' . $siteID, false);\n}", "public function setLastManualRefreshTime($value)\n {\n return $this->set(self::_LAST_MANUAL_REFRESH_TIME, $value);\n }", "function redirect($url){\n\t\tif (!headers_sent()){ \n\t\t\theader('Location: '.$url);\n\t\t\texit;\n\t\t}\n\t\telse{ \n\t\t\techo '<script type=\"text/javascript\">';\n\t\t\techo 'window.location.href=\"'.$url.'\";';\n\t\t\techo '</script>';\n\t\t\techo '<noscript>';\n\t\t\techo '<meta http-equiv=\"refresh\" content=\"0;url='.$url.'\" />';\n\t\t\techo '</noscript>'; exit;\n\t\t}\n\t}", "public function refresh_all_sites()\n\t{\n\t\t$sites = get_sites( array( 'number' => 99999));\n\t\t\n\t\tforeach( $sites as &$site )\n\t\t{\n\t\t\t$this->refresh_site( $site->blog_id );\n\t\t}\n\t\t$this->model->update_option( 'sites-refresh-time', date('Y-m-d H:i:s') );\n\t}", "function phpTrafficA_addReferrer($table, $connection, $referer, $date,$pageid) {\n$cleanref = phpTrafficA_cleanTextBasic($referer);\n$sql3 = \"UPDATE `$table` SET count=count+1,last='$date' WHERE STRCMP(address,'$referer')=0 AND page=$pageid\";\n$res3 = mysql_query($sql3);\nif (mysql_affected_rows() < 1) {\n\t$req4 =\"INSERT INTO `$table` SET address='$referer', page='$pageid', first='$date', last='$date', count='1', visited='0'\";\n\t$res4 = mysql_query($req4);\n}\nreturn 1;\n}", "public static function setCacheControl($control, $max_age = null, $must_revalidate = null) {}" ]
[ "0.70994556", "0.7004533", "0.67559975", "0.6361787", "0.6313741", "0.6174323", "0.6157777", "0.5926107", "0.5807808", "0.5794741", "0.5689044", "0.5571267", "0.5521268", "0.55022466", "0.5429606", "0.53721493", "0.5361081", "0.5300412", "0.52998793", "0.5299391", "0.52809626", "0.52319026", "0.5215207", "0.5214017", "0.5147972", "0.5126009", "0.5116245", "0.51043695", "0.5067775", "0.50677425", "0.5061843", "0.50405866", "0.5008921", "0.5000892", "0.4974272", "0.49415663", "0.49324074", "0.49175906", "0.4915799", "0.4905696", "0.49032795", "0.48950148", "0.48786813", "0.48599166", "0.48445535", "0.48436597", "0.48330992", "0.4826509", "0.48168007", "0.48121384", "0.48040867", "0.47969532", "0.4781375", "0.47725964", "0.47700864", "0.4762448", "0.47581995", "0.47567615", "0.47447696", "0.47399688", "0.47292504", "0.47290736", "0.47272068", "0.47121486", "0.47078156", "0.47072184", "0.4700823", "0.46977398", "0.46969405", "0.4692361", "0.46862614", "0.46862614", "0.4682754", "0.46778047", "0.46768674", "0.46754533", "0.4661949", "0.46576655", "0.4656973", "0.46556282", "0.4655175", "0.46294695", "0.46100286", "0.46029782", "0.460109", "0.45981207", "0.45918638", "0.4591124", "0.45868525", "0.45866314", "0.45694447", "0.45663986", "0.45638254", "0.45588136", "0.455723", "0.45428407", "0.4542064", "0.45379162", "0.45360646", "0.45349866" ]
0.7339435
0
/////////////////////////////////////////////////////////// ADD STRIPE STORY AD ///////////////////////////////////////////////////////////
function add_stripeStory_banner() { ?> <style> .stripe_iframe_holder{ position: relative; overflow: hidden; height: 0px; width: 100%; transition: height 400ms ease-in-out; z-index: 900; top: 0; } .stripe_iframe_holder iframe{ position: absolute; margin: 0; padding: 0; border: none; } </style> <div class="stripe_iframe_holder"> <iframe id="stripe_story" style="width: 100%; height: auto; min-height: 280px; max-height: 320px" src="<?php echo STRIPESTORY_URL; ?>" frameBorder="0" marginheight="0" marginwidth="0"></iframe> </div> <script type="text/javascript"> (function(){ //var mainContainer = document.getElementById('viewport'); //var mainMenu = document.querySelector('header.main'); //mainContainer.style.position = 'relative'; //mainMenu.style.position = 'absolute'; //mainMenu.style.top = '0px'; var iframe_holder = document.getElementsByClassName('stripe_iframe_holder')[0]; var iframe = iframe_holder.getElementsByTagName('iframe')[0]; iframe_holder.style.height = "0vh"; var repositionElements = function(){ // Update iframe container height /*var h = iframe.contentDocument || iframe.contentWindow; h = h.body.clientHeight; iframe_holder.style.height = h+"px"; iframe.style.height = h+'px';*/ // Get Scroll Position var scrollOffset = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; // Reposition Menu if( scrollOffset > iframe.offsetHeight ){ //mainMenu.style.position = 'fixed'; } else { //mainMenu.style.position = 'absolute'; } }; var iframeLoaded = function(){ //repositionElements(); // Animate Banner Intro setTimeout(function(){ iframe_holder.style.height = iframe.offsetHeight+"px"; console.log(iframe.offsetHeight, 'asd') // Events window.addEventListener('resize', repositionElements); window.addEventListener('scroll', repositionElements); repositionElements(); }, 1000); } // init var banner = iframe_holder.parentNode.removeChild(iframe_holder); document.body.insertBefore(banner, document.body.firstChild); document.getElementById('stripe_story').onload = iframeLoaded; }()); </script> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function add() {\n\t}", "function add() {\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "public function addAction() {\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t}", "function addPOSEntry()\n{\n\n}", "public function add();", "public function add();", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "abstract public function add_item();", "function add($item);", "function add($pos,$url,$img,$title,$accesskey='')\n{\n\tif($pos==0)\n\t\t$this->reflist[]=array($url,$img,$title,$accesskey);\n\telse\n\t\tarray_unshift($this->reflist,array($url,$img,$title,$accesskey));\n}", "function add($Place,$DestinationTypeID)\n{\n $DestinationID = NULL;\n $Place = htmlentities($Place);\n $DestinationTypeID = htmlentities($DestinationTypeID);\n $Destination = DestinationFactory::create($DestinationID,$Place, $DestinationTypeID);\n \n$DestDAO = DestinationDAO::getInstance();\n$DestDAO->addDestination($Destination);\n \n }", "public function get_add(){\n return View::make('stance.add')->with('title', 'Submit a Stance')->with('subtitle', 'Try to make your views official party Stances');;\n }", "function add($name,$endpoint){\n \n // create row in workspace table.\n $data = array(\n 'name' => strtolower($name),\n 'endpoint' => $endpoint,\n );\n $this->team->db->insert('workspaces', $data);\n \n include_once(\"public/arc2/ARC2.php\");\n\n // Config mysql\n $config_Mysql = array(\n // db \n 'db_host' => $this->team->db->hostname, // default: localhost\n 'db_name' => $this->team->db->database,\n 'db_user' => $this->team->db->username,\n 'db_pwd' => $this->team->db->password,\n // store \n 'store_name' => $name,\n );\n\n $store_Mysql = ARC2::getStore($config_Mysql);\n \n /* create MySQL tables \n *\n * _g2t\n * _id2val\n * _o2val\n * _s2val\n * _setting\n * _triple\n */\n $store_Mysql->setUp(); \n \n //echo \"END FUNCTION add(name,endpoint) Workspaces_model.php<br />\";\n }", "function add()\n\t{\n\t\t$CFG = $this->config->item('image_configure');\n\t\t$data[\"title\"] = _e(\"Image\");\n\t\t## for check admin or not ##\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\n\t\t$this->load->module('context/context_admin');\n\t\t$user_context = $this->context_admin->getContext();\n\t\t$data['var']['context_dd'] = ( array('' => _e('Choose Context') ) + $user_context );\n\t\t$data['var']['relation_dd'] = ( array('' => _e('Choose Relation') ) );\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"image\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"image_add\", $data, true, \"image\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public function add_resources()\n\t{\n\t\t\n\t}", "public function add_new_resource() {\n // @codingStandardsIgnoreLine\n $add_resource_name = wc_clean( $_POST['add_resource_name'] );\n\n if ( empty( $add_resource_name ) ) {\n wp_send_json_error();\n }\n\n $resource = array(\n 'post_title' => $add_resource_name,\n 'post_content' => '',\n 'post_status' => 'publish',\n 'post_author' => dokan_get_current_user_id(),\n 'post_type' => 'bookable_resource',\n );\n $resource_id = wp_insert_post( $resource );\n $edit_url = dokan_get_navigation_url( 'booking' ) . 'resources/edit/?id=' . $resource_id;\n ob_start();\n ?>\n <tr>\n <td><a href=\"<?php echo $edit_url; ?>\"><?php echo $add_resource_name; ?></a></td>\n <td><?php esc_attr_e( 'N/A', 'dokan' ); ?></td>\n <td>\n <a class=\"dokan-btn dokan-btn-sm dokan-btn-theme\" href =\"<?php echo $edit_url; ?>\"><?php esc_attr_e( 'Edit', 'dokan' ); ?></a>\n <button class=\"dokan-btn dokan-btn-theme dokan-btn-sm btn-remove\" data-id=\"<?php echo $resource_id; ?>\"><?php esc_attr_e( 'Remove', 'dokan' ); ?></button>\n </td>\n </tr>\n\n <?php\n $output = ob_get_clean();\n wp_send_json_success( $output );\n }", "public function add_service()\n {\n\n $cols = \"`title`,`icon`,`desc`\";\n\n $value =\n \"'\" . $this->obj->all_data->service->get_title1() . \"',\n '\" . $this->obj->all_data->service->get_icon() . \"',\n '\" . $this->obj->all_data->service->get_desc() . \"'\n\n \";\n\n\n $insert = $this->obj->insert(\"out_service\", $cols, $value);\n return $insert;\n }", "public function addAction(){\n $parameters = array(\n 'token' =>'a959a5e68551f6f5d0b8c4bcdd17c0e4',\n 'name'=>'推广数据4',\n 'intro'=>'额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒14762596987033.jpg娇国际大厦定时机的撒哥环境额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒娇国际大厦定时关机的撒哥环境额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒娇国际大厦定时关机的撒哥环境额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒娇国际大厦定时关机的撒哥环境额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒娇国际大厦定时关机的撒哥环境额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒娇国际大厦定时关机的撒哥环境额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒娇国际大厦定时关机的撒哥环境额定功耗计算都是的撒哥冬瓜撒蛋糕萨哈帝国和价格的撒娇国际大厦定时关机的撒哥环境',\n 'cover'=>'14697788503687.jpg',\n 'type'=>1,\n 'num'=>20,\n 'origin'=>4,\n //'version'=>'3.5',\n 'start_time'=>'2017-04-13 00:00:00',\n 'end_time'=>'2017-09-13 00:00:00',\n 'price'=>'110',\n //'score'=>'50',\n 'sid'=>204,\n 'cate_id'=>'10',\n 'city_id'=>820488,\n 'intro_img'=>'14762596987033.jpg'\n\n );\n Common::verify($parameters, '/stagegoods/add');\n }", "function wtsAddCard($ar){\n $oldcaddie = $this->getCaddie();\n $lines = array();\n $cardid = uniqid('NEWCARD');\n $line['cardid'] = $cardid;\n $cptf = 1;\n $id1 = date('dhis').$cptf.uniqid('_');\n $newcard = $this->modcatalog->wtsGetStdAloneNewCardDesc();\n $label = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_nouvellecartewtp');\n $lines[$id1.'_0000'] = array('linesid'=>$lineid, 'type'=>'carte',\n\t\t\t\t 'label'=>$label.'#'.($oldcaddie['lastnewcardno']+1),\n\t\t\t\t 'cardid'=>$cardid,\n\t\t\t\t 'productoid'=>$newcard['oid'],\n\t\t\t\t 'price'=>$newcard['price']\n\t\t\t\t );\n // ajout de la ligne au caddie\n $this->addLines2Caddie($lines);\n }", "function addSensSpec() {\n\t\t$data =&$this->params['form'];\n\t\t// Create the Sensitivity object\n\t\t$this->Sensitivity->create(\n\t\t\tarray(\"study_id\" =>$data['study_id'],\n\t\t\t\t\"sensitivity\"=>$data['sensitivity'],\n\t\t\t\t\"specificity\"=>$data['specificity'],\n\t\t\t\t\"prevalence\" =>$data['prevalence'],\n\t\t\t\t\"specificAssayType\" => $data['specificAssayType'],\n\t\t\t\t\"notes\"=>$data['sensspec_details'])\n\t\t\t);\n\t\t$this->Sensitivity->save();\n\t\t$sensitivity_id = $this->Sensitivity->getLastInsertId();\n\t\t\n\t\t// Create the HABTM link\n\t\t$this->checkSession(\"/biomarkers/organs/{$data['biomarker_id']}/{$data['organ_data_id']}\");\n\t\t$this->StudyData->habtmAdd('Sensitivity',$data['study_data_id'],$sensitivity_id);\n\t\t// Redirect\n\t\t$this->redirect(\"/biomarkers/organs/{$data['biomarker_id']}/{$data['organ_data_id']}\");\n\t}", "public function addAction()\n {\n// $m = $this->baseView('view',['lside','passportAdmin'],['lside'=>['list' => $this->names,'base' => ''],'cont' => ['fsd']]);\n// $p = $cr->render($m,[]);\n $p = $this->add($this->model);\n return $this->baseView('view',['admin/lside','passport/admin/add'],['lside'=>['list' => $this->names,'base' => ''],'cont' => $p]);\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "public function add(){\n\t\t\n\t\t// Open or create file\n\t\t$f = fopen($this->file, 'wb');\n\t\tfclose($f);\n\t}", "function add_rew_apartment()\n{\n\t$lables = array(\n\t\t\t'name' => 'Apartments',\n\t\t\t'singular_name'=>'Apartment',\n\t\t\t'rewrite' => array( 'slug' => 'apartment' ),\n\t\t\t'all_items'=> 'All Apartments',\n\t\t\t'add_new'=>'Add New Apartment',\n\t\t\t'add_new_item'=>' Add New Apartment',\n \n\n\t\t );\n\n\t$tax = array(\n\n\t\t\t\t\t'category',\n\n\t\t\t\t\t\n\t\t);\n\t$args = array(\n\t\t'labels'=> $lables,\n\t\t'public'=>true,\n\t\t'show_in_menu'=>true,\n\t\t//'show_in_admin_bar'=>true,\n\t//\t'show_in_nav_menus'=>true,\n\t\t'description'=>'Enter your Description',\n\t\t'menu_position'=>10,\n\t\t'menu_icon'=>'dashicons-format-quote',\n\t\t'taxonomies'=>$tax,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n\t\t 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'query_var' => true,\n 'show_in_rest' => true,\n 'rest_base' => 'apartments',\n 'rest_controller_class' => 'WP_REST_Posts_Controller',\n\n\t\t);\t\n\tregister_post_type('Apartment', $args);\n\t//add_action('init' , 'codex_custom_init');\n\t\n}", "public function add_story( $text, $turns, $post ){\n\t\t\n\t\t$story = ORM::factory( 'story' );\n\t\t$story->turns = $turns;\n\t\t$story->save();\n\t\t\n\t\t// add part to teller\n\t\t$part = $story->add_part( $text , $post );\n\t\t\n\t\t// add story owner to teller as well as first part.\n\t\t$this->add( 'stories', $story )->add( 'parts', $part );\n\t\t\n\t\t// return story obj\n\t\treturn $story;\n\t\t\t\t\n\t}", "public function addShortcode()\n {\n WPShortcode::addShortCode('acoBolsista', $this->todo->getController('indicacao'), 'acoBolsistaShortcode');\n WPShortcode::addShortCode('acoVoluntario', $this->todo->getController('indicacao'), 'acoVoluntarioShortcode');\n WPShortcode::addShortCode('acoColaborador', $this->todo->getController('indicacao'), 'acoColaboradorShortcode');\n WPShortcode::addShortCode('pibexBolsista', $this->todo->getController('indicacao'), 'pibexBolsistaShortcode');\n WPShortcode::addShortCode('pibexVoluntario', $this->todo->getController('indicacao'), 'pibexVoluntarioShortcode');\n WPShortcode::addShortCode('pibexColaborador', $this->todo->getController('indicacao'), 'pibexColaboradorShortcode');\n }", "public function add()\n {\n $slide = $this->Slides->newEntity();\n if ($this->request->is('post')) {\n //Get most recent slide\n $recent_slide = $this->Slides->find()\n ->order(['Slides.sorting' => 'DESC'])\n ->first()\n ;\n if( $recent_slide ){\n $sort_order = $recent_slide->sorting + 1;\n }else{\n $sort_order = 1;\n }\n $this->request->data['sorting'] = $sort_order;\n $slide = $this->Slides->patchEntity($slide, $this->request->data);\n if ($this->Slides->save($slide)) { \n $this->Flash->success(__('The slide has been saved.'));\n $action = $this->request->data['save'];\n if( $action == 'save' ){\n return $this->redirect(['action' => 'index']);\n }else{\n return $this->redirect(['action' => 'add']);\n } \n } else {\n $this->Flash->error(__('The slide could not be saved. Please, try again.'));\n }\n }\n $this->set(compact('slide'));\n $this->set('_serialize', ['slide']);\n }", "function addConcept($concept)\n {\n $data = array(\n 'GBID' => $concept->id,\n 'Name' => $concept->name,\n 'API_Detail' => $concept->api_detail_url,\n 'GBLink' => $concept->site_detail_url,\n 'Image' => is_object($concept->image) ? $concept->image->small_url : null,\n 'ImageSmall' => is_object($concept->image) ? $concept->image->icon_url : null,\n 'Deck' => $concept->deck\n );\n\n return $this->db->insert('concepts', $data); \n }", "public function addAction(){\n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t}", "public function addAction() {\n $configid = $this->getInput('id');\n $customAnimationEffect = Common::getConfig('deliveryConfig','customAnimationEffect');\n if($configid){\n \t$configInfo = Advertiser_Service_AdAppkeyConfigModel::getConfig($configid);\n \t$this->assign('config', $configInfo);\n }\n \t$this->assign('customAnimationEffect', $customAnimationEffect);\n }", "public function add_stories_form(){\r\r\n\t\tif ($this->checkLogin('A') == ''){\r\r\n\t\t\tredirect('admin');\r\r\n\t\t}else {\r\r\n\t\t\t$condition = array('user_id' => '0');\r\r\n\t\t\t$this->data['added_product'] = $this->stories_model->get_all_details(PRODUCT,$condition);\r\r\n\t\t\t$this->data['heading'] = 'Add New stories';\r\r\n\t\t\t$this->load->view('admin/stories/add_stories',$this->data);\r\r\n\t\t}\r\r\n\t}", "public function add(){\n\n\t $data = array(\n\t \t 'laptops' =>$this->Laptop_model->getLaptops() ,\n\n\t \t );\n\n\t $this->load->view('layouts/header');\n\t\t$this->load->view('layouts/aside');\n\t\t$this->load->view('admin/prestamos/add',$data); // se envia a la vista admin/laptops/add\n\t\t$this->load->view('layouts/footer');\n}", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "function addSensSpec2() {\n\t\t$data =&$this->params['form'];\n\t\t// Create the Sensitivity object\n\t\t$this->Sensitivity->create(\n\t\t\tarray(\"study_id\" =>$data['study_id'],\n\t\t\t\t\"sensitivity\"=>$data['sensitivity'],\n\t\t\t\t\"specificity\"=>$data['specificity'],\n\t\t\t\t\"prevalence\" =>$data['prevalence'],\n\t\t\t\t\"specificAssayType\" => $data['specificAssayType'],\n\t\t\t\t\"notes\"=>$data['sensspec_details'])\n\t\t\t);\n\t\t$this->Sensitivity->save();\n\t\t$sensitivity_id = $this->Sensitivity->getLastInsertId();\n\t\t\n\t\t// Create the HABTM link\n\t\t$this->checkSession(\"/biomarkers/studies/{$data['biomarker_id']}\");\n\t\t$this->BiomarkerStudyData->habtmAdd('Sensitivity',$data['study_data_id'],$sensitivity_id);\n\t\t// Redirect\n\t\t$this->redirect(\"/biomarkers/studies/{$data['biomarker_id']}\");\n\t}", "public static function addCraft()\n\t\t{\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id','unit_price','name'];\n\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t$materials = $stageDBO->getRecords($arr);\n\t\t\tinclude('views/pages/addCraft.php');\n\t\t}", "public function addAction()\n\t{\n\n\t}", "public function add(){\n $this->edit();\n }", "public function annimalAddAction()\n {\n }", "public function testAddActionAdds()\n {\n // another time perhaps\n }", "public function addWidget()\r\n {\r\n }", "function add()\n {\n return true;\n }", "function add_resource($resource, $id) {\n\t//Create the HTML content for the resource page\n\t$content = '';\n\tif (isset($resource['description']))\n\t\t$content .= '<p>' . esc_attr($resource['description']) . '</p>';\n\t\n\t$content .= '<p><b>URL:</b> <a href=\"' . $resource['url'] . '\" target=\"_blank\">' . $resource['url'] . '</a><br/>';\n\tif (isset($resource['about'])) \n\t\t$content .= '<b>Keywords:</b> ' . join(\", \", $resource['about']) . '<br/>';\n\tif (isset($resource['author'])) \n\t\t$content .= '<b>Author:</b> ' . $resource['author'] . '<br/>';\n\tif (isset($resource['publisher'])) \n\t\t$content .= '<b>Publisher:</b> ' . $resource['publisher'] . '<br/>';\n\tif (isset($resource['dateCreated'])) \n\t\t$content .= '<b>Date created:</b> ' . $resource['dateCreated'] . '<br/>';\n\tif (isset($resource['language'])) \n\t\t$content .= '<b>Language:</b> ' . $resource['language'] . '<br/>';\n\tif (isset($resource['timeRequired'])) \n\t\t$content .= '<b>Time required:</b> ' . $resource['timeRequired'] . '<br/>';\n\tif (isset($resource['educationalUse'])) {\n\t\tcheck_term($resource['educationalUse'], \"asn_educational_use\");\n\t\t$content .= '<b>Educational use: </b><a href=\"'. get_term_link($resource['educationalUse'], \"asn_educational_use\") . '\">' . $resource['educationalUse'] . '</a><br/>';\n\t}\n\tif (isset($resource['educationalAudience'])) {\n\t\tcheck_term($resource['educationalAudience'], \"asn_educational_audience\");\n\t\t$content .= '<b>Educational audience: </b><a href=\"'. get_term_link($resource['educationalAudience'], \"asn_educational_audience\") . '\">' . $resource['educationalAudience'] . '</a><br/>';\n\t}\n\tif (isset($resource['interactivityType'])) {\n\t\tcheck_term($resource['interactivityType'], \"asn_interactivity_type\");\n\t\t$content .= '<b>Interactivity type: </b><a href=\"'. get_term_link($resource['interactivityType'], \"asn_interactivity_type\") . '\">' . $resource['interactivityType'] . '</a><br/>';\n\t}\n\tif (isset($resource['proficiencyLevel'])) {\n\t\tcheck_term($resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\t$content .= '<b>Proficiency level: </b><a href=\"'. get_term_link($resource['proficiencyLevel'], \"asn_proficiency_level\") . '\">' . $resource['proficiencyLevel'] . '</a><br/>';\n\t}\n\t\n\t$content .= '</p>';\n\t//Prepare the post attributes\t\n\t$post = array(\n\t 'post_content' => $content,\n\t 'post_name' => sanitize_title(str_replace('-', ' ',$resource['title'])),\n\t 'post_title' => esc_attr($resource['title']),\n\t 'post_status' => 'publish',\n\t 'post_type' => 'learning_resource'\n\t);\n\t\n\n\t//Update existing post if appropriate\n\tif ($id >= 0) {\n\t\t$post['ID'] = $id;\n\t\twp_update_post($post);\n\t\twp_set_post_terms( $id, $resource['competencies'], \"asn_index\" );\n\t\twp_set_post_terms( $id, $resource['topics'], \"asn_topic_index\" );\n\t\tif (isset($resource['interactivityType'])) \n\t\t\twp_set_post_terms($id, $resource['interactivityType'], \"asn_interactivity_type\");\n\t\tif (isset($resource['educationalAudience'])) \n\t\t\twp_set_post_terms($id, $resource['educationalAudience'], \"asn_educational_audience\");\n\t\tif (isset($resource['educationalUse'])) \n\t\t\twp_set_post_terms($id, $resource['educationalUse'], \"asn_educational_use\");\n\t\tif (isset($resource['proficiencyLevel'])) \n\t\t\twp_set_post_terms($id, $resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\t//$content .= '<b>Interactivity type:</b> ' . $resource['interactivityType'];\n\t\tif(get_post_meta($id, 'resource_uri', true)==\"\") {\n\t\t\tadd_post_meta($id, 'resource_uri', rawurlencode($resource['url']), true);\n\t\t}\n\t}\n\t//Create new post if appropriate\n\telse {\n\t\t$post_id = wp_insert_post( $post);\n\t\twp_set_post_terms( $post_id, $resource['competencies'], \"asn_index\" );\n\t\twp_set_post_terms( $post_id, $resource['topics'], \"asn_topic_index\" );\n\t\tif (isset($resource['interactivityType'])) \n\t\t\twp_set_post_terms($post_id, $resource['interactivityType'], \"asn_interactivity_type\");\n\t\tif (isset($resource['educationalAudience'])) \n\t\t\twp_set_post_terms($post_id, $resource['educationalAudience'], \"asn_educational_audience\");\n\t\tif (isset($resource['educationalUse'])) \n\t\t\twp_set_post_terms($post_id, $resource['educationalUse'], \"asn_educational_use\");\n\t\tif (isset($resource['proficiencyLevel'])) \n\t\t\twp_set_post_terms($post_id, $resource['proficiencyLevel'], \"asn_proficiency_level\");\n\t\tadd_post_meta($post_id, 'resource_uri', rawurlencode($resource['url']), true);\n\t}\n\t\n}", "function addStation($name,$line,$name1,$name2,$distfromS1,$price=array(0,0,0)){\n\n /**\n * Parameters:\n * Name = the name of the new station you want to add.\n * line = the name of the line in which you will add the station.\n * name1 = name of the first station\n * name2 = name of the terminal station to determine direction\n *\n * distfromS1 = the distance of the new staion from name1\n * price = array of three ints\n *\n */\n\n // check existance in Database, each station is identified by key pair (Nom, NomLigne)\n if ( ! (($station1= getStationDB($name1,$line)) && ($station2= getStationDB($name2,$line)))) return \"stations do not exist\";\n if (getStationDB($name,$line)) return \"station already exists\";\n\n\n // calculate distance\n if ($station1->getDist() > $station2->getDist()) {$dist=$station1->getDist()-$distfromS1;}\n else if ($station1->getDist() < $station2->getDist()) {$dist=$station1->getDist()+$distfromS1;}\n else {\n $dist=$station1->getDist() + $distfromS1 * getisTerminalUtility($station2);\n\n }\n\n // check if new station is not in the location of an existing station\n if (getStationByDistDB($dist,$line)) return \"invalid distance\";\n\n // we can now safely create and insert our station\n $newstation = new Station($name,$line,$dist,$price);\n insertStationDB($newstation);\n return false;\n\n}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "function addbrandname($brand,$addbranddescr,$addbrandstatus)\n\t{\n\t\t$names = array('name' => $brand ,'description' => $addbranddescr, 'status' => $addbrandstatus);\n\t\t$add_query = $this->insert( 'brand', $names );\n\t\tif( $add_query )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function add( $data, $shard = NULL );", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "public function add(){\n\t\t\t$formAction = \"index.php?area=backend&controller=news&action=do_add\";\n\t\t\t//xuat du lieu ra view qua ham renderHTML\n\t\t\t$this->renderHTML(\"views/backend/add_edit_news.php\",array(\"formAction\"=>$formAction));\n\t\t}", "function appendTerminalStation($new,$old,$linename,$dist,$price=array(0,0,0)){\n\n //check if old terminal exists\n $oldterminal = getStationDB($old,$linename);\n\n\n //check if old terminal is terminal\n if (! getisTerminalUtility($oldterminal)) return \"station to replace is not terminal\";\n\n //check if new station doesn't exists\n if (getStationDB($new,$linename)) return \"station already exists\";\n\n //create new terminal\n $pos = getisTerminalUtility($oldterminal);\n $dist = $oldterminal->getDist() + ($pos * $dist);\n $newterminal = New Station($new,$linename,$dist,$price);\n\n //insert new terminal\n insertStationDB($newterminal);\n\n return false;\n\n}", "public function addAction() {\r\n\t\t$channel_id = intval($this->getInput('channel_id'));\r\n\t\t$this->assign('ad_types', $this->ad_types[$channel_id]);\r\n\t\t$this->assign('channel_id', $channel_id);\r\n\t\t$ad_type = $this->getInput('ad_type');\r\n\t\t$this->assign('ad_type', $ad_type);\r\n\t\t\r\n\t\tif($channel_id == 2 || $channel_id == 6) {\r\n\t\t list(, $ptypes) = Type_Service_Ptype::getsBy(array('status'=>1,'pid'=>0), array('sort'=>'DESC', 'id'=>'DESC'));\r\n\t\t $this->assign('ptype', $ptypes);\r\n\t\t}\r\n\t\t\r\n\t\tif($channel_id == 2) {\r\n\t\t $this->assign('actions', $this->client_actions);\r\n\t\t}\r\n\t\t\r\n\t\t//module channel\r\n\t\tlist($modules, $channel_names) = Gou_Service_ChannelModule::getsModuleChannel();\r\n\t\t$this->assign('modules', $modules);\r\n\t\t$this->assign('channel_names', $channel_names);\r\n\t}", "public function addCard()\n {\n }", "function addData($data){\n\t\t\t//encode array\n\t\t\twhile(list($key,$val) = each($data)){\n\t\t\t\t$data[$key] = utf8_encode($val);\n\t\t\t}\n\t\t\t\n\t\t\t$this->root->new_child('title',$data['prog_title']);\n\t\t\t$this->root->new_child('alternative',$data['prog_alt_title']);\n\t\t\t\n\t\t\t//series data\n\t\t\t$series = $this->root->new_child('series',null);\n\t\t\t$series->new_child('id',$data['series_id']);\n\t\t\t$series->new_child('title',$data['series_title']);\n\t\t\t$series->new_child('description',$data['series_desc']);\n\t\t\t\n\t\t\t$this->root->new_child('stationid',SOTF_STATION_ID);\n\t\t\t$this->root->new_child('language',$data['prog_lang']);\n\t\t\t$this->root->new_child('rights',$data['prog_rights']);\n\t\t\t$this->root->new_child('genre',$data['prog_genre']);\n\t\t\t$this->root->new_child('topic',$data['prog_topic']);\n\t\t\t\n\t\t\t$this->root->new_child('description',$data['prog_desc']);\n\t\t\t$this->root->new_child('contributor',$data['prog_contrib']);\n\t\t\t$this->root->new_child('identifier',$data['prog_id']);\n\t\t\t\n\t\t\t$creator = $this->root->new_child('creator',null);\n\t\t\t$entity = $creator->new_child('entity',null);\t\n\t\t\t$entity->set_attribute('type','organisation');\n\t\t\t$entity_name = $entity->new_child('name',SOTF_PUB);\n\t\t\t$entity_name->set_attribute('type','organizationname');\n\t\t\t$entity_acronym = $entity->new_child('name',SOTF_PUB_ACR);\n\t\t\t$entity_acronym->set_attribute('type','organizationacronym');\n\t\t\t$entity->new_child('e-mail',SOTF_PUB_MAIL);\n\t\t\t$entity->new_child('address',SOTF_PUB_ADR);\n\t\t\t$entity->new_child('logo',SOTF_PUB_LOGO);\n\t\t\t$entity->new_child('uri',SOTF_PUB_URI);\n\t\t\t\n\t\t\t$publisher = $this->root->new_child('publisher',null);\n\t\t\t$entity = $publisher->new_child('entity',null);\t\n\t\t\t$entity->set_attribute('type','organisation');\n\t\t\t$entity_name = $entity->new_child('name',SOTF_PUB);\n\t\t\t$entity_name->set_attribute('type','organizationname');\n\t\t\t$entity_acronym = $entity->new_child('name',SOTF_PUB_ACR);\n\t\t\t$entity_acronym->set_attribute('type','organizationacronym');\n\t\t\t$entity->new_child('e-mail',SOTF_PUB_MAIL);\n\t\t\t$entity->new_child('address',SOTF_PUB_ADR);\n\t\t\t$entity->new_child('logo',SOTF_PUB_LOGO);\n\t\t\t$entity->new_child('uri',SOTF_PUB_URI);\n\t\t\t\n\t\t\t$date = $this->root->new_child('date',$data['prog_datecreated']);\n\t\t\t$date->set_attribute('type','created');\n\t\t\t\n\t\t\t$date = $this->root->new_child('date',$data['prog_dateissued']);\n\t\t\t$date->set_attribute('type','issued');\n\t\t\t\n\t\t\t$date = $this->root->new_child('date',$data['prog_dateavailable']);\n\t\t\t$date->set_attribute('type','available');\n\t\t\t\n\t\t\t$date = $this->root->new_child('date',$data['prog_datemodified']);\n\t\t\t$date->set_attribute('type','modified');\n\t\t\t\n\t\t\t$owner = $this->root->new_child('owner',null);\n\t\t\t$owner->new_child('auth_id',$data['owner_user_authid']);\n\t\t\t$owner->new_child('login',$data['owner_user_login']);\n\t\t\t$owner->new_child('name',$data['owner_user_name']);\n\t\t\t$owner->new_child('role',$data['owner_user_role']);\n\t\t\t\n\t\t\t$publisher = $this->root->new_child('publishedby',null);\n\t\t\t$publisher->new_child('auth_id',$data['owner_user_authid']);\n\t\t\t$publisher->new_child('login',$data['owner_user_login']);\n\t\t\t$publisher->new_child('name',$data['owner_user_name']);\n\t\t\t$publisher->new_child('role',$data['owner_user_role']);\n\t\t}", "public function add() {\n if ($this->id == 0) {\n $reponse = $this->bdd->prepare('INSERT INTO chapitres SET title = :title, body = :body');\n $reponse->execute([\n 'body'=>$this->body, \n 'title'=>$this->title\n ]);\n }\n }", "function add(Http $http)\n \t{\n \t\tif(! $http->get('id')){\n \t\t\t $slide = new oCoder;\n \t\t}else{\n \t\t\t$slide = oCoder::find($http->get('id'));\n\n \t\t}\n \t\t$slide->name = $http->get('name');\n\t\t$slide->content = $http->get('content');\n\t\t$slide->image_link = $http->get('image_link');\n\t\t$slide->save();\n \t\t \n \t\treturn redirect_response(panel_url('oCoder::editSlide', ['id'=> $slide->id ]));\n \t}", "function add() {\n\n\t\t// assign values from $_POST to class variables\n\t\t$this -> personal_id = $this -> input -> post('personal_id', TRUE);\n\n\t\t$this -> movable_number = $this -> input -> post('movable_number', TRUE);\n\n\t\t$this -> series_number = $this -> input -> post('series_number', TRUE);\n\n\t\t$this -> unit = $this -> input -> post('unit', TRUE);\n\n\t\t$this -> comment = $this -> input -> post('comment', TRUE);\n\t\t//tr_date_add\n\n\t\t$this -> give_date = tr_date_add($this -> input -> post('give_date', TRUE));\n\n\t\t$this -> take_date = tr_date_add($this -> input -> post('take_date', TRUE));\n\n\t\t$ok = $this -> db -> insert('movable', $this);\n\n\t\tif ($ok) {\n\n\t\t\t$this -> res = $this -> db -> insert_id();\n\t\t\t//$data['lastid'] = $this->db->insert_id() ;\n\n\t\t}\n\n\t\treturn $this -> res;\n\n\t}", "public function addAction() {\r\n\t}", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function add() {\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authenticate()) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend/login', '<strong>Error:</strong> Please login to continue.');\n\t\t\t}\n\t\t\t// Authorize w/ backend app.\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authorize('sharers', 'add')) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend', '<strong>Error:</strong> Insufficient user access.');\n\t\t\t}\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n \t\t\t// Handle form submit.\n\t\t\t\treturn $this->models['sharers']->add();\n\t\t\t} else {\n \t\t\t// Load view.\n \t\t\treturn $this->_loadView(dirname(__FILE__) .'/views/add.tpl');\n\t\t\t}\n\t\t}", "function add() {\n\t\tif (True) {\n\n\t\t\t// create an empty product.\n\t\t\t$o =& new ufo_product(0);\n\t\t\t$this->addedObject =& $o;\n\t\t\n\t\t\t// create an entry in the db.\n\t\t\t$o->initialize();\n\t\t\t$o->create();\n\t\t\t$o->edit();\n\n\t\t\t// add it to the product array.\n\t\t\t$this->product[] = $o;\n\t\t}\n\t}", "function ag_add_coll() {\n\tif(!isset($_POST['coll_name'])) {die('missing data');}\n\t$name = $_POST['coll_name'];\n\t\n\t$resp = wp_insert_term( $name, 'ag_collections', array( 'slug'=>sanitize_title($name)) );\n\t\n\tif(is_array($resp)) {die('success');}\n\telse {\n\t\t$err_mes = $resp->errors['term_exists'][0];\n\t\tdie($err_mes);\n\t}\n}", "public function addAction() {\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "protected function addSlug()\n {\n $slugSource = $this->generateSlugFrom();\n\n $slug = $this->generateUniqueSlug($slugSource);\n\n $this->slug = $slug;\n }", "function makeResource($rType, $details, $identifier, $department){\n sqlQuery(\"INSERT INTO resources (resource_type, resource_details, resource_identifier, resource_department) VALUES ('$rType','$details','$identifier','$department')\");\n alog(\"Added resource $identifier\");\n}", "function add() {\n Ad::addAd($_POST['title'], $_POST['url'], $_POST['description']);\n unset($_POST['title']);\n unset($_POST['url']);\n unset($_POST['description']);\n }", "function add ($other) {\n $this->getTool();\n return ($this->tool->add(&$this, $other));\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "function addNewTrunk() {\n\n $sql\n = \"INSERT INTO $this->table (\n id,\n transport,\n aors,\n context,\n dtls_ca_file,\n dtls_cert_file,\n dtls_verify,\n dtls_setup,\n outbound_auth,\n disallow,\n allow,\n direct_media,\n date_created\n )\n VALUES \n (\n '$this->id',\n '$this->transport',\n '$this->id',\n '$this->context',\n '$this->dtls_ca_file',\n '$this->dtls_cert_file',\n '$this->dtls_verify',\n '$this->dtls_setup',\n '$this->outbound_auth',\n '$this->disallow',\n '$this->allow',\n '$this->direct_media',\n '$this->date'\n );\";\n\n $setDID = (strpos($this->id, '+') === false) ? \"+$this->id\" : $this->id;\n\n $sql_trunk = \"INSERT INTO ctn_trunks (id_endpoint, name, status) VALUES ('$this->id', '$this->name', 0)\";\n\n // echo $sql . '<br>';\n $this->doSql($sql);\n $this->doSql($sql_trunk);\n }", "function add_rew_land()\n{\n\t$lables = array(\n\t\t\t'name' => 'Lands',\n\t\t\t'singular_name'=>'Land',\n\t\t\t'rewrite' => array( 'slug' => 'land' ),\n\t\t\t'all_items'=> 'All Lands',\n\t\t\t'add_new'=>'Add New Land',\n\t\t\t'add_new_item'=>' Add New Land',\n \n\n\t\t );\n\n\t$tax = array(\n\n\t\t\t\t\t'category',\n\n\t\t\t\t\t\n\t\t);\n\t$args = array(\n\t\t'labels'=> $lables,\n\t\t'public'=>true,\n\t\t'show_in_menu'=>true,\n\t\t'show_in_admin_bar'=>true,\n\t\t'show_in_nav_menus'=>true,\n\t\t'description'=>'Enter your Description',\n\t\t'menu_position'=>10,\n\t\t'menu_icon'=>'dashicons-format-quote',\n\t\t'taxonomies'=>$tax,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' , 'custom-fields' ),\n\t\t 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n 'query_var' => true,\n 'show_in_rest' => true,\n 'rest_base' => 'land',\n\n\t\t);\t\n\tregister_post_type('Land', $args);\n\t//add_action('init' , 'codex_custom_init');\n\t\n}", "public function add($data)\n {\n }", "function add_book() {\n global $wpdb;\n\n $this->check_dir();\n $this->check_db();\n\n foreach($_POST as $key=>$value) {\n \t$_POST[\"$key\"] = $wpdb->escape($value);\n }\n\n $sql = \"insert into `\".$this->table_name.\"` (`name`, `date`) values ('\".$_POST['name'].\"', '\".date(\"U\").\"')\";\n $wpdb->query($sql);\n $id = $wpdb->get_var(\"select LAST_INSERT_ID();\", 0, 0);\n $xml_file = $this->plugin_path.$this->books_dir.\"/\".$id.\".xml\";\n\n $xml = $this->create_xml($_POST['Width'], $_POST['Height'], $_POST['LoaderColor'], $_POST['InnerSideColor'], $_POST['Autoplay'], $_POST['FieldOfView'], $_POST['SideShadowAlpha'], $_POST['DropShadowAlpha'], $_POST['DropShadowDistance'], $_POST['DropShadowScale'], $_POST['DropShadowBlurX'], $_POST['DropShadowBlurY'], $_POST['MenuDistanceX'], $_POST['MenuDistanceY'], $_POST['MenuColor1'], $_POST['MenuColor2'], $_POST['MenuColor3'], $_POST['ControlSize'], $_POST['ControlDistance'] , $_POST['ControlColor1'], $_POST['ControlColor2'], $_POST['ControlAlpha'], $_POST['ControlAlphaOver'], $_POST['ControlsX'], $_POST['ControlsY'],$_POST['ControlsAlign'], $_POST['TooltipHeight'], $_POST['TooltipColor'], $_POST['TooltipTextY'], $_POST['TooltipTextStyle'], $_POST['TooltipTextColor'], $_POST['TooltipMarginLeft'], $_POST['TooltipMarginRight'], $_POST['TooltipTextSharpness'], $_POST['TooltipTextThickness'], $_POST['InfoWidth'], $_POST['InfoBackground'], $_POST['InfoBackgroundAlpha'], $_POST['InfoMargin'], $_POST['InfoSharpness'], $_POST['InfoThickness'], '', '' );\n $config_file = @fopen($xml_file, \"w+\");\n if(!fwrite($config_file, $xml)) {\n \t$sql = \"delete from `\".$this->table_name.\"` where `id` = '\".$id.\"'\";\n \t$wpdb->query($sql);\n\n \techo \"Adding piecemaker error! Please setup permission to the piecemakers/ , piecemaker-images/ folders and include files to &quot;777&nbsp;\";\n\t\t return 0;\n }\n fclose($config_file);\n\t}", "function ajouterRessource($id_bp_ressource,$id_owner,$id_bp,$personne,$revenu_pro,$retraite,$pole_emploi,$pensions,$rsa,$prestations_familiales,$aides_logement,$allocation_diverses,$autres)\r\n\t{\r\n\t\t$db = Zend_Registry::get('dbAdapter');\r\n\t\t$data = array('id_owner'=>$id_owner,'date_creation'=>time(),'id_bp'=>$id_bp,\"personne\"=>$personne,\"revenu_pro_net\"=>$revenu_pro,\"retraite\"=>$retraite,\"pole_emploi\"=>$pole_emploi,\"pensions\"=>$pensions,\"rsa\"=>$rsa,\"prestations_familiales\"=>$prestations_familiales\r\n\t\t,'aide_logement'=>$aides_logement,'allocations_diverses'=>$allocation_diverses,'autres'=>$autres);\r\n\t\t\r\n\t\tif($id_bp_ressource=='')\r\n\t\t{\r\n\t\t$db->insert('egw_bp_ressource',$data);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['id_modifier']=$id_owner;\r\n\t\t\t$data['date_last_modified']=time();\r\n\t\t$db->update('egw_bp_ressource',$data,'id_bp_ressource='.$id_bp_ressource);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public function addAction() {\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\tlist(, $subjects) = Client_Service_Subject::getAllSubject();\n\t\t$this->assign('subjects', $subjects);\n\t}", "public function addAction() {\n\t\tlist(, $groups) = Resource_Service_Pgroup::getAllPgroup();\n\t\t$this->assign('groups', $groups);\n\t\t$this->assign('ntype', $this->ntype);\n\t\t$this->assign('btype', $this->btype);\n\t}", "public function add()\n {\n $data = [\n 'property' => [\n 'template' => 'extracurricular_add',\n 'title' => 'Tambah Ekstrakurikuler',\n 'menu' => $this->menu->read(),\n ],\n 'data' => [],\n ];\n\n $this->load->view('template', $data);\n }", "function addSTC($propRS){\r\n\tinclude('Connections/adestate.php'); \r\n//\techo \"thmb =\".$propRS['THUMB_PIC_PATH'];\r\n\t$logo_file = \"images/soldstc.png\"; \r\n\t$image_file = $propRS['THUMB_PIC_PATH']; \r\n $image_info = getimagesize($image_file);\r\n\t//echo \"mannestateDB = \".$mannestateDB;\r\n\t$picture_ID = getSeqNextVal( $mannestateDB, $database_mannestateDB, \"sequence_picture_id\" );\r\n $uploadfilename = $picture_ID.'_STC_THUMB';\r\n $photo = \"\";\r\n $image_type = $image_info[2];\r\n\t//echo \"type = \".$image_info;\r\n\t if( $image_type == IMAGETYPE_JPEG ) {\r\n\t\t $photo = imagecreatefromjpeg($image_file);\r\n\t\t $uploadfile = '../property_images/'.$propRS['PROPERTY_ID'].'/'.$uploadfilename.\".jpg\";\r\n\t } elseif( $image_type == IMAGETYPE_GIF ) {\r\n\t\t $photo = imagecreatefromgif($image_file);\r\n \t\t $uploadfile = '../property_images/'.$propRS['PROPERTY_ID'].'/'.$uploadfilename.\".gif\";\r\n\t } elseif( $image_type == IMAGETYPE_PNG ) {\r\n\t\t $photo = imagecreatefrompng($image_file);\r\n\t\t $uploadfile = '../property_images/'.$propRS['PROPERTY_ID'].'/'.$uploadfilename.\".png\";\r\n\t }\r\n //echo \"photo\".$photo;\r\n\t$fotoW = imagesx($photo); \r\n\t$fotoH = imagesy($photo); \r\n\t$targetfile = $uploadfile; \r\n\r\n $logoImage = imagecreatefrompng($logo_file); \r\n\t$logoW = imagesx($logoImage); \r\n\t$logoH = imagesy($logoImage); \r\n\t$photoFrame = imagecreatetruecolor($fotoW,$fotoH); \r\n\t$dest_x = $fotoW - $logoW; \r\n\t$dest_y = $fotoH - $logoH; \r\n\timagecopyresampled($photoFrame, $photo, 0, 0, 0, 0, $fotoW, $fotoH, $fotoW, $fotoH); \r\n\timagecopy($photoFrame, $logoImage, 0, 0, 0, 0, $logoW, $logoH); \r\n\timagejpeg($photoFrame, $targetfile); \r\n//\techo \"dest_x\".$dest_x;\r\n\t\r\n\t$image_file = $propRS['SLIDE_PIC_PATH']; \r\n $uploadfilename = $picture_ID.'_STC_SLIDE';\r\n\t if( $image_type == IMAGETYPE_JPEG ) {\r\n\t\t $photo = imagecreatefromjpeg($image_file);\r\n\t\t $uploadfile = '../property_images/'.$propRS['PROPERTY_ID'].'/'.$uploadfilename.\".jpg\";\r\n\t } elseif( $image_type == IMAGETYPE_GIF ) {\r\n\t\t $photo = imagecreatefromgif($image_file);\r\n \t\t $uploadfile = '../property_images/'.$propRS['PROPERTY_ID'].'/'.$uploadfilename.\".gif\";\r\n\t } elseif( $image_type == IMAGETYPE_PNG ) {\r\n\t\t $photo = imagecreatefrompng($image_file);\r\n\t\t $uploadfile = '../property_images/'.$propRS['PROPERTY_ID'].'/'.$uploadfilename.\".png\";\r\n\t }\r\n\t$fotoW = imagesx($photo); \r\n\t$fotoH = imagesy($photo); \r\n\t$slidetargetfile = $uploadfile; \r\n\r\n $logoImage = imagecreatefrompng($logo_file); \r\n\t$logoW = imagesx($logoImage); \r\n\t$logoH = imagesy($logoImage); \r\n\t$photoFrame = imagecreatetruecolor($fotoW,$fotoH); \r\n\t$dest_x = $fotoW - $logoW; \r\n\t$dest_y = $fotoH - $logoH; \r\n\timagecopyresampled($photoFrame, $photo, 0, 0, 0, 0, $fotoW, $fotoH, $fotoW, $fotoH); \r\n\timagecopy($photoFrame, $logoImage, 0, 0, 0, 0, $logoW, $logoH); \r\n\timagejpeg($photoFrame, $slidetargetfile); \r\n\t\r\n\t\r\n $updateSQL = sprintf(\"UPDATE pictures SET IS_MAIN=%s WHERE PROPERTY_ID=%s\",\r\n\t\t\t\t\t\t GetSQLValueString(\"N\", \"text\"),\r\n\t\t\t\t\t\t\t\t GetSQLValueString($propRS['PROPERTY_ID'], \"int\"));\r\n $mainRS = mysql_query($updateSQL) or die(mysql_error());\r\n\t//echo $updateSQL;\r\n\t$insertSQL = sprintf(\"INSERT INTO pictures ( PICTURE_ID, PROPERTY_ID, IS_MAIN, TITLE, COMMENTS, THUMB_PIC_PATH, SLIDE_PIC_PATH, FULL_PIC_PATH, ORIGINAL_PIC_PATH) VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s)\",\r\n\t\t\t GetSQLValueString($picture_ID, \"double\"),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t GetSQLValueString($propRS['PROPERTY_ID'], \"int\"),\r\n\t\t\t GetSQLValueString('Y', \"text\"),\r\n\t\t\t GetSQLValueString(\"STC\", \"text\"),\r\n\t\t\t GetSQLValueString(\"\", \"text\"),\r\n\t\t\t GetSQLValueString($targetfile, \"text\"),\r\n\t\t\t GetSQLValueString($slidetargetfile, \"text\"),\r\n\t\t\t GetSQLValueString($slidetargetfile, \"text\"),\r\n\t\t\t GetSQLValueString($slidetargetfile, \"text\"));\r\n\t//echo $insertSQL;\r\n $picRS = mysql_query($insertSQL) or die(mysql_error());\r\n//echo \"STC added\";\r\n }", "public function addAction() {\r\n \t$this->checkRight();\r\n \t$gid = $this->getInput('gid');\r\n \t$title = \"添加收货人地址\";\r\n \t$this->assign('title', $title);\r\n \t$this->assign('gid', $gid);\r\n }", "function addComponent($data);", "function bethel_add_image_to_stories() {\n\tglobal $post;\n\tif ($post && ($post->post_type=='bethel_stories' || $post->page_template == 'stories.php')) {\n\t\techo \"<div class=\\\"bethel-featured-image-wrapper\\\">\";\n\t\tthe_post_thumbnail('bethel_column_width');\n\t\t$caption = apply_filters ('bethel_featured_image_caption', '');\n\t\tif ($caption != '') {\n\t\t\techo \"<div class=\\\"bethel-featured-image-caption\\\">{$caption}</div>\";\n\t\t}\n\t\tdo_action ('bethel_after_featured_image');\n\t\techo \"</div>\";\n\t}\n}", "public function p_add() {\n if (empty($_POST['title'])) {\n Router::redirect(\"/trips/new/missing\");\n }\n\n # Associate this trip with this user\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this trip was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n $_POST['coverimg'] = \"fpo.jpg\";\n\n # Insert\n DB::instance(DB_NAME)->insert(\"trips\", $_POST);\n\n Router::redirect(\"/trips/index\");\n\n }", "function add_dashboard() {\n}", "public function Add(&$entity)\n {\n \n }", "public function add(string $content) {\n\t\t$image = $this->getImage();\n\t\t$image->setPage($content);\n\t\t$this->setImage($image);\n\t}", "public function addNewAction()\n {\n\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n $title = $_POST['title'];\n $content = $_POST['content'];\n $error = '';\n\n /*\n * validate fields\n *\n */\n if ($title == 'aaa') {\n $error = 'Greska - polje Title ne moze da ima ovaj sadrzaj';\n $errors[] = $error;\n }\n\n if ($content== 'aaa') {\n $error = 'Greska - polje Content ne moze da ima ovaj sadrzaj';\n $errors[] = $error;\n }\n\n if (empty($errors)) {\n\n try {\n\n $post = PostService::create($title,$content);\n View::renderTemplate('Posts/addPost.html', [\n 'post' => $post\n ]);\n\n return;\n\n } catch (\\PDOException $e) {\n $errors[] = $e->getMessage();\n }\n\n }\n\n View::renderTemplate('Posts/addPost.html', [\n 'title' => $title,\n 'content' => $content,\n 'errors' => $errors\n ]);\n exit();\n }\n View::renderTemplate('Posts/addPost.html');\n }", "public function add_postAction() {\n\t\t$info = $this->getPost(array('sort', 'title', 'ad_type', 'ad_ptype', 'link', 'img', 'icon', 'start_time', 'end_time', 'status'));\n\t\t$info['ad_type'] = $this->ad_type;\n\t\t$info = $this->_cookData($info);\n\t\t\n\t\tif($info['ad_ptype'] == 1){\n\t\t\t$adInfo = Resource_Service_Games::getResourceGames($info['link']);\n\t\t\t$tip = \"内容\";\n\t\t} else if($info['ad_ptype'] == 2){\n\t\t\t$adInfo = Resource_Service_Attribute::getResourceAttributeByTypeId($info['link'],1);\n\t\t\t$tip = \"分类\";\n\t\t} else if($info['ad_ptype'] == 3){\n\t\t\t$adInfo = Client_Service_Subject::getSubject($info['link']);\n\t\t\t$tip = \"专题\";\n\t\t}\n\t\t$msg = $this->_getMsg($adInfo, $tip,$info['ad_ptype'],$info['link']);\n\t\t$result = Client_Service_Ad::addAd($info);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function create() //添加\n {\n\t\t//\n }", "function add() {\n\t\t$this->account();\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Menu->create();\n\t\t\tif ($this->Menu->save($this->data)) {\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$this->loadModel(\"Menu\");\n $menulist = $this->Menu->generatetreelist(null,null,null,\" _ \");\n $this->set(compact('menulist'));\n\t}", "function add($meta = array(), $post_id = 0, $is_main = \\false)\n {\n }", "function roster_add($pid = 0, $tid = 0, $sid = 0)\n\t{\n\t\t// Retrieve all the players, teams, or seasons.\n\t\t$players = $this->players->retrieve_roster();\n\t\t$teams = $this->teams->retrieve_roster();\n\t\t$seasons = $this->seasons->retrieve_roster();\n\n\t\t// If there are no players, teams, or seasons...\n\t\tif (!$players || !$teams || !$seasons)\n\t\t{\n\t\t\tshow_error('At least one team, one player, and one season must be added for roster functions to work.');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'form_action' => 'action_add_roster',\n\t\t\t'title' => 'Add to Roster',\n\t\t\t'js' => array('/js/admin/admin.js'),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'players' => $players,\n\t\t\t'teams' => $teams,\n\t\t\t'seasons' => $seasons,\n\t\t\t'pid' => $pid,\n\t\t\t'tid' => $tid,\n\t\t\t'sid' => $sid,\n\t\t\t'submit_message' => 'Add to Roster',\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->helper(array('form'));\n\n\t\t$this->load->view('admin/add_roster.php', $data);\n\t}", "public function testAddString() {\n $head = Head::getInstance();\n $head->add('Invalid head string');\n }", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "public function addPostAction() {\n $inputVars = $this->getInput(array(\n \t\t'id', 'dataType', //主表字段:id,type\n \t\t \t'data'//子表字段\n ));\n \tlist($news, $itemsList) = $this->checkInput($inputVars);\n \t$news['create_time'] = time();\n \t$result = Admin_Service_Material::add($news, $itemsList);\n \tif (!$result) $this->failPostOutput('操作失败');\n \t$this->successPostOutput($this->actions['listUrl']);\n }", "function addStory(& $story, & $pageElement) {\n\t\t$storyElement =& $this->_document->createElement('story');\n\t\t$pageElement->appendChild($storyElement);\n\t\t\n\t\t$this->addCommonProporties($story, $storyElement);\n\t\t\n\t\tif ($story->getField('texttype') == \"text\")\n\t\t\t$texttype = \"text\";\n\t\telse\n\t\t\t$texttype = \"html\";\n\t\t\t\t\n \t\tif ($story->getField('shorttext')) {\n \t\t\t$shorttext =& $this->_document->createElement('shorttext');\n\t\t\t$storyElement->appendChild($shorttext);\n\t\t\t$shorttext->appendChild($this->_document->createTextNode(htmlspecialchars(convertInteralLinksToTags($story->owning_site, $story->getField('shorttext')))));\n\t\t\t$shorttext->setAttribute('text_type', $texttype);\n \t\t}\n \t\t\n \t\tif ($story->getField('longertext')) {\n \t\t\t$longertext =& $this->_document->createElement('longertext');\n\t\t\t$storyElement->appendChild($longertext);\n\t\t\t$longertext->appendChild($this->_document->createTextNode(htmlspecialchars(convertInteralLinksToTags($story->owning_site, $story->getField('longertext')))));\n\t\t\t$longertext->setAttribute('text_type', $texttype);\n \t\t}\n \t\t\n \t\t$this->addStoryProporties($story, $storyElement);\n\t}", "public function add()\n\t{\n\t\tEvent::add('ushahidi_filter.map_base_layers', array($this, '_add_layer'));\n\t\tif (Router::$controller != 'settings')\n\t\t{\n\t\t\tEvent::add('ushahidi_filter.map_layers_js', array($this, '_add_map_layers_js'));\n\t\t}\n\t}", "function add_swakelola($params)\n {\n $this->db->insert('swakelola',$params);\n return $this->db->insert_id();\n }" ]
[ "0.5975317", "0.59654295", "0.5900318", "0.5900318", "0.58995247", "0.5880278", "0.5876555", "0.5876555", "0.56491363", "0.56491363", "0.56491363", "0.56411445", "0.55566204", "0.55074006", "0.54472446", "0.54142445", "0.54070556", "0.5396708", "0.5385892", "0.53798586", "0.53703207", "0.5357295", "0.5347082", "0.53071946", "0.5283421", "0.52814656", "0.52795476", "0.52780575", "0.52673393", "0.52614856", "0.52606666", "0.52458113", "0.52457434", "0.5236861", "0.522475", "0.52164143", "0.52145797", "0.52048045", "0.5204402", "0.5198306", "0.5194482", "0.51766497", "0.5172499", "0.5164248", "0.5164038", "0.5160837", "0.5157737", "0.51493263", "0.51424074", "0.51424074", "0.51424074", "0.51374173", "0.5137285", "0.5134417", "0.5126668", "0.51243967", "0.5120249", "0.51196486", "0.5106671", "0.5106651", "0.5106559", "0.5105722", "0.5105657", "0.5105407", "0.51051134", "0.51032203", "0.5097673", "0.50833184", "0.50776327", "0.5077369", "0.5076664", "0.5073351", "0.5071326", "0.50699764", "0.5065068", "0.50619984", "0.505619", "0.5056036", "0.5052014", "0.504852", "0.5048162", "0.5047624", "0.5034337", "0.5028567", "0.5027633", "0.5015242", "0.50088054", "0.5008562", "0.5004776", "0.5003808", "0.5001688", "0.5001305", "0.49973765", "0.49970344", "0.4995193", "0.49894896", "0.49887896", "0.49886292", "0.4985498", "0.4985106", "0.49785206" ]
0.0
-1
/////////////////////////////////////////////////////////// ADD DOUBLECLICK FOR PUBLISHERS (DFP) ///////////////////////////////////////////////////////////
function add_DFP(){ ?> <script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> <script> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; </script> <script> var ad_home_billboard, ad_mobile_box; googletag.cmd.push(function() { <?php if( !wp_is_mobile() ){ ?> googletag.defineSlot('/94465771/7boom_Billboard_all', [[728, 90], [970, 250]], 'div-gpt-ad-1503949356736-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Billboard_9am', [[728, 90], [970, 250]], 'div-gpt-ad-1503949678961-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Billboard_6pm', [[970, 250], [728, 90]], 'div-gpt-ad-1503949716909-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Billboard_8pm', [[728, 90], [970, 250]], 'div-gpt-ad-1503949802451-0').addService(googletag.pubads()); <?php } else { ?> googletag.defineSlot('/94465771/7boom_m_Boxbanner_All', [[300, 250], [300, 300]], 'div-gpt-ad-1503950138877-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_m_Boxbanner_9am', [[300, 300], [300, 250]], 'div-gpt-ad-1503950165993-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_m_Boxbanner_6pm', [[300, 300], [300, 250]], 'div-gpt-ad-1503950188173-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_m_Boxbanner_8pm', [[300, 300], [300, 250]], 'div-gpt-ad-1503950213186-0').addService(googletag.pubads()); <?php } ?> googletag.defineSlot('/94465771/7boom_Boxbanner_1_All', [[300, 250], [300, 300]], 'div-gpt-ad-1503949907122-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Boxbanner_2_All', [[300, 300], [300, 250]], 'div-gpt-ad-1503950030022-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Boxbanner_1_9am', [[300, 250], [300, 300]], 'div-gpt-ad-1503949935630-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Boxbanner_2_9am', [[300, 250], [300, 300]], 'div-gpt-ad-1503950060345-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Boxbanner_1_6pm', [[300, 250], [300, 300]], 'div-gpt-ad-1503949960322-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Boxbanner_2_6pm', [[300, 250], [300, 300]], 'div-gpt-ad-1503950079788-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Boxbanner_1_8pm', [[300, 250], [300, 300]], 'div-gpt-ad-1503949983999-0').addService(googletag.pubads()); googletag.defineSlot('/94465771/7boom_Boxbanner_2_8pm', [[300, 250], [300, 300]], 'div-gpt-ad-1503950105552-0').addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); //googletag.pubads().disableInitialLoad(); googletag.enableServices(); }); </script> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addDblClickAction(NonKeyAction $a){\n\t\t$this->_on_dbl_click[] = $a;\n\t}", "function getOnDblClick() {return $this->_ondblclick;}", "function vip_doubleclick_dartiframe_redirect() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "function print_embed_sharing_button()\n {\n }", "function _h_jetpack_share_add_print_listener($url, $share) {\n if ($share->shortname === 'print') {\n $url = '#print';\n return \"$url\\\" onclick=\\\"window.print();\";\n }\n\n return $url;\n}", "public function clickFinger()\n {\n }", "function getjsOnDblClick() {return $this->readjsOnDblClick();}", "public function pro_ad_click_action()\n\t{\n\t\tglobal $wpdb, $pro_ads_main, $pro_ads_browser, $pro_ads_statistics;\n\t\t\n\t\tif( isset( $_GET['pasID'] ) && !empty( $_GET['pasID'] ) )\n\t\t{\n\t\t\t$banner_id = base64_decode($_GET['pasID']);\n\t\t\t$adzone_id = isset($_GET['pasZONE']) && !empty($_GET['pasZONE']) ? base64_decode($_GET['pasZONE']) : '';\n\t\t\t\n\t\t\t$banner_link = get_post_meta( $banner_id, 'banner_link', true );\n\t\t\t\n\t\t\t$pro_ads_statistics->save_clicks( $banner_id, $adzone_id );\n\t\t\t\n\t\t\theader('Location: '. $banner_link);\n\t\t\texit;\n\t\t}\n\t}", "function wp_direct_php_update_button()\n {\n }", "public function removeDblClickAction(NonKeyAction $a){\n\t\t$index = array_search($a, $this->_on_dbl_click);\n\t\tif(isset($this->_on_dbl_click[$index])){\n\t\t\tarray_splice($this->_on_dbl_click, $index, 1);\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function dokan_add_to_wishlist_link() {\n if ( class_exists( 'YITH_WCWL' ) ) {\n global $yith_wcwl, $product;\n\n printf( '<a href=\"%s\" class=\"btn fav add_to_wishlist\" data-product-id=\"%d\" data-product-type=\"\"><i class=\"fa fa-heart\"></i></a>', $yith_wcwl->get_addtowishlist_url(), $product->id );\n }\n}", "function double_play_offer_link()\n{\n\tglobal $form_config;\n\t\n\t$offer_link = 'http://track.thewebgemnetwork.com/aff_c?offer_id=1301&aff_id=3903';\n\t\n\t$offer_link .= '&aff_sub=' . urlencode($form_config['affid']);\n\n\t$offer_link .= '&first_name=' . urlencode($_POST['first_name']);\n\t$offer_link .= '&last_name=' . urlencode($_POST['last_name']);\n\t$offer_link .= '&street_addr1=' . urlencode($_POST['street_addr1']);\n\t$offer_link .= '&city=' . urlencode($_POST['city']);\n\t$offer_link .= '&state=' . urlencode($_POST['state']);\n\t$offer_link .= '&zip=' . urlencode($_POST['zip']);\n\t//$offer_link .= '&phone_home=' . urlencode($_POST['HomePhone']);\n\t$offer_link .= '&email=' . urlencode($_POST['email']);\n\t//$offer_link .= '&bank_aba=' . urlencode($_POST['BankRoutingNumber']);\n\t//$offer_link .= '&bank_account=' . urlencode($_POST['BankAccountNumber']);\n\t\n\treturn $offer_link;\n}", "public function add_button() {\n\t\tglobal $product;\n\n\t\tif ($this->gateway === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t$product->product_type == 'external' ||\n\t\t\t!$this->customer_can() ||\n\t\t\t!$this->gateway->is_available() ||\n\t\t\t$this->gateway->configs->settings['one_click'] !== 'yes'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $product->product_type == 'variable' ) {\n\t\t\tadd_action( 'woocommerce_after_single_variation', array( $this, 'print_button' ) );\n\t\t} else {\n\t\t\tadd_action( 'woocommerce_after_add_to_cart_button', array( $this, 'print_button' ) );\n\t\t}\n\t}", "private function button2() {\n\t\tif ( $this->button_array['button2']['text'] ) {\n\t\t\t?>\n\t\t\tlastOpenedPointer.find( '#pointer-close' ).after('<a id=\"pointer-primary\" class=\"button-primary\">' +\n\t\t\t\t'<?php echo esc_attr( $this->button_array['button2']['text'] ); ?>' + '</a>');\n\t\t\tlastOpenedPointer.find('#pointer-primary').click(function () {\n\t\t\t<?php echo $this->button_array['button2']['function']; ?>\n\t\t\t});\n\t\t<?php\n\t\t}\n\t}", "public function click(): void\n {\n $this->itemsList->backToSidebar()->handleLink($this->itemsList->getName(), $this->getName());\n }", "function insert_share_product() {\n\t?>\n\t<script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-57e482b2e67c850b\"></script>\n\t<div class=\"addthis_inline_share_toolbox_4524\"></div>\n\t<?php\n}", "protected function _registerFrontEndClick()\n { // Create a hit id if none present\n if( !$this->_hid /* and APPLICATION_ENVIRONMENT == 'production' */) {\n // Construct the URL\n $url = \"https://affiliate.rbmtracker.com/rd/r.php?pub={$this->_affid}&sid={$this->_cid}&c1={$this->_c1}&c2={$this->_c2}&c3={$this->_c3}\";\n // Mark the click\n $response = file_get_contents($url);\n // Check for permission denied from HitPath\n if( $response == 'The link you have requested is not available, please try your request later.') return;\n // Decode response\n $json = json_decode($response);\n // Check for invalid response\n if( $json === null ) return;\n // Validate the HID\n if( !$json->hid || !is_numeric($json->hid) ) return;\n // Store the HID\n $this->_hid = $json->hid;\n $affData = Yii::app()->session['affData'];\n $affData['hid'] = $this->_hid;\n Yii::app()->session['affData'] = $affData;\n // Log the click\n $this->log('Click registered: '.$this->_hid);\n }\n }", "function owa_newAttachmentActionTracker($post_id) {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$post = get_post($post_id);\r\n\t$label = $post->post_title;\r\n\t$owa->trackAction('wordpress', 'Attachment Created', $label);\r\n}", "function track_link($slug,$values)\n {\n global $wpdb, $prli_click, $prli_options, $prli_link, $prli_update;\n \n $query = \"SELECT * FROM \".$prli_link->table_name.\" WHERE slug='$slug' LIMIT 1\";\n $pretty_link = $wpdb->get_row($query);\n $pretty_link_target = apply_filters('prli_target_url',array('url' => $pretty_link->url, 'link_id' => $pretty_link->id));\n $pretty_link_url = $pretty_link_target['url'];\n \n if(isset($pretty_link->track_me) and $pretty_link->track_me)\n {\n $first_click = 0;\n \n $click_ip = isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'';\n $click_referer = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'';\n $click_uri = isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'';\n $click_user_agent = isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'';\n\n //Set Cookie if it doesn't exist\n $cookie_name = 'prli_click_' . $pretty_link->id;\n\n //Used for unique click tracking\n $cookie_expire_time = time()+60*60*24*30; // Expire in 30 days\n \n if(!isset($_COOKIE[$cookie_name]))\n {\n setcookie($cookie_name,$slug,$cookie_expire_time,'/');\n $first_click = 1;\n }\n \n if(isset($prli_options->extended_tracking) and $prli_options->extended_tracking == 'extended')\n {\n $click_browser = $this->php_get_browser();\n $click_host = gethostbyaddr($click_ip);\n\n $visitor_cookie = 'prli_visitor';\n //Used for visitor activity\n $visitor_cookie_expire_time = time()+60*60*24*365; // Expire in 1 year\n \n // Retrieve / Generate visitor id\n if(!isset($_COOKIE[$visitor_cookie]))\n {\n $visitor_uid = $prli_click->generateUniqueVisitorId();\n setcookie($visitor_cookie,$visitor_uid,$visitor_cookie_expire_time,'/');\n }\n else\n $visitor_uid = $_COOKIE[$visitor_cookie];\n }\n else\n {\n $click_browser = array( 'browser' => '', 'version' => '', 'platform' => '', 'crawler' => '' );\n $click_host = '';\n $visitor_uid = '';\n }\n \n if($prli_options->extended_tracking != 'count')\n {\n //Record Click in DB\n $insert_str = \"INSERT INTO {$prli_click->table_name} (link_id,vuid,ip,browser,btype,bversion,os,referer,uri,host,first_click,robot,created_at) VALUES (%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d,%d,NOW())\";\n $insert = $wpdb->prepare($insert_str, $pretty_link->id,\n $visitor_uid,\n $click_ip,\n $click_user_agent,\n $click_browser['browser'],\n $click_browser['version'],\n $click_browser['platform'],\n $click_referer,\n $click_uri,\n $click_host,\n $first_click,\n $this->this_is_a_robot($click_user_agent,$click_browser));\n \n $results = $wpdb->query( $insert );\n \n do_action('prli_record_click',array('link_id' => $pretty_link->id, 'click_id' => $wpdb->insert_id, 'url' => $pretty_link_url));\n }\n else\n {\n global $prli_link_meta;\n $exclude_ips = explode(\",\", $prli_options->prli_exclude_ips);\n if(!in_array($click_ip, $exclude_ips) and !$this->this_is_a_robot($click_user_agent,$click_browser))\n {\n $clicks = $prli_link_meta->get_link_meta($pretty_link->id, 'static-clicks', true);\n $clicks = (empty($clicks) or $clicks === false)?0:$clicks;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-clicks', $clicks+1);\n\n if($first_click)\n {\n $uniques = $prli_link_meta->get_link_meta($pretty_link->id, 'static-uniques', true);\n $uniques = (empty($uniques) or $uniques === false)?0:$uniques;\n $prli_link_meta->update_link_meta($pretty_link->id, 'static-uniques', $uniques+1);\n }\n }\n }\n }\n \n // Reformat Parameters\n $param_string = '';\n \n if(isset($pretty_link->param_forwarding) and ($pretty_link->param_forwarding == 'custom' OR $pretty_link->param_forwarding == 'on') and isset($values) and count($values) >= 1)\n {\n $first_param = true;\n foreach($values as $key => $value)\n {\n if($first_param)\n {\n $param_string = (preg_match(\"#\\?#\", $pretty_link_url)?\"&\":\"?\");\n $first_param = false;\n }\n else\n $param_string .= \"&\";\n \n $param_string .= \"$key=$value\";\n }\n }\n \n if(isset($pretty_link->nofollow) and $pretty_link->nofollow)\n header(\"X-Robots-Tag: noindex, nofollow\", true);\n\n switch($pretty_link->redirect_type)\n {\n case '301':\n header(\"HTTP/1.1 301 Moved Permanently\");\n header('Location: '.$pretty_link_url.$param_string);\n break;\n default:\n if( $pretty_link->redirect_type == '307' or\n !$prli_update->pro_is_installed_and_authorized() )\n {\n if($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')\n header(\"HTTP/1.1 302 Found\");\n else\n header(\"HTTP/1.1 307 Temporary Redirect\");\n header('Location: '.$pretty_link_url.$param_string);\n }\n else\n do_action('prli_issue_cloaked_redirect', $pretty_link->redirect_type, $pretty_link, $pretty_link_url, $param_string);\n }\n }", "function affiliatewp_dlt_plugin_activate() {\n\tadd_option( 'affwp_dlt_activated', true );\n}", "function wpcr_twitter_extended_callback() {\n?>\n\t<div>\n\t<br /><br />\n\t<p><b>Publish Settings</b></p><br />\n\tSettings for the Twitter Publish plugin.<br />\n\t<?php wpcr_twitter_publish_auto_callback(); ?>\n\t</div>\n\n<?php\n}", "function enqueue_auto_click_script() \n{\n wp_register_script('auto_click_script', plugin_dir_url(__FILE__).'/assets/tf-op-auto-click-script.js', array('jquery'), '1.1', true);\n\n wp_enqueue_script('auto_click_script', 9999);\n}", "function print_embed_comments_button()\n {\n }", "private function define_gdpr_hooks()\n {\n $gdpr = new MailChimp_WooCommerce_Privacy();\n\n $this->loader->add_action('admin_init', $gdpr, 'privacy_policy');\n $this->loader->add_filter('wp_privacy_personal_data_exporters', $gdpr, 'register_exporter', 10);\n $this->loader->add_filter('wp_privacy_personal_data_erasers', $gdpr, 'register_eraser', 10);\n }", "function webamp_remove_double_menu() {\n // register your script location, dependencies and version\n wp_register_script('custom_script',\n plugin_dir_url( __FILE__ ) . 'js/doublemenuscript.js',\n array('jquery'),\n '1.0',\n true);\n // enqueue the script\n wp_enqueue_script('custom_script');\n}", "function wp_idolondemand_twitterfeed($args) {\n\textract($args);\t\n\techo $before_widget;\n\techo $before_title;?>twitter.com/idolondemand<?php echo $after_title;\n\tdisplay_wp_idolondemand_twitter_feed();\n\techo $after_widget;\n}", "function print_embed_sharing_dialog()\n {\n }", "function get_wbf_admin_download_link(){\n\t$url = self_admin_url('update.php?action=install-plugin&amp;plugin=wbf');\n\t$url = wp_nonce_url($url, 'install-plugin_wbf');\n\treturn $url;\n}", "function alt_click_link($url, $alt_url)\n\t{\n\t\treturn Backend_Html::alt_click_link($url, $alt_url);\n\t}", "function getjsOnDblClick () { return $this->readjsOnDblClick(); }", "function getjsOnDblClick () { return $this->readjsOnDblClick(); }", "function getjsOnDblClick () { return $this->readjsOnDblClick(); }", "function getjsOnDblClick () { return $this->readjsOnDblClick(); }", "function tsuiseki_tracking_click($data) {\n if (!empty($data)) {\n $t_data = (string)(trim($data));\n // We need to cut the first \"ref=\" as it comes from the javascript part\n // and may overlay the partner field.\n if (preg_match('/^ref=.*/', $t_data)) {\n $t_data = mb_substr($t_data, mb_strpos($t_data, '=') + 1);\n }\n $t_parts = preg_split('/;;/', $t_data);\n $src_url = (string)(trim($t_parts[0]));\n $width = (string)(trim($t_parts[1]));\n $height = (string)(trim($t_parts[2]));\n $mousex = (string)(trim($t_parts[3]));\n $mousey = (string)(trim($t_parts[4]));\n $browser = (string)(trim($t_parts[5]));\n $browser_version = (string)(trim($t_parts[6]));\n $referer = (string)(trim($t_parts[7]));\n if (!empty($referer)) {\n // Wir extrahieren nur die Domain!\n $r_parts = array();\n preg_match('/[a-z]{3,5}:\\/\\/(.+?)[\\/?:]/', $referer, $r_parts);\n if (!empty($r_parts[1])) {\n $referer = 'referer='. (string)trim($r_parts[1]);\n }\n }\n $click_type = (string)(trim($t_parts[8]));\n $click_bits = (string)trim($t_parts[9]);\n }\n\n $key = (string)trim($_SESSION['TSUISEKI_TRACKER_KEY']);\n if (!empty($src_url) && !empty($key)) {\n $ref = urldecode($src_url);\n $data = (string)(trim(tsuiseki_tracking_get_data($ref)));\n $data .= '&'. $width .'&'. $height .'&'. $mousex .'&'. $mousey .'&'. $browser .'&'. $browser_version .'&'. $click_bits .'&'. $referer .'&'. $click_type;\n $data = urlencode($data);\n $ip = ip2long($_SERVER['REMOTE_ADDR']);\n $url = \"http://tracker.tsuiseki.com/tsuiseki.php?q=$key;1;$ip;$data&ajax=1\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, (string)trim($_SERVER['HTTP_USER_AGENT']));\n curl_setopt($ch, CURLOPT_REFERER, $src_url);\n $result = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n trigger_error(curl_error($ch), curl_errno($ch));\n }\n curl_close($ch);\n }\n // generate the response\n $response = json_encode( array( 'success' => true ) );\n // response output\n header( \"Content-Type: application/json\" );\n echo $response;\n exit;\n //return 0;\n}", "function dwc_activation_functions() {\n\t// Set All Plugin Options when plugin activate\n\t$dwc_plugin_options_data = array(\n\t\t'dwc_shop_wishlist_btn' \t\t=>\t'on',\n\t\t'dwc_shop_wishlist_btn_text' \t=>\t'Wishlist',\n\t\t'dwc_shop_compare_btn' \t\t\t=>\t'on',\n\t\t'dwc_shop_compare_btn_text' \t=>\t'Compare',\n\t\t'dwc_single_wishlist_btn' \t\t=>\t'on',\n\t\t'dwc_single_wishlist_btn_text' \t=>\t'Wishlist',\n\t\t'dwc_single_compare_btn' \t\t=>\t'on',\n\t\t'dwc_single_compare_btn_text' \t=>\t'Compare',\n\t);\n\t// Update Theme Options\n\tupdate_option( 'dwc_plugin_options', $dwc_plugin_options_data, '', 'yes' );\n\n\t// Auto create table when plugin activate\n\tglobal $wpdb;\n\tglobal $jal_db_version;\n\n\t$table_name = $wpdb->prefix . 'liveshoutbox';\n\t\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\t$sql = \"CREATE TABLE $table_name (\n\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\ttime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n\t\tname tinytext NOT NULL,\n\t\ttext text NOT NULL,\n\t\turl varchar(55) DEFAULT '' NOT NULL,\n\t\tUNIQUE KEY id (id)\n\t) $charset_collate;\";\n\n\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\tdbDelta( $sql );\n}", "public function getDblClickActions(){\n\t\treturn $this->_on_dbl_click;\n\t }", "function permalink_save_twice_notice() {\n\tif( isset($_POST['_wp_http_referer']) && strpos($_POST['_wp_http_referer'], 'options-permalink.php') ) {\n\t\tprint_r('<div id=\"message\" class=\"updated\"><p>'.__('Note: Please make sure you save your permalink settings <strong>twice</strong> in order for them to be applied correctly in Jigoshop', 'jigoshop' ).'</p></div>');\n\t}\n}", "function broadcast_support_button( $term_id ) {\n\t$rabe_options = get_option( 'rabe_option_name' );\n\t$support_page = $rabe_options['support_page'];\n\tif ( $support_page ) {\n\t\t?>\n\t\t<a href=\"<?php echo get_permalink( $support_page ) . '?broadcast-id=' . $term_id; ?>\">\n\t\t\t<button><?php echo __( 'Support', 'rabe' ) . ' ' . get_broadcast_name( $term_id ); ?></button>\n\t\t</a>\n\t\t<?php\n\t}\n}", "public function setSocialUniqueClick($value)\n\t{\n\t\t$this->socialUniqueClick = $value;\n\t}", "public function print_button() {\n\t\t\techo do_shortcode( \"[yith_wcwl_add_to_wishlist]\" );\n\t\t}", "function bab_postmaster($evt, $stp='')\n{\n global $bab_pm_PrefsTable, $bab_pm_SubscribersTable;\n\n if ($evt == 'postmaster' && $stp == 'export') {\n bab_pm_export();\n return;\n }\n\n header(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\"); // Date in the past\n header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n header(\"Pragma: no-cache\");\n\n // session_start();\n pagetop('Postmaster','');\n\n // define the users table names (with prefix)\n $bab_pm_PrefsTable = safe_pfx('bab_pm_list_prefs');\n $bab_pm_SubscribersTable = safe_pfx('bab_pm_subscribers');\n\n\n // set up script for hiding add sections\n echo $jshas = <<<jshas\n<script type=\"text/javascript\">\n$(document).ready(function(){\n $(\"a.show\").click(function() {\n console.log('hi');\n $(this).closest('fieldset').find('.stuff').toggle();\n });\n});\n</script>\njshas;\n\n // check tables. if not exist, create tables\n $check_prefsTable = @getThings('describe `'.PFX.'bab_pm_list_prefs`');\n $check_subscribersTable = @getThings('describe `'.PFX.'bab_pm_subscribers`');\n\n if (!$check_prefsTable or !$check_subscribersTable) {\n bab_pm_createTables();\n }\n\n $sql = \"SHOW COLUMNS FROM {$bab_pm_SubscribersTable} LIKE '%name%'\";\n\n $rs = safe_query($sql);\n\n if (numRows($rs) < 2) {\n //upgrade the db\n bab_pm_upgrade_db();\n }\n\n // define postmaster styles\n\n bab_pm_create_subscribers_list();\n\n bab_pm_styles();\n\n bab_pm_poweredit();\n\n // masthead / navigation\n\n // fix this hack\n $step = gps('step');\n\n if (!$step) {\n $step = 'subscribers';\n }\n //assign all down state\n $td_subscribers = $td_lists = $td_importexport = $td_formsend = $td_prefs = '<td class=\"navlink\">';\n\n $active_tab_var = 'td_' . $step;\n $$active_tab_var = '<td class=\"navlink-active\">';\n\n $pm_nav = <<<pm_nav\n<table id=\"pagetop\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-bottom:10px;margin-top:-20px;\">\n <tr id=\"nav-secondary\"><td align=\"center\" class=\"tabs\" colspan=\"2\">\n <td>\n <table id=\"bab_pm_nav\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" colspan=\"2\" style=\"margin-bottom:30px;\" >\n <tr>\n $td_subscribers<a href=\"?event=postmaster&step=subscribers\" class=\"plain\">Subscribers</a></td>\n $td_lists<a href=\"?event=postmaster&step=lists\" class=\"plain\">Lists</a></td>\n $td_importexport<a href=\"?event=postmaster&step=importexport\" class=\"plain\">Import/Export</a></td>\n $td_formsend<a href=\"?event=postmaster&step=formsend\" class=\"plain\">Direct Send</a></td>\n $td_prefs<a href=\"?event=postmaster&step=prefs\" class=\"plain\">Preferences</a></td>\n </tr>\n </table>\n </td>\n </tr>\n</table>\npm_nav;\n\n echo '<div id=\"bab_pm_master\">';\n echo '<div id=\"bab_pm_nav\">' . $pm_nav . '</div>';\n echo '<div id=\"bab_pm_content\">';\n bab_pm_ifs(); // deal with the \"ifs\" (if delete button pushed, etc)\n\n include_once txpath.'/publish.php'; // testing page_url\n\n $handler = \"bab_pm_$step\";\n\n if (!function_exists($handler)) {\n $handler = \"bab_pm_subscribers\";\n }\n\n $handler();\n\n echo '</div>'; // end bab_pm_content\n echo '</div>'; // end master_bab_pm\n}", "function update_copyprov1($clickpro, $selecpro, $iframepro, $droppro){\r\nglobal $wpdb;\r\n\tif($clickpro==\"\"){\r\n\t$clickpro=\"n\";\r\n\t}\r\n\tif($selecpro==\"\"){\r\n\t$selecpro=\"n\";\r\n\t}\r\n\tif($iframepro==\"\"){\r\n\t$iframepro=\"n\";\r\n\t}\r\n\tif($droppro==\"\"){\r\n\t$droppro=\"n\";\r\n\t}\r\n$wpdb->query(\"UPDATE copyrightpro SET copy_click = '$clickpro', copy_selection = '$selecpro', copy_iframe = '$iframepro', copy_drop = '$droppro'\");\r\n}", "function _insert_into_post_button($type)\n {\n }", "function ssl_widget() {\r\n $widget_ops = array('classname' => 'ssl_widget', 'description' => __('widget that display a slideshow from all attachments','ssl-plugin') ); \r\n $this->WP_Widget('ssl_widget', __('Siteshow Widget','ssl-plugin'), $widget_ops);\r\n }", "static function add_widget_to_sidebar($sidebar_id, $widget_name, $atts) {\n\n $widget_instances = get_option('widget_' . $widget_name);\n //All demo widgets will have an instance id of 99+\n $widget_instances[self::$last_widget_instance] = $atts;\n\n //add widget instance to DB\n update_option('widget_' . $widget_name, $widget_instances);\n $sidebars_widgets = get_option( 'sidebars_widgets' );\n $sidebars_widgets[ale_demo_base::sidebar_name_to_id($sidebar_id)][self::$last_sidebar_widget_position] = $widget_name . '-' . self::$last_widget_instance;\n update_option('sidebars_widgets', $sidebars_widgets);\n\n\n self::$last_sidebar_widget_position++;\n self::$last_widget_instance++;\n }", "function sendit_duplicate_post_link( $actions, $post ) {\n\tif (current_user_can('edit_posts')) {\n\t\tif($post->post_type=='newsletter') {\n\t\t$actions['duplicate'] = '<a href=\"admin.php?action=sendit_duplicate_post_as_draft&amp;post=' . $post->ID . '\" title=\"Duplicate this item\" rel=\"permalink\">Duplicate</a>';\t\t\t\n\t\t}\n\n\t}\n\treturn $actions;\t\n}", "function media_button() {\n global $post;\n\n if( WP_Dummy_Admin::is_in_post_page() ) {\n $thickbox_url = '#TB_inline?width=753&height=578&inlineId=lipsum-generator';\n echo '<a href=\"'. $thickbox_url .'\" class=\"button add-lipsum-dummy\" id=\"add-lipsum-dummy\" title=\"' . esc_attr__( 'Lipsum Generator', 'colabsthemes' ) . '\" onclick=\"return false;\">'. __('Lipsum Generator', 'colabsthemes') .'</a>';\n }\n }", "public function register_rest_audio_download_link() {\n\t\tregister_rest_field(\n\t\t\tssp_post_types(),\n\t\t\t'download_link',\n\t\t\tarray(\n\t\t\t\t'get_callback' => array( $this, 'get_rest_audio_download_link' ),\n\t\t\t\t'update_callback' => null,\n\t\t\t\t'schema' => null,\n\t\t\t)\n\t\t);\n\t}", "function wppb_multiple_forms_publish_admin_hook(){\r\n\tglobal $post;\r\n\t\r\n\tif ( is_admin() && ( ( $post->post_type == 'wppb-epf-cpt' ) || ( $post->post_type == 'wppb-rf-cpt' ) ) ){\r\n\t\t?>\r\n\t\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\t\tjQuery(document).ready(function() {\r\n\t\t\t\tjQuery(document).on( 'click', '#publish', function(){\r\n\t\t\t\t\tvar post_title = jQuery( '#title' ).val();\r\n\r\n\t\t\t\t\tif ( jQuery.trim( post_title ) == '' ){\r\n\t\t\t\t\t\talert ( '<?php _e( 'You need to specify the title of the form before creating it', 'profile-builder' ); ?>' );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tjQuery( '#ajax-loading' ).hide();\r\n\t\t\t\t\t\tjQuery( '.spinner' ).hide();\r\n\t\t\t\t\t\tjQuery( '#publish' ).removeClass( 'button-primary-disabled' );\r\n\t\t\t\t\t\tjQuery( '#save-post' ).removeClass('button-disabled' );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\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</script>\r\n\t\t<?php\r\n\t}\r\n}", "function add_wp_hooks(){\n\n\t\t$comments = new WordpressConnectComments();\n\t\t$like = new WordpressConnectLikeButton();\n\n\t}", "private function button3() {\n\t\tif ( $this->button_array['button3']['text'] ) {\n\t\t\t?>\n\t\t\tlastOpenedPointer.find('#pointer-primary').after('<a id=\"pointer-ternary\" style=\"float: left;\" class=\"button-secondary\">' +\n\t\t\t\t'<?php echo esc_attr( $this->button_array['button3']['text'] ); ?>' + '</a>');\n\t\t\tlastOpenedPointer.find('#pointer-ternary').click(function () {\n\t\t\t<?php echo $this->button_array['button3']['function']; ?>\n\t\t\t});\n\t\t<?php }\n\t}", "public function setNewsfeedClick($value)\n\t{\n\t\t$this->newsfeed_click = $value;\n\t}", "public function media_button()\n\t{\n\t\t$type = 'picasa';\n\t\t$id = 'picasa';\n\t\t$title = \"Add Picasa Media\";\n\t\t$icon = plugins_url('/images/picasa-logo.png', __FILE__);\n\n\t\techo \"<a href='\" . esc_url( get_upload_iframe_src($type) ) . \"' id='{$id}-add_{$type}' class='thickbox add_$type' title='\" . esc_attr( $title ) . \"'><img src='\" . $icon . \"' alt='$title' onclick='return false;' /></a>\";\n\t}", "public function setSocialClick($value) \n\t{\n\t\t$this->socialClick = $value;\n\t}", "function ebay_feeds_for_wordpress_Widget() {\n // curl need to be installed\n\tregister_widget( 'ebay_feeds_for_wordpress_Widget_class' );\n}", "public function addDoubleList(array $params)\n {\n $this->scriptContainer['double_list'] .= \"$('#\".$params['id'].\"').multiselect2side({\n 'search': '\".$params['search'].\"',\n 'minSize': \".$params['minSize'].\",\n 'selectedPosition': '\".$params['selectedPosition'].\"',\n 'moveOptions': '\".$params['moveOptions'].\"',\n 'labelTop': '\".$params['labelTop'].\"',\n 'labelBottom': '\".$params['labelBottom'].\"',\n 'labelUp': '\".$params['labelUp'].\"',\n 'labelDown': '\".$params['labelDown'].\"',\n 'labelSort': '\".$params['labelSort'].\"',\n 'maxSelected': \".$params['maxSelected'].\",\n 'labelsx': '\".$params['labelsx'].\"',\n 'labeldx': '\".$params['labeldx'].\"',\n 'autoSort': '\".$params['autoSort'].\"',\n 'caseSensitive': '\".$params['caseSensitive'].\"',\n 'delay': \".$params['delay'].\"\n });\";\n }", "function custom_bookmark_links() {\n global $post;\n?>\n<ul class=\"bookmark_links\">\n\t<li><a rel=\"nofollow\" href=\"http://delicious.com/save?url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>\" onclick=\"window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=<?php urlencode(the_permalink()); ?>&amp;title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;\" title=\"Bookmark this post on del.icio.us\">Bookmark this article on Delicious</a></li>\n</ul>\n<?php\n}", "function genesisawesome_subscribe_sharebox() {\n\n\tif ( ! is_singular( 'post' ) )\n\t\treturn;\n\t?>\n\n\t<?php if ( genesis_get_option( 'enable_post_subscribe_box', GA_CHILDTHEME_FIELD ) ) : ?>\n<div id='ga-subscribebox'>\n\t<h4><?php _e( 'Subscribe to Our Blog Updates!', 'genesisawesome' );?></h4>\n\t<p class='message'><?php _e( 'Subscribe to Our Free Email Updates!', 'genesisawesome' );?></p>\n\t<form action='http://feedburner.google.com/fb/a/mailverify' class='subscribeform' method='post' onsubmit='window.open(\"http://feedburner.google.com/fb/a/mailverify?uri=<?php echo esc_attr( genesis_get_option( 'feedburner_id', GA_CHILDTHEME_FIELD ) );?>\", \"popupwindow\", \"scrollbars=yes,width=550,height=520\");return true' target='popupwindow'>\n\t\t<input name='uri' type='hidden' value='<?php echo esc_attr( genesis_get_option( 'feedburner_id', GA_CHILDTHEME_FIELD ) );?>'/>\n\t\t<input name='loc' type='hidden' value='en_US'/>\n\t\t<input class='einput' name='email' onblur='if (this.value == \"\") {this.value = \"Enter your email...\";}' onfocus='if (this.value == \"Enter your email...\") {this.value = \"\"}' type='text' value='Enter your email...'/>\n\t\t<input class='ebutton' title='' type='submit' value='<?php _e( 'Subscribe', 'genesisawesome' );?>'/>\n\t</form>\n</div>\n\t<?php endif; ?>\n\n\t<?php if ( genesis_get_option( 'enable_post_social_share', GA_CHILDTHEME_FIELD ) ) : ?>\n<div id=\"ga-sharebox\">\n\t<h4><?php _e( 'Share this article!', 'genesisawesome' );?></h4>\n\t<table width='100%'>\n\t\t<tr>\n\t\t\t<td><iframe allowTransparency='true' src='//www.facebook.com/plugins/like.php?href=<?php echo urlencode( get_permalink() ); ?>&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=65' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:50px; height:65px;'></iframe></td>\n\t\t\t<td><a class='twitter-share-button' data-count='vertical' data-lang='en' data-title='<?php the_title_attribute(); ?>' data-url='<?php the_permalink(); ?>' href='https://twitter.com/share'>Tweet</a></td>\n\t\t\t<td>\t\n\t\t\t\t<div style='position:relative;'>\n\t\t\t\t\t<a class='pin-it-button' count-layout='vertical' href='http://pinterest.com/pin/create/button/?url=<?php echo urldecode( get_permalink() ); ?>'>Pin It now!</a>\n\t\t\t\t\t<a href='javascript:void(run_pinmarklet())' style='position:absolute;top:0;bottom:0;left:0;right:0;'></a>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<td><g:plusone href='<?php the_permalink(); ?>' size='tall'></g:plusone></td>\n\t\t\t<td>\n\t\t\t\t<su:badge layout=\"5\" location=\"<?php get_permalink();?>\"></su:badge>\n\t\t\t</td>\n\t\t\t<td><a class='DiggThisButton DiggMedium'></a></td>\n\t\t\t<td>\n\t\t\t\t<script src='//platform.linkedin.com/in.js' type='text/javascript'></script>\n\t\t\t\t<script data-counter='top' data-url='<?php the_permalink(); ?>' type='IN/Share'></script>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</div>\n\t<?php endif; ?>\n\n\t<?php if ( genesis_get_option( 'enable_post_related_posts', GA_CHILDTHEME_FIELD ) ) :?>\n<div id='ga-relatedposts'>\n\t <h4><?php _e( 'Related Posts', 'genesisawesome' );?></h4>\n\t <?php genesisawesome_related_posts(); ?>\n</div>\n\t<?php endif; ?>\n\n\t<?php\n\n}", "public function doubleClick($pageId, $elementId) {\n return $this->command('double_click', $pageId, $elementId);\n }", "public function clickUpdateWishlist()\n {\n $this->waitFormToLoad();\n $this->_rootElement->hover();\n $this->_rootElement->find($this->updateButton)->click();\n }", "function callbackTypePressed($entry,$event) {\n \n \n $this->table->database->designer->activeColumn = &$this;\n \n $v = $entry->get_text();\n $w = $this->table->database->glade->get_widget('type_'.$v);\n \n $w->set_active(true);\n $this->table->database->designer->menu->popup(null, null, null, (int) $event->button, (int) $event->time);\n \n \n }", "function it_exchange_custom_url_tracking_addon_increment_custom_url_click() {\n\n\t// Don't add if using default permalinks\n\tif ( ! get_option( 'permalink_structure' ) )\n\t\treturn;\n\n\t$post_id = get_query_var( 'p' );\n\t$custom_url = get_query_var( 'it_exchange_custom_url' );\n\t$custom_url = empty( $custom_url ) ? false : urldecode( $custom_url );\n\n\t// Set cookie on first time today\n\tif ( ! empty( $custom_url ) && empty( $_COOKIE['it-exchange-custom-url-' . sanitize_title_with_dashes( $custom_url )] ) ) {\n\t\tsetcookie( 'it-exchange-custom-url-' . sanitize_title_with_dashes( $custom_url ), true, time()+3600*24 );\n\t\t$first_time = true;\n\t}\n\n\tif ( ! empty( $first_time) && ! empty( $post_id ) && ! empty( $custom_url ) ) {\n\t\t$custom_url_clicks = get_post_meta( $post_id, '_it_exchange_custom_url_clicks', true );\n\t\t$custom_url_clicks[$custom_url] = empty( $custom_url_clicks[$custom_url] ) ? 1 : $custom_url_clicks[$custom_url] + 1;\n\t\tupdate_post_meta( $post_id, '_it_exchange_custom_url_clicks', $custom_url_clicks );\n\t}\n\tunset( $custom_url );\n}", "function wpbook_safe_publish_to_facebook($post_ID) { \n\t$debug_file= WP_PLUGIN_DIR .'/wpbook/wpbook_pub_debug.txt';\n\n\tif(!class_exists('Facebook')) {\n\t\tinclude_once(WP_PLUGIN_DIR.'/wpbook/includes/client/facebook.php');\n\t}\t \n\t$wpbookOptions = get_option('wpbookAdminOptions');\n \n\tif (!empty($wpbookOptions)) {\n\t\tforeach ($wpbookOptions as $key => $option)\n\t\t$wpbookAdminOptions[$key] = $option;\n\t}\n \n\tif($wpbookOptions['wpbook_enable_debug'] == \"true\")\n\t\tdefine ('WPBOOKDEBUG',true);\n\telse\n\t\tdefine ('WPBOOKDEBUG',false);\n \n\t$api_key = $wpbookAdminOptions['fb_api_key'];\n\t$secret = $wpbookAdminOptions['fb_secret'];\n\t$target_admin = $wpbookAdminOptions['fb_admin_target'];\n\t$target_page = $wpbookAdminOptions['fb_page_target'];\n\t$stream_publish = $wpbookAdminOptions['stream_publish'];\n\t$stream_publish_pages = $wpbookAdminOptions['stream_publish_pages'];\n\t$wpbook_show_errors = $wpbookAdminOptions['show_errors'];\n\t$wpbook_promote_external = $wpbookAdminOptions['promote_external'];\n\t$wpbook_attribution_line = $wpbookAdminOptions['attribution_line'];\n\t$wpbook_as_note = $wpbookAdminOptions['wpbook_as_note'];\n\t$wpbook_target_group = $wpbookAdminOptions['wpbook_target_group'];\n \n\tif($wpbookOptions['wpbook_disable_sslverify'] == \"true\") {\n\t\tFacebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;\n\t\tFacebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;\n\t}\n \n \n\t$facebook = new Facebook($api_key, $secret);\n\t$wpbook_user_access_token = get_option('wpbook_user_access_token','');\n\t$wpbook_page_access_token = get_option('wpbook_page_access_token','');\n \n\tif($wpbook_user_access_token == '') {\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\tif(($fp) && (filesize($debug_file) > 500 * 1024)) { // 500k max to file\n\t\t\t\tfclose($fp);\n\t\t\t\t$fp = @fopen($debug_file,'w+'); // start over with a new file\n\t\t\t}\n\t\t\tif(!$fp) \n\t\t\t\tdefine('WPBOOKDEBUG',false); // stop trying\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No user access token\\n\";\n\t\t\tif(is_writeable($debug_file)) {\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t} else {\n\t\t\t\tfclose($fp);\n\t\t\t\tdefine (WPBOOKDEBUG,false); // if it isn't writeable don't keep trying \n\t\t\t}\n\t\t}\n\t}\n\tif((!empty($api_key)) && (!empty($secret)) && (!empty($target_admin)) && (($stream_publish == \"true\") || $stream_publish_pages == \"true\")) {\n\t\tif(($wpbook_user_access_token == '')&&($wpbook_page_access_token == '')) {\n\t\t\t// if both of these are blank, no point in the rest of publish_to_facebook\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No user access token or page access token.\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\tif($wpbook_show_errors) {\n\t\t\t\t$wpbook_message = 'Both user access token AND page access_token are blank. You must grant permissions before publishing will work.'; \n\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t}\n\t\treturn;\n\t\t} \n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : publish_to_facebook running, target_admin is \" . $target_admin .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$my_post = get_post($post_ID);\n\t\tif(!empty($my_post->post_password)) { // post is password protected, don't post\n\t\t\treturn;\n\t\t}\n\t\tif(get_post_type($my_post->ID) != 'post') { // only do this for posts\n\t\t\treturn;\n\t\t}\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post ID is \". $my_post->ID .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$publish_meta = get_post_meta($my_post->ID,'wpbook_fb_publish',true); \n\t\tif(($publish_meta == 'no')) { // user chose not to post this one\n\t\t\treturn;\n\t\t}\n\t\t$my_title=$my_post->post_title;\n\t\t$my_author=get_userdata($my_post->post_author)->display_name;\n\t\tif($wpbook_promote_external) { \n\t\t\t$my_permalink = get_permalink($post_ID);\n\t\t} else {\n\t\t\t$my_permalink = wpbook_always_filter_postlink(get_permalink($post_ID));\n\t\t}\n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : My permalink is \". $my_permalink .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$publish_meta_message = get_post_meta($my_post->ID,'wpbook_message',true); \n\t\tif($publish_meta_message) {\n\t\t\t$wpbook_description = $publish_meta_message;\n\t\t} else {\n\t\t\tif(($my_post->post_excerpt) && ($my_post->post_excerpt != '')) {\n\t\t\t\t$wpbook_description = stripslashes(wp_filter_nohtml_kses(apply_filters('the_content',$my_post->post_excerpt)));\n\t\t\t} else { \n\t\t\t\t$wpbook_description = stripslashes(wp_filter_nohtml_kses(apply_filters('the_content',$my_post->post_content)));\n\t\t\t}\n\t\t}\n\t\tif(strlen($wpbook_description) >= 995) {\n\t\t\t$space_index = strrpos(substr($wpbook_description, 0, 995), ' ');\n\t\t\t$short_desc = substr($wpbook_description, 0, $space_index);\n\t\t\t$short_desc .= '...';\n\t\t\t$wpbook_description = $short_desc;\n\t\t}\n\n\t\tif (function_exists('get_the_post_thumbnail') && has_post_thumbnail($my_post->ID)) {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : function exists, and this post has_post_thumbnail - post_Id is \". $my_post->ID .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t} \n\t\t\t$my_thumb_id = get_post_thumbnail_id($my_post->ID);\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : my_thumb_id is \". $my_thumb_id .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\t$my_thumb_array = wp_get_attachment_image_src($my_thumb_id);\n\t\t\t$my_image = $my_thumb_array[0]; // this should be the url\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : my_image is \". $my_image .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t} else {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Get Post Thumbnail function does not exist, or no thumb \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\t\t \n\t\t\t$my_image = '';\n\t\t}\n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post thumbail is \". $my_image .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n\t\t$actions = json_encode(array(array('name'=>'Read More','link'=>$my_permalink)));\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post share link is \". $my_link .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t/* This section handles publishing to user's wall */ \n\t\tif($stream_publish == \"true\") {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to personal wall, admin is \" .$target_admin .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_user_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting user access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t \n\t\t\t$fb_response = '';\n\t\t\ttry{\n\t\t\t\tif(($wpbook_as_note == 'note') || ($wpbook_as_note == 'true')) {\n\t\t\t\t\t/* notes on walls don't allow much */ \n\t\t\t\t\t$allowedtags = array('img'=>array('src'=>array(), 'style'=>array()), \n 'span'=>array('id'=>array(), 'style'=>array()), \n 'a'=>array('href'=>array()), 'p'=>array(),\n 'b'=>array(),'i'=>array(),'u'=>array(),'big'=>array(),\n 'small'=>array(), 'ul' => array(), 'li'=>array(),\n 'ol'=> array(), 'blockquote'=> array(),'h1'=>array(),\n 'h2'=> array(), 'h3'=>array(),\n );\n\t\t\t\t\tif(!empty($my_image)) {\n /* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'subject' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'message' => wp_kses(stripslashes(apply_filters('the_content',$my_post->post_content)),$allowedtags), \n\t\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'subject' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'message' => wp_kses(stripslashes(apply_filters('the_content',$my_post->post_content)),$allowedtags), \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t}\n\t\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing as note, $my_image is \" . $my_image .\" \\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/notes', 'POST', $attachment);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t} elseif ($wpbook_as_note == 'link') {\n\t\t\t\t\t// post as link\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/links', 'POST', $attachment);\n\t\t\t\t} else {\n\t\t\t\t\t// post as a post\n\t\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t\t'picture' => $my_image,\n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t\t'comments_xid' => $post_ID, \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t}\n\t\t\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing as excerpt, $my_image is \" . $my_image .\" \\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/feed', 'POST', $attachment); \n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception in stream publish for user: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_user_stream_id', $fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_user_stream_time',0); // no comments imported yet\n\t\t\t} // end of if $response\n\t\t} // end of if stream_publish \n \n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Past stream_publish, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t/* This section handls publishing to group wall */ \n\t\tif(($stream_publish_pages == \"true\") && (!empty($wpbook_target_group))) {\n\t\t\t$fb_response = '';\n\t\t\t/* Publishing to a group's wall requires the user access token, and \n\t\t\t * is published as coming from the user, not the group - different process\n\t\t\t * than Pages \n\t\t\t */ \n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_user_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting user access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Group access token is \". $wpbook_user_access_token .\"\\n\";\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to group \" . $wpbook_target_group .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry{\n\t\t\t\t// post as an excerpt\n\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t} else {\n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t}\n\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to group, image is \" . $my_image .\" \\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\tif($wpbook_as_link == 'link') {\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $wpbook_target_group .'/links','POST',$attachment);\n\t\t\t\t} else {\n\t\t\t\t\t$fb_response = $facebook->api('/'. $wpbook_target_group .'/feed/','POST', $attachment); \n\t\t\t\t}\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to group via api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$wpbook_message = 'Caught exception in publish to group ' . $e->getMessage() . ' Error code: ' . $e->getCode();\n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try/catch for publish to group\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_group_stream_id',$fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_group_stream_time',0); // no comments imported\n\t\t\t} else {\n\t\t\t\t$wpbook_message = 'No post id returned from Facebook, $fb_response was ' . print_r($fb_response,true) . '/n';\n\t\t\t\t$wpbook_message = $wpbook_message . ' and $fb_page_type was ' . $fb_page_type;\n\t\t\t\t$wpbook_message .= ' and $wpbook_description was ' . $wpbook_description;\n\t\t\t\t$wpbook_message .= ' and $my_title was ' . $my_title;\n\t\t\t\twp_die($wpbook_message,'WPBook Error publishing to group'); \n\t\t\t} \n\t\t} // end of publish to group\n \n\t\t/* This section handles publishing to page wall */ \n\t\tif(($stream_publish_pages == \"true\") && (!empty($target_page))) { \n\t\t\t// publish to page with new api\n\t\t\t$fb_response = '';\n\t\t\tif($wpbook_page_access_token == '') {\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No Access Token for Publishing to Page\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\treturn; // no page access token, no point in trying to publish\n\t\t\t} \t \n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Page access token is \". $wpbook_page_access_token .\"\\n\";\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to page \" . $target_page .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_page_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting page access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t\t\ttry{\n\t\t\t\t// post as an excerpt\n\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions, \n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t} else {\n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t}\n\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to page, image is \" . $my_image .\" \\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\tif($wpbook_as_link == 'link') {\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_page .'/links/','POST',$attachment); \n\t\t\t\t} else {\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_page .'/feed/','POST', $attachment); \n\t\t\t\t}\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published as page to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$wpbook_message = 'Caught exception in publish to page ' . $e->getMessage() . ' Error code: ' . $e->getCode();\n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try/catch for publish to page\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_page_stream_id',$fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_page_stream_time',0); // no comments imported\n\t\t\t} else {\n\t\t\t\t$wpbook_message = 'No post id returned from Facebook, $fb_response was ' . print_r($fb_response,true) . '/n';\n\t\t\t\t$wpbook_message = $wpbook_message . ' and $fb_page_type was ' . $fb_page_type;\n\t\t\t\t$wpbook_message .= ' and $wpbook_description was ' . $wpbook_description;\n\t\t\t\t$wpbook_message .= ' and $my_title was ' . $my_title;\n\t\t\t\twp_die($wpbook_message,'WPBook Error publishing to page'); \n\t\t\t}\n\t\t} // end of if stream_publish_pages is true AND target_page non-empty\n\t} // end for if stream_publish OR stream_publish_pages is true\n}", "function dblions_sidebar_embed() {\n\t$embed = esc_attr( get_option( 'sidebar_embed' ) );\n\tcreate_input_field( array(\n\t\t\t'sidebar_embed', 'text', \n\t\t\t$embed, 'Sidebar Embed'\n\t\t) );\n}", "protected function bind_action_buttons() {\n\t\t\t?>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\tjQuery(\"#doaction\").click(function () {\n\t\t\t\t\t\treturn wpda_action_button();\n\t\t\t\t\t});\n\t\t\t\t\tjQuery(\"#doaction2\").click(function () {\n\t\t\t\t\t\treturn wpda_action_button();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}", "function get_the_wpc_button_link( $args ) {\n\n if ( empty( $args[ $args['link_type'] . '_link' ] ) ) {\n return '';\n }\n\n $link = $args[ $args['link_type'] . '_link' ];\n\n if ( 'link' === $args['link_type'] ) {\n $link = $link['url'];\n }\n\n return $link;\n}", "function pixelsquare_download_metabox(){\r\n\r\n \t//add_meta_box(html_id, meatbox_heading, callback_fun, post_type_where_its_diasplayed, position(normal,side), priority)\r\n \tadd_meta_box('download_metabox', 'Download Link', 'display_download_metabox', 'post', 'side', 'high');\r\n\r\n }", "function add_twitterfield_wp3($args){ \r\n $options = $this->get_options();\r\n $inputclass = $options['input_class'] ? 'class=\"'.$options['input_class'].'\"' : '';\r\n $inputfieldclass = $options['input_field_class'] ? 'class=\"'.$options['input_field_class'].'\"' : ''; \r\n $label = $options['input_label'];\r\n if($options['input_label_position'] == 'before'){\r\n $args['fields']['twitter'] = '<p '.$inputclass.'><label for=\"atf_twitter_id\">' . $label . '</label>' .\r\n '<input '.$inputfieldclass.' id=\"atf_twitter_id\" name=\"atf_twitter_id\" type=\"text\" size=\"30\" value=\"\"/></p>';\r\n } else {\r\n $args['fields']['twitter'] = '<p '.$inputclass.'>' .\r\n '<input '.$inputfieldclass.' id=\"atf_twitter_id\" name=\"atf_twitter_id\" type=\"text\" size=\"30\" value=\"\"/>\r\n <label for=\"atf_twitter_id\">' . $label . '</label></p>';\r\n\r\n }\r\n return $args;\r\n }", "function ywig_twitter_link_callback() {\n\techo '<p class=\"description\">Enter your Twitter url</p><input type=\"text\" name=\"twitter_link\" value=\"' . esc_url( get_option( 'twitter_link' ) ) . '\" placeholder=\"Twitter link\" />';\n}", "function psa_youtube_link( $id, $embeded = false ) {\n\tif ( $embeded == true ) {\n\t\treturn 'https://www.youtube.com/embed/' . $id . '?rel=0&autoplay=1';\n\t} else {\n\t\treturn 'https://youtu.be/' . $id;\n\t}\n}", "function pull_quote_url_meta() {\n add_meta_box('pull_quote_url_meta', 'Pull Quote URL', 'pull_quote_url_callback', 'discussion', 'normal', 'high');\n}", "function reussitepersonnelle_commander() {\n\t?>\n\t<li class=\"genesis-nav-menu menu-item commander\"><a onclick=\"javascript:__gaTracker('send', 'event', 'top-nav', 'commander');\" href=\"https://www.reussitepersonnelle.com/commande/?add-to-cart=7782\">Commander Maintenant</a></li>';\n\t<?php\n}", "function cc_add_upgrade_button() {\n\n// Get the upgrade link.\n $upgrade_link = apply_filters( 'cyberchimps_upgrade_link', esc_url_raw( 'http://cyberchimps.com' ) );\n ?>\n <script type=\"text/javascript\">\n jQuery( document ).ready( function( $ ) {\n jQuery( '#customize-info .accordion-section-title' ).append( '<a target=\"_blank\" class=\"button btn-upgrade\" href=\"<?php echo $upgrade_link; ?>\"><?php _e( 'Upgrade To Pro', 'cyberchimps_core' ); ?></a>' );\n jQuery( '#customize-info .btn-upgrade' ).click( function( event ) {\n event.stopPropagation();\n } );\n } );\n </script>\n <style>\n .wp-core-ui .btn-upgrade {\n color: #fff;\n background: none repeat scroll 0 0 #5BC0DE;\n border-color: #CCCCCC;\n box-shadow: 0 1px 0 #5BC0DE inset, 0 1px 0 rgba(0, 0, 0, 0.08);\n float: right;\n margin-top: -23px;\n }\n .wp-core-ui .btn-upgrade:hover {\n color: #fff;\n background: none repeat scroll 0 0 #39B3D7;\n box-shadow: 0 1px 0 #39B3D7 inset, 0 1px 0 rgba(0, 0, 0, 0.08);\n }\n .wp-core-ui #customize-info .theme-name{\n word-break: break-all;\n padding-right: 120px;\n }\n </style>\n <?php\n}", "function get_wbf_download_button($plugin_name){\n\t$button = sprintf(\n\t\t__( '<strong>'.$plugin_name.'</strong> requires Waboot Framework. <span class=\"wbf-install-now\"><a class=\"wbf-install-btn button\" href=\"%s\">%s</a></span>'),\n\t\tget_wbf_admin_download_link(),\n\t\t__( 'Install Now' )\n\t);\n\treturn $button;\n}", "public function daam_track_click()\n {\n\n //check the referer\n if ( ! check_ajax_referer('daam', 'security', false)) {\n echo \"Invalid AJAX Request\";\n die();\n }\n\n //get the data\n $post_id = $_POST['post_id'];\n $autolink_id = $_POST['autolink_id'];\n $user_ip = $_SERVER[\"REMOTE_ADDR\"];\n\n //get the minimum interval\n $minimum_interval = intval(get_option($this->shared->get('slug') . \"_tracking_minimum_interval\"), 10);\n\n //verify if there are tracked clicks submitted in the last $minimum_interval seconds\n global $wpdb;\n $table_name = $wpdb->prefix . $this->shared->get('slug') . \"_tracking\";\n $past_time_gmt = date(\"Y-m-d H:i:s\", current_time('timestamp', 1) - $minimum_interval);\n $current_time_gmt = current_time('mysql', 1);\n $safe_sql = $wpdb->prepare(\"SELECT COUNT(*) FROM $table_name WHERE user_ip = %s AND date_gmt BETWEEN %s AND %s\",\n $user_ip, $past_time_gmt, $current_time_gmt);\n $number_of_records = $wpdb->get_var($safe_sql);\n\n if (intval($number_of_records, 10) > 0) {\n echo 'rejected';\n die();\n }\n\n //save the click\n global $wpdb;\n $table_name = $wpdb->prefix . $this->shared->get('slug') . \"_tracking\";\n $safe_sql = $wpdb->prepare(\"INSERT INTO $table_name SET \n post_id = %d,\n autolink_id = %d,\n user_ip = %s,\n date = %s,\n date_gmt = %s\",\n $post_id,\n $autolink_id,\n $user_ip,\n current_time('mysql', 0),\n current_time('mysql', 1)\n );\n\n $query_result = $wpdb->query($safe_sql);\n\n if ($query_result !== false) {\n echo \"saved\";\n } else {\n echo \"error\";\n }\n\n die();\n\n }", "function WBC3_guest_contributor_add_admin_panel() {\n\tadd_meta_box(\n\t\t'WBC3_guest_contributor_editor',\n\t\t__('Guest Contributor'),\n\t\t'WBC3_guest_contributor_editor',\n\t\t'post',\n\t\t'normal',\n\t\t'low'\n\t);\n}", "function WeblizarTwitterWidget() {\r\n\tregister_widget( 'WeblizarTwitter' );\r\n}", "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 }", "function on_buy()\r\n\t{\r\n\t}", "function owa_editAttachmentActionTracker($post_id) {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$post = get_post($post_id);\r\n\t$label = $post->post_title;\r\n\t$owa->trackAction('wordpress', 'Attachment Edit', $label);\r\n}", "public function add_button() {\n\t\t\t$positions = apply_filters( 'yith_wcwl_positions', array(\n\t\t\t\t'after_add_to_cart' => array( 'hook' => 'woocommerce_single_product_summary', 'priority' => 31 ),\n\t\t\t\t'add-to-cart' => array( 'hook' => 'woocommerce_single_product_summary', 'priority' => 31 ),\n\t\t\t\t'thumbnails' => array( 'hook' => 'woocommerce_product_thumbnails', 'priority' => 21 ),\n\t\t\t\t'summary' => array( 'hook' => 'woocommerce_after_single_product_summary', 'priority' => 11 )\n\t\t\t) );\n\n\t\t\t// Add the link \"Add to wishlist\"\n\t\t\t$position = get_option( 'yith_wcwl_button_position', 'add-to-cart' );\n\n\t\t\tif ( $position != 'shortcode' && isset( $positions[ $position ] ) ) {\n\t\t\t\tadd_action( $positions[ $position ]['hook'], array( $this, 'print_button' ), $positions[ $position ]['priority'] );\n\t\t\t}\n\n\t\t\t// check if Add to wishlist button is enabled for loop\n\t\t\t$enabled_on_loop = 'yes' == get_option( 'yith_wcwl_show_on_loop', 'no' );\n\n\t\t\tif( ! $enabled_on_loop ){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$positions = apply_filters( 'yith_wcwl_loop_positions', array(\n\t\t\t\t'before_image' => array( 'hook' => 'woocommerce_before_shop_loop_item', 'priority' => 5 ),\n\t\t\t\t'before_add_to_cart' => array( 'hook' => 'woocommerce_after_shop_loop_item', 'priority' => 7 ),\n\t\t\t\t'after_add_to_cart' => array( 'hook' => 'woocommerce_after_shop_loop_item', 'priority' => 15 )\n\t\t\t) );\n\n\t\t\t// Add the link \"Add to wishlist\"\n\t\t\t$position = get_option( 'yith_wcwl_loop_position', 'after_add_to_cart' );\n\n\t\t\tif ( $position != 'shortcode' && isset( $positions[ $position ] ) ) {\n\t\t\t\tadd_action( $positions[ $position ]['hook'], array( $this, 'print_button' ), $positions[ $position ]['priority'] );\n\t\t\t}\n\t\t}", "function wp_oembed_add_discovery_links()\n {\n }", "function getjsOnDblClick() { return $this->readjsondblclick(); }", "function livepress_update_box() {\n\tstatic $called = 0;\n\tif($called++) return;\n\tif (LivePress_Updater::instance()->has_livepress_enabled()) {\n\t\techo '<div id=\"lp-update-box\"></div>';\n\t}\n}", "function _make_web_ftp_clickable_cb($matches)\n {\n }", "function wf_widget($destinationID=null) {\n\t\t\n\t\tif($destinationID === null) {\n\t\t\tprint('You need to provide the destination ID from <a href=\"http://wanderfly.com\">Wanderfly</a>.');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Connect to the OSCommerce database\n\t\t$apikey = get_option('wf_apikey');\n\t\t\n\t\treturn '<iframe srcolling=\"no\" frameborder=\"0\" border=\"0\" width=\"596\" height=\"130\" name=\"wf-widget-checkitout-'.$destinationID.'\" id=\"wf-widget-checkitout-'.$destinationID.'\" src=\"http://partners.wanderfly.com/widgets/checkitout?apiKey='.$apikey.'&destinationID='.$destinationID.'\" style=\"border:none; overflow:hidden; width:596px; height:130px;\" allowTransparency=\"true\"></iframe>';\n\t}", "public function additional_plugin_setup() {\n\n $page_main = $this->_admin_pages['swpm'];\n\n if (!get_option('swpm_dashboard_widget_options')) {\n $widget_options['swpm_dashboard_recent_entries'] = array(\n 'items' => 5,\n );\n update_option('swpm_dashboard_widget_options', $widget_options);\n }\n }", "function ywig_youtube_link_callback() {\n\techo '<p class=\"description\">Enter your Youtube url</p><input type=\"text\" name=\"youtube_link\" value=\"' . esc_url( get_option( 'youtube_link' ) ) . '\" placeholder=\"Youtube link\" />';\n}", "function um_messaging_button_in_directory( $user_id, $args ) {\r\n\tif ( isset( $args['show_pm_button'] ) && !$args['show_pm_button'] ) return;\r\n\tif ( $user_id == get_current_user_id() ) {\r\n\t\t$messages_link = add_query_arg( 'profiletab', 'messages', um_user_profile_url() );\r\n\t\techo '<a href=\"' . $messages_link . '\" class=\"um-message-abtn um-button\"><span>'. __('My messages','um-messaging'). '</span></a>';\r\n\t} else {\r\n\t\techo do_shortcode('[ultimatemember_message_button user_id='.$user_id.']');\r\n\t}\r\n}", "public function userClick($commentId,$uid){\n $comment = $this->field('id,thumbs,uid_likes')->where('id',$commentId)->find();\n if (empty($comment->data['uid_likes'])) {\n $data = [\n 'thumbs' => $comment->data['thumbs'] + 1,\n 'uid_likes' => $uid\n ];\n }else{\n $data = [\n 'thumbs' => $comment->data['thumbs'] + 1,\n 'uid_likes' => $comment->data['uid_likes'].','.$uid\n ];\n }\n $result = $this->where('id',$commentId)->update($data);\n return $result;\n }", "function add_twitterfield_legacy($args){ \r\n //debugbreak(); \r\n $options = $this->get_options();\r\n $inputclass = $options['input_class'] ? 'class=\"'.$options['input_class'].'\"' : ''; \r\n $inputfieldclass = $options['input_field_class'] ? 'class=\"'.$options['input_field_class'].'\"' : ''; \r\n $label = $options['input_label'];\r\n $l_html = '<label for=\"atf_twitter_id\">' . $label . '</label>';\r\n $i_html = '<input '.$inputfieldclass.' id=\"atf_twitter_id\" name=\"atf_twitter_id\" type=\"text\" size=\"30\" tabindex=\"4\" value=\"\"/>';\r\n if($options['input_label_position'] == 'before'){\r\n $html = $l_html.$i_html;\r\n } else {\r\n $html = $i_html.$l_html;\r\n }\r\n echo '<p '.$inputclass.'>'.$html.'</p>';\r\n }", "public function clickShareWishList()\n {\n $this->waitFormToLoad();\n $this->_rootElement->find($this->shareWishList)->click();\n }", "function basel_add_to_compare_single_btn() {\n\t\tglobal $product;\n\t\techo '<a class=\"basel-compare-btn button\" href=\"' . esc_url( basel_get_compare_page_url() ) . '\" data-added-text=\"' . esc_html__( 'Compare products', 'basel' ) . '\" data-id=\"' . esc_attr( $product->get_id() ) . '\">' . esc_html_x( 'Compare', 'add_button', 'basel' ) . '</a>';\n\t}", "function widget( $args, $instance ) {\r\n\textract( $args );\r\n\t\r\n\t$title = $instance['title'] ;\r\n\t$subtitle = $instance['subtitle'];\r\n\t$code = $instance['code'];\r\n\r\n\techo $before_widget;\r\n\techo '<div class=\"bnk-newsletter clickable\">';\r\n\techo '<span class=\"newsletter-icon mobile-hide\">&nbsp;</span>';\r\n\techo '<h3 class=\"replace inset\"><a href=\"'.$code.'\">' . $title . '</a></h3>\r\n\t\t <p class=\"subhead\">' . $subtitle . '</p></div> ';\r\n\techo $after_widget;\r\n\t}", "function copyright_headv1(){\r\n\r\nglobal $wpdb;\r\n\t$fivesdrafts = $wpdb->get_results(\"SELECT*FROM copyrightpro\");\r\n\r\n\tforeach ($fivesdrafts as $fivesdraft) {\r\n\t\t\t$result[0]=$fivesdraft->copy_click;\r\n\t\t\t$result[1]=$fivesdraft->copy_selection;\r\n\t}\r\n\t\r\nif ($result[0]==\"y\"){?>\r\n<script language=\"Javascript\">\r\n<!-- Begin\r\ndocument.oncontextmenu = function(){return false}\r\n// End -->\r\n</script>\r\n<?php }\r\n\r\nif ($result[1]==\"y\"){?>\r\n<script type=\"text/javascript\">\r\n// IE Evitar seleccion de texto\r\ndocument.onselectstart=function(){\r\nif (event.srcElement.type != \"text\" && event.srcElement.type != \"textarea\" && event.srcElement.type != \"password\")\r\nreturn false\r\nelse return true;\r\n};\r\n// FIREFOX Evitar seleccion de texto\r\nif (window.sidebar){\r\ndocument.onmousedown=function(e){\r\nvar obj=e.target;\r\nif (obj.tagName.toUpperCase() == \"INPUT\" || obj.tagName.toUpperCase() == \"TEXTAREA\" || obj.tagName.toUpperCase() == \"PASSWORD\")\r\nreturn true;\r\n/*else if (obj.tagName==\"BUTTON\"){\r\nreturn true;\r\n}*/\r\nelse\r\nreturn false;\r\n}\r\n}\r\n// End -->\r\n</script>\r\n\r\n<?php }\r\n\r\n}", "function newsdot_entry_footer() {\n\t\tif ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {\n\t\t\techo '<span class=\"comments-link\">';\n\t\t\tcomments_popup_link(\n\t\t\t\tsprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %s: post title */\n\t\t\t\t\t\t__( 'Leave a Comment<span class=\"screen-reader-text\"> on %s</span>', 'newsdot' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t\t'class' => array(),\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\twp_kses_post( get_the_title() )\n\t\t\t\t)\n\t\t\t);\n\t\t\techo '</span>';\n\t\t}\n\n\t\tedit_post_link(\n\t\t\tsprintf(\n\t\t\t\twp_kses(\n\t\t\t\t\t/* translators: %s: Name of current post. Only visible to screen readers */\n\t\t\t\t\t__( 'Edit <span class=\"screen-reader-text\">%s</span>', 'newsdot' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\twp_kses_post( get_the_title() )\n\t\t\t),\n\t\t\t'<span class=\"edit-link\">',\n\t\t\t'</span>'\n\t\t);\n\t}", "function msdlab_load_contributor_widget() {\n register_widget('MSDLab_Contributor_Widget');\n}", "public function handleClickEvent(object $message): void;", "function pb18_article_also_widget() {\n register_widget( 'pb18_article_also_widget' );\n}", "function deals_display_popup_single(){\n if(is_singular('daily-deals') AND deals_is_free()):\n ?>\n <!-- popup form -->\n <div style=\"display:none\">\n <div id=\"subscribe_deals\">\n <h2 class=\"modal-title\"><?php _e('Download Form', 'wpdeals'); ?></h2>\n <h3 class=\"modal-tagline\"><?php _e('Enter your email below, for the download link.', 'wpdeals'); ?></h3>\n\n <div class=\"subs-container clearfix\">\n <div class=\"modal-download\">\n <div class=\"modal-icon\">\n <span class=\"email\"><?php _e('Download here', 'wpdeals'); ?></span>\n </div>\n <h4><?php _e('Enter your email', 'wpdeals'); ?></h4>\n <h5><?php _e('Check your INBOX or SPAM folder.', 'wpdeals'); ?></h5> \n <?php deals_form_subscribe(array('idform' => 'free-deals', 'free' => true, 'text' => 'Give Me!')); ?>\n </div>\n </div>\n </div>\n </div>\n <?php\n endif;\n}", "function news_sidebar_widget() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'subscribe',\n\t\t'id' => 'subscribe',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\" role=\"complementary\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}" ]
[ "0.5988109", "0.57954943", "0.53715616", "0.5328268", "0.514386", "0.511955", "0.5111568", "0.51096606", "0.5026011", "0.4977786", "0.49536696", "0.4937576", "0.48609218", "0.48606524", "0.48589194", "0.4853008", "0.48527968", "0.48509562", "0.48396078", "0.4831752", "0.4819308", "0.4775076", "0.47307196", "0.4729696", "0.4706333", "0.47048473", "0.4686222", "0.4678833", "0.46566978", "0.46414167", "0.46414167", "0.46414167", "0.46414167", "0.46398637", "0.4631488", "0.46207857", "0.46111143", "0.46065038", "0.46000934", "0.4599361", "0.45955223", "0.45910716", "0.45904893", "0.45861006", "0.4566954", "0.45457065", "0.45457065", "0.45431662", "0.45426103", "0.45414373", "0.45343202", "0.4524505", "0.45200622", "0.45195103", "0.45104355", "0.45053864", "0.4505298", "0.4504483", "0.44991842", "0.4497126", "0.4494652", "0.4492773", "0.4487194", "0.44822145", "0.44676048", "0.44666708", "0.44628602", "0.44624388", "0.44622892", "0.44594702", "0.44578323", "0.4457652", "0.44548288", "0.44538385", "0.44536102", "0.44416398", "0.44414377", "0.44338265", "0.44286993", "0.44261256", "0.44232997", "0.44220608", "0.44199553", "0.44182712", "0.44177034", "0.44156408", "0.44138354", "0.4412912", "0.44021404", "0.44000357", "0.4399434", "0.43948054", "0.4393859", "0.43889248", "0.438307", "0.4373528", "0.43712258", "0.43642005", "0.43639767", "0.43555567", "0.4352474" ]
0.0
-1
/////////////////////////////////////////////////////////// END DOUBLECLICK FOR PUBLISHERS (DFP) /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// ADD COMSCORE TAG (FOOTER) ///////////////////////////////////////////////////////////
function add_comScore(){ ?> <!-- Begin comScore Inline Tag 1.1302.13 --> <script type="text/javascript" language="JavaScript1.3" src="http://b.scorecardresearch.com/c2/9734177/ct.js"></script> <!-- End comScore Inline Tag --> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hookFooter()\n\t{\n\t\t//Assign template variables\n\t\t$this->context->smarty->assign(\n\t\t\tarray(\n\t\t\t\t'clerk_public_key' => Configuration::get('CLERK_PUBLIC_KEY', ''),\n\t\t\t)\n\t\t);\n\n\t\treturn $this->display(__FILE__, 'visitor_tracking.tpl', $this->getCacheId(BlockCMSModel::FOOTER));\n\t}", "function print_sub_footer() {\r\n\techo '<div class=\"sub-footer\"><div class=\"wrap\"><p><a href=\"/about\">Learn more about Speak Agent <i class=\"fa fa-caret-right\"></i></a></p></div></div>';\r\n}", "function footer() {\n\n\techo '<p>Copyright Dynamic Sites LLC 2012</p>';\n\t\n}", "function extamus_change_admin_footer(){\n\t echo '<span id=\"footer-note\">Please dont hesitate to reach out to your friends at <a href=\"http://www.extamus.com/\" target=\"_blank\">Extamus Media</a> with any questions.</span>';\n\t}", "function iframe_footer()\n {\n }", "public function hookFooter(){\n $settings = unserialize( Configuration::get($this->name.'_settings') );\n \n $this->context->smarty->assign(array(\n 'user' => $settings['user'],\n 'widget_id' => $settings['widget_id'],\n 'tweets_limit' => $settings['tweets_limit'],\n 'follow_btn' => $settings['follow_btn']\n ));\n \n return $this->display(__FILE__, $this->name.'.tpl');\n }", "function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}", "function circle_footer_copyright() {\n\tcircle_site_copyright( '<div class=\"footer__copyright\">', '</div>' );\n}", "function cera_grimlock_footer() {\n\t\tdo_action( 'grimlock_prefooter', array(\n\t\t\t'callback' => 'cera_grimlock_prefooter_callback',\n\t\t) );\n\n\t\tdo_action( 'grimlock_footer', array(\n\t\t\t'callback' => 'cera_grimlock_footer_callback',\n\t\t) );\n\t}", "function base_admin_footer_bloom() {\n\t?>\n\t<span id=\"footer-thankyou\">\n\t\t<?php esc_html_e( 'Theme Development by', 'base' ); ?>\n\t\t<a href=\"https://bloomcu.com\"><?php esc_html_e( 'BloomCU', 'base' ); ?></a>.\n\t</span>\n\t<?php\n}", "function tr_custom_admin_footer() {\n\t_e('<span id=\"footer-thankyou\">Developed by <a href=\"http://third-law.com\" target=\"_blank\">Kenny Scott (Third Law Web Design)</a></span>. Built using Tabula Rasa.', 'tabula_rasa');\n}", "function sl_admin_footer() {\n\techo __('The Dashboard Tweaks plugin has been developed by Piet Bos of <a href=\"http://wpti.ps\">WP TIPS</a>. For any issues, please open a thread in the Wordpress plugin forum.', 'sl_dashtweaks');\n}", "function d4tw_filter_admin_footer () {\r\n echo '<span id=\"dashFooter\">Website developed by <a style = \"color: #ff0000; text-decoration: none;\" href=\"http://www.knockmedia.com\" target=\"_blank\">KnockMedia</a></span>';\r\n}", "function sloodle_print_footer()\r\n {\r\n global $CFG;\r\n echo \"<p style=\\\"text-align:center; margin-top:32px; font-size:90%;\\\"><a href=\\\"{$CFG->wwwroot}/course/view.php?id={$this->course->id}\\\">&lt;&lt;&lt; \".get_string('backtocoursepage','sloodle').\"</a></h2>\";\r\n sloodle_print_footer($this->course);\r\n }", "function kickstart_footer_social() {\n\tgenesis_widget_area( 'footer-social', array(\n\t\t'before' => '<section class=\"footer-social\"><div class=\"wrap\">',\n\t\t'after' => '</div></section>',\n\t) );\n}", "function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}", "function showFooter() \n {\n // AUSGABE\n echo \"<div class='newFahrt'><div class='footer'>\";\n echo \"<p>EventPlanner by Steven Schödel (c) Version 05.072019 | \";\n echo \"<a href='/flatnet2/informationen/impressum.php'>Impressum</a> | \";\n echo \"<a href='/index.php'>Login</a>\";\n echo \"</p>\";\n echo \"</div></div>\";\n }", "public function do_footer_items()\n {\n }", "public function do_footer_items()\n {\n }", "function inesdevhub_sidebar_footer_4()\n{\n $args = array(\n 'name' => __('Sidebar Dev Hub - Footer 4th column', 'inesdevhub'),\n 'id' => 'inesdevhub-sidebar-footer-4', // ID should be LOWERCASE ! ! !\n 'description' => __('INES Dev Hub sidebar for footer 4th column', 'inesdevhub'),\n 'class' => '',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"footer-widget-title text--white\">',\n 'after_title' => '</h4>',\n );\n\n register_sidebar($args);\n}", "function display_portal_footer()\r\n {\r\n Display :: footer();\r\n }", "public static function displayFooter() {\r\n ?>\r\n <br><br><br>\r\n <div id=\"push\"></div>\r\n </div>\r\n <div id=\"footer\"><br>&copy 2016 Power House. All Rights Reserved.</div>\r\n <script type=\"text/javascript\" src=\"<?= BASE_URL ?>/www/js/ajax_autosuggestion.js\"></script>\r\n </body>\r\n </html>\r\n <?php\r\n }", "function sloodle_print_footer()\n {\n sloodle_print_footer($this->course);\n }", "function footer() {\n }", "function cera_grimlock_footer_callback() {\n\t\t?>\n\t\t<div class=\"region__row\">\n\t\t\t<?php\n\t\t\t$sidebar_active = false;\n\t\t\tfor ( $i = 1; $i <= 4; $i++ ) :\n\t\t\t\tif ( is_active_sidebar( \"footer-{$i}\" ) ) :\n\t\t\t\t\t$sidebar_active = true; ?>\n\t\t\t\t\t<div class=\"<?php echo esc_attr( \"region__col region__col--{$i} widget-area\" ); ?>\">\n\t\t\t\t\t\t<?php dynamic_sidebar( \"footer-{$i}\" ); ?>\n\t\t\t\t\t</div><!-- .region__col -->\n\t\t\t\t\t<?php\n\t\t\t\tendif;\n\t\t\tendfor;\n\n\t\t\tif ( ! $sidebar_active ) : ?>\n\t\t\t\t<div class=\"site-info text-center w-100\" role=\"contentinfo\">\n\t\t\t\t\t<?php bloginfo( 'title' ); ?><span class=\"sep\"> | </span><?php bloginfo( 'description' ); ?>\n\t\t\t\t</div><!-- .site-info -->\n\t\t\t\t<?php\n\t\t\tendif; ?>\n\t\t</div><!-- .region__row -->\n\t\t<?php\n\t}", "function footer()\r\n{\r\n}", "function poco_handheld_footer_bar() {\n $links = array(\n 'shop' => array(\n 'priority' => 5,\n 'callback' => 'poco_handheld_footer_bar_shop_link',\n ),\n 'my-account' => array(\n 'priority' => 10,\n 'callback' => 'poco_handheld_footer_bar_account_link',\n ),\n 'search' => array(\n 'priority' => 20,\n 'callback' => 'poco_handheld_footer_bar_search',\n ),\n 'wishlist' => array(\n 'priority' => 30,\n 'callback' => 'poco_handheld_footer_bar_wishlist',\n ),\n 'cart' => array(\n 'priority' => 35,\n 'callback' => 'poco_handheld_footer_bar_cart',\n ),\n );\n\n if (wc_get_page_id('myaccount') === -1) {\n unset($links['my-account']);\n }\n\n if (!function_exists('yith_wcwl_count_all_products')) {\n unset($links['wishlist']);\n }\n\n if(!poco_is_elementor_activated()) {\n unset($links['cart']);\n }\n\n $links = apply_filters('poco_handheld_footer_bar_links', $links);\n ?>\n <div class=\"poco-handheld-footer-bar\">\n <ul class=\"columns-<?php echo count($links); ?>\">\n <?php foreach ($links as $key => $link) : ?>\n <li class=\"<?php echo esc_attr($key); ?>\">\n <?php\n if ($link['callback']) {\n call_user_func($link['callback'], $key, $link);\n }\n ?>\n </li>\n <?php endforeach; ?>\n </ul>\n </div>\n <?php\n }", "function inesdevhub_sidebar_footer_3()\n{\n $args = array(\n 'name' => __('Sidebar Dev Hub - Footer 3rd column', 'inesdevhub'),\n 'id' => 'inesdevhub-sidebar-footer-3', // ID should be LOWERCASE ! ! !\n 'description' => __('INES Dev Hub sidebar for footer 3rd column', 'inesdevhub'),\n 'class' => '',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"footer-widget-title text--white\">',\n 'after_title' => '</h4>',\n );\n\n register_sidebar($args);\n}", "function admin_footer () {\n\techo '<a href=\"http://www.drumcreative.com\" target=\"_blank\">&copy;' . date('Y') . ' Drum Creative</a>';\n}", "function bethel_do_footer_bottom() {\n\tgenesis_widget_area ('footer-bottom', array ('before' => '<div id=\"bethel-header-right-bottom\">', 'after' => '</div>'));\n}", "function change_footer_admin () { echo '<span id=\"footer-thankyou\">Developed by IT ADR</span>'; }", "protected function generatePageFooter() \r\n {\r\n echo <<<HTML\r\n </article>\r\n <script src=\"CityWok.js\"> </script>\r\n </body>\r\n</html>\r\nHTML;\r\n }", "function admin_footer()\n {\n }", "function admin_footer()\n {\n }", "function admin_footer()\n {\n }", "function admin_footer()\n {\n }", "function admin_footer()\n {\n }", "function circle_footer_social() {\n\tget_template_part( 'template-parts/footer-social' );\n}", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}", "function inesdevhub_sidebar_footer_2()\n{\n $args = array(\n 'name' => __('Sidebar Dev Hub - Footer 2nd column', 'inesdevhub'),\n 'id' => 'inesdevhub-sidebar-footer-2', // ID should be LOWERCASE ! ! !\n 'description' => __('INES Dev Hub sidebar for footer 2nd column', 'inesdevhub'),\n 'class' => '',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"footer-widget-title text--white\">',\n 'after_title' => '</h4>',\n );\n\n register_sidebar($args);\n}", "abstract protected function footer();", "abstract protected function footer();", "function core_update_footer($msg = '')\n {\n }", "public static function onRefreshedFooter( &$footerExtra ) {\n\t\tglobal $wgAdConfig;\n\t\tif (\n\t\t\tisset( $wgAdConfig['refreshed']['leaderboard-footer'] ) &&\n\t\t\t$wgAdConfig['refreshed']['leaderboard-footer']\n\t\t) {\n\t\t\t$adHTML = self::loadAd( 'leaderboard' );\n\t\t\t$footerExtra = str_replace(\n\t\t\t\t// <s>Quick HTML validation fix</s>\n\t\t\t\t// Just a simple renaming because Refreshed expects the ID to be #advert :|\n\t\t\t\t'<div id=\"refreshed-leaderboard-ad\" class=\"refreshed-ad noprint\">',\n\t\t\t\t'<div id=\"advert\" class=\"refreshed-ad noprint\">' .\n\t\t\t\t\t// Also inject the title here, as per the MW.org manual page\n\t\t\t\t\twfMessage( 'refreshed-advert' )->parseAsBlock(),\n\t\t\t\t$adHTML\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}", "static function change_admin_footer_text() {\n\t\t$plugin_name = WPLA_LIGHT ? 'WP-Lister for Amazon' : 'WP-Lister Pro for Amazon'; \n\t echo '<span id=\"footer-thankyou\">';\n\t echo sprintf( __( 'Thank you for listing with %s', 'wp-lister-for-amazon' ), '<a href=\"https://www.wplab.com/plugins/wp-lister/\" target=\"_blank\">'.$plugin_name.'</a>' );\n\t echo '</span>';\n\t}", "function cdn_do_footer() {\n\t$args = array(\n\t\t'theme_location' => 'footer',\n\t\t'menu_class' => 'menu menu-footer'\n\t);\n\t$nav_menu = genesis_get_nav_menu( $args );\n\t$copyright = genesis_footer_copyright_shortcode( array( 'first' => '2011' ) );\n\n\techo '<div class=\"wrap\">';\n\techo '<p class=\"footer-text\">';\n\techo $copyright . ' &middot; made with <i class=\"icon icon-heart\"></i> by <a href=\"http://codingismycardio.com\">coding is my cardio</a>';\n\techo '</p>';\n\techo $nav_menu;\n\techo '<a href=\"#\" class=\"to-top\">Back to top</a>';\n\techo '</div>';\n}", "function codepress_footer_js()\n {\n }", "function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}", "function circle_menu_copyright() {\n\tcircle_primarymenu_copyright( '<div class=\"footer__copyright\">', '</div>' );\n}", "function printSampleHtmlFooter()\n{\n print '<a href=\"index.php\">Go back to samples list</a>';\n printHtmlFooter();\n}", "function wp_footer() {\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "public function trueFooter()\n {\n ?>\n <style>\n #wpfooter a {\n outline: none !important; text-decoration: none !important;\n } \n .wp-footer-true-link {\n position: relative;\n display: block; color: #aeaeae;\n -webkit-transition: color 0.22s ease;\n -o-transition: color 0.22s ease;\n transition: color 0.22s ease;\n }\n .wp-footer-true-link:before {\n content: '';\n position: absolute;\n bottom: 0; margin-left: 50%;\n width: 0%; height: 1px;\n background-color: #333;\n -webkit-transition: width 0.28s cubic-bezier(0.63, 0.62, 0.48, 1.3),\n margin-left 0.28s cubic-bezier(0.63, 0.62, 0.48, 1.3);\n -o-transition: width 0.28s cubic-bezier(0.63, 0.62, 0.48, 1.3),\n margin-left 0.28s cubic-bezier(0.63, 0.62, 0.48, 1.3);\n transition: width 0.28s cubic-bezier(0.63, 0.62, 0.48, 1.3),\n margin-left 0.28s cubic-bezier(0.63, 0.62, 0.48, 1.3);\n }\n .wp-footer-true-link > img {\n width: 45px; height: auto; position: relative; top: 2px;\n opacity: 0.7;\n -webkit-transition: opacity 0.22s ease;\n -o-transition: opacity 0.22s ease;\n transition: opacity 0.22s ease;\n }\n .wp-footer-true-link:hover {\n color: #333;\n }\n .wp-footer-true-link:hover:before {\n width: 100%; margin-left: 0%;\n }\n .wp-footer-true-link:hover > img {\n opacity: 1;\n }\n .acf-field.acf-field-image.acf-banner-image .acf-image-uploader .hide-if-value {\n margin-top: 50px;\n }\n .acf-field.acf-field-image.acf-banner-image .acf-image-uploader.has-value {\n min-height: 100px;\n }\n .acf-field.acf-field-image.acf-banner-image .view.show-if-value {\n position: absolute;\n z-index: 100;\n height: auto;\n max-height: 100px;\n overflow: hidden;\n -webkit-box-shadow: 1px 3px 12px transparent;\n box-shadow: 1px 3px 12px transparent;\n -webkit-transition: height .32s ease, max-height .32s ease, box-shadow .32s ease;\n -o-transition: height .32s ease, max-height .32s ease, box-shadow .32s ease;\n transition: height .32s ease, max-height .32s ease, box-shadow .32s ease\n }\n .acf-field.acf-field-image.acf-banner-image .view.show-if-value img {\n -webkit-transform: translate(0, -30px);\n -ms-transform: translate(0, -30px);\n -o-transform: translate(0, -30px);\n transform: translate(0, -30px);\n -webkit-transition: transform .32s ease;\n -o-transition: transform .32s ease;\n transition: transform .32s ease\n }\n .acf-field.acf-field-image.acf-banner-image .view.show-if-value:after {\n content: '';\n position: absolute;\n height: 20px;\n width: 100%;\n bottom: 0;\n left: 0;\n background-image: -webkit-linear-gradient(top, transparent 0, rgba(0, 0, 0, .25) 100%);\n background-image: -o-linear-gradient(top, transparent 0, rgba(0, 0, 0, .25) 100%);\n background-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, .25) 100%);\n background-repeat: repeat-x;\n opacity: 1;\n filter: alpha(opacity=100);\n -webkit-transition: opacity .01s linear .32s;\n -o-transition: opacity .01s linear .32s;\n transition: opacity .01s linear .32s\n }\n .acf-field.acf-field-image.acf-banner-image .view.show-if-value:hover {\n max-height: 470px;\n -webkit-box-shadow: 1px 3px 12px rgba(0, 0, 0, .45);\n box-shadow: 1px 3px 12px rgba(0, 0, 0, .45)\n }\n .acf-field.acf-field-image.acf-banner-image .view.show-if-value:hover img {\n -webkit-transform: translate(0, 0);\n -ms-transform: translate(0, 0);\n -o-transform: translate(0, 0);\n transform: translate(0, 0)\n }\n .acf-field.acf-field-image.acf-banner-image .view.show-if-value:hover:after {\n opacity: 0;\n filter: alpha(opacity=0);\n -webkit-transition: opacity .01s;\n -o-transition: opacity .01s;\n transition: opacity .01s\n }\n </style>\n <a href=\"http://www.trueagency.com.au\" target=\"_blank\" class=\"wp-footer-true-link\">\n <img src=\"<?= \\TrueLib::getImageURL('common/true-footer-logo.png') ?>\" alt=\"Digital Agency Melbourne\">\n </a>\n <?php\n }", "function mantis_publisher_footer()\n{\n\t$site = get_option('mantis_site_id');\n\n\tif (!$site) {\n\t\treturn;\n\t}\n\n\trequire(dirname(__FILE__) . '/html/publisher/config.php');\n\n\trequire(dirname(__FILE__) . '/html/publisher/styling.php');\n\n\tif (get_option('mantis_async')) {\n\t\trequire(dirname(__FILE__) . '/html/publisher/async.html');\n\t} else {\n\t\trequire(dirname(__FILE__) . '/html/publisher/sync.html');\n\t}\n}", "function edit_footer_text_admin () {\n echo '<span id=\"footer-thankyou\">Contact Database by <a href=\"https://www.supint.com/\" target=\"_blank\">Superlative</a></span>\n\t\t <p id=\"footer-upgrade\"></p>';\n}", "function mantis_advertiser_footer()\n{\n $advertiser = get_option('mantis_advertiser_id');\n\n if (!$advertiser) {\n return;\n }\n\n require(dirname(__FILE__) . '/html/advertiser/config.php');\n\n require(dirname(__FILE__) . '/html/advertiser/async.html');\n}", "function inesdevhub_sidebar_footer_1()\n{\n $args = array(\n 'name' => __('Sidebar Dev Hub - Footer 1st column', 'inesdevhub'),\n 'id' => 'inesdevhub-sidebar-footer-1', // ID should be LOWERCASE ! ! !\n 'description' => __('INES Dev Hub sidebar for footer 1st column', 'inesdevhub'),\n 'class' => '',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"footer-widget-title text--white\">',\n 'after_title' => '</h4>',\n );\n\n register_sidebar($args);\n}", "function add_admin_footer() {\n\t echo '<span id=\"footer-thankyou\">Wordpress Theme by <a href=\"http://url.com\">Name Here</a>.</span>';\n\t}", "function get_admin_footer() {\r\n\tglobal $bj; ?>\r\n\t\t\t</div>\r\n<?php run_actions('admin_footer'); ?>\r\n\t\t\t<hr />\r\n\t\t\t<div id=\"footer\">\r\n\t\t\t\t<p><?php printf(_r('Blackjack %1$s'),$bj->vars->version); ?></p>\n\t\t\t\t<p><?php printf(_r('%1$s Queries'),$bj->db->querycount()); ?></p>\r\n\t\t\t</div>\n\t\t</div>\r\n\t</body>\r\n</html>\r\n<?php\r\n}", "function output_footer() {\n?>\n\t\t<!-- Main footer section -->\n\t\t<footer>\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t\t\t<ul id=\"footer-copyright-terms-privacy\" class=\"list-inline\">\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<p>&copy; CrowdShot <?php echo date('Y'); ?></p>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<p><a href=\"terms-of-service.php\">Terms of service</a></p>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<p><a href=\"privacy-policy.php\">Privacy policy</a></p>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"col-sm-3\">\n\t\t\t\t\t\t<ul class=\"share-icon-list list-inline pull-right\">\n\t\t\t\t\t\t\t<li>Share</li>\n\t\t\t\t\t\t\t<li class=\"share-icon\"><a href=\"http://facebook.com/\" target=\"crowdshotfacebook\"><i class=\"fa fa-facebook-square\"></i></a></li>\n\t\t\t\t\t\t\t<li class=\"share-icon\"><a href=\"http://twitter.com/\" target=\"crowdshottwitter\"><i class=\"fa fa-twitter-square\"></i></a></li>\n\t\t\t\t\t\t\t<li class=\"share-icon\"><a href=\"mailto:\"><i class=\"fa fa-envelope\"></i></a></li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<div class=\"clearfix\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- .container -->\n\t\t</footer>\n\t</body>\n</html>\n<?php\n}", "function wpfolio_admin_footer() {\n\techo 'Thank you for creating with <a href=\"http://wordpress.org/\" target=\"_blank\">WordPress</a>. | <a href=\"http://codex.wordpress.org/\" target=\"_blank\">Documentation</a> | <a href=\"http://wordpress.org/support/forum/4\" target=\"_blank\">Feedback</a> | <a href=\"http://wpfolio.visitsteve.com/\">Theme by WPFolio</a>';\n}", "public function get_footer()\n {\n return <<<EOD\n<div id=\"siteftr\">\n Sitewide Footer\n</div>\n\nEOD;\n }", "function Footer()\r\n {\r\n }", "public function admin_footer() {\n\t\t\t$link_button_args = array(\n\t\t\t\t'hash'\t=>\t'buy-toolset'\n\t\t\t);\n\t\t\t$link_learn =\t$this->get_affiliate_promotional_link( 'http://wp-types.com/' );\n\t\t\t$link_button =\t$this->get_affiliate_promotional_link( 'http://wp-types.com/', $link_button_args );\n\n ob_start();\n ?>\n\n <div class=\"ddl-dialogs-container\">\n <div id=\"js-buy-toolset-embedded-message-wrap\"></div>\n </div>\n <script type=\"text/html\" id=\"js-buy-toolset-embedded-message\">\n <div class=\"toolset-modal\">\n <h2><?php _e('Want to edit Views, CRED forms and Layouts? Get the full <em>Toolset</em> package!', 'wpcf'); ?></h2>\n\n <div class=\"content\">\n <p class=\"full\"><?php _e('The full <em>Toolset</em> package allows you to develop and customize themes without touching PHP. You will be able to:', 'wpcf'); ?></p>\n\n <div class=\"icons\">\n <ul>\n <li class=\"template\"><?php _e('Create templates', 'wpcf'); ?></li>\n <li class=\"layout\"><?php _e('Design page layouts using drag-and-drop', 'wpcf'); ?></li>\n <li class=\"toolset-search\"><?php _e('Build parametric searches', 'wpcf'); ?></li>\n </ul>\n <ul>\n <li class=\"list\"><?php _e('Display lists of content', 'wpcf'); ?></li>\n <li class=\"form\"><?php _e('Create front-end content editing forms', 'wpcf'); ?></li>\n <li class=\"more\"><?php _e('and more…', 'wpcf'); ?></li>\n </ul>\n </div>\n\n <p class=\"description\"><?php _e('Once you buy the full Toolset, you will be able to edit Views, CRED forms and Layouts in your site, as well as build new ones.', 'wpcf'); ?></p>\n\n <a href=\"<?php echo $link_button; ?>\"\n class=\"button\"><?php _e('<em>Toolset</em> Package Options', 'wpcf'); ?></a>\n <a href=\"<?php echo $link_learn; ?>\"\n class=\"learn\"><?php _e('Learn more about <em>Toolset</em>', 'wpcf'); ?></a>\n\n </div>\n <span class=\"icon-toolset-logo\"></span>\n <span class=\"js-close-promotional-message\"></span>\n </div>\n </script>\n <?php\n echo ob_get_clean();\n }", "function Footer()\n\t\t{\n\t\t}", "public function executeFooterPanel()\n {\n }", "protected function footer()\n {\n\n }", "function opinionstage_settings_load_footer(){\n}", "function flawless_footer_copyright() {\r\n global $flawless;\r\n echo do_shortcode( nl2br( $flawless[ 'footer' ][ 'copyright' ] ) );\r\n }", "function esh_load_footer_widget() {\n\tregister_widget( 'esh_footer_widget' );\n}", "function gutenberg_block_footer_area() {\n\tgutenberg_block_template_part( 'footer' );\n}", "public function template_footer() {\n\t\tget_footer( 'course' );\n\t}", "private function printFooter()\n {\n // Nothing to do at the moment\n }", "function genesisawesome_fullwidth_footer() {\n\n\t?>\n\t</div> <!-- end .wrap -->\n\t<div class=\"ga-footer-fullwidth\">\n\t<?php\n\n}", "function newsdot_entry_footer() {\n\t\tif ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {\n\t\t\techo '<span class=\"comments-link\">';\n\t\t\tcomments_popup_link(\n\t\t\t\tsprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %s: post title */\n\t\t\t\t\t\t__( 'Leave a Comment<span class=\"screen-reader-text\"> on %s</span>', 'newsdot' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t\t'class' => array(),\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\twp_kses_post( get_the_title() )\n\t\t\t\t)\n\t\t\t);\n\t\t\techo '</span>';\n\t\t}\n\n\t\tedit_post_link(\n\t\t\tsprintf(\n\t\t\t\twp_kses(\n\t\t\t\t\t/* translators: %s: Name of current post. Only visible to screen readers */\n\t\t\t\t\t__( 'Edit <span class=\"screen-reader-text\">%s</span>', 'newsdot' ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t'class' => array(),\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\twp_kses_post( get_the_title() )\n\t\t\t),\n\t\t\t'<span class=\"edit-link\">',\n\t\t\t'</span>'\n\t\t);\n\t}", "function adminFooter()\n {\n return \"\";\n }", "public function after_main_content() {\n\t?>\n\n\t\t\t</div><!-- #bbp-content -->\n\t\t</div><!-- #bbp-container -->\n\n\t<?php\n\t}", "function spartan_custom_admin_footer() {\n\n\t// VARIABLES\n\n\t$get_host = gethostname();\n\t$iq ='server1.iquariusmedia.com' || 'server2.iquariusmedia.com';\n\t$spartan = 'xenon.websitewelcome.com';\n\n\n\tif ( $get_host == $spartan ) {\n\n\t\t$developer = 'Renzo Johnson';\n\t\t$developer_url = 'http://renzojohnson.com';\n\n\t} else {\n\n\t\t$developer = 'iQuarius Media';\n\t\t$developer_url = 'http://iquariusmedia.com';\n\n\t}\n\n\t$client = get_option('blogname');\n\t$client_url = home_url();\n\n\n\n\t$spartan_admin_footer = 'Developed for ';\n\t$spartan_admin_footer .= '<a href=\"'. $client_url .'\">';\n\t$spartan_admin_footer .= $client;\n\t$spartan_admin_footer .= '</a>. Made Awesome by ';\n\t$spartan_admin_footer .= '<a href=\"' . $developer_url. '\" target=\"_blank\">'. $developer .'</a>.';\n\n\techo $spartan_admin_footer;\n\n}", "function emc_single_footer_meta() {\r\n\r\n\tif ( ! class_exists( 'Acf', false ) ) return false;\r\n\r\n\t$source = ( get_field( 'source' ) ) ? get_field( 'source' ) : __( 'Not specified', 'emc' );\r\n\t$copyright = ( get_field( 'copyright' ) ) ? get_field( 'copyright' ) : __( '&copy; Erikson Insitute', 'emc' );\r\n\t$content_id = ( get_field( 'id' ) ) ? get_field( 'id' ) : __( 'Not specified', 'emc' );\r\n\r\n\t$html = sprintf( __( 'Source: %1$s &bull; Copyright: %2$s &bull; Content ID: %3$s', 'emc' ),\r\n\t\tesc_html( $source ),\r\n\t\tesc_html( $copyright ),\r\n\t\tesc_html( $content_id )\r\n\t);\r\n\r\n\techo $html;\r\n\r\n}", "function Footer(){\n\t}", "function footer() {\n\t?>\n\t\t\t\t<div class=\"headfoot\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t&quot;Remember The Cow is nice, but it's a total copy of another site.&quot; - PCWorld<br />\n\t\t\t\t\t\tAll pages and content &copy; Copyright CowPie Inc.\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<div id=\"w3c\">\n\t\t\t\t\t\t<a href=\"https://webster.cs.washington.edu/validate-html.php\">\n\t\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/w3c-html.png\" alt=\"Valid HTML\" /></a>\n\t\t\t\t\t\t<a href=\"https://webster.cs.washington.edu/validate-css.php\">\n\t\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/w3c-css.png\" alt=\"Valid CSS\" /></a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</body>\n\t\t</html>\n\t<?php\n\t}", "function Wfc_Developer_Footer( $text ){\n global $wp_version, $wfc_version;\n $wfc_versions = \"WP ver: \".$wp_version.\" | WFC ver: \".$wfc_version;\n $text = '<span id=\"footer-thankyou\" class=\"wfc-admin-footer\">WFC Developer. '.$wfc_versions.'</span>';\n return $text;\n }", "public function print_footer_scripts()\n {\n }", "function printFooter($args_raw = array()) {\n\t\tglobal $Config;\n\t\t\n\t\t$args = array_map('print_html', $args_raw);\n?>\n\n</div>\n</div>\n\n<div id=\"footer\">\n\t<a href=\"<?php echo $Config['URLPath'] ?>/legal.php\">View legal disclaimer</a><br />\n\t&copy; 2006 Jain Foundation Inc. All Rights Reserved\n</div>\n\n</div>\n</body>\n</html>\n<?php\n\t}", "function footer() \n{\n\techo <<<END\n\t<div class=\"footer\">\n\tDeveloped by Jason Soo and Jordan Wilberding under the direction of Drs. Gideon Frieder and Ophir Frieder. <br>\n\tCourtesy of the IIT IR Laboratory. E-Mail problems to <a class=\"footer\" href=\"mailto:[email protected]\">[email protected]</a>\n\t</div>\nEND;\n}", "public function apb_email_footer() {\r\n\t\tinclude AWE_function::template_exsits( 'emails/apb-email-footer' );\r\n\t}", "function display_results_end(){\r\n?>\r\n\t\t\t</section>\r\n<!-- \t\t\t\t<footer id=\"foot\" class=\"containers\">\r\n\t\t\t\t\t<label>Copyright@RClouds Technologies Pvt. Ltd. </label>\r\n\t\t\t\t</footer> -->\t\r\n\t\t\t</body>\r\n\t\t</html>\r\n<?php\r\n\t}", "function theme_hbmode_process_footer($app, &$vars) {\n}", "function auxin_footer_copyright_markup( $echo = false ){\n global $post;\n\n $output = '';\n $copyright_text = ! empty( $post->ID ) ? auxin_get_post_meta( $post, 'page_footer_copyright', '') : '';\n $copyright_text = empty( $copyright_text ) ? auxin_get_option( 'copyright' ): $copyright_text ;\n\n if( $copyright_text ) {\n $date_format = 'Y'; // to pass theme check plugin\n $copyright_text = str_replace( array( '{{Y}}', '{{sitename}}' ), array( date_i18n( $date_format ), get_bloginfo( 'name' ) ), $copyright_text );\n $output .= '<small>' . do_shortcode( stripslashes( $copyright_text ) ) . '</small>';\n }\n\n $attribution = auxin_get_post_meta( $post, 'page_footer_attribution', 'default') ;\n $attribution = 'default' === $attribution ? auxin_get_option( 'attribution', false ) : $attribution;\n\n if ( auxin_is_true( $attribution ) ) {\n $output .= sprintf( '<small class=\"aux-attribution\"> %1$s <a href=\"https://wordpress.org/themes/phlox/\" title=\"%2$s\"> %3$s </a></small>',\n __( 'Powered by', 'phlox' ),\n __( 'Phlox Free WordPress Theme', 'phlox' ),\n __( 'Phlox Theme', 'phlox' )\n );\n }\n\n // Prints the policy markup in site footer\n if( auxin_get_option( 'footer_privacy_policy_link_display', 0 ) ){\n if ( function_exists( 'the_privacy_policy_link' ) ) {\n $output .= get_the_privacy_policy_link( '<small class=\"aux-privacy-policy\">', '</small>' );\n } else {\n $output .= sprintf( '<small class=\"aux-privacy-policy\">%s</small>', __( 'WordPress version 4.9.6 or higher is required for this feature.', 'phlox') );\n }\n }\n\n if( $echo ){\n echo $output;\n } else {\n return $output;\n }\n}", "function audiotheme_after_main_content() {\n\techo '</div>';\n}", "function my_footer_shh() {\n remove_filter( 'update_footer', 'core_update_footer' );\n}", "function wpstocks_action_javascript_footer()\n{\n}", "function Footer()\n {\n $this->SetY(-15);\n //Select Arial Italic 8\n $this->SetFont('Arial','I',8);\n $this->SetX(86,5);\n $this->Write(5, '[ powered by '.$this->web_str.']',$this->web_str);\n //Print centered page number\n $this->Cell(0,10,$this->page_str.' '.$this->PageNo(),0,0);\n }", "public static function customFooter()\n\t{\n\t\treturn '';\n\t\treturn 'Default custom server message / google analytics code.';\n\t}", "function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}", "function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}", "function replace_footer_admin ()\n{\n\techo '<span id=\"footer-thankyou\">Developpé par <a href=\"http://gilleshoarau.com\" target=\"_blank\">Gilles Hoarau</a></span>';\n}", "function displayFooter()\n\t{\n\t\t// footer (not really)\n\t\tif ($this->cmd != \"logout\")\n\t\t{\n\t\t\tif ($this->setup->ini_ilias_exists and $this->display_mode == \"setup\" and $this->setup->getClient()->getId() != \"\")\n\t\t\t{\n\t\t\t\t$this->tpl->setVariable(\"TXT_ACCESS_MODE\",\"(\".$this->lng->txt(\"client_id\").\": \".$this->setup->getClient()->getId().\")\");\n\t\t\t}\n\t\t\telseif ($this->setup->isAdmin())\n\t\t\t{\n\t\t\t\t$this->tpl->setVariable(\"TXT_ACCESS_MODE\",\"(\".$this->lng->txt(\"root_access\").\")\");\n\t\t\t}\n\n\t\t\t$this->displayNavButtons();\n\t\t}\n\n\t\t$this->tpl->show();\n\t}", "function Footer() {\r\n // footer line\r\n $this->SetFooterFont();\r\n $this->SetFillColor(0, 0, 0);\r\n $this->Rect(10, $this->PageBreakTrigger + 2, 190, 0.2, \"F\");\r\n $this->Rect(10, $this->PageBreakTrigger + 2.5, 190, 0.2, \"F\");\r\n $this->SetY($this->PageBreakTrigger + 5);\r\n\r\n $this->Cell(0, 0, \"Used by permission, CCLI #2752477\", 0, 1, \"L\");\r\n $this->Cell(0, 0, \"The Ridge Community Church\", 0, 1, \"R\");\r\n }", "function pt_document_close() {\nwp_footer();\n\necho \"\\n\\n\".'</body>'.\"\\n\";\necho '</html>';\n\n}", "public function tmpl_in_footer() {\n\t\t\t?>\n\t\t\t<script type=\"text/html\" id=\"tmpl-list-voters\">\n\t\t\t\t<div class=\"voter-item\">\n\t\t\t\t\t<div class=\"wce-voter-name\">{{ data.voter_name }}</div>\n\t\t\t\t\t<div class=\"wce-vote-type\">\n\t\t\t\t\t<# if ( 'up' === data.vote_type ) { #>\n\t\t\t\t\t\t<i class=\"fa fa-thumbs-up wce-voter-up\" aria-hidden=\"true\"></i>\n\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t<i class=\"fa fa-thumbs-down wce-voter-down\" aria-hidden=\"true\"></i>\n\t\t\t\t\t<# } #>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</script>\n\t\t\t<?php\n\t\t}" ]
[ "0.68403965", "0.66903025", "0.6631232", "0.65849835", "0.6548302", "0.6507044", "0.6501025", "0.6484594", "0.6468775", "0.64656407", "0.6443127", "0.6437092", "0.6432444", "0.6427218", "0.64028174", "0.6400998", "0.63973194", "0.6375746", "0.6375746", "0.6361869", "0.63589483", "0.63539237", "0.63271385", "0.63267237", "0.6325125", "0.63124907", "0.6308789", "0.63074017", "0.6300438", "0.62821835", "0.6280895", "0.62666154", "0.62398934", "0.62398934", "0.62398934", "0.62398934", "0.62398934", "0.6236322", "0.623147", "0.623147", "0.6230992", "0.6229588", "0.6229588", "0.62294644", "0.6211038", "0.62101257", "0.6207174", "0.6201502", "0.6187807", "0.61869204", "0.6185676", "0.61802024", "0.61781406", "0.6173783", "0.6167878", "0.6159627", "0.61588264", "0.6142479", "0.612573", "0.6123027", "0.61059004", "0.61022156", "0.60940146", "0.60929745", "0.6090282", "0.60861826", "0.607964", "0.6078998", "0.60770637", "0.60760796", "0.60689944", "0.6053194", "0.6052785", "0.6052181", "0.6044416", "0.60405207", "0.6039323", "0.6037995", "0.6023377", "0.60211587", "0.6019742", "0.60191494", "0.601777", "0.60072356", "0.6001917", "0.5996014", "0.5994373", "0.5993753", "0.5988141", "0.59837407", "0.59751606", "0.59674567", "0.5964416", "0.59588444", "0.59526396", "0.59523827", "0.5941319", "0.59394765", "0.59358716", "0.59328514", "0.5930877" ]
0.0
-1
/////////////////////////////////////////////////////////// END COMSCORE TAG /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// ADD GOOGLE ANALYTICS (FOOTER) ///////////////////////////////////////////////////////////
function add_GoogleAnalyticsTag(){ ?> <!-- Begin Google Analytics Tag --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-36293587-1', 'auto'); ga('send', 'pageview'); </script> <!-- End Google Analytics Tag --> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function Add_Google_Analytics() {\n\t\tif (isset(self::$GOOGLE_ANALYTICS_ID) && !empty(self::$GOOGLE_ANALYTICS_ID)) {\n\t\t?>\n<script async src=\"https://www.googletagmanager.com/gtag/js?id=<?= self::$GOOGLE_ANALYTICS_ID; ?>\"></script>\n<script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '<?= self::$GOOGLE_ANALYTICS_ID; ?>');</script>\n<?\n \t}\n\t}", "public static function customFooter()\n\t{\n\t\treturn '';\n\t\treturn 'Default custom server message / google analytics code.';\n\t}", "function display_analyzer_footer() {\n $mysql_version = mysql_get_server_info();\n $php_os = PHP_OS;\n $p_blog_version = P_BLOG_VERSION;\n $analyzer_footer =<<<EOD\n\n</div>\n<!-- Begin #footer -->\n<div id=\"footer\">\n<address>\nPowered by {$_SERVER['SERVER_SOFTWARE']} &amp; MySQL-{$mysql_version} running on {$php_os}<br />\nPowered by P_BLOG ver.{$p_blog_version}\n</address>\n</div><!-- End #footer -->\n</div><!-- End #wrapper -->\n</body>\n</html>\nEOD;\n return $analyzer_footer;\n}", "function blogolytics_google_tracking() {\n\t?>\n\t<!-- Google Analytics by Blogolytics -->\n\t<script type=\"text/javascript\">\n\t\twindow.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n\t\tga('create', '<?php echo blogolytics_get_option( 'connection', 'tracking_code'); ?>', 'auto');\n\t\tga('send', 'pageview');\n\t</script>\n\t<script async src='https://www.google-analytics.com/analytics.js'></script>\n\t<!-- End Google Analytics by Blogolytics -->\n\t<?php\n}", "protected function generatePageFooter() \r\n {\r\n echo <<<HTML\r\n </article>\r\n <script src=\"CityWok.js\"> </script>\r\n </body>\r\n</html>\r\nHTML;\r\n }", "function build_footer($loadchartapi = false)\n{\n\tinclude(\"footer.php\");\n}", "function add_blog_google_analytics(){\n global $shortname;\n\n $GAID = get_option($shortname . '_gaID');\n if($GAID and $GAID != ''):\n echo <<<HTML\n<script type=\"text/javascript\">\n\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '$GAID']);\n _gaq.push(['_trackPageview']);\n \n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n\n</script>\nHTML;\n endif;\n}", "function generer_google_analytics(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\t/* GOOGLE ANALYTICS */\n\tif ($config['analytics']['id']){\n\t\t// Nouvelle balise : http://www.google.com/support/analytics/bin/answer.py?hl=fr_FR&answer=174090&utm_id=ad\n\t\t$flux .= \"<script type=\\\"text/javascript\\\">\n\tvar _gaq = _gaq || [];\n\t_gaq.push(['_setAccount', '\" . $config['analytics']['id'] . \"']);\n\t_gaq.push(['_trackPageview']);\n\t(function() {\n\t\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\t\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\t\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n\t})();\n</script>\n\";\n\t}\n\n\treturn $flux;\n}", "function mantis_advertiser_footer()\n{\n $advertiser = get_option('mantis_advertiser_id');\n\n if (!$advertiser) {\n return;\n }\n\n require(dirname(__FILE__) . '/html/advertiser/config.php');\n\n require(dirname(__FILE__) . '/html/advertiser/async.html');\n}", "function storefront_footer_site_info()\n {\n ?>\n <div class=\"content-copyright text-center\" itemprop=\"streetAddress\">Central Jakarta, Indonesia</div>\n <div class=\"content-copyright text-center\">Developed by <a target=\"_blank\" href=\"https://taufiqelrahman.com\">taufiqelrahman.com</a>.</div>\n <?php\n }", "public function footer_branding()\n\t\t{\n\t\t}", "public function getFooter();", "public function getFooter();", "function mantis_publisher_footer()\n{\n\t$site = get_option('mantis_site_id');\n\n\tif (!$site) {\n\t\treturn;\n\t}\n\n\trequire(dirname(__FILE__) . '/html/publisher/config.php');\n\n\trequire(dirname(__FILE__) . '/html/publisher/styling.php');\n\n\tif (get_option('mantis_async')) {\n\t\trequire(dirname(__FILE__) . '/html/publisher/async.html');\n\t} else {\n\t\trequire(dirname(__FILE__) . '/html/publisher/sync.html');\n\t}\n}", "public function hookFooter()\n\t{\n\t\t//Assign template variables\n\t\t$this->context->smarty->assign(\n\t\t\tarray(\n\t\t\t\t'clerk_public_key' => Configuration::get('CLERK_PUBLIC_KEY', ''),\n\t\t\t)\n\t\t);\n\n\t\treturn $this->display(__FILE__, 'visitor_tracking.tpl', $this->getCacheId(BlockCMSModel::FOOTER));\n\t}", "public function get_footer()\n {\n return <<<EOD\n<div id=\"siteftr\">\n Sitewide Footer\n</div>\n\nEOD;\n }", "abstract protected function footer();", "abstract protected function footer();", "public static function displayFooter() {\r\n ?>\r\n <br><br><br>\r\n <div id=\"push\"></div>\r\n </div>\r\n <div id=\"footer\"><br>&copy 2016 Power House. All Rights Reserved.</div>\r\n <script type=\"text/javascript\" src=\"<?= BASE_URL ?>/www/js/ajax_autosuggestion.js\"></script>\r\n </body>\r\n </html>\r\n <?php\r\n }", "protected function makeFooter()\n {\n }", "function opinionstage_help_resource_load_footer(){\n}", "function display_results_end(){\r\n?>\r\n\t\t\t</section>\r\n<!-- \t\t\t\t<footer id=\"foot\" class=\"containers\">\r\n\t\t\t\t\t<label>Copyright@RClouds Technologies Pvt. Ltd. </label>\r\n\t\t\t\t</footer> -->\t\r\n\t\t\t</body>\r\n\t\t</html>\r\n<?php\r\n\t}", "public function addFooter(){\n\n$this->page .= <<<EOD\n<pre>\n$this->title\n</pre>\n</body>\n</html>\nEOD;\n}", "function roboaztechs_google_analytics() { ?>\n\t<script>\n\t\t<?php if (WP_ENV === 'production') : ?>\n\t\t(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=\n\t\tfunction(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;\n\t\te=o.createElement(i);r=o.getElementsByTagName(i)[0];\n\t\te.src='//www.google-analytics.com/analytics.js';\n\t\tr.parentNode.insertBefore(e,r)}(window,document,'script','ga'));\n\t<?php else : ?>\n\t\tfunction ga() {\n\t\t console.log('GoogleAnalytics: ' + [].slice.call(arguments));\n\t\t}\n\t<?php endif; ?>\n\t\tga('create','<?php echo GOOGLE_ANALYTICS_ID; ?>','auto');ga('send','pageview');\n\t</script>\n\n<?php }", "public function displayContentFooter() {\n ?>\n <footer class=\"container-fluid text-center\">\n <p>IT360 Applied Database Systems Project By Harrison Bleckley, Drake Bodine, and Lani Davis</p>\n </footer>\n <?php\n }", "public static function getFooter()\n {\n ?>\n <p>Content in the front end's footer. This code comes from <?php echo __METHOD__; ?></p>\n <?php\n }", "final public function Add_Google_Tag_Manager_HEAD() {\n\t\tif (isset(self::$GOOGLE_TAG_MANAGER_ID) && !empty(self::$GOOGLE_TAG_MANAGER_ID)) {\n\t\t?>\n<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','<?= self::$GOOGLE_TAG_MANAGER_ID; ?>');</script>\n<?\n \t}\n\t}", "public static function output_footer_assets()\n {\n }", "function sloodle_print_footer()\r\n {\r\n global $CFG;\r\n echo \"<p style=\\\"text-align:center; margin-top:32px; font-size:90%;\\\"><a href=\\\"{$CFG->wwwroot}/course/view.php?id={$this->course->id}\\\">&lt;&lt;&lt; \".get_string('backtocoursepage','sloodle').\"</a></h2>\";\r\n sloodle_print_footer($this->course);\r\n }", "function opinionstage_settings_load_footer(){\n}", "function smash_wp_footer_site_analytics() {\n\n\t// don't track logged in users.\n\tif ( is_user_logged_in() ) {\n\t\treturn;\n\t}\n\t?>\n\n\t<script>\n\t\tvar clicky_site_ids = clicky_site_ids || [];\n\t\tclicky_site_ids.push( 2727 );\n\t\t(\n\t\t\tfunction( d ) {\n\t\t\t\tvar $s = d.createElement( \"script\" );\n\t\t\t\t$s.type = \"text/javascript\";\n\t\t\t\t$s.async = 1;\n\t\t\t\t$s.src = \"//static.getclicky.com/js\";\n\t\t\t\td.getElementsByTagName( \"head\" )[ 0 ].appendChild( $s )\n\t\t\t}\n\t\t)( document )\n\t</script>\n\t<noscript><p><img alt=\"Clicky\" width=\"1\" height=\"1\" src=\"//in.getclicky.com/2727ns.gif\" /></p></noscript>\n\t<?php\n}", "public function cheffism_async_google_analytics() {\n\n if ( !WP_DEBUG ) {\n $UA = get_option( 'cheffism_functionality_options', '' );\n\n require plugin_dir_path( dirname( __FILE__ ) ) . '/public/partials/cheffism-functionality-analytics.php';\n }\n }", "function footer() {\n\n\techo '<p>Copyright Dynamic Sites LLC 2012</p>';\n\t\n}", "function display_analytics_section_html()\n\t\t{\n\t\t\techo '<p>';\n\t\t\techo 'Enter code block used for site analytics';\n\t\t\techo '</p>';\n\t\t}", "function blogolytics_localize_scripts() {\n\n\t// Call GA Analytics.js\n\twp_enqueue_script( 'ga-analytics', 'https://www.google-analytics.com/analytics.js' );\n\n}", "public function print_footer_scripts()\n {\n }", "function sloodle_print_footer()\n {\n sloodle_print_footer($this->course);\n }", "protected function footer()\n {\n\n }", "public function template_footer() {\n\t\tget_footer( 'course' );\n\t}", "function get_footer(){\n\t\tglobal $FANNIE_ROOT, $FANNIE_AUTH_ENABLED, $FANNIE_URL;\n\t\tob_start();\n\t\tinclude($FANNIE_ROOT.'src/footer_install.html');\n\t\treturn ob_get_clean();\n\t}", "function display_footer_locations()\n {\n include 'assets/partials/footer-locations.php';\n }", "public function bl_insert_google_analytics() {\r\n\t\t\t\r\n\t\t\t$ga_code = $this->value('googleanalytics_code');\r\n\t\t\t$ga_code_extra = $this->value('googleanalytics_code_extra');\r\n\t\t\tif ( strlen(trim($ga_code_extra)) > 0 ) {\r\n\t\t\t\t$ga_code_extra = \"gtag('config', '\" . $ga_code_extra . \"', {'anonymize_ip': true} );\";\r\n\t\t\t}\r\n\r\n\t\t\t$eu_cookie_popup = $this->value('eu_cookie_popup');\r\n\r\n\t\t\tif ( strlen($ga_code) > 0 ) {\r\n\r\n\t\t\t\t$ga_script = \"<!-- Global site tag (gtag.js) - Google Analytics -->\r\n\t\t\t\t<script async src=\\\"https://www.googletagmanager.com/gtag/js?id=\" . $ga_code . \"\\\"></script>\r\n\t\t\t\t<script>\r\n\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\r\n\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\r\n\t\t\t\t</script>\";\r\n\t\t\t\t$ga_script .= \"<script>function initialiseGoogleAnalytics() { gtag('js', new Date()); gtag('config', '\" . $ga_code . \"', {'anonymize_ip': true} ); console.log('initialiseGoogleAnalytics initied'); \".$ga_code_extra.\" }</script>\";\r\n\r\n\t\t\t\techo ($ga_script);\r\n\r\n\r\n\t\t\t\tif ( $eu_cookie_popup != 'checked' ) { ?>\r\n\t\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t\t// Not presenting the cookie box, so auto init GA\r\n\t\t\t\t\t\tinitialiseGoogleAnalytics();\r\n\t\t\t\t\t</script>\r\n\t\t\t\t\r\n\t\t\t\t<?php } else { ?>\r\n\r\n\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t\r\n\t\t\t\t// Subscribe for the cookie consent events\r\n\t\t\t\tvar $jq = jQuery.noConflict();\r\n\t\t\t\tif ( $jq(document).euCookieLawPopup().alreadyAccepted() ) {\r\n\t\t\t\t\t// User clicked on enabling cookies. Now it’s safe to call the init functions.\r\n\t\t\t\t\tinitialiseGoogleAnalytics();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$jq(document).bind(\"user_cookie_consent_changed\", function(event, object) {\r\n\t\t\t\t\tconst userConsentGiven = $jq(object).attr('consent');\r\n\t\t\t\t\tif (userConsentGiven) {\r\n\t\t\t\t\t\t// User clicked on enabling cookies. Now it’s safe to call the init functions.\r\n\t\t\t\t\t\tinitialiseGoogleAnalytics();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t</script>\r\n\t\t\t<?php }\r\n\t\t\t}\r\n\t\t}", "public function initPageFooter()\n\t{\n\t\tinclude_once('view/main_page_footer.php');\n\t}", "function genesisawesome_fullwidth_footer() {\n\n\t?>\n\t</div> <!-- end .wrap -->\n\t<div class=\"ga-footer-fullwidth\">\n\t<?php\n\n}", "function bones_google_analytics(){\n if( defined(\"GOOGLE_ANALYTICS_ID\") ){\n $o = null;\n $o.= '<script type=\"text/javascript\">';\n $o.= \"var _gaq = _gaq || [];\";\n $o.= \"_gaq.push(['_setAccount', '\". GOOGLE_ANALYTICS_ID .\"']);\";\n $o.= \"_gaq.push(['_trackPageview']);\";\n\n $o.= '(function() {';\n $o.= \" var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\";\n $o.= \" ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\";\n $o.= \" var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\";\n $o.= \"})();\";\n $o.= '</script>';\n echo $o;\n }\n}", "public function footer() {\n\t}", "function phorum_mod_google_maps_before_footer_profile()\n{\n global $PHORUM;\n\n if (isset($PHORUM[\"DATA\"][\"MOD_GOOGLE_MAPS\"]) &&\n $PHORUM[\"mod_google_maps\"][\"profile_auto_show\"]) {\n include phorum_get_template(\"google_maps::profile\");\n }\n}", "function Footer()\n\t\t{\n\t\t}", "function getContentFooter() {\n return '';\n }", "function gphq_build_header() {\n?>\n<!-- GeoTag metadata -->\n<meta name=\"geo.country\" content=\"US\" />\n<meta name=\"geo.region\" content=\"US-AZ\" />\n<meta name=\"geo.placename\" content=\"Chandler, AZ 85225, USA\" />\n<meta name=\"geo.position\" content=\"33.299671, -111.841882\" />\n<!-- GeoURL metadata -->\n<meta name=\"ICBM\" content=\"33.299671, -111.841882\" />\n<meta name=\"DC.title\" content=\"Gangplank - A Collaborative coworking and event space\" />\n<!-- End GeoData -->\n<?php }", "function emc_single_footer_meta() {\r\n\r\n\tif ( ! class_exists( 'Acf', false ) ) return false;\r\n\r\n\t$source = ( get_field( 'source' ) ) ? get_field( 'source' ) : __( 'Not specified', 'emc' );\r\n\t$copyright = ( get_field( 'copyright' ) ) ? get_field( 'copyright' ) : __( '&copy; Erikson Insitute', 'emc' );\r\n\t$content_id = ( get_field( 'id' ) ) ? get_field( 'id' ) : __( 'Not specified', 'emc' );\r\n\r\n\t$html = sprintf( __( 'Source: %1$s &bull; Copyright: %2$s &bull; Content ID: %3$s', 'emc' ),\r\n\t\tesc_html( $source ),\r\n\t\tesc_html( $copyright ),\r\n\t\tesc_html( $content_id )\r\n\t);\r\n\r\n\techo $html;\r\n\r\n}", "function display_portal_footer()\r\n {\r\n Display :: footer();\r\n }", "public function footer()\n {\n }", "function megatron_ubc_clf_global_utility_footer($variables) {\n $clf_layout = theme_get_setting('clf_layout');\n $containerstart = '';\n $containerend = '';\n if (($clf_layout == '__full') || ($clf_layout == '__fluid')) {\n $containerstart = '<div class=\"container\">';\n $containerend = '</div>';\n }\n $output = '<div class=\"row-fluid expand\" id=\"ubc7-global-footer\">';\n $output .= $containerstart;\n $output .= '<div class=\"span5\" id=\"ubc7-signature\"><a href=\"http://www.ubc.ca/\">The University of British Columbia</a></div>\n <div class=\"span7\" id=\"ubc7-footer-menu\"></div>';\n $output .= $containerend;\n $output .= '</div>\n <div class=\"row-fluid expand\" id=\"ubc7-minimal-footer\">';\n $output .= $containerstart;\n $output .= '<div class=\"span12\">\n <ul>\n <li><a href=\"https://cdn.ubc.ca/clf/ref/emergency\">Emergency Procedures</a> <span class=\"divider\">|</span></li>\n <li><a href=\"https://cdn.ubc.ca/clf/ref/terms\">Terms of Use</a> <span class=\"divider\">|</span></li>\n <li><a href=\"https://cdn.ubc.ca/clf/ref/copyright\">UBC Copyright</a> <span class=\"divider\">|</span></li>\n <li><a href=\"https://cdn.ubc.ca/clf/ref/accessibility\">Accessibility</a></li>\n </ul>\n </div>';\n $output .= $containerend;\n $output .= '</div>';\n return $output;\n}", "private function PH_SiteFooter(){\n $res =<<<EOF\n <a href=\"#\">Lorem</a> |\n <a href=\"#\">Ipsum</a> |\n <a href=\"#\">Dolor</a> |\n <a href=\"#\">Sit amet</a> |\n <a href=\"#\">Aliquip</a> \nEOF;\n return $res;\n }", "function Footer()\n {\n date_default_timezone_set('UTC+1');\n //Date\n $tDate = date('F j, Y, g:i:s a');\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 12);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10,utf8_decode('Page ' . $this->PageNo().' \n CHUYC \n '.$tDate.'\n +237 693 553 454\n '.$this->Image(SITELOGO, 189, 280, 10, 10,'', URLROOT)), 0, 0, 'L');\n }", "function display_footer_social()\n {\n include 'assets/partials/footer-social.php';\n }", "function Footer()\n\t{\n\t\t$this->pie_pred();\n\t \n\t}", "public function injectAnalytics() {\n $googleAnalyticsId = Project::$googleAnalyticsId;\n if (isset($googleAnalyticsId) && $googleAnalyticsId != '') {\n\n ?>\n <script>\n (function (b, o, i, l, e, r) {\n b.GoogleAnalyticsObject = l;\n b[l] || (b[l] =\n function () {\n (b[l].q = b[l].q || []).push(arguments)\n });\n b[l].l = +new Date;\n e = o.createElement(i);\n r = o.getElementsByTagName(i)[0];\n e.src = 'https://www.google-analytics.com/analytics.js';\n r.parentNode.insertBefore(e, r)\n }(window, document, 'script', 'ga'));\n ga('create', '<?php echo $googleAnalyticsId; ?>', 'auto');\n ga('send', 'pageview');\n </script><?php\n }\n }", "function display_footer_quicklinks()\n {\n include 'assets/partials/footer-quicklinks.php';\n }", "public function print_footer_scripts()\n {\n }", "function cosmetics_footer_scripts() {\n global $cosmetics_options;\n $cosmetics_footer_scripts = $cosmetics_options['cosmetics_footer_scripts_editor'];\n\n if ( !empty( $cosmetics_footer_scripts ) ) :\n echo $cosmetics_footer_scripts;\n endif;\n}", "public static function show_footer() {\n require_once Config::get('prefix') . '/templates/footer.inc.php';\n if (isset($_REQUEST['profiling'])) {\n Dba::show_profile();\n }\n }", "function sl_after_content_setup(){\n // end of the main content container\n?>\n </section> <!-- .site-content -->\n<?php\n}", "function maxDoc_themes_footer_inc(){\n}", "function footer() {\n\t?>\n\t\t\t\t<div class=\"headfoot\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t&quot;Remember The Cow is nice, but it's a total copy of another site.&quot; - PCWorld<br />\n\t\t\t\t\t\tAll pages and content &copy; Copyright CowPie Inc.\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<div id=\"w3c\">\n\t\t\t\t\t\t<a href=\"https://webster.cs.washington.edu/validate-html.php\">\n\t\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/w3c-html.png\" alt=\"Valid HTML\" /></a>\n\t\t\t\t\t\t<a href=\"https://webster.cs.washington.edu/validate-css.php\">\n\t\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/w3c-css.png\" alt=\"Valid CSS\" /></a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</body>\n\t\t</html>\n\t<?php\n\t}", "function getFooter()\n{\n global $rAdminSettings, $rPermissions, $rSettings, $rRelease, $rEarlyAccess, $_;\n if ($rPermissions[\"is_admin\"]) {\n $version = \"Version : \" . $rRelease . \" Based On Xtream UI 22F\";\n if ($rAdminSettings['show_version'] == 0) {\n $version = \" Based On Xtream UI 22F\";\n }\n return $_[\"copyright\"] . \" &copy; \" . date(\"Y\") . \" - \" . $rAdminSettings['site_title'] . \" - \" . $version;\n } else {\n return $rSettings[\"copyrights_text\"];\n }\n}", "function kickstart_footer_social() {\n\tgenesis_widget_area( 'footer-social', array(\n\t\t'before' => '<section class=\"footer-social\"><div class=\"wrap\">',\n\t\t'after' => '</div></section>',\n\t) );\n}", "function addFooter($year, $copyright)\n {\n $this->page .= <<<EOD\n<div align=\"center\">&copy; $year $copyright</div>\n</body>\n</html>\nEOD;\n }", "function storefront_footer_social_media()\n {\n include('footer_social_media.php');\n }", "public function addFooter()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/footer.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/footer.php\");\n }\n }", "function showFooter() \n {\n // AUSGABE\n echo \"<div class='newFahrt'><div class='footer'>\";\n echo \"<p>EventPlanner by Steven Schödel (c) Version 05.072019 | \";\n echo \"<a href='/flatnet2/informationen/impressum.php'>Impressum</a> | \";\n echo \"<a href='/index.php'>Login</a>\";\n echo \"</p>\";\n echo \"</div></div>\";\n }", "final public function Add_Google_Tag_Manager_BODY() {\n\t\tif (isset(self::$GOOGLE_TAG_MANAGER_ID) && !empty(self::$GOOGLE_TAG_MANAGER_ID)) {\n\t\t?>\n<noscript><iframe src=\"https://www.googletagmanager.com/ns.html?id=<?= self::$GOOGLE_TAG_MANAGER_ID; ?>\"\nheight=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript>\n<?\n \t}\n\t}", "public function apb_email_footer() {\r\n\t\tinclude AWE_function::template_exsits( 'emails/apb-email-footer' );\r\n\t}", "function megatron_ubc_clf_visual_identity_footer($variables) {\n $clf_layout = theme_get_setting('clf_layout');\n $containerstart = '';\n $containerend = '';\n if (($clf_layout == '__full') || ($clf_layout == '__fluid')) {\n $containerstart = '<div class=\"container\">';\n $containerend = '</div>';\n }\n $output = '<div id=\"ubc7-unit-footer\" class=\"row-fluid expand\">';\n $output .= $containerstart;\n if (theme_get_setting('custom_signature')) {\n $output .= '<div class=\"row-fluid\"><div class=\"span12\"><a class=\"faculty-identifier ir\" href=\"/\">' . theme_get_setting('clf_faculty_name') . '</a></div></div>';\n }\n $output .= '<div class=\"row-fluid\"><div class=\"span10\" id=\"ubc7-unit-address\">';\n $output .= '<div class=\"ubc7-address-unit-name\"><strong>' . theme_get_setting('clf_unitname') . '</strong></div>' . theme_get_setting('clf_campus') . '';\n if (theme_get_setting('clf_faculty')) {\n $output .= '<div class=\"ubc7-address-faculty-name\">' . theme_get_setting('clf_faculty_name') . '</div>'; }\n $output .= '<div class=\"ubc7-address-street\">' . theme_get_setting('clf_streetaddr') . '</div>';\n $output .= '<div class=\"ubc7-address-location\">';\n $output .= '<span class=\"ubc7-address-city\">' . theme_get_setting('clf_locality') . '</span>';\n if (theme_get_setting('clf_locality') && theme_get_setting('clf_region')) {\n $output .= ',';\n }\n $output .= ' <span class=\"ubc7-address-province\" title=\"' . theme_get_setting('clf_region') . '\">' . theme_get_setting('clf_region') . '</span> ';\n $output .= '<span class=\"ubc7-address-country\">' . theme_get_setting('clf_country') . '</span> ';\n $output .= '<span class=\"ubc7-address-postal\">' . theme_get_setting('clf_postal') . '</span>';\n $output .= '</div>';\n if (theme_get_setting('clf_telephone')) {\n $output .= '<div class=\"ubc7-address-phone\">Tel ' . theme_get_setting('clf_telephone') . '</div>';\n }\n if (theme_get_setting('clf_fax')) {\n $output .= '<div class=\"ubc7-address-fax\">Fax ' . theme_get_setting('clf_fax') . '</div>';\n }\n if (theme_get_setting('clf_email')) {\n $output .= '<div class=\"ubc7-address-email\">E-mail <a href=\"mailto:' . theme_get_setting('clf_email') . '\">' . theme_get_setting('clf_email') . '</a></div>';\n }\n if (theme_get_setting('clf_website')) {\n $output .= '<div class=\"ubc7-address-website\">Website <a href=\"//' . theme_get_setting('clf_website') . '\" title=\"' . theme_get_setting('clf_unitname') . '\">' . theme_get_setting('clf_website') . '</a></div>';\n }\n $output .= '</div>';\n if (theme_get_setting('clf_social_facebook') || theme_get_setting('clf_social_twitter') || theme_get_setting('clf_social_linkedin') || theme_get_setting('clf_social_googleplus') || theme_get_setting('clf_social_youtube')) {\n $output .= '<div class=\"span2\"><strong>Find us on</strong><div id=\"ubc7-unit-social-icons\">';\n if (theme_get_setting('clf_social_facebook')) {\n $output .= '<a href=\"' . theme_get_setting('clf_social_facebook') . '\"><i class=\"icon-facebook-sign\"></i></a>&nbsp;';\n }\n if (theme_get_setting('clf_social_twitter')) {\n $output .= '<a href=\"' . theme_get_setting('clf_social_twitter') . '\"><i class=\"icon-twitter-sign\"></i></a>&nbsp;';\n }\n if (theme_get_setting('clf_social_linkedin')) {\n $output .= '<a href=\"' . theme_get_setting('clf_social_linkedin') . '\"><i class=\"icon-linkedin-sign\"></i></a>&nbsp;';\n }\n if (theme_get_setting('clf_social_googleplus')) {\n $output .= '<a href=\"' . theme_get_setting('clf_social_googleplus') . '\"><i class=\"icon-google-plus-sign\"></i></a>&nbsp;';\n }\n if (theme_get_setting('clf_social_youtube')) {\n $output .= '<a href=\"' . theme_get_setting('clf_social_youtube') . '\"><i class=\"icon-youtube\"></i></a>&nbsp;';\n }\n $output .= '</div></div>';\n }\n else { $output .= ''; }\n $output .= $containerend;\n $output .= '</div><div class=\"row-fluid expand ubc7-back-to-top\">';\n $output .= $containerstart;\n $output .= '<div class=\"span2\">\n <a href=\"#\" title=\"Back to top\">Back to top <div class=\"ubc7-arrow up-arrow grey\"></div></a>\n </div>';\n $output .= $containerend;\n $output .= '</div>';\n return $output;\n}", "function footer() {\n }", "function Footer()\r\n {\r\n }", "function circle_footer_social() {\n\tget_template_part( 'template-parts/footer-social' );\n}", "public function renderAllDivisionsFooter(): void;", "public function addFooterContent($content);", "protected function footer()\n {\n require SCRIPT_BASE . \"build/rox/templates/footer.php\";\n }", "function setFooter(){\n $this->footer.= <<<EOD\n</div>\n</div>\n</body>\n</html>\nEOD;\n }", "private function printFooter()\n {\n // Nothing to do at the moment\n }", "function atarr_entry_footer() {\n\t\t// Hide tag text for pages.\n\t\tif ( 'post' === get_post_type() ) {\n\t\t\t/* translators: used between list items, there is a space after the comma */\n\t\t\t$tags_list = get_the_tag_list();\n\t\t\tif ( $tags_list ) {\n\t\t\t\tprintf( '<span class=\"tags-links\">' . esc_html__( '%1$s ', 'starry' ) . '</span>', $tags_list ); // WPCS: XSS OK.\n\t\t\t}\n\t\t}\n\t}", "public function footer()\n\t{\n\t\t$social = array();\n\t\tif(!empty($this->cfg->facebook)){$social['facebook'] = $this->cfg->facebook;}\n\t\tif(!empty($this->cfg->instagram)){$social['instagram'] = $this->cfg->instagram;}\n\t\tif(!empty($this->cfg->youtube)){$social['youtube'] = $this->cfg->youtube;}\n\t\tif(!empty($this->cfg->twitter)){$social['twitter'] = $this->cfg->twitter;}\n\t\tif(!empty($this->cfg->tumblr)){$social['tumblr'] = $this->cfg->tumblr;}\n\t\t$links = $this->footer;\n\t\treturn view('footer')->with(compact('social','links'))->render();\n\t}", "function _wp_footer_scripts()\n {\n }", "function circle_footer_copyright() {\n\tcircle_site_copyright( '<div class=\"footer__copyright\">', '</div>' );\n}", "public function hookFooter(){\n $settings = unserialize( Configuration::get($this->name.'_settings') );\n \n $this->context->smarty->assign(array(\n 'user' => $settings['user'],\n 'widget_id' => $settings['widget_id'],\n 'tweets_limit' => $settings['tweets_limit'],\n 'follow_btn' => $settings['follow_btn']\n ));\n \n return $this->display(__FILE__, $this->name.'.tpl');\n }", "function _asc_footer_scripts() {\n\tprint_late_styles();\n\tprint_footer_scripts();\n}", "public function output_head() {\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) return;\n\n\t\t// no indentation on purpose\n\t\t?>\n<!-- Start WooCommerce KISSmetrics -->\n<script type=\"text/javascript\">\n\tvar _kmq = _kmq || [];\n\tfunction _kms(u) {\n\t\tsetTimeout(function () {\n\t\t\tvar s = document.createElement('script');\n\t\t\tvar f = document.getElementsByTagName('script')[0];\n\t\t\ts.type = 'text/javascript';\n\t\t\ts.async = true;\n\t\t\ts.src = u;\n\t\t\tf.parentNode.insertBefore(s, f);\n\t\t}, 1);\n\t}\n\t_kms('//i.kissmetrics.com/i.js');\n\t_kms('//doug1izaerwt3.cloudfront.net/<?php echo $this->api_key; ?>.1.js');\n\t_kmq.push(['identify', '<?php echo $this->get_identity(); ?>']);\n\t<?php if ( is_front_page() && $this->event_name['viewed_homepage'] ) echo \"_kmq.push(['record', '\" . $this->event_name['viewed_homepage'] . \"' ]);\\n\"; ?>\n</script>\n<!-- end WooCommerce KISSmetrics -->\n\t\t<?php\n\t}", "function fiorello_mikado_header_meta() { ?>\n\n\t\t<meta charset=\"<?php bloginfo( 'charset' ); ?>\"/>\n\t\t<link rel=\"profile\" href=\"http://gmpg.org/xfn/11\"/>\n\t\t<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>\n\t\t\t<link rel=\"pingback\" href=\"<?php bloginfo( 'pingback_url' ); ?>\">\n\t\t<?php endif; ?>\n\n\t<?php }", "public function getFooter()\n {\n return <<<EOF\n\n<info>\nFinished. \n</info>\n\n\nEOF;\n\n}", "function adminFooter()\n {\n return \"\";\n }", "function cs_footer_settings() {\n global $cs_theme_option;\n echo htmlspecialchars_decode($cs_theme_option['analytics']);\n}", "public function Footer()\n {\n global $PMF_LANG;\n\n // Set custom footer\n $this->setCustomFooter();\n\n $date = new PMF_Date($this->_config);\n\n $footer = sprintf(\n '(c) %d %s <%s> | %s',\n date('Y'),\n $this->_config->get('main.metaPublisher'),\n $this->_config->get('main.administrationMail'),\n $date->format(date('Y-m-d H:i'))\n );\n\n if (0 < PMF_String::strlen($this->customFooter)) {\n $this->writeHTMLCell(0, 0, '', '', $this->customFooter);\n }\n\n $currentTextColor = $this->TextColor;\n $this->SetTextColor(0, 0, 0);\n $this->SetY(-25);\n $this->SetFont($this->currentFont, '', 10);\n $this->Cell(0, 10, $PMF_LANG['ad_gen_page'].' '.$this->getAliasNumPage().' / '.$this->getAliasNbPages(), 0, 0, 'C');\n $this->SetY(-20);\n $this->SetFont($this->currentFont, 'B', 8);\n $this->Cell(0, 10, $footer, 0, 1, 'C');\n if ($this->enableBookmarks == false) {\n $this->SetY(-15);\n $this->SetFont($this->currentFont, '', 8);\n $baseUrl = 'index.php';\n if (is_array($this->faq) && !empty($this->faq)) {\n $baseUrl .= '?action=artikel&amp;';\n if (array_key_exists($this->category, $this->categories)) {\n $baseUrl .= 'cat='.$this->categories[$this->category]['id'];\n } else {\n $baseUrl .= 'cat=0';\n }\n $baseUrl .= '&amp;id='.$this->faq['id'];\n $baseUrl .= '&amp;artlang='.$this->faq['lang'];\n }\n $url = $this->_config->getDefaultUrl().$baseUrl;\n $urlObj = new PMF_Link($url, $this->_config);\n $urlObj->itemTitle = $this->question;\n $_url = str_replace('&amp;', '&', $urlObj->toString());\n $this->Cell(0, 10, 'URL: '.$_url, 0, 1, 'C', 0, $_url);\n }\n $this->TextColor = $currentTextColor;\n }", "function iframe_footer()\n {\n }", "function Wfc_Developer_Footer( $text ){\n global $wp_version, $wfc_version;\n $wfc_versions = \"WP ver: \".$wp_version.\" | WFC ver: \".$wfc_version;\n $text = '<span id=\"footer-thankyou\" class=\"wfc-admin-footer\">WFC Developer. '.$wfc_versions.'</span>';\n return $text;\n }", "public function Footer(){\n // Posición: a 1,5 cm del final\n $this->SetY(-20);\n // Arial italic 8\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',10);\n $this->SetTextColor(50,50,50);\n // Número de págin\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode('Generado por GetYourGames'),0,0,\"R\");\n $this->Ln(4);\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode(date(\"d-m-Y g:i a\").' - Página ').$this->PageNo(),0,0,\"R\");\n\n }", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}" ]
[ "0.6810003", "0.6767638", "0.6615356", "0.645893", "0.6431056", "0.63403636", "0.62368566", "0.6222071", "0.61863595", "0.6185349", "0.61760724", "0.6158829", "0.6158829", "0.6142523", "0.61363375", "0.6130057", "0.6105094", "0.6105094", "0.6088329", "0.6079853", "0.6057435", "0.60537004", "0.6051392", "0.6046467", "0.60358703", "0.5980389", "0.5971211", "0.5961083", "0.595834", "0.59577954", "0.5944969", "0.5942952", "0.5925817", "0.591886", "0.5899791", "0.58938754", "0.58872074", "0.588652", "0.5873236", "0.5866672", "0.5852871", "0.58318657", "0.5826983", "0.5824753", "0.5806031", "0.5800805", "0.5798327", "0.57942104", "0.5784223", "0.5784141", "0.5783691", "0.57696325", "0.5764618", "0.57480395", "0.5747504", "0.5742688", "0.5742502", "0.57388115", "0.5737516", "0.5723831", "0.5717273", "0.571192", "0.5709336", "0.57028216", "0.5698009", "0.56786925", "0.5678346", "0.5677547", "0.5671061", "0.56693625", "0.56640035", "0.56596315", "0.5657501", "0.5652383", "0.5639818", "0.56365955", "0.5632411", "0.5627544", "0.561122", "0.5609857", "0.5609088", "0.5608252", "0.55957204", "0.55953115", "0.5587886", "0.55794775", "0.5574335", "0.5573373", "0.5571002", "0.55665356", "0.55618066", "0.55561364", "0.5552082", "0.5551672", "0.5548471", "0.55435914", "0.5535106", "0.55343103", "0.55328125", "0.55328125" ]
0.5959148
28
Create a new controller instance.
public function __construct() { $this->post = new Post(); $this->comment = new Comment(); $this->member = new Member(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Formats a numbers as bytes, based on size, and adds the appropriate suffix
function number_to_size($num, int $precision = 1, ?string $locale = null) { // Strip any formatting & ensure numeric input try { // @phpstan-ignore-next-line $num = 0 + str_replace(',', '', $num); } catch (ErrorException $ee) { // Catch "Warning: A non-numeric value encountered" return false; } // ignore sub part $generalLocale = $locale; if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) { $generalLocale = substr($locale, 0, $underscorePos); } if ($num >= 1_000_000_000_000) { $num = round($num / 1_099_511_627_776, $precision); $unit = lang('Number.terabyteAbbr', [], $generalLocale); } elseif ($num >= 1_000_000_000) { $num = round($num / 1_073_741_824, $precision); $unit = lang('Number.gigabyteAbbr', [], $generalLocale); } elseif ($num >= 1_000_000) { $num = round($num / 1_048_576, $precision); $unit = lang('Number.megabyteAbbr', [], $generalLocale); } elseif ($num >= 1000) { $num = round($num / 1024, $precision); $unit = lang('Number.kilobyteAbbr', [], $generalLocale); } else { $unit = lang('Number.bytes', [], $generalLocale); } return format_number($num, $precision, $locale, ['after' => ' ' . $unit]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _files_formatFileSize($size) {\n\t$suffix = '';\n\t\n\t## check if we got a number\n\tif(!is_numeric($size) || $size < 0) {\n\t\treturn 0;\n\t}\n\t\n\t## now determine the 'level'\n\tfor($level = 0; $size >= 1024; $level++) {\n\t\t$size /= 1024;\n\t}\n\t\n\t## now add the suffix\n\tswitch($level) {\n\t\tcase 0: $suffix = 'Bytes'; break;\n\t\tcase 1: $suffix = 'KB'; break;\n\t\tcase 2: $suffix = 'MB'; break;\n\t\tcase 3: $suffix = 'GB'; break;\n\t\tdefault: $suffix = '';\n\t}\n\t\n\treturn round($size,2) . ' '.$suffix;\n}", "function format_bytes ( $size ) {\n\t\tswitch ( $size ) {\n\t\t\tcase $size > 1000000:\n\t\t\t\treturn number_format(ceil($size / 1000000)) . \"mb\";\n\t\t\t\tbreak;\n\t\t\tcase $size > 1000:\n\t\t\t\treturn number_format(ceil($size / 1000)) . \"k\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn number_format($size) . \"b\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "function formatBytes($size, $precision = 2)\n {\n $base = log($size, 1024);\n $suffixes = array('', 'K', 'M', 'G', 'T'); \n\n return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)];\n }", "function formatBytes($size) {\n $units = array(' B', ' KB', ' MB', ' GB', ' TB');\n for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;\n return round($size, 2).$units[$i];\n}", "function formatBytes($size, $precision = 2)\n {\n if($size != 0){\n $base = log($size, 1024);\n $suffixes = array('kB', 'MB', 'GB', 'TB'); \n return round(pow(1024, $base - floor($base)), $precision) .''. $suffixes[floor($base)];\n }\n return 0;\n }", "function formatBytes($size, $precision = 1)\n{\n $base = log($size, 1024);\n $suffixes = array('B', 'KB', 'MB', 'GB', 'TB');\n return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];\n}", "function format_bytes($size, $precision = 0)\n {\n $sizes = array(\n 'YB',\n 'ZB',\n 'EB',\n 'PB',\n 'TB',\n 'GB',\n 'MB',\n 'KB',\n 'B'\n );\n $total = count($sizes);\n \n while ($total-- && $size > 1024)\n $size /= 1024;\n return sprintf('%.' . $precision . 'f', $size) . $sizes[$total];\n }", "function size_format($bytes, $decimals = 0)\n {\n }", "public function formatBytes($size, $precision = 2)\n\t{\n\t $base = log($size) / log(1024);\n\t $suffixes = array('', 'k', 'M', 'G', 'T'); \n\n\t return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];\n\t}", "function cre_resize_bytes($size) {\n $count = 0;\n $format = array(\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\",\"EB\",\"ZB\",\"YB\");\n while(($size/1024)>1 && $count<8) {\n $size=$size/1024;\n $count++;\n }\n $return = number_format($size,0,'','.').\" \".$format[$count];\n return $return;\n }", "public static function formatBytes($size, $precision = 2)\r\n {\r\n $base = log($size) / log(1024);\r\n $suffixes = array('', 'k', 'M', 'G', 'T'); \r\n return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];\r\n }", "function twe_format_filesize($size) {\n\t$a = array(\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\");\n\t\n\t$pos = 0;\n\twhile ($size >= 1024) {\n\t\t$size /= 1024;\n\t\t$pos++;\n\t}\n\treturn round($size,2).\" \".$a[$pos];\n}", "public static function format_bytes($size, $precision = 2)\n\t{\n\t\t$base = log($size, 1024);\n\t\t$suffixes = array('', 'kB', 'MB', 'GB', 'TB');\n\n\t\treturn round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];\n\t}", "public function formatBytes(int $size): string\n {\n $units = ['B', 'KB', 'MB', 'GB', 'TB'];\n $base = \\log($size) / \\log(1024);\n\n return \\round(1024 ** ($base - \\floor($base)), 1) . ' ' . $units[(int)\\floor($base)];\n }", "private function formatBytes($size, $precision = 2)\n {\n $base = log($size, 1024);\n $suffixes = array('B', 'kB', 'MB', 'GB', 'TB', 'PT');\n return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)];\n }", "function filesize_formatted($size)\n{\n\t$units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\t$power = $size > 0 ? floor(log($size, 1024)) : 0;\n\treturn number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];\n}", "public static function formatBytes($size, $precision = 2)\n {\n if ($size > 0) {\n $size = (int) $size;\n $base = log($size) / log(1024);\n $suffixes = array(' bytes', ' KB', ' MB', ' GB', ' TB');\n\n return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];\n } else {\n return $size;\n }\n }", "protected function formatBytes($size, $precision = 2)\n\t{\n\t\t$base = log($size, 1024);\n\t\t$suffixes = array('bytes', 'kb', 'Mb', 'G', 'T'); \n\n\t\treturn round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];\n\t}", "function formatBytes($intSize) {\n\t\treturn sprintf('%0.2f', ($intSize/1000)). ' Kb';\n\t}", "function format_filesize($size)\r\n{\r\n\r\n // Measure & Number of decimals\r\n $measures = array (\r\n 0 => array ( \"B\", 0 ),\r\n 1 => array ( \"KB\", 0 ),\r\n 2 => array ( \"MB\", 0 ),\r\n 3 => array ( \"GB\", 2 ),\r\n 4 => array ( \"TB\", 3 )\r\n );\r\n\r\n $file_size = (double)$size;\r\n\r\n for ( $i = 0; $file_size >= 1024; $i++ )\r\n {\r\n $file_size = (double)$file_size / 1024;\r\n }\r\n\r\n $file_size = number_format ( $file_size, $measures[$i][1] );\r\n\r\n return $file_size.\" \".$measures[$i][0];\r\n}", "function format_toSizeInBytes_shortForm($size_in_bytes) {\n\t\t//\n\t\t// Data sizes are normally specified in KB - powers of 1024, so return KB rather than kB\n\n\t\tif ($size_in_bytes < (1024 * 1024)) {\n\t\t\t$unit = \"K\";\n\t\t\t$unitSize = $size_in_bytes / 1024;\n\t\t} else if ($size_in_bytes < (1024 * 1024 * 1024)) {\n\t\t\t$unit = \"M\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024);\n\t\t} else {\n\t\t\t$unit = \"G\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024 * 1024);\n\t\t}\n\n\t\t$showDecimalPlace = $unitSize < 10 && round($unitSize, 1) != round($unitSize);\n\n\t\treturn sprintf($showDecimalPlace ? \"%1.1f\" : \"%1.0f\", $unitSize) . $unit;\n\t}", "function byteSizeConvert($size){\n $unit=array('b','kb','mb','gb','tb','pb');\n return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];\n}", "function sizeFormat($size) { \n if($size<1024) \n { \n return $size.\" bytes\"; \n } \n else if($size<(1024*1024)) \n { \n $size=round($size/1024,1); \n return $size.\" KB\"; \n } \n else if($size<(1024*1024*1024)) \n { \n $size=round($size/(1024*1024),1); \n return $size.\" MB\"; \n } \n else \n { \n $size=round($size/(1024*1024*1024),1); \n return $size.\" GB\"; \n } \n}", "function sizeFormat($b = 0){\r\n\t\tif($b < 1024){\r\n\t\t\treturn $b . 'bytes';\r\n\t\t}elseif($b < 1048576){\r\n\t\t\treturn round($b / 1024 * 100 ) / 100 . 'KB';\r\n\t\t}elseif($b < 130023424){\r\n\t\t\treturn round($b / 1048576 * 100 ) / 100 . 'MB';\r\n\t\t}elseif($b < 133143986176){\r\n\t\t\treturn round($b / 130023424 * 100) / 100 . 'GB';\r\n\t\t}else{\r\n\t\t\treturn round($b / 133143986176 * 100) / 100 . 'TB';\r\n\t\t}\r\n\t}", "public static function formatSize($size)\n {\n if ($size < DRUSH_KILOBYTE) {\n // format_plural() not always available.\n return dt('@count bytes', ['@count' => $size]);\n } else {\n $size /= DRUSH_KILOBYTE; // Convert bytes to kilobytes.\n $units = [\n dt('@size KB', []),\n dt('@size MB', []),\n dt('@size GB', []),\n dt('@size TB', []),\n dt('@size PB', []),\n dt('@size EB', []),\n dt('@size ZB', []),\n dt('@size YB', []),\n ];\n foreach ($units as $unit) {\n if (round($size, 2) >= DRUSH_KILOBYTE) {\n $size /= DRUSH_KILOBYTE;\n } else {\n break;\n }\n }\n return str_replace('@size', round($size, 2), $unit);\n }\n }", "function convert($size)\n {\n $unit=array('b','kb','mb','gb','tb','pb');\n return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];\n }", "function bytes_to_human_size($size, $decimals = 1)\n {\n $suffix = array('Bytes','KB','MB','GB','TB','PB','EB','ZB','YB','NB','DB');\n $i = 0;\n\n while ($size >= 1024 && ($i < count($suffix) - 1)) {\n $size /= 1024;\n $i++;\n }\n\n return round($size, $decimals) . ' ' . $suffix[$i];\n }", "public function formatBytes($size, $precision = 2)\n {\n if ($size > 0) {\n $size = (int) $size;\n $base = log($size) / log(1024);\n $suffixes = array(' bytes', ' KB', ' MB', ' GB', ' TB');\n\n return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];\n } else {\n return $size . ' bytes';\n }\n }", "public static function fsize($size){\n $unit = array('b','Kb','Mb','Gb','Tb','Pb');\n $prefix = $size < 0 ? '-' : ''; $size = abs($size);\n return $prefix.@round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];\n }", "function format_bytes($a_bytes) {\n if ($a_bytes < 1024) {\n return $a_bytes .' B';\n } elseif ($a_bytes < 1048576) {\n return round($a_bytes / 1024, 2) .' Kb';\n } elseif ($a_bytes < 1073741824) {\n return round($a_bytes / 1048576, 2) . ' Mb';\n } elseif ($a_bytes < 1099511627776) {\n return round($a_bytes / 1073741824, 2) . ' Gb';\n } elseif ($a_bytes < 1125899906842624) {\n return round($a_bytes / 1099511627776, 2) .' Tb';\n } elseif ($a_bytes < 1152921504606846976) {\n return round($a_bytes / 1125899906842624, 2) .' Pb';\n } elseif ($a_bytes < 1180591620717411303424) {\n return round($a_bytes / 1152921504606846976, 2) .' Eb';\n } elseif ($a_bytes < 1208925819614629174706176) {\n return round($a_bytes / 1180591620717411303424, 2) .' Zb';\n } else {\n return round($a_bytes / 1208925819614629174706176, 2) .' Yb';\n }\n}", "function formatSize($filename)\n\t{\n\n\t\tif (is_string($filename) && !is_numeric($filename)) $size = filesize($filename);\n\n\t\t$mod = 1024;\n\t\t$units = explode(' ', 'B KB MB GB TB PB');\n\n\t\tfor ($i = 0; $size > $mod; $i++)\n\t\t{\n\t\t\t$size /= $mod;\n\t\t}\n\n\t\treturn round($size, 2).' '.$units[$i];\n\n\t}", "function transByte($size){\n\t$arr = array(\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"EB\");\n\t$i = 0;\n\twhile($size>1024){\n\t\t$size/=1024;\n\t\t$i++;\n\t}\n\treturn round($size,2).$arr[$i];\n}", "private function getSizeFormattedSi(int $size): string\n {\n if ($size > 1000 * 1000) {\n return sprintf('%0.1f MB', ($size / 1000 / 1000));\n }\n if ($size > 1000) {\n return sprintf('%0.1f KB', ($size / 1000));\n }\n\n return $size . ' B';\n }", "function size_format($bytes=\"\")\n\t{\n\t\t$retval = \"\";\n\t\t\n\t\tif ($bytes >= 1048576)\n\t\t{\n\t\t\t$retval = round($bytes / 1048576 * 100 ) / 100 . $this->lang['sf_mb'];\n\t\t}\n\t\telse if ($bytes >= 1024)\n\t\t{\n\t\t\t$retval = round($bytes / 1024 * 100 ) / 100 . $this->lang['sf_k'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$retval = $bytes . $this->lang['sf_bytes'];\n\t\t}\n\t\t\n\t\treturn $retval;\n\t}", "function format_size($file_size, $sizetype) {\n\t\tswitch(strtolower($sizetype)){\n\t\t\tcase \"kb\":\n\t\t\t\t$filesize = $file_size * .0009765625; // bytes to KB\n\t\t\tbreak;\n\t\t\tcase \"mb\":\n\t\t\t\t$filesize = $file_size * .0009765625 * .0009765625; // bytes to MB\n\t\t\tbreak;\n\t\t\tcase \"gb\":\n\t\t\t\t$filesize = $file_size * .0009765625 * .0009765625 * .0009765625; // bytes to GB\n\t\t\tbreak;\n\t\t}\n\t\tif($filesize <= 0){\n\t\t\t$filesize = 0;\n\t\t} else {\n\t\t\t$filesize = round($filesize, 2).' '.$sizetype;\n\t\t}\n\t\treturn $filesize;\n\t}", "function humanReadableToBytes (string $size): int {\n\t$unitIndex = 0;\n\n\t$chars = str_split($size);\n\t$charsLen = count($chars);\n\n\t$multipliers =\n\t\t[\n\t\t\t'B' => 1,\n\t\t\t'KB' => 1 << 10,\n\t\t\t'MB' => 1 << 20,\n\t\t\t'GB' => 1 << 30,\n\t\t\t'TB' => 1 << 40\n\t\t];\n\n\tfor ($i = 0; $i < $charsLen; $i++) {\n\t\tif (!is_numeric($size[$i]) and $size[$i] != '.') {\n\t\t\t$unitIndex = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$sizeN = floatval(substr($size, 0, $unitIndex));\n\t$sizeU = substr($size, $unitIndex, $charsLen - $unitIndex);\n\n\treturn round($sizeN * $multipliers[$sizeU]);\n}", "function round_up_bytes($size) {\n if($size < 1024) {\n return array('size'=>round($size,2),'label'=>'B');\n } elseif($size >= 1024 AND $size < 1048576) {\n return array('size'=>round(($size / 1024),2),'label'=>'KB');\n } elseif($size >= 1048576 AND $size < 1073741824) {\n return array('size'=>round(($size / 1048576),2),'label'=>'MB');\n } else {\n return array('size'=>round(($size / 1073741824),2),'label'=>'GB');\n }\n}", "public function __invoke($size, $precision = 2)\n {\n if ($size < 1024) {\n return sprintf('%d B', $size);\n }\n\n if (($size / 1024) < 1024) {\n return sprintf('%.0f KB', $size / 1024);\n }\n\n return sprintf('%.' . $precision . 'f MB', $size / 1024 / 1024);\n }", "function byteConvert($size, $round = 0) {\n \t/* La size deve essere espressa in Bytes */\n \t$sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n \tfor ($i=0; $size > 1024 && $i < count($sizes) - 1; $i++) $size /= 1024;\n \t\n \treturn round($size,$round).\" \".$sizes[$i];\n\t}", "function bsize($size) {\n foreach (array('', 'K', 'M', 'G') as $k) {\n if ($size < 1024) {\n break;\n }\n $size /= 1024;\n }\n return sprintf(\"%5.1f %sBytes\", $size, $k);\n}", "function formatRawSize($bytes) {\n if(!empty($bytes)) {\n\n $s = array('bytes', 'kb', 'MB', 'GB', 'TB', 'PB');\n $e = floor(log($bytes)/log(1024));\n\n $output = sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e))));\n\n return $output;\n }\n}", "public static function formatSize($size, $decimals = 1) {\n\t\t\n\t\tif($size==0)\n\t\t\treturn \"0 bytes\";\n\t\t\n\t\tswitch ($size) {\n\t\t\tcase ($size >= 1073741824) :\n\t\t\t\t$size = self::localize($size / 1073741824, $decimals);\n\t\t\t\t$size .= \" G\";\n\t\t\t\tbreak;\n\n\t\t\tcase ($size >= 1048576) :\n\t\t\t\t$size = self::localize($size / 1048576, $decimals);\n\t\t\t\t$size .= \" M\";\n\t\t\t\tbreak;\n\n\t\t\tcase ($size >= 1024) :\n\t\t\t\t$size = self::localize($size / 1024, $decimals);\n\t\t\t\t$size .= \" K\";\n\t\t\t\tbreak;\n\n\t\t\tdefault :\n\t\t\t\t$size = self::localize($size, $decimals);\n\t\t\t\t$size .= \" bytes\";\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $size;\n\t}", "function formatSize($b)\n\t{\n\t\t//1024\t\tk\n\t\t//1048576\tm\n\t\t//1073741824\tg\n\n\t\tif ($b >= 1073741824)\n\t\t\t$thesize = round($b / 1073741824 * 100) / 100 . \"G\"; \n\t\telseif ($b >= 1048576)\n\t\t\t$thesize = round($b / 1048576 * 100) / 100 . \"MB\";\n\t\telseif ($b >= 1024)\n\t\t\t$thesize = round($b / 1024 * 100) / 100 . \"K\"; \n\t\telse\n\t\t\t$thesize = $b . \"b\";\n\n\t\treturn $thesize;\n\t}", "public function filesize_format($val, $digits = 3, $mode = \"SI\", $bB = \"B\"){ //$mode == \"SI\"|\"IEC\", $bB == \"b\"|\"B\"\n\t\n\t\t$si = array(\"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\", \"Y\");\n\t\t$iec = array(\"\", \"Ki\", \"Mi\", \"Gi\", \"Ti\", \"Pi\", \"Ei\", \"Zi\", \"Yi\");\n\t\tswitch(strtoupper($mode)) {\n\t\t\tcase \"SI\" :\n\t\t\t\t$factor = 1000;\n\t\t\t\t$symbols = $si;\n\t\t\t\tbreak;\n\t\t\tcase \"IEC\" :\n\t\t\t\t$factor = 1024;\n\t\t\t\t$symbols = $iec;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$factor = 1000;\n\t\t\t\t$symbols = $si;\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch($bB) {\n\t\t\tcase \"b\" :\n\t\t\t\t$val *= 8;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$bB = \"B\";\n\t\t\t\tbreak;\n\t\t}\n\t\tfor($i=0;$i<count($symbols)-1 && $val>=$factor;$i++) {\n\t\t\t$val /= $factor;\n\t\t}\n\t\t$p = strpos($val, \".\");\n\t\tif($p !== false && $p > $digits) {\n\t\t\t$val = round($val);\n\t\t} elseif($p !== false) {\n\t\t\t$val = round($val, $digits-$p);\n\t\t}\n\t\n\t\treturn round($val, $digits) . \" \" . $symbols[$i] . $bB;\n\t}", "function filesize_format($filesize) {\r\n\r\n\tif ($filesize >= 1073741824) $string = round($filesize / 1073741824).\" GB\";\r\n\telseif ($filesize >= 1048576) $string = round($filesize / 1048576).\" MB\";\r\n\telseif ($filesize >= 1024) $string = round($filesize / 1024).\" KB\";\r\n\telse $string = \"$filesize bytes\";\r\n\treturn $string;\r\n\t\r\n}", "function number_to_human_size($bytes){\n\t$border = 1024 * 1.5;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u Byte', $bytes);\n\t\n\t$bytes /= 1024;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u KiByte', $bytes);\n\t\n\t$bytes /= 1024;\n\treturn sprintf('%.1f MiByte', $bytes);\n}", "public static function formatSize($bytes, $round=1)\n\t{\n\t\t$suffix = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n\t\tfor ($i=0; $bytes > 1024 && isset($suffix[$i+1]); $i++) {$bytes /= 1024;}\n\t\treturn round($bytes,$round).\" \".$suffix[$i];\n\t}", "function convertPHPSizeToBytes($sSize) \n{ \n if ( is_numeric( $sSize) ) {\n return $sSize;\n }\n $sSuffix = substr($sSize, -1); \n $iValue = substr($sSize, 0, -1); \n switch(strtoupper($sSuffix)){ \n case 'P':\n $iValue *= 1024;\n case 'T':\n $iValue *= 1024;\n case 'G':\n $iValue *= 1024;\n case 'M':\n $iValue *= 1024;\n case 'K':\n $iValue *= 1024;\n break;\n } \n return $iValue;\n}", "function cs_format_bytes($bytes, $decimals = 2)\r\n{\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%d Bytes', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f KiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f MiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f GiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\treturn sprintf('%.'.$decimals.'f TiB', $bytes);\r\n}", "function format_bytes($bytes, $round=1) {\n\tswitch($bytes) {\n\t\tcase $bytes < 1024:\n\t\t\treturn $bytes .' B';\n\t\tbreak;\n\t\tcase $bytes < 1048576:\n\t\t\t return round($bytes / 1024, $round) .' KB';\n\t\tbreak;\n\t\tcase $bytes < 1073741824:\n\t\t\treturn round($bytes / 1048576, $round) . ' MB';\n\t\tbreak;\t\t\n\t}\n}", "function convertFileSize ($filesize){\n $count = 0;\n $newFileSize = '';\n $array = ['byte', 'kb', 'mb', 'gb', 'tb', 'pb'];\n while($filesize > 1024){\n $filesize /= 1024;\n $count++;\n }\n\n $newFileSize .= round($filesize, 2) . $array[$count]; \n\n \n return $newFileSize;\n }", "function formatBytes($bytes) {\n\t\tif ($bytes < 1024) return $bytes.' B';\n\t\telseif ($bytes < 1048576) return round($bytes / 1024, 2).' KB';\n\t\telseif ($bytes < 1073741824) return round($bytes / 1048576, 2).' MB';\n\t\telseif ($bytes < 1099511627776) return round($bytes / 1073741824, 2).' GB';\n\t\telse return round($bytes / 1099511627776, 2).' TB';\n\t}", "function convertToNotation(int $bytes) {\n\n\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t$bytes = max($bytes, 0); \n\t$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); \n\t$pow = min($pow, count($units) - 1);\n\t$bytes /= pow(1024, $pow);\n\n return round($bytes, 2).$units[$pow]; \n\n}", "function bytesToHumanReadable (int $size, int $decimals = 2): string {\n\tif ($size >= 1 << 40)\n\t\treturn number_format($size / (1 << 40), $decimals).\"TB\";\n\tif ($size >= 1 << 30)\n\t\treturn number_format($size / (1 << 30), $decimals).\"GB\";\n\tif ($size >= 1 << 20)\n\t\treturn number_format($size / (1 << 20), $decimals).\"MB\";\n\tif ($size >= 1 << 10)\n\t\treturn number_format($size / (1 << 10), $decimals).\"KB\";\n\treturn number_format($size, $decimals).\"B\";\n}", "function prettySize($size)\n{\n $limit = 10 * 1024;\n $mult = 1;\n\n if ($size < ($limit * $mult)) {\n $retSize = $size . \" bytes\";\n } else {\n $mult *= 1024;\n if ($size < ($limit * $mult)) {\n $size = round($size / $mult);\n $retSize = $size . \" KiB\";\n } else {\n $mult *= 1024;\n if ($size < ($limit * $mult)) {\n $size = round($size / $mult);\n $retSize = $size . \" MiB\";\n } else {\n $mult *= 1024;\n if ($size < ($limit * $mult)) {\n $size = round($size / $mult);\n $retSize = $size . \" GiB\";\n } else {\n $mult *= 1024;\n $size = round($size / $mult);\n $retSize = $size . \" TiB\";\n }\n }\n }\n }\n return $retSize;\n}", "function formatSizeUnits($bytes) {\n if ($bytes >= 1073741824) {\n $bytes = number_format($bytes / 1073741824, 2) . ' GB';\n } elseif ($bytes >= 1048576) {\n $bytes = number_format($bytes / 1048576, 2) . ' MB';\n } elseif ($bytes >= 1024) {\n $bytes = number_format($bytes / 1024, 2) . ' KB';\n } elseif ($bytes > 1) {\n $bytes = $bytes . ' bytes';\n } elseif ($bytes == 1) {\n $bytes = $bytes . ' byte';\n } else {\n $bytes = '0 bytes';\n }\n return $bytes;\n}", "public function formatFilesize($bytes, $format = false, $precision = 2)\n\t{ \n\t\t$kilobyte = 1024;\n\t\t$megabyte = $kilobyte * 1024;\n\t\t$gigabyte = $megabyte * 1024;\n\t\t$terabyte = $gigabyte * 1024;\n\n\t\tif (($bytes >= 0) && ($bytes < $kilobyte) && !$format || $format == 'B') {\n\t\t\treturn $bytes . ' B';\n\n\t\t} elseif (($bytes >= $kilobyte) && ($bytes < $megabyte) && !$format || $format == 'KB') {\n\t\t\treturn round($bytes / $kilobyte, $precision) . ' KB';\n\n\t\t} elseif (($bytes >= $megabyte) && ($bytes < $gigabyte) && !$format || $format == 'MB') {\n\t\t\treturn round($bytes / $megabyte, $precision) . ' MB';\n\n\t\t} elseif (($bytes >= $gigabyte) && ($bytes < $terabyte) && !$format || $format == 'GB') {\n\t\t\treturn round($bytes / $gigabyte, $precision) . ' GB';\n\n\t\t} elseif ($bytes >= $terabyte && !$format || $format == 'TB') {\n\t\t\treturn round($bytes / $terabyte, $precision) . ' TB';\n\t\t} else {\n\t\t\treturn $bytes . ' B';\n\t\t}\n\t}", "public function formatSize($bytes, $precision = 2)\n {\n if ((int)$bytes < 1) {\n return '';\n }\n\n $units = ['B', \"KB\", \"MB\", \"GB\", \"TB\"];\n\n $bytes = (int)$bytes;\n $base = log($bytes) / log(1000); // 1024 would be for MiB KiB etc\n $pow = pow(1000, $base - floor($base)); // Same rule for 1000\n\n return round($pow, $precision) . ' ' . $units[(int)floor($base)];\n }", "function testFormatSize() {\n\t\t$this->assertEquals(\"1000 bytes\", File::format_size(1000));\n\t\t$this->assertEquals(\"1023 bytes\", File::format_size(1023));\n\t\t$this->assertEquals(\"1 KB\", File::format_size(1025));\n\t\t$this->assertEquals(\"9.8 KB\", File::format_size(10000));\n\t\t$this->assertEquals(\"49 KB\", File::format_size(50000));\n\t\t$this->assertEquals(\"977 KB\", File::format_size(1000000));\n\t\t$this->assertEquals(\"1 MB\", File::format_size(1024*1024));\n\t\t$this->assertEquals(\"954 MB\", File::format_size(1000000000));\n\t\t$this->assertEquals(\"1 GB\", File::format_size(1024*1024*1024));\n\t\t$this->assertEquals(\"9.3 GB\", File::format_size(10000000000));\n\t\t// It use any denomination higher than GB. It also doesn't overflow with >32 bit integers\n\t\t$this->assertEquals(\"93132.3 GB\", File::format_size(100000000000000));\n\t}", "function sloodle_convert_file_size_shorthand($size)\n {\n $size = trim($size);\n $num = (int)$size;\n $char = strtolower($size{strlen($size)-1});\n switch ($char)\n {\n case 'g': $num *= 1024;\n case 'm': $num *= 1024;\n case 'k': $num *= 1024;\n }\n\n return $num;\n }", "function formatBytes( $bytes, $precision = 2 )\n{\n $units = array('b', 'Kb', 'Mb', 'Gb', 'Tb');\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n $bytes /= pow(1024, $pow);\n return round($bytes, $precision) . ' ' . $units[$pow];\n}", "function size_readable ($size, $retstring = null) {\n // adapted from code at http://aidanlister.com/repos/v/function.size_readable.php\n $sizes = array('B ', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n if ($retstring === null) { $retstring = '%01.2f %s'; }\n $lastsizestring = end($sizes);\n foreach ($sizes as $sizestring) {\n if ($size < 1024) { break; }\n if ($sizestring != $lastsizestring) { $size /= 1024; }\n }\n if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; } // Bytes aren't normally fractional\n return sprintf($retstring, $size, $sizestring);\n }", "function file_size_readable ($size, $retstring = null) {\n $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n if ($retstring === null) { $retstring = '%01.2f %s'; }\n $lastsizestring = end($sizes);\n foreach ($sizes as $sizestring) {\n if ($size < 1024) { break; }\n if ($sizestring != $lastsizestring) { $size /= 1024; }\n }\n if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; } // Bytes aren't normally fractional\n return sprintf($retstring, $size, $sizestring);\n}", "function formatSizeUnits($bytes)\n {\n if ($bytes >= 1073741824)\n\t {\n\t $bytes = number_format($bytes / 1073741824, 2) . ' GB';\n }\n elseif ($bytes >= 1048576)\n {\n $bytes = number_format($bytes / 1048576, 2) . ' MB';\n\t }\n elseif ($bytes >= 1024)\n {\n $bytes = number_format($bytes / 1024, 2) . ' KB';\n }\n elseif ($bytes > 1)\n {\n $bytes = $bytes . ' bytes';\n }\n\t elseif ($bytes == 1)\n {\n\t $bytes = $bytes . ' byte';\n }\n else\n {\n $bytes = '0 bytes';\n\t }\n\n return $bytes;\n}", "public function getFormattedSize() {\r\n\t\r\n\t $bytes = $this->getSize();\r\n\t\r\n\t if ($bytes >= 1073741824)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1073741824, 2) . ' GB';\r\n\t }\r\n\t elseif ($bytes >= 1048576)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1048576, 2) . ' MB';\r\n\t }\r\n\t elseif ($bytes >= 1024)\r\n\t {\r\n\t\t$bytes = number_format($bytes / 1024, 2) . ' KB';\r\n\t }\r\n\t elseif ($bytes > 1)\r\n\t {\r\n\t\t$bytes = $bytes . ' bytes';\r\n\t }\r\n\t elseif ($bytes == 1)\r\n\t {\r\n\t\t$bytes = $bytes . ' byte';\r\n\t }\r\n\t else\r\n\t {\r\n\t\t$bytes = '0 bytes';\r\n\t }\r\n\r\n\t return $bytes;\r\n\t \r\n }", "function human_filesize($bytes, $decimals = 0)\n{\n $size = ['B','KB','MB','GB','TB','PB','EB','ZB','YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n}", "public function formatBytes(int $bytes, int $precision = 2) : string {\n $base = log($bytes, 1024);\n $suffixes = ['', 'KB', 'MB', 'GB', 'TB'];\n return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[(int) floor($base)];\n }", "function humanize_filesize($bytes, $dec = 2)\n{\n $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n\n return sprintf(\"%.{$dec}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n}", "function fileOfSize($size, $precision = 2)\n{\n if ($size >= 1099511627776) return round(($size / 1099511627776 * 100) / 100, $precision) . ' To';\n if ($size >= 1073741824) return round(($size / 1073741824 * 100) / 100, $precision) . ' Go';\n if ($size >= 1048576) return round(($size / 1048576 * 100) / 100, $precision) . ' Mo';\n if ($size >= 1024) return round(($size / 1024 * 100) / 100, $precision) . ' Ko';\n if ($size > 0) return $size . ' o';\n return '-';\n}", "public static function toDataSizeString($size, $scale = 1024, $unit = 'oct', $kilo = 'Ko', $mega = 'Mo', $giga = 'Go', $tera = 'To') {\r\n if ($size < $scale) {\r\n return $size . ' ' . $unit;\r\n } elseif ($size < ($scale * $scale)) {\r\n return sprintf('%01.2f ' . $kilo, $size / $scale);\r\n } elseif ($size < ($scale * $scale * $scale)) {\r\n return sprintf('%01.2f ' . $mega, $size / ($scale * $scale));\r\n } elseif ($size < ($scale * $scale * $scale * $scale)) {\r\n return sprintf('%01.2f ' . $giga, $size / ($scale * $scale * $scale));\r\n }\r\n return sprintf('%01.2f ' . $tera, $size / ($scale * $scale * $scale * $scale));\r\n }", "function format_gigabytes($gigabytes)\n{\n if ($gigabytes >= 1000) {\n return Metric::gigabytes($gigabytes)->format('Tb/');\n } else {\n return Metric::gigabytes($gigabytes)->format('GB/');\n }\n}", "function show_bytes($bytes)\n{\n if ($bytes > 1073741824)\n {\n $gb = $bytes/1073741824;\n $str = sprintf($gb>=10 ? \"%d \" : \"%.1f \", $gb) . crystal_label('GB');\n }\n else if ($bytes > 1048576)\n {\n $mb = $bytes/1048576;\n $str = sprintf($mb>=10 ? \"%d \" : \"%.1f \", $mb) . crystal_label('MB');\n }\n else if ($bytes > 1024)\n $str = sprintf(\"%d \", round($bytes/1024)) . crystal_label('KB');\n else\n $str = sprintf('%d ', $bytes) . crystal_label('B');\n\n return $str;\n}", "function FormatSizeDisplay($fileSizeInfo, $precision = 2)\n\t{\n\t\t\t// $this->fileSizeDisplay .= $fileSizeInfo.\" (bytes)\" ;\n\t\t// elseif ($fileSizeInfo >= 1024 && $fileSizeInfo < 1<<20)\n\t\t\t// $this->fileSizeDisplay = number_format($fileSizeInfo/1024,2,\".\",\"\").\" (Kb)\";\n\t\t// elseif ($fileSizeInfo >= 1<<20)\n\t\t\t// $this->fileSizeDisplay = number_format($fileSizeInfo/(1<<20),2,\".\",\"\").\" (Mb)\";\n\t\t\t\n\t\tif ($fileSizeInfo < 1000000)\n\t\t\t$fileSizeDisplay = number_format($fileSizeInfo/1000, $precision,\".\",\"\").\" Kb\";\n\t\telse\n\t\t\t$fileSizeDisplay = number_format($fileSizeInfo/1000000, $precision,\".\",\"\").\" Mb\";\n\t\t\t\n\t\treturn $fileSizeDisplay;\n\t}", "private function getSizeFormattedExact(int $size): string\n {\n if ($size > 1024 * 1024) {\n return sprintf('%0.2f MiB', ($size / 1024 / 1024));\n }\n if ($size > 1024) {\n return sprintf('%0.2f KiB', ($size / 1024));\n }\n\n return $size . ' B';\n }", "function tmpl_let_to_num( $size ) {\r\n\t\t$l = substr( $size, -1 );\r\n\t\t$ret = substr( $size, 0, -1 );\r\n\t\tswitch ( strtoupper( $l ) ) {\r\n\t\t\tcase 'P':\r\n\t\t\t\t$ret *= 1024;\r\n\t\t\tcase 'T':\r\n\t\t\t\t$ret *= 1024;\r\n\t\t\tcase 'G':\r\n\t\t\t\t$ret *= 1024;\r\n\t\t\tcase 'M':\r\n\t\t\t\t$ret *= 1024;\r\n\t\t\tcase 'K':\r\n\t\t\t\t$ret *= 1024;\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "function sizetobytes($size,$reverse=false) {\n\t\t//UNITS TO BYTES\n\t\tif(!$reverse) {\n\t\t\t$unit = strtolower($size);\n\t\t\t$unit = preg_replace('/[^a-z]/', '', $unit);\n\t\t\t$value = intval(preg_replace('/[^0-9]/', '', $size));\n\t\t\t$units = array('b'=>0, 'kb'=>1, 'mb'=>2, 'gb'=>3, 'tb'=>4);\n\t\t\t$exponent = isset($units[$unit]) ? $units[$unit] : 0;\n\t\t\treturn ($value * pow(1024, $exponent)); \n\t\t} \n\t\t//BYTES TO UNITS\n if ($size >= 1073741824) {\n $size = number_format($size / 1073741824, 2).' gb';\n } elseif ($size >= 1048576) {\n $size = number_format($size / 1048576, 2).' mb';\n } elseif ($size >= 1024) {\n $size = number_format($size / 1024, 2).' kb';\n } elseif ($size > 1) {\n $size = $size.' bytes';\n } elseif ($size == 1) {\n $size = $size.' byte';\n } else {\n $size = '0 bytes';\n }\n\n return $size;\n\t}", "function formatBytes($bytes, $precision = 2) { \n $units = array('B', 'KB', 'MB', 'GB', 'TB'); \n $bytes = max($bytes, 0); \n $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); \n $pow = min($pow, count($units) - 1); \n $bytes /= pow(1024, $pow); \n return round($bytes, $precision) . ' ' . $units[$pow]; \n }", "public function getSize(): string\n {\n $B = 1;\n $KB = $B * 1024;\n $MB = $KB * 1024;\n $GB = $MB * 1024;\n\n $bytes = filesize($this->filePath);\n\n $units = match (true)\n {\n $bytes >= $GB => ['suffix' => 'GiB', 'base' => $GB, 'css' => 'text-dark'],\n $bytes >= $MB => ['suffix' => 'MiB', 'base' => $MB, 'css' => 'text-light'],\n $bytes >= $KB => ['suffix' => 'KiB', 'base' => $KB, 'css' => 'text-muted'],\n default => ['suffix' => 'B', 'base' => $B, 'css' => 'text-danger']\n };\n\n return sprintf('%.3f', $bytes / $units['base']) . $units['suffix'];\n }", "function getFilesizeString(float $size, int $decPoint = 2, bool $upperCase = false, string $separator = '')\n{\n\t$unitScale = ['byte', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb'];\n\t$unit = 'byte';\n\t$scale = 0;\n\t$decPoint = ($decPoint < 1) ? 0 : $decPoint;\n\n\twhile ($size >= 1024 && isset($unitScale[$scale + 1])) {\n\t\t$size /= 1024;\n\t\t$unit = $unitScale[++$scale];\n\t}\n\n\t$size = ($decPoint) ? number_format($size, $decPoint) : (int) $size;\n\n\tif ($upperCase) {\n\t\t$unit = strtoupper($unit);\n\t}\n\n\treturn $size . $separator . $unit;\n}", "function human_filesize($size, $precision = 2) {\n $units = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');\n $step = 1024;\n $i = 0;\n while (($size / $step) > 0.9) {\n $size = $size / $step;\n $i++;\n }\n return round($size, $precision).$units[$i];\n}", "function convertPHPSizeToBytes($sSize)\n{\n\tif (is_numeric($sSize)) {\n\t\treturn $sSize;\n\t}\n\t$sSuffix = substr($sSize, -1);\n\t$iValue = substr($sSize, 0, -1);\n\tswitch (strtoupper($sSuffix)) {\n\t\tcase 'P':\n\t\t\t$iValue *= 1024;\n\t\tcase 'T':\n\t\t\t$iValue *= 1024;\n\t\tcase 'G':\n\t\t\t$iValue *= 1024;\n\t\tcase 'M':\n\t\t\t$iValue *= 1024;\n\t\tcase 'K':\n\t\t\t$iValue *= 1024;\n\t\t\tbreak;\n\t}\n\treturn $iValue;\n}", "protected function formatBytes($bytes)\n {\n $size = (integer) $bytes;\n\n if ( ! $this->useFormatting) {\n return $size;\n }\n\n $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n\n return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $units[$i];\n }", "static public function getLiteralSizeFormat($bytes)\n {\n if (!$bytes) {\n return false;\n }\n\n $exp = floor(log($bytes, 1024));\n\n switch ($exp) {\n case 0: // bytes\n $suffix = ' bytes';\n break;\n\n case 1: // KB\n $suffix = ' KB';\n break;\n\n case 2: // MB\n $suffix = ' MB';\n break;\n\n case 3: // GB\n $suffix = ' GB';\n break;\n }\n\n return round(($bytes / pow(1024, $exp)), 1).$suffix;\n }", "function formatBytes($bytes, $precision = 2) {\n $bytes = round($bytes, 0);\n\n $units = array('B', 'KB', 'MB', 'GB', 'TB');\n $short_units = array('B', 'K', 'M', 'G', 'T');\n\n // Don't allow minus bytes\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1000));\n $pow = min($pow, count($units) - 1);\n\n // Adjust the bytes to MB, GB, etc\n $bytes /= pow(1000, $pow);\n\n // If we're using TB then allow for one more DP\n if ($pow == 4) $precision += 1;\n\n // Format it to the correct dp\n $number = number_format($bytes, $precision);\n\n return $number . $short_units[$pow];\n}", "function file_size($size)\r\n\r\n{\r\n\r\n\t$units = array('b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb');\r\n\r\n\r\n\r\n\tfor ($i = 0; $size > 1024; $i++)\r\n\r\n\t\t$size /= 1024;\r\n\r\n\r\n\r\n\treturn round($size, 2).' '.$units[$i];\r\n\r\n}", "private static function toFormattedBytes(int $bytes) : string\n {\n $precision = 2;\n $base = log($bytes, 1024);\n $suffixes = array('', 'K', 'M', 'G', 'T');\n\n return round(1024 ** ($base - floor($base)), $precision) . $suffixes[floor($base)];\n }", "function human_filesize($bytes, $decimals = 2, $decimalSeparator = null, $thousandSeparator = null)\n{\n $decimalSeparator = $decimalSeparator ?? (localeconv()['decimal_point'] ?? '.');\n $thousandSeparator = $thousandSeparator ?? (localeconv()['thousands_sep'] ?? ',');\n $size = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');\n $factor = min(floor((strlen($bytes) - 1) / 3), count($size) - 1);\n return number_format($bytes / pow(1024, $factor), $decimals, $decimalSeparator, $thousandSeparator) . $size[$factor];\n}", "function humanFileSize($size,$unit=\"\") \n {\n if( (!$unit && $size >= 1<<30) || $unit == \"GB\")\n return number_format($size/(1<<30),2).\"GB\";\n if( (!$unit && $size >= 1<<20) || $unit == \"MB\")\n return number_format($size/(1<<20),2).\"MB\";\n if( (!$unit && $size >= 1<<10) || $unit == \"KB\")\n return number_format($size/(1<<10),2).\"KB\";\n return number_format($size).\" bytes\";\n }", "public static function formatFromInt($byte, $size) {}", "function human_filesize($bytes, $decimals = 2) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$sz[$factor];\n}", "function size_tobytes(&$size, $onerror) {\n \t $arr_uploaded = explode(' ', $size); //[0] nr [1] mb/gb/tb\n \t if (count($arr_uploaded) != 2 || !is_numeric($arr_uploaded[0]) || $arr_uploaded[0] <= 0 || strlen($arr_uploaded[1]) != 2) return $onerror;\n \t $amount = $arr_uploaded[0];\n \t $masure = $arr_uploaded[1];\n \t if ($masure == 'MB') return ceil($amount * 1048576);\n \t if ($masure == 'GB') return ceil($amount * 1073741824);\n \t if ($masure == 'TB') return ceil($amount * 1099511627776);\n \t return $onerror;\n }", "function format_megabytes($megabytes)\n{\n if ($megabytes >= 1000) {\n return $megabytes / 1000 . 'GB';\n }\n\n if ($megabytes >= 1000000) {\n return $megabytes / 1000000 . 'TB';\n }\n\n return $megabytes . 'MB';\n}", "function large_images_human_filesize($bytes, $decimals = 2) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$sz[$factor];\n}", "function formatBytes($bytes, int $precision = 2): string\n {\n $units = array('B', 'KB', 'MB', 'GB', 'TB');\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n $bytes /= pow(1024, $pow);\n return round($bytes, $precision) . ' ' . $units[$pow];\n }", "public function formatBytes($bytes) {\n // JEDEC memory standard\n $units = array(\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\");\n\n // 0 bytes - doh!\n if ($bytes == 0) {\n return $bytes . \" \" . $units[0];\n }\n\n // Temporary value\n $i = (int)\\floor(\\log($bytes) / \\log(1024));\n\n // Return space usage in good format + prefix\n return \\round($bytes / \\pow(1024, $i), 2) . \" \" . $units[$i];\n }", "public function size($size)\n {\n $kb = 1024;\n $mb = 1048576;\n $gb = 1073741824;\n $tb = 1099511627776;\n if (!$size) {\n return '0 B';\n } elseif ($size < $kb) {\n return $size.' B';\n } elseif ($size < $mb) {\n return round($size / $kb, 2).' KB';\n } elseif ($size < $gb) {\n return round($size / $mb, 2).' MB';\n } elseif ($size < $tb) {\n return round($size / $gb, 2).' GB';\n } else {\n return round($size / $tb, 2).' TB';\n }\n }", "function file_size_nice($size) {\n\t// Adapted from: http://www.php.net/manual/en/function.filesize.php\n\n\t$mod = 1024;\n\n\t$units = explode(' ', 'B KB MB GB TB PB');\n\tfor ($i = 0; $size > $mod; $i++) {\n\t\t$size /= $mod;\n\t}\n\n\treturn round($size, 2) . ' ' . $units[$i];\n}", "function PMA_formatByteDown($value, $limes = 6, $comma = 0)\r\n{\r\n $dh = pow(10, $comma);\r\n $li = pow(10, $limes);\r\n $return_value = $value;\r\n $unit = $byteunits[0];\r\n\t$byteunits = array('Byte', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');\r\n\t$number_thousands_separator = ',';\r\n\t$number_decimal_separator = '.';\r\n\r\n for ( $d = 6, $ex = 15; $d >= 1; $d--, $ex-=3 ) {\r\n if (isset($byteunits[$d]) && $value >= $li * pow(10, $ex)) {\r\n $value = round($value / ( pow(1024, $d) / $dh) ) /$dh;\r\n $unit = $byteunits[$d];\r\n break 1;\r\n } // end if\r\n } // end for\r\n\r\n if ($unit != $byteunits[0]) {\r\n $return_value = number_format($value, $comma, $number_decimal_separator, $number_thousands_separator);\r\n } else {\r\n $return_value = number_format($value, 0, $number_decimal_separator, $number_thousands_separator);\r\n }\r\n\r\n return array($return_value, $unit);\r\n}", "public function bytesToShorthand($nbrOfBytes, $lang = 'en')\n\t{\n\t\t$modifier = '';\n\t\t$nbrOfBytes = (int)$nbrOfBytes;\n\n\t\t// Test if the number of bytes is a power of 2\n\t\t// If it is, create a shorthand version\n\t\tif ((($nbrOfBytes & ($nbrOfBytes - 1)) == 0)) {\n\t\t\t$temp_nbr = $nbrOfBytes;\n\n\t\t\tif ($temp_nbr >= 1024) {\n\t\t\t\t$temp_nbr = $temp_nbr / 1024;\n\t\t\t\t$modifier = ' K';\n\t\t\t}\n\n\t\t\tif ($temp_nbr >= 1024) {\n\t\t\t\t$temp_nbr = $temp_nbr / 1024;\n\t\t\t\t$modifier = ' M';\n\t\t\t}\n\n\t\t\tif ($temp_nbr >= 1024) {\n\t\t\t\t$temp_nbr = $temp_nbr / 1024;\n\t\t\t\t$modifier = ' G';\n\t\t\t}\n\t\t} else {\n\t\t\t$temp_nbr = number_format($nbrOfBytes) . ' ';\n\t\t}\n\n\t\tif ($lang == 'fr') {\n\t\t\t$modifier .= 'o';\n\t\t}\n\t\telse {\n\t\t\t$modifier .= 'B';\n\t\t}\n\n\t\treturn $temp_nbr . $modifier;\n\t}", "function iu_format_number($input){\n\t$suffixes = array('', 'k', 'M', 'B');\n\t$suffixIndex = 0;\n\n\twhile(abs($input) >= 1000 && $suffixIndex < sizeof($suffixes)){\n\t\t$suffixIndex++;\n\t\t$input /= 1000;\n\t}\n\treturn round(floatval($input / pow(10, 0)),1).$suffixes[$suffixIndex];\n}", "private function formatByteCount($bytes, $precision = 2) {\n\t\t$units = array('bytes', 'KiB', 'MiB', 'GiB', 'TiB'); //SI units.\n\n\t\t$bytes = max($bytes, 0);\n\t\t$pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n\t\t$pow = min($pow, count($units) - 1);\n\n\t\t$size = $bytes / pow(1024, $pow);\n\n\t\treturn round($size, $precision) . ' ' . $units[$pow];\n\t}" ]
[ "0.77128875", "0.75418514", "0.7418545", "0.7368076", "0.73188466", "0.7284241", "0.72248864", "0.7171169", "0.7120543", "0.7052944", "0.70425916", "0.70243794", "0.7023063", "0.7014354", "0.6953958", "0.69018984", "0.6892875", "0.6864247", "0.6856254", "0.68415886", "0.6835107", "0.681936", "0.6807457", "0.6788403", "0.6766717", "0.6765908", "0.6728192", "0.66645646", "0.6651738", "0.66353685", "0.66098684", "0.6601741", "0.6544763", "0.6543752", "0.65324813", "0.6524022", "0.64978886", "0.64953953", "0.64915967", "0.646427", "0.64430016", "0.6436", "0.6432587", "0.6410523", "0.64071333", "0.638963", "0.63705975", "0.63340694", "0.6332606", "0.6304991", "0.62994814", "0.6295949", "0.6285732", "0.6282345", "0.6241096", "0.62315434", "0.6218332", "0.61995006", "0.6156655", "0.6153994", "0.6147642", "0.6147232", "0.6146574", "0.6125789", "0.6125162", "0.61026525", "0.609207", "0.6089269", "0.60892165", "0.60892075", "0.60768455", "0.60708696", "0.6066169", "0.60522896", "0.60519457", "0.6051364", "0.60466313", "0.6046151", "0.6042672", "0.6035", "0.6021562", "0.6014561", "0.6009843", "0.6002005", "0.5997301", "0.5989178", "0.59875095", "0.5986529", "0.5977842", "0.59742254", "0.59582794", "0.5949945", "0.59337306", "0.59285545", "0.5926017", "0.5925971", "0.59210414", "0.5921", "0.5905159", "0.587959", "0.5860022" ]
0.0
-1
Converts numbers to a more readable representation when dealing with very large numbers (in the thousands or above), up to the quadrillions, because you won't often deal with numbers larger than that. It uses the "short form" numbering system as this is most commonly used within most Englishspeaking countries today.
function number_to_amount($num, int $precision = 0, ?string $locale = null) { // Strip any formatting & ensure numeric input try { // @phpstan-ignore-next-line $num = 0 + str_replace(',', '', $num); } catch (ErrorException $ee) { return false; } $suffix = ''; // ignore sub part $generalLocale = $locale; if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) { $generalLocale = substr($locale, 0, $underscorePos); } if ($num >= 1_000_000_000_000_000) { $suffix = lang('Number.quadrillion', [], $generalLocale); $num = round(($num / 1_000_000_000_000_000), $precision); } elseif ($num >= 1_000_000_000_000) { $suffix = lang('Number.trillion', [], $generalLocale); $num = round(($num / 1_000_000_000_000), $precision); } elseif ($num >= 1_000_000_000) { $suffix = lang('Number.billion', [], $generalLocale); $num = round(($num / 1_000_000_000), $precision); } elseif ($num >= 1_000_000) { $suffix = lang('Number.million', [], $generalLocale); $num = round(($num / 1_000_000), $precision); } elseif ($num >= 1000) { $suffix = lang('Number.thousand', [], $generalLocale); $num = round(($num / 1000), $precision); } return format_number($num, $precision, $locale, ['after' => $suffix]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_number($number) \n{ \n if (($number < 0) || ($number > 999999999)) \n { \n echo \"Number is out of range\";\n } \n\n \t//$Gn = floor($number / 1000000); /* Millions (giga) */ \n //$number -= $Gn * 1000000; \n\n $Gn = floor($number / 100000); /* Lakhs (giga) */ \n $number -= $Gn * 100000; \n $kn = floor($number / 1000); /* Thousands (kilo) */ \n $number -= $kn * 1000; \n $Hn = floor($number / 100); /* Hundreds (hecto) */ \n $number -= $Hn * 100; \n $Dn = floor($number / 10); /* Tens (deca) */ \n $n = $number % 10; /* Ones */ \n\n $res = \"\"; \n\n /*if ($Gn) \n { \n $res .= convert_number($Gn) . \" Millions\"; \n } */\n\n\tif ($Gn) \n { \n $res .= convert_number($Gn) . \" Lakhs\"; \n } \n\n if ($kn) \n { \n $res .= (empty($res) ? \"\" : \" \") . \n convert_number($kn) . \" Thousand\"; \n } \n\n if ($Hn) \n { \n $res .= (empty($res) ? \"\" : \" \") . \n convert_number($Hn) . \" Hundred\"; \n } \n\n $ones = array(\"\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \n \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Eleven\", \"Twelve\", \"Thirteen\", \n \"Fourteen\", \"Fifteen\", \"Sixteen\", \"Seventeen\", \"Eightteen\", \n \"Nineteen\"); \n $tens = array(\"\", \"\", \"Twenty\", \"Thirty\", \"Fourty\", \"Fifty\", \"Sixty\", \n \"Seventy\", \"Eigthy\", \"Ninety\"); \n\n if ($Dn || $n) \n { \n if (!empty($res)) \n { \n $res .= \" and \"; \n } \n\n if ($Dn < 2) \n { \n $res .= $ones[$Dn * 10 + $n]; \n } \n else \n { \n $res .= $tens[$Dn]; \n\n if ($n) \n { \n $res .= \"-\" . $ones[$n]; \n } \n } \n } \n\n if (empty($res)) \n { \n $res = \"zero\"; \n } \n\n return $res; \n}", "function number_format_huge($n)\n {\n if ($n>pow(10, 100)) {\n return round(($n/pow(10, 100)), 1).' googol';\n }\n // I'll add more later\n if ($n>pow(1000, 32)) {\n return round(($n/pow(1000, 32)), 1).' untrigintillion';\n }\n if ($n>pow(1000, 31)) {\n return round(($n/pow(1000, 31)), 1).' trigintillion';\n }\n if ($n>pow(1000, 30)) {\n return round(($n/pow(1000, 30)), 1).' novemvigintillion';\n }\n if ($n>pow(1000, 29)) {\n return round(($n/pow(1000, 29)), 1).' octovigintillion';\n }\n if ($n>pow(1000, 28)) {\n return round(($n/pow(1000, 28)), 1).' septenvigintillion';\n }\n if ($n>pow(1000, 27)) {\n return round(($n/pow(1000, 27)), 1).' sexvigintillion';\n }\n if ($n>pow(1000, 26)) {\n return round(($n/pow(1000, 26)), 1).' quinvigintillion';\n }\n if ($n>pow(1000, 25)) {\n return round(($n/pow(1000, 25)), 1).' quattuorvigintillion';\n }\n if ($n>pow(1000, 24)) {\n return round(($n/pow(1000, 24)), 1).' trevigintillion';\n }\n if ($n>pow(1000, 23)) {\n return round(($n/pow(1000, 23)), 1).' duovigintillion';\n }\n if ($n>pow(1000, 22)) {\n return round(($n/pow(1000, 22)), 1).' unvigintillion';\n }\n if ($n>pow(1000, 21)) {\n return round(($n/pow(1000, 21)), 1).' vigintillion';\n }\n if ($n>pow(1000, 20)) {\n return round(($n/pow(1000, 20)), 1).' novemdecillion';\n }\n if ($n>pow(1000, 19)) {\n return round(($n/pow(1000, 19)), 1).' octodecillion';\n }\n if ($n>pow(1000, 18)) {\n return round(($n/pow(1000, 18)), 1).' septendecillion';\n }\n if ($n>pow(1000, 17)) {\n return round(($n/pow(1000, 17)), 1).' sexdecillion';\n }\n if ($n>pow(1000, 16)) {\n return round(($n/pow(1000, 16)), 1).' quindecillion';\n }\n if ($n>pow(1000, 15)) {\n return round(($n/pow(1000, 15)), 1).' quattuordecillion';\n }\n if ($n>pow(1000, 14)) {\n return round(($n/pow(1000, 14)), 1).' tredecillion';\n }\n if ($n>pow(1000, 13)) {\n return round(($n/pow(1000, 13)), 1).' duodecillion';\n }\n if ($n>pow(1000, 12)) {\n return round(($n/pow(1000, 12)), 1).' undecillion';\n }\n if ($n>pow(1000, 11)) {\n return round(($n/pow(1000, 11)), 1).' decillion';\n }\n if ($n>pow(1000, 10)) {\n return round(($n/pow(1000, 10)), 1).' nonillion';\n }\n if ($n>pow(1000, 9)) {\n return round(($n/pow(1000, 9)), 1).' octillion';\n }\n if ($n>pow(1000, 8)) {\n return round(($n/pow(1000, 8)), 1).' septillion';\n }\n if ($n>pow(1000, 7)) {\n return round(($n/pow(1000, 7)), 1).' sextillion';\n }\n if ($n>pow(1000, 6)) {\n return round(($n/pow(1000, 6)), 1).' quintillion';\n }\n if ($n>pow(1000, 5)) {\n return round(($n/pow(1000, 5)), 1).' quadrillion';\n }\n if ($n>pow(1000, 4)) {\n return round(($n/pow(1000, 4)), 1).' trillion';\n }\n if ($n>pow(1000, 3)) {\n return round(($n/pow(1000, 3)), 1).' billion';\n }\n if ($n>1000000) {\n return round(($n/1000000), 1).' million';\n }\n if ($n>1000) {\n return number_format($n);\n }\n }", "function num_to_short($num)\n{\n\tif (is_float($num))\n\t\t$num = round($num);\n\t\n\tif ($num >= 1000) {\n\t\t$i = 1000;\n\t\twhile ($num >= $i) {\n\t\t\t$return = ($i/1000). \"K\";\n\t\t\t\n\t\t\tif ($num > $i)\n\t\t\t\t$return .= \"+\";\n\t\t\t\n\t\t\t$i += 1000;\n\t\t}\n\t} else\n\t\t$return = $num;\n\t\n\treturn $return;\n}", "function number_format_short( $n, $precision = 1 ) {\r\n\tif ($n < 900) {\r\n\t\t// 0 - 900\r\n\t\t$n_format = number_format($n, $precision);\r\n\t\t$suffix = '';\r\n\t} else if ($n < 900000) {\r\n\t\t// 0.9k-850k\r\n\t\t$n_format = number_format($n / 1000, $precision);\r\n\t\t$suffix = 'K';\r\n\t} else if ($n < 900000000) {\r\n\t\t// 0.9m-850m\r\n\t\t$n_format = number_format($n / 1000000, $precision);\r\n\t\t$suffix = 'M';\r\n\t} else if ($n < 900000000000) {\r\n\t\t// 0.9b-850b\r\n\t\t$n_format = number_format($n / 1000000000, $precision);\r\n\t\t$suffix = 'B';\r\n\t} else {\r\n\t\t// 0.9t+\r\n\t\t$n_format = number_format($n / 1000000000000, $precision);\r\n\t\t$suffix = 'T';\r\n\t}\r\n\t// Remove unecessary zeroes after decimal. \"1.0\" -> \"1\"; \"1.00\" -> \"1\"\r\n\t// Intentionally does not affect partials, eg \"1.50\" -> \"1.50\"\r\n\tif ( $precision > 0 ) {\r\n\t\t$dotzero = '.' . str_repeat( '0', $precision );\r\n\t\t$n_format = str_replace( $dotzero, '', $n_format );\r\n\t}\r\n\treturn $n_format . $suffix;\r\n}", "function bd_nice_number($n) {\n // Strip any formatting;\n $n = (0+str_replace(\",\",\"\",$n));\n \n // Check if it's a num\n if(!is_numeric($n)) return false;\n \n // Filter through trillions, billions, and millions\n if($n>1000000000000) return round(($n/1000000000000),2).'T';\n else if($n>1000000000) return round(($n/1000000000),2).'B';\n else if($n>1000000) return round(($n/1000000),2).'M';\n \n return number_format($n);\n}", "public function nice_number($n) {\r\n $n = (0+str_replace(\",\", \"\", $n));\r\n\r\n // is this a number?\r\n if (!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).' T'; //trillion\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).' B'; //billion\r\n elseif ($n > 1000000) return round(($n/1000000), 2).' M';//million\r\n elseif ($n > 1000) return round(($n/1000), 2).' TH'; //thousand\r\n\r\n return number_format($n);\r\n}", "function num2words($num, $c=0) {\n $ZERO = 'zero';\n $MINUS = 'minus';\n $lowName = array(\n /* zero is shown as \"\" since it is never used in combined forms */\n /* 0 .. 19 */\n \"\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\",\n \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\",\n \"Eleven\", \"Twelve\", \"Thirteen\", \"Fourteen\", \"Fifteen\",\n \"Sixteen\", \"Seventeen\", \"Eighteen\", \"Nineteen\");\n \n $tys = array(\n /* 0, 10, 20, 30 ... 90 */\n \"\", \"\", \"Twenty\", \"Thirty\", \"Forty\", \"Fifty\",\n \"Sixty\", \"Seventy\", \"Eighty\", \"Ninety\");\n \n $groupName = array(\n /* We only need up to a quintillion, since a long is about 9 * 10 ^ 18 */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n \"\", \"Hundred\", \"Thousand\", \"Million\", \"Billion\",\n \"Trillion\", \"Quadrillion\", \"Quintillion\");\n \n $divisor = array(\n /* How many of this group is needed to form one of the succeeding group. */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n 100, 10, 1000, 1000, 1000, 1000, 1000, 1000) ;\n \n $num = str_replace(\",\",\"\",$num);\n $num = number_format($num,2,'.','');\n $cents = substr($num,strlen($num)-2,strlen($num)-1);\n $num = (int)$num;\n \n $s = \"\";\n \n if ( $num == 0 ) $s = $ZERO;\n $negative = ($num < 0 );\n if ( $negative ) $num = -$num;\n // Work least significant digit to most, right to left.\n // until high order part is all 0s.\n for ( $i=0; $num>0; $i++ ) {\n $remdr = (int)($num % $divisor[$i]);\n $num = $num / $divisor[$i];\n // check for 1100 .. 1999, 2100..2999, ... 5200..5999\n // but not 1000..1099, 2000..2099, ...\n // Special case written as fifty-nine hundred.\n // e.g. thousands digit is 1..5 and hundreds digit is 1..9\n // Only when no further higher order.\n if ( $i == 1 /* doing hundreds */ && 1 <= $num && $num <= 5 ){\n if ( $remdr > 0 ){\n $remdr = ($num * 10);\n $num = 0;\n } // end if\n } // end if\n if ( $remdr == 0 ){\n continue;\n }\n $t = \"\";\n if ( $remdr < 20 ){\n $t = $lowName[$remdr];\n }\n else if ( $remdr < 100 ){\n $units = (int)$remdr % 10;\n $tens = (int)$remdr / 10;\n $t = $tys [$tens];\n if ( $units != 0 ){\n $t .= \"-\" . $lowName[$units];\n }\n }else {\n $t = num2words($remdr, 0);\n }\n $s = $t.\" \".$groupName[$i].\" \".$s;\n $num = (int)$num;\n } // end for\n $s = trim($s);\n if ( $negative ){\n $s = $MINUS . \" \" . $s;\n }\n \n if ($c == 1) $s .= \" and $cents/100\";\n \n return $s;\n}", "function nice_number( $n ) {\n\t$n = (0 + str_replace( ',', '', $n ) );\n\t// is this a number? (o yes, almost certain - but...)\n\tif ( ! is_numeric( $n ) ) return false;\n\t// now filter it;\n\tif ( $n > 1000000000000 ) return round( ($n / 1000000000000), 1 ) . 't';\n\telse if ( $n > 1000000000 ) return round( ($n / 1000000000), 1 ) . 'b';\n\telse if ( $n > 1000000 ) return round( ($n / 1000000), 1 ) . 'm';\n\telse if ( $n > 1000 ) return round( ($n / 1000), 1 ) . 'k';\n\treturn number_format( $n );\n}", "function convert_number($n) {\r\r\n if($n != ''){\r\r\n $n = (0+str_replace(\",\", \"\", $n));\r\r\n }\r\r\n\r\r\n //if (!is_numeric($n)) return false;\r\r\n\r\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).'T';\r\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).'B';\r\r\n elseif ($n > 1000000) return round(($n/1000000), 2).'M';\r\r\n elseif ($n > 1000) return round(($n/1000), 2).'Th';\r\r\n \r\r\n return number_format($n);\r\r\n }", "function numtowords($num)\n{\n\t$ones = array(\n\t1 => \"one\",\n\t2 => \"two\",\n\t3 => \"three\",\n\t4 => \"four\",\n\t5 => \"five\",\n\t6 => \"six\",\n\t7 => \"seven\",\n\t8 => \"eight\",\n\t9 => \"nine\",\n\t10 => \"ten\",\n\t11 => \"eleven\",\n\t12 => \"twelve\",\n\t13 => \"thirteen\",\n\t14 => \"fourteen\",\n\t15 => \"fifteen\",\n\t16 => \"sixteen\",\n\t17 => \"seventeen\",\n\t18 => \"eighteen\",\n\t19 => \"nineteen\"\n\t);\n\t$tens = array(\n\t2 => \"twenty\",\n\t3 => \"thirty\",\n\t4 => \"forty\",\n\t5 => \"fifty\",\n\t6 => \"sixty\",\n\t7 => \"seventy\",\n\t8 => \"eighty\",\n\t9 => \"ninety\"\n\t);\n\t$hundreds = array(\n\t\"hundred\",\n\t\"thousand\",\n\t\"million\",\n\t\"billion\",\n\t\"trillion\",\n\t\"quadrillion\"\n\t); //limit t quadrillion\n\t$num = number_format($num,2,\".\",\",\");\n\t$num_arr = explode(\".\",$num);\n\t$wholenum = $num_arr[0];\n\t$decnum = $num_arr[1];\n\t$whole_arr = array_reverse(explode(\",\",$wholenum));\n\tkrsort($whole_arr);\n\t$rettxt = \"\";\n\tforeach($whole_arr as $key => $i)\n\t{\n\t\tif($i < 20)\n\t\t{\n\t\t\t$rettxt .= $ones[$i];\n\t\t}\n\t\telseif($i < 100)\n\t\t{\n\t\t\t$rettxt .= $tens[substr($i,0,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($i,1,1)];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rettxt .= $ones[substr($i,0,1)].\" \".$hundreds[0];\n\t\t\t$rettxt .= \" \".$tens[substr($i,1,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($i,2,1)];\n\t\t}\n\t\t\n\t\tif($key > 0)\n\t\t{\n\t\t\t$rettxt .= \" \".$hundreds[$key].\" \";\n\t\t}\n\t}\n\tif($decnum > 0)\n\t{\n\t\t$rettxt .= \" and \";\n\t\tif($decnum < 20)\n\t\t{\n\t\t\t$rettxt .= $ones[$decnum];\n\t\t}\n\t\telseif($decnum < 100)\n\t\t{\n\t\t\t$rettxt .= $tens[substr($decnum,0,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($decnum,1,1)];\n\t\t}\n\t}\n\treturn $rettxt;\n}", "function convertNumber($num) {\n $count = 0;\n global $ones, $tens, $triplets;\n $ones = array(\n '',\n ' One',\n ' Two',\n ' Three',\n ' Four',\n ' Five',\n ' Six',\n ' Seven',\n ' Eight',\n ' Nine',\n ' Ten',\n ' Eleven',\n ' Twelve',\n ' Thirteen',\n ' Fourteen',\n ' Fifteen',\n ' Sixteen',\n ' Seventeen',\n ' Eighteen',\n ' Nineteen'\n );\n $tens = array(\n '',\n '',\n ' Twenty',\n ' Thirty',\n ' Forty',\n ' Fifty',\n ' Sixty',\n ' Seventy',\n ' Eighty',\n ' Ninety'\n );\n\n $triplets = array(\n '',\n ' Thousand',\n ' Million',\n ' Billion',\n ' Trillion',\n ' Quadrillion',\n ' Quintillion',\n ' Sextillion',\n ' Septillion',\n ' Octillion',\n ' Nonillion'\n );\n return convertNum($num);\n}", "function nice_number($n) {\r\n // first strip any formatting;\r\n $n = (0+str_replace(\",\",\"\",$n));\r\n\r\n // is this a number?\r\n if(!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if($n>1000000000000) return round(($n/1000000000000),2).' trillion';\r\n else if($n>1000000000) return round(($n/1000000000),2).' billion';\r\n else if($n>1000000) return round(($n/1000000),2).' million';\r\n else if($n>1000) return round(($n/1000),2).' thousand';\r\n\r\n return number_format($n);\r\n}", "public function short_number($n = 0)\n {\n $n = (0 + str_replace(',', '', $n));\n\n // is this a number?\n if (!is_numeric($n)) {\n return false;\n }\n\n // now filter it;\n if ($n > 1000000000000) {\n return round(($n / 1000000000000), 2).'t';\n } elseif ($n > 1000000000) {\n return round(($n / 1000000000), 2).'b';\n } elseif ($n > 1000000) {\n return round(($n / 1000000), 2).'m';\n } elseif ($n > 1000) {\n return round(($n / 1000), 2).'k';\n }\n\n return number_format($n);\n }", "public function shortNumber($value)\n {\n $value = (0 + str_replace(',', '', $value)); // remove formatting\n if (!is_numeric($value)) {\n return false; // require number\n }\n $t = ($value / 1000000000000); // trillion\n $b = ($value / 1000000000); // billions\n $m = ($value / 1000000); // millions\n $k = ($value / 1000); // thousands\n if ($t >= 1) {\n if (is_float($t) && $t < 100) {\n return round($t, 1) . 'T';\n }\n return round($t) . 'T';\n } else if ($b >= 1) {\n if (is_float($b) && $b < 100) {\n return round($b, 1) . 'B';\n }\n return round($b) . 'B';\n } else if ($m >= 1) {\n if (is_float($m) && $m < 100) {\n return round($m, 1) . 'M';\n }\n return round($m) . 'M';\n } else if ($k >= 1) {\n if (is_float($k) && $k < 100) {\n return round($k, 1) . 'k';\n }\n return round($k) . 'k';\n }\n return is_float($value) ? number_format($value, 2) : number_format($value);\n }", "function convertNumberToWord($num = false)\n{\n $num = str_replace(array(',', ' '), '' , trim($num));\n if(! $num) {\n return false;\n }\n $num = (int) $num;\n $words = array();\n $list1 = array('', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',\n 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'\n );\n $list2 = array('', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred');\n $list3 = array('', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',\n 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',\n 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'\n );\n $num_length = strlen($num);\n $levels = (int) (($num_length + 2) / 3);\n $max_length = $levels * 3;\n $num = substr('00' . $num, -$max_length);\n $num_levels = str_split($num, 3);\n for ($i = 0; $i < count($num_levels); $i++) {\n $levels--;\n $hundreds = (int) ($num_levels[$i] / 100);\n $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ( $hundreds == 1 ? '' : 's' ) . ' ' : '');\n $tens = (int) ($num_levels[$i] % 100);\n $singles = '';\n if ( $tens < 20 ) {\n $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );\n } else {\n $tens = (int)($tens / 10);\n $tens = ' ' . $list2[$tens] . ' ';\n $singles = (int) ($num_levels[$i] % 10);\n $singles = ' ' . $list1[$singles] . ' ';\n }\n $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );\n } //end for loop\n $commas = count($words);\n if ($commas > 1) {\n $commas = $commas - 1;\n }\n return implode(' ', $words);\n}", "function convertNumberToWord($num = false)\n{\n $num = str_replace(array(',', ' '), '' , trim($num));\n if(! $num) {\n return false;\n }\n $num = (int) $num;\n $words = array();\n $list1 = array('', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',\n 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'\n );\n $list2 = array('', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred');\n $list3 = array('', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',\n 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',\n 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'\n );\n $num_length = strlen($num);\n $levels = (int) (($num_length + 2) / 3);\n $max_length = $levels * 3;\n $num = substr('00' . $num, -$max_length);\n $num_levels = str_split($num, 3);\n for ($i = 0; $i < count($num_levels); $i++) {\n $levels--;\n $hundreds = (int) ($num_levels[$i] / 100);\n $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ( $hundreds == 1 ? '' : 's' ) . ' ' : '');\n $tens = (int) ($num_levels[$i] % 100);\n $singles = '';\n if ( $tens < 20 ) {\n $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );\n } else {\n $tens = (int)($tens / 10);\n $tens = ' ' . $list2[$tens] . ' ';\n $singles = (int) ($num_levels[$i] % 10);\n $singles = ' ' . $list1[$singles] . ' ';\n }\n $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );\n } //end for loop\n $commas = count($words);\n if ($commas > 1) {\n $commas = $commas - 1;\n }\n return implode(' ', $words);\n}", "private function convert_dollars($number) {\n\n //check if argument is set to avoid error\n if(isset($number)) {\n //save original int number\n $number_int = (int)$number;\n\n //extract the whole numbers only (ie. excluding the cents) and convert to a string\n $number = (string)((int)$number_int); \n }\n\n //check if number is a number\n if(ctype_digit($number)) {\n\n //stores the numbers in words grouped into lots of thousands\n $words = array();\n\n //determine the precision of the number\n $precision = strlen($number);\n\n //determine the number of levels required in the currency format (ie. levels between the commas, lots of thousands)\n //for example 1 comma has 2 levels to start off with, each level and each level includes 3 decimal precisions to left\n $levels = (int) (($precision+2)/3);\n\n //determine the absolute maximum number of precision based on the levels\n $max_precision = $levels * 3;\n\n //group the numbers into groups 3 numerical precision\n $number = substr('00'.$number , -$max_precision);\n $num_levels = str_split($number, 3); \n\n //loop through each \n foreach($num_levels as $num_part) {\n\n //extract the hundreds precision followed by tens and single\n $levels--;\n $hundreds = (int)($num_part/100);\n $hundreds = ($hundreds ? ' ' . $this->list_singles[$hundreds] . ' Hundred' . ' ' : '' );\n $tens = (int)($num_part % 100);\n $singles = '';\n\n //if number less than 20\n if($tens < 20) {\n $tens = ( $tens ? ' ' . $this->list_singles[$tens] . ' ' : '' );\n } else {\n //number is greater than 20\n $tens = (int) ( $tens / 10 );\n $tens = $this->list_tens[$tens];\n $singles = (int) ( $num_part % 10 );\n $singles = $this->list_singles[$singles];\n }\n\n //put the words together including the thousand's plus precisions\n $words[] = $hundreds . (strlen($hundreds) && strlen($tens) ? $this->conjunction : '') . $tens . (strlen($singles)? $this->hyphen : '') . $singles . (($levels && (int) ( $num_part ) ) ? ' ' . $this->list_thousands[$levels] . ' ' : '');\n }\n\n //clean up and put words into grammically correct english\n $commas = count($words);\n $commas = ($commas > 1 ? $commas - 1 : $commas);\n $words = implode($this->separator,array_filter($words));\n\n //Some finishing touch\n //Replacing multiples of spaces with one space\n $words = trim(str_replace(' ,',',',$words),$this->separator);\n \n return $words . ' dollar' . ($number_int > 1 ? 's' : '');\n\n }\n }", "function dokan_number_format( $number ) {\n $threshold = 10000;\n\n if ( $number > $threshold ) {\n return number_format( $number/1000, 0, '.', '' ) . ' K';\n }\n\n return $number;\n}", "protected function numberFormatter($n) {\r\n $n = (0+str_replace(\",\",\"\",$n));\r\n\r\n // is this a number?\r\n if(!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if($n>1000000000000) return round(($n/1000000000000),1).' trillion';\r\n else if($n>1000000000) return round(($n/1000000000),1).' milliarder';\r\n else if($n>1000000) return round(($n/1000000),1).' millioner';\r\n else if($n>1000) return round(($n/1000),1).' tusind';\r\n\r\n return number_format($n);\r\n }", "function wolf_share_format_number( $n = 0 ) {\n\n\t$s = array( 'K', 'M', 'G', 'T' );\n\t$out = '';\n\twhile ( $n >= 1000 && count( $s ) > 0) {\n\t\t$n = $n / 1000.0;\n\t\t$out = array_shift( $s );\n\t}\n\treturn round( $n, max( 0, 3 - strlen( (int)$n ) ) ) .\" $out\";\n}", "function angka($n) {\n $n = (0+str_replace(\",\",\"\",$n));\n \n // is this a number?\n if(!is_numeric($n)) return false;\n \n // now filter it;\n if($n>1000000000000) return round(($n/1000000000000),1);\n else if($n>1000000000) return round(($n/1000000000),1);\n else if($n>1000000) return round(($n/1000000),1);\n else if($n>1000) return round(($n/1000),1);\n \n return number_format($n);\n}", "function translateToWords($number) \n{\n // zero is a special case, it cause problems even with typecasting if we don't deal with it here\n $max_size = pow(10,18);\n if (!$number) return \"zero\";\n if (is_int($number) && $number < abs($max_size)) \n { \n switch ($number) \n {\n // set up some rules for converting digits to words\n case $number < 0:\n $prefix = \"negative\";\n $suffix = translateToWords(-1*$number);\n $string = $prefix . \" \" . $suffix;\n break;\n case 1:\n $string = \"one\";\n break;\n case 2:\n $string = \"two\";\n break;\n case 3:\n $string = \"three\";\n break;\n case 4: \n $string = \"four\";\n break;\n case 5:\n $string = \"five\";\n break;\n case 6:\n $string = \"six\";\n break;\n case 7:\n $string = \"seven\";\n break;\n case 8:\n $string = \"eight\";\n break;\n case 9:\n $string = \"nine\";\n break; \n case 10:\n $string = \"ten\";\n break; \n case 11:\n $string = \"eleven\";\n break; \n case 12:\n $string = \"twelve\";\n break; \n case 13:\n $string = \"thirteen\";\n break; \n // fourteen handled later\n case 15:\n $string = \"fifteen\";\n break; \n case $number < 20:\n $string = translateToWords($number%10);\n // eighteen only has one \"t\"\n if ($number == 18)\n {\n $suffix = \"een\";\n } else \n {\n $suffix = \"teen\";\n }\n $string .= $suffix;\n break; \n case 20:\n $string = \"twenty\";\n break; \n case 30:\n $string = \"thirty\";\n break; \n case 40:\n $string = \"forty\";\n break; \n case 50:\n $string = \"fifty\";\n break; \n case 60:\n $string = \"sixty\";\n break; \n case 70:\n $string = \"seventy\";\n break; \n case 80:\n $string = \"eighty\";\n break; \n case 90:\n $string = \"ninety\";\n break; \n case $number < 100:\n $prefix = translateToWords($number-$number%10);\n $suffix = translateToWords($number%10);\n $string = $prefix . \"-\" . $suffix;\n break;\n // handles all number 100 to 999\n case $number < pow(10,3): \n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,2)))) . \" hundred\";\n if ($number%pow(10,2)) $suffix = \" and \" . translateToWords($number%pow(10,2));\n $string = $prefix . $suffix;\n break;\n case $number < pow(10,6):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,3)))) . \" thousand\";\n if ($number%pow(10,3)) $suffix = translateToWords($number%pow(10,3));\n $string = $prefix . \" \" . $suffix;\n break;\n case $number < pow(10,9):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,6)))) . \" million\";\n if ($number%pow(10,6)) $suffix = translateToWords($number%pow(10,6));\n $string = $prefix . \" \" . $suffix;\n break; \n case $number < pow(10,12):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,9)))) . \" billion\";\n if ($number%pow(10,9)) $suffix = translateToWords($number%pow(10,9));\n $string = $prefix . \" \" . $suffix; \n break;\n case $number < pow(10,15):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,12)))) . \" trillion\";\n if ($number%pow(10,12)) $suffix = translateToWords($number%pow(10,12));\n $string = $prefix . \" \" . $suffix; \n break; \n // Be careful not to pass default formatted numbers in the quadrillions+ into this function\n // Default formatting is float and causes errors\n case $number < pow(10,18):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,15)))) . \" quadrillion\";\n if ($number%pow(10,15)) $suffix = translateToWords($number%pow(10,15));\n $string = $prefix . \" \" . $suffix; \n break; \n }\n } else\n {\n echo \"ERROR with - $number<br/> Number must be an integer between -\" . number_format($max_size, 0, \".\", \",\") . \" and \" . number_format($max_size, 0, \".\", \",\") . \" exclussive.\";\n }\n return $string; \n}", "function formatNumberToDisplayInMillions($number, $fullFormat=FALSE)\n{\tif(!is_numeric($number)) return false;\n\n\t// now filter it;\n\tif($number>=1000000000000) return round(($number/1000000000000),0). (($fullFormat)? ' Trillion':' T');\n\telse if($number>=1000000000) return round(($number/1000000000),0).(($fullFormat)? ' Billion':' B');\n\telse if($number>=1000000) return round(($number/1000000),0).(($fullFormat)? ' Million':' M');\n\telse if($number>=1000) return round(($number/1000),0).(($fullFormat)? ' Thousand':' K');\n\n\treturn number_format($number, 0, '.', ',');\n}", "function displayNumberWords($number,$preOne=\"\",$preOther=\"\",$postOne=\"\",$postOther=\"\",$decimalPlaces=0) {\r\n\r\n\tglobal $dss_numberWords;\r\n\t\r\n\tif ($number == 1) return $preOne.\" \".$dss_numberWords[$number].\" \".$postOne;\r\n\telseif ($number < 13) return $preOther.\" \".$dss_numberWords[$number].\" \".$postOther;\r\n\telse return $preOther.\" \".number_format($number,$decimalPlaces).\" \".$postOther;\r\n\t\r\n}", "function convert_words_to_nums($words){\n \n $result = \"\"; \n $max_string_length = 1000;\n $temp_num = 0;\n $final_num = 0;\n $max_num = 999999999;\n $negative = false; //flag\n \n $number_dictionary = array(\n 'negative' => '-',\n 'zero' => 0, 'one' => 1, 'two' => 2, 'three' => 3,'four' => 4, 'five' => 5,\n 'six' => 6, 'seven' => 7, 'eight' => 8, 'nine' => 9, 'ten' => 10,\n 'eleven' => 11, 'twelve' => 12, 'thirteen' => 13, 'fourteen' =>14,\n 'fifteen' =>15, 'sixteen' => 16, 'seventeen' =>17, 'eighteen' =>18,\n 'nineteen' => 19,'twenty' => 20, 'thirty' => 30, 'forty' => 40, \n 'fifty' => 50, 'sixty' => 60, 'seventy' => 70, 'eighty' =>80,\n 'ninety' => 90, 'hundred' => 100, 'thousand' => 1000, 'million' => 1000000\n );\n \n $ones = array(\n 'negative' => '-',\n 'zero' => 0, 'one' => 1, 'two' => 2, 'three' => 3,'four' => 4, 'five' => 5,\n 'six' => 6, 'seven' => 7, 'eight' => 8, 'nine' => 9, 'ten' => 10,\n 'eleven' => 11, 'twelve' => 12, 'thirteen' => 13, 'fourteen' =>14,\n 'fifteen' =>15, 'sixteen' => 16, 'seventeen' =>17, 'eighteen' =>18,\n 'nineteen' => 19\n );\n \n $tens = array(\n 'twenty' => 20, 'thirty' => 30, 'forty' => 40, \n 'fifty' => 50, 'sixty' => 60, 'seventy' => 70, 'eighty' =>80,\n 'ninety' => 90\n );\n \n //Conditions for user input\n if(strlen($words) > $max_string_length){\n return \"<p>Sorry your input is too long!</p>\";\n }\n elseif(preg_match(\"/[0-9]+/\",$words)){\n return $result .=\"<p>Please enter only words for optimal translation :)</p>\";\n }\n else {\n $result .= \"<p>You entered: <div id=\\\"words\\\">\".$words.\"</div>\n <br/><br/></p>\";\n }\n \n //$words = strtr($words, $number_dictionary); \n //strtr() converts \"done\" to \"d1\", so we use string_translate() instead\n $words = string_translate($words, $number_dictionary);\n $words = preg_split(\"/(\\,)|(\\.)+/i\", $words, -1, \n PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); \n \n $result .= \"<p>The translation is: \";\n \n //loop through entire string\n foreach($words as $val){\n $temp_num = 0;\n $final_num = 0;\n $negative = false;\n \n //preg_split by space\n $val = preg_split(\"/\\s+/i\",$val, -1, PREG_SPLIT_NO_EMPTY); \n \n //loop through each word\n foreach($val as $key => $translate){\n \n //check if negative or not numeric\n if($translate == '-' && $negative == false){\n $result .= $translate; \n $negative = true; //add only one negative per number\n continue;\n }\n elseif(!is_numeric($translate)){\n //echo \"not numeric..skipping to next number <br/>\";\n if($final_num == 0 && $temp_num != 0){\n //output word\n $result .= $temp_num.\" \";\n $temp_num = 0;\n }\n elseif($final_num != 0){\n //previous number was stored, so output the number first\n $result .= bcadd($final_num, $temp_num).\" \";\n $temp_num = 0;\n $final_num = 0;\n }\n $result .= $translate.\" \";\n continue;\n }\n \n //case: $translate < 100 ?\n if(bccomp($translate, 100) == -1 ){\n $temp_num = bcadd($temp_num, $translate); \n \n //check some invalid input conditions\n if( isset($val[$key + 1]) ){\n if(in_array($translate, $ones) && (in_array($val[$key + 1], $ones)\n || in_array($val[$key+1],$tens) ) ){\n //two ones repeat\n //invalid user syntax, so let us start new number \n $result .= bcadd($final_num, $temp_num).\" \";\n $temp_num = 0;\n $final_num = 0;\n }\n elseif(in_array($translate, $tens) && in_array($val[$key + 1], $tens) ){\n //two tens repeat\n //invalid user syntax, so let us start new number\n $result .= bcadd($final_num, $temp_num).\" \";\n $temp_num = 0;\n $final_num = 0;\n }\n }\n continue;\n }\n \n //case: $translate == 100 ?\n if(bccomp($translate, 100) == 0 ){\n $temp_num = bcmul($temp_num, $translate);\n \n //check if two multiples are repeated\n if( isset($val[$key + 1]) ){\n if( $translate == $val[$key + 1] ){\n //invalid user syntax \n $result .= bcadd($final_num, $temp_num).\" [invalid input] \";\n $temp_num = 0;\n $final_num = 0;\n }\n }\n continue;\n }\n \n //case: greater than 100 (e.g. 1000, or million)\n $temp_num = bcmul($temp_num, $translate);\n \n //check if OVERFLOW\n if(bcadd($final_num,$temp_num) > $max_num){\n return \"<p>Overflow, check your input (put some commas)\n !! Max number is 999,999,999</p>\";\n /*$final_num = $temp_num;\n $result .= \"[overflow]:\".$final_num.\" \";\n $final_num = 0;*/\n }\n else{\n //nothing wrong, so add final_num\n $final_num = bcadd($final_num,$temp_num);\n }\n\n $temp_num = 0; //restart process\n \n //check if two multiples are repeated\n if( isset($val[$key + 1]) ){\n if( $translate == $val[$key + 1] ){\n //invalid user syntax, so let us start new number \n $result .= bcadd($final_num, $temp_num).\" [invalid input] \";\n $temp_num = 0;\n $final_num = 0;\n }\n }\n\n }//end foreach\n \n //add number to result\n if(is_numeric($translate)) {\n $final_num = bcadd($final_num, $temp_num);\n $result .= $final_num;\n }\n \n }//we looped through whole string\n \n $result .= \"</p>\";\n return $result;\n}", "public static function asShortNumber($value)\r\n {\r\n if ($value >= 9500000) {\r\n return round($value / 1000000, 0) . \"m\";\r\n } else if ($value >= 950000) {\r\n return round($value / 1000000, 1) . \"m\";\r\n } else if ($value >= 95000) {\r\n return round($value / 1000, 0) . \"k\";\r\n } else if ($value >= 950) {\r\n return round($value / 1000, 1) . \"k\";\r\n } else {\r\n return round($value, 1);\r\n }\r\n }", "function convertTri($num, $tri) {\n global $ones, $tens, $triplets, $count;\n $test = $num;\n $count++;\n // chunk the number, ...rxyy\n // init the output string\n $str = '';\n // to display hundred & digits\n if ($count == 1) {\n $r = (int) ($num / 1000);\n $x = ($num / 100) % 10;\n $y = $num % 100;\n // do hundreds\n if ($x > 0) {\n $str = $ones[$x] . ' Hundred';\n // do ones and tens\n $str .= commonloop($y, ' and ', '');\n }\n else if ($r > 0) {\n // do ones and tens\n $str .= commonloop($y, ' and ', '');\n }\n else {\n // do ones and tens\n $str .= commonloop($y);\n }\n }\n // To display lakh and thousands\n else if($count == 2) {\n $r = (int) ($num / 10000);\n $x = ($num / 100) % 100;\n $y = $num % 100;\n $str .= commonloop($x, '', ' Lakh ');\n $str .= commonloop($y);\n if ($str != '')\n $str .= $triplets[$tri];\n }\n // to display till hundred crore\n else if($count == 3) {\n $r = (int) ($num / 1000);\n $x = ($num / 100) % 10;\n $y = $num % 100;\n // do hundreds\n if ($x > 0) {\n $str = $ones[$x] . ' Hundred';\n // do ones and tens\n $str .= commonloop($y,' and ',' Crore ');\n }\n else if ($r > 0) {\n // do ones and tens\n $str .= commonloop($y,' and ',' Crore ');\n }\n else {\n // do ones and tens\n $str .= commonloop($y);\n }\n }\n else {\n $r = (int) ($num / 1000);\n }\n // add triplet modifier only if there\n // is some output to be modified...\n // continue recursing?\n if ($r > 0)\n return convertTri($r, $tri+1) . $str;\n else\n return $str;\n}", "function nicenumber($n) {\n $n = (0+str_replace(\",\",\"\",$n));\n\n // is this a number?\n if(!is_numeric($n)) return false;\n\n // now filter it;\n if($n>1000000000) return round(($n/1000000000),1).'B';\n else if($n>1000000) return round(($n/1000000),1).'M';\n else if($n>1000) return round(($n/1000),1).'K';\n\n return number_format($n);\n}", "public function changeCurrencytowords($number)\n {\n /*$number = 190908100.25;*/\n $no = round($number);\n /* if($number < $no){\n $point = round($no - $number , 2) * 100;\n }else{\n $point = round($number - $no, 2) * 100;\n }*/\n\n $hundred = null;\n $digits_1 = strlen($no);\n $i = 0;\n $str = array();\n $words = array('0' => '', '1' => 'One', '2' => 'Two',\n '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',\n '7' => 'Seven', '8' => 'Eight', '9' => 'Nine',\n '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',\n '13' => 'Thirteen', '14' => 'Fourteen',\n '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',\n '18' => 'Eighteen', '19' => 'Nineteen', '20' => 'Twenty',\n '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',\n '60' => 'Sixty', '70' => 'Seventy',\n '80' => 'Eighty', '90' => 'Ninety');\n $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\n\n while ($i < $digits_1) {\n\n $divider = ($i == 2) ? 10 : 100;\n $number = floor($no % $divider);\n $no = floor($no / $divider);\n $i += ($divider == 10) ? 1 : 2;\n if ($number) {\n $plural = (($counter = count($str)) && $number > 9) ? 's' : null;\n $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;\n $str[] = ($number < 21) ? $words[$number] .\n \" \" . $digits[$counter] . $plural . \" \" . $hundred\n :\n $words[floor($number / 10) * 10]\n . \" \" . $words[$number % 10] . \" \"\n . $digits[$counter] . $plural . \" \" . $hundred;\n } else {\n $str[] = null;\n }\n\n }\n\n $str = array_reverse($str);\n $result = implode('', $str);\n\n /*$points = ($point) ?\n \".\" . $words[$point / 10] . \" \" .\n $words[$point = $point % 10]. \" Paise\" : '';*/\n\n return $result . \"Rupees \"; //. $points\n }", "function convertToRupee($number){\r\n\t\t$no = round($number);\r\n\t\t$whole = floor($number); \r\n\t\t$point = $number - $whole; \r\n\r\n\t\t$hundred = null;\r\n\t\t$digits_1 = strlen($no);\r\n\t\t$i = 0;\r\n\t\t$str = array();\r\n\t\t$words = array('0' => '', '1' => 'One', '2' => 'Two',\r\n\t\t\t\t'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',\r\n\t\t\t\t'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',\r\n\t\t\t\t'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',\r\n\t\t\t\t'13' => 'Thirteen', '14' => 'fourteen',\r\n\t\t\t\t'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',\r\n\t\t\t\t'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',\r\n\t\t\t\t'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',\r\n\t\t\t\t'60' => 'Sixty', '70' => 'Seventy',\r\n\t\t\t\t'80' => 'Eighty', '90' => 'Ninety');\r\n\t\t\t\t$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\r\n\t\twhile ($i < $digits_1) {\r\n\t\t\t$divider = ($i == 2) ? 10 : 100;\r\n\t\t\t$number = floor($no % $divider);\r\n\t\t\t$no = floor($no / $divider);\r\n\t\t\t$i += ($divider == 10) ? 1 : 2;\r\n\t\t\tif ($number) {\r\n\t\t\t\t$plural = (($counter = count($str)) && $number > 9) ? 's' : null;\r\n\t\t\t\t$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;\r\n\t\t\t\t$str [] = ($number < 21) ? $words[$number] .\r\n\t\t\t\t\t\" \" . $digits[$counter] . $plural . \" \" . $hundred\r\n\t\t\t\t\t:\r\n\t\t\t\t\t$words[floor($number / 10) * 10]\r\n\t\t\t\t\t. \" \" . $words[$number % 10] . \" \"\r\n\t\t\t\t\t. $digits[$counter] . $plural . \" \" . $hundred;\r\n\t\t\t} else $str[] = null;\r\n\t\t}\r\n\t\t$str = array_reverse($str);\r\n\t\t$result = implode('', $str);\r\n\t\t$points = $this->paiseValue($point);\r\n\r\n\t\t$finalStr = '';\r\n\r\n\t\tif(!empty($result)){\r\n\t\t\t$finalStr .= $result. \" Rupees \";\r\n\t\t}\r\n\t\tif(!empty($points)){\r\n\t\t\t$finalStr .= \"and \".$points. \" Paise\";\r\n\t\t}\r\n\t\tif(!empty($finalStr)){\r\n\t\t\t$finalStr .= \" Only.\";\r\n\t\t}\r\n\r\n\t\treturn $finalStr;\r\n\t}", "function iu_format_number($input){\n\t$suffixes = array('', 'k', 'M', 'B');\n\t$suffixIndex = 0;\n\n\twhile(abs($input) >= 1000 && $suffixIndex < sizeof($suffixes)){\n\t\t$suffixIndex++;\n\t\t$input /= 1000;\n\t}\n\treturn round(floatval($input / pow(10, 0)),1).$suffixes[$suffixIndex];\n}", "function mgl_instagram_instagram_format_number($number ) {\n // Set divisor divisor and short letter by number\n if( $number < 1000 ) {\n // If number is less than 1000 do nothing\n return $number;\n\n }else if ($number > 1000 && $number < 1000000) {\n // Anything between 1000 and a million\n $divisor = 1000;\n $letter = 'k';\n\n } else if ($number > 1000000 && $number < 1000000000) {\n // Anything between a million and a billion\n $divisor = 1000000;\n $letter = 'm';\n\n } else {\n // Anything greater than a billion\n $divisor = 1000000000;\n $letter = 'G';\n }\n\n // Set a decimal precision to 1\n $precision = 1;\n // Set dec point to ','\n // TODO: translate dec point by language\n $dec_point = ',';\n // Set thousand sep to '.'\n // TODO: translate thousand sep by language\n $thousand_sep = '.';\n // Remove extra decimals. Trick because of number_format below also always round up and causes weird results\n // More information: http://php.net/manual/es/function.number-format.php#88424\n $short_number = bcdiv( ( $number / $divisor ), 1, 1 );\n // Get formatted number\n $n_format = trim(number_format( $short_number, $precision, $dec_point, $thousand_sep), 0 . $dec_point) . $letter;\n\n return $n_format;\n}", "function toString() {\n if (abs($this->num) >= abs($this->denom)) {\n if ($this->denom == 1) {\n return $this->num;\n }\n\n if ($this->isNegative()) {\n $whole = ceil ($this->num / $this->denom);\n } else {\n $whole = floor ($this->num / $this->denom);\n }\n $num = abs($this->num % $this->denom);\n } else {\n $num = $this->num;\n }\n return ((empty($whole)?(empty($num)?\"0\":\"\"):$whole)\n . (empty($num)? \"\" : \" \" . $num .\"/\". $this->denom));\n }", "function makewords($numval,$curr)\n{\n \n $moneystr = \"\";\n #Millions\n $milval = int($numval / 1000000);\n if($milval == 1) {\n $moneystr .= \"un millon\";\n }\n if($milval > 1) {\n $moneystr .= getwords($milval) . \" millones\";\n } \n #thousands\n $workval = $numval - ($milval * 1000000); # get rid of millions\n $thouval = int($workval / 1000);\n if($thouval > 0) {\n $workword = getwords($thouval);\n if ($moneystr == \"\") {\n $moneystr = $workword . \" mil\";\n } else {\n $moneystr .= \" \" . $workword . \" mil\";\n }\n }\n #handle all the rest of the money\n $workval = $workval - ($thouval * 1000); # get rid of thousands\n $tensval = int($workval);\n if ($moneystr == 0) {\n if ($tensval > 0) {\n $moneystr .= getwords($tensval);\n } else {\n $moneystr .= \"cero\";\n }\n } else {\n # non zero values in hundreds and up\n $workword = getwords($tensval);\n $moneystr .= \" \" . $workword;\n }\n # plural or singular\n $workval = int($numval);\n if ($workval == 1) {\n $moneystr .= \" \" . lc($curr) . \" \";\n } else {\n $moneystr .= \" \" . lc($curr) . \"s \";\n }\n # do the pennies - use printf so that we get the\n # same rounding as printf\n $workstr = sprintf(\"%3.2f\",$numval); #// convert to a string\n $intstr = substr($workstr,length($workstr) - 2, 2);\n $workint = int($intstr);\n if ($workint == 0) {\n $moneystr .= \"00/100\";\n } else {\n $moneystr .= $workint.\"/100\";\n }\n\n # done - let's get out of here!\n return $moneystr;\n}", "function makeNumberScreen ($num = 0)\n{\n\n $dictionary = array(\n 0 => \"a\",\n 1 => \"b\",\n 2 => \"c\",\n 3 => \"d\",\n 4 => \"e\",\n 5 => \"f\",\n 6 => \"g\",\n );\n\n $numbers = array();\n\n $numbers[0] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"ba\", \"bd\",\n \"ca\", \"cd\",\n \"da\", \"dd\",\n \"ea\", \"ed\",\n \"fa\", \"fd\",\n \"ga\", \"gb\", \"gc\", \"gd\",\n );\n\n $numbers[1] = array(\n \"ad\",\n \"bd\",\n \"cd\",\n \"dd\",\n \"ed\",\n \"fd\",\n \"gd\",\n );\n\n $numbers[2] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"bd\",\n \"cd\",\n \"da\", \"db\", \"dc\", \"dd\",\n \"ea\",\n \"fa\",\n \"ga\", \"gb\", \"gc\", \"gd\",\n );\n\n $numbers[3] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"bd\",\n \"cd\",\n \"da\", \"db\", \"dc\", \"dd\",\n \"ed\",\n \"fd\",\n \"ga\", \"gb\", \"gc\", \"gd\",\n );\n\n $numbers[4] = array(\n \"aa\", \"ad\",\n \"ba\", \"bd\",\n \"ca\", \"cd\",\n \"da\", \"db\", \"dc\", \"dd\",\n \"ed\",\n \"fd\",\n \"gd\",\n );\n\n $numbers[5] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"ba\",\n \"ca\",\n \"da\", \"db\", \"dc\", \"dd\",\n \"ed\",\n \"fd\",\n \"ga\", \"gb\", \"gc\", \"gd\",\n );\n\n $numbers[6] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"ba\",\n \"ca\",\n \"da\", \"db\", \"dc\", \"dd\",\n \"ea\", \"ed\",\n \"fa\", \"fd\",\n \"ga\", \"gb\", \"gc\", \"gd\",\n );\n\n $numbers[7] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"bd\",\n \"cd\",\n \"dd\",\n \"ed\",\n \"fd\",\n \"gd\",\n );\n\n $numbers[8] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"ba\", \"bd\",\n \"ca\", \"cd\",\n \"da\", \"db\", \"dc\", \"dd\",\n \"ea\", \"ed\",\n \"fa\", \"fd\",\n \"ga\", \"gb\", \"gc\", \"gd\",\n );\n\n $numbers[9] = array(\n \"aa\", \"ab\", \"ac\", \"ad\",\n \"ba\", \"bd\",\n \"ca\", \"cd\",\n \"da\", \"db\", \"dc\", \"dd\",\n \"ed\",\n \"fd\",\n \"gd\",\n );\n\n $output = '';\n for($row = 0; $row < 7; $row++) {\n $row_data = $dictionary[$row];\n $output .= \"<div class='counter__row'>\";\n\n for($column = 0; $column < 4; $column++) {\n $column_data = $dictionary[$column];\n $excluded = array(\"bb\", \"bc\", \"cb\", \"cc\", \"eb\", \"ec\", \"fb\", \"fc\");\n if (in_array(($row_data . $column_data), $numbers[$num])) {\n $output .= \"<span class='counter__bulb on' data-lat='\" . $row_data . \"' data-long='\" . $column_data . \"'><i class='f'></i><i class='s'></i><i class='t'></i><i class='l'></i></span>\";\n } elseif (!in_array(($row_data . $column_data), $excluded)) {\n $output .= \"<span class='counter__bulb' data-lat='\" . $row_data . \"' data-long='\" . $column_data . \"'><i class='f'></i><i class='s'></i><i class='t'></i><i class='l'></i></span>\";\n } else {\n $output .= \"<span class='counter__bulb off'></span>\";\n }\n }\n\n $output .= \"</div>\";\n }\n\n return $output;\n\n}", "function transNumber($input) \n{\n $faRes=\"\";\n $input=\"$input\";\n $len=strlen($input);\n for ($i=0; $i<$len; $i++)\n switch($input[$i]) {\n case \"0\": $faRes.=\"۰\"; break;\n case \"1\": $faRes.=\"۱\"; break;\n case \"2\": $faRes.=\"۲\"; break;\n case \"3\": $faRes.=\"۳\"; break;\n case \"4\": $faRes.=\"۴\"; break;\n case \"5\": $faRes.=\"۵\"; break;\n case \"6\": $faRes.=\"۶\"; break;\n case \"7\": $faRes.=\"۷\"; break;\n case \"8\": $faRes.=\"۸\"; break;\n case \"9\": $faRes.=\"۹\"; break;\n default: $faRes.= $input[$i]; break;\n }\n return $faRes;\n}", "function formatNumbers($inputID)\n\t{\n\t\t$number_format = number_format($inputID);\n\t\t\n\t\techo $number_format;\n\t}", "function numberformat( $num ) {\n\tglobal $lang;\n\tif ( $lang == 'www' || $lang == 'meta' || $lang == 'commons' || $lang == 'en' || $lang == 'incubator' ) {\n\t\treturn number_format($num);\n\t}\n\telseif ( $lang == 'fr' ) {\n\t\treturn number_format($num, 0, ',', ' ');\n\t}\n\telse {\n\t\treturn number_format($num);\n\t}\n}", "public static function human_number( $number ) {\n\n\t\tif ( ! is_numeric( $number ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$negative = '';\n\t\tif ( abs( $number ) != $number ) {\n\t\t\t$negative = '-';\n\t\t\t$number = abs( $number );\n\t\t}\n\n\t\tif ( $number < 1000 ) {\n\t\t\treturn $negative ? -1 * $number : $number;\n\t\t}\n\n\t\t$unit = intval( log( $number, 1000 ) );\n\t\t$units = array( '', 'K', 'M', 'B', 'T', 'Q' );\n\n\t\tif ( array_key_exists( $unit, $units ) ) {\n\t\t\treturn sprintf( '%s%s%s', $negative, rtrim( number_format( $number / pow( 1000, $unit ), 1 ), '.0' ), $units[ $unit ] );\n\t\t}\n\n\t\treturn $number;\n\t}", "function forDecimal($num){\n global $ones,$tens;\n $str=\"\";\n $len = strlen($num);\n if($len==1){\n $num=$num*10;\n }\n $x= $num%100;\n if($x>0){\n if($x<20){\n $str = $ones[$x].' Paise';\n }else{\n $str = $ones[$x/10].$ones[$x%10].' Paise';\n }\n }\n return $str;\n }", "function mylong2ip($n) {\r\n $t=array(0,0,0,0);\r\n $msk = 16777216.0;\r\n $n += 0.0;\r\n if ($n < 1)\r\n return('&nbsp;');\r\n for ($i = 0; $i < 4; $i++) {\r\n $k = (int) ($n / $msk);\r\n $n -= $msk * $k;\r\n $t[$i]= $k;\r\n $msk /=256.0;\r\n };\r\n //$a=join('.', $t);\r\n\t$a = $t[3] . \".\" . $t[2] . \".\" . $t[1] . \".\" . $t[0];\r\n return($a);\r\n}", "public static function BigNumber($Number) {\n if (!is_numeric($Number))\n return $Number;\n\n if ($Number >= 1000000000) {\n $Number = $Number / 1000000000;\n $Suffix = \"B\";\n } elseif ($Number >= 1000000) {\n $Number = $Number / 1000000;\n $Suffix = \"M\";\n } elseif ($Number >= 1000) {\n $Number = $Number / 1000;\n $Suffix = \"K\";\n }\n\n if (isset($Suffix)) {\n return number_format($Number, 1).$Suffix;\n } else {\n return $Number;\n }\n }", "function money_format($n)\n {\n $n = (0 + str_replace(\",\", \"\", $n));\n\n // is this a number?\n if (!is_numeric($n)) return false;\n\n // now filter it;\n if ($n > 1000000000000) return round(($n / 1000000000000), 1) . ' nghìn tỷ';\n else if ($n > 1000000000) return round(($n / 1000000000), 1) . ' tỷ';\n else if ($n > 1000000) return round(($n / 1000000), 1) . ' triệu';\n else if ($n > 1000) return round(($n / 1000), 1) . ' nghìn';\n\n return number_format($n);\n }", "function convertNumberToWordsForIndia($number){\n $words = array(\n '0'=> '' ,'1'=> 'one' ,'2'=> 'two' ,'3' => 'three','4' => 'four','5' => 'five',\n '6' => 'six','7' => 'seven','8' => 'eight','9' => 'nine','10' => 'ten',\n '11' => 'eleven','12' => 'twelve','13' => 'thirteen','14' => 'fouteen','15' => 'fifteen',\n '16' => 'sixteen','17' => 'seventeen','18' => 'eighteen','19' => 'nineteen','20' => 'twenty',\n '30' => 'thirty','40' => 'fourty','50' => 'fifty','60' => 'sixty','70' => 'seventy',\n '80' => 'eighty','90' => 'ninty');\n \n //First find the length of the number\n $number_length = strlen($number);\n //Initialize an empty array\n $number_array = array(0,0,0,0,0,0,0,0,0);\n $received_number_array = array();\n \n //Store all received numbers into an array\n for($i=0;$i<$number_length;$i++){\n $received_number_array[$i] = substr($number,$i,1);\n }\n //Populate the empty array with the numbers received - most critical operation\n for($i=9-$number_length,$j=0;$i<9;$i++,$j++){\n $number_array[$i] = $received_number_array[$j];\n }\n $number_to_words_string = \"\";\n //Finding out whether it is teen ? and then multiply by 10, example 17 is seventeen, so if 1 is preceeded with 7 multiply 1 by 10 and add 7 to it.\n for($i=0,$j=1;$i<9;$i++,$j++){\n //\"01,23,45,6,78\"\n //\"00,10,06,7,42\"\n //\"00,01,90,0,00\"\n if($i==0 || $i==2 || $i==4 || $i==7){\n if($number_array[$j]==0 || $number_array[$i] == \"1\"){\n $number_array[$j] = intval($number_array[$i])*10+$number_array[$j];\n $number_array[$i] = 0;\n }\n \n }\n }\n $value = \"\";\n for($i=0;$i<9;$i++){\n if($i==0 || $i==2 || $i==4 || $i==7){\n $value = $number_array[$i]*10;\n }\n else{\n $value = $number_array[$i];\n }\n if($value!=0) { $number_to_words_string.= $words[\"$value\"].\" \"; }\n if($i==1 && $value!=0){ $number_to_words_string.= \"Crores \"; }\n if($i==3 && $value!=0){ $number_to_words_string.= \"Lakhs \"; }\n if($i==5 && $value!=0){ $number_to_words_string.= \"Thousand \"; }\n if($i==6 && $value!=0){ $number_to_words_string.= \"Hundred &amp; \"; }\n }\n if($number_length>9){ $number_to_words_string = \"Sorry This does not support more than 99 Crores\"; }\n return ucfirst(strtolower($number_to_words_string).\" only.\");\n}", "function expanded_form(int $n) {\n // Get string value of a variable\n $a=strval($n);\n // Convert string to array;\n $tab = str_split($a);\n $longueurTab= sizeof($tab);\n for($i=0,$j=$longueurTab-1;$i<$longueurTab;$i++,$j--){\n $tab[$i] = intval($tab[$i])*pow(10,$j);\n }\n // delete 0 numbers\n foreach (array_keys($tab, 0) as $key) {\n unset($tab[$key]);\n }\n //var_dump($tab,\"no\");\n $res = implode(\" + \",$tab);\n //var_dump($res,\"no\");\n return $res;\n }", "function formatNumber($number)\n {\n $stringLength = strlen($number);\n\n if ($stringLength > 5) {\n return round($number / 1000, 2).'K';\n }\n return $number;\n }", "function MakeDIN5008()\n {\n $this->PhoneDurchwahl = preg_replace(\"/-+/\", '-', $this->PhoneDurchwahl);\n $this->Teilnehmerkennzahl = trim(eregi_replace(\"[^0-9]\", null, $this->Teilnehmerkennzahl));\n if ($this->Landesvorwahl) $this->Landesvorwahl = \"+\".trim(eregi_replace(\"[^0-9]\", null, $this->Landesvorwahl));\n return trim($this->Landesvorwahl.\" \".\n abs(trim(eregi_replace(\"\\(0)\", \"\", $this->Ortsnetzkennzahl))).\" \".\n $this->Teilnehmerkennzahl.\n $this->PhoneDurchwahl);\n }", "function humanNumber($num, $places = 1, $type = 'metric') {\n if ($type == 'metric') {\n $k = 'K';\n $m = 'M';\n } else {\n $k = ' thousand';\n $m = ' million';\n }\n if ($num < 1000) {\n $num_format = number_format($num);\n } elseif ($num < 1000000) {\n $num_format = number_format($num / 1000, $places) . $k;\n } else {\n $num_format = number_format($num / 1000000, $places) . $m;\n }\n\n return $num_format;\n}", "public static function numMassFormat($num) {\n\n if($num>1000) {\n\n $x = round($num);\n $x_number_format = number_format($x);\n $x_array = explode(',', $x_number_format);\n $x_parts = array('K', 'M', 'B', 'T');\n $x_count_parts = count($x_array) - 1;\n $x_display = $x_array[0] . ((int) $x_array[1][0] !== 0 ? '.' . $x_array[1][0] : '');\n $x_display .= $x_parts[$x_count_parts - 1];\n\n return $x_display;\n\n }\n\n return $num;\n }", "public static function shortenInt($int){\n\t\tif ( $int >= 1000) $int = floor($int/1000).'k';\n\t\treturn $int;\n\t}", "function covertirNumLetras()\r\n{\r\n\r\n\t$number = $this->monto;\r\n\r\n\t//number = number_format (number, 2);\r\n $number1=$number;\r\n\r\n\r\n //settype (number, \"integer\");\r\n $cent = strpos($number1,\".\");\r\n\r\n if($cent > 0){\r\n\t\r\n\t$centavos = substr($number1,$cent+1,2);\r\n\t\r\n }else{\r\n\r\n \t$centavos = \"00\";\r\n\t\r\n\t}\r\n\t/* \r\n\t $cent = split(\".\",$number1,7); \r\n\r\n\t\techo $cent[4];\r\n\t\texit();\r\n\r\n\t $centavos = $cent[1];\r\n\r\n\t if ($centavos == 0 || empty($centavos)){\r\n\t \t$centavos = \"00\";\r\n\t }\r\n\t*/\r\n\t/*\r\n\t \r\n\t if (number == 0 || number == \"\") \r\n\t { // if amount = 0, then forget all about conversions, \r\n\t centenas_final_string=\" cero \"; // amount is zero (cero). handle it externally, to \r\n\t // function breakdown \r\n\t } \r\n\t else \r\n\t { \r\n \r\n \r\n\r\n\t \r\n millions = ObtenerParteEntDiv(number, 1000000); // first, send the millions to the string \r\n number = mod(number, 1000000); // conversion function \r\n \r\n\t alert(millions);\r\n\t \r\n if (millions != 0)\r\n { \r\n // This condition handles the plural case \r\n if (millions == 1) \r\n { // if only 1, use 'millon' (million). if \r\n descriptor= \" millon \"; // > than 1, use 'millones' (millions) as \r\n } \r\n else \r\n { // a descriptor for this triad. \r\n descriptor = \" millones \"; \r\n } \r\n } \r\n else \r\n { \r\n descriptor = \" \"; // if 0 million then use no descriptor. \r\n } \r\n millions_final_string = string_literal_conversion(millions)+descriptor; \r\n */ \r\n\r\n\r\n $thousands = $this->ObtenerParteEntDiv($number, 1000); // now, send the thousands to the string \r\n $number = fmod($number, 1000); // conversion function. \r\n //print \"Th:\".thousands;\r\n if ($thousands != 1) \r\n { // This condition eliminates the descriptor \r\n $thousands_final_string = $this->string_literal_conversion($thousands) . \" mil \"; \r\n // descriptor = \" mil \"; // if there are no thousands on the amount \r\n } \r\n if ($thousands == 1)\r\n {\r\n $thousands_final_string = \" mil \"; \r\n }\r\n if ($thousands < 1) \r\n { \r\n $thousands_final_string = \" \"; \r\n } \r\n \r\n // this will handle numbers between 1 and 999 which \r\n // need no descriptor whatsoever. \r\n\r\n\r\n $centenas = $number; \r\n $centenas_final_string = $this->string_literal_conversion($centenas) ; \r\n \r\n\t// } //end if (number ==0) \r\n\r\n /*if (ereg(\"un\",centenas_final_string))\r\n {\r\n centenas_final_string = ereg_replace(\"\",\"o\",centenas_final_string); \r\n }*/\r\n //finally, print the output. \r\n\r\n /* Concatena los millones, miles y cientos*/\r\n\r\n\r\n $cad = $thousands_final_string.$centenas_final_string; \r\n \r\n /* Convierte la cadena a Mayúsculas*/\r\n $cad = strtoupper($cad); \r\n\r\n\r\n\r\n\t/*\r\n\t if (strlen($centavos) > 2)\r\n\t { \r\n\t if(substr($centavos.substring,2,3) >= 5){\r\n\t $centavos = substr($centavos,0,1).(parseInt(centavos.substring(1,2)).1).toString();\r\n\t }else{\r\n\t centavos = centavos.substring(0,2);\r\n\t }\r\n\t }\r\n\r\n\t*/\r\n\r\n\r\n if (strlen($centavos) == 1)\r\n {\r\n $centavos = $centavos.\"0\";\r\n }\r\n $centavos = $centavos. \"/100\"; \r\n\r\n\r\n if ($number == 1)\r\n {\r\n $moneda = \" PESO \"; \r\n }\r\n else\r\n {\r\n $moneda = \" PESOS \"; \r\n }\r\n \r\n /* Regresa el número en cadena entre paréntesis y con tipo de moneda y la fase M.N.*/\r\n\r\n return $cad.$moneda.\" \".$centavos.\" M.N.\";\r\n \r\n}", "function fullNumber($newNum){\n switch ($newNum){ \n case ($newNum < 100000): \n echo \"000\" . $newNum;\n break; \n case ($newNum < 1000000): \n echo \"00\" . $newNum;\n break; \n case ($newNum < 10000000): \n echo \"0\" . $newNum; \n break; \n default: \n echo $newNum;\n break; \n } \n}", "function rupiah($n) {\n\t\treturn number_format($n,2,',','.');\n\t}", "function format_scientifique_number($num, $float_sep = \",\", $thouthand_sep = \" \")\r\n\t{\r\n\t\t$float = null;\r\n\t\tif((int)$num != (float)$num ) $float = 2;\r\n\t\treturn number_format($num,$float,$floatsep,$thouthandsep);\r\n\t}", "public static function toWord($digits){\n $digits = str_replace(',','.',$digits);\n if(is_numeric($digits)){\n $digitsArrray = explode('.', $digits);\n\n $digits = $digitsArrray[0];\n $ret_string = \"\";\n $sub_ret_string = \"\";\n\n for($i = 10; $i>=0; $i--){\n $pw = pow(1000,$i);\n \n if((int)($digits / $pw) != 0){\n \n $str = (int)($digits / $pw);\n \n if((strlen($str) - 3) == -1){\n $sub_dig = substr($str, (strlen($str) - 2), 3);\n }else{\n $sub_dig = substr($str, (strlen($str) - 3), 3);\n }\n \n $sub_len = strlen($sub_dig);\n \n $flag = false;\n $sub_ret_string = \"\";\n for($j=0; $j<$sub_len; $j++){\n $post = ($sub_len-1) - $j;\n\n if($sub_len == 3){\n if($j == 1 && $sub_dig[$j] == 1){\n $ret_string .= self::getDigitName( $sub_dig[$j].$sub_dig[$j+1], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j].$sub_dig[$j+1];\n $flag = true;\n }\n if(!$flag){\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }elseif($sub_len == 2){\n if($j == 0 && $sub_dig[$j] == 1){\n $ret_string .= self::getDigitName( $sub_dig[$j].$sub_dig[$j+1], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j].$sub_dig[$j+1];\n $flag = true;\n }\n if(!$flag){\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }else{\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }\n $ret_string .= self::getTriolName($pw, $sub_ret_string).' ';\n }\n }\n $ret_string = self::mb_ucfirst($ret_string);\n return [$ret_string, empty($digitsArrray[1])? \"00\":$digitsArrray[1]];\n }\n return [\"0\",\"00\"];\n }", "function number_to_human_size($bytes){\n\t$border = 1024 * 1.5;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u Byte', $bytes);\n\t\n\t$bytes /= 1024;\n\tif ($bytes < $border)\n\t\treturn sprintf('%u KiByte', $bytes);\n\t\n\t$bytes /= 1024;\n\treturn sprintf('%.1f MiByte', $bytes);\n}", "function th($number) {\n\treturn number_format(intval($number));\n}", "function makewords($numval, $decs, $moneda=\"pesos\" ) \r\n{ \r\n $moneystr = \"\"; \r\n\r\n // handle the millions \r\n $milval = (integer)($numval / 1000000); \r\n\r\n if($milval > 0) \r\n { \r\n $moneystr = getwords($milval) . \" MILLONES\";\r\n }\r\n\r\n // handle the thousands \r\n $workval = $numval - ($milval * 1000000); // get rid of millions \r\n $thouval = (integer) ($workval / 1000); \r\n \r\n if($thouval > 0) \r\n { \r\n $workword = getwords($thouval); \r\n\t\r\n if ($moneystr == \"\") \r\n { \r\n $moneystr = $workword . \" mil\"; \r\n } \r\n else \r\n { \r\n $moneystr .= \" \" . $workword . \" mil\"; \r\n } \r\n } \r\n\r\n // handle all the rest of the dollars \r\n $workval = $workval - ($thouval * 1000); // get rid of thousands \r\n $tensval = (integer)($workval); \r\n \r\n if ($moneystr == \"\") \r\n { \r\n $moneystr = \"\";\r\n\t \r\n\t if ($tensval > 0) \r\n $moneystr .= getwords($tensval); \r\n else \r\n $moneystr .= \"Cero\"; \r\n } \r\n else // non zero values in hundreds and up \r\n { \r\n $workword = getwords($tensval); \r\n $moneystr .= \" \" . $workword; \r\n } \r\n\r\n // plural or singular 'dollar' \r\n $workval = (integer)($numval); \r\n \r\n if ($workval == 1) \r\n { \r\n if( $moneda == \"pesos\" )\r\n\t \t$moneystr .= \" peso con \"; \r\n\t else if( $moneda == \"dolares\" )\r\n\t \t$moneystr .= \" dolar con \"; \r\n } \r\n else \r\n $moneystr .= \" $moneda \"; \r\n\r\n // do the pennies - use printf so that we get the \r\n // same rounding as printf \r\n $workstr = sprintf(\"%3.\" . $decs . \"f\", $numval ); // convert to a string \r\n $intstr = substr($workstr, strlen($workstr) - $decs, $decs); \r\n $workint = (integer)($intstr); \r\n \r\n if( $moneda <> \"pesos\" and $workint <> 0)\r\n {\r\n\t$moneystr .= \" con \" . $intstr;\r\n\t\r\n\t if ($workint == 1) \r\n\t $moneystr .= \" centavo\"; \r\n\t else \r\n\t $moneystr .= \" centavos\"; \r\n }\r\n else if( $moneda == \"pesos\" )\r\n $moneystr .= $intstr;\r\n \r\n $moneystr .= (($moneda<>\"dolares\") ? \"/100 M.N.\" : \"\");\r\n\r\n// done - let's get out of here! \r\n $moneystr = strtoupper($moneystr);\r\n \r\nreturn trim($moneystr); \r\n}", "function int_to_str($i) {\n\treturn implode('.', int_to_digits($i));\n}", "function PMA_formatByteDown($value, $limes = 6, $comma = 0)\r\n{\r\n $dh = pow(10, $comma);\r\n $li = pow(10, $limes);\r\n $return_value = $value;\r\n $unit = $byteunits[0];\r\n\t$byteunits = array('Byte', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');\r\n\t$number_thousands_separator = ',';\r\n\t$number_decimal_separator = '.';\r\n\r\n for ( $d = 6, $ex = 15; $d >= 1; $d--, $ex-=3 ) {\r\n if (isset($byteunits[$d]) && $value >= $li * pow(10, $ex)) {\r\n $value = round($value / ( pow(1024, $d) / $dh) ) /$dh;\r\n $unit = $byteunits[$d];\r\n break 1;\r\n } // end if\r\n } // end for\r\n\r\n if ($unit != $byteunits[0]) {\r\n $return_value = number_format($value, $comma, $number_decimal_separator, $number_thousands_separator);\r\n } else {\r\n $return_value = number_format($value, 0, $number_decimal_separator, $number_thousands_separator);\r\n }\r\n\r\n return array($return_value, $unit);\r\n}", "function unit_display($bits) {\n\n\t$output = \"\";\n\n\tif (($bits / 1000000000000) > 1 ) {\n\t\t$output = round(($bits / 1000000000000), 3) . \" Tb\";\n\t}elseif (($bits / 1000000000) > 1 ) {\n\t\t$output = round(($bits / 1000000000), 3) . \" Gb\";\n\t}elseif (($bits / 1000000) > 1 ) {\n\t\t$output = round(($bits / 1000000), 3) . \" Mb\";\n\t}elseif (($bits / 1000) > 1 ) {\n\t\t$output = round(($bits / 1000), 3) . \" Kb\";\n\t}else{\n\t\t$output = $bits . \" bits\";\n\t}\n\n\treturn $output;\n\n}", "function convertNumbersToFarsi($srting,$mode='html')\n\t{\n\t\tif ($mode=='html') {\n\t\t\t$num0=\"&#1776;\";\n\t\t\t$num1=\"&#1777;\";\n\t\t\t$num2=\"&#1778;\";\n\t\t\t$num3=\"&#1779;\";\n\t\t\t$num4=\"&#1780;\";\n\t\t\t$num5=\"&#1781;\";\n\t\t\t$num6=\"&#1782;\";\n\t\t\t$num7=\"&#1783;\";\n\t\t\t$num8=\"&#1784;\";\n\t\t\t$num9=\"&#1785;\";\n\t\t} elseif($mode=='plainText') {\n\t\t\t$num0=chr(hexdec('DB')).chr(hexdec('B0'));\n\t\t\t$num1=chr(hexdec('DB')).chr(hexdec('B1'));\n\t\t\t$num2=chr(hexdec('DB')).chr(hexdec('B2'));\n\t\t\t$num3=chr(hexdec('DB')).chr(hexdec('B3'));\n\t\t\t$num4=chr(hexdec('DB')).chr(hexdec('B4'));\n\t\t\t$num5=chr(hexdec('DB')).chr(hexdec('B5'));\n\t\t\t$num6=chr(hexdec('DB')).chr(hexdec('B6'));\n\t\t\t$num7=chr(hexdec('DB')).chr(hexdec('B7'));\n\t\t\t$num8=chr(hexdec('DB')).chr(hexdec('B8'));\n\t\t\t$num9=chr(hexdec('DB')).chr(hexdec('B9'));\n\t\t}\n\n\t\t$stringtemp=\"\";\n\t\t$len=strlen($srting);\n\t\tfor($sub=0;$sub<$len;$sub++) {\n\t\t\tif(substr($srting,$sub,1)==\"0\")$stringtemp.=$num0;\n\t\t\telseif(substr($srting,$sub,1)==\"1\")$stringtemp.=$num1;\n\t\t\telseif(substr($srting,$sub,1)==\"2\")$stringtemp.=$num2;\n\t\t\telseif(substr($srting,$sub,1)==\"3\")$stringtemp.=$num3;\n\t\t\telseif(substr($srting,$sub,1)==\"4\")$stringtemp.=$num4;\n\t\t\telseif(substr($srting,$sub,1)==\"5\")$stringtemp.=$num5;\n\t\t\telseif(substr($srting,$sub,1)==\"6\")$stringtemp.=$num6;\n\t\t\telseif(substr($srting,$sub,1)==\"7\")$stringtemp.=$num7;\n\t\t\telseif(substr($srting,$sub,1)==\"8\")$stringtemp.=$num8;\n\t\t\telseif(substr($srting,$sub,1)==\"9\")$stringtemp.=$num9;\n\t\t\telse $stringtemp.=substr($srting,$sub,1);\n\t\t}\n\t\treturn $stringtemp;\n\t}", "function format_toSizeInBytes_shortForm($size_in_bytes) {\n\t\t//\n\t\t// Data sizes are normally specified in KB - powers of 1024, so return KB rather than kB\n\n\t\tif ($size_in_bytes < (1024 * 1024)) {\n\t\t\t$unit = \"K\";\n\t\t\t$unitSize = $size_in_bytes / 1024;\n\t\t} else if ($size_in_bytes < (1024 * 1024 * 1024)) {\n\t\t\t$unit = \"M\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024);\n\t\t} else {\n\t\t\t$unit = \"G\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024 * 1024);\n\t\t}\n\n\t\t$showDecimalPlace = $unitSize < 10 && round($unitSize, 1) != round($unitSize);\n\n\t\treturn sprintf($showDecimalPlace ? \"%1.1f\" : \"%1.0f\", $unitSize) . $unit;\n\t}", "function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}", "function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}", "public function to($numbers);", "function number_format_i18n($number, $decimals = 0)\n {\n }", "static function Number_to_Word($num)\n\t{\n\t\t$fn = array();\n\n\t\tif ($num == 0)\n\t\t\treturn self::$nums[0];\n\n\t\twhile ($num != 0) {\n\t\t\tif ($num < 0) {\n\t\t\t\t$fn[] = self::$nums['-'];\n\t\t\t\t$num = -$num;\n\t\t\t}\n\t\t\telseif ($num < 20) {\n\t\t\t\t$fn[] = self::$nums[$num];\n\t\t\t\t$num = 0;\n\t\t\t}\n\t\t\telse if ($num < 100) {\n\t\t\t\t$val = floor($num / 10) * 10;\n\t\t\t\t$fn[] = self::$nums[$val];\n\t\t\t\tif (($num -= $val) > 0)\n\t\t\t\t\t$fn[] = '-';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($num < 1000) {\n\t\t\t\t\t$num -= ($val = floor($num / 100)) * 100;\n\t\t\t\t\t$fn[] = self::$nums[$val] . ' hundred';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($num < 1000000) {\n\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000)));\n\t\t\t\t\t\t$fn[] = 'thousand';\n\t\t\t\t\t\t$num = $num % 1000;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($num < 1000000000) {\n\t\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000000)));\n\t\t\t\t\t\t\t$fn[] = 'million';\n\t\t\t\t\t\t\t$num = $num % 1000000;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttrigger_error(\"WriteNum::write :: number is bigger than maximum allowed.\", E_USER_WARNING);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn preg_replace('/ \\- /', '-', implode(' ', $fn));\n\t}", "function convert_number_to_words($number)\n\t{\n\t\t$hyphen = '-';\n\t\t$conjunction = ' and ';\n\t\t$separator = ', ';\n\t\t$negative = 'negative ';\n\t\t$decimal = ' point ';\n\t\t$dictionary = array(\n\t\t\t0 => 'zero',\n\t\t\t1 => 'one',\n\t\t\t2 => 'two',\n\t\t\t3 => 'three',\n\t\t\t4 => 'four',\n\t\t\t5 => 'five',\n\t\t\t6 => 'six',\n\t\t\t7 => 'seven',\n\t\t\t8 => 'eight',\n\t\t\t9 => 'nine',\n\t\t\t10 => 'ten',\n\t\t\t11 => 'eleven',\n\t\t\t12 => 'twelve',\n\t\t\t13 => 'thirteen',\n\t\t\t14 => 'fourteen',\n\t\t\t15 => 'fifteen',\n\t\t\t16 => 'sixteen',\n\t\t\t17 => 'seventeen',\n\t\t\t18 => 'eighteen',\n\t\t\t19 => 'nineteen',\n\t\t\t20 => 'twenty',\n\t\t\t30 => 'thirty',\n\t\t\t40 => 'fourty',\n\t\t\t50 => 'fifty',\n\t\t\t60 => 'sixty',\n\t\t\t70 => 'seventy',\n\t\t\t80 => 'eighty',\n\t\t\t90 => 'ninety',\n\t\t\t100 => 'hundred',\n\t\t\t1000 => 'thousand',\n\t\t\t1000000 => 'million',\n\t\t\t1000000000 => 'billion',\n\t\t\t1000000000000 => 'trillion',\n\t\t\t1000000000000000 => 'quadrillion',\n\t\t\t1000000000000000000 => 'quintillion'\n\t\t);\n\n\t\tif (!is_numeric($number)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {\n\t\t\t// overflow\n\t\t\ttrigger_error(\n\t\t\t\t'convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,\n\t\t\t\tE_USER_WARNING\n\t\t\t);\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($number < 0) {\n\t\t\treturn $negative . convert_number_to_words(abs($number));\n\t\t}\n\n\t\t$string = $fraction = null;\n\n\t\tif (strpos($number, '.') !== false) {\n\t\t\tlist($number, $fraction) = explode('.', $number);\n\t\t}\n\n\t\tswitch (true) {\n\t\t\tcase $number < 21:\n\t\t\t\t$string = $dictionary[$number];\n\t\t\t\tbreak;\n\t\t\tcase $number < 100:\n\t\t\t\t$tens = ((int) ($number / 10)) * 10;\n\t\t\t\t$units = $number % 10;\n\t\t\t\t$string = $dictionary[$tens];\n\t\t\t\tif ($units) {\n\t\t\t\t\t$string .= $hyphen . $dictionary[$units];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase $number < 1000:\n\t\t\t\t$hundreds = $number / 100;\n\t\t\t\t$remainder = $number % 100;\n\t\t\t\t$string = $dictionary[$hundreds] . ' ' . $dictionary[100];\n\t\t\t\tif ($remainder) {\n\t\t\t\t\t$string .= $conjunction . convert_number_to_words($remainder);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$baseUnit = pow(1000, floor(log($number, 1000)));\n\t\t\t\t$numBaseUnits = (int) ($number / $baseUnit);\n\t\t\t\t$remainder = $number % $baseUnit;\n\t\t\t\t$string = convert_number_to_words($numBaseUnits) . ' ' . $dictionary[$baseUnit];\n\t\t\t\tif ($remainder) {\n\t\t\t\t\t$string .= $remainder < 100 ? $conjunction : $separator;\n\t\t\t\t\t$string .= convert_number_to_words($remainder);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (null !== $fraction && is_numeric($fraction)) {\n\t\t\t$string .= $decimal;\n\t\t\t$words = array();\n\t\t\tforeach (str_split((string) $fraction) as $number) {\n\t\t\t\t$words[] = $dictionary[$number];\n\t\t\t}\n\t\t\t$string .= implode(' ', $words);\n\t\t}\n\n\t\treturn $string;\n\t}", "public function formatNumber($number);", "public static function nice_number($number){\n\t\treturn number_format($number,0,'',',');\n\t}", "function bytesToHumanReadable (int $size, int $decimals = 2): string {\n\tif ($size >= 1 << 40)\n\t\treturn number_format($size / (1 << 40), $decimals).\"TB\";\n\tif ($size >= 1 << 30)\n\t\treturn number_format($size / (1 << 30), $decimals).\"GB\";\n\tif ($size >= 1 << 20)\n\t\treturn number_format($size / (1 << 20), $decimals).\"MB\";\n\tif ($size >= 1 << 10)\n\t\treturn number_format($size / (1 << 10), $decimals).\"KB\";\n\treturn number_format($size, $decimals).\"B\";\n}", "function numberToText($num) {\n if(!is_numeric($num)){\n $num = intval($num);\n if(!is_numeric($num)) return 'NaN';\n }\n $numbers = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty');\n return $numbers[$num];\n}", "function toChinese($number) {\n $wording = str_split((string)$number);\n\n $numberArray = ['十', '一', '二', '三', '四', '五', '六', '七', '八', '九'];\n $tenNumberArray = ['十', '廿', '卅', '四', '五', '六', '七', '八', '九'];\n\n if ($number > 10) {\n return $tenNumberArray[(int)$wording[0] - 1] . $numberArray[(int)$wording[1]];\n }\n if ($number == 10) {\n return '十' . '岁';\n }\n return $numberArray[(int)$wording[0]] . '岁';\n }", "function numeral($number) {\r\n $test = abs($number) % 10;\r\n $ext = ((abs($number) % 100 < 21 and abs($number) % 100 > 4) ? 'th' : (($test < 4) ? ($test < 3) ? ($test < 2) ? ($test < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th'));\r\n return $number . $ext;\r\n}", "function number_suffix($i) {\n\t\tif ($i%10 == 1 && $i%100 != 11) {\n\t\t\treturn \"st\";\n\t\t} else if ($i%10 == 2 && $i%100 != 12) {\n\t\t\treturn \"nd\";\n\t\t} else if ($i%10 == 3 && $i%100 != 13) {\n\t\t\treturn \"rd\";\n\t\t} else {\n\t\t\treturn \"th\";\n\t\t}\n\t}", "Function float2largearray($n) {\r\n $result = array();\r\n while ($n > 0) {\r\n array_push($result, ($n & 0xffff));\r\n list($n, $dummy) = explode('.', sprintf(\"%F\", $n/65536.0));\r\n # note we don't want to use \"%0.F\" as it will get rounded which is bad.\r\n }\r\n return $result;\r\n}", "function convertToIndianCurrency($number) {\n $no = round($number);\n $decimal = round($number - ($no = floor($number)), 2) * 100; \n $digits_length = strlen($no); \n $i = 0;\n $str = array();\n $words = array(\n 0 => '',\n 1 => 'One',\n 2 => 'Two',\n 3 => 'Three',\n 4 => 'Four',\n 5 => 'Five',\n 6 => 'Six',\n 7 => 'Seven',\n 8 => 'Eight',\n 9 => 'Nine',\n 10 => 'Ten',\n 11 => 'Eleven',\n 12 => 'Twelve',\n 13 => 'Thirteen',\n 14 => 'Fourteen',\n 15 => 'Fifteen',\n 16 => 'Sixteen',\n 17 => 'Seventeen',\n 18 => 'Eighteen',\n 19 => 'Nineteen',\n 20 => 'Twenty',\n 30 => 'Thirty',\n 40 => 'Forty',\n 50 => 'Fifty',\n 60 => 'Sixty',\n 70 => 'Seventy',\n 80 => 'Eighty',\n 90 => 'Ninety');\n $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\n while ($i < $digits_length) {\n $divider = ($i == 2) ? 10 : 100;\n $number = floor($no % $divider);\n $no = floor($no / $divider);\n $i += $divider == 10 ? 1 : 2;\n if ($number) {\n $plural = (($counter = count($str)) && $number > 9) ? 's' : null; \n $str [] = ($number < 21) ? $words[$number] . ' ' . $digits[$counter] . $plural : $words[floor($number / 10) * 10] . ' ' . $words[$number % 10] . ' ' . $digits[$counter] . $plural;\n } else {\n $str [] = null;\n } \n }\n \n $Rupees = implode(' ', array_reverse($str));\n $paise = ($decimal) ? \"And Paise \" . ($words[$decimal - $decimal%10]) .\" \" .($words[$decimal%10]) : '';\n return ($Rupees ? 'Rupees ' . $Rupees : '') . $paise . \" Only\";\n }", "function format($number) {\r\n\t$number = bcdiv($number, 100000000, 8);\r\n\t$point = strpos($number,\".\");\r\n\tif($point != -1) {\r\n\t\t$after = substr($number,$point+1);\r\n\t\t$after = strlen($after);\r\n\t\t$after = 8-$after;\r\n\t\tfor($i=0;$i<$after;$i++) {\r\n\t\t\t$number .= \"0\";\r\n\t\t}\r\n\t} else {\r\n\t\t$number .= \".00000000\";\r\n\t}\r\n\treturn($number);\r\n}", "public function convert($number)\n {\n $number = str_replace('.', '', $number);\n if ( ! is_numeric($number)) throw new Exception(\"Please input number.\");\n $base = array('nol', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan');\n $numeric = array('1000000000000000', '1000000000000', '1000000000000', 1000000000, 1000000, 1000, 100, 10, 1);\n $unit = array('kuadriliun', 'triliun', 'biliun', 'milyar', 'juta', 'ribu', 'ratus', 'puluh', '');\n $str = null;\n $i = 0;\n if ($number == 0) {\n $str = 'nol';\n } else {\n while ($number != 0) {\n $count = (int)($number / $numeric[$i]);\n if ($count >= 10) {\n $str .= static::convert($count) . ' ' . $unit[$i] . ' ';\n } elseif ($count > 0 && $count < 10) {\n $str .= $base[$count] . ' ' . $unit[$i] . ' ';\n }\n $number -= $numeric[$i] * $count;\n $i++;\n }\n $str = preg_replace('/satu puluh (\\w+)/i', '\\1 belas', $str);\n $str = preg_replace('/satu (ribu|ratus|puluh|belas)/', 'se\\1', $str);\n $str = preg_replace('/\\s{2,}/', ' ', trim($str));\n }\n return $str;\n }", "private function twodigits($num)\n {\n //displays from 1 to 99\n if($num<20)\n return $this->discrete[$num];\n else\n return $this->ten_digit_prefix[substr($num,0,1)].' '.$this->discrete[substr($num,1,1)];\n }", "function add_commas($number)\n{\n $parts = explode('.', $number);\n $parts[0] = number_format($number);\n $number = implode('.', $parts);\n return $number;\n}", "function tfnm_format_number( $number, $decimal_places ){\n\n\t// Checking it is in fact a number before formatting to be safe.\n\tif( is_int( $number ) || is_float( $number ) ){\n\t\treturn number_format( $number, $decimal_places, '.', ',' );\n\t}\n\n\t// Just return what was inputted if it fails the checks above.\n\treturn $number;\n}", "function convertToNotation(int $bytes) {\n\n\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t$bytes = max($bytes, 0); \n\t$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); \n\t$pow = min($pow, count($units) - 1);\n\t$bytes /= pow(1024, $pow);\n\n return round($bytes, 2).$units[$pow]; \n\n}", "public function testFormatNumber()\n {\n $target_value = 1.67583978;\n $initial_value = 1.675839781223232323223232323;\n \n $this->assertEquals($target_value, format_number($initial_value));\n }", "public function numbers(array $options = []): string\n {\n $paging = $this->params();\n\n $first = $last = $current = 1;\n\n if ($paging) {\n $first = $paging['current'] > 5 ? ($paging['current'] - 4) : 1;\n $last = $first + 7;\n if ($last > $paging['pages']) {\n $last = $paging['pages'];\n }\n $current = $paging['current'];\n }\n\n $output = '';\n $query = $this->request()->query();\n for ($i = $first; $i < $last + 1; ++$i) {\n $template = 'number';\n if ($current == $i) {\n $template = 'numberActive';\n }\n $query['page'] = $i;\n\n $options['url'] = $this->request()->path() . '?' . http_build_query($query);\n $options['text'] = $i;\n $output .= $this->templater()->format($template, $options);\n }\n\n return $output;\n }", "public static function shortEncode(int $num): string {\n $codes = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $array = [];\n while ($num > 0){\n $array[] = $num % 62;\n $num = floor($num / 62);\n }\n if (count($array) < 1) $array = [0];\n foreach ($array as &$value) {\n $value = $codes[$value];\n }\n return strrev(implode('',$array));\n }", "function formatAmountSimply($v,$t=1){\n return number_format($v,2,'.',',');\n}", "function convertNum($num) {\n $num = (int) $num; // make sure it's an integer\n\n if ($num < 0)\n return 'negative' . convertTri(-$num, 0);\n\n if ($num == 0)\n return 'Zero';\n return convertTri($num, 0);\n}", "function makeInteger()\r\n{\r\n $array = array();\r\n for ($i = 0; $i < 10000; $i++) {\r\n $array[] = rand(100, 999);\r\n }\r\n\r\n return join(\"\\n\", $array);\r\n}", "function nb2chiffres($nb){\n\treturn sprintf(\"%02d\", $nb);\n}", "function kwh(float $number)\n{\n return number_format($number, '2', ',', '');\n}", "public static function padeg($number, $variants)\n\t{\n\t\t\n\t\tif ($number == 0) {\n\t\t\treturn str_replace('{n}', $number, $variants[0]);\n\t\t}\n\t\telseif ($number % 100 > 10 && $number % 100 < 20) {\n\t\t\treturn str_replace('{n}', $number, $variants[3]);\n\t\t}\n\t\telseif (in_array($number % 10, [2,3,4])) {\n\t\t\treturn str_replace('{n}', $number, $variants[2]);\n\t\t}\n\t\telseif ($number % 10 == 1) {\n\t\t\treturn str_replace('{n}', $number, $variants[1]);\n\t\t}\n\t\telse {\n\t\t\treturn str_replace('{n}', $number, $variants[3]);\n\t\t}\n\t}", "function format_number($value=0)\n{\n\tif ((is_numeric( $value ) AND floor( $value ) != $value)) {\n\t\treturn number_format($value, 2, '.', ',');\n\t} else {\n\t\treturn number_format($value);\n\t}\n}", "function packFBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFBchunk\");\n\n\t\t$lower_limit_high_word = -16383;\n\t\t$upper_limit_high_word = 16383;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFBchunk argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\tif ($low_word < $lower_limit_low_word) {\n\n\t\t\t$low_word = $lower_limit_low_word;\n\t\t}\n\n\t\tif ($low_word > $upper_limit_low_word) {\n\n\t\t\t$low_word = $upper_limit_low_word;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"1\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"1\" . substr(decbin($high_word), 18);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"0\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"0\" . decbin($high_word);\n\t\t\t}\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = ~$low_word;\n\n\t\t\t\t$low_word = substr(decbin(intval($low_word * 65536 / 10000)), 16);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = sprintf(\"%016s\", decbin(intval($low_word * 65536 / 10000)));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $high_word . $low_word;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}", "function filterNumber($num)\n{\n return number_format(floatval($num), 2, '.', ',');\n}", "function format_megabytes($megabytes)\n{\n if ($megabytes >= 1000) {\n return $megabytes / 1000 . 'GB';\n }\n\n if ($megabytes >= 1000000) {\n return $megabytes / 1000000 . 'TB';\n }\n\n return $megabytes . 'MB';\n}", "function extendedencode($data, &$maxvalue='notspecified')\n{\n $grid = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',\n 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',\n 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',\n 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '.');\n\n // try to find reasonable maximum value\n if(is_numeric($maxvalue)){\n // assume below manipulations are better than what caller is doing\n $max = ceil($maxvalue);\n } else {\n $max = ceil(max($data));\n }\n $precision = strlen($max) - 1;\n $maxvalue = ceil($max/pow(10,$precision));\n $maxvalue = $maxvalue * pow(10, $precision);\n\n $multiplier = (float)(count($grid) * count($grid)) / $maxvalue;\n\n $ret = '';\n for($i=0;$i<count($data);$i++){\n if(!is_numeric($data[$i])){\n $ret .= '__';\n } else {\n $datum = $data[$i] * $multiplier;\n $x = (int)($datum / count($grid));\n $y = $datum % 64;\n $ret .= $grid[$x].$grid[$y];\n }\n }\n return $ret;\n}", "function unify_number($number){\n $number = str_replace([\" \", \"-\"], \"\", $number); // Android likes to put those in\n if( strpos($number, \"00\") === 0 )\n return \"+\".substr($number, 2);\n if( strpos($number, \"0\") === 0 )\n return \"+49\".substr($number, 1);\n if( strpos($number, \"+\") === 0 ){\n return $number;\n }\n return \"+496659\".$number;\n}", "static public function fixNumber( $nToFix, $nDefault, $nMin=\"\", $nMax=\"\" ) {\n\n if ( ! is_numeric( trim( $nToFix ) ) ) return $nDefault;\n if ( $nMin !== \"\" && $nToFix < $nMin ) return $nMin;\n if ( $nMax !== \"\" && $nToFix > $nMax ) return $nMax;\n return $nToFix;\n \n }", "public static function bigBaseConvert($number)\n {\n $result = '';\n\n $bin = substr(chunk_split(strrev($number), 4, '-'), 0, -1);\n $temp = preg_split('[-]', $bin, -1, PREG_SPLIT_DELIM_CAPTURE);\n \n for ($i = count($temp)-1;$i >= 0;$i--) {\n \n $result = $result . base_convert(strrev($temp[$i]), 2, 16);\n }\n \n return strtoupper($result);\n }" ]
[ "0.70921326", "0.6916145", "0.68754935", "0.66312075", "0.6278991", "0.6278644", "0.62614506", "0.6245244", "0.6238312", "0.6224972", "0.61778045", "0.6056732", "0.60521775", "0.6026802", "0.6007218", "0.6007218", "0.5987977", "0.59821194", "0.59566087", "0.59526217", "0.5722797", "0.56741506", "0.5669971", "0.5669839", "0.5664108", "0.5627459", "0.5619207", "0.5615606", "0.5612081", "0.5606353", "0.55902493", "0.5574871", "0.55696356", "0.5519085", "0.5492803", "0.547991", "0.5465944", "0.543003", "0.5419277", "0.5411357", "0.53729266", "0.53704184", "0.5366766", "0.53659505", "0.5346106", "0.53235364", "0.5317343", "0.53153473", "0.5304194", "0.5298269", "0.529729", "0.525501", "0.52464837", "0.5235798", "0.5221001", "0.5217387", "0.52130836", "0.5212821", "0.5176709", "0.5170942", "0.51702094", "0.5161173", "0.51435983", "0.51401126", "0.51401126", "0.51376194", "0.51341134", "0.51331013", "0.51304287", "0.51280063", "0.5126394", "0.51179", "0.5098475", "0.5086434", "0.5069062", "0.50575036", "0.50441176", "0.50361514", "0.502076", "0.50189924", "0.50177664", "0.5002394", "0.49868736", "0.4979638", "0.49662745", "0.4957425", "0.49542838", "0.4952222", "0.49501288", "0.49480695", "0.49437776", "0.4943321", "0.49427786", "0.49368373", "0.49198282", "0.49153545", "0.49146676", "0.49132097", "0.49066398", "0.49024588", "0.48995858" ]
0.0
-1
A general purpose, localeaware, number_format method. Used by all of the functions of the number_helper.
function format_number(float $num, int $precision = 1, ?string $locale = null, array $options = []): string { // If locale is not passed, get from the default locale that is set from our config file // or set by HTTP content negotiation. $locale ??= Locale::getDefault(); // Type can be any of the NumberFormatter options, but provide a default. $type = (int) ($options['type'] ?? NumberFormatter::DECIMAL); $formatter = new NumberFormatter($locale, $type); // Try to format it per the locale if ($type === NumberFormatter::CURRENCY) { $formatter->setAttribute(NumberFormatter::FRACTION_DIGITS, $options['fraction']); $output = $formatter->formatCurrency($num, $options['currency']); } else { // In order to specify a precision, we'll have to modify // the pattern used by NumberFormatter. $pattern = '#,##0.' . str_repeat('#', $precision); $formatter->setPattern($pattern); $output = $formatter->format($num); } // This might lead a trailing period if $precision == 0 $output = trim($output, '. '); if (intl_is_failure($formatter->getErrorCode())) { throw new BadFunctionCallException($formatter->getErrorMessage()); } // Add on any before/after text. if (isset($options['before']) && is_string($options['before'])) { $output = $options['before'] . $output; } if (isset($options['after']) && is_string($options['after'])) { $output .= $options['after']; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberformat( $num ) {\n\tglobal $lang;\n\tif ( $lang == 'www' || $lang == 'meta' || $lang == 'commons' || $lang == 'en' || $lang == 'incubator' ) {\n\t\treturn number_format($num);\n\t}\n\telseif ( $lang == 'fr' ) {\n\t\treturn number_format($num, 0, ',', ' ');\n\t}\n\telse {\n\t\treturn number_format($num);\n\t}\n}", "function number_format_i18n($number, $decimals = 0)\n {\n }", "public function formatNumber($number);", "function do_number_format($number)\n\t{\n\t\tif ( $this->vars['number_format'] != 'none' )\n\t\t{ \n\t\t\treturn number_format($number , 0, '', $this->num_format);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $number;\n\t\t}\n\t}", "public function numberFormatDataProvider() {}", "function format( $number , $format=null )\n {\n if( $format == null ){\n $format = $this->getFormat();\n }\n\n // handle custom formats too\n if ($format >= I18N_CUSTOM_FORMATS_OFFSET) {\n if (isset($this->_customFormats[$format])) {\n $numberFormat = $this->_customFormats[$format];\n }\n } else {\n $numberFormat = $this->_localeObj->numberFormat[$format]; \n }\n return call_user_func_array( 'number_format' , array_merge( array($number),$numberFormat) );\n }", "function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }", "function international_num_format($input, $decimals = 2)\n\t{\n\t\tglobal $config;\n\n\t\tswitch ($config['number_format_style']) {\n\t\t\tcase '2': // spain, germany\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '3': // estonia\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '4': // france, norway\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '5': // switzerland\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, \",\", \"'\");\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, \",\", \"'\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '6': // kazahistan\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ',');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ',');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t} // end switch\n\t\treturn $output;\n\t}", "function yourls_number_format_i18n( $number, $decimals = 0 ) {\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\t$formatted = number_format( $number, abs( intval( $decimals ) ), $yourls_locale_formats->number_format['decimal_point'], $yourls_locale_formats->number_format['thousands_sep'] );\n\treturn yourls_apply_filter( 'number_format_i18n', $formatted );\n}", "function number_format($number, $type = _NUM_TYPE)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase \"figure\":\n\t\t\t\treturn XoopsLocaleJalali::Convertnumber2farsi($number);\n\t\t\t\tbreak;\n\t\t\tcase \"word\":\n\t\t\t\treturn ($number > 0) ? self::num2Words($number) : _NUMWORDS_ZERO;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $number;\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "function numberFormat($amount) {\n try {\n return number_format($amount);\n } catch (Exception $e) {\n return $amount;\n }\n }", "function money_format($format, $number) {\r\n\t\tif (function_exists('money_format')) {\r\n\t\t\treturn money_format($format, $number);\r\n\t\t}\r\n\t\tif (setlocale(LC_MONETARY, 0) == 'C') {\r\n\t\t\tsetlocale(LC_MONETARY, '');\r\n\t\t\t//return number_format($number, 2);\r\n\t\t}\r\n\r\n\t\t$locale = localeconv();\r\n\r\n\t\t$regex = '/%((?:[\\^!\\-]|\\+|\\(|\\=.)*)([0-9]+)?'\r\n\t\t\t\t. '(?:#([0-9]+))?(?:\\.([0-9]+))?([in%])/';\r\n\r\n\t\tpreg_match_all($regex, $format, $matches, PREG_SET_ORDER);\r\n\r\n\t\tforeach ($matches as $fmatch) {\r\n\t\t\t$value = floatval($number);\r\n\t\t\t$flags = array(\r\n\t\t\t\t\t'fillchar' => preg_match('/\\=(.)/', $fmatch[1], $match) ? $match[1]\r\n\t\t\t\t\t\t\t: ' ',\r\n\t\t\t\t\t'nogroup' => preg_match('/\\^/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'usesignal' => preg_match('/\\+|\\(/', $fmatch[1], $match) ? $match[0]\r\n\t\t\t\t\t\t\t: '+',\r\n\t\t\t\t\t'nosimbol' => preg_match('/\\!/', $fmatch[1]) > 0,\r\n\t\t\t\t\t'isleft' => preg_match('/\\-/', $fmatch[1]) > 0);\r\n\t\t\t$width = trim($fmatch[2]) ? (int) $fmatch[2] : 0;\r\n\t\t\t$left = trim($fmatch[3]) ? (int) $fmatch[3] : 0;\r\n\t\t\t$right = trim($fmatch[4]) ? (int) $fmatch[4]\r\n\t\t\t\t\t: $locale['int_frac_digits'];\r\n\t\t\t$conversion = $fmatch[5];\r\n\r\n\t\t\t$positive = true;\r\n\t\t\tif ($value < 0) {\r\n\t\t\t\t$positive = false;\r\n\t\t\t\t$value *= -1;\r\n\t\t\t}\r\n\t\t\t$letter = $positive ? 'p' : 'n';\r\n\r\n\t\t\t$prefix = $suffix = $cprefix = $csuffix = $signal = '';\r\n\r\n\t\t\t$signal = $positive ? $locale['positive_sign']\r\n\t\t\t\t\t: $locale['negative_sign'];\r\n\t\t\tswitch (true) {\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 1\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$prefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 2\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$suffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 3\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$cprefix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 4\r\n\t\t\t\t\t&& $flags['usesignal'] == '+':\r\n\t\t\t\t$csuffix = $signal;\r\n\t\t\t\tbreak;\r\n\t\t\tcase $flags['usesignal'] == '(':\r\n\t\t\tcase $locale[\"{$letter}_sign_posn\"] == 0:\r\n\t\t\t\t$prefix = '(';\r\n\t\t\t\t$suffix = ')';\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (!$flags['nosimbol']) {\r\n\t\t\t\t$currency = $cprefix\r\n\t\t\t\t\t\t. ($conversion == 'i' ? $locale['int_curr_symbol']\r\n\t\t\t\t\t\t\t\t: $locale['currency_symbol']) . $csuffix;\r\n\t\t\t} else {\r\n\t\t\t\t$currency = '';\r\n\t\t\t}\r\n\t\t\t$space = $locale[\"{$letter}_sep_by_space\"] ? ' ' : '';\r\n\r\n\t\t\t$value = number_format($value, $right,\r\n\t\t\t\t\t$locale['mon_decimal_point'],\r\n\t\t\t\t\t$flags['nogroup'] ? '' : $locale['mon_thousands_sep']);\r\n\t\t\t$value = @explode($locale['mon_decimal_point'], $value);\r\n\r\n\t\t\t$n = strlen($prefix) + strlen($currency) + strlen($value[0]);\r\n\t\t\tif ($left > 0 && $left > $n) {\r\n\t\t\t\t$value[0] = str_repeat($flags['fillchar'], $left - $n)\r\n\t\t\t\t\t\t. $value[0];\r\n\t\t\t}\r\n\t\t\t$value = implode($locale['mon_decimal_point'], $value);\r\n\t\t\tif ($locale[\"{$letter}_cs_precedes\"]) {\r\n\t\t\t\t$value = $prefix . $currency . $space . $value . $suffix;\r\n\t\t\t} else {\r\n\t\t\t\t$value = $prefix . $value . $space . $currency . $suffix;\r\n\t\t\t}\r\n\t\t\tif ($width > 0) {\r\n\t\t\t\t$value = str_pad($value, $width, $flags['fillchar'],\r\n\t\t\t\t\t\t$flags['isleft'] ? STR_PAD_RIGHT : STR_PAD_LEFT);\r\n\t\t\t}\r\n\r\n\t\t\t$format = str_replace($fmatch[0], $value, $format);\r\n\t\t}\r\n\t\treturn $format;\r\n\t}", "function format_number(int|float|string $input, int|bool|null $decimals = 0, string $decimal_separator = null, string $thousand_separator = null): string|null\n{\n if (is_string($input)) {\n if (!is_numeric($input)) {\n trigger_error(sprintf('%s(): Invalid non-numeric input', __function__));\n return null;\n }\n\n $input += 0;\n }\n\n $export = var_export($input, true);\n\n // Auto-detect decimals.\n if (is_true($decimals)) {\n $decimals = strlen(stracut($export, '.'));\n }\n\n // Prevent corruptions.\n if ($decimals > PRECISION) {\n $decimals = PRECISION;\n }\n\n $ret = number_format($input, (int) $decimals, $decimal_separator, $thousand_separator);\n\n // Append \".0\" for eg: 1.0 & upper NAN/INF.\n if (!$decimals && !is_int($input) && strlen($export) == 1) {\n $ret .= '.0';\n } elseif ($ret == 'inf' || $ret == 'nan') {\n $ret = strtoupper($ret);\n }\n\n return $ret;\n}", "function money_format($format, $number)\n{\n $regex = '/%((?:[\\^!\\-]|\\+|\\(|\\=.)*)([0-9]+)?'.\n '(?:#([0-9]+))?(?:\\.([0-9]+))?([in%])/';\n if (setlocale(LC_MONETARY, 0) == 'C') {\n setlocale(LC_MONETARY, '');\n }\n $locale = localeconv();\n preg_match_all($regex, $format, $matches, PREG_SET_ORDER);\n foreach ($matches as $fmatch) {\n $value = floatval($number);\n $flags = array(\n 'fillchar' => preg_match('/\\=(.)/', $fmatch[1], $match) ?\n $match[1] : ' ',\n 'nogroup' => preg_match('/\\^/', $fmatch[1]) > 0,\n 'usesignal' => preg_match('/\\+|\\(/', $fmatch[1], $match) ?\n $match[0] : '+',\n 'nosimbol' => preg_match('/\\!/', $fmatch[1]) > 0,\n 'isleft' => preg_match('/\\-/', $fmatch[1]) > 0\n );\n $width = trim($fmatch[2]) ? (int)$fmatch[2] : 0;\n $left = trim($fmatch[3]) ? (int)$fmatch[3] : 0;\n $right = trim($fmatch[4]) ? (int)$fmatch[4] : $locale['int_frac_digits'];\n $conversion = $fmatch[5];\n\n $positive = true;\n if ($value < 0) {\n $positive = false;\n $value *= -1;\n }\n $letter = $positive ? 'p' : 'n';\n\n $prefix = $suffix = $cprefix = $csuffix = $signal = '';\n\n $signal = $positive ? $locale['positive_sign'] : $locale['negative_sign'];\n switch (true) {\n case $locale[\"{$letter}_sign_posn\"] == 1 && $flags['usesignal'] == '+':\n $prefix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 2 && $flags['usesignal'] == '+':\n $suffix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 3 && $flags['usesignal'] == '+':\n $cprefix = $signal;\n break;\n case $locale[\"{$letter}_sign_posn\"] == 4 && $flags['usesignal'] == '+':\n $csuffix = $signal;\n break;\n case $flags['usesignal'] == '(':\n case $locale[\"{$letter}_sign_posn\"] == 0:\n $prefix = '(';\n $suffix = ')';\n break;\n }\n if (!$flags['nosimbol']) {\n $currency = $cprefix .\n ($conversion == 'i' ? $locale['int_curr_symbol'] : $locale['currency_symbol']) .\n $csuffix;\n } else {\n $currency = '';\n }\n $space = $locale[\"{$letter}_sep_by_space\"] ? ' ' : '';\n\n $value = number_format($value, $right, $locale['mon_decimal_point'],\n $flags['nogroup'] ? '' : $locale['mon_thousands_sep']);\n $value = @explode($locale['mon_decimal_point'], $value);\n\n $n = strlen($prefix) + strlen($currency) + strlen($value[0]);\n if ($left > 0 && $left > $n) {\n $value[0] = str_repeat($flags['fillchar'], $left - $n) . $value[0];\n }\n $value = implode($locale['mon_decimal_point'], $value);\n if ($locale[\"{$letter}_cs_precedes\"]) {\n $value = $prefix . $currency . $space . $value . $suffix;\n } else {\n $value = $prefix . $value . $space . $currency . $suffix;\n }\n if ($width > 0) {\n $value = str_pad($value, $width, $flags['fillchar'], $flags['isleft'] ?\n STR_PAD_RIGHT : STR_PAD_LEFT);\n }\n\n $format = str_replace($fmatch[0], $value, $format);\n }\n return $format;\n}", "function erp_number_format_i18n( $number ) {\n // cast as string\n $number = (string) $number;\n\n // check if . exist\n if ( strpos( $number, '.' ) !== false ) {\n $extract = explode( '.', $number );\n if ( isset( $extract[1] ) && absint( $extract[1] > 0 ) ) {\n return number_format_i18n( $number, 1 );\n }\n }\n return number_format_i18n( $number );\n}", "function format_number($value=0)\n{\n\tif ((is_numeric( $value ) AND floor( $value ) != $value)) {\n\t\treturn number_format($value, 2, '.', ',');\n\t} else {\n\t\treturn number_format($value);\n\t}\n}", "protected function numberFormat($number)\n {\n return number_format($number, 2, $this->t('decimalSeparator'), $this->t('thousandsSeparator'));\n }", "function format($val) {\r\n //setlocale(LC_MONETARY, 'en_US');\r\n return number_format(money_format('%i', $val), 2);\r\n }", "protected function formatNumber(string $number, NumberFormat $numberFormat, array $options = []): string\n {\n $parsedPattern = $this->getParsedPattern($numberFormat, $options['style']);\n // Start by rounding the number, if rounding is enabled.\n if (is_int($options['rounding_mode'])) {\n $number = Calculator::round($number, $options['maximum_fraction_digits'], $options['rounding_mode']);\n }\n $negative = (Calculator::compare('0', $number, 12) == 1);\n // Ensure that the value is positive and has the right number of digits.\n $signMultiplier = $negative ? '-1' : '1';\n $number = bcdiv($number, $signMultiplier, $options['maximum_fraction_digits']);\n // Split the number into major and minor digits.\n $numberParts = explode('.', $number);\n $majorDigits = $numberParts[0];\n // Account for maximumFractionDigits = 0, where the number won't\n // have a decimal point, and $numberParts[1] won't be set.\n $minorDigits = isset($numberParts[1]) ? $numberParts[1] : '';\n\n if ($options['use_grouping'] && $parsedPattern->isGroupingUsed()) {\n // Reverse the major digits, since they are grouped from the right.\n $majorDigits = array_reverse(str_split($majorDigits));\n // Group the major digits.\n $groups = [];\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getPrimaryGroupSize());\n while (!empty($majorDigits)) {\n $groups[] = array_splice($majorDigits, 0, $parsedPattern->getSecondaryGroupSize());\n }\n // Reverse the groups and the digits inside of them.\n $groups = array_reverse($groups);\n foreach ($groups as &$group) {\n $group = implode(array_reverse($group));\n }\n // Reconstruct the major digits.\n $majorDigits = implode(',', $groups);\n }\n\n if ($options['minimum_fraction_digits'] < $options['maximum_fraction_digits']) {\n // Strip any trailing zeroes.\n $minorDigits = rtrim($minorDigits, '0');\n if (strlen($minorDigits) < $options['minimum_fraction_digits']) {\n // Now there are too few digits, re-add trailing zeroes\n // until the desired length is reached.\n $neededZeroes = $options['minimum_fraction_digits'] - strlen($minorDigits);\n $minorDigits .= str_repeat('0', $neededZeroes);\n }\n }\n\n // Assemble the final number and insert it into the pattern.\n $number = strlen($minorDigits) ? $majorDigits . '.' . $minorDigits : $majorDigits;\n $pattern = $negative ? $parsedPattern->getNegativePattern() : $parsedPattern->getPositivePattern();\n $number = preg_replace('/#(?:[\\.,]#+)*0(?:[,\\.][0#]+)*/', $number, $pattern);\n $number = $this->localizeNumber($number, $numberFormat);\n\n return $number;\n }", "function smarty_modifier_number_format($string, $places=2, $dec=\",\", $thoussep=\" \")\n{\n if (!$string) return $string;\n return number_format($string, $places, $dec, $thoussep);\n}", "function formatInIndianStyle($num){\n\t $pos = strpos((string)$num, \".\");\n\t if ($pos === false) { $decimalpart=\"00\";}\n\t else { $decimalpart= substr($num, $pos+1, 2); $num = substr($num,0,$pos); }\n\n\t if(strlen($num)>3 & strlen($num) <= 12){\n\t\t\t\t $last3digits = substr($num, -3 );\n\t\t\t\t $numexceptlastdigits = substr($num, 0, -3 );\n\t\t\t\t $formatted = makecomma($numexceptlastdigits);\n\t\t\t\t $stringtoreturn = $formatted.\",\".$last3digits.\".\".$decimalpart ;\n\t }elseif(strlen($num)<=3){\n\t\t\t\t $stringtoreturn = $num.\".\".$decimalpart ;\n\t }elseif(strlen($num)>12){\n\t\t\t\t $stringtoreturn = number_format($num, 2);\n\t }\n\n\t if(substr($stringtoreturn,0,2)==\"-,\"){$stringtoreturn = \"-\".substr($stringtoreturn,2 );}\n\t return $stringtoreturn;\n\t}", "function dayNumberFormat() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_dayNumberFormat = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_dayNumberFormat;\n\t}", "private static function numberFormat($number)\r\n {\r\n if (!is_string($number))\r\n return number_format($number, 2, ',', ' ');\r\n else\r\n return $number;\r\n }", "protected function numberFormatter($n) {\r\n $n = (0+str_replace(\",\",\"\",$n));\r\n\r\n // is this a number?\r\n if(!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if($n>1000000000000) return round(($n/1000000000000),1).' trillion';\r\n else if($n>1000000000) return round(($n/1000000000),1).' milliarder';\r\n else if($n>1000000) return round(($n/1000000),1).' millioner';\r\n else if($n>1000) return round(($n/1000),1).' tusind';\r\n\r\n return number_format($n);\r\n }", "public function getNumberFormat()\n {\n return $this->numberFormat;\n }", "public function formatNumber($value)\n\t{\n\t\treturn $value;\n\t}", "function format_number_in_french($number)\n {\n return number_format($number, 2, ',', ' ');\n }", "public static function formatNumber($num){\r\n\t\treturn number_format($num, 0, '', '.');\r\n\t}", "function FormatNumber($number, $decimals = 0)\n{\n if (is_numeric($number)) {\n return number_format($number, $decimals, ',', '.');\n } else {\n return number_format(0, $decimals, ',', '.');\n }\n}", "public function testFormatWithDefaults()\n {\n // test defaultLocale with 3 digits\n $formatted = $this->priceFormatter->format(123.45, 3);\n\n $this->assertEquals('123,450', $formatted, 'price format for defaultLocale does not match');\n\n // test defaultLocale with default amount of digits (see self::setUp)\n $formatted = $this->priceFormatter->format(123.45);\n\n $this->assertEquals('123,45', $formatted, 'price format for default digits does not match');\n }", "protected function get_number_formatter()\n\t{\n\t\treturn new NumberFormatter($this);\n\t}", "public function formatLocale(float $number, ?int $decimals = 0, ?string $locale = null): string\n {\n if ($locale === null) {\n $locale = $this->localizationService->getConfiguration()->getCurrentLocale();\n }\n setlocale(LC_NUMERIC, $locale);\n $conf = localeconv();\n return number_format($number, $decimals, $conf['decimal_point'], $conf['thousands_sep']);\n }", "public static function numberFormat($number)\n {\n return number_format($number,2,'.','');\n }", "public static function GetMoneyFormat($number){\n setlocale(LC_MONETARY, 'en_US');\n $FormatAmt = money_format('%!i', $number) . \"\\n\";\n \n return $FormatAmt;\n \n }", "private function formatNumber($number)\n {\n return number_format($number, 0, ',', '.');\n }", "function formatAmountSimply($v,$t=1){\n return number_format($v,2,'.',',');\n}", "public static function number($number, $options = '')\n\t{\n\n\t\t// Handle specific values AND types (this makes sure to allow '0' as a string and 0 as an integer)\n\t\tif ($number === '' || $number === false || $number === null) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$formatted_number = false;\n\n\t\t/** Define the default argument array. */\n\t\t$defaults = array(\n\t\t\t'add_commas' => true,\n\t\t\t'add_currency_sign' => true,\n\t\t\t'abbreviate' => true\n\t\t);\n\n\t\t/** Merge the arguments with the defaults. */\n\t\t$options = wp_parse_args($options, $defaults);\n\n\t\t//given a number, properly insert commas. \n\t\tif ($options['add_commas']) {\n\t\t\t$formatted_number = number_format($number);\n\t\t}\n\n\t\tif ($options['abbreviate']) {\n\t\t\t$formatted_number = self::abbreviate_number($formatted_number);\n\t\t}\n\n\t\t//insert $ sign.\n\t\tif ($options['add_currency_sign']) {\n\t\t\t$formatted_number = pls_get_currency_symbol() . $formatted_number;\n\t\t}\n\n\t\treturn $formatted_number;\n\n\t}", "function twig_number_format_filter(Twig_Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null)\n{\n $defaults = $env->getExtension('core')->getNumberFormat();\n if (null === $decimal) {\n $decimal = $defaults[0];\n }\n if (null === $decimalPoint) {\n $decimalPoint = $defaults[1];\n }\n if (null === $thousandSep) {\n $thousandSep = $defaults[2];\n }\n return number_format((float) $number, $decimal, $decimalPoint, $thousandSep);\n}", "static function format($number, $decimals = 2, $culture = null, $style = [])\n {\n $style = ['minimum_fraction_digits' => $decimals, 'maximum_fraction_digits' => $decimals] + $style;\n if ($culture)\n {\n return number()->usingLocale($culture, function($num) use ($decimals, $number, $style) {\n return $num->format($number, $style);\n });\n }\n return number()->format($number, $style);\n }", "function number_format_short( $n, $precision = 1 ) {\r\n\tif ($n < 900) {\r\n\t\t// 0 - 900\r\n\t\t$n_format = number_format($n, $precision);\r\n\t\t$suffix = '';\r\n\t} else if ($n < 900000) {\r\n\t\t// 0.9k-850k\r\n\t\t$n_format = number_format($n / 1000, $precision);\r\n\t\t$suffix = 'K';\r\n\t} else if ($n < 900000000) {\r\n\t\t// 0.9m-850m\r\n\t\t$n_format = number_format($n / 1000000, $precision);\r\n\t\t$suffix = 'M';\r\n\t} else if ($n < 900000000000) {\r\n\t\t// 0.9b-850b\r\n\t\t$n_format = number_format($n / 1000000000, $precision);\r\n\t\t$suffix = 'B';\r\n\t} else {\r\n\t\t// 0.9t+\r\n\t\t$n_format = number_format($n / 1000000000000, $precision);\r\n\t\t$suffix = 'T';\r\n\t}\r\n\t// Remove unecessary zeroes after decimal. \"1.0\" -> \"1\"; \"1.00\" -> \"1\"\r\n\t// Intentionally does not affect partials, eg \"1.50\" -> \"1.50\"\r\n\tif ( $precision > 0 ) {\r\n\t\t$dotzero = '.' . str_repeat( '0', $precision );\r\n\t\t$n_format = str_replace( $dotzero, '', $n_format );\r\n\t}\r\n\treturn $n_format . $suffix;\r\n}", "public static function numberFormat($number, $decimalPlaces = 0, $minimal = true)\r\n\t{\r\n\t\tif($minimal && $decimalPlaces > 0)\r\n\t\t{\r\n\t\t\twhile($decimalPlaces > 0 && numbers::round($number,$decimalPlaces - 1) == $number)\r\n\t\t\t{\r\n\t\t\t\t$decimalPlaces--;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ipsRegistry::getClass('class_localization')->formatNumber($number, $decimalPlaces);\r\n\t}", "function tfnm_format_number( $number, $decimal_places ){\n\n\t// Checking it is in fact a number before formatting to be safe.\n\tif( is_int( $number ) || is_float( $number ) ){\n\t\treturn number_format( $number, $decimal_places, '.', ',' );\n\t}\n\n\t// Just return what was inputted if it fails the checks above.\n\treturn $number;\n}", "public function testFormat() {\n\t\t$is = $this->Numeric->format('22');\n\t\t$expected = '22,00';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => 1]);\n\t\t$expected = '22,3';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => -1]);\n\t\t$expected = '20';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => -2]);\n\t\t$expected = '0';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => 3]);\n\t\t$expected = '22,300';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('abc', ['places' => 2]);\n\t\t$expected = '---';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t/*\n\t\t$is = $this->Numeric->format('12.2', array('places'=>'a'));\n\t\t$expected = '12,20';\n\t\t$this->assertEquals($expected, $is);\n\t\t*/\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'before' => 'EUR ']);\n\t\t$expected = 'EUR 22,30';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'after' => ' EUR']);\n\t\t$expected = '22,30 EUR';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'after' => 'x', 'before' => 'v']);\n\t\t$expected = 'v22,30x';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t#TODO: more\n\n\t}", "function numberformat($qwe,$asd)\r\n{\r\n if($qwe==0)$zxc='0'; \r\n else{\r\n $zxc=number_format($qwe,$asd);\r\n }\r\n return $zxc;\r\n}", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "function format_price($number)\n{\n return number_format($number, 0, '', '&thinsp;');\n}", "function formatNumbers($inputID)\n\t{\n\t\t$number_format = number_format($inputID);\n\t\t\n\t\techo $number_format;\n\t}", "static function currency_format_en($value) {\n $value = number_format($value, 2, '.', ',');\n $value = str_replace('.00', '', $value);\n return $value;\n }", "function carton_format_decimal( $number, $dp = '' ) {\n\tif ( $dp == '' )\n\t\t$dp = intval( get_option( 'carton_price_num_decimals' ) );\n\n\t$number = number_format( (float) $number, (int) $dp, '.', '' );\n\n\tif ( strstr( $number, '.' ) )\n\t\t$number = rtrim( rtrim( $number, '0' ), '.' );\n\n\treturn $number;\n}", "function smarty_modifier_commify($string, $decimals=-1, $dec_point='.', $thousands_sep=',')\n{\n\tif ($decimals == -1) {\n\t\tif (preg_match('/(.*)\\.(\\d+.*)/', $string, $matches)) \n\t\t\treturn number_format($matches[1], 0, $dec_point, $thousands_sep) . $dec_point . $matches[2];\n\t\telse \n\t\t\treturn number_format($string);\n\t}\n\telse \n\t\treturn number_format($string, $decimals, $dec_point, $thousands_sep);\n}", "function getFormatNumericDecimal( $n, $p=2 )\n{\n // $r = round( $n, $p );\n $r = number_format($n, 2, '.', '');\n if( $r == '' or $r == 0 or $r == 0.00 )\n {\n $r = '0.00';\n }\n return $r;\n}", "public static function numberFormat($num, $dec_max = 2, $dec_point = \".\", $thousands_sep = \",\")\n {\n if (floor($num) != $num) {\n $num = trim(\n number_format($num, $dec_max, $dec_point, $thousands_sep), \n \"0\"\n );\n } else {\n $num = number_format((double)$num, 0, $dec_point, $thousands_sep);\n }\n \n return $num;\n }", "public function numberFormatByValue($value) {\n\n if ($value < 0)\n $value = '(' . number_format($value, 2) . ')';\n else\n $value = number_format($value, 2);\n\n return str_replace(\"-\", \"\", $value);\n }", "private function _formatNumber($number)\n {\n if ($number == '')\n {\n \treturn FALSE;\n }\n return number_format($number, 2, '.', ',');\n }", "function convert_number($n) {\r\r\n if($n != ''){\r\r\n $n = (0+str_replace(\",\", \"\", $n));\r\r\n }\r\r\n\r\r\n //if (!is_numeric($n)) return false;\r\r\n\r\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).'T';\r\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).'B';\r\r\n elseif ($n > 1000000) return round(($n/1000000), 2).'M';\r\r\n elseif ($n > 1000) return round(($n/1000), 2).'Th';\r\r\n \r\r\n return number_format($n);\r\r\n }", "private function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator)\n {\n if(is_null($decimals)){\n $decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals');\n }\n if(is_null($decimalPoint)){\n $decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point');\n }\n if(is_null($thousandSeperator)){\n $thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator');\n }\n\n return number_format($value, $decimals, $decimalPoint, $thousandSeperator);\n }", "public function formatNumber($value)\n {\n $decimal = Configuration::first()->decimal;\n return number_format($value, $decimal, \".\", \"\");\n }", "function numeral($number) {\r\n $test = abs($number) % 10;\r\n $ext = ((abs($number) % 100 < 21 and abs($number) % 100 > 4) ? 'th' : (($test < 4) ? ($test < 3) ? ($test < 2) ? ($test < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th'));\r\n return $number . $ext;\r\n}", "private function _formatConvert($number)\n {\n if ($this->round) {\n $n = floor($number);\n $fraction = ($number - $n);\n if ($fraction != 0) {\n $step = 1 / $this->round;\n $decimal = (((int)($fraction / $step) + 1) * $step);\n $number = $n + $decimal;\n }\n }\n $number = number_format($number, $this->decimal);\n\n return number_format($number, $this->decimal);\n }", "function iu_format_number($input){\n\t$suffixes = array('', 'k', 'M', 'B');\n\t$suffixIndex = 0;\n\n\twhile(abs($input) >= 1000 && $suffixIndex < sizeof($suffixes)){\n\t\t$suffixIndex++;\n\t\t$input /= 1000;\n\t}\n\treturn round(floatval($input / pow(10, 0)),1).$suffixes[$suffixIndex];\n}", "public function locale();", "public function getDlblNumFormat(): string\n {\n return $this->DlblNumFormat;\n }", "function formatCurrency($number, $decimals = 2, $currency = 'Ksh')\n{\n return $currency . \" \" . format_num($number, $decimals, '.', ',');\n}", "function currencyFormat($inputID)\n\t{\n\t\t\n\t\tsetlocale(LC_MONETARY,\"en_US\");\n\t\treturn money_format('%i', $inputID) .\"\\n\";\n\t}", "function mgl_instagram_instagram_format_number($number ) {\n // Set divisor divisor and short letter by number\n if( $number < 1000 ) {\n // If number is less than 1000 do nothing\n return $number;\n\n }else if ($number > 1000 && $number < 1000000) {\n // Anything between 1000 and a million\n $divisor = 1000;\n $letter = 'k';\n\n } else if ($number > 1000000 && $number < 1000000000) {\n // Anything between a million and a billion\n $divisor = 1000000;\n $letter = 'm';\n\n } else {\n // Anything greater than a billion\n $divisor = 1000000000;\n $letter = 'G';\n }\n\n // Set a decimal precision to 1\n $precision = 1;\n // Set dec point to ','\n // TODO: translate dec point by language\n $dec_point = ',';\n // Set thousand sep to '.'\n // TODO: translate thousand sep by language\n $thousand_sep = '.';\n // Remove extra decimals. Trick because of number_format below also always round up and causes weird results\n // More information: http://php.net/manual/es/function.number-format.php#88424\n $short_number = bcdiv( ( $number / $divisor ), 1, 1 );\n // Get formatted number\n $n_format = trim(number_format( $short_number, $precision, $dec_point, $thousand_sep), 0 . $dec_point) . $letter;\n\n return $n_format;\n}", "function format($value);", "function get_date_numeral($format = 'Y-m-d') {\n\t$format = ($format == '') ? 'Y-m-d' : $format;\n\t$format = str_replace('Y', '9999', $format);\n\t$format = str_replace('m', '99', $format);\n\t$format = str_replace('d', '99', $format);\n\treturn $format;\n}", "function money_format($n)\n {\n $n = (0 + str_replace(\",\", \"\", $n));\n\n // is this a number?\n if (!is_numeric($n)) return false;\n\n // now filter it;\n if ($n > 1000000000000) return round(($n / 1000000000000), 1) . ' nghìn tỷ';\n else if ($n > 1000000000) return round(($n / 1000000000), 1) . ' tỷ';\n else if ($n > 1000000) return round(($n / 1000000), 1) . ' triệu';\n else if ($n > 1000) return round(($n / 1000), 1) . ' nghìn';\n\n return number_format($n);\n }", "protected function _numberFormat($float)\n {\n return number_format($float, 2, '', '');\n }", "public function format($number, $style, array $attributes = array(), array $textAttributes = array(), $locale = null)\n {\n $formatter = $this->getFormatter($locale ?: $this->localeDetector->getLocale(), $style, $attributes, $textAttributes);\n\n return $this->fixCharset($formatter->format($number));\n }", "abstract function format();", "private function numberFormat($value): string\n\t{\n\t\treturn number_format(\n\t\t\t(float) $value,\n\t\t\tRSFormProHelper::getConfig('payment.nodecimals'),\n\t\t\tRSFormProHelper::getConfig('payment.decimal'),\n\t\t\tRSFormProHelper::getConfig('payment.thousands')\n\t\t);\n\t}", "function date_format_intl(DateTimeInterface $date, $format) {\n\t$fmt = new IntlDateFormatter('nl', null, null);\n\t$fmt->setPattern($format);\n\n\treturn $fmt->format($date);\n}", "public function format($amt, Currency$currency) {\n\t\t\n\t\t#If there is a special case translation we will reset the format to prevent\n\t\t#the application from showing bogus data. Usually special translations come\n\t\t#after the number since they disambiguate the value.\n\t\tif (isset($this->specialTranslations[$currency->getISOCode()])) {\n\t\t\t$symbol = $this->specialTranslations[$currency->getISOCode()];\n\t\t\t$position = self::SYMBOL_AFTER;\n\t\t}\n\t\telse {\n\t\t\t$symbol = $currency->getSymbol();\n\t\t\t$position = (int)$this->symbolPosition;\n\t\t}\n\t\t\n\t\t#Format the number\n\t\tif ($position === self::SYMBOL_DECIMALSEP) {\n\t\t\t$number = number_format($amt, $currency->getDecimalCount(), $currency->getSymbol(), $this->thousandsSeparator);\n\t\t} \n\t\telse {\n\t\t\t$number = number_format($amt, $currency->getDecimalCount(), $this->decimalSeparator, $this->thousandsSeparator);\n\t\t}\n\t\t\n\t\t#Depending on where the symbol is positioned we have a bunch of options.\n\t\tswitch ($position) {\n\t\t\tcase self::SYMBOL_BEFORE : return $symbol . $number;\n\t\t\tcase self::SYMBOL_DECIMALSEP : return $number;\n\t\t\tcase self::SYMBOL_AFTER :\n\t\t\tdefault : return $number . $symbol;\n\t\t}\n\t}", "function format($number) {\r\n\t$number = bcdiv($number, 100000000, 8);\r\n\t$point = strpos($number,\".\");\r\n\tif($point != -1) {\r\n\t\t$after = substr($number,$point+1);\r\n\t\t$after = strlen($after);\r\n\t\t$after = 8-$after;\r\n\t\tfor($i=0;$i<$after;$i++) {\r\n\t\t\t$number .= \"0\";\r\n\t\t}\r\n\t} else {\r\n\t\t$number .= \".00000000\";\r\n\t}\r\n\treturn($number);\r\n}", "public static function invoiceNumberFormat($settings, $number)\n {\n //return '#' . sprintf(\"%05d\", $number);\n return $settings[\"invoice_prefix\"] . sprintf(\"%05d\", $number);\n }", "function intFmt($str) {\n return number_format($str, 0);\n}", "function moneyFormat($amount) {\n try {\n return number_format($amount, 2, '.', ',');\n } catch (Exception $e) {\n return $amount;\n }\n }", "public function transformTelNum($num, $format)\r\n {\r\n if ($format == \"00\") {\r\n if (strpos($num, \"+\") !== false) {\r\n return substr_replace($num, '00', 0, -12);\r\n } elseif (strpos($num, \"00\") !== false) {\r\n return $num;\r\n } else {\r\n return \"0030\" . $num;\r\n }\r\n } elseif ($format == \"+\") {\r\n if (strpos($num, '+') !== false) {\r\n return $num;\r\n } elseif (strpos($num, '00') !== false) {\r\n return substr_replace($num, '+', 0, -12);\r\n } else {\r\n return \"+30\" . $num;\r\n }\r\n } else {\r\n if (strpos($num, \"+\") !== false) {\r\n return $num;\r\n } elseif (strpos($num, \"00\") !== false) {\r\n return substr_replace($num, '+', 0, -12);\r\n } else {\r\n return \"+30\" . $num;\r\n }\r\n }\r\n }", "function Formato1($val){\r\n return number_format($val,0,\",\",\".\");\r\n }", "public function testConvertToNumberFormat()\n {\n $test_data = array(\n array('2013-12-23 23:59:59', '20131223235959'),\n array('2013.12.23 23\"59\\'59', '20131223235959'),\n array('2013/12/23 23:59:59', '20131223235959'),\n );\n foreach ($test_data as $data) {\n $result = DateUtility::convertToNumberFormat($data[0]);\n $this->assertEquals($data[1], $result);\n }\n }", "public static function numberToCurrency($number, $options = array())\n {\n if ( null === $number ) return null;\n\n $params = array(\n 'default' => array()\n );\n\n if ( isset($options['locale']) )\n $params = array_merge( $params, array('locale' => $options['locale']) );\n\n $defaults = Lycan_Locale_i18n::translate(\"number.format\", $params);\n #print_r($defaults);\n /**\n * Should return\n * array(\n * 'precision' => 2,\n * 'separator' => '.',\n * 'delimiter' => ','\n * )\n */\n $currency = Lycan_Locale_i18n::translate(\"number.currency.format\", $params);\n /**\n * Should return\n * array(\n * 'unit' => '$',\n * 'precision' => 2,\n * 'format' => '%u %n'\n * )\n */\n $defaults = array_merge(self::$DEFAULT_CURRENCY_VALUES, $defaults, $currency);\n\n if ( isset($options['format']) )\n $defaults['negative_format'] = \"-\" + $options['format'];\n\n $options = array_merge($defaults, $options);\n\n $unit = $options['unit'];\n unset($options['unit']);\n $format = $options['format'];\n unset($options['format']);\n\n if ( floatval($number) < 0 ) {\n $format = $options['negative_format'];\n unset($options['negative_format']);\n $number = abs($number);\n }\n\n $value = self::numberWithPrecision($number, array_merge($options, array('raise'=>true)));\n\n $find = array(\"%n\", \"%u\"); $replace = array($value, $unit);\n $format = str_replace($find, $replace, $format);\n\n return $format;\n }", "function format_number($number, $divider = ',') {\n\t$number = intval(trim($number)) . '';\n\t$return = '';\n\t$len = strlen($number);\n\tfor($i = $len - 1, $j = 1; $i >= 0; $i--, $j++) {\n\t\t$return = ($j % 3 == 0 && $j != $len ? $divider : '') . $number[$i] . $return;\n\t}\n\treturn $return;\n}", "function currency_format($amount) {\n\t$amount_ok = number_format($amount,2,',','.');\n\treturn $amount_ok;\n}", "function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}", "function convertNum($x){\n\treturn number_format($x, 2, '.', ',');\n}", "public function decimalFormat($value, $locale = null, $symbol = null);", "function add_commas($number)\n{\n $parts = explode('.', $number);\n $parts[0] = number_format($number);\n $number = implode('.', $parts);\n return $number;\n}", "function format_money(float $int = NULL, string $format = \"standard\"): string {\n\tif ($format == 'int') {\n\t\t$int = round($int, 0);\n\t}\n\t$fmt = NumberFormatter::create('en_US', \\NumberFormatter::CURRENCY);\n\treturn !empty($int)? $fmt->formatCurrency($int, 'USD'): '';\n}", "public function testFormat(): void\n {\n $tests = $this->currencyPermutationsWithLocales();\n $results = [];\n\n foreach ($tests as $test => $parameters) {\n $locale = new Locale($parameters['locale']);\n $formatOptions = new NumberFormatOptions($parameters['options']);\n $formatter = new NumberFormat($locale, $formatOptions);\n\n $results[$test] = [\n 'result' => $formatter->format(self::NUMBER),\n ];\n }\n\n $this->assertMatchesJsonSnapshot($results);\n }", "public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace('&#160;', ' ', $separator));\n }", "public function getOutputFormat()\n {\n $formated = $this->formatTxt(0);\n $number = $this->formatTxt(0, array('display' => Zend_Currency::NO_SYMBOL));\n return str_replace($number, '%s', $formated);\n }", "function Moeda($val) {\n //setlocale(LC_MONETARY, 'pt_BR', 'ptb');\n //return money_format('%4n', $val);\n return number_format($val, 2,',','.');\n}", "public static function format($number, $decimals = 2, $dec_point = \",\", $thousands_sep = \".\")\n {\n return self::decimal($number, $decimals, $dec_point, $thousands_sep);\n }", "function mobileNumberFormat($mobileNumber)\n{\n\t$mobileNumber\t=\tpreg_replace(\"/[^0-9]*/s\", \"\", $mobileNumber);\n\tswitch(strlen($mobileNumber))\n\t{\n\t\tcase 10:\n\t\t\t$rtn_mobile\t=\tsubstr($mobileNumber,0,3).\"-\".substr($mobileNumber,3,3).\"-\".substr($mobileNumber,6,4);\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\t$rtn_mobile\t=\tsubstr($mobileNumber,0,3).\"-\".substr($mobileNumber,3,4).\"-\".substr($mobileNumber,7,4);\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\t$rtn_mobile\t=\t\"\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$rtn_mobile\t=\t$mobileNumber;\n\t}//\tend switch\n\t\n\treturn $rtn_mobile;\n}", "public function number($value, $decimals = 0, $dec_point = '.', $thousands_sep = ',')\n {\n return is_numeric($value) ? number_format($value, $decimals, $dec_point, $thousands_sep) : $value;\n }", "public function format(Money $money);", "public function toNumber($number, $options = array())\n {\n $options = array_merge(array(\n 'locale' => $this->getLocale()\n ), $options);\n \n return Zend_Locale_Format::toNumber($number, $options);\n }", "function add_commas($number, $number_of_decimals)\n{\n\t# Default to zero if the number is not set\n\tif(!isset($number) || $number == \"\" || $number <= 0)\n\t{\n\t\t$number = \"0\";\n\t} \n\t\n\treturn number_format($number, $number_of_decimals, '.', ',');\n}", "function get_telephone_format($number) {\n $telephone_format = array(\n '02' => \"3,4,4\",\n '03' => \"4,3,4\",\n '05' => \"5,6\", \n '0500' => \"4,6\",\n '07' => \"5,6\",\n '08' => \"4,3,4\",\n '09' => \"4,3,4\",\n '01' => \"5,6\",\n '011' => \"4,3,4\",\n '0121' => \"4,3,4\",\n '0131' => \"4,3,4\",\n '0141' => \"4,3,4\",\n '0151' => \"4,3,4\",\n '0161' => \"4,3,4\",\n '0191' => \"4,3,4\",\n '013873' => \"6,5\", \n '015242' => \"6,5\", \n '015394' => \"6,5\",\n '015395' => \"6,5\",\n '015396' => \"6,5\",\n '016973' => \"6,5\",\n '016974' => \"6,5\",\n '017683' => \"6,5\",\n '017684' => \"6,5\",\n '017687' => \"6,5\",\n '019467' => \"6,5\",\n '0169737' => \"5,6\",\n '0169772' => \"6,4\",\n '0169773' => \"6,4\",\n '0169774' => \"6,4\"\n );\n\n // Sorts into longest key first\n uksort($telephone_format, \"sort_str_len\"); \n foreach ($telephone_format AS $key => $value) {\n if (substr($number, 0, strlen($key)) == $key) break;\n };\n return $value;\n}" ]
[ "0.7582609", "0.73806006", "0.72515726", "0.7250891", "0.70316863", "0.6982435", "0.6954951", "0.6906346", "0.6905284", "0.68864626", "0.6756495", "0.673719", "0.67219365", "0.67058575", "0.665617", "0.6624225", "0.6570612", "0.65340066", "0.6531119", "0.65287083", "0.65249485", "0.6480124", "0.64291304", "0.64276135", "0.6406938", "0.6372835", "0.62960136", "0.6256084", "0.6235979", "0.6221869", "0.62174696", "0.6215204", "0.61850405", "0.6145948", "0.6096746", "0.6093153", "0.60808444", "0.6076822", "0.6062918", "0.60591847", "0.6055931", "0.6049548", "0.6027905", "0.60082674", "0.59774417", "0.59659", "0.5961144", "0.59258604", "0.59235", "0.5897226", "0.58923584", "0.58874625", "0.58844185", "0.58650154", "0.5861565", "0.58521533", "0.58499694", "0.58485895", "0.58343554", "0.58238816", "0.58077514", "0.5793095", "0.57642037", "0.57478225", "0.5741064", "0.5725941", "0.5716629", "0.5701069", "0.56919616", "0.56855816", "0.5682223", "0.5672719", "0.5662944", "0.565482", "0.5654733", "0.56515104", "0.56470054", "0.562477", "0.56225353", "0.56172365", "0.561574", "0.5613193", "0.56069213", "0.56054777", "0.5602958", "0.5602958", "0.56024355", "0.55949837", "0.5594286", "0.5591641", "0.5590502", "0.55814207", "0.5570336", "0.55671173", "0.55661225", "0.55624384", "0.55551875", "0.5547438", "0.5539251", "0.55365264" ]
0.7030238
5
Convert a number to a roman numeral.
function number_to_roman($num): ?string { static $map = [ 'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1, ]; $num = (int) $num; if ($num < 1 || $num > 3999) { return null; } $result = ''; foreach ($map as $roman => $arabic) { $repeat = (int) floor($num / $arabic); $result .= str_repeat($roman, $repeat); $num %= $arabic; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function numberToRoman($num) \n\t{\n\t\t// Make sure that we only use the integer portion of the value\n\t\t$n = intval($num);\n\t\t$result = '';\n\n\t\t// Declare a lookup array that we will use to traverse the number:\n\t\t$lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,\n\t\t\t'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,\n\t\t\t'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);\n\n\t\tforeach ($lookup as $roman => $value) \n\t\t{\n\t\t\t// Determine the number of matches\n\t\t\t$matches = intval($n / $value);\n\n\t\t\t// Store that many characters\n\t\t\t$result .= str_repeat($roman, $matches);\n\n\t\t\t// Substract that from the number\n\t\t\t$n = $n % $value;\n\t\t}\n\n\t\t// The Roman numeral should be built, return it\n\t\treturn $result;\n\t}", "public function numberToRomanRepresentation($number)\n {\n\n $map = array(\n 'M' => 1000,\n 'CM' => 900,\n 'D' => 500,\n 'CD' => 400,\n 'C' => 100,\n 'XC' => 90,\n 'L' => 50,\n 'XL' => 40,\n 'X' => 10,\n 'IX' => 9,\n 'V' => 5,\n 'IV' => 4,\n 'I' => 1\n );\n\n $returnValue = '';\n\n while ($number > 0) {\n foreach ($map as $roman => $int) {\n if ($number >= $int) {\n $number -= $int;\n $returnValue .= $roman;\n break;\n }\n }\n }\n return $returnValue;\n }", "private function convertToRoman($number)\n {\n $error_code = $this->checkParamaters($number, 'r');\n\n if ($error_code > 0) {\n return self::$error_codes[$error_code];\n }\n\n $roman_number = '';\n\n while ($number >= 1000) {\n $roman_number .= 'M';\n $number -= 1000;\n }\n\n while ($number >= 900) {\n $roman_number .= 'CM';\n $number -= 900;\n }\n\n while ($number >= 500) {\n $roman_number .= 'D';\n $number -= 500;\n }\n\n while ($number >= 400) {\n $roman_number .= 'CD';\n $number -= 400;\n }\n\n while ($number >= 100) {\n $roman_number .= 'C';\n $number -= 100;\n }\n\n while ($number >= 90) {\n $roman_number .= 'XC';\n $number -= 90;\n }\n\n while ($number >= 50) {\n $roman_number .= 'L';\n $number -= 50;\n }\n\n while ($number >= 40) {\n $roman_number .= 'XL';\n $number -= 40;\n }\n\n while ($number >= 10) {\n $roman_number .= 'X';\n $number -= 10;\n }\n\n while ($number >= 9) {\n $roman_number .= 'IX';\n $number -= 9;\n }\n\n while ($number >= 5) {\n $roman_number .= 'V';\n $number -= 5;\n }\n\n while ($number >= 4) {\n $roman_number .= 'IV';\n $number -= 4;\n }\n\n while ($number >= 1) {\n $roman_number .= 'I';\n $number -= 1;\n }\n\n return $roman_number;\n }", "public function converterRomanNumber($number) : void\n {\n\n if ($number > 0 && $number < 5000)\n {\n $alphabet = [\n [\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"],\n [\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\"],\n [\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\"],\n [\"\", \"M\", \"MM\", \"MMM\", \"MMMM\"]\n ];\n\n $chars = str_split($number);\n $result = \"\";\n for ($i = 0; $i < sizeof($chars); $i++)\n {\n $result = $result . $alphabet[sizeof($chars) - 1 - $i][intval($chars[$i])];\n }\n echo \"L'équivalent de \" . $number . \" en nombre romain est : \" . $result . ' ';\n }\n else\n {\n echo \"Votre nombre n'est pas compris dans la plage ]0;5000[\";\n }\n }", "function decimalToRoman($num) \r\n{\r\n // when placed at different places \r\n $m = array(\"\", \"M\", \"MM\", \"MMM\",\"MMMM\"); \r\n $c = array(\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \r\n \"DC\", \"DCC\", \"DCCC\", \"CM\"); \r\n $x = array(\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \r\n \"LX\", \"LXX\", \"LXXX\", \"XC\"); \r\n $i = array(\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \r\n \"VI\", \"VII\", \"VIII\", \"IX\"); \r\n \r\n // Converting to roman \r\n $thousands = $m[$num / 1000]; \r\n $hundereds = $c[($num % 1000) / 100]; \r\n $tens = $x[($num % 100) / 10]; \r\n $ones = $i[$num % 10]; \r\n \r\n $ans = $thousands . $hundereds . $tens . $ones; \r\n \r\n return $ans; \r\n}", "public static function integerToRoman($integer, $uppercase = true) {}", "function toRoman($integer) {\n\t\t$integer = intval($integer);\n\t\t$result = '';\n\n\t\t// Create a lookup array that contains all of the Roman numerals.\n\t\t$lookup = array('M' => 1000,\n\t\t'CM' => 900,\n\t\t'D' => 500,\n\t\t'CD' => 400,\n\t\t'C' => 100,\n\t\t'XC' => 90,\n\t\t'L' => 50,\n\t\t'XL' => 40,\n\t\t'X' => 10,\n\t\t'IX' => 9,\n\t\t'V' => 5,\n\t\t'IV' => 4,\n\t\t'I' => 1);\n\n\t\tforeach ($lookup as $roman => $value) {\n\t\t\t// Determine the number of matches\n\t\t\t$matches = intval($integer/$value);\n\n\t\t\t// Add the same number of characters to the string\n\t\t\t$result .= str_repeat($roman,$matches);\n\n\t\t\t// Set the integer to be the remainder of the integer and the value\n\t\t\t$integer = $integer % $value;\n\t\t}\n\n\t\t// The Roman numeral should be built, return it\n\t\treturn $result;\n\t}", "protected function buildRomanNumber()\n {\n $result = '';\n $number = $this->value;\n\n foreach ($this->romanSymbols as $value => $symbol) {\n while ($number >= $value) {\n $result .= $symbol;\n $number -= $value;\n }\n }\n\n return $result;\n }", "function romanNumerals($num) \n{\n\t$n = intval($num);\n\t$res = '';\n\n\t/*** roman_numerals array ***/\n\t$roman_numerals = array(\n\t 'M' => 1000,\n\t 'CM' => 900,\n\t 'D' => 500,\n\t 'CD' => 400,\n\t 'C' => 100,\n\t 'XC' => 90,\n\t 'L' => 50,\n\t 'XL' => 40,\n\t 'X' => 10,\n\t 'IX' => 9,\n\t 'V' => 5,\n\t 'IV' => 4,\n\t 'I' => 1);\n\n\tforeach ($roman_numerals as $roman => $number) \n\t{\n\t /*** divide to get matches ***/\n\t $matches = intval($n / $number);\n\n\t /*** assign the roman char * $matches ***/\n\t $res .= str_repeat($roman, $matches);\n\n\t /*** substract from the number ***/\n\t $n = $n % $number;\n\t}\n\n\treturn $res;\n\t}", "public static function RomanNumber($integer){\n $table = array('M'=>1000, 'CM'=>900, 'D'=>500, 'CD'=>400, 'C'=>100,\n 'XC'=>90, 'L'=>50, 'XL'=>40, 'X'=>10, 'IX'=>9,\n 'V'=>5, 'IV'=>4, 'I'=>1);\n $return = '';\n while($integer > 0) {\n foreach($table as $rom=>$arb) {\n if($integer >= $arb) {\n $integer -= $arb;\n $return .= $rom;\n break;\n }\n }\n }\n return $return;\n }", "function integerToRoman($integer)\n{\n $integer = intval($integer);\n $result = '';\n \n // Create a lookup array that contains all of the Roman numerals.\n $lookup = array('M' => 1000,\n 'CM' => 900,\n 'D' => 500,\n 'CD' => 400,\n 'C' => 100,\n 'XC' => 90,\n 'L' => 50,\n 'XL' => 40,\n 'X' => 10,\n 'IX' => 9,\n 'V' => 5,\n 'IV' => 4,\n 'I' => 1);\n \n foreach($lookup as $roman => $value){\n // Determine the number of matches\n $matches = intval($integer/$value);\n \n // Add the same number of characters to the string\n $result .= str_repeat($roman,$matches);\n \n // Set the integer to be the remainder of the integer and the value\n $integer = $integer % $value;\n }\n \n // The Roman numeral should be built, return it\n return $result;\n}", "public function toRoman()\n {\n if ($this->romanValue === null) {\n $this->romanValue = $this->buildRomanNumber();\n }\n\n return $this->romanValue;\n }", "public function testRomanNumbersConverter()\n {\n $converter = new \\App\\Converter();\n // 1 -> I\n // 2 -> II\n // 3 -> III\n // 4 -> IV\n // 5 -> V\n // 6 -> VI\n // 7 -> VII\n // 8 -> VIII\n // 9 -> IX\n // 10 -> X\n // 20 -> XX\n // 50 -> L\n // 100 -> C\n // 500 -> D\n // 1000 -> M\n\n $this->assertEquals('I', $converter->convert(1));\n $this->assertEquals('II', $converter->convert(2));\n $this->assertEquals('III', $converter->convert(3));\n $this->assertEquals('V', $converter->convert(5));\n $this->assertEquals('VI', $converter->convert(6));\n $this->assertEquals('VIII', $converter->convert(8));\n $this->assertEquals('XI', $converter->convert(11));\n $this->assertEquals('XIII', $converter->convert(13));\n $this->assertEquals('XVII', $converter->convert(17));\n $this->assertEquals('XIV', $converter->convert(14));\n $this->assertEquals('LXXXVI', $converter->convert(86));\n\n }", "function valueOfRoman($input){\n $roman_map = array(\n \"I\" => 1,\n \"V\" => 5,\n \"X\" => 10,\n \"L\" => 50,\n \"C\" => 100,\n \"D\" => 500,\n \"M\" => 1000\n );\n return $roman_map[$input];\n }", "public function toRomanNumerals($theInteger){\n $theInteger = intval($theInteger);\n\n\t\t// Array containing Roman numerals, so we can loop through them\n $map = array(\n 'M' => 1000, \n 'CM' => 900, \n 'D' => 500, \n 'CD' => 400, \n 'C' => 100, \n 'XC' => 90, \n 'L' => 50, \n 'XL' => 40, \n 'X' => 10, \n 'IX' => 9, \n 'V' => 5, \n 'IV' => 4, \n 'I' => 1\n );\n\n\t\t// Initializing the return value\n $returnValue = '';\n\n\t // Looking up into Roman numerals array $map , and pairing up arabic with roman \n\t while ($theInteger > 0) {\n\t foreach ($map as $roman => $int) {\n\t if($theInteger >= $int) {\n\t $theInteger -= $int;\n\t $returnValue .= $roman;\n\t break;\n\t }\n\t }\n\t }\n return $returnValue;\n\t}", "function calculateRomanNumerals ($n) {\n $romanNumerals = '';\n\n if ($n > 1000) {\n $numberOfLetters = $n / 1000;\n\t\t$romanNumerals .= str_repeat('M', $numberOfLetters); \n\t\t$n = $n % 1000;\n\t}\n\t\n if ($n > 500) {\n $numberOfLetters = $n / 500;\n\t\t$romanNumerals .= str_repeat('D', $numberOfLetters); \n\t\t$n = $n % 500;\n\t}\n\n if ($n > 100) {\n $numberOfLetters = $n / 100;\n\t\t$romanNumerals .= str_repeat('C', $numberOfLetters); \n\t\t$n = $n % 100;\n\t}\t\n\n if ($n > 50) {\n $numberOfLetters = $n / 50;\n\t\t$romanNumerals .= str_repeat('L', $numberOfLetters); \n\t\t$n = $n % 50;\n\t}\t\n\n if ($n > 10) {\n $numberOfLetters = $n / 10;\n\t\t$romanNumerals .= str_repeat('X', $numberOfLetters); \n\t\t$n = $n % 10;\n\t}\t\n\t\n\tif ($n > 5) {\n $numberOfLetters = $n / 5;\n\t\t$romanNumerals .= str_repeat('V', $numberOfLetters); \n\t\t$n = $n % 5;\n\t}\t\n\t\n\tif ($n > 0) {\n $numberOfLetters = $n / 1;\n\t\t$romanNumerals .= str_repeat('I', $numberOfLetters); \n\t}\t\n \n \n\techo $romanNumerals;\n return $romanNumerals;\n\n}", "function Roman_val($value)\n{\n if ($value == 'I')\n return 1;\n\t \n elseif ($value == 'V')\n return 5;\n\t \n elseif ($value == 'X')\n return 10;\n\t \n elseif ($value == 'L')\n return 50;\n\t \n elseif ($value == 'C')\n return 100;\n\t \n elseif ($value == 'D')\n return 500;\n\t \n elseif ($value == 'M')\n return 1000;\n\t \n else\n echo \"Error, invalid input: \";\t \n}", "public static function convertDecimalToRoman($value, $toupper = true)\n {\n if ($value >= 5000 || $value < 1)\n return \"?\"; //supports up to 4999\n \n $aux = (int) ($value / 1000);\n \n if ($aux !== 0)\n {\n $value %= 1000;\n \n while ($aux !== 0)\n {\n $r1 .= \"M\";\n $aux--;\n }\n }\n \n $aux = (int) ($value / 100);\n \n if ($aux !== 0)\n {\n $value %= 100;\n \n switch ($aux)\n {\n case 3:\n $r2 = \"C\";\n case 2:\n $r2 .= \"C\";\n case 1:\n $r2 .= \"C\";\n break;\n case 9:\n $r2 = \"CM\";\n break;\n case 8:\n $r2 = \"C\";\n case 7:\n $r2 .= \"C\";\n case 6:\n $r2 .= \"C\";\n case 5:\n $r2 = \"D\" . $r2;\n break;\n case 4:\n $r2 = \"CD\";\n break;\n default:\n break;\n }\n }\n \n $aux = (int) ($value / 10);\n \n if ($aux !== 0)\n {\n $value %= 10;\n switch ($aux)\n {\n case 3:\n $r3 = \"X\";\n case 2:\n $r3 .= \"X\";\n case 1:\n $r3 .= \"X\";\n break;\n case 9:\n $r3 = \"XC\";\n break;\n case 8:\n $r3 = \"X\";\n case 7:\n $r3 .= \"X\";\n case 6:\n $r3 .= \"X\";\n case 5:\n $r3 = \"L\" . $r3;\n break;\n case 4:\n $r3 = \"XL\";\n break;\n default:\n break;\n }\n }\n \n switch ($value)\n {\n case 3:\n $r4 = \"I\";\n case 2:\n $r4 .= \"I\";\n case 1:\n $r4 .= \"I\";\n break;\n case 9:\n $r4 = \"IX\";\n break;\n case 8:\n $r4 = \"I\";\n case 7:\n $r4 .= \"I\";\n case 6:\n $r4 .= \"I\";\n case 5:\n $r4 = \"V\" . $r4;\n break;\n case 4:\n $r4 = \"IV\";\n break;\n default:\n break;\n }\n \n $roman = $r1 . $r2 . $r3 . $r4;\n \n if (!$toupper)\n $roman = strtolower($roman);\n \n return $roman;\n }", "function roman($arabic)\n{\n\t$ones = Array(\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\");\n\t$tens = Array(\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\");\n\t$hundreds = Array(\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\");\n\t$thousands = Array(\"\", \"M\", \"MM\", \"MMM\", \"MMMM\");\n\n\tif ($arabic > 4999)\n\t{\n\t\t// For large numbers (five thousand and above), a bar is placed above a base numeral to indicate multiplication by 1000.\n\t\t// Since it is not possible to illustrate this in plain ASCII, this function will refuse to convert numbers above 4999.\n\t\tdie(\"Cannot represent numbers larger than 4999 in plain ASCII.\");\n\t}\n\telseif ($arabic == 0)\n\t{\n\t\t// About 725, Bede or one of his colleagues used the letter N, the initial of nullae,\n\t\t// in a table of epacts, all written in Roman numerals, to indicate zero.\n\t\treturn \"N\";\n\t}\n\telse\n\t{\n\t\t// Handle fractions that will round up to 1.\n\t\tif (round(fmod($arabic, 1) * 12) == 12)\n\t\t{\n\t\t\t$arabic = round($arabic);\n\t\t}\n\n\t\t// With special cases out of the way, we can proceed.\n\t\t// NOTE: modulous operator (%) only supports integers, so fmod() had to be used instead to support floating point.\n\t\t$roman = $thousands[($arabic - fmod($arabic, 1000)) / 1000];\n\t\t$arabic = fmod($arabic, 1000);\n\t\t$roman .= $hundreds[($arabic - fmod($arabic, 100)) / 100];\n\t\t$arabic = fmod($arabic, 100);\n\t\t$roman .= $tens[($arabic - fmod($arabic, 10)) / 10];\n\t\t$arabic = fmod($arabic, 10);\n\t\t$roman .= $ones[($arabic - fmod($arabic, 1)) / 1];\n\t\t$arabic = fmod($arabic, 1);\n\n\n\t\treturn $roman;\n\t}\n}", "function roman_expand($roman)\n{\n\t$roman = str_replace(\"CM\", \"DCCCC\", $roman);\n\t$roman = str_replace(\"CD\", \"CCCC\", $roman);\n\t$roman = str_replace(\"XC\", \"LXXXX\", $roman);\n\t$roman = str_replace(\"XL\", \"XXXX\", $roman);\n\t$roman = str_replace(\"IX\", \"VIIII\", $roman);\n\t$roman = str_replace(\"IV\", \"IIII\", $roman);\n\treturn $roman;\n}", "function roman_expand($roman)\n{\n\t$roman = str_replace(\"CM\", \"DCCCC\", $roman);\n\t$roman = str_replace(\"CD\", \"CCCC\", $roman);\n\t$roman = str_replace(\"XC\", \"LXXXX\", $roman);\n\t$roman = str_replace(\"XL\", \"XXXX\", $roman);\n\t$roman = str_replace(\"IX\", \"VIIII\", $roman);\n\t$roman = str_replace(\"IV\", \"IIII\", $roman);\n\t\n\t$roman = str_replace(\"IC\", \"LXXXXVIIII\", $roman);\n\t\n\t\n\treturn $roman;\n}", "function postdigit(string $c, int $n):void{\n global $i, $romanval;\n for($j = 0; $j < $n; $j++){\n $romanval[$i++] = $c;\n }\n}", "public function integerToRoman($the_integer)\n {\n if(!is_int((int)$the_integer)){\n return response('Non-integer request', 400)\n ->header('Content-Type', 'text/plain');\n }\n $x=RomanNumeralsService::where('theNumber',$the_integer)->first();\n if($x){\n $x->conversionCount++;\n $x->save();\n $cvt = fractal($x, new RomanNumeralsServiceTransformer())->toArray();\n }else{\n $cvt = fractal(RomanNumeralsService::create([\n 'theNumber'=>$the_integer,\n 'romanNumeralConversion'=>$this->svc->integerToRoman($the_integer),\n 'conversionCount'=>1\n ]), new RomanNumeralsServiceTransformer())->toArray();\n }\n return response()->json($cvt);\n }", "function romanCalc($input){\n $convertedValue;\n\n for($i = 0; $i < strlen($input); $i++){\n $valueOne = valueOfRoman($input[$i]);\n if($i + 1 < strlen($input)){\n $valueTwo = valueOfRoman($input[$i + 1]);\n\n if($valueOne >= $valueTwo){\n $convertedValue += $valueOne;\n }else{\n $convertedValue += $valueTwo - $valueOne;\n $i++;\n }\n }else{\n $convertedValue += $valueOne;\n $i++;\n }\n\n }\n\n return $convertedValue;\n }", "public function convert($num)\n {\n if(strlen($num)>48) \n {\n $this->error=\"Number out of bounds\";\n return $this->error;\n }\n \n //check if first \n if(substr($num,0,1)==\"-\")\n {\n $this->sentence.='minus ';\n $num=substr($num,1,strlen($num)-1);\n }\n \n if(strlen($num)<=3)\n {\n $this->sentence.=$this->decider($num);\n }\n else\n {\n $k=strrev($num);\n for($i=0;$i<strlen($k);$i=$i+3){$arro[]=strrev(substr($k,$i,3));}\n //reverse again\n $arro=array_reverse($arro);\n //print_r($arro);\n $mool=ceil(strlen($num)/3);\n if((strlen($num)%3)==0){$mool--;}\n //return $this->decider($arro[0]);\n $this->sentence.=$this->decider($arro[0]).' '.$this->mool_array[$mool];\n $mool--;\n //leave the first one and prepare string of others\n $arrlen=count($arro);\n for($i=1;$i<$arrlen;$i++)\n {\n $this->sentence.=' '.$this->decider($arro[$i]);\n if($mool!=0)\n {\n $this->sentence=' '.$this->sentence.' '.$this->mool_array[$mool];\n }\n $mool--;\n }\n }\n return ucfirst(trim($this->sentence));\n }", "function predigit(string $num1, string $num2):void{\n global $i, $romanval;\n $romanval[$i++] = $num1; // Stores $num1 in i'th cell and increase it to 1.\n $romanval[$i++] = $num2; // Stores $num2 in i'th cell and increase it to 1.\n}", "public static function arabigo2romano($valor){\n\t\t$romanos = array('M','CM','D','CD','C','XC','L','XL','X','IX','V','IV','I');\n\t\t$valores = array(1000,900,500,400,100,90,50,40,10,9,5,4,1);\n\t\t$resultado='';\n\t\tfor($i=0;$i<count($romanos);$i++){\n\t\t\twhile($valor>=$valores[$i]){\n\t\t\t\t$resultado.=$romanos[$i];\n\t\t\t\t$valor-=$valores[$i];\n\t\t\t}\n\t\t}\n\t\treturn $resultado;\n\t}", "public function testDecimalToRoman0()\n {\n $this->assertEquals(\"\", RomanNumber::decimalToRoman(0));\n }", "public function convert($number)\n {\n $number = str_replace('.', '', $number);\n if ( ! is_numeric($number)) throw new Exception(\"Please input number.\");\n $base = array('nol', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan');\n $numeric = array('1000000000000000', '1000000000000', '1000000000000', 1000000000, 1000000, 1000, 100, 10, 1);\n $unit = array('kuadriliun', 'triliun', 'biliun', 'milyar', 'juta', 'ribu', 'ratus', 'puluh', '');\n $str = null;\n $i = 0;\n if ($number == 0) {\n $str = 'nol';\n } else {\n while ($number != 0) {\n $count = (int)($number / $numeric[$i]);\n if ($count >= 10) {\n $str .= static::convert($count) . ' ' . $unit[$i] . ' ';\n } elseif ($count > 0 && $count < 10) {\n $str .= $base[$count] . ' ' . $unit[$i] . ' ';\n }\n $number -= $numeric[$i] * $count;\n $i++;\n }\n $str = preg_replace('/satu puluh (\\w+)/i', '\\1 belas', $str);\n $str = preg_replace('/satu (ribu|ratus|puluh|belas)/', 'se\\1', $str);\n $str = preg_replace('/\\s{2,}/', ' ', trim($str));\n }\n return $str;\n }", "function testing_function()\n{\n $input = \"VI\";\n\techo \"Roman Numeral VI equals to: \";\t \n echo Roman_numeral($input).\"<br>\";\n\t\n\t$input = \"IV\";\n\techo \"Roman Numeral IV equals to: \";\t \n echo Roman_numeral($input).\"<br>\";\n\t\t \n\t$input = \"MCMXC\";\n\techo \"Roman Numeral MCMXC equals to: \";\t \n echo Roman_numeral($input).\"<br>\";\n\t\t \n $input = \"IX\";\n\techo \"Roman Numeral IX equals to: \";\t \n echo Roman_numeral($input).\"<br>\";\n\t\t \n\t$input = \"MMM\";\n\techo \"Roman Numeral MMM equals to: \";\t \n echo Roman_numeral($input).\"<br>\";\t \n\t\t \n\t$input = \"MMMCMXCIX\";\n\techo \"Roman Numeral MMMCMXCIX equals to: \";\t \n echo Roman_numeral($input).\"<br>\";\n\t\t \n\t$input = \"Z\";\n\techo \"Invalid input Z equals to: \";\t \n echo Roman_numeral($input);\n\t\t \n\t// Roman numerals traditionally don't have negatives or zeros\n}", "public static function convert_number_to_code( $number )\n {\n return preg_replace( '/^([0-9]+)([0-9]{3})/', '$1.$2', $number );\n }", "public function bulan_to_romawi($val)\n {\n \t$romawi = ['I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII'];\n \treturn $romawi[$val+1];\n }", "function roman_to_decimal($romans) {\n // conversion table\n $roman_values = array(\"I\" => 1, \"V\" => 5, \"X\" => 10,\n \"L\" => 50, \"C\" => 100, \"D\" => 500, \"M\" => 1000);\n\n $total = 0;\n $previous = 0;\n\n // parse from end to start of string\n for ($i = strlen($romans) - 1; $i >= 0; --$i) {\n\n // check if the character is a roman numeral\n $numeral = strtoupper($romans[$i]);\n if (!array_key_exists($numeral, $roman_values)) {\n throw new Exception(\"invalid string of roman numerals\");\n }\n\n // convert to decimal and add/subtract from total.\n $value = $roman_values[$numeral];\n if ($value >= $previous) {\n $total += $value;\n\n } else {\n $total -= $value;\n }\n\n // keep track of last value\n $previous = $value;\n }\n\n return $total;\n}", "public function roman($num,$seq=false)\n {\n $series = [];\n $sum = 0;\n for ($i=0; $i < $num ; $i++) {\n\n $number = $this->numberToRomanRepresentation($i);\n\n if(strpos((string)$number,\"X\")!== FALSE){\n array_push($series,$number);\n }\n\n $sum = $sum + substr_count((string)$number,\"X\");\n\n }\n\n // Array\n $array = ['repetitions'=>$sum];\n\n if($seq){\n // we need to return numbers as well sum\n $array = [\n 'series' => $series,\n 'repetitions' => $sum,\n ];\n }\n\n return $array;\n\n }", "function romanToInteger($legend, $str) {\n if (empty($str)) {\n return;\n }\n $numbers = [];\n for ($i=0; $i < strlen($str); $i++) { \n $numbers[] = $legend[$str[$i]];\n }\n $result = 0;\n while (!empty($numbers)) {\n if (sizeof($numbers) == 1 || $numbers[0] >= $numbers[1]) {\n $result += array_shift($numbers);\n } else { // number[0] < number[1]\n $result += abs(array_shift($numbers) - array_shift($numbers));\n }\n }\n return $result;\n}", "public function toInt():int\n {\t\t\n\t//The time complexity is approximately O(n^2)\n\t\n //Make char array of the Roman numeral\n $arr = str_split($this->numeral);\n //Get symbols keys and values\n $symbols = $this->symbols;\n //Initialise result\n $total = 0;\n //Initialise iterator\n $i = 0;\n while($i<count($arr)){\n //Check if the token is a vaild Roman numeral\n if (in_array($arr[$i], $symbols)){\n //Check if the current index is not the last position\n if($i+1<count($arr)){\n //Compare the two index positions\n $currIndex = array_search($arr[$i], $symbols);\n $nextIndex = array_search($arr[$i+1], $symbols);\n /**\n * If the current index is smaller than the next index\n * then subtract the current index from the next index\n * then add it to the total\n */\n if($currIndex<$nextIndex){\n $total += $nextIndex - $currIndex;\n //Increment twice and continue\n $i+=2;\n continue;\n }\n }\n //Add the current index to the total\n $currIndex = array_search($arr[$i], $symbols);\n $total += $currIndex;\n $i++;\n }else {\n //Invaild numeral\n throw new \\Exception(\"Invalid Token\", 1);\n }\n }\n return $total;\n }", "function arabic($roman)\n{\n\t$result = 0;\n\t\n\t$roman = strtoupper($roman);\n\n\t// Remove subtractive notation.\n\t$roman = roman_expand($roman);\n\n\t// Calculate for each numeral.\n\t$result += substr_count($roman, 'M') * 1000;\n\t$result += substr_count($roman, 'D') * 500;\n\t$result += substr_count($roman, 'C') * 100;\n\t$result += substr_count($roman, 'L') * 50;\n\t$result += substr_count($roman, 'X') * 10;\n\t$result += substr_count($roman, 'V') * 5;\n\t$result += substr_count($roman, 'I');\n\treturn $result;\n}", "function arabic($roman)\n{\n\t$result = 0;\n\t\n\t$roman = strtoupper($roman);\n\n\t// Remove subtractive notation.\n\t$roman = roman_expand($roman);\n\n\t// Calculate for each numeral.\n\t$result += substr_count($roman, 'M') * 1000;\n\t$result += substr_count($roman, 'D') * 500;\n\t$result += substr_count($roman, 'C') * 100;\n\t$result += substr_count($roman, 'L') * 50;\n\t$result += substr_count($roman, 'X') * 10;\n\t$result += substr_count($roman, 'V') * 5;\n\t$result += substr_count($roman, 'I');\n\treturn $result;\n}", "public function ordinalize($number)\n {\n if (in_array($number % 100, range(11, 13))) {\n return $number . 'th';\n }\n switch ($number % 10) {\n case 1:\n return $number . 'st';\n case 2:\n return $number . 'nd';\n case 3:\n return $number . 'rd';\n default:\n return $number . 'th';\n }\n }", "public function convert($number = '', $type = '')\n {\n if (strlen($type) > 1) {\n $type = $type[0];\n }\n\n switch (strtolower($type)) {\n case 'w':\n return $this->convertToWord($number);\n case 'o':\n return $this->convertToOrdinal($number);\n case 'n':\n return $this->convertToNumberOrdinal($number);\n case 'r':\n return $this->convertToRoman($number);\n }\n }", "public function ordinalize($number)\n\t{\n\t\tif (in_array(($number % 100),range(11,13))){\n\t\t\treturn $number.'th';\n\t\t}else{\n\t\t\tswitch (($number % 10)) {\n\t\t\tcase 1:\n\t\t\t\treturn $number.'st';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\treturn $number.'nd';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\treturn $number.'rd';\n\t\t\tdefault:\n\t\t\t\treturn $number.'th';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static function ordinalize($number)\n {\n if (in_array((intval($number) % 100),range(11,13))){\n return $number.'th';\n }else{\n switch (($number % 10)) {\n case 1:\n return $number.'st';\n break;\n case 2:\n return $number.'nd';\n break;\n case 3:\n return $number.'rd';\n default:\n return $number.'th';\n break;\n }\n }\n }", "private function convertToOrdinal($number)\n {\n $error_code = $this->checkParamaters($number, 'o');\n\n if ($error_code > 0) {\n return self::$error_codes[$error_code];\n }\n\n $small_number = (int) substr($number, strlen($number) - 1);\n $big_number = (int) ($number - $small_number);\n\n $string = '';\n\n // Numbers between 20 and 99.\n if ($big_number > 0 && $number > 19 && $number < 100) {\n return $this->convertToWord($big_number).' '.$this->convertToOrdinal($small_number);\n }\n\n // Numbers over 100.\n if ($number >= 100) {\n $string = $this->convertToWord(str_pad(substr($number, 0, 1), strlen($number), '0')).'th';\n\n if ($small_number > 0) {\n $string .= ' and '.$this->convertToWord($small_number);\n }\n\n return $string;\n }\n\n return $this->small_number_string[$number];\n }", "private function getNumberToText(int $number): string {\n\t\tswitch($number) {\n\t\t\tcase 0:\n\t\t\t\treturn Language::out()->get0Name();\n\t\t\tcase 1:\n\t\t\t\treturn Language::out()->get1Name();\n\t\t\tcase 2:\n\t\t\t\treturn Language::out()->get2Name();\n\t\t\tcase 3:\n\t\t\t\treturn Language::out()->get3Name();\n\t\t\tcase 4:\n\t\t\t\treturn Language::out()->get4Name();\n\t\t\tcase 5:\n\t\t\t\treturn Language::out()->get5Name();\n\t\t\tcase 6:\n\t\t\t\treturn Language::out()->get6Name();\n\t\t\tcase 7:\n\t\t\t\treturn Language::out()->get7Name();\n\t\t\tcase 8:\n\t\t\t\treturn Language::out()->get8Name();\n\t\t\tcase 9:\n\t\t\t\treturn Language::out()->get9Name();\n\t\t\tdefault:\n\t\t\t\treturn (string) $number;\n\t\t}\n\t}", "public static function Ordinal($number) {\n $ends = array('th','st','nd','rd','th','th','th','th','th','th');\n if ((($number % 100) >= 11) && (($number%100) <= 13))\n return $number. 'th';\n else\n return $number. $ends[$number % 10];\n }", "function transNumber($input) \n{\n $faRes=\"\";\n $input=\"$input\";\n $len=strlen($input);\n for ($i=0; $i<$len; $i++)\n switch($input[$i]) {\n case \"0\": $faRes.=\"۰\"; break;\n case \"1\": $faRes.=\"۱\"; break;\n case \"2\": $faRes.=\"۲\"; break;\n case \"3\": $faRes.=\"۳\"; break;\n case \"4\": $faRes.=\"۴\"; break;\n case \"5\": $faRes.=\"۵\"; break;\n case \"6\": $faRes.=\"۶\"; break;\n case \"7\": $faRes.=\"۷\"; break;\n case \"8\": $faRes.=\"۸\"; break;\n case \"9\": $faRes.=\"۹\"; break;\n default: $faRes.= $input[$i]; break;\n }\n return $faRes;\n}", "private function convertToNumberOrdinal($number)\n {\n $error_code = $this->checkParamaters($number, 'n');\n\n if ($error_code > 0) {\n return self::$error_codes[$error_code];\n }\n\n if ($number === 0) {\n return 0;\n }\n\n if (!in_array(($number % 100), [11, 12, 13])) {\n switch ($number % 10) {\n case 1:\n return $number.'st';\n case 2:\n return $number.'nd';\n case 3:\n return $number.'rd';\n }\n }\n\n return $number.'th';\n }", "function convertNum($num) {\n $num = (int) $num; // make sure it's an integer\n\n if ($num < 0)\n return 'negative' . convertTri(-$num, 0);\n\n if ($num == 0)\n return 'Zero';\n return convertTri($num, 0);\n}", "function int2vancode($i = 0) {\n\t\t$num = base_convert((int) $i, 10, 36);\n\t\t$length = strlen($num);\n\n\t\treturn chr($length + ord('0') - 1) . $num;\n\t}", "public function testRomanToDecimal0()\n {\n $this->assertEquals(0, RomanNumber::romanToDecimal(\"\"));\n }", "function show_ordinal($num) \n\t{\n\t\t$the_num = (string) $num;\n\t\t$last_digit = substr($the_num, -1, 1);\n\t\tswitch($last_digit) \n\t\t{\n\t\t\tcase \"1\":\n\t\t\t\t$the_num.=\"st\";\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\t$the_num.=\"nd\";\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\t$the_num.=\"rd\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$the_num.=\"th\";\n\t\t}\n\t\treturn $the_num;\n\t}", "function translateIndent($number)\n{\n $indent = \"\";\n for ($x = $number; $x>0; $x--) {\n $indent = $indent.\"\\t\";\n }\n return $indent;\n}", "function convertNum($num) {\n$num = (int) $num; // make sure it's an integer\n\nif ($num < 0)\nreturn \"negative\".convertTri(-$num, 0);\n\nif ($num == 0)\nreturn \"zero\";\n\nreturn convertTri($num, 0);\n}", "protected function int2vancode($i = 0)\n {\n $num = base_convert((int)$i, 10, 36);\n $length = strlen($num);\n\n return chr($length + ord('0') - 1) . $num;\n }", "protected function int2vancode($i = 0)\n {\n $num = base_convert((int)$i, 10, 36);\n $length = strlen($num);\n\n return chr($length + ord('0') - 1) . $num;\n }", "public function convertToString($number, $letter = 'a', $i = 0)\n {\n if (!is_numeric($number)) {\n return $number;\n }\n\n while ($i < $number) {\n $i++;\n $letter++;\n }\n\n return $letter;\n }", "public function __invoke($num) {\n if ( ($num / 10) % 10 != 1 ) {\n switch( $num % 10 ) {\n case 1: return $num . 'st';\n case 2: return $num . 'nd';\n case 3: return $num . 'rd';\n }\n }\n return $num . 'th';\n }", "function romanToDecimal(&$str) \r\n{ \r\n \r\n $res = 0; \r\n \r\n // Traverse given input \r\n for ($i = 0; $i < strlen($str); $i++) \r\n { \r\n // Getting value of symbol s[i] \r\n $s1 = $this->value($str[$i]); \r\n \r\n if ($i+1 < strlen($str)) \r\n { \r\n // Getting value of \r\n // symbol s[i+1] \r\n $s2 = $this->value($str[$i + 1]); \r\n \r\n // Comparing both values \r\n if ($s1 >= $s2) \r\n { \r\n // Value of current symbol \r\n // is greater or equal to \r\n // the next symbol \r\n $res = $res + $s1; \r\n } \r\n else\r\n { \r\n $res = $res + $s2 - $s1; \r\n $i++; // Value of current symbol is \r\n // less than the next symbol \r\n } \r\n } \r\n else\r\n { \r\n $res = $res + $s1; \r\n $i++; \r\n } \r\n } \r\n return $res; \r\n}", "public function numberToLetters(int $number) : string\n {\n $number -= 1;\n for($r = \"\"; $number >= 0; $number = intval($number / 26) - 1) {\n $r = chr($number%26 + 0x41) . $r;\n }\n return $r;\n }", "public function __invoke(int $number)\n {\n $lastDigit = $this->calculateLastDigit($number);\n\n return $number.$this->ordinal($lastDigit);\n }", "public static function nameOfNumberMonth($number) {\n $sg = '';\n switch ($number) {\n case -2:\n $sg = 'Out';\n break;\n case -1:\n $sg = 'Nov';\n break;\n case 0:\n $sg = 'Dez';\n break;\n case 1:\n $sg = 'Jan';\n break;\n case 2:\n $sg = 'Fev';\n break;\n case 3:\n $sg = 'Mar';\n break;\n case 4:\n $sg = 'Abr';\n break;\n case 5:\n $sg = 'Mai';\n break;\n case 6:\n $sg = 'Jun';\n break;\n case 7:\n $sg = 'Jul';\n break;\n case 8:\n $sg = 'Ago';\n break;\n case 9:\n $sg = 'Set';\n break;\n case 10:\n $sg = 'Out';\n break;\n case 11:\n $sg = 'Nov';\n break;\n case 12:\n $sg = 'Dez';\n break;\n default:\n break;\n }\n return $sg;\n }", "public static function romano2arabigo($valor){\n\t\t$valromano=array('I'=>1, 'V'=>5,'X'=>10,'L'=>50,'C'=>100,'D'=>500,'M'=>1000);\n\t\t$resultado=0;\n\t\tif(!empty($valor)){\n\t\t\tfor($i=0; $i<strlen($valor)-1; $i++){\n\t\t\t\t$letra1=substr($valor,$i,1);\n\t\t\t\t$letra2=substr($valor,$i+1,1);\n\t\t\t\tif($valromano[$letra1] >= $valromano[$letra2] )\n\t\t\t\t\t$resultado+=$valromano[$letra1];\n\t\t\t\telse\n\t\t\t\t\t$resultado-=$valromano[$letra1];\n\t\t\t}\n\t\t\t$letra1=substr($valor,strlen($valor)-1,1);\n\t\t\t$resultado+=$valromano[$letra1];\n\t\t}\n\t\treturn $resultado;\n\t}", "public function convert($number)\n {\n if ($number % 15 == 0) {\n return \"FizzBuzz\";\n } elseif ($number % 3 == 0) {\n return \"Fizz\";\n } elseif ($number % 5 == 0) {\n return \"Buzz\";\n }\n \n return $number;\n }", "function numeral($number) {\r\n $test = abs($number) % 10;\r\n $ext = ((abs($number) % 100 < 21 and abs($number) % 100 > 4) ? 'th' : (($test < 4) ? ($test < 3) ? ($test < 2) ? ($test < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th'));\r\n return $number . $ext;\r\n}", "public function number_to_ranking($number) {\n \t//array with all rankings as number and offcial name (//if 5 points two possibilities: N.G. / C+30/5)\n \t$rankings = ['5'\t=> 'C+30/5',\n \t\t\t\t '10'\t=> 'C+30/4',\n \t\t\t\t '15'\t=> 'C+30/3',\n \t\t\t\t '20'\t=> 'C+30/2',\n \t\t\t\t '25'\t=> 'C+30/1',\n \t\t\t\t '30'\t=> 'C+30',\n \t\t\t\t '35'\t=> 'C+15/5',\n \t\t\t\t '40'\t=> 'C+15/4',\n \t\t\t\t '45'\t=> 'C+15/3',\n \t\t\t\t '50'\t=> 'C+15/2',\n \t\t\t\t '55'\t=> 'C+15/1',\n \t\t\t\t '60'\t=> 'C+15',\n \t\t\t\t '65'\t=> 'B+4/6',\n \t\t\t\t '70'\t=> 'B+2/6',\n \t\t\t\t '75'\t=> 'B0',\n \t\t\t\t '80'\t=> 'B-2/6',\n \t\t\t\t '85'\t=> 'B-4/6',\n \t\t\t\t '90'\t=> 'B-15',\n \t\t\t\t '95'\t=> 'B-15/1',\n \t\t\t\t '100'\t=> 'B-15/2',\n \t\t\t\t '105'\t=> 'B-15/4',\n \t\t\t\t '110'\t=> 'A nationaal',\n \t\t\t\t '115'\t=> 'A internationaal'];\n \tif($number) {\n \t\t$ranking = $rankings[$number] . ' (' . $number . ')';\n \t}\n \telse {\n \t\t$ranking = null;\n \t}\n \treturn $ranking;\n }", "function int_to_str($i) {\n\treturn implode('.', int_to_digits($i));\n}", "public static function inflect($number)\n {\n if (!is_numeric($number)) {\n\n throw new \\InvalidArgumentException(sprintf('$number should be numeric, \"%s\" given', gettype($number)));\n }\n\n if (0 == $number) {\n\n return 'Zero';\n }\n\n $numbers = str_split($number, 1);\n krsort($numbers);\n $chunks = array_chunk($numbers, 3);\n krsort($chunks);\n\n $finalNumber = array();\n foreach ($chunks as $k => $v) {\n // Keep a consistent map, so we fix the index\n $k = $k - 1;\n ksort($v);\n $temp = trim(self::parseNumber(implode('', $v)));\n if ($temp != '') {\n $finalNumber[$k] = $temp;\n if (isset(self::$otherNumbers[$k]) && self::$otherNumbers[$k] != '') {\n $finalNumber[$k] .= ' ' . self::$otherNumbers[$k];\n }\n }\n }\n\n return implode(', ', $finalNumber);\n }", "public function generate(int $number, bool $lowerCase = FALSE) : string {\n if ($lowerCase) {\n $table = array('m'=>1000, 'cm'=>900, 'd'=>500, 'cd'=>400, 'c'=>100, 'xc'=>90, 'l'=>50, 'xl'=>40, 'x'=>10, 'ix'=>9, 'v'=>5, 'iv'=>4, 'i'=>1);\n } else {\n $table = array('M'=>1000, 'CM'=>900, 'D'=>500, 'CD'=>400, 'C'=>100, 'XC'=>90, 'L'=>50, 'XL'=>40, 'X'=>10, 'IX'=>9, 'V'=>5, 'IV'=>4, 'I'=>1);\n }\n $return = '';\n while($number > 0)\n {\n foreach($table as $rom=>$arb)\n {\n if($number >= $arb)\n {\n $number -= $arb;\n $return .= $rom;\n break;\n }\n }\n }\n\n return $return;\n }", "public function formaRatingtNumber($number)\n {\n return number_format($number, 2, '.', '');\n }", "public static function number_to_position_word($number){\n if($number == NULL || $number == ''){\n\n echo \"Not Applicable\";\n return false;\n\n }else{\n switch ($number){\n case \"1\" :\n\n echo \"First\";\n\n break;\n\n case \"2\" :\n\n echo \"Second\";\n\n break;\n\n case \"3\" :\n\n echo \"Third\";\n\n break;\n\n case \"4\" :\n\n echo \"Fourth\";\n\n break;\n\n case \"5\" :\n\n echo \"Fifth\";\n\n break;\n\n }\n\n } \n }", "public function numToAlpha(int $num): string\n {\n // fixed set of 26 uppercase letters to be used for the conversion\n $letters = [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'\n ];\n\n /**\n * decrement the number by one to account for zero based arrays,\n * get the integer value of the number divided by 26.\n * if the number is still greater than zero call the function again.\n * else return the character in the corresponding position\n */\n\n // ensuere that $num is never less than zero\n $num = $num > 0 ? $num -= 1 : 0;\n\n $i = (int) floor($num / 26);\n\n return $i > 0 ? $this->numToAlpha($i) . $letters[$num % 26] : $letters[$num % 26];\n }", "function numberToText($num) {\n if(!is_numeric($num)){\n $num = intval($num);\n if(!is_numeric($num)) return 'NaN';\n }\n $numbers = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty');\n return $numbers[$num];\n}", "protected function ordinal($number)\n {\n return (isset($this->dict[$number]))\n ? $this->dict[$number]\n : 'th';\n }", "public function generate($integer) {\n\n\t if(!is_nan($integer)) {\n\t \t\t\n\t\t$RomanNumerals = array_keys($this->NumeralMapping);\n\t\t$NumeralValues = array_values($this->NumeralMapping);\n\t \t$deltavalue = $integer;\n\t\t$Magnitude = array();\n\t\t$Index = count($RomanNumerals) - 1;\n\t\t\n\t \twhile($deltavalue > 0) {\n\t\t\t$count = floor($deltavalue / $NumeralValues[$Index]);\n\t\t // var count = parseInt(dv / parseInt(RomanNumbers[$Index],10),10);\n\t\t //Special Cases, if we are about to place more than 3 of a specified value, \n\t\t // ( check if ) it is better to place the next (lower) numeral before the current numeral\n\t\t if($count > 3) {\n\t\t array_push($Magnitude, $RomanNumerals[$Index]);\n\t\t $deltavalue += $NumeralValues[$Index];\n\t\t array_push($Magnitude, $RomanNumerals[$Index+1]);\n\t\t $deltavalue -= $NumeralValues[$Index+1];\n\t\t $count -= 3;\n\t\t } else {\n\t\t // Keep adding Numeral until count is 0.\n\t\t while($count > 0) {\n\t\t array_push($Magnitude, $RomanNumerals[$Index]);\n\t\t $deltavalue -= $NumeralValues[$Index];\n\t\t $count--;\n\t\t }\n\t\t }\n\t \t$Index--;\n\t }\n\t\treturn implode('', $Magnitude);\n\t } else {\n\t return \"Recieved value is NOT a valid integer.\";\n\t }\n }", "function modify_number($number){\n //get the part of the string after the first zero\n $num = substr($number,1,strlen($number));\n //chunk the number into groups of threes\n $num_chunked = chunk_split($num,3,' ');\n return ' (0) '.$num_chunked;\n}", "function numberToLetter($num){\n switch ($num){\n case 1:\n return 'A';\n case 2:\n return 'B';\n case 3:\n return 'C';\n case 4:\n return 'D';\n case 5:\n return 'E';\n case 6:\n return 'F';\n case 7:\n return 'G';\n case 8:\n return 'H';\n case 9:\n return 'I';\n case 10:\n return 'J';\n case 11:\n return 'K';\n case 12:\n return 'L';\n case 13:\n return 'M';\n case 14:\n return 'N';\n case 15:\n return 'O';\n case 16:\n return 'P';\n case 17:\n return 'R';\n case 18:\n return 'S';\n case 19:\n return 'T';\n case 20:\n return 'U';\n case 21:\n return 'W';\n case 22:\n return 'X';\n case 23:\n return 'Q';\n case 24:\n return 'V';\n case 25:\n return 'Y';\n case 26:\n return 'Z';\n default:\n return '';\n }\n \n}", "function convertToIndianCurrency($number) {\n $no = round($number);\n $decimal = round($number - ($no = floor($number)), 2) * 100; \n $digits_length = strlen($no); \n $i = 0;\n $str = array();\n $words = array(\n 0 => '',\n 1 => 'One',\n 2 => 'Two',\n 3 => 'Three',\n 4 => 'Four',\n 5 => 'Five',\n 6 => 'Six',\n 7 => 'Seven',\n 8 => 'Eight',\n 9 => 'Nine',\n 10 => 'Ten',\n 11 => 'Eleven',\n 12 => 'Twelve',\n 13 => 'Thirteen',\n 14 => 'Fourteen',\n 15 => 'Fifteen',\n 16 => 'Sixteen',\n 17 => 'Seventeen',\n 18 => 'Eighteen',\n 19 => 'Nineteen',\n 20 => 'Twenty',\n 30 => 'Thirty',\n 40 => 'Forty',\n 50 => 'Fifty',\n 60 => 'Sixty',\n 70 => 'Seventy',\n 80 => 'Eighty',\n 90 => 'Ninety');\n $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\n while ($i < $digits_length) {\n $divider = ($i == 2) ? 10 : 100;\n $number = floor($no % $divider);\n $no = floor($no / $divider);\n $i += $divider == 10 ? 1 : 2;\n if ($number) {\n $plural = (($counter = count($str)) && $number > 9) ? 's' : null; \n $str [] = ($number < 21) ? $words[$number] . ' ' . $digits[$counter] . $plural : $words[floor($number / 10) * 10] . ' ' . $words[$number % 10] . ' ' . $digits[$counter] . $plural;\n } else {\n $str [] = null;\n } \n }\n \n $Rupees = implode(' ', array_reverse($str));\n $paise = ($decimal) ? \"And Paise \" . ($words[$decimal - $decimal%10]) .\" \" .($words[$decimal%10]) : '';\n return ($Rupees ? 'Rupees ' . $Rupees : '') . $paise . \" Only\";\n }", "function convertEvenToOdd($number)\n{\n $n = $number;\n if ($n % 2 === 0) {\n $n += 1;\n return $number . \" odd number\";\n }\n return $n . \" odd number\";\n}", "function month_to_string($i) \n {\n if (!is_numeric($i)) return \"\";\n $str = Array(\n 1 => 'Enero',\n 2 => 'Febrero',\n 3 => 'Marzo',\n 4 => 'Abril',\n 5 => 'Mayo',\n 6 => 'Junio',\n 7 => 'Julio',\n 8 => 'Agosto',\n 9 => 'Septiembre',\n 10 => 'Octubre',\n 11 => 'Noviembre',\n 12 => 'Diciembre'\n );\n if (isset($str[intval($i)])) \n return $str[intval($i)];\n else\n return \"\";\n }", "private static function convertToNumbers($sentence)\n {\n\t$romans = array(\n\t 'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,\n\t 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);\n\n\t$result = 0;\n\n\tforeach ($romans as $key => $value)\n\t{\n\t while (strpos($sentence, $key) === 0)\n\t {\n\t\t$result += $value;\n\t\t$sentence = mb_substr($sentence, strlen($key));\n\t }\n\t}\n\treturn $result;\n\n }", "function name_to_numbers($name){\n /* Keys on the phone:\n\n 1 2 3\n abc def\n\n 4 5 6\n ghi jkl mno\n\n 7 8 9\n pqrs tuv wxyz\n\n */\n $numberkeys = [\n \"a\" => \"2\", \"ä\" => \"2\", \"b\" => \"2\", \"c\" => \"2\",\n \"d\" => \"3\", \"e\" => \"3\", \"f\" => \"3\",\n \"g\" => \"4\", \"h\" => \"4\", \"i\" => \"4\",\n \"j\" => \"5\", \"k\" => \"5\", \"l\" => \"5\",\n \"m\" => \"6\", \"n\" => \"6\", \"o\" => \"6\", \"ö\" => \"6\",\n \"p\" => \"7\", \"q\" => \"7\", \"r\" => \"7\", \"s\" => \"7\", \"ß\" => \"7\",\n \"t\" => \"8\", \"u\" => \"8\", \"ü\" => \"8\", \"v\" => \"8\",\n \"w\" => \"9\", \"x\" => \"9\", \"y\" => \"9\", \"z\" => \"9\"\n ];\n $out = \"\";\n for($i = 0; $i < mb_strlen($name); $i++){\n $idx = mb_strtolower(mb_substr($name, $i, 1));\n if( isset($numberkeys[$idx]) )\n $out.= $numberkeys[$idx];\n }\n return $out;\n}", "function convertToRupee($number){\r\n\t\t$no = round($number);\r\n\t\t$whole = floor($number); \r\n\t\t$point = $number - $whole; \r\n\r\n\t\t$hundred = null;\r\n\t\t$digits_1 = strlen($no);\r\n\t\t$i = 0;\r\n\t\t$str = array();\r\n\t\t$words = array('0' => '', '1' => 'One', '2' => 'Two',\r\n\t\t\t\t'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',\r\n\t\t\t\t'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',\r\n\t\t\t\t'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',\r\n\t\t\t\t'13' => 'Thirteen', '14' => 'fourteen',\r\n\t\t\t\t'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',\r\n\t\t\t\t'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',\r\n\t\t\t\t'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',\r\n\t\t\t\t'60' => 'Sixty', '70' => 'Seventy',\r\n\t\t\t\t'80' => 'Eighty', '90' => 'Ninety');\r\n\t\t\t\t$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\r\n\t\twhile ($i < $digits_1) {\r\n\t\t\t$divider = ($i == 2) ? 10 : 100;\r\n\t\t\t$number = floor($no % $divider);\r\n\t\t\t$no = floor($no / $divider);\r\n\t\t\t$i += ($divider == 10) ? 1 : 2;\r\n\t\t\tif ($number) {\r\n\t\t\t\t$plural = (($counter = count($str)) && $number > 9) ? 's' : null;\r\n\t\t\t\t$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;\r\n\t\t\t\t$str [] = ($number < 21) ? $words[$number] .\r\n\t\t\t\t\t\" \" . $digits[$counter] . $plural . \" \" . $hundred\r\n\t\t\t\t\t:\r\n\t\t\t\t\t$words[floor($number / 10) * 10]\r\n\t\t\t\t\t. \" \" . $words[$number % 10] . \" \"\r\n\t\t\t\t\t. $digits[$counter] . $plural . \" \" . $hundred;\r\n\t\t\t} else $str[] = null;\r\n\t\t}\r\n\t\t$str = array_reverse($str);\r\n\t\t$result = implode('', $str);\r\n\t\t$points = $this->paiseValue($point);\r\n\r\n\t\t$finalStr = '';\r\n\r\n\t\tif(!empty($result)){\r\n\t\t\t$finalStr .= $result. \" Rupees \";\r\n\t\t}\r\n\t\tif(!empty($points)){\r\n\t\t\t$finalStr .= \"and \".$points. \" Paise\";\r\n\t\t}\r\n\t\tif(!empty($finalStr)){\r\n\t\t\t$finalStr .= \" Only.\";\r\n\t\t}\r\n\r\n\t\treturn $finalStr;\r\n\t}", "private function _toNumericString($iban)\n {\n assert(is_string($iban), 'Invalid argument $iban: string expected');\n\n $string = strtoupper(substr($iban, 4) . substr($iban, 0, 4));\n $number = \"\";\n\n // The string is treated as an array on purpose. This is NOT an accident. Unicode is NOT an issue here.\n for ($i = 0; $i < strlen($string); $i++)\n {\n $number .= is_numeric($string[$i]) ? (string) $string[$i] : (string) (ord($string[$i]) - 55);\n }\n unset($i, $string);\n\n return $number;\n }", "public function getNumberVoucher(){\n return str_replace('R','G',$this->number);\n }", "public function create_invoice_number()\n\t{\n\t\t//select product code\n\t\t$this->db->from('invoice');\n\t\t$this->db->where(\"invoice_number LIKE 'IOD-INV-\".date('y').\"-%'\");\n\t\t$this->db->select('MAX(invoice_number) AS number');\n\t\t$query = $this->db->get();\n\t\t$preffix = \"IODk/\";\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result();\n\t\t\t$number = $result[0]->number;\n\t\t\t$real_number = str_replace($preffix, \"\", $number);\n\t\t\t$real_number++;//go to the next number\n\t\t\t$number = $preffix.sprintf('%04d', $real_number);\n\t\t}\n\t\telse{//start generating receipt numbers\n\t\t\t$number = $preffix.sprintf('%04d', 1);\n\t\t}\n\t\t\n\t\treturn $number.'/'.date('Y');\n\t}", "function convertNumToWord($n) {\n $arr = array(\n 0 => 'twelve',\n 1 => 'one',\n 2 => 'two', \n 3 => 'three',\n 4 => 'four',\n 5 => 'five', \n 6 => 'six',\n 7 => 'seven',\n 8 => 'eight', \n 9 => 'nine',\n 10 => 'ten',\n 11 => 'eleven',\n 12 => 'twelve',\n 13 => 'thirteen',\n 14 => 'fourteen',\n 15 => 'fifteen',\n 16 => 'sixteen',\n 17 => 'seventeen',\n 18 => 'eighteen',\n 19 => 'nineteen',\n 20 => 'twenty',\n 21 => 'twenty one',\n 22 => 'twenty two',\n 23 => 'twenty three',\n 24 => 'twenty four',\n 25 => 'twenty five',\n 26 => 'twenty six',\n 27 => 'twenty seven',\n 28 => 'twenty eight',\n 29 => 'twenty nine',\n 30 => 'thirty'\n );\n return $arr[$n];\n}", "function NumToLetter($NumValue)\n\t{\n\t\treturn ( chr($NumValue + 97) );\n\t}", "static function Number_to_Word($num)\n\t{\n\t\t$fn = array();\n\n\t\tif ($num == 0)\n\t\t\treturn self::$nums[0];\n\n\t\twhile ($num != 0) {\n\t\t\tif ($num < 0) {\n\t\t\t\t$fn[] = self::$nums['-'];\n\t\t\t\t$num = -$num;\n\t\t\t}\n\t\t\telseif ($num < 20) {\n\t\t\t\t$fn[] = self::$nums[$num];\n\t\t\t\t$num = 0;\n\t\t\t}\n\t\t\telse if ($num < 100) {\n\t\t\t\t$val = floor($num / 10) * 10;\n\t\t\t\t$fn[] = self::$nums[$val];\n\t\t\t\tif (($num -= $val) > 0)\n\t\t\t\t\t$fn[] = '-';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($num < 1000) {\n\t\t\t\t\t$num -= ($val = floor($num / 100)) * 100;\n\t\t\t\t\t$fn[] = self::$nums[$val] . ' hundred';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($num < 1000000) {\n\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000)));\n\t\t\t\t\t\t$fn[] = 'thousand';\n\t\t\t\t\t\t$num = $num % 1000;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($num < 1000000000) {\n\t\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000000)));\n\t\t\t\t\t\t\t$fn[] = 'million';\n\t\t\t\t\t\t\t$num = $num % 1000000;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttrigger_error(\"WriteNum::write :: number is bigger than maximum allowed.\", E_USER_WARNING);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn preg_replace('/ \\- /', '-', implode(' ', $fn));\n\t}", "function numtochar($numin) {\n\t\tif($numin == 0){\n\t\t\t$charout = $numin;\n\t\t\treturn $charout; \n\t\t}\n\t\telse{\n\t\t\t$numa=ord('A'); \t\t//\twe want numin=1 to produce chr('A'), so \n\t\t\t$numout=$numin+$numa-1; // now if numin=1, numout = chr('A') \n\t\t\t$charout=chr($numout); // and if numin=2, numout = chr('B') etc. \t\n\t\t\treturn $charout; \n\t\t}\n\t}", "public function formatNumber($number);", "function NumeroInscripcion($primerdigito,$id)\n {\n $numero = $primerdigito.str_pad($id, 4, '0', STR_PAD_LEFT);\n $letra = '';\n $suma = 0;\n for ($i = 0; $i < 5; $i++) {\n $suma += substr($numero, $i, 1) * ($i + 1);\n }\n $letra = chr($suma % 11 + 65);\n $codigo = $numero.$letra;\n\n return $codigo;\n }", "function ordinal($number) {\r\n\r\n // when fed a number, adds the English ordinal suffix. Works for any\r\n // number, even negatives\r\n\r\n if ($number % 100 > 10 && $number %100 < 14):\r\n $suffix = \"th\";\r\n else:\r\n switch($number % 10) {\r\n\r\n case 0:\r\n $suffix = \"th\";\r\n break;\r\n\r\n case 1:\r\n $suffix = \"st\";\r\n break;\r\n\r\n case 2:\r\n $suffix = \"nd\";\r\n break;\r\n\r\n case 3:\r\n $suffix = \"rd\";\r\n break;\r\n\r\n default:\r\n $suffix = \"th\";\r\n break;\r\n }\r\n\r\n endif;\r\n\r\n return \"${number}$suffix\";\r\n\r\n}", "function nilaiSiswa($nilai) {\nif($nilai==0){ \n\t$nilai = '';\n}\nelseif($nilai==4){ \n\t$nilai = 'SB';\n}\nelseif($nilai==3){ \n\t$nilai = 'B';\n}\nelseif($nilai==2){ \n\t$nilai = 'C';\n}\nelse { \n\t$nilai = 'K';\n}\n\treturn $nilai;\n}", "function stpb_number_to_text($n){\r switch($n){\r case 1:\r $class ='one';\r break;\r case 2:\r $class ='two';\r break;\r case 3:\r $class ='three';\r break;\r case 4:\r $class ='four';\r break;\r case 5:\r $class ='five';\r break;\r case 6:\r $class ='six';\r break;\r case 7:\r $class ='seven';\r break;\r case 8:\r $class ='eight';\r break;\r case 9:\r $class ='nine';\r break;\r case 10:\r $class ='ten';\r break;\r case 10:\r $class ='eleven';\r break;\r\r default :\r $class ='twelve';\r\r }\r return $class;\r}", "function MakePhoneNumberInt($thenumber)\r\n{\r\n\t$dff = substr($thenumber, 0, 1);\r\n\t$dff2 = substr($thenumber, 0, 3);\r\n\tif($dff==\"+\")\r\n\t{\r\n\t\treturn $thenumber;\r\n\t}\r\n\telse if($dff == \"0\")\r\n\t{\r\n\t\treturn \"234\".substr($thenumber, 1);\r\n\t}\r\n\telse if($dff2 == \"234\")\r\n\t{\r\n\t\treturn $thenumber;\r\n\t}\r\n}", "private function getNameFromNumber($num) {\n \t$numeric = $num % 26;\n \t$letter = chr(65 + $numeric);\n \t$num2 = intval($num / 26);\n \tif ($num2 > 0) {\n \treturn $this->getNameFromNumber($num2 - 1) . $letter;\n \t} else {\n \treturn $letter;\n \t}\n\t}", "public static function integerToLetters($integer, $uppercase = true) {}", "public function toMonth(int $int)\n {\n return date('F', mktime(0, 0, 0, $int, 10));\n }", "function to($dscNum);", "public static function human_number( $number ) {\n\n\t\tif ( ! is_numeric( $number ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$negative = '';\n\t\tif ( abs( $number ) != $number ) {\n\t\t\t$negative = '-';\n\t\t\t$number = abs( $number );\n\t\t}\n\n\t\tif ( $number < 1000 ) {\n\t\t\treturn $negative ? -1 * $number : $number;\n\t\t}\n\n\t\t$unit = intval( log( $number, 1000 ) );\n\t\t$units = array( '', 'K', 'M', 'B', 'T', 'Q' );\n\n\t\tif ( array_key_exists( $unit, $units ) ) {\n\t\t\treturn sprintf( '%s%s%s', $negative, rtrim( number_format( $number / pow( 1000, $unit ), 1 ), '.0' ), $units[ $unit ] );\n\t\t}\n\n\t\treturn $number;\n\t}" ]
[ "0.82610625", "0.82389516", "0.7946739", "0.7691947", "0.7565053", "0.7512252", "0.7407585", "0.7310331", "0.7305015", "0.72473955", "0.71868056", "0.70210695", "0.69471973", "0.6856323", "0.6725886", "0.66838336", "0.66663855", "0.6618996", "0.65021867", "0.61236745", "0.60478616", "0.59808266", "0.585209", "0.58063036", "0.5801744", "0.57401466", "0.5724844", "0.56809425", "0.563641", "0.55709916", "0.5551072", "0.5396839", "0.5392093", "0.5321151", "0.5281053", "0.5267305", "0.526279", "0.526279", "0.52493703", "0.5208784", "0.51969236", "0.5189497", "0.51832384", "0.5157445", "0.5144367", "0.51345694", "0.51143116", "0.5083648", "0.5054812", "0.5054632", "0.5050863", "0.50229335", "0.50136584", "0.499668", "0.499668", "0.49236593", "0.49199784", "0.4914862", "0.4866906", "0.48578712", "0.48385108", "0.48312324", "0.48302898", "0.47783938", "0.47766504", "0.47758758", "0.47529092", "0.47440258", "0.47424835", "0.4715482", "0.47077224", "0.47051692", "0.46924514", "0.4684989", "0.4680343", "0.46546277", "0.46515617", "0.4645156", "0.4641826", "0.464125", "0.4587362", "0.4582694", "0.4567955", "0.4553548", "0.45412815", "0.45307735", "0.4529146", "0.4513994", "0.450401", "0.4503745", "0.4484672", "0.44787216", "0.44748786", "0.44739187", "0.44679573", "0.4446842", "0.44460878", "0.44451708", "0.44243288", "0.44186825" ]
0.80524415
2
/ this way it works well only for orthogonal lines imagesetthickness($image, $thick); return imageline($image, $x1, $y1, $x2, $y2, $color);
function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1) { if ($thick == 1) { return imageline($image, $x1, $y1, $x2, $y2, $color); } $t = $thick / 2 - 0.5; if ($x1 == $x2 || $y1 == $y2) { return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color); } $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q $a = $t / sqrt(1 + pow($k, 2)); $points = array( round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a), round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a), round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a), round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a), ); imagefilledpolygon($image, $points, 4, $color); return imagepolygon($image, $points, 4, $color); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1)\n {\n if ($thick == 1) {\n return imageline($image, $x1, $y1, $x2, $y2, $color);\n }\n $t = $thick / 2 - 0.5;\n if ($x1 == $x2 || $y1 == $y2) {\n return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);\n }\n $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q\n $a = $t / sqrt(1 + pow($k, 2));\n $points = array(\n round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a),\n round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a),\n round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a),\n round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a),\n );\n imagefilledpolygon($image, $points, 4, $color);\n return imagepolygon($image, $points, 4, $color);\n }", "function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1)\n{\n if ($thick == 1) {\n return imageline($image, $x1, $y1, $x2, $y2, $color);\n }\n $t = $thick / 2 - 0.5;\n if ($x1 == $x2 || $y1 == $y2) {\n return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);\n }\n $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q\n $a = $t / sqrt(1 + pow($k, 2));\n $points = array(\n round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a),\n round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a),\n round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a),\n round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a),\n );\n imagefilledpolygon($image, $points, 4, $color);\n return imagepolygon($image, $points, 4, $color);\n}", "function drawThickLine($img, $startX, $startY, $endX, $endY, $colour, $thickness) \n{\n\t$angle = (atan2(($startY - $endY), ($endX - $startX))); \n\n\t$dist_x = $thickness * (sin($angle));\n\t$dist_y = $thickness * (cos($angle));\n\t\n\t$p1x = ceil(($startX + $dist_x));\n\t$p1y = ceil(($startY + $dist_y));\n\t$p2x = ceil(($endX + $dist_x));\n\t$p2y = ceil(($endY + $dist_y));\n\t$p3x = ceil(($endX - $dist_x));\n\t$p3y = ceil(($endY - $dist_y));\n\t$p4x = ceil(($startX - $dist_x));\n\t$p4y = ceil(($startY - $dist_y));\n\t\n\t$array = array(0=>$p1x, $p1y, $p2x, $p2y, $p3x, $p3y, $p4x, $p4y);\n\timagefilledpolygon($img, $array, (count($array)/2), $colour);\n}", "function zbx_imageline($image, $x1, $y1, $x2, $y2, $color) {\n\t\timageline($image, round($x1), round($y1), round($x2), round($y2), $color);\n}", "private function drawThickLine($im, $x1, $y1, $x2, $y2, $thickness, $col)\n {\n $dx = $x2 - $x1;\n $dy = $y2 - $y1;\n\n $d = sqrt($dx * $dx + $dy * $dy);\n\n if ($d == 0)\n return;\n\n $dx /= $d;\n $dy /= $d;\n\n $t = $thickness * 0.5;\n\n $p = array();\n\n $p[] = array($x1 + $dy * $t, $y1 - $dx * $t);\n $p[] = array($x2 + $dy * $t, $y2 - $dx * $t);\n $p[] = array($x2 - $dy * $t, $y2 + $dx * $t);\n $p[] = array($x1 - $dy * $t, $y1 + $dx * $t);\n\n $this->drawShadedConvexPolygon($im, $p, $col);\n }", "public function drawLine(int $x1, int $y1, int $x2, int $y2, int $thick = 1, int $r = 255, int $g = 255, int $b = 255, int $alpha = 0) {\r\n $colour = imagecolorallocatealpha($this->image, $r, $g, $b, $alpha);\r\n\r\n if ($thick == 1) {\r\n return imageline($this->image, $x1, $y1, $x2, $y2, $colour);\r\n }\r\n $t = $thick / 2 - 0.5;\r\n if ($x1 == $x2 || $y1 == $y2) {\r\n return imagefilledrectangle($this->image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $colour);\r\n }\r\n $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q\r\n $a = $t / sqrt(1 + pow($k, 2));\r\n $points = array(\r\n round($x1 - (1 + $k) * $a), round($y1 + (1 - $k) * $a),\r\n round($x1 - (1 - $k) * $a), round($y1 - (1 + $k) * $a),\r\n round($x2 + (1 + $k) * $a), round($y2 - (1 - $k) * $a),\r\n round($x2 + (1 - $k) * $a), round($y2 + (1 + $k) * $a),\r\n );\r\n imagefilledpolygon($this->image, $points, 4, $colour);\r\n imagepolygon($this->image, $points, 4, $colour);\r\n }", "function imagesmoothline ( $image , $x1 , $y1 , $x2 , $y2 , $color )\n {\n $colors = imagecolorsforindex ( $image , $color );\n if ( $x1 == $x2 )\n {\n imageline ( $image , $x1 , $y1 , $x2 , $y2 , $color ); // Vertical line\n }\n else\n {\n $m = ( $y2 - $y1 ) / ( $x2 - $x1 );\n $b = $y1 - $m * $x1;\n if ( abs ( $m ) <= 1 )\n {\n $x = min ( $x1 , $x2 );\n $endx = max ( $x1 , $x2 );\n while ( $x <= $endx )\n {\n $y = $m * $x + $b;\n $y == floor ( $y ) ? $ya = 1 : $ya = $y - floor ( $y );\n $yb = ceil ( $y ) - $y;\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , $x , floor ( $y ) ) );\n $tempcolors['red'] = $tempcolors['red'] * $ya + $colors['red'] * $yb;\n $tempcolors['green'] = $tempcolors['green'] * $ya + $colors['green'] * $yb;\n $tempcolors['blue'] = $tempcolors['blue'] * $ya + $colors['blue'] * $yb;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , $x , floor ( $y ) , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , $x , ceil ( $y ) ) );\n $tempcolors['red'] = $tempcolors['red'] * $yb + $colors['red'] * $ya;\n $tempcolors['green'] = $tempcolors['green'] * $yb + $colors['green'] * $ya;\n $tempcolors['blue'] = $tempcolors['blue'] * $yb + $colors['blue'] * $ya;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , $x , ceil ( $y ) , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $x ++;\n }\n }\n else\n {\n $y = min ( $y1 , $y2 );\n $endy = max ( $y1 , $y2 );\n while ( $y <= $endy )\n {\n $x = ( $y - $b ) / $m;\n $x == floor ( $x ) ? $xa = 1 : $xa = $x - floor ( $x );\n $xb = ceil ( $x ) - $x;\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , floor ( $x ) , $y ) );\n $tempcolors['red'] = $tempcolors['red'] * $xa + $colors['red'] * $xb;\n $tempcolors['green'] = $tempcolors['green'] * $xa + $colors['green'] * $xb;\n $tempcolors['blue'] = $tempcolors['blue'] * $xa + $colors['blue'] * $xb;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , floor ( $x ) , $y , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $tempcolors = imagecolorsforindex ( $image , imagecolorat ( $image , ceil ( $x ) , $y ) );\n $tempcolors['red'] = $tempcolors['red'] * $xb + $colors['red'] * $xa;\n $tempcolors['green'] = $tempcolors['green'] * $xb + $colors['green'] * $xa;\n $tempcolors['blue'] = $tempcolors['blue'] * $xb + $colors['blue'] * $xa;\n if ( imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) == -1 ) imagecolorallocate ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] );\n imagesetpixel ( $image , ceil ( $x ) , $y , imagecolorexact ( $image , $tempcolors['red'] , $tempcolors['green'] , $tempcolors['blue'] ) );\n $y ++;\n }\n }\n }\n }", "function drawLine(&$im, $x1, $y1, $x2, $y2, $c1, $c2)\n\t{\n\t\timageline($im, $x1+1, $y1, $x2+1, $y2, $c1);\n\t\timageline($im, $x1-1, $y1, $x2-1, $y2, $c1);\n\t\timageline($im, $x1, $y1+1, $x2, $y2+1, $c1);\n\t\timageline($im, $x1, $y1-1, $x2, $y2-1, $c1);\n\t\timageline($im, $x1, $y1, $x2, $y2, $c2);\n\t}", "function drawBorder(&$img, &$color, $thickness = 1) \n{\n $x1 = 0; \n $y1 = 0; \n $x2 = ImageSX($img) - 1; \n $y2 = ImageSY($img) - 1; \n\n for($i = 0; $i < $thickness; $i++) \n { \n ImageRectangle($img, $x1++, $y1++, $x2--, $y2--, $color); \n } \n}", "private function _addLines() {\r\n\t\t// Reset line thickness to one pixel.\r\n\t\timagesetthickness($this->_resource, 1);\r\n\t\t\r\n\t\t// Reset foreground color to default. \r\n\t\t$foreground = imagecolorallocate($this->_resource, $this->_fg_color['R'], $this->_fg_color['G'], $this->_fg_color['B']);\r\n\t\t\r\n\t\t// Get dimension of image\r\n\t\t$width = imagesx($this->_resource);\r\n\t\t$height = imagesy($this->_resource);\r\n\t\t\r\n\t\tfor ($i = 0; $i < abs($this->_linesModifier); $i++) {\r\n\t\t\t// Set random foreground color if desired.\r\n\t\t\t($this->useRandomColorLines) ? $foreground = $this->_setRandomColor() : null;\r\n\t\t\t\r\n\t\t\t// Add some randomly colored lines.\r\n\t\t\timageline($this->_resource, 0, rand(0, $height), $width, rand(0, $height), $foreground); // horizontal\r\n\t\t\timageline($this->_resource, rand(0, $width), 0, rand(0, $width), $height, $foreground); // vertical\r\n\t\t}\r\n\t}", "private function getLine(Point $point1, Point $point2, $color, $thickness)\n {\n $line = new SVGLine($point1->x, $point1->y, $point2->x, $point2->y);\n $line->setStyle('stroke', $color);\n $line->setStyle('stroke-width', $thickness);\n $line->setStyle('fill', 'none');\n\n return $line;\n }", "public function createLine($x1, $y1, $x2, $y2){\n imageline($this->img, $x1, $y1, $x2, $y2, $this->color);\t\n }", "abstract protected function renderStroke($image, $params, int $color, float $strokeWidth): void;", "public function setLineWidth($lineWidth = 1) {}", "private function addLines()\n {\n\n $lines = rand(1, 3);\n for ($i = 0; $i < $lines; $i++) {\n imageline($this->imageResource, rand(0, 200), rand(0, -77), rand(0, 200), rand(77, 144), imagecolorallocate($this->imageResource, rand(0, 240), rand(0, 240), rand(0, 240)));\n }\n\n for ($i = 0; $i < 5 - $lines; $i++) {\n imageline($this->imageResource, rand(0, -200), rand(0, 77), rand(200, 400), rand(0, 77), imagecolorallocate($this->imageResource, rand(0, 240), rand(0, 240), rand(0, 240)));\n }\n }", "public function setUnderlineThickness($thickness) {}", "public function setLineWidth($lineWidth) {}", "function draw_average_line($average, $max_w, $min_w, $im){\r\n \r\n global $width, $height, $offset_w, $offset_h;\r\n $red = imagecolorallocate($im, 220, 0, 200);\r\n $y = $height - ($average - $min_w) * $height / ($max_w - $min_w) + $offset_h;\r\n imageline($im, $offset_w, $y, $offset_w + $width, $y, $red); \r\n imagestring($im, 2, $offset_w+$width+10, $y, round($average,2), $red);\r\n}", "function draw_boxes2 ($image, $colorid=0, $offset=0) {\r\n \r\n $color[0]= imagecolorallocate($image, 0, 0, 0);\r\n $color[1]= imagecolorallocate($image, 255, 0, 0);\r\n $color[2]= imagecolorallocate($image, 0, 255, 0);\r\n $color[3]= imagecolorallocate($image, 0, 0, 255);\r\n $color[4]= imagecolorallocate($image, 255, 255, 0);\r\n \r\n $linecolor=$color[$colorid];\r\n \r\n foreach($this->text_blocks as $text_block) {\r\n imageline ( $image , $text_block->ordered['x1'] -$offset, $text_block->ordered['y1'] -$offset, $text_block->ordered['x2'] +$offset, $text_block->ordered['y2'] -$offset, $linecolor);\r\n imageline ( $image , $text_block->ordered['x2'] +$offset, $text_block->ordered['y2'] -$offset, $text_block->ordered['x3'] +$offset, $text_block->ordered['y3']+$offset , $linecolor);\r\n imageline ( $image , $text_block->ordered['x3'] +$offset, $text_block->ordered['y3'] +$offset, $text_block->ordered['x4'] -$offset, $text_block->ordered['y4']+$offset , $linecolor);\r\n imageline ( $image , $text_block->ordered['x4'] -$offset, $text_block->ordered['y4'] +$offset, $text_block->ordered['x1'] -$offset, $text_block->ordered['y1']-$offset , $linecolor);\r\n }\r\n $this->image_drawn=$image;\r\n }", "function setLineStyle($thickness = 4, $dot_size = 7)\n {\n if ($dot_size < 0) {\n $dot_size = 0;\n }\n if ($thickness < 0) {\n $thickness = 0;\n }\n\n if ($dot_size < $thickness) {\n $dot_size = $thickness;\n }\n\n $this->line_thickness = $thickness;\n $this->line_dot_size = $dot_size;\n\n $this->data[$this->series]['line_dot_size'] = $dot_size;\n $this->data[$this->series]['line_thickness'] = $thickness;\n }", "public function line($x1, $y1, $x2, $y2) {}", "public function border(string $color = '#000', int $thickness = 5): Image\n\t{\n\t\t$this->processor->border($color, $thickness);\n\n\t\treturn $this;\n\t}", "function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color) \n\t{\n\t\tif( $alength > 1 )\n\t\t\tarrow( $im, $x1, $y1, $x2, $y2, $alength - 1, $awidth - 1, $color );\n\n\t\t$distance = sqrt(pow($x1 - $x2, 2) + pow($y1 - $y2, 2));\n\n\t\t$dx = $x2 + ($x1 - $x2) * $alength / $distance;\n\t\t$dy = $y2 + ($y1 - $y2) * $alength / $distance;\n\n\t\t$k = $awidth / $alength;\n\n\t\t$x2o = $x2 - $dx;\n\t\t$y2o = $dy - $y2;\n\t\t\n\t\t$x3 = $y2o * $k + $dx;\n\t\t$y3 = $x2o * $k + $dy;\n\n\t\t$x4 = $dx - $y2o * $k;\n\t\t$y4 = $dy - $x2o * $k;\n\n\t\timageline($im, $x1, $y1, $dx, $dy, $color);\n\t\timageline($im, $x3, $y3, $x4, $y4, $color);\n\t\timageline($im, $x3, $y3, $x2, $y2, $color);\n\t\timageline($im, $x2, $y2, $x4, $y4, $color);\n\t}", "function drawLine($lineRange, $type, $colour = 'D9D9D9') {\n $border_style = array('borders' => array($type =>\n array('style' =>\n \\PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('rgb' => $colour)\n )));\n $this->objWorksheet->getStyle($lineRange)->applyFromArray($border_style);\n }", "function build_grid($rows, $columns, $image){\r\n\r\n global $width, $height, $offset_w, $offset_h;\r\n \r\n $grid_color = imagecolorallocate($image, 90, 90, 90);\r\n $grid_light_color = imagecolorallocate($image, 120, 120, 120);\r\n // vertical grid\r\n for($i=0;$i<$rows+1;$i++){\r\n $x = $offset_w + $i/$rows*$width;\r\n if($i%10==0){\r\n imageline($image, $x, $offset_h, $x, $offset_h+$height, $grid_light_color);\r\n }else{\r\n imageline($image, $x, $offset_h, $x, $offset_h+$height, $grid_color);\r\n }\r\n }\r\n \r\n for($i=0;$i<$columns+1;$i++){\r\n $y = $offset_h + $i/$columns*$height;\r\n imageline($image, $offset_w, $y, $offset_w+$width, $y, $grid_color);\r\n }\r\n}", "public function generatePictureLine()\n {\n $values = $this->data;\n\n // Get the total number of columns we are going to plot\n $columns = count($values);\n\n // Get the height and width of the diagram itself\n $width = round($this->w*0.75);\n $height = round($this->h*0.75);\n\n //$padding = 0;\n //$padding_l = 5;\n $padding_h = round(($this->w - $width) / 2);\n $padding_v = round(($this->h - $height) / 2); \n\n // Get the width of 1 column\n $column_width = round ($width / $columns) ;\n \n \n // Fill in the background of the image\n imagefilledrectangle($this->im,0,0,$this->w,$this->h,$this->white);\n\n $maxv = 0;\n\n // Calculate the maximum value we are going to plot\n\n foreach($values as $key => $value) \n {\n $maxv = max($value,$maxv); \n }\n \n $this->drawAxesLabels($width, $height, $column_width, $padding_h,$padding_v, $maxv);\n \n //diagram itself\n $i=0;\n //for ($i = 0;$i<count($values);)\n foreach ($values as $key => $value)\n {\n //if ($i==count($values))\n // break;\n $column_height1 = ($height / 100) * (( $value / $maxv) *100);\n $x1 = $i*$column_width + $padding_h + $column_width/2;\n $y1 = $height-$column_height1 + $padding_v;\n $i++;\n if ($i<2)\n {\n $column_height2 = ($height / 100) * (( $value / $maxv) *100);\n $x2 = (($i)*$column_width) + $padding_h + $column_width/2;\n $y2 = $height-$column_height2 + $padding_v;\n }\n if ($i>1)\n imageline($this->im,$x1,$y1,$x2,$y2,$this->color_helper->img_colorallocate($this->im, $this->color_helper->nextColor()));\n $x2 = $x1; \n\t\t$y2 = $y1;\n }\n \n return $this->im;\n }", "function svgline($x1,$y1,$x2,$y2,$xmul,$ymul)\n{\n global $colors;\n $str=\"\";\n $strokew=$xmul*0.1;\n \n $col=$colors[$y1%count($colors)];\n\n if((abs($x2-$x1)>1)&&($y1!=$y2)){\n $str.=\"<line x1='\".($x1*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".(($x2-1)*$xmul).\"' y2='\".($y1*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n $str.=\"<line x1='\".(($x2-1)*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".($x2*$xmul).\"' y2='\".($y2*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n }else{\n $str.=\"<line x1='\".($x1*$xmul).\"' y1='\".($y1*$ymul).\"' x2='\".($x2*$xmul).\"' y2='\".($y2*$ymul).\"' stroke='\".$col.\"' style='stroke-width:\".$strokew.\"' />\";\n }\n\n return($str);\n}", "function line($x1, $y1, $x2, $y2)\r\n {\r\n $this->forcePen();\r\n echo \"$this->_canvas.drawLine($x1, $y1, $x2, $y2);\\n\";\r\n }", "function StrokeFascia($img) {\n\t$r = $this->iRadius;\n\n\t// If the border width > 1 we have no choice but to\n\t// draw to filled circles since GD 1.x at does not support\n\t// a width for a circle. For the special case with a border\n\t// of width==1 it looks aestethically better to just draw a \n\t// normal circle.\n\tif( $this->iBorderWidth > 1 ) {\n\t $this->FilledCircle($img,\n\t $this->xc,$this->yc,$r,\n\t $this->iColor);\n\t $this->FilledCircle($img,\n\t $this->xc,$this->yc,$r-$this->iBorderWidth,\n\t $this->iFillColor);\n\t}\n\telse {\n\t $this->FilledCircle($img,$this->xc,$this->yc,$r,$this->iFillColor);\n\t}\n\t$doarcborder = $this->iBorderWidth == 1 ;\n\n\t// Stroke colored indicator band\n\t$n = count($this->iInd);\n\t$r = $this->iRadius - ($this->iBorderWidth == 1 ? 0 : $this->iBorderWidth);\n\tfor( $i=0; $i<$n; ++$i) {\n\t $ind = $this->iInd[$i];\n\t $as = 360-$this->scale->Translate($ind[0])*180/M_PI;\n\t $ae = 360-$this->scale->Translate($ind[1])*180/M_PI;\n\t $img->PushColor($ind[2]);\n\t $img->FilledArc($this->xc,$this->yc,$r*2,$r*2,$as,$ae);\n\t $img->PopColor();\t\n\t}\n $this->FilledCircle($img,\n\t $this->xc,$this->yc,$this->iCenterAreaWidth*$this->iRadius,\n\t $this->iFillColor); \n\tif( $doarcborder ) \n\t $img->Arc($this->xc,$this->yc, 2*$r, 2*$r, $this->iStyle==ODO_HALF ? 180 : 0 , 360);\n\n\t// Finally draw bottom line if ODO_HALF\n\tif( $this->iStyle == ODO_HALF && $this->iBorderWidth > 0 ) {\n\t $img->SetLineWeight($this->iBorderWidth);\n\t $img->PushColor($this->iColor);\n\t $img->Line($this->xc-$this->iRadius,$this->yc,$this->xc+$this->iRadius,$this->yc);\n\t $img->PopColor();\n\t}\n }", "function Line($x1, $y1, $x2, $y2, $style = null) {\r\n if ($style)\r\n $this->SetLineStyle($style);\r\n parent::Line($x1, $y1, $x2, $y2);\r\n }", "public function addScreen($_image)\n {\n $imagex = imagesx($_image);\n $imagey = imagesy($_image);\n $black = imagecolorallocate($_image, 0, 0, 0);\n\n for($x = 1; $x <= $imagex; $x += 2)\n {\n imageline($_image, $x, 0, $x, $imagey, $black);\n }\n\n for($y = 1; $y <= $imagey; $y += 2)\n {\n imageline($_image, 0, $y, $imagex, $y, $black);\n }\n\n return $_image;\n }", "private function traceLine() {\n $this->lineJump();\n $this->currentPage->rectangle(self::HMARGIN + $this->hOffset, $this->PAGE_HEIGHT - self::VMARGIN - $this->vOffset, $this->PAGE_WIDTH - 2*$this->hOffset - 2*self::HMARGIN, 1);\n $this->currentPage->stroke();\n }", "public function getLineWidth($line = false) {\n if (!$line) {\n $line = $this->_lineIndex;\n }\n return $this->_lines[$this->_lineIndex]['width'];\n }", "public function getLineWidth($line = false) {\n if (!$line) {\n $line = $this->_lineIndex;\n }\n return $this->_lines[$this->_lineIndex]['width'];\n }", "private function cutFill($im, $line_numbers, $line_width, $start, $end, $direction, $step = 0) {\n if ($step) $this->step = $step;\n list($r1,$g1,$b1) = self::hex2rgb($start);\n list($r2,$g2,$b2) = self::hex2rgb($end);\n\n/*\n switch($direction) {\n case 'horizontal':\n $line_numbers = imagesx($im);\n $line_width = imagesy($im);\n break;\n case 'vertical':\n $line_numbers = imagesy($im);\n $line_width = imagesx($im);\n break;\n case 'ellipse':\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = min($width,$height);\n $center_x = $width/2;\n $center_y = $height/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n imagefill($im, 0, 0, imagecolorallocate( $im, $r1, $g1, $b1 ));\n break;\n case 'ellipse2':\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = sqrt(pow($width,2)+pow($height,2));\n $center_x = $width/2;\n $center_y = $height/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'circle':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = sqrt(pow($width,2)+pow($height,2));\n $center_x = $width/2;\n $center_y = $height/2;\n $rh = $rw = 1;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'circle2':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = min($width,$height);\n $center_x = $width/2;\n $center_y = $height/2;\n $rh = $rw = 1;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n imagefill($im, 0, 0, imagecolorallocate( $im, $r1, $g1, $b1 ));\n break;\n case 'square':\n case 'rectangle':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = max($width,$height)/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'diamond':\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = min($width,$height);\n break;\n default:\n }\n*/\n\n $r = $g = $b = 255;\n $colors = [];\n $fill = '';\n for ( $i = 0; $i < $line_numbers; $i=$i+$this->step ) {\n // old values :\n $old_r=$r;\n $old_g=$g;\n $old_b=$b;\n // new values :\n $r = ( $r2 - $r1 != 0 ) ? intval( $r1 + ( $r2 - $r1 ) * ( $i / $line_numbers ) ): $r1;\n $g = ( $g2 - $g1 != 0 ) ? intval( $g1 + ( $g2 - $g1 ) * ( $i / $line_numbers ) ): $g1;\n $b = ( $b2 - $b1 != 0 ) ? intval( $b1 + ( $b2 - $b1 ) * ( $i / $line_numbers ) ): $b1;\n\n\n if ( \"$old_r,$old_g,$old_b\" != \"$r,$g,$b\")\n $fill = imagecolorallocate( $im, $r, $g, $b );\n $colors[] = $fill;\n }\n return $colors;\n }", "function stretchDraw($x1, $y1, $x2, $y2, $image)\r\n {\r\n echo \"$this->_canvas.drawImage(\\\"$image\\\", $x1, $y1, $x2-$x1+1, $y2-$y1+1);\\n\";\r\n }", "function noisemaker($im)\n{\n imageSetThickness($im, 2);\n for ($i = 1; $i < 200; $i++) {\n imageSetPixel($im, rand(5, 195), rand(75, 5), imageColorAllocate($im, 8, 24, 89));\n }\n for ($i = 1; $i < 4; $i++) {\n imageline($im, rand(5, 195), rand(60, 20), rand(5, 195), rand(60, 20), imageColorAllocate($im, 240, 240, 240));\n }\n return;\n}", "public function addBorderLine()\r\n {\r\n $this->rowIndex++;\r\n $this->data[$this->rowIndex] = self::HR;\r\n\r\n return $this;\r\n }", "function SetLineStyle($style) {\r\n\t\textract($style);\r\n\t\tif (isset($width)) {\r\n\t\t\t$width_prev = $this->LineWidth;\r\n\t\t\t$this->SetLineWidth($width);\r\n\t\t\t$this->LineWidth = $width_prev;\r\n\t\t}\r\n\t\tif (isset($cap)) {\r\n\t\t\t$ca = array('butt' => 0, 'round'=> 1, 'square' => 2);\r\n\t\t\tif (isset($ca[$cap]))\r\n\t\t\t\t$this->_out($ca[$cap] . ' J');\r\n\t\t}\r\n\t\tif (isset($join)) {\r\n\t\t\t$ja = array('miter' => 0, 'round' => 1, 'bevel' => 2);\r\n\t\t\tif (isset($ja[$join]))\r\n\t\t\t\t$this->_out($ja[$join] . ' j');\r\n\t\t}\r\n\t\tif (isset($dash)) {\r\n\t\t\t$dash_string = '';\r\n\t\t\tif ($dash) {\r\n\t\t\t\t$tab = explode(',', $dash);\r\n\t\t\t\t$dash_string = '';\r\n\t\t\t\tforeach ($tab as $i => $v) {\r\n\t\t\t\t\tif ($i > 0)\r\n\t\t\t\t\t\t$dash_string .= ' ';\r\n\t\t\t\t\t$dash_string .= sprintf('%.2F', $v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!isset($phase) || !$dash)\r\n\t\t\t\t$phase = 0;\r\n\t\t\t$this->_out(sprintf('[%s] %.2F d', $dash_string, $phase));\r\n\t\t}\r\n\t\tif (isset($color)) {\r\n\t\t\tlist($r, $g, $b) = $color;\r\n\t\t\t$this->SetDrawColor($r, $g, $b);\r\n\t\t}\r\n\t}", "public function getLineHeightFactor() {}", "function mond($depth, $split, &$lines, $x1, $y1, $x2, $y2, &$boxes) {\n\n\t// 1 out of $splitty single lines is just a line, not a\n\t// divider between two sub-zones.\n\t// $buffer is the distance from a previously-existing line that\n\t// we'll draw another line.\n\tglobal $splitty, $buffer;\n\n\tif ($depth == 0) {\n\t\tif (!$split)\n\t\t\t$boxes[] = array($x1, $y1, $x2, $y2);\n\t\treturn;\n\t}\n\n\t$line_choice = mt_rand(0,2);\n\n\tif ($line_choice == 0 && abs($x1 - $x2) < 2*$buffer) {\n\t\t// Can't draw a horizontal line, but maybe a vertical?\n\t\tif (abs($y1 - $y2) < 2*$buffer) {\n\t\t\tif (!$split)\n\t\t\t\t$boxes[] = array($x1, $y1, $x2, $y2);\n\t\t\treturn;\n\t\t}\n\t\t$line_choice = 1;\n\t}\n\n\tif ($line_choice == 1 && abs($y1 - $y2) < 2*$buffer) {\n\t\t// Can't draw a vertical line, but maybe a horizontal?\n\t\tif (abs($x1 - $x2) < 2*$buffer) {\n\t\t\tif (!$split)\n\t\t\t\t$boxes[] = array($x1, $y1, $x2, $y2);\n\t\t\treturn;\n\t\t}\n\t\t$line_choice = 0;\n\t}\n\n\tif ($line_choice == 2 && (abs($y1 - $y2) < 2*$buffer\n\t\t|| abs($x1 - $x2) < 2*$buffer)) {\n\t\tif (!$split)\n\t\t\t$boxes[] = array($x1, $y1, $x2, $y2);\n\t\treturn;\n\t}\n\n\tswitch ($line_choice) {\n\tcase 0: // Draw a line horizontally across current zone.\n\t\t$x3 = rand($x1 + $buffer, $x2 - $buffer);\n\t\t$lines[] = array(array($x3,$y1), array($x3,$y2));\n\t\t// Either just draw a line, or split zone into two sub-zones\n\t\tif (mt_rand(0,$splitty) == 0)\n\t\t\tmond($depth, 1, $lines, $x1, $y1, $x2, $y2, $boxes);\n\t\telse {\n\t\t\t// Split current zone into 2 sub-zones.\n\t\t\tmond($depth - 1, 0, $lines, $x1,$y1,$x3,$y2, $boxes);\n\t\t\tmond($depth - 1, 0, $lines, $x3,$y1,$x2,$y2, $boxes);\n\t\t}\n\t\tbreak;\n\tcase 1: // Draw a line vertically across current zone.\n\t\t$y3 = rand($y1 + $buffer, $y2 - $buffer);\n\t\t$lines[] = array(array($x1,$y3), array($x2,$y3));\n\t\t// Either just draw the line, or split zone into two sub-zones\n\t\tif (mt_rand(0,$splitty) == 0)\n\t\t\tmond($depth, 1, $lines, $x1, $y1, $x2, $y2, $boxes);\n\t\telse {\n\t\t\t// Split current zone into 2 sub-zones.\n\t\t\tmond($depth - 1, 0, $lines, $x1,$y1,$x2,$y3, $boxes);\n\t\t\tmond($depth - 1, 0, $lines, $x1,$y3,$x2,$y2, $boxes);\n\t\t}\n\t\tbreak;\n\n\tcase 2: // Draw both horizontal and vertical lines across zone.\n\n\t\t$x3 = mt_rand($x1 + $buffer, $x2 - $buffer);\n\t\t$y3 = mt_rand($y1 + $buffer, $y2 - $buffer);\n\n\t\t$lines[] = array(array($x3,$y1), array($x3,$y2));\n\t\t$lines[] = array(array($x1,$y3), array($x2,$y3));\n\n\t\t// Draw lines in 4 sub-zones.\n\t\tmond($depth - 1, 0, $lines, $x1,$y1,$x3,$y3, $boxes);\n\t\tmond($depth - 1, 0, $lines, $x3,$y1,$x2,$y3, $boxes);\n\t\tmond($depth - 1, 0, $lines, $x1,$y3,$x3,$y2, $boxes);\n\t\tmond($depth - 1, 0, $lines, $x3,$y3,$x2,$y2, $boxes);\n\n\t\tbreak;\n\t}\n}", "function zen_draw_separator($image = 'true', $width = '100%', $height = '1') {\n\n // set default to use from template - zen_image will translate if not found in current template\n if ($image == 'true') {\n $image = DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BLACK_SEPARATOR;\n } else {\n if (!strstr($image, DIR_WS_TEMPLATE_IMAGES)) {\n $image = DIR_WS_TEMPLATE_IMAGES . $image;\n }\n }\n return zen_image($image, '', $width, $height);\n }", "public function setLineHeightFactor($lineHeightFactor) {}", "function DoPattern($aImg) {\n\t$x0 = $this->rect->x + $this->rect->w/2;\n\t$y0 = $this->rect->y;\n\t$x1 = $x0;\n\t$y1 = $this->rect->ye;\n\t$x0_right = $x0;\n\t$x1_right = $x1;\n\n\t// BTW \"apa\" means monkey in Swedish but is really a shortform for\n\t// \"alpha+a\" which was the labels I used on paper when I derived the\n\t// geometric to get the 3D perspective right. \n\t// $apa is the height of the bounding rectangle plus the distance to the\n\t// artifical horizon (alpha)\n\t$apa = $this->rect->h + $this->alpha;\n\n\t// Three cases and three loops\n\t// 1) The endpoint of the line ends on the bottom line\n\t// 2) The endpoint ends on the side\n\t// 3) Horizontal lines\n\n\t// Endpoint falls on bottom line\n\t$middle=$this->rect->x + $this->rect->w/2;\n\t$dist=$this->linespacing;\n\t$factor=$this->alpha /($apa);\n\twhile($x1>$this->rect->x) {\n\t $aImg->Line($x0,$y0,$x1,$y1);\n\t $aImg->Line($x0_right,$y0,$x1_right,$y1);\n\t $x1 = $middle - $dist;\n\t $x0 = $middle - $dist * $factor;\n\t $x1_right = $middle + $dist;\n\t $x0_right = $middle + $dist * $factor;\n\t $dist += $this->linespacing;\n\t}\n\n\t// Endpoint falls on sides\n\t$dist -= $this->linespacing;\n\t$d=$this->rect->w/2;\n\t$c = $apa - $d*$apa/$dist;\n\twhile( $x0>$this->rect->x ) {\n\t $aImg->Line($x0,$y0,$this->rect->x,$this->rect->ye-$c);\n\t $aImg->Line($x0_right,$y0,$this->rect->xe,$this->rect->ye-$c);\n\t $dist += $this->linespacing;\t\t\t\n\t $x0 = $middle - $dist * $factor;\n\t $x1 = $middle - $dist;\n\t $x0_right = $middle + $dist * $factor;\t\t\t\n\t $c = $apa - $d*$apa/$dist;\n\t}\t\t\n\t\t\n\t// Horizontal lines\n\t// They need some serious consideration since they are a function\n\t// of perspective depth (alpha) and density (linespacing)\n\t$x0=$this->rect->x;\n\t$x1=$this->rect->xe;\n\t$y=$this->rect->ye;\n\t\t\n\t// The first line is drawn directly. Makes the loop below slightly\n\t// more readable.\n\t$aImg->Line($x0,$y,$x1,$y);\n\t$hls = $this->linespacing;\n\t\t\n\t// A correction factor for vertical \"brick\" line spacing to account for\n\t// a) the difference in number of pixels hor vs vert\n\t// b) visual apperance to make the first layer of \"bricks\" look more\n\t// square.\n\t$vls = $this->linespacing*0.6;\n\t\t\n\t$ds = $hls*($apa-$vls)/$apa;\n\t// Get the slope for the \"perspective line\" going from bottom right\n\t// corner to top left corner of the \"first\" brick.\n\t\t\n\t// Uncomment the following lines if you want to get a visual understanding\n\t// of what this helpline does. BTW this mimics the way you would get the\n\t// perspective right when drawing on paper.\n\t/*\n\t $x0 = $middle;\n\t $y0 = $this->rect->ye;\n\t $len=floor(($this->rect->ye-$this->rect->y)/$vls);\n\t $x1 = $middle+round($len*$ds);\n\t $y1 = $this->rect->ye-$len*$vls;\n\t $aImg->PushColor(\"red\");\n\t $aImg->Line($x0,$y0,$x1,$y1);\n\t $aImg->PopColor();\n\t*/\n\t\t\n\t$y -= $vls;\t\t\n\t$k=($this->rect->ye-($this->rect->ye-$vls))/($middle-($middle-$ds));\n\t$dist = $hls;\n\twhile( $y>$this->rect->y ) {\n\t $aImg->Line($this->rect->x,$y,$this->rect->xe,$y);\n\t $adj = $k*$dist/(1+$dist*$k/$apa);\n\t if( $adj < 2 ) $adj=1;\n\t $y = $this->rect->ye - round($adj);\n\t $dist += $hls;\n\t}\n }", "public function addLine($startPoint = ADD_LINE_POINT_DEFAULT, $endPoint = ADD_LINE_POINT_DEFAULT)\n {\n $this->pdf->setlinewidth(1);\n $this->pdf->setcolor(\"stroke\", \"rgb\", 0, 0, 0, 0);\n\n if ($startPoint && $endPoint) {\n $this->pdf->moveto($startPoint[\"x\"], $startPoint[\"y\"]);\n $this->pdf->lineto($endPoint[\"x\"], $endPoint[\"y\"]);\n } else {\n $this->cursorX = $this->minX;\n $this->cursorY -= $this->margin['top'];\n $this->pdf->moveto($this->cursorX, $this->cursorY);\n $this->cursorX = $this->maxX;\n $this->pdf->lineto($this->cursorX, $this->cursorY);\n }\n $this->pdf->stroke();\n $this->pdf->fit_textline(\"\", 0, 0, \"fillcolor={black}\");\n }", "public function getUnderlineThickness();", "public function getUnderlineThickness() {}", "public function lineTo($x, $y) {}", "function ncurses_mvvline($y, $x, $attrchar, $n)\n{\n}", "function lineInterceptWithSet($line, $set) {\n $line1XStart = $line[0][0];\n $line1XEnd = $line[1][0];\n $line1YStart = $line[0][1];\n $line1YEnd = $line[1][1];\n\n\n foreach($set AS $item) {\n $line2XStart = $item[0][0];\n $line2XEnd = $item[1][0];\n $line2YStart = $item[0][1];\n $line2YEnd = $item[1][1];\n\n\n }\n return true;\n}", "protected function draw_border(&$im) {\n imagerectangle($im, 0, 0, $this->width - 1, $this->height - 1, imagecolorallocate($im, 0, 0, 0));\n }", "public function getLineGap() {}", "public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)\n {\n ($line_width !== null) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;\n ($compound_type !== null) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null;\n ($dash_type !== null) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null;\n ($cap_type !== null) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null;\n ($join_type !== null) ? $this->lineStyleProperties['join'] = (string) $join_type : null;\n ($head_arrow_type !== null) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null;\n ($head_arrow_size !== null) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null;\n ($end_arrow_type !== null) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null;\n ($end_arrow_size !== null) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null;\n }", "public function drawLine($xFrom, $xTo, $yFrom, $yTo, $lineWidth = 0.3, $unit = null);", "function generate_line_diagramm($filename,$text,$data) {\n\n\t$y_max = 70 + sizeof($data) * 40;\n\n\t$image = imagecreatetruecolor(600,$y_max);\n\timagecolorallocate ($image, 255, 255, 255);\n\n\t// Colours\n\t$colours[\"black\"] = imagecolorallocate ($image, 0, 0, 0);\n\t$colours[\"grey\"] = imagecolorallocate($image,193,193,193);\n\t$colours[\"red\"] = imagecolorallocate($image,255,0,0);\n\t$colours[\"blue\"] = imagecolorallocate($image,202,218,249); \n\t$colours[\"white\"] = imagecolorallocate($image,255,255,255); \n\t\n\n\t// Texts\n\timagettftext($image, \"10\",\"0\",\"150\",\"10\",\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"top\"]);\n\timagettftext($image, \"10\",\"90\",\"10\",$y_max/2,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"left\"]);\n\timagettftext($image, \"10\",\"270\",\"590\",$y_max/2,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"right\"]);\n\timagettftext($image, \"10\",\"0\",\"300\",$y_max - 10,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$text[\"buttom\"]);\n\n\n\t// Background for middle\n\t$date = date(\"Y-m-d H:i\");\n\t\n\timagefilledrectangle($image, 22,22,580,$y_max-30, $colours[\"grey\"]); \n\timagerectangle($image,22,22,580,$y_max-30,$colours[\"black\"]);\n\timagettftext($image, \"8\",\"0\",\"400\",$y_max - 35,\"255\",\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",\"$date | lansuite 2.0 Chart\");\n\n\n\t\n\tforeach($data AS $these_data) {\n\t\n\t$overall_count = $overall_count + $these_data[\"count\"];\n\t\n\t}\n\t\n\tforeach($data AS $draw_this_line) {\n\t\n\t$x1 = 30;\n\t$y1 = $y1+40;\n\t$x2 = $x1 + (540*($draw_this_line[\"count\"]/$overall_count));\n\t$y2 = $y1 + 20;\n\t\n\t$red_value = 255 * round(($draw_this_line[\"count\"])/$overall_count,1);\n\t\n\t\n\t\n\t$myred = imagecolorallocate($image,255,$red_value,$red_value);\n\t\n\timagefilledrectangle($image,$x1 ,$y1,$x2,$y2, $myred); \n\timagerectangle($image,$x1,$y1,$x2,$y2,$colours[\"black\"]);\n\t\n\t$line_text = $draw_this_line[\"name\"] . \" (\" . round(100*(($draw_this_line[\"count\"]/$overall_count)),2) . \" %)\";\n\t\n\t\n\t\n\timagettftext($image, \"10\",\"0\",$x1 + 3 ,$y1 + 14,250,\"{$GLOBALS[\"config\"][\"environment\"][\"dir\"]}/ext_inc/fonts/arial.ttf\",$line_text);\n\t\t\t\t\t\t\n\t\n\t}\n\n\timagepng($image,$filename,\"100\");\n\n}", "function error($message) {\n // Determine text sizes\n $lines = explode(\"\\n\",str_replace(\"\\t\",' ',$message));\n $maxline = 0;\n $lineCount = 0;\n foreach($lines as $line) {\n $lineCount++;\n $maxline = max($maxline,strlen($line));\n }\n\n // calculate image box\n $h = (imagefontheight(2)+1) * $lineCount;\n $w = imagefontwidth(2) * $maxline;\n\n // create image and prep border\n $im = imagecreatetruecolor($w + 6, $h + 4);\n $red = imagecolorallocate($im,255,0,0);\n $white = imagecolorallocate($im,255,255,255);\n $black = imagecolorallocate($im,0,0,0);\n\n // draw border and text\n imagefilledrectangle($im,0,0,$w+6,$h+4,$red);\n imagefilledrectangle($im,2,2,$w+3,$h+1,$white);\n $curline = 2;\n foreach($lines as $line) {\n imagestring($im, 2, 4, $curline, $line,$black);\n $curline += imagefontheight(2)+1;\n }\n\n // output image\n header('content-type: image/png');\n imagepng($im);\n imagedestroy($im);\n die();\n}", "function imagettfstroketext(&$image, $size, $angle, $x, $y, &$textcolor, &$strokecolor, $fontfile, $text, $px)\n{\n for($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++)\n for($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++)\n $bg = imagettftext($image, $size, $angle, $c1, $c2, $strokecolor, $fontfile, $text);\n\n return imagettftext($image, $size, $angle, $x, $y, $textcolor, $fontfile, $text);\n}", "protected function _ensureUnderlineThickness() {}", "public function dashedLine($x1, $y1, $x2, $y2, $color = 'black', $width = 1, $dash_length = 2, $dash_space = 2)\n {\n $style = 'stroke:' . $this->getHexColor($color) . '; stroke-width:' . (int)$width . '; stroke-dasharray:' . $dash_length . ',' . $dash_space . ';';\n $this->_svg->addChild(new XML_SVG_Line(array('x1' => $x1,\n 'y1' => $y1,\n 'x2' => $x2,\n 'y2' => $y2,\n 'style' => $style)));\n }", "function bevelLine($color, $x1, $y1, $x2, $y2)\r\n {\r\n $this->forcePen();\r\n echo \"$this->_canvas.setColor(\\\"\" . $color . \"\\\");\\n\";\r\n echo \"$this->_canvas.drawLine($x1, $y1, $x2, $y2);\\n\";\r\n }", "public function lineStyle()\n {\n return isset($this->data->graphicElement->pen[\"lineStyle\"]) ? (string) $this->data->graphicElement->pen[\"lineStyle\"] : \"Solid\";\n }", "public function drawLine($X1, $Y1, $X2, $Y2, array $Format = [])\n {\n $R = isset($Format[\"R\"]) ? $Format[\"R\"] : 0;\n $G = isset($Format[\"G\"]) ? $Format[\"G\"] : 0;\n $B = isset($Format[\"B\"]) ? $Format[\"B\"] : 0;\n $Alpha = isset($Format[\"Alpha\"]) ? $Format[\"Alpha\"] : 100;\n $Ticks = isset($Format[\"Ticks\"]) ? $Format[\"Ticks\"] : null;\n $Cpt = isset($Format[\"Cpt\"]) ? $Format[\"Cpt\"] : 1;\n $Mode = isset($Format[\"Mode\"]) ? $Format[\"Mode\"] : 1;\n $Weight = isset($Format[\"Weight\"]) ? $Format[\"Weight\"] : null;\n $Threshold = isset($Format[\"Threshold\"]) ? $Format[\"Threshold\"] : null;\n\n if ($this->Antialias == false && $Ticks == null) {\n if ($this->Shadow && $this->ShadowX != 0 && $this->ShadowY != 0) {\n $ShadowColor = $this->allocateColor(\n $this->Picture,\n $this->ShadowR,\n $this->ShadowG,\n $this->ShadowB,\n $this->Shadowa\n );\n imageline(\n $this->Picture,\n intval($X1 + $this->ShadowX),\n intval($Y1 + $this->ShadowY),\n intval($X2 + $this->ShadowX),\n intval($Y2 + $this->ShadowY),\n $ShadowColor\n );\n }\n\n $Color = $this->allocateColor($this->Picture, $R, $G, $B, $Alpha);\n imageline($this->Picture, (int) $X1, (int) $Y1, (int) $X2, (int) $Y2, $Color);\n return 0;\n }\n\n $Distance = sqrt(($X2 - $X1) * ($X2 - $X1) + ($Y2 - $Y1) * ($Y2 - $Y1));\n if ($Distance == 0) {\n return -1;\n }\n\n /* Derivative algorithm for overweighted lines, re-route to polygons primitives */\n if ($Weight != null) {\n $Angle = $this->getAngle($X1, $Y1, $X2, $Y2);\n $PolySettings = [\"R\" => $R, \"G\" => $G, \"B\" => $B, \"Alpha\" => $Alpha, \"BorderAlpha\" => $Alpha];\n\n if ($Ticks == null) {\n $Points = [];\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $X1;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Y1;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $X1;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Y1;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $X2;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Y2;\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $X2;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Y2;\n\n $this->drawPolygon($Points, $PolySettings);\n } else {\n for ($i = 0; $i <= $Distance; $i = $i + $Ticks * 2) {\n $Xa = (($X2 - $X1) / $Distance) * $i + $X1;\n $Ya = (($Y2 - $Y1) / $Distance) * $i + $Y1;\n $Xb = (($X2 - $X1) / $Distance) * ($i + $Ticks) + $X1;\n $Yb = (($Y2 - $Y1) / $Distance) * ($i + $Ticks) + $Y1;\n\n $Points = [];\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $Xa;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Ya;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $Xa;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Ya;\n $Points[] = cos(deg2rad($Angle + 90)) * $Weight + $Xb;\n $Points[] = sin(deg2rad($Angle + 90)) * $Weight + $Yb;\n $Points[] = cos(deg2rad($Angle - 90)) * $Weight + $Xb;\n $Points[] = sin(deg2rad($Angle - 90)) * $Weight + $Yb;\n\n $this->drawPolygon($Points, $PolySettings);\n }\n }\n\n return 1;\n }\n\n $XStep = ($X2 - $X1) / $Distance;\n $YStep = ($Y2 - $Y1) / $Distance;\n\n for ($i = 0; $i <= $Distance; $i++) {\n $X = $i * $XStep + $X1;\n $Y = $i * $YStep + $Y1;\n\n $Color = [\"R\" => $R, \"G\" => $G, \"B\" => $B, \"Alpha\" => $Alpha];\n\n if ($Threshold != null) {\n foreach ($Threshold as $Key => $Parameters) {\n if ($Y <= $Parameters[\"MinX\"] && $Y >= $Parameters[\"MaxX\"]) {\n if (isset($Parameters[\"R\"])) {\n $RT = $Parameters[\"R\"];\n } else {\n $RT = 0;\n }\n if (isset($Parameters[\"G\"])) {\n $GT = $Parameters[\"G\"];\n } else {\n $GT = 0;\n }\n if (isset($Parameters[\"B\"])) {\n $BT = $Parameters[\"B\"];\n } else {\n $BT = 0;\n }\n if (isset($Parameters[\"Alpha\"])) {\n $AlphaT = $Parameters[\"Alpha\"];\n } else {\n $AlphaT = 0;\n }\n $Color = [\"R\" => $RT, \"G\" => $GT, \"B\" => $BT, \"Alpha\" => $AlphaT];\n }\n }\n }\n\n if ($Ticks != null) {\n if ($Cpt % $Ticks == 0) {\n $Cpt = 0;\n if ($Mode == 1) {\n $Mode = 0;\n } else {\n $Mode = 1;\n }\n }\n\n if ($Mode == 1) {\n $this->drawAntialiasPixel($X, $Y, $Color);\n }\n $Cpt++;\n } else {\n $this->drawAntialiasPixel($X, $Y, $Color);\n }\n }\n\n return [$Cpt, $Mode];\n }", "function setLineBetweenColumns() {\t \r\n\t \t$this->lineBetweenColumns = true;\t\r\n\t}", "public function drawLine($start = null, $finish = null, $height = 3) {\n $this->_writeLine('<hr />', '#FFFFFF', $height);\n return $this;\n }", "public function drawLine($start = null, $finish = null, $height = 3) {\n $x1 = $this->getDriver()->GetX();\n $y1 = $this->getDriver()->GetY();\n ;\n $y2 = $y1;\n if ($start !== null) {\n $y1+= $start;\n }\n if ($finish !== null) {\n $x2 = $finish;\n } else {\n $x2 = $this->getDriver()->w - $this->getDriver()->lMargin - $this->getDriver()->rMargin;\n }\n $this->getDriver()->Line($x1, $y1, $x2, $y2);\n //$this->getDriver()->Ln($height);\n return $this;\n }", "public function getLineHeight() {}", "private function drawAxis() : void\n\t{\n\t\timageline($this->im, 0 , $this->shiftY , $this->sizeX , $this->shiftY, $this->colorAxisX);\n\t\timageline($this->im, $this->shiftX , 0 , $this->shiftX, $this->sizeY , $this->colorAxisX);\n\t}", "public function draw(Image $image) {\n parent::draw($image);\n\n $bulletDimension = new Dimension(3, 3);\n\n $image->fillEllipse($this->beginPoint, $bulletDimension, $this->color);\n $image->fillEllipse($this->endPoint, $bulletDimension, $this->color);\n }", "function imagettfstroketext(&$image, $size, $angle, $x, $y, &$textcolor, &$strokecolor, $fontfile, $text, $px) {\n \n for($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++)\n for($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++)\n $bg = imagettftext($image, $size, $angle, $c1, $c2, $strokecolor, $fontfile, $text);\n \n return imagettftext($image, $size, $angle, $x, $y, $textcolor, $fontfile, $text);\n }", "function BorderlessRow($data)\n\t{\n\t $nb=0;\n\t for($i=0;$i<count($data);$i++)\n\t $nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));\n\t $h=5*$nb;\n\t //Issue a page break first if needed\n\t $this->CheckPageBreak($h);\n\t //Draw the cells of the row\n\t for($i=0;$i<count($data);$i++)\n\t {\n\t $w=$this->widths[$i];\n\t $a=isset($this->aligns[$i]) ? $this->aligns[$i] : 'L';\n\t //Save the current position\n\t $x=$this->GetX();\n\t $y=$this->GetY();\n\t //Draw the border\n\t //$this->Rect($x,$y,$w,$h);\n\t //Print the text\n\t $this->MultiCell($w,5,\"$data[$i]\",0,$a);\n\t //Put the position to the right of the cell\n\t $this->SetXY($x+$w,$y);\n\t }\n\t //Go to the next line\n\t $this->Ln($h);\n\t}", "public function _lines($lines, $prefix=' ', $color='white')\n\t{\n\t}", "function bevelLine($color, $x1, $y1, $x2, $y2)\r\n {\r\n $resp = $this->forcePen();\r\n $resp .= $this->_getJavascriptVar() . \".strokeStyle = \\\"\" . $color . \"\\\";\\n\";\r\n $resp .= $this->drawLine(array($x1, $y1), array($x2, $y2));\r\n\r\n return $resp;\r\n }", "function addBorder($picture) {\n\n $width = strlen($picture[0]) + 2; \n $count = count($picture);\n\n for($i = 0; $i < $count; $i++) {\n $picture[$i] = '*' . $picture[$i] . '*';\n }\n\n array_unshift($picture, str_repeat('*', $width));\n $picture[] = str_repeat('*', $width);\n \n return $picture;\n}", "public function fillAndStrokeEvenOdd() {}", "public function setLine($var)\n {\n GPBUtil::checkInt32($var);\n $this->line = $var;\n\n return $this;\n }", "function displayLine($a_dbc, $a_lineCount)\n\t{\n\t\tif($this->lineID)\n\t\t\techo \"<textarea>{$this->text}</textarea>\\n\";\n\t\telse\n\t\t \techo \"<textarea class='newLine'>{$this->text}</textarea>\\n\";\n\n\t\treturn null;\n\t}", "public function setMaxLineWidth(int $value) {\n $this->_maxLineWidth = $value;\n return $this;\n }", "public function setMaxLineWidth(int $value) {\n $this->_maxLineWidth = $value;\n return $this;\n }", "function getLineHeight() { return $this->_lineheight; }", "private static function imageTtfStrokeText(\n $image,\n $text,\n $size = 25,\n $strokeSize = 2,\n $xPosition = 20,\n $yPosition = 50,\n $textColor = null,\n $strokeColor = null,\n $fontFile = null,\n $angle = 0\n ) {\n for ($c1 = ($xPosition - abs($strokeSize)); $c1 <= ($xPosition + abs($strokeSize)); $c1++) {\n for ($c2 = ($yPosition - abs($strokeSize)); $c2 <= ($yPosition + abs($strokeSize)); $c2++) {\n imagettftext($image, $size, $angle, $c1, $c2, $strokeColor, $fontFile, $text);\n }\n }\n return imagettftext($image, $size, $angle, $xPosition, $yPosition, $textColor, $fontFile, $text);\n }", "public function setLineHeight($lineHeight) {}", "public function setLineWidth($series, $width) {\n\t\t$this->Data[$series]['lines']['lineWidth'] = $width;\n\t}", "function _getLines(&$text_lines, &$line_no, $end = \\false)\n {\n }", "private function makeTickMarks() : void \n\t{\n\t\t$tickX = 0;\n\n\t\t$tickY = 0;\n\n\t\tif($this->ticks) {\n\n\t\t\t$tickSizeX = $this->scaleY/6;\n\t\t\t$tickSizeY = $this->scaleX/6;\n\n\t\t\twhile($tickX <= $this->sizeX) {\n\t\t\t\timageline($this->im, $tickX, 0-$tickSizeX+$this->shiftY, $tickX, 0+$tickSizeX+$this->shiftY, $this->colorTickX);\n\t\t\t\t$tickX += $this->scaleX;\n\t\t\t}\n\n\t\t\twhile($tickY <= $this->sizeY) {\n\t\t\t\timageline($this->im, 0-$tickSizeY+$this->shiftX, $tickY, 0+$tickSizeY+$this->shiftX, $tickY, $this->colorTickY);\n\t\t\t\t$tickY += $this->scaleY;\n\t\t\t}\n\t\t}\n\t}", "public function getLine($lineNumber);", "function drawImage($imgHeight, $imgWidth)\n{\n\t# create blank img\n\t$image = imagecreatetruecolor($imgWidth, $imgHeight);\n\n\t# rainbow color scheme\n\t$rGray = imagecolorallocate($image, 119, 119, 119);\n\t$rPink = imagecolorallocate($image, 255, 17, 153);\n\t$rRed = imagecolorallocate($image, 255, 0, 0);\n\t$rOrange = imagecolorallocate($image, 255, 119, 0);\n\t$rYellow = imagecolorallocate($image, 255, 255, 0);\n\t$rGreen = imagecolorallocate($image, 0, 136, 0);\n\t$rBlue = imagecolorallocate($image, 0, 0, 255);\n\t$rIndigo = imagecolorallocate($image, 136, 0, 255);\n\t$rViolet = imagecolorallocate($image, 221, 0, 238);\n\t\n\t# jewel color scheme\n\t$jBrown = imagecolorallocate($image, 136, 68, 17);\n\t$jPink = imagecolorallocate($image, 221, 17, 68);\n\t$jRed = imagecolorallocate($image, 119, 0, 0);\n\t$jOrange = imagecolorallocate($image, 255, 68, 0);\n\t$jYellow = imagecolorallocate($image, 255, 187, 0);\n\t$jGreen = imagecolorallocate($image, 0, 153, 0);\n\t$jBlue = imagecolorallocate($image, 0, 0, 136);\n\t$jIndigo = imagecolorallocate($image, 68, 0, 136);\n\t$jViolet = imagecolorallocate($image, 153, 0, 153);\n\t\n\t# neon color scheme\n\t$nBlack = imagecolorallocate($image, 0, 0, 0);\n\t$nPink = imagecolorallocate($image, 255, 0, 204);\n\t$nRed = imagecolorallocate($image, 255, 0, 51);\n\t$nOrange = imagecolorallocate($image, 255, 51, 0);\n\t$nYellow = imagecolorallocate($image, 204, 255, 51);\n\t$nGreen = imagecolorallocate($image, 0, 255, 0);\n\t$nBlue = imagecolorallocate($image, 0, 85, 255);\n\t$nIndigo = imagecolorallocate($image, 129, 0, 255);\n\t$nViolet = imagecolorallocate($image, 204, 0, 255);\n\n\t# construct array of rainbow colors\n\t$rainbowColorsArray = array(\n\t\t$rGray, $rPink, $rRed, $rOrange, $rYellow, $rGreen, $rBlue, $rIndigo, $rViolet);\n\n\t# construct array of jewel colors\n\t$jewelColorsArray = array(\n\t\t$jBrown, $jPink, $jRed, $jOrange, $jYellow, $jGreen, $jBlue, $jIndigo, $jViolet);\n\n\t# construct array of neon colors\n\t$neonColorsArray = array(\n\t\t$nBlack, $nPink, $nRed, $nOrange, $nYellow, $nGreen, $nBlue, $nIndigo, $nViolet);\n\n\t# figure out which color scheme to use according to user input\n\t$imgColorChoice = $_POST['imgColorChoice'];\n\t\n\tif($imgColorChoice == 1)\n\t{\n\t\t$colorSchemeArray = $rainbowColorsArray;\n\t}\t\t\t\n\telse if($imgColorChoice == 2)\n\t{\n\t\t$colorSchemeArray = $jewelColorsArray;\n\t}\n\telse if($imgColorChoice == 3)\n\t{\n\t\t$colorSchemeArray = $neonColorsArray;\n\t}\n\t\n\t# fill in with background color\n\timagefill($image, 0, 0, $colorSchemeArray[0]);\n\n\t# DRAW GRAPHICS...\n\t# polygons(x2) in center of image\n\t# imagepolygon($image, array(coords of vertices in form x1,y1, x2,y2, etc.),\n\t# \tnumber of vertices, $color)\n\timagepolygon($image, array(\n\t\t100, 400, 600, 100, 700, 300, 150, 600, 100, 400), 4, $colorSchemeArray[1]);\n\timagepolygon($image, array(\n\t\t200, 300, 250, 450, 600, 500, 350, 300, 200, 250), 4, $colorSchemeArray[5]);\n\n\t# blue \"funnel\"\n\t# imageellipse($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, $color)\n\tfor($i = 0; $i < 100; $i++)\n\t{\n\t\timageellipse($image, ($i*5)+500, $i*10, $i, $i*5, $colorSchemeArray[6]);\n\t}\n\n\t# \"whirlwind\" at bottom\n\t# imagefilledellipse($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, $color, fill mode)\n\timagefilledellipse($image, 300, 730, 300, 100, $colorSchemeArray[8]);\n\t\n\t# imagefilledarc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color, fill mode)\n\timagefilledarc($image, 300, 705, 250, 75, 90, 360, $colorSchemeArray[4], IMG_ARC_NOFILL);\n\timagefilledarc($image, 325, 705, 250, 75, 300, 45, $colorSchemeArray[2], IMG_ARC_NOFILL);\n\timagefilledarc($image, 330, 725, 225, 60, 0, 330, $colorSchemeArray[6], IMG_ARC_NOFILL);\n\timagefilledarc($image, 325, 680, 225, 55, 0, 300, $colorSchemeArray[1], IMG_ARC_NOFILL);\n\timagefilledarc($image, 320, 700, 225, 55, 50, 180, $colorSchemeArray[7], IMG_ARC_NOFILL);\n\timagefilledarc($image, 275, 730, 200, 70, 270, 180, $colorSchemeArray[5], IMG_ARC_NOFILL);\n\timagefilledarc($image, 335, 650, 175, 50, 0, 300, $colorSchemeArray[3], IMG_ARC_NOFILL);\n\timagefilledarc($image, 340, 670, 175, 55, 250, 60, $colorSchemeArray[4], IMG_ARC_NOFILL);\n\n\t# star polygon\n\t# imagepolygon($image, array(coords of vertices in form x1,y1, x2,y2, etc.),\n\t# \tnumber of vertices, $color)\n\tfor($i = 0; $i < 10; $i++)\n\t{\n\t\timagepolygon($image, array(\n\t\t\t0, 20, \n\t\t\t733-($i*3), ($i*3)+33, \n\t\t\t750-($i*3), ($i*3)+$i, \n\t\t\t766-($i*3), ($i*3)+33, \n\t\t\t800-($i*3), ($i*3)+33, \n\t\t\t775-($i*3), ($i*3)+66, \n\t\t\t800-($i*3), ($i*3)+100, \n\t\t\t755-($i*3), ($i*3)+85, \n\t\t\t780, 800, \n\t\t\t725, ($i*3)+66, \n\t\t\t0, 20), \n\t\t\t10, $colorSchemeArray[5]);\n\t}\n\n\t# interconnected loops\n\t# imagearc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color)\n\tfor($i = 0; $i < 50; $i++)\n\t{\n\t\timagearc($image, 600, 700, ($i+100), ($i+100), 0, 360, $colorSchemeArray[1]);\n\t\timagearc($image, 600, 500, ($i+100), ($i+100), 0, 360, $colorSchemeArray[4]);\n\t\timagearc($image, 600, 600, ($i+100), ($i+100), 0, 360, $colorSchemeArray[5]);\n\t\timagearc($image, 700, 600, ($i+100), ($i+100), 0, 360, $colorSchemeArray[1]);\n\t\timagearc($image, 500, 600, ($i+100), ($i+100), 0, 360, $colorSchemeArray[4]);\t\n\t}\n\n\t# \"beach ball\"\t \n\t# imagefilledarc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color, fill mode)\n\timagefilledarc($image, 110, 110, 200, 200, 0, 50, $colorSchemeArray[2], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 60, 110, $colorSchemeArray[6], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 120, 170, $colorSchemeArray[1], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 180, 230, $colorSchemeArray[5], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 240, 290, $colorSchemeArray[3], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 200, 200, 300, 350, $colorSchemeArray[4], IMG_ARC_CHORD);\n\t\n\t# give each segment of \"beach ball\" a \"cutout\"\n\t# imagefilledarc($image, x-coord of ellipse center, y-coord of ellipse center,\n\t# \tellipse width, ellipse height, start angle, end angle, $color, fill mode)\n\timagefilledarc($image, 110, 110, 150, 150, 2, 48, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 62, 108, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 122, 168, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 182, 228, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 242, 288, $colorSchemeArray[0], IMG_ARC_CHORD);\n\timagefilledarc($image, 110, 110, 150, 150, 302, 348, $colorSchemeArray[0], IMG_ARC_CHORD);\n\n\t# lines fanning out\n\t# imageline($image, x1, y1, x2, y2, $color). \n\t# draws line from coords (x1,y1) to (x2,y2).\n\tfor($i = 0; $i < 70; $i++)\n\t{\n\t\timageline($image, 0, 800, $i*5, $i+500, $colorSchemeArray[7]);\n\t\timageline($image, 300, 500, $i*5, $i+500, $colorSchemeArray[3]);\n\t}\n\n\t# thick crossing lines\n\timagesetthickness($image, 25);\n\n\t# imageline($image, x1, y1, x2, y2, $color). \n\t# draws line from coords (x1,y1) to (x2,y2).\n\timageline($image, 350, 0, 0, 450, $colorSchemeArray[8]);\n\timageline($image, 360, 0, 0, 460, $colorSchemeArray[5]);\n\timageline($image, 380, 0, 0, 480, $colorSchemeArray[2]);\n\n\timageline($image, 0, 400, 450, 0, $colorSchemeArray[1]);\n\timageline($image, 0, 410, 460, 0, $colorSchemeArray[4]);\n\timageline($image, 0, 430, 480, 0, $colorSchemeArray[7]);\n\n\t# save img out to temp directory\n\timagepng($image, \"../temp/tempPNG.png\");\n\n\t# output img according to user-supplied dimensions\n\techo \"\t<img src='../temp/tempPNG.png' alt='artistic expression image' \".\n\t\"height='$imgHeight' width='$imgWidth' />\\n\";\n\n\t# clear buffer of image\n\timagedestroy($image);\n}", "public function createImage2(){\n $this->createCircle(100, 100, 50, 50, 0, 360);\n $this->createCircle(400, 100, 50, 50, 0, 360);\n $this->createCircle(110, 200, 50, 50, 0, 360);\n $this->createCircle(250, 300, 50, 50, 0, 360);\n $this->createCircle(390, 200, 50, 50, 0, 360);\n $this->createLine(125, 100, 375, 100);\n $this->createLine(100, 125, 100, 175);\n $this->createLine(400, 125, 400, 175);\n $this->createLine(125, 220, 225, 300);\n $this->createLine(275, 300, 375, 220);\n $this->generateImage();\n }", "private function createOrd()\n {\n $point1 = new Point(\n $this->style->canvas->left,\n $this->style->canvas->top - $this->style->axes->ord->marginY\n );\n\n $point2 = new Point(\n $point1->x,\n $this->style->canvas->top + $this->style->canvas->height\n );\n\n return $this->getLine(\n $point1,\n $point2,\n $this->style->axes->ord->color,\n $this->style->axes->ord->thickness\n );\n }", "function linify($string, $fitwidth, $font, $size){\n\t\t$words = explode(' ', $string);\n\t\t$lines = array($words[0]);\n\t\t$currentLine = 0; \n\t for($i = 1; $i < count($words); $i++) { \n\t\t\t// see if next word fits\n\t $lineSize = imagettfbbox($size, 0, $font, $lines[$currentLine] . ' ' . $words[$i]);\n\t\t\t$linewidth = $lineSize[2] - $lineSize[0];\n\t if($linewidth < $fitwidth) { \n\t $lines[$currentLine] .= ' ' . $words[$i]; \n\t }else { \n\t $currentLine += 1;\n\t $lines[$currentLine] = $words[$i]; \n\t } \n\t }\n\t\treturn $lines;\n\t}", "public function setLine($value)\n {\n return $this->set(self::_LINE, $value);\n }", "function imagettfstroketext(&$image, $size, $angle, $x, $y, &$textcolor, &$strokecolor, $fontfile, $text, $px) {\n\t\tfor($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++)\n\t\t\tfor($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++)\n\t\t\t\t$bg = imagettftext($image, $size, $angle, $c1, $c2, $strokecolor, $fontfile, $text);\n\t\treturn imagettftext($image, $size, $angle, $x, $y, $textcolor, $fontfile, $text);\n\t}", "function imagettfstroketext($image, $size, $angle, $x, $y, $textcolor, $strokecolor, $fontfile, $text, $px) {\n\t\tfor ($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++)\n\t\t\tfor ($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++)\n\t\t\t\t$bg = imagettftext($image, $size, $angle, $c1, $c2, $strokecolor, $fontfile, $text);\n\t\treturn imagettftext($image, $size, $angle, $x, $y, $textcolor, $fontfile, $text);\n\t}", "public function withLineItem($thing)\n {\n $mode = is_array($thing) ? 'multi' : 'single';\n\n if ($mode === 'single') {\n $this->_model['lines'][] = (array)$thing;\n $this->_line_number++;\n }\n\n\n if ($mode === 'multi') {\n foreach($thing as $lineItem) {\n $this->_model['lines'][] = (array)$lineItem;\n $this->_line_number++;\n }\n }\n\n return $this;\n }", "private function drawHorizontalLine(Canvas $canvas, Shape $line)\n {\n // Get line coordinates.\n $coordinates = $line->getCoordinates();\n // Get canvas grid.\n $grid = $canvas->getGrid();\n // Get the line distance between the coordinates.\n $line_distance = $line->getLineDistance();\n\n for ($col = 0; $col < $line_distance; $col++)\n {\n $grid[$coordinates['y1']][$coordinates['x1'] + $col] = 'x';\n }\n\n // Write data to the canvas grid.\n $canvas->setGrid($grid);\n }", "public function interlace()\n\t{\n\t\t$this->checkImage();\n\t\t$imageX = $this->optimalWidth;\n\t\t$imageY = $this->optimalHeight;\n\n\t\t$black = imagecolorallocate($this->imageResized, 0, 0, 0);\n\t\tfor ($y = 1; $y < $imageY; $y += 2) {\n\t\t\timageline($this->imageResized, 0, $y, $imageX, $y, $black);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function makeImage()\n {\n $x_width = 200;\n $y_width = 125;\n\n $this->image = imagecreatetruecolor(200, 125);\n\n $this->white = imagecolorallocate($this->image, 255, 255, 255);\n $this->black = imagecolorallocate($this->image, 0, 0, 0);\n $this->red = imagecolorallocate($this->image, 255, 0, 0);\n $this->green = imagecolorallocate($this->image, 0, 255, 0);\n $this->grey = imagecolorallocate($this->image, 128, 128, 128);\n\n $this->red = imagecolorallocate($this->image, 231, 0, 0);\n\n $this->yellow = imagecolorallocate($this->image, 255, 239, 0);\n $this->green = imagecolorallocate($this->image, 0, 129, 31);\n\n $this->color_palette = [$this->red, $this->yellow, $this->green];\n\n imagefilledrectangle($this->image, 0, 0, 200, 125, $this->white);\n\n $border = 25;\n\n $lines = [\"e\", \"g\", \"b\", \"d\", \"f\"];\n $i = 0;\n foreach ($lines as $key => $line) {\n $x1 = 0;\n $x2 = $x_width;\n $y1 = $i * 15 + 25;\n $y2 = $y1;\n imageline(\n $this->image,\n $x1 + $border,\n $y1,\n $x2 - $border,\n $y2,\n $this->black\n );\n $i = $i + 1;\n }\n\n imageline(\n $this->image,\n 0 + $border,\n 25,\n 0 + $border,\n 4 * 15 + 25,\n $this->black\n );\n imageline(\n $this->image,\n 200 - $border,\n 25,\n 200 - $border,\n 4 * 15 + 25,\n $this->black\n );\n\n $textcolor = $this->black;\n\n $font = $this->default_font;\n\n $size = 10;\n $angle = 0;\n\n if (!isset($this->bar_count) or $this->bar_count == \"X\") {\n $this->bar_count = 0;\n }\n $count_notation = $this->bar_count + 1;\n\n if (file_exists($font)) {\n if (\n $count_notation != 1 or\n $count_notation == $this->max_bar_count\n ) {\n imagettftext(\n $this->image,\n $size,\n $angle,\n 0 + 10,\n 110,\n $this->black,\n $font,\n $count_notation\n );\n }\n\n if (\n $count_notation + 1 != 1 or\n $count_notation + 1 == $this->max_bar_count + 1\n ) {\n imagettftext(\n $this->image,\n $size,\n $angle,\n 200 - 25,\n 110,\n $this->black,\n $font,\n $count_notation + 1\n );\n }\n }\n }", "function linesCross($x1, $y1, $x2, $y2, $u1, $v1, $u2, $v2) {\n\n\t\t// vertical lines result in a divide by 0;\n\t\t$line1Vertical = $x2 == $x1;\n\t\t$line2Vertical = $u2 == $u1;\n\t\tif ($line1Vertical && $line2Vertical) {\n\t\t\t// x=a\n\t\t\tif ($x1 == $u1) {\n\t\t\t\t// lines are the same\n\t\t\t\treturn $y1 <= $v1 && $v1 < $y2 || $y1 <= $v2 && $v2 < $y2;\n\t\t\t} else {\n\t\t\t\t// parallel -> they don't intersect!\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t} else if ($line1Vertical && !$line2Vertical) {\n\t\t\t$b2 = ($v2 - $v1) / ($u2 - $u1);\n\t\t\t$a2 = $v1 - $b2 * $u1;\n\n\t\t\t$xi = $x1;\n\t\t\t$yi = $a2 + $b2 * $xi;\n\n\t\t\treturn $yi >= $y1 && $yi <= $y2;\n\n\t\t} else if (!$line1Vertical && $line2Vertical) {\n\t\t\t$b1 = ($y2 - $y1) / ($x2 - $x1);\n\t\t\t$a1 = $y1 - $b1 * $x1;\n\n\t\t\t$xi = $u1;\n\t\t\t$yi = $a1 + $b1 * $xi;\n\n\t\t\treturn $yi >= $v1 && $yi <= $v2;\n\t\t} else {\n\n\t\t\t$b1 = ($y2 - $y1) / ($x2 - $x1);\n\t\t\t// divide by zero if second line vertical\n\t\t\t$b2 = ($v2 - $v1) / ($u2 - $u1);\n\n\t\t\t$a1 = $y1 - $b1 * $x1;\n\t\t\t$a2 = $v1 - $b2 * $u1;\n\n\t\t\tif ($b1 - $b2 == 0) {\n\t\t\t\tif ($a1 == $a2) {\n\t\t\t\t\t// lines are the same\n\t\t\t\t\treturn $x1 <= $u1 && $u1 < $x2 || $x1 <= $u2 && $u2 < $x2;\n\t\t\t\t} else {\n\t\t\t\t\t// parallel -> they don't intersect!\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// calculate intersection point xi,yi\n\t\t\t$xi = -($a1 - $a2) / ($b1 - $b2);\n\t\t\t$yi = $a1 + $b1 * $xi;\n\t\t\tif (($x1 - $xi) * ($xi - $x2) >= 0 && ($u1 - $xi) * ($xi - $u2) >= 0 && ($y1 - $yi) * ($yi - $y2) >= 0 && ($v1 - $yi) * ($yi - $v2) >= 0) {\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "public function lineWidth()\n {\n return isset($this->data->graphicElement->pen[\"lineWidth\"]) ? (float) $this->data->graphicElement->pen[\"lineWidth\"] : 1.0;\n }", "function listSmall_YlineDiagram($yleft, $ytop)\n{\n $sum = $yleft;\n for ($i=0; $i <= 60 ; $i++) {\n $result[] = array('y_small_margin_left' => $sum, 'y_small_margin_top' => $ytop);\n $sum += 5;\n }\n\n return $result;\n}", "function displayLine($a_dbc, $a_lineCount)\n\t{\n\t}" ]
[ "0.8573647", "0.8501134", "0.79354656", "0.74994016", "0.72305226", "0.7107917", "0.6801208", "0.66063446", "0.65580803", "0.63726324", "0.60559034", "0.60532975", "0.5880996", "0.58563715", "0.5822639", "0.5817805", "0.57569975", "0.56424606", "0.56362456", "0.5605013", "0.5576288", "0.5561501", "0.5544325", "0.5422016", "0.5367705", "0.53018916", "0.52764344", "0.5257183", "0.5219612", "0.52192175", "0.5159229", "0.51520133", "0.51366013", "0.51366013", "0.5116211", "0.5108526", "0.5091691", "0.50260174", "0.49920845", "0.49553078", "0.49113175", "0.49096638", "0.4907382", "0.48959655", "0.48722428", "0.48432368", "0.483446", "0.4809971", "0.47977912", "0.47407314", "0.47273153", "0.47109488", "0.46920866", "0.46833554", "0.4671021", "0.46660483", "0.4648264", "0.46153885", "0.45954856", "0.45803016", "0.45800406", "0.45610982", "0.45579964", "0.45561036", "0.45536506", "0.45486957", "0.45290443", "0.45140818", "0.44947734", "0.44656482", "0.446175", "0.44540682", "0.44475928", "0.4445527", "0.4443187", "0.44411176", "0.44406658", "0.44406658", "0.44355148", "0.44232443", "0.44129983", "0.43999398", "0.43927535", "0.43774593", "0.43685576", "0.43678707", "0.43620774", "0.43519312", "0.43516198", "0.4347244", "0.43395293", "0.43295738", "0.43134782", "0.43112126", "0.43020165", "0.43004382", "0.43002233", "0.43002015", "0.42980635", "0.42966378" ]
0.85506845
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 __construct() { parent::__construct(); $this->load->model('login_model'); $this->load->library('Password_encryption'); }
{ "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 $this->load->view('welcome_message');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function Index()\n {\n \treturn view(\"index\");\n\t}", "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}", "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 {\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 }", "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 }", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function index()\n\t{\n\t\treturn view('index');\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.765474", "0.74130577", "0.73950845", "0.7316426", "0.72267336", "0.72267336", "0.7188932", "0.71641964", "0.71506983", "0.7143705", "0.71064097", "0.70761514", "0.7074392", "0.7040164", "0.70277566", "0.70277566", "0.70277566", "0.70277566", "0.70277566", "0.69715184", "0.6967171", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.69467306", "0.6930143", "0.69249934", "0.6910722", "0.68989384", "0.6893409", "0.6873847", "0.6856649", "0.68554837", "0.68383443", "0.6801943", "0.6801943", "0.6801398", "0.67945987", "0.67887646", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.67664593", "0.6764506", "0.6763014", "0.67595977", "0.67595977", "0.67514503", "0.6750154", "0.6746792", "0.6741381", "0.673737", "0.67274755", "0.6716705", "0.6712698", "0.67104334", "0.6703541", "0.66981715", "0.66917276", "0.6673561", "0.66618454", "0.66593856", "0.66507924", "0.6629688", "0.66203475", "0.6612322", "0.6602961", "0.65978956", "0.6592892", "0.659181", "0.6584117", "0.65750426", "0.6573747", "0.65728444", "0.65532637", "0.65457416", "0.6544036", "0.6542768", "0.65418786", "0.6540533", "0.6516457", "0.6514384", "0.6514384", "0.6514384", "0.6514384" ]
0.0
-1
/print_r($_POST); echo $this>input>post('company_name'); die;
public function insert_form(){ if(!empty($_FILES['file_name']['name'])) { $config['upload_path'] = './uploads'; $config['allowed_types'] = '*'; $config['max_size'] = '10000000000000'; $config['overwrite'] = FALSE; $this->load->library('upload',$config); $this->upload->initialize($config); if(!$this->upload->do_upload('file_name')) { $error = array('error' => $this->upload->display_errors()); } else { } $image = $_FILES['file_name']['name']; } else { $image = ''; } if(!empty($_FILES['pdf_name']['name'])) { $config['upload_path'] = './uploads'; $config['allowed_types'] = '*'; $config['max_size'] = '10000000000000'; $config['overwrite'] = FALSE; $this->load->library('upload',$config); $this->upload->initialize($config); if(!$this->upload->do_upload('pdf_name')) { $error = array('error' => $this->upload->display_errors()); } else { } $pdf_name = $_FILES['pdf_name']['name']; } else { $pdf_name = ''; } $Listinspector = implode(',', $this->input->post('inspector')); $edata = array( 'file_name' => $image, 'pdf_name' => $pdf_name, 'company_name' => $this->input->post('company_name'), 'date' => $this->input->post('date'), 'year' => $this->input->post('year'), 'category' => $this->input->post('category'), 'category_sub' => $this->input->post('category_sub'), 'inspector' => $Listinspector, 'observation' => $this->input->post('observation'), 'fei' => $this->input->post('fei'), 'firm_name' => $this->input->post('firm_name'), 'address' => $this->input->post('address'), 'location' => $this->input->post('location'), 'name_title' => $this->input->post('name_title'), 'date_of_inspection' => $this->input->post('date_of_inspection'), 'type_of_es' => $this->input->post('type_of_es') ); $subject_result = $this->login_model->insert_form($edata); redirect('home/add_form'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prp() \r\n{\r\n\tprintarr($_POST, '$_POST:');\r\n}", "function getPost( $name ) #version 1\n{\n if ( isset($_POST[$name]) ) \n {\n return htmlspecialchars($_POST[$name]);\n }\n return \"\";\n}", "function getSubmittedRealName() {\n\t\treturn $this->data_array['realname'];\n\t}", "function handle_post($indata) {\n// showDebug('form_class POST:');\n// showArray($indata); \n return;\n }", "public static function create()\n {\n print_r($_POST);\n }", "function getSubmittedRealName() {\n\t\treturn $this->data_array['submitted_realname'];\n\t}", "public function userinfo() {\n\n return $_POST;\n\n }", "function debugPost(){\n foreach ($_POST as $key => $value) {\n echo \"<tr>\";\n echo \"<td>&nbsp\";\n echo $key;\n echo \"</td>\";\n echo \"<td>&nbsp\";\n echo $value;\n echo \"</td>\";\n echo \"</tr><br>\";\n }\n }", "function add_couponCode(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function info_about_company($submit_button, $company_name, $company_place, $company_address, $company_pib, $company_mat_br, $company_mail, $company_phone, $company_contact_person){\n\t\tif( isset($_POST[$submit_button]) ){\n\t\t\t$company_name \t= $_POST[$company_name];\n\t\t\t$city \t\t \t= $_POST[$company_place];\n\t\t\t$address \t \t= $_POST[$company_address];\n\t\t\t$pib \t\t \t= $_POST[$company_pib];\n\t\t\t$mat_broj \t \t= $_POST[$company_mat_br];\n\t\t\t$username \t \t= $_SESSION['username'];\n\t\t\t$email \t\t \t= $_POST[$company_mail];\n\t\t\t$phone \t\t \t= $_POST[$company_phone];\n\t\t\t$contact_person = $_POST[$company_contact_person];\t\t\n\n\t\t\t//user::update_user_info( $company_name, $city, $address, $jmbg, $mat_broj, $username, $email, $phone, $contact_person );\n\t\t\tuser::update_user_info( $company_name, $city, $address, $pib, $mat_broj, $username, $email, $phone, $contact_person );\n\t\t\t\theader(\"location: ../../basic_info.php\");\n\t\t}\n\t}", "function posted_value($name) {\n if(isset($_POST[$name])) {\n return htmlspecialchars($_POST[$name]);\n }\n}", "function pickup_submit()\n\t{\n\t\t$name = '_f_'.$this->name;\n\t\t$this->value = $GLOBALS[$name];\n\t}", "protected function getPostValues() {}", "function print_input_fields()\n{\n\t$fields = func_get_args();\n\tforeach ($fields as $field)\n\t{\n\t\t$value = array_key_value($_POST,$field,'');\n\t\t$label = ucwords(str_replace('_',' ',$field));\n\t\tprint <<<EOQ\n <tr>\n <td valign=top align=right>\n <b>$label:</b>\n </td>\n <td valign=top align=left>\n <input type=\"text\" name=\"$field\" size=\"40\" value=\"$value\">\n </td>\n </tr>\nEOQ;\n\t}\n}", "public function get_input()\n {\n }", "function form_data($args)\n {\n }", "function update_couponCode(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function showCompany() {\n\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\n\t\t\t\t\t$editForm = new h2o('views/editCompany.html');\n\t\t\t\t\techo $editForm->render(compact('company'));\n\t\t\t\t}", "public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "public function get_submitted_edit_form_data()\n\t{\n\t\t$this->credits = $_POST['credits'];\n\t\t$this->levelID = $_POST['level'];\t\n\t}", "public function showRequestPost();", "function lesson_title(){\n return $_POST['lesson-title'];\n}", "function dumpFormItems()\r\n {\r\n // Overriden to avoid printing a hidden field to get the value of the component.\r\n }", "public function getPostVariables();", "function get_submit($productName)\n{\n}", "function getPostParam($name,$def=null) {\n\treturn htmlentities(isset($_POST[$name]) ? $_POST[$name] : $def,ENT_QUOTES);\n\t\t\n}", "function WriteID()\r\n{\r\n if (isset($_POST))\r\n {\r\n if (!empty($_POST) && !empty($_POST['delivery']))\r\n {\r\n echo $_POST['delivery'];\r\n }\r\n\r\n }\r\n}", "private function readPost(){\n\t\tIF(isset($_POST['eventName'])) { \n\t\t $this->eventName = trim(strip_tags($_POST['eventName']));\n\t\t}\n\t\tIF(isset($_POST['senderName'])) { \n\t\t $this->senderName = trim(strip_tags($_POST['senderName']));\n\t\t}\n\t\tIF(isset($_POST['senderEmail'])) {\n\t\t $this->senderEmail = trim(strip_tags(preg_replace(\"/[^0-9a-zA-ZäöüÄÖÜÈèÉéÂâáÁàÀíÍìÌâÂ@ \\-\\+\\_\\.]/\", \" \", $_POST['senderEmail'])));\n\t\t}\n\t\tIF(isset($_POST['validateEmail'])){\n\t\t $this->validateEmail = trim(strip_tags($_POST['validateEmail']));\n\t\t}\n\t\tIF(isset($_POST['senderPhone'])){\n\t\t $this->senderPhone = trim(strip_tags($_POST['senderPhone']));\n\t\t}\n\t\tIF(isset($_POST['numberOfTickets'])){\n\t\t $this->numberOfTickets = trim(strip_tags($_POST['numberOfTickets']));\n\t\t}\n\t\tIF(isset($_POST['paymentOption'])){\n\t\t $this->paymentOption = trim(strip_tags($_POST['paymentOption']));\n\t\t}\n\t\tIF(isset($_POST['otherPartyNames'])){\n\t\t $this->otherPartyNames = trim(strip_tags($_POST['otherPartyNames']));\n\t\t}\n\t\tIF(isset($_POST['pickupPoint'])){\n\t\t $this->pickupPoint = trim(strip_tags($_POST['pickupPoint']));\n\t\t} \n\t\tIF(isset($_POST['sittingNear'])){\n\t\t $this->sittingNear = trim(strip_tags($_POST['sittingNear']));\n\t\t}\n\t\tIF(isset($_POST['specialNeeds'])){\n\t\t $this->specialNeeds = trim(strip_tags($_POST['specialNeeds']));\n\t\t}\n\t}", "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "public function postData()\n\t{\n\t\t$this->setCustomerName($_POST['frmcname']);\n\t\t$this->setCustomerAddress1($_POST['frmcaddy1']);\n\t\t$this->setCustomerAddress2($_POST['frmcaddy2']);\n\t\t$this->setCustomerCity($_POST['frmccity']);\n\t\t$this->setCustomerZipcode($_POST['frmczipcode']);\n\t\t$this->setCustomerState($_POST['frmcstate']);\n\t\t$this->setCustomerPhone( $_POST['frmcpnumber']);\n\t\t$this->setCustomerExt($_POST['frmcext']);\n\t\t$this->setCustomerFax($_POST['frmcfnumber']);\n\t\t$this->setCustomerEmail($_POST['frmcemail']);\n\t\t$this->setCustomerRdp($_POST['frmcrdp']);\n\t\t$this->setCustomerNotes($_POST['frmcnotes']);\n\t\t$this->setFlag($_POST['frmflaggedq']);\n\t\t$this->setFlagReason($_POST['frmflagreason']);\n\t}", "function post($input=''){\n $input = htmlspecialchars($_POST[$input]);\n $input = addslashes($input);\n return $input;\n }", "function acf_get_form_data($name = '')\n{\n}", "function action_handler() \n{ \t \n // set variables that were passed fron the form\n $name = $_POST[\"name\"];\n $artist = $_POST[\"artist\"];\n $price = $_POST[\"price\"];\n $version = $_POST[\"version\"];\n\n echo \"<br>Running our ACTION HANDLER code - Version $version\"; \n echo \"<br> Name was entered: $name\";\n echo \"<br> Artist was entered: $artist\";\n echo \"<br> Price was entered: $price\";\n}", "public function getPostRequest(): ParameterBag { return $this->post; }", "function getFromPost() {\r\n\t\t\r\n\t\t//Event Page variables.\r\n\t\t$this->name = $_POST['eventName'];\r\n\t\t$this->date = $_POST['eventDate'];\r\n\t\t$this->time = $_POST['eventTime'];\r\n\t\t$this->time_before = $_POST['time_before'];\r\n\t\t$this->freq = $_POST['frequency'];\r\n\t\t$this->notif_method = $_POST['method'];\r\n\t}", "private function input(){\n $this->params['controller_name'] = $this->ask('Controller name');\n $this->params['crud_url'] = $this->ask('CRUD url');\n $this->params['model_name'] = $this->ask('Model name');\n $this->params['table_name'] = $this->ask('Table name');\n $this->params['author'] = env('PACKAGE_AUTHOR');\n }", "function CMSBodyMain()\n\t{\techo $this->cat->InputForm();\n\t}", "public function cs_generate_form() {\n global $post;\n }", "function getPostVal($key) {\n $CI = & get_instance();\n $val = $CI->input->post($key);\n if ($val != \"\")\n return $val;\n else\n return false;\n}", "function process_post()\r\n{\r\n $myReturn = ''; //set to initial empty value\r\n\r\n foreach($_POST as $varName=> $value)\r\n {#loop POST vars to create JS array on the current page - include email\r\n $strippedVarName = str_replace(\"_\",\" \",$varName);#remove underscores\r\n if(is_array($_POST[$varName]))\r\n {#checkboxes are arrays, and we need to collapse the array to comma separated string!\r\n $myReturn .= $strippedVarName . \": \" . implode(\",\",$_POST[$varName]) . PHP_EOL;\r\n }else{//not an array, create line\r\n $myReturn .= $strippedVarName . \": \" . $value . PHP_EOL;\r\n }\r\n }\r\n return $myReturn;\r\n}", "public function getPostValues()\n {\n // Define the check for params\n $post_check_array = array(\n // submit action\n 'toevoegen' => array('filter' => FILTER_SANITIZE_STRING),\n 'bijwerken' => array('filter' => FILTER_SANITIZE_STRING),\n 'verwijderen' => array('filter' => FILTER_SANITIZE_STRING),\n // question\n 'vraag' => array('filter' => FILTER_SANITIZE_STRING),\n // question type (open or closed)\n 'vraagId' => array('filter' => FILTER_SANITIZE_INT),\n // question type (open or closed)\n 'vraagSoort' => array('filter' => FILTER_SANITIZE_STRING),\n // Education\n 'opleiding' => array('filter' => FILTER_SANITIZE_STRING),\n // question send time\n 'verstuurTijd' => array('filter' => FILTER_SANITIZE_STRING)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n // RTS\n return $inputs;\n }", "function process_post()\n{\n $myReturn = ''; //set to initial empty value\n\n foreach($_POST as $varName=> $value)\n {#loop POST vars to create JS array on the current page - include email\n $strippedVarName = str_replace(\"_\",\" \",$varName);#remove underscores\n if(is_array($_POST[$varName]))\n {#checkboxes are arrays, and we need to collapse the array to comma separated string!\n $myReturn .= $strippedVarName . \": \" . implode(\",\",$_POST[$varName]) . PHP_EOL;\n }else{//not an array, create line\n $myReturn .= $strippedVarName . \": \" . $value . PHP_EOL;\n }\n }\n return $myReturn;\n}", "public function getForm();", "function getPostData($str){\n $data = $_POST[$str] ?? '';\n return htmlentities($data);\n}", "function dumpFormItems()\r\n {\r\n }", "function dumpFormItems()\r\n {\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}", "function editCompany() {\n\t\t\t\t\tif ($_POST['updateDelete'] == 'update') {\n\n\t\t\t\t\t\t/* params(0) represents the apprentice name passed in via the URL */\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$company->update_attributes(array('name'\t\t => $_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t 'city'\t\t => $_POST['inputCity'],\n\t\t\t\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\t\t\t 'sql'\t\t\t => $_POST['inputSql'],\n\t\t\t\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\t\t\t 'wordpress'\t => $_POST['inputWordpress'],\n\t\t\t\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\t\t\t 'python'\t\t => $_POST['inputPython'],\n\t\t\t\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\t\t\t 'objective_c'\t => $_POST['inputObjectiveC'],\n\t\t\t\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\t\t\t 'c_plusplus'\t => $_POST['inputCPlusPlus'],\n\t\t\t\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\t\t\t 'php'\t\t\t => $_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'html_css'\t => $_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'java'\t\t => $_POST['inputJava'],\n\t\t\t\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\t\t\t 'comments'\t => $_POST['inputComments'])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ($_POST['updateDelete'] == 'delete') {\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t$company->delete();\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}", "function createCompany() {\n\t\t\t\t\t$addForm = new h2o('views/addCompany.html');\n\t\t\t\t\techo $addForm->render();\n\t\t\t\t}", "function getInput()\r\n\t{\r\n\t\t$this->name = trim($_POST['name']);\r\n\r\n\t\t$this->desg = trim($_POST['desg']);\r\n\r\n\t\t$this->gender = trim($_POST['gender']);\r\n\r\n\t\t\r\n\t\tif(strcmp($this->gender, 'M') == 0)\r\n\t\t{\r\n\t\t\t$this->addr = trim($_POST['office']);\r\n\t\t}\t\r\n\r\n\t\telseif(strcmp($this->gender, 'F') == 0)\r\n\t\t\t$this->addr = trim($_POST['resd']);\r\n\r\n\t\t\r\n\t\t$this->contacts = array(trim($_POST['con1']));\r\n\t\tarray_push($this->contacts, trim($_POST['con2']), trim($_POST['con3']), trim($_POST['con4']), trim($_POST['con5']));\r\n\r\n\t\t$this->emails = array(trim($_POST['email1']));\r\n\t\tarray_push($this->emails, trim($_POST['email2']));\r\n\r\n\t\t//print_r($this->emails);\r\n\r\n\t\t$this->validateInput();\r\n\r\n\t}", "abstract public function get_posted_value();", "function add_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->role = $_POST['role'];\n $this->firstname = trimStrip($_POST['firstname']);\n $this->surname = trimStrip($_POST['surname']);\n $this->email = trimStrip($_POST['email']);\n $this->login = trimStrip($_POST['login']);\n $this->password = trimStrip($_POST['pass1']);\n }", "public function getCompany_name()\n {\n return $company_name;\n }", "public function savecompany() {\n if (isset($_POST['companyname'])) {\n $userId = $this->session->userdata('user_id');\n $companyname = $this->input->post('companyname');\n $result = $this->Users->savecompany($companyname, $userId);\n if ($result) {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 1)));\n } else {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 0)));\n }\n }\n }", "public function getPost()\n {\n $request = $this->getRequest();\n return $request->getPost();\n }", "public function getFormName();", "public function getFormName();", "function ProductsBody()\n\t{\t//$this->FilterForm();\n\t\techo $this->cat->InputForm();\n\t}", "private function getPostData()\n {\n $postData = $this->request->getPostValue();\n\n /** Magento may adds the SID session parameter, depending on the store configuration.\n * We don't need or want to use this parameter, so remove it from the retrieved post data. */\n unset($postData['SID']);\n\n //Set original postdata before setting it to case lower.\n $this->originalPostData = $postData;\n\n //Create post data array, change key values to lower case.\n $postDataLowerCase = array_change_key_case($postData, CASE_LOWER);\n $this->postData = $postDataLowerCase;\n }", "public function getRequestUserName() {\n if(isset($_POST[self::$name])){\n return trim($_POST[self::$name]);\n }\n\t}", "function get_post($name = '', $clean = true) {\n\tif($name === '') {\n\t\t$return = array();\n\n\t\tforeach ($_POST as $key => $post) {\n\t\t\t$return[$key] = $clean ? clean_variable($post) : $post;\n\t\t}\n\t\treturn $return;\n\t}\n\n\tif (!isset($_POST[$name])) {\n\t\treturn '';\n\t}\n\n\treturn $clean ? clean_variable($_POST[$name]) : $_POST[$name];\n}", "public function payment_fields() {\n\n\t\t$this->log( 'Show Payment fields on the checkout page' );\n\n\t\t$referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : \"\";\n\n\t\t$this->log( 'Received GET data from [' . $referer. ']:' );\n\t\t$this->log( print_r($_GET, true ) );\n\n\t\t$this->log( 'Received POST data from [' . $referer. ']:' );\n\t\t$this->log( print_r($_POST, true ) );\n\n\t\tif ( $this->description ) {\n\t\t\techo wpautop( wp_kses_post( $this->description ) );\n\t\t}\n\t}", "function getUserFromForm()\n {\n $string= \"default\";\n\n if (isset($_POST['Parametro']))\n $string=$_POST['Parametro'];\n\n return $string;\n }", "abstract protected function getFormName();", "function input($name){\n\t\tif(isset($_POST[$name])){\n\t\t\t$t = $this->simpleCleanInput($_POST[$name]);\n\t\t\tif($t !== false){\n\t\t\t\treturn $t;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "function getPostValue ( $name ) {\n\tglobal $HTTP_POST_VARS;\n\n\tif ( isset ( $_POST ) && is_array ( $_POST ) && ! empty ( $_POST[$name] ) ) {\n\t\t$HTTP_POST_VARS[$name] = $_POST[$name];\n\t\treturn $_POST[$name];\n\t} else if ( ! isset ( $HTTP_POST_VARS ) ) {\n\t\treturn null;\n\t} else if ( ! isset ( $HTTP_POST_VARS[$name] ) ) {\n\t\treturn null;\n\t}\n\treturn ( $HTTP_POST_VARS[$name] );\n}", "function getPost($key) {\n\t$value = '';\n\tif (isset($_POST[$key])) {\n\t\t$value = $_POST[$key];\n\t}\n\t// return $value;\n\t//Phan 2: Ham xu ly ky tu dac biet\n\treturn removeSpecialCharacter($value);\n}", "function pickup_submit()\n\t{\n\t\t$year = $this->name . '_year';\n\t\t$month = $this->name . '_month';\n\t\t$day = $this->name . '_day';\n\t\tglobal $$year, $$month, $$day;\n\n\t\t$this->value = $$year . \".\" . $$month . \".\" . $$day;\n\t}", "public function actionSendt(){\n //return 'dddd';\n print_r(\\Yii::$app->request->post());\n return;\n }", "function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->login = trimStrip($_POST['login']);\n $this->surname = trimStrip($_POST['surname']);\n $this->firstname = trimStrip($_POST['firstname']);\n $this->hash = trimStrip($_POST['hash']);\n $this->yearno = (integer)trimStrip($_POST['yearno']);\n $this->groupno = (integer)trimStrip($_POST['groupno']);\n $this->email = trimStrip($_POST['email']);\n $this->calendaryear = intval($_POST['calendaryear']);\n $this->coeff = (float)$_POST['coeff'];\n }", "private function get_post( $name ) {\n\t\tif ( isset( $_POST[ $name ] ) ) {\n\t\t\treturn trim( $_POST[ $name ] );\n\t\t}\n\t\treturn null;\n\t}", "public function getInputName() {\n return $this->inputName;\n\t }", "public function getName(){ return $this->getField('name'); }", "function _post($v) { // clean Post - returns a useable $_POST variable or NULL if and only if it is not set\r\n return isset($_POST[$v]) ? bwm_clean($_POST[$v]) : NULL;\r\n}", "public function post_body() {\n\t\treturn file_get_contents( 'php://input' );\n\t}", "function MYMODULE_my_custom_form_submit(&$form, &$form_state) {\n // from what I've tested they even get validated accordingly by \n // their \"parent modules\" (the CCK modules which define them).\n //var_dump($form_state['values']);\n}", "public function getInput() {}", "function readinput()\n\t{\n\t\t$temanbaru = [\n\t\t\t\"noteman\"\t=> $this->input->post(\"noteman\"),\n\t\t\t\"namateman\"\t=> $this->input->post(\"namateman\"),\n\t\t\t\"notelp\"\t=> $this->input->post(\"notelp\"),\n\t\t\t\"email\"\t\t=> $this->input->post(\"email\")\n\t\t];\n\n\t\treturn $temanbaru;\n\t}", "public function getPostValues() {\n $post_check_array = array(\n// submit action\n 'add' => array('filter' => FILTER_SANITIZE_STRING),\n 'update' => array('filter' => FILTER_SANITIZE_STRING),\n // List all update form fields !!!\n// event type name.\n 'datum' => array('filter' => FILTER_SANITIZE_STRING),\n 'prioriteit' => array('filter' => FILTER_SANITIZE_STRING),\n 'username' => array('filter' => FILTER_SANITIZE_STRING),\n 'user' => array('filter' => FILTER_SANITIZE_STRING),\n 'password' => array('filter' => FILTER_SANITIZE_STRING),\n // Help text\n 'status' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'alarm_id' => array('filter' => FILTER_VALIDATE_INT),\n 'alarm_noticed' => array('filter' => FILTER_VALIDATE_INT),\n\t\t\t'alarm_origin' => array('filter' => FILTER_SANITIZE_STRING)\n );\n// Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n// RTS\n return $inputs;\n }", "function add_course(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function post_editketentuanjenjang(){\n $this->layout = null;\n \n $input= Input::all();\n echo var_dump($input);\n }", "function get_fields_from_post(){\n\t\t$prefix=\"\";\n\t\t$this->id_corp=$_SESSION['ident_corp'];\n\t\t$this->name=htmlentities($_POST[$prefix.$this->ddbb_name]);\n\t\t$this->name_web=htmlentities($_POST[$prefix.$this->ddbb_name_web]);\n\t\t$this->pvp=$_POST[$prefix.$this->ddbb_pvp];\n\t\t$this->tax=$_POST[$prefix.$this->ddbb_tax];\n\t\t$this->pvp_tax=$_POST[$prefix.$this->ddbb_pvp_tax];\n\t\t$this->descrip=htmlentities($_POST[$prefix.$this->ddbb_descrip]);\n\t\t$this->path_photo = $_SESSION['ruta_photo'];\n\t\t\n\n\t\t\n\t\t$this->get_categories_from_post();\n\n\t\treturn 0;\n\t}", "function repopulatePost($name) {\n if (filter_has_var(INPUT_POST, $name)) {\n return htmlspecialchars_decode(sanitize(filter_input(INPUT_POST, $name, FILTER_SANITIZE_STRING)));\n }\n else {\n return '';\n }\n}", "function getInput(){\n return json_decode(file_get_contents('php://input'), true);\n }", "function create_company_box_for_aliment() {\n\n\t$post_relationship = new \\IA\\One_To_Many_Post_Relationship( 'ia_aliment_brand' );\n\tglobal $post;\n\n\t$company_id = $post_relationship->get_parent_id( $post->ID );\n\t$name = IA_ALIMENT_PRODUCER_FORM_INPUT_NAME;\n\n\t?>\n\t\t<p>\n\t\t\t<input type=\"search\" placeholder=\"<?php _ex( 'Search for company', 'backend', 'wiki-eat' ) ?>\">\n\t\t\t<input id=\"ia-company-of-aliment\" name=\"<?php echo $name; ?>\" type=\"search\" value=\"<?php echo $company_id; ?>\" data-swplive=\"true\">\n\t\t</p>\n\t<?php\n}", "function my_custom_field($field, $value){\r\n\tprint_r($field);\r\n\tprint_r($value);\r\n\r\n}", "function persisted($posted_key) {\n\n $form_data = Session::getFormData();\n if (isset($form_data[$posted_key])) {\n echo $form_data[$posted_key];\n }\n \n}", "function company_settingsupdate() {\n $this->auth(COMP_ADM_LEVEL);\n $company_id = $this->uri->segment(3);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_company_settings->update($company_id, $data)){\n $this->companyadmin(7);\n }else{\n echo 'error';\n }\n }", "public static function input_fields()\n {\n }", "function my_custom_field($field, $value){\n\tprint_r($field);\n\tprint_r($value);\n\n}", "function WithPost()\n {\n $this->mUsername = $_POST['username'];\n $this->mPassword = $_POST['password'];\n $this->mPasswordConfirm = $_POST['passwordConfirm'];\n }", "public function transactionGetForm ();", "public function postAction() {\n\n }", "public function postAction()\n {\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function OrderDataPost($postData){\n //do something awesome with that post data\n return \"I am in\";\n }", "public function onCompanyData()\n {\n $data = post();\n $company = new Company;\n $company->name = $data['company'];\n $company->address = $data['address'];\n $company->zip = $data['zip'];\n $company->city_id = $data['city'];\n $company->state_id = $data['state'];\n $company->country_id = $data['country'];\n $company->save();\n if ($id = $data['user_id']) {\n $user = BaseUser::whereId($id)->first();\n $this->sendEmailConfirmation($data, $user);\n $this->sendAdminData($data, $user);\n }\n }", "public function companysave() {\r\n try {\r\n if (isset($_POST)) {\r\n $validationResult = Validator::validate($_POST, $this->model->rules());\r\n if (empty($validationResult)) {\r\n $this->model->companySave($_POST);\r\n header('Location: /companylist');\r\n die();\r\n } else {\r\n FlashMessage::addData($_POST);\r\n FlashMessage::setMessage('danger', $validationResult);\r\n header('Location: ' . $_SERVER['HTTP_REFERER']);\r\n die;\r\n }\r\n }\r\n } catch (Exception $exc) {\r\n echo $exc->getMessage();\r\n }\r\n }", "private function loadPostParams()\n {\n if(isset($_POST)) {\n $this->postParams = $_POST;\n }\n }", "public function postAction()\n {\n \n }" ]
[ "0.65776294", "0.62472314", "0.6189828", "0.6172967", "0.61709654", "0.6044475", "0.60267586", "0.6013567", "0.59740883", "0.59280914", "0.5892254", "0.5788545", "0.5746599", "0.5716973", "0.5708422", "0.5697761", "0.5690449", "0.56830925", "0.56741947", "0.56665415", "0.5624641", "0.56166077", "0.5608137", "0.55941993", "0.55824894", "0.55590725", "0.55195135", "0.5506615", "0.5494836", "0.5493445", "0.54846865", "0.5460397", "0.54565924", "0.5441819", "0.5436457", "0.5432183", "0.5423305", "0.5404261", "0.5402894", "0.53953916", "0.5379014", "0.53758776", "0.53714496", "0.53620964", "0.53503495", "0.53503495", "0.53480685", "0.5344729", "0.5344168", "0.53432554", "0.53355575", "0.5335545", "0.53275925", "0.53267574", "0.53207624", "0.5316877", "0.5311456", "0.5311456", "0.5310913", "0.5309611", "0.5309166", "0.53043205", "0.53031737", "0.530022", "0.52981675", "0.52976966", "0.5295731", "0.5293068", "0.5277057", "0.5268468", "0.52630025", "0.52613705", "0.52581215", "0.5255787", "0.5245948", "0.5245344", "0.5241021", "0.5237159", "0.5231031", "0.5230725", "0.5229604", "0.52264833", "0.5226193", "0.5222631", "0.5222399", "0.5221647", "0.5218422", "0.5218213", "0.52181476", "0.52031195", "0.5202258", "0.51924396", "0.5189403", "0.51889265", "0.5188841", "0.51887375", "0.5188355", "0.518733", "0.5185318", "0.5185187", "0.51825225" ]
0.0
-1
registration_button. This method is used to show connect with loyaltybox button which will open registration / login popup if session is already runnig for logged in user it will show users account details with available loyalty points.
public function registration_button() { $rewardProgrammeName = Mage::getStoreConfig('lbconfig_section/lb_settings_group/reward_programme_name_field'); Lb_Points_Helper_Data::$rewardProgrammeName = $rewardProgrammeName; if(isset($_SESSION['LB_Session'])) { if(!empty($_SESSION['LB_Session'])) { $LB_Session = $_SESSION['LB_Session']; Lb_Points_Helper_Data::debug_log("Rendered session user with his LB Points", true); ?> <div class="connectlbbtn lb-box"> <span class="h2"><?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></span> <div class="loyaltybox-info-contain"> <?php if(isset($_SESSION['LB_Session']['totalRedeemPoints'])) $remainingPoints = $LB_Session['lb_points'] - $_SESSION['LB_Session']['totalRedeemPoints']; else $remainingPoints = $LB_Session['lb_points']; ?> <?php echo "<strong>Hi ".$LB_Session['Customer Name']."</strong> | <a id='lbLogout' href='javascript:void(0);'>Logout(".Lb_Points_Helper_Data::$rewardProgrammeName.")</a></br>You have ".$remainingPoints." Points in your <strong>".Lb_Points_Helper_Data::$rewardProgrammeName."</strong> account."; ?> </div> <div class="lbMsg"></div> </div> <?php } else { Lb_Points_Helper_Data::debug_log("Rendered Connect with Loyalty Box button", true); ?> <div class="connectlbbtn registrationBtn lb-box"> <button class="button btn-cart" onclick="return showForm('popup_form_registration')" title="Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?>" type="button"><span><span>Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></span></span></button> <div class="lbMsg"></div> </div> <script type="text/javascript"> function showForm(id){ win = new Window({ title: "Connect with Loyalty Box", zIndex:3000, destroyOnClose: true, recenterAuto:true, resizable: false, width:400, height:'auto', minimizable: true, maximizable: false, draggable: true}); win.setContent(id, false, false); win.showCenter(); } </script> <?php Lb_Points_Helper_Data::debug_log("End: Rendered Connect with Loyalty Box button", true); } } else { Lb_Points_Helper_Data::debug_log("Rendered Connect with Loyalty Box button", true); ?> <div class="connectlbbtn registrationBtn lb-box"> <button class="button btn-cart" onclick="return showForm('popup_form_registration')" title="Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?>" type="button"><span><span>Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></span></span></button> <div class="lbMsg"></div> </div> <script type="text/javascript"> function showForm(id){ win = new Window({ title: "Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?>", zIndex:3000, destroyOnClose: true, recenterAuto:true, resizable: false, width:400, height:'auto', minimizable: true, maximizable: false, draggable: true}); win.setContent(id, false, false); win.showCenter(); } </script> <?php Lb_Points_Helper_Data::debug_log("End: Rendered Connect with Loyalty Box button", true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registration_popup() {\n ?>\n <div style=\"display:none;\">\n <div id=\"popup_form_registration\" class=\"main\">\n <div class=\"col-main\" style=\"float: none;width:100%;\">\n <div class=\"page-title\">\n <h1>Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></h1>\n </div>\n <div id=\"registerLB\">\n <form id=\"registrationForm\">\n <div class=\"fieldset\">\n <h2 class=\"legend\">Registration</h2>\n <p class=\"required\">* Required Fields</p>\n <div id=\"formRegisterSuccess\" ></div>\n <ul class=\"form-list\">\n <li class=\"fields\">\n <div class=\"field\">\n <label class=\"required\" for=\"name\"><em>*</em>Name</label>\n <div class=\"input-box\">\n <input type=\"text\" class=\"input-text required-entry\" value=\"\" title=\"Name\" id=\"name\" name=\"name\">\n </div>\n </div>\n <div class=\"field\">\n <label class=\"required\" for=\"email\"><em>*</em>Email Address</label>\n <div class=\"input-box\">\n <input type=\"email\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" class=\"input-text required-entry validate-email\" value=\"\" title=\"Email\" id=\"email\" name=\"email\">\n </div>\n </div>\n </li>\n <li>\n <label class=\"required\" for=\"phonenumber\"><em>*</em>Phone number</label>\n <div class=\"input-box\">\n <input type=\"tel\" class=\"input-text required-entry validate-number IsValidCellNumber\" value=\"\" title=\"Phone number\" id=\"phonenumber\" name=\"phonenumber\">\n </div>\n </li>\n </ul>\n </div>\n <div class=\"buttons-set lb-btn-register\">\n <button class=\"button\" title=\"Submit\" type=\"submit\"><span><span>Submit</span></span></button>\n </div>\n <div class=\"lb-links\">\n <div >\n Or <a href=\"javascript:void(0);\" id=\"lnkLBLogin\" style=\"color:burlywood;\">login</a> if already registered.\n </div>\n <div>\n download our <a href=\"javascript:void(0);\" id=\"lnkDownloadApp\" style=\"color:burlywood;\">mobile application</a>\n </div>\n </div>\n </form>\n </div>\n <div style=\"display:none;\" id=\"loginLB\">\n <form id=\"loginForm\">\n <div class=\"fieldset\">\n <h2 class=\"legend\">Login</h2>\n <p class=\"required\">* Required Fields</p>\n <div id=\"formLoginLowestSuccess\" ></div>\n <ul class=\"form-list\">\n <li>\n <label class=\"required\" for=\"txtCardNumber\"><em>*</em>Card Number / Phone number / OTP</label>\n <div class=\"input-box\">\n <input type=\"tel\" class=\"input-text required-entry validate-number IsValidCartNumber\" value=\"\" title=\"Telephone\" id=\"txtCardNumber\" name=\"txtCardNumber\" >\n </div>\n </li>\n </ul>\n </div>\n <div class=\"buttons-set lb-btn-register\">\n <button class=\"button\" title=\"Submit\" type=\"submit\"><span><span>Submit</span></span></button>\n </div>\n <div class=\"lb-links\">\n <div>\n Or <a href=\"javascript:void(0);\" id=\"lnkLBRegister\" style=\"color:burlywood;\">click here</a> to register.\n </div>\n <div>\n download our <a href=\"javascript:void(0);\" id=\"lnkDownloadApp\" style=\"color:burlywood;\">mobile application</a>\n </div>\n </div>\n </form>\n </div>\n <span id=\"formLoader\" >\n <img src=\"<?php echo $this->getSkinUrl(\"images/opc-ajax-loader.gif\") ?>\">\n </span>\n </div>\n </div>\n </div>\n <style>\n .frm_error{\n color:red;\n font-size: 13px;\n margin: 5px 0 0;\n }\n .frm_success{\n color:green;\n font-size: 13px;\n margin: 5px 0 0;\n }\n #formLoader{\n display:none;\n }\n .lb-btn-register{\n margin-bottom: 5px;\n }\n .lb-btn-register::after {\n clear: none;\n content: \"\";\n display: table;\n }\n .lb-links{\n color: #636363;\n font-family: \"Helvetica Neue\",Verdana,Arial,sans-serif;\n font-size: 13px;\n line-height: 1.5;\n margin-top: -10px;\n }\n \n @media screen and (max-width: 479px) {\n .lb-btn-register::after {\n clear: both;\n content: \"\";\n display: table;\n }\n }\n #popup_form_registration {\n width: auto;\n }\n .connectlbbtn.lb-box {\n clear: both;\n padding:5px;\n }\n\n .registrationBtn h2 {\n font-size: 12px;\n font-weight: bold;\n margin: 0 0 5px;\n }\n \n #formRegisterSuccess{\n font-size: 13px;\n margin: 5px 0 0;\n color: green;\n }\n \n .dialog_content {\n background-color: #F4F4F4;\n color: #636363;\n font-family: Tahoma,Arial,sans-serif;\n font-size: 10px;\n overflow: auto;\n padding-bottom: 5px!important;\n }\n \n .redeem_lbpoints input {\n margin-bottom: 5px;\n }\n .lb-redeem-wrapper{\n margin-top: 5px;\n display: none;\n }\n <?php if(strpos($_SERVER['REQUEST_URI'], '/checkout/cart/') !== false){?>\n .registrationBtn{\n background-color: #f4f4f4;\n border: 1px solid #cccccc;\n padding: 10px;\n margin-bottom: 20px;\n }\n <?php }?>\n \n </style>\n <script type=\"text/javascript\">\n \n jQuery(\"#loginLB\").hide();\n jQuery(\"#lnkLBLogin\").click(function(){\n jQuery(\"#loginLB\").show();\n jQuery(\"#registerLB\").hide();\n jQuery(\".dialog_content\").css('height','auto');\n });\n\n jQuery(\"#lnkLBRegister\").click(function(){\n jQuery(\"#loginLB\").hide();\n jQuery(\"#registerLB\").show();\n jQuery(\".dialog_content\").css('height','auto');\n });\n \n Validation.add('IsValidCartNumber', 'Only 10 or 15 digits are allowed.', function(v) {\n return (v.length == 10 || v.length == 15); // || /^\\s+$/.test(v));\n }); \n \n Validation.add('IsValidCellNumber', 'Only 10 digits are allowed.', function(v) {\n return (v.length == 10); // || /^\\s+$/.test(v));\n }); \n \n \n //var dataForm = new VarienForm('lowest-form-validate', true);\n var formId = 'registrationForm';\n var myForm = new VarienForm(formId, true);\n var handleSubmit = true;\n function doAjax() {\n var postUrl = \"<?php echo Mage::getBaseUrl() . 'lb/index/register' ?>\";\n jQuery(\".dialog_content\").css('height','auto');\n if (myForm.validator.validate()) {\n var txtName = jQuery(\"#name\");\n var txtEmail = jQuery(\"#email\");\n var txtPhoneNumber = jQuery(\"#phonenumber\");\n var tips = jQuery(\"#formRegisterSuccess\");\n tips.text('');\n var data = {\n 'txtName': txtName.val(),\n 'txtEmail': txtEmail.val(),\n 'txtPhoneNumber': txtPhoneNumber.val()\n };\n if(handleSubmit){\n handleSubmit = false;\n jQuery(\"#formLoader\").show();\n jQuery.post(postUrl, data, function(response) {\n handleSubmit = true;\n if(response.status == '1'){\n jQuery(\"#formLoader\").hide();\n tips.text(response.message).addClass( \"frm_success\" );\n txtName.val('');\n txtEmail.val('');\n txtPhoneNumber.val('');\n jQuery(\".dialog_close\").trigger('click');\n window.location.reload();\n }\n else{\n tips.text(response.message).addClass( \"frm_error\" );\n jQuery(\"#formLoader\").hide();\n }\n },'JSON');\n }\n }\n }\n // REGISTRATION CALL BACK\n new Event.observe('registrationForm', 'submit', function(e){\n e.stop();\n doAjax();\n });\n \n \n // login js\n var loginFormId = 'loginForm';\n var loginForm = new VarienForm(loginFormId, true);\n jQuery(\"#loginForm button\").click(function(){\n var postUrl = \"<?php echo Mage::getBaseUrl() . 'lb/index/login' ?>\";\n var txtCardNumber = jQuery(\"#txtCardNumber\").val();\n jQuery(\".dialog_content\").css('height','auto');\n if (loginForm.validator.validate()) {\n jQuery(\"#formLoader\").show();\n jQuery.post(postUrl,{'txtCardNumber':txtCardNumber}, function(response) {\n if(response.status == '1'){\n jQuery(\"#formLoader\").hide();\n jQuery(\".dialog_close\").trigger('click');\n Element.show('formLoginLowestSuccess');\n jQuery(\"#formLoginLowestSuccess\").html(response.message).addClass( \"frm_success\" );\n jQuery(\".connectlbbtn\").html(response.replaceBtn);\n window.location.reload();\n }\n else{\n jQuery(\"#formLoader\").hide();\n Element.show('formLoginLowestSuccess');\n jQuery(\"#formLoginLowestSuccess\").html(response.message).addClass( \"frm_error\" );\n }\n },'JSON');\n }\n return false;\n });\n \n \n // Add connect with loyaltybox button to right side bar\n /*if(jQuery(\".cart-forms\").length == 1)\n {\n var btnHtml = jQuery(\".connectlbbtn\").html();\n jQuery(\".connectlbbtn\").html('');\n jQuery(\".cart-forms\").prepend(\"<div class='discount connectlbbtn'>\"+btnHtml+\"</div>\");\n\n }*/\n // End : Add connect with loyaltybox button to right side bar.\n \n // LOGOUT CALL BACK\n jQuery(\"#lbLogout\").click(function(){\n var postUrl = \"<?php echo Mage::getBaseUrl() . 'lb/index/logout' ?>\";\n jQuery.post(postUrl, function(response) {\n if(response.status == '1'){\n window.location.reload();\n }\n else{\n jQuery(\"lbMsg\").html(response.message).addClass( \"frm_error\" );\n }\n },'JSON');\n });\n // end of logout\n //end of javascript code\n <?php if(strpos($_SERVER['REQUEST_URI'], '/checkout/cart/') !== false){?>\n jQuery(\".connectlbbtn\").parent().addClass('cart-forms');\n <?php }else{?>\n var regBox = jQuery(\".connectlbbtn\");\n jQuery(\".add-to-cart\").append(regBox);\n jQuery(\".add-to-cart\").css(\"clear\",\"both\");\n <?php }?>\n </script>\n <?php \n }", "private function show_connect_button() {\n\t\t?>\n\t\t<div class=\"text-center wp-core-ui rank-math-ui\" style=\"margin-top: 30px;\">\n\t\t\t<button type=\"submit\" class=\"button button-primary button-animated\" name=\"rank_math_activate\"><?php echo esc_attr__( 'Connect Your Account', 'rank-math' ); ?></button>\n\t\t</div>\n\t\t<?php\n\t}", "public function displayGoogleRegisterLink()\n {\n if ($this->use_google_login === true) {\n $client = $this->newGoogleClient($this->getGoogleOptions());\n $auth_url = $client->createAuthUrl();\n \n if (isset($auth_url)) {\n echo '<p class=\"google-register oauth-login\"><a href=\"'.$auth_url.'\">'.__('Register with Google', 'okv-oauth').'</a></p>';\n }\n \n if (isset($_REQUEST['error'])) {\n $this->googleRegisterError($_REQUEST['error'], true);\n return false;\n }\n \n if (isset($_COOKIE['google_access_token']) && !empty($_COOKIE['google_access_token'])) {\n $check_user_result = $this->googleRegisterCheckUser();\n if ($check_user_result === false) {\n return false;\n } elseif (is_array($check_user_result)) {\n // check user passed. now it is ready to prepare register form.\n echo '<script>'.\"\\n\";\n echo 'var okvoauth_google_register_got_code = true;'.\"\\n\";\n echo 'var okvoauth_google_wp_user_login = \\''.(isset($check_user_result['wp_user_login']) ? $check_user_result['wp_user_login'] : '').'\\';'.\"\\n\";\n echo 'var okvoauth_google_wp_user_email = \\''.(isset($check_user_result['wp_user_email']) ? $check_user_result['wp_user_email'] : '').'\\';'.\"\\n\";\n echo 'var okvoauth_google_wp_user_avatar = \\''.(isset($check_user_result['wp_user_avatar']) ? $check_user_result['wp_user_avatar'] : '').'\\';'.\"\\n\";\n echo '</script>'.\"\\n\";\n }\n unset($check_user_result);\n }\n \n unset($auth_url, $client);\n return true;\n } else {\n return false;\n }\n }", "function dp_signup_button() { \n\tif(!is_user_logged_in() && get_option('users_can_register') && get_option('dp_header_signup')) {\n\t\techo '<a class=\"btn btn-green btn-signup\" href=\"'.site_url('wp-login.php?action=register', 'login').'\">'.__('Sign up', 'dp').'</a>';\n\t}\n\t\n\treturn;\n}", "public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'Bilder-DB';\n $view->heading = 'Registration';\n $view->display();\n }", "public static function my_account_links_newButton()\n {\n //let other method do all the checks and stuff\n return self::geoCart_cartDisplay_newButton(true);\n }", "public function display_account_register( ){\n\t\tif( $this->is_page_visible( \"register\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_register.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_register.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_register.php' );\n\t\t}\n\t}", "public function showRegistrationForm()\n {\n return view('skins.' . config('pilot.SITE_SKIN') . '.auth.register');\n }", "public function RegistrationUnderApproval() {\n $this->Render();\n }", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "function show_register_message_on_login()\n {\n echo '<div>Si no tienes cuenta <a href=\"'.get_permalink(ConstantBD::BD_POST_SIGNUP).'\">registrate</a> en un solo paso. </div>';\n }", "public function gluu_sso_form()\n {\n // add taskbar button\n\n $boxTitle = html::div(array('id' => \"prefs-title\", 'class' => 'boxtitle'), $this->gettext('hederGluu'));\n $this->include_stylesheet('GluuOxd_Openid/css/gluu-oxd-css.css');\n $this->include_script('GluuOxd_Openid/js/scope-custom-script.js');\n\n $tableHtml=$this->admin_html();\n unset($_SESSION['message_error']);\n unset($_SESSION['message_success']);\n return html::div(array('class' => ''),$boxTitle . html::div(array('class' => \"boxcontent\"), $tableHtml ));\n }", "public function signup(){\n \n $this->data[\"title_tag\"]=\"Lobster | Accounts | Signup\";\n \n $this->view(\"accounts/signup\",$this->data);\n }", "public function regNewCommercialUser()\n {\n $this->view('Registration/commercial_user_registration');\n }", "function display() {\n\n\t\t$model = $this->getModel('provider');\n\n\t\t$usersConfig = &JComponentHelper::getParams( 'com_users' );\n\t\tif (!$usersConfig->get( 'allowUserRegistration' )) {\n\t\t\tJError::raiseError( 403, JText::_( 'Access Forbidden' ));\n\t\t\treturn;\n\t\t}\n\n\t\t$user \t=& JFactory::getUser();\n\n\t\tif ( $user->get('guest')) {\n\t\t\tJRequest::setVar('view', 'provider_request');\n\t\t} else {\n\t\t\t$this->setredirect('index.php?option=com_users&task=edit',JText::_('You are already registered.'));\n\t\t}\n\n\n if( !JRequest::getVar( 'view' )) {\n\t\t JRequest::setVar('view', 'provider_request' );\n }\n\n\t\t$view = $this->getView( 'provider_request', 'html' );\n\t\t$view->setModel( $this->getModel( 'provider', 'providerModel' ), true );\n\t\t$view->display();\n\t\t//parent::display();\n\t}", "public function activationAction()\n {\n View::renderBlade('register/activation');\n }", "function show_add_button(){\n if($this->session->system_admin){\n return true;\n }\n \n }", "function DisplayLoginPopup()\n\t{\n\t\t$this->LoadPage('generic_popup');\n\t\t$this->Page->SetName(\"Login\");\n\t\t$this->Page->AddObject('UserLogin', COLUMN_ONE, HTML_CONTEXT_POPUP);\n\t\treturn TRUE;\n\t}", "public function register_show_2()\n {\n return view('fontend.user.verify');\n }", "public function auth_modal()\n\t{\n get_template_part('bbpress/auth-modal'); \n\t}", "public function partner_registration() {\n $logged_in_user_details = $this->session->userdata('logged_in_user_data');\n if ($logged_in_user_details->is_logged_in == 1) {\n $data['title'] = \"Zinguplife Customer Support|Partner Registration\";\n $data['logged_in_user_details'] = $logged_in_user_details;\n $data['url'] = 'customer_support/vendors';\n $data['services'] = $this->Cs_vendor->get_business_services();\n $data['main_content'] = 'admin/cs/partner_registration';\n $data['locations'] = $this->Cs_vendor->get_locations();\n $this->load->view('admin/includes/template', $data);\n } else {\n $this->session->set_flashdata('login_required_message', 'Please login to continue !!!.');\n redirect(\"/admin\");\n }\n }", "public function register() {\n\t\t$result = $this->Member_Model->get_max_id();\n\t\t$current_next_id = $result + 1;\n\n\t\t$this->breadcrumbs->set(['Register' => 'members/register']);\n\t\t$data['api_reg_url'] = base64_encode(FINGERPRINT_API_URL . \"?action=register&member_id=$current_next_id\");\n\n\t\tif ($this->session->userdata('current_finger_data')) {\n\t\t\t$this->session->unset_userdata('current_finger_data');\n\t\t}\n\n\t\t$this->render('register', $data);\n\t}", "public function AddCheckboxToBpRegistrationPage()\n\t{\n\t\t$bp_checked = get_option($this->GrOptionDbPrefix . 'bp_registration_checked');\n\t\t?>\n\t\t<div class=\"gr_bp_register_checkbox\">\n\t\t\t<label>\n\t\t\t\t<input class=\"input-checkbox GR_bpbox\" value=\"1\" id=\"gr_bp_checkbox\" type=\"checkbox\"\n\t\t\t\t name=\"gr_bp_checkbox\" <?php if ($bp_checked)\n\t\t\t\t{ ?> checked=\"checked\"<?php } ?> />\n\t\t\t\t<span\n\t\t\t\t\tclass=\"gr_bp_register_label\"><?php echo get_option($this->GrOptionDbPrefix . 'bp_registration_label'); ?></span>\n\t\t\t</label>\n\t\t</div>\n\t\t<?php\n\t}", "function NeedToRegister(){\n \t$HTML = '';\n\n \t$HTML .= _JNEWS_REGISTER_REQUIRED . '<br />';\n\n\t\t $text = _NO_ACCOUNT.\" \";\n\t\t if ( isset( $GLOBALS[JNEWS.'cb_integration'] ) && $GLOBALS[JNEWS.'cb_integration'] ) {\n\t\t\t $linkme = 'option=com_comprofiler&task=registers';\n\t\t } else {\n\t\t \tif( version_compare(JVERSION,'1.6.0','>=') ){ //j16\n\t\t \t\t$linkme = 'option=com_users&view=registration';\n\t\t \t} else {\n\t\t \t\t$linkme = 'option=com_user&task=register';\n\t\t \t}\n\t\t }\n\n\t\t $linkme = jNews_Tools::completeLink($linkme,false);\n\n\t\t $text .= '<a href=\"'. $linkme.'\">';\n\t\t $text .= _CREATE_ACCOUNT.\"</a>\";\n\t\t $HTML .= jnews::printLine( $this->linear, $text );\n\n \treturn $HTML;\n }", "public function logInRegisterPage();", "public function showSignUpForm() {\n if(!config('springintoaction.signup.allow')) {\n return view('springintoaction::frontend.signup_closed');\n }\n\n return view('springintoaction::frontend.signup');\n }", "public function course_bank_conncheck() {\n global $CFG;\n\n $html = $this->box_start();\n $html .= $this->heading(\n get_string('connchecktitle', 'tool_coursebank'),\n 3\n );\n // Hide the button, and then show it with js if it is enabled.\n $html .= html_writer::start_tag('div',\n array('class' => 'conncheckbutton-div hide')\n );\n $buttonattr = array(\n 'id' => 'conncheck',\n 'type' => 'button',\n 'class' => 'conncheckbutton',\n 'value' => get_string('conncheckbutton', 'tool_coursebank')\n );\n $html .= html_writer::tag('input', '', $buttonattr);\n $html .= html_writer::end_tag('div');\n\n // Display ordinary link, and hide it with js if it is enabled.\n $html .= html_writer::start_tag('div',\n array('class' => 'conncheckurl-div')\n );\n $nonjsparams = array('action' => 'conncheck');\n $nonjsurl = new moodle_url(\n $CFG->wwwroot.'/admin/tool/coursebank/check_connection.php',\n $nonjsparams\n );\n $html .= html_writer::link(\n $nonjsurl,\n get_string('conncheckbutton', 'tool_coursebank'),\n array('class' => 'conncheckurl')\n );\n $html .= html_writer::end_tag('div');\n\n $html .= html_writer::start_tag('div',\n array('class' => 'check-div hide'));\n $imgattr = array(\n 'class' => 'hide',\n 'src' => $CFG->wwwroot.'/pix/i/loading_small.gif',\n 'alt' => get_string('checking', 'tool_coursebank')\n );\n\n $html .= html_writer::empty_tag('img', $imgattr);\n $inputattr = array(\n 'type' => 'hidden',\n 'name' => 'wwwroot',\n 'value' => $CFG->wwwroot,\n 'class' => 'wwwroot'\n );\n $html .= html_writer::tag('input', '', $inputattr);\n $html .= html_writer::end_tag('div');\n\n // Success notification.\n $urltarget = isset($this->get_config()->url) ? $this->get_config()->url : null;\n $html .= $this->course_bank_check_notification(\n 'conncheck',\n 'success',\n get_string('connchecksuccess', 'tool_coursebank', $urltarget)\n );\n\n // Failure notification.\n $html .= $this->course_bank_check_notification(\n 'conncheck',\n 'fail',\n get_string('conncheckfail', 'tool_coursebank', $urltarget)\n );\n\n $html .= $this->box_end();\n\n return $html;\n }", "function _renren_login_form() {\n global $RR_config, $user;\n //$backurl = url('user', array('absolute' => true));\n $xd_receiver = url(\"user/renren_receiver\", array('absolute' => true));\n return\n '<xn:login-button autologoutlink=\"true\"></xn:login-button>\n <script type=\"text/javascript\" src=\"http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp\"></script>\n <script type=\"text/javascript\">\n XN_RequireFeatures([\"EXNML\"], function()\n {\n XN.Main.init(\"'.$RR_config->APIKey.'\", \"'.$xd_receiver.'\");\n });\n </script>';\n}", "public function showRegistrationForm()\n {\n return redirect()->route('frontend.account.register');\n //return theme_view('account.register');\n }", "public function signup() {\n $this->template->content = View::instance(\"v_users_signup\");\n \n # Render the view\n echo $this->template;\n }", "public function checkaccount()\n {\n $this->data['lang'] = $this->language;\n $apiKey = preg_replace('/[^[:alnum:]]/i', '', $this->request->get['apikey']);\n $this->data['onego_jssdk_url'] = OneGoConfig::get('jsSdkURI').'?apikey='.$apiKey;\n $this->template = 'total/onego_status_jssdk.tpl';\n $this->response->setOutput($this->render());\n }", "public function showRegistrationForm()\n {\n $askForAccount = false;\n return view('client.auth.register',compact(\"askForAccount\"));\n }", "function login_form_register()\n {\n }", "public function loginButtonAction()\n {\n $user = $this->user();\n\n if ($this->get('security.context')->isGranted('ROLE_USER')) {\n return $this->render(\n 'FoodUserBundle:Default:profile_button.html.twig',\n array('user' => $user)\n );\n }\n\n return $this->render('FoodUserBundle:Default:login_button.html.twig');\n }", "public function SetPanelSettings()\n\t{\n\t\tif(gzte11(ISC_LARGEPRINT) && GetConfig('EnableGiftCertificates') != 0) {\n\t\t\t$GLOBALS['SNIPPETS']['TopMenuGiftCertificates'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"TopMenuGiftCertificates\");\n\t\t}\n\t\t// Show the login/logout link as required\n\n\t\t$GLOBALS['HideLogoutLink'] = 'display: none';\n\t\t\n\t\tif(!isset($GLOBALS['LoginOrLogoutText'])) {\n\n\t\t\tif(CustomerIsSignedIn()) {\n\t\t\t\t$usuarioLogado = true;\n\t\t\t\t// If they're a customer, set their name so it's available in the templates\n\t\t\t\t$c = GetClass('ISC_CUSTOMER');\n\t\t\t\t$customerData = $c->GetCustomerDataByToken();\n\t\t\t\t$GLOBALS['CurrentCustomerFirstName'] = isc_html_escape(ucwords(strtolower($customerData['custconfirstname'])));\n\t\t\t\t$GLOBALS['CurrentCustomerLastName'] = isc_html_escape(ucwords(strtolower($customerData['custconlastname'])));\n\t\t\t\t$GLOBALS['CurrentCustomerEmail'] = isc_html_escape(strtolower($customerData['custconemail']));\n\n\t\t\t\t$GLOBALS['LoginOrLogoutLink'] = \"login.php?action=logout\";\n\t\t\t\t//$GLOBALS['LoginOrLogoutText'] = sprintf(GetLang('LogoutLink'), $GLOBALS['ShopPathNormal']);\n\t\t\t\t$GLOBALS['LoginOrLogoutText'] = 'Ol&aacute; <b>'.$GLOBALS['CurrentCustomerFirstName'].'!</b> </a>\n\t\t\t\t\t\t ( <a href=\"'.$GLOBALS['ShopPathNormal'].'/account.php\">Meus Dados</a>\n\t\t\t\t\t\t <a href=\"'.$GLOBALS['ShopPathNormal'].'/account.php?action=order_status\">Meus Pedidos</a>\n\t\t\t\t\t\t <a href=\"'.$GLOBALS['ShopPathNormal'].'/login.php?action=logout\">Sair</a> )';\n\t\t\t\t\n\t\t\t\t$GLOBALS['HideLogoutLink'] = '';\n\t\t\t}else{\n\t\t\t\t$usuarioLogado = false;\n\t\t\t\t$loginLinkFunction = '';\n\t\t\t\t$createAccountLinkFunction = '';\n\t\t\t\t$GLOBALS['OptimizerLinkScript'] = $this -> insertOptimizerLinkScript();\n\t\t\t\tif($GLOBALS['OptimizerLinkScript'] != '') {\n\t\t\t\t\t$loginLinkFunction = \"gwoTracker._link(\\\"\".$GLOBALS['ShopPathSSL'].\"/login.php?tk=\".session_id().\"\\\"); return false;\";\n\t\t\t\t\t$createAccountLinkFunction = \"gwoTracker._link(\\\"\".$GLOBALS['ShopPathSSL'].\"/login.php?action=create_account&tk=\".session_id().\"\\\"); return false;\";\n\n\t\t\t\t}\n\t\t\t\t// If they're a guest, set their name to 'Guest'\n\t\t\t\t$GLOBALS['CurrentCustomerFirstName'] = GetLang('Guest');\n\t\t\t\t$GLOBALS['CurrentCustomerLastName'] = $GLOBALS['CurrentCustomerEmail'] = '';\n\n\t\t\t\t$GLOBALS['LoginOrLogoutLink'] = \"login.php\";\n\t\t\t\t$GLOBALS['LoginOrLogoutText'] = sprintf(GetLang('SignInOrCreateAccount'), $GLOBALS['ShopPath'], $loginLinkFunction, $GLOBALS['ShopPath'], $createAccountLinkFunction);\n\t\t\t}\n\t\t}else{\n\t\t\t$usuarioLogado = false;\n\t\t}\n\t\t\n\t\t/* EDAZCOMMERCE - CRIAR OS CAMPOS DE LOGIN NO HEADER POR AQUI, PARA NÃO ENTRAR EM CONFLITO COM O LOGIN DO CHECKOUT */\n\t\t$GLOBALS['FieldsLoginHeader'] = '<input type=\"text\" class=\"InputTexto InitialFocus\" name=\"login_email\" id=\"login_email\" size=\"35\" />\n\t\t\t\t\t\t<input type=\"password\" class=\"InputTexto\" name=\"login_pass\" id=\"login_pass\" />\n\t\t\t\t\t\t<input type=\"submit\" id=\"id=\"LoginButton\"\" value=\"Entrar\" />';\n\t\t\n\t\t/* EDAZCOMMERCE - USUÁRIO DESLOGADO DO SISTEMA */\n\t\t$GLOBALS['UsuarioLogado'] = $usuarioLogado;\n\t\tif($usuarioLogado){\n\t\t\t$GLOBALS['DisplayLoginHome'] \t\t= \"displayNone\";\n\t\t\t$GLOBALS['ClassWelcomeMessageUser'] = \"width600\";\n\t\t}else{\n\t\t\t/* DESABILITA OS CAMPOS PARA LOGIN NO HEADER QUANDO ESTIVER NO CHECKOUT */\n\t\t\tif(!isset($GLOBALS['PanelLoginJavaScript']) || (isset($GLOBALS['PanelLoginJavaScript']) && $GLOBALS['PanelLoginJavaScript'] != 'desabilitadoCheckout')){\n\t\t\t\t$GLOBALS['PanelLoginJavaScript'] = \"%%Panel.LoginJavaScript%%\";\n\t\t\t}\n\t\t}\n\t\tif($GLOBALS['PanelLoginJavaScript'] == 'desabilitadoCheckout'){\n\t\t\t$GLOBALS['FieldsLoginHeader']\t = \"\";\n\t\t\t$GLOBALS['PanelLoginJavaScript'] = \"\";\n\t\t}\n\n\t\t// Display our currency flags. Has been disabled for the time being. Theory being that this will include the whole locale (text aswell)\n\t\t$GLOBALS['CurrencyFlags'] = \"\";\n\t}", "public function accountAction()\n {\n \tif(!in_array($this->_user->{User::COLUMN_STATUS}, array(User::STATUS_BANNED, User::STATUS_PENDING, User::STATUS_GUEST))){\n \t\t$this->_forward('homepage');\n \t\treturn;\n \t}\n \t$this->view->registerForm = new User_Form_Register();\n \t$this->view->loginForm = new User_Form_Login();\n }", "public function _register_step_2()\n {\n $this->render('_register_step_2');\n }", "public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }", "public function AddCheckboxToRegistrationForm()\n\t{\n\t\tif ( ! is_user_logged_in())\n\t\t{\n\t\t\t$checked = get_option($this->GrOptionDbPrefix . 'registration_checked');\n\t\t\t?>\n\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t<input class=\"input-checkbox GR_registrationbox\" value=\"1\" id=\"gr_registration_checkbox\" type=\"checkbox\"\n\t\t\t\t name=\"gr_registration_checkbox\" <?php if ($checked)\n\t\t\t\t { ?>checked=\"checked\"<?php } ?> />\n\t\t\t\t<label for=\"gr_registration_checkbox\" class=\"checkbox\">\n\t\t\t\t\t<?php echo get_option($this->GrOptionDbPrefix . 'registration_label'); ?>\n\t\t\t\t</label>\n\t\t\t</p><br/>\n\t\t\t<?php\n\t\t}\n\t}", "function index()\n {\n // Check if there errors from the forms, and display them.\n $this->registry->template->loginSend = Util::checkExcistInSession($this->loginError);\n $this->registry->template->registerSend = Util::checkExcistInSession($this->registerError);\n\n // If the user is loggedIn show the logout button\n if ($this->registry->userAccount->isLogedIn()) {\n $this->registry->template->show('account-loggedin');\n } else {\n $this->registry->template->show('account');\n }\n }", "public function formRegistrazionePrivato() {\n $this->smarty->display('reg_privato.tpl');\n }", "function addLogin(){\n\t\tif(!$this->data['Registration']['number'] && !$this->data['Registrator']['email']) {\n\t\t\t// First time visiting the site, do nothing and just display the view\n\t\t\t$this->Session->write('errors.noInput', 'Fyll i <strong>bokningsnummer</strong> och <strong>email</strong>');\n\t\t} else { \n\t\t\t// Sanitize the input data\n\t\t\tif($this->data['Registration']['number']) {\n\t\t\t\t$number = Sanitize::clean($this->data['Registration']['number']);\n\t\t\t} else {\n\t\t\t\t$this->Session->write('errors.noNumber', 'Du har glömt fylla i <strong>bokningsnummer</strong>');\n\t\t\t\t$number = false;\n\t\t\t}\n\t\t\tif ($this->data['Registrator']['email']){\n\t\t\t\t$email = Sanitize::clean($this->data['Registrator']['email']);\n\t\t\t} else {\n\t\t\t\t$this->Session->write('errors.noEmail', 'Du har glömt fylla i <strong>email</strong>');\n\t\t\t\t$email = false;\n\t\t\t}\n\t\t\tif ($number && $email){\n\t\t\t\t$number = strtoupper($number);\n\t\t\t\t// Get an array from the database with all the info on the registration\n\t\t\t\tif($registration = $this->Registration->findByNumber($number)){\n\t\t\t\t\t$event = $registration['Event'];\n\t\t\t\t\tunset($registration['Event']);\n\t\t\t\t\tunset($registration['Invoice']);\n\t\t\t\t\t$this->Session->write('Event', $event);\n\t\t\t\t\t// Checks the array from the database and tries to match the email with the form//\n\t\t\t\t\t$email = $this->data['Registrator']['email'];\n\t\t\t\t\tif($registration['Registrator']['email'] == $email){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->Session->write('loggedIn', true);\n\t\t\t\t\t\t$this->Registration->putRegistrationInSession($registration, $this->Session);\n\t\t\t\t\t\t$this->setPreviousStepsToPrevious('Registrations','review');\n\t\t\t\t\t\t$this->requestAction('steps/redirectToNextUnfinishedStep');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//the user has put in wrong values in the field 'email'\n\t\t\t\t\t\t$this->Session->write('errors.unvalidEmail', 'Är du säker på att skrev rätt <strong>email?</strong>');\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\t//the user has put in wrong values in at least the 'booking number' field\n\t\t\t\t\t$this->Session->write('errors.noBookingnr', 'Är du säker på att du skrev rätt <strong>bokningsnummer?</strong>');\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->redirect(array('controller' => 'registrations', 'action' => 'login'));\t\t\n\t}", "public function display_account_login( ){\n\t\tif( $this->is_page_visible( \"login\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_login.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_login.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_login.php' );\n\t\t}\n\t}", "function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show the home page instead (unless we just completed registering an account) */\n if ($this->Model_Account->amILoggedIn()) {\n if (!array_key_exists( 'registerMsg', $_SESSION )) {\n redirect( \"mainpage/index\", \"refresh\" );\n }\n }\n\n/* ... define values for template variables to display on page */\n $data['title'] = \"Account Registration - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"register\";\n\n/* ... complete our flow as we would for a normal page */\n $this->index( $data );\n\n/* ... time to go */\n return;\n }", "public function getShowLoginPage()\n {\n echo $this->blade->render(\"login\", [\n 'signer' => $this->signer,\n ]);\n }", "public function showRegistrationForm()\n {\n //Custom code here\n return view('auth.register')->with('packages', Package::all()->where('status', 1));\n }", "public function register()\n\t{\n\t\tif ($this->session->userdata('isValid') == 0) {\n\t\t\t$this->load->view('v_register');\n\t\t}\n\n\t\t// Jika user masuk dari link baru, memastikan isi data session kosong dengan men-destroy data session\n\t\telse\n\t\t{\n\t\t\t$this->session->sess_destroy();\n\t\t\t$this->load->view('v_register');\n\t\t}\n\t}", "public function showForm()\n {\n return view('auth.register-step2');\n }", "function execute() {\n\t global $oscTemplate, $cart, $navigation, $messageStack, $breadcrumb, $session_started, $customer_id, $customer_first_name, $customer_default_address_id, $customer_country_id, $customer_zone_id, $password, $confirm,$customer_picture, $language;\n define('DIR_WS_INCLUDES', 'includes/');\n define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');\n define('FILENAME_CREATE_ACCOUNT', 'create_account.php');\n require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);\n \n/**\n * Function that adding a new column in the customer table.\n */ \n function add_column_if_not_exist($dbtable, $column, $column_attr = \"varchar( 255 ) NULL\" ) {\n $exists = false;\n $columns = mysql_query(\"show columns from $dbtable\");\n while ($c = mysql_fetch_assoc($columns)) {\n if($c['Field'] == $column) {\n $exists = true;\n break;\n }\n } \n if (!$exists) {\n mysql_query(\"ALTER TABLE `$dbtable` ADD `$column` $column_attr\");\n }\n }\n\t \n/**\n * Function that remove tmp data of user.\n */\n\t function remove_tmpuser($lrdata) {\n tep_db_query(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key = '\".$lrdata['session'].\"'\");\n }\n\n/**\n * Function that remove tmp data of user.\n */\n function sociallogin_popup($msg, $lrdata) {?>\n\t\t<style type=\"text/css\">\n\t\t.LoginRadius_overlay {background: none no-repeat scroll 0 0 rgba(127, 127, 127, 0.6);position: absolute;top: 0;left: 0;z-index: 100001;width: 100%;height: 100%;overflow: auto;padding: 220px 20px 20px 20px;padding-bottom: 130px;position: fixed;}\n\t\t#popupouter {-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;overflow:auto;background:#f3f3f3;padding:0px 0px 0px 0px;width:370px;margin:0 auto;}\n\t\t#popupinner {-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;overflow:auto;background:#ffffff;margin:10px;padding:10px 8px 4px 8px;}\n\t\t#textmatter {margin:10px 0px 10px 0px;font-family:Arial, Helvetica, sans-serif;color:#666666;font-size:14px;}\n\t\t.inputtxt {font-family:Arial, Helvetica, sans-serif;color:#a8a8a8;font-size:11px;border:#e5e5e5 1px solid;width:280px;height:27px;margin:5px 0px 15px 0px;}\n\t\t.inputbutton {border:#dcdcdc 1px solid;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;text-decoration:none;\n\t\tcolor:#6e6e6e;font-family:Arial, Helvetica, sans-serif;font-size:13px;cursor:pointer;background:#f3f3f3;padding:6px 7px 6px 8px;\n\t\tmargin:0px 8px 0px 0px;}\n\t\t.inputbutton:hover {border:#00ccff 1px solid;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;khtml-border-radius:2px;text-decoration:none;color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:13px;cursor:pointer;padding:6px 7px 6px 8px;-moz-box-shadow: 0px 0px 4px #8a8a8a;-webkit-box-shadow: 0px 0px 4px #8a8a8a;box-shadow: 0px 0px 4px #8a8a8a;background:#f3f3f3;margin:0px 8px 0px 0px;}\n\t\t#textdiv {text-align:right;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;}\n\t\t.span {font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#00ccff;}\n\t\t.span1 {font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#333333;}\n\t\t<!--[if IE]>\n\t\t.LoginRadius_content_IE {\n\t\tbackground:black;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)\";filter: alpha(opacity=90);}\n\t\t<![endif]-->\n\t\t</style>\n<?php\n $output = '<div class=\"LoginRadius_overlay\" class=\"LoginRadius_content_IE\"><div id=\"popupouter\">\n <div id=\"popupinner\">\n <div id=\"textmatter\">';\n if ($msg) {\n $output .= \"<b>\" . $msg . \"</b>\";\n }\n $output .= '</div>\n <form method=\"post\" action=\"\">\n <div><input type=\"text\" name=\"email\" id=\"email\" class=\"inputtxt\"/></div><div>\n <input type=\"submit\" id=\"LoginRadiusEmailClick\" name=\"LoginRadiusEmailClick\" value=\"Submit\" class=\"inputbutton\">\n <input type=\"submit\" value=\"Cancel\" class=\"inputbutton\" name = \"cancel\"/>\n\t <input type=\"hidden\" value=\"'.$lrdata['session'].'\" name=\"session\" />';\n $output .= '</div></form></div></div></div>';\n return $output;\n }\n \n// Creating columns in customer table.\n $dbtable = 'customers';\n $column = 'loginradiusid';\n\t $columnPicture = 'customer_social_avatar';\n add_column_if_not_exist($dbtable, $column, $column_attr = \"varchar( 255 ) NULL\" );\n\t add_column_if_not_exist($dbtable, $columnPicture, $column_attr = \"varchar( 255 ) NULL\" );\n\n// Getting api key.\n $apikey_query = tep_db_query(\"select configuration_value from \" . TABLE_CONFIGURATION . \" where configuration_key = 'MODULE_BOXES_LOGINRADIUS_API_KEY'\");\n $apikey_array = tep_db_fetch_array($apikey_query);\n $apikey = trim($apikey_array['configuration_value']);\n\n// Getting api secret.\n $apisecretkey_query = tep_db_query(\"select configuration_value from \" . TABLE_CONFIGURATION . \" where configuration_key = 'MODULE_BOXES_LOGINRADIUS_API_SECRET_KEY'\");\n $apisecretkey_array = tep_db_fetch_array($apisecretkey_query);\n $apisecretkey = trim($apisecretkey_array['configuration_value']);\n\n// Getting api email required.\n $emailrequired_query = tep_db_query(\"select configuration_value from \" . TABLE_CONFIGURATION . \" where configuration_key = 'MODULE_BOXES_LOGINRADIUS_EMAIL_REQUIRED'\");\n $emailrequired_array = tep_db_fetch_array($emailrequired_query);\n $emailrequired = $emailrequired_array['configuration_value'];\n\n// Checking apikey and show interface.\n if(tep_session_is_registered('customer_id')) {\n\t $data = '<div class=\"ui-widget infoBoxContainer\">' .\n ' <div class=\"ui-widget-header infoBoxHeading\">' . MODULE_BOXES_LOGINRADIUS_BOX_TITLE . '</div>' .\n ' <div class=\"ui-widget-content infoBoxContents\">' . '<div align =\"center\">';\n\t\t\t\t if (!empty($customer_picture)) {\n\t\t\t\t $data .= '<img src = \"'.$customer_picture.'\" height =\"90\" width = \"90\" style =\"border:3px solid #e7e7e7;\"><br>';\n\t\t\t\t }\n\t\t\t\t \t \n\t\t\t\t $data .='<b> Hi! '.$customer_first_name.'</b></div></div>' .'</div>';\t\n }\n\t\telseif(empty($apikey) && empty($apisecretkey)){\n\t\t\t$data = '<div class=\"ui-widget infoBoxContainer\">' .\n ' <div class=\"ui-widget-header infoBoxHeading\">' . MODULE_BOXES_LOGINRADIUS_BOX_TITLE . '</div>' .\n ' <div class=\"ui-widget-content infoBoxContents\"><p style =\"color:red;\">To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web: <b><a href =\"http://www.loginradius.com\" target = \"_blank\">www.LoginRadius.com</a></b></p></div></div>';\n\t\t}\n\t\telseif(!empty($apikey) && preg_match('/^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/i', $apikey) && !empty($apisecretkey) && preg_match('/^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/i', $apisecretkey)){\n\t\t $data = '<div class=\"ui-widget infoBoxContainer\">' .\n ' <div class=\"ui-widget-header infoBoxHeading\">' . MODULE_BOXES_LOGINRADIUS_BOX_TITLE . '</div>' .\n ' <div class=\"ui-widget-content infoBoxContents\"><div id=\"interfacecontainerdiv\" class=\"interfacecontainerdiv\"></div></div></div>';\t\t\t\t\n }\n\t\telse{\n\t\t\t$data = '<div class=\"ui-widget infoBoxContainer\">' .\n ' <div class=\"ui-widget-header infoBoxHeading\">' . MODULE_BOXES_LOGINRADIUS_BOX_TITLE . '</div>' .\n ' <div class=\"ui-widget-content infoBoxContents\"><p style =\"color:red;\">Your LoginRadius API key and secret is not valid, please correct it or contact LoginRadius support at <b><a href =\"http://www.loginradius.com\" target = \"_blank\">www.LoginRadius.com</a></b></p></div></div>';\n\t\t}\n \n\t \n// Starting loginradius login process.\n $lrdata = array();\n $obj = new LoginRadius();\n $userprofile = $obj->loginradius_get_data($apisecretkey);\n \n if ($obj->IsAuthenticated == true) {\n \n $process = true;\n $lrdata = $this->sociallogin_getuser_data($userprofile);\n $error = false;\n\ttep_db_query(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_title = 'Store tmp data'\");\n\tif (!empty($lrdata['Email']) OR (empty($lrdata['Email']) && $emailrequired != 'True')) {\n if (empty($lrdata['Email']) && $emailrequired != 'True') {\n $lrdata['Email'] = $this->sociallogin_get_randomEmail($lrdata);\n }\n\t $check_customer = $this->sociallogin_get_existUser($lrdata);\n\t if (!empty($check_customer) && $check_customer > 0) {\n $this->sociallogin_logging_existUser($check_customer);\n }\n\t else {\n\t $this->sociallogin_add_newUser($lrdata);\n\t }\n }\n if (empty($lrdata['Email']) && $emailrequired == 'True') {\n $check_customer = $this->sociallogin_get_existUser($lrdata);\n if (!empty($check_customer) && $check_customer > 0) {\n $this->sociallogin_logging_existUser($check_customer);\n }\n else {\n\t foreach($lrdata as $key => $value)\n\t {\n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description) values ('Store tmp data', '\".$lrdata['session'].\"', '\".mysql_real_escape_string($value).\"', '\".mysql_real_escape_string($key).\"')\");\n\t }\n\t\t$msg = \"Please enter email to proceed.\";\n print sociallogin_popup($msg, $lrdata);\n } \n }\n }\n if (isset($_POST['LoginRadiusEmailClick']) && !empty($_POST['session'])) {\n $lrdata['session'] = $_POST['session'];\n if (tep_validate_email($_POST['email']) != true) {\n $msg = \"<p style='color:red;'><b>This email already registered or invalid. Please choose another one.</b></p>\";\n print sociallogin_popup($msg ,$lrdata);\n }\n\t else {\n\t $check_existEmail = tep_db_query(\"select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from \" . TABLE_CUSTOMERS . \" where customers_email_address = '\" . mysql_real_escape_string($_POST['email']) . \"'\");\n $check_customer = tep_db_fetch_array($check_existEmail);\n\t if($check_customer > 0) {\n\t\t $msg = \"<p style='color:red;'><b>This email already registered or invalid. Please choose another one.</b></p>\";\n print sociallogin_popup($msg ,$lrdata);\n\t\t }\n else {\n\t\t\t $query = tep_db_query(\"select configuration_title, configuration_key, configuration_value, configuration_description from \" . TABLE_CONFIGURATION . \" where configuration_key = '\" . mysql_real_escape_string($_POST['session']) . \"'\");\n\t\t\t while($tmp_data = tep_db_fetch_array($query)) {\n\t\t\t\t$key = $tmp_data['configuration_description'];\n\t\t\t\t$value = $tmp_data['configuration_value'];\n\t\t\t\t$lrdata[$key] = $value;\n\t }\n $lrdata['Email'] = mysql_real_escape_string($_POST['email']);\n\t\t\t $this->sociallogin_add_newUser($lrdata);\n\t }\n }\n }\n else if (isset($_POST['cancel'])) {\n remove_tmpuser($lrdata);\n\t define('FILENAME_DEFAULT', 'index.php');\n tep_redirect(tep_href_link(FILENAME_DEFAULT));\n }\n if ($messageStack->size('create_account') > 0) {\n echo $messageStack->output('create_account');\n }\n $oscTemplate->addBlock($data, $this->group);\n }", "function account_panel()\n {\n // Tai cac file thanh phan\n $this->load->helper('user');\n $this->load->model('user_model');\n\n // Bien luu thong tin user da dang nhap hay chua\n $is_login = user_is_login();\n $this->data['is_login'] = $is_login;\n\n // Tao cac lien ket\n $user = user_get_account_info();\n $user = user_add_info($user);\n $user = site_create_url('account', $user);\n $user = UserFactory::auth()->user($user);\n // Luu cac bien gui den view\n $this->data['user'] = $user;\n $this->data['action_login'] = site_url('user/login') . '?fast=true';\n\n // Hien thi view\n $this->load->view('tpl::_widget/user/panel', $this->data);\n }", "public function add_to_register_form() {\n\t\t$this->recaptcha->show_recaptcha( array( 'action' => ITSEC_Recaptcha::A_REGISTER ) );\n\t}", "public function registerAction()\n {\n $storeViewId = Mage::app()->getRequest()->getParam('store_view_id');\n\n if ($storeViewId && !$this->_isStoreViewAlreadyRegisterdToConnection($storeViewId)) {\n $redirect = $this->_buildShopgateOAuthUrl($storeViewId);\n } else {\n $redirect = $this->getUrl('*/*/connect');\n }\n\n $this->getResponse()->setRedirect($redirect);\n $this->getResponse()->sendResponse();\n }", "public function registerCourseClick ()\n {\n $objCourse = new Course();\n $result = $objCourse->fetchCoursename();\n if (! empty($result)) {\n $this->showSubViews(\"registerCourse\", $result);\n } else {\n $message = \"You cannnot register<br> No courses exist yet\";\n $this->setCustomMessage(\"ErrorMessage\", $message);\n }\n }", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "function showLoginForm() {\n}", "function googleaccount_wp_login_form() {\n\techo '<input type=\"hidden\" name=\"googleaccount_login\"/>\n\t<button class=\"btn-auth btn-google large\">Login with Google</button>';\n}", "function mixtape_qodef_woocommerce_login_holder()\n {\n echo \"<div class='qodef-my-account-login'>\";\n }", "public function redeem_points() {\n $rewardProgrammeName = Mage::getStoreConfig('lbconfig_section/lb_settings_group/reward_programme_name_field');\n Lb_Points_Helper_Data::$rewardProgrammeName = $rewardProgrammeName;\n if(isset($_SESSION['LB_Session']))\n {\n if(!empty($_SESSION['LB_Session'])) \n {\n $LB_Session = $_SESSION['LB_Session'];\n Lb_Points_Helper_Data::debug_log(\"Rendered session user with his LB Points\", true);\n ?>\n <div class=\"redeem_lbpoints lb-box\">\n <form id=\"frmRedeemPoints\" onsubmit=\" return false;\">\n <label>\n Want to Redeem Loyalty Points? <a class=\"btnShowRedeem\" href=\"javascript:void(0);\" >Click here</a> to redeem.\n </label>\n <div class=\"lb-redeem-wrapper\">\n <label>Enter Loyalty Points</label>\n <input type=\"text\" class=\"input-text required-entry lb-double\" value=\"\" title=\"Enter Loyalty points\" placeholder=\"Enter Loyalty points\" id=\"txtRedeemPoints\" name=\"txtRedeemPoints\">\n <div class=\"redeemMsg\"></div>\n <div class=\"button-wrapper\">\n <button id=\"btnRedeemPoints\" value=\"Redeem\" class=\"button\" title=\"Redeem\" type=\"button\"><span><span>Redeem</span></span></button>\n <!-- button value=\"Cancel\" class=\"button btnShowRedeem\" title=\"Cancel\" type=\"button\"><span><span>Cancel</span></span></button -->\n </div>\n \n </div>\n </form>\n </div>\n <script>\n // Redeem points\n jQuery(\".btnShowRedeem\").click(function(){\n jQuery(\".lb-redeem-wrapper\").toggle('display');\n });\n \n var frmRedeemPoints = 'frmRedeemPoints';\n var redeemPoints = new VarienForm(frmRedeemPoints, true);\n Validation.add('lb-double', 'Please enter a number greater than 0 in this field.', function(v) {\n return (v > 0); // || /^\\s+$/.test(v));\n });\n jQuery(\"#btnRedeemPoints\").click(function(){\n if (redeemPoints.validator.validate()) {\n jQuery(this).attr('disabled','disabled');\n \n var postUrl = \"<?php echo Mage::getBaseUrl() . 'lb/index/redeem' ?>\";\n var txtRedeemPoints = jQuery(\"#txtRedeemPoints\").val();\n jQuery.post(postUrl,{'txtRedeemPoints':txtRedeemPoints},function(response) {\n if(response.status == '1'){\n jQuery(\".redeemMsg\").html(response.message).addClass( \"frm_success\" );\n window.location.reload();\n }\n else{\n jQuery(\".redeemMsg\").html(response.message).addClass( \"frm_error\" );\n jQuery(\"#btnRedeemPoints\").removeAttr('disabled');\n }\n },'JSON');\n }\n });\n </script>\n <style>\n .lb-box\n {\n background-color: #f4f4f4;\n border: 1px solid #cccccc;\n padding: 10px;\n margin-bottom: 20px;\n }\n .lb-redeem-wrapper label,.redeemMsg{\n padding-bottom: 5px;\n }\n </style>\n <?php \n }\n }\n }", "public function showNewClientButton()\n {\n $this->_showNewClientButton = true;\n }", "function pay_acp_fees(){\n\n // redirect(base_url() . 'index.php?login', 'refresh');\n\t\tsession_start();\n\t\t\t\n\t\t$page_data['page_name'] = 'pay_acp_fees';\n $page_data['page_title'] = get_phrase('Pay Acceptance Fee');\n \n\n $this->load->view('backend/register', $page_data);\n\t}", "public function loginRegister () {\n \treturn view(\"Socialite.login-register\");\n }", "public function registration() {\n $this->load->view('header');\n $this->load->view('user_registration');\n $this->load->view('footer');\n }", "function register_action()\n {\n $login_model = $this->loadModel('Login');\n $registration_successful = $login_model->registerNewUser();\n\n if ($registration_successful == true) {\n $this->view->render('login/index');\n } else {\n $this->view->render('login/register');\n }\n }", "public function signup() {\n $this->template->content = View::instance('v_users_signup');\n $this->template->title = \"Sign Up\";\n\n // Render the view\n echo $this->template;\n\n }", "function register()\n {\n // Create our Application instance (necessary to request Facebook data)\n $facebook = new Facebook(array(\n 'appId' => FACEBOOK_LOGIN_APP_ID,\n 'secret' => FACEBOOK_LOGIN_APP_SECRET,\n ));\n\n $redirect_url_after_facebook_auth = URL . 'login/registerwithfacebook';\n // hard to explain, read the Facebook PHP SDK for more\n // basically, when the user clicks the Facebook register button, the following arguments will be passed\n // to Facebook: In this case a request for getting the email (not shown by default btw) and the URL\n // when facebook will send the user after he/she has authenticated\n $this->view->facebook_login_url = $facebook->getLoginUrl(array(\n 'scope' => 'email',\n 'redirect_uri' => $redirect_url_after_facebook_auth\n ));\n\n $this->view->render('login/register');\n }", "public function paml_additional_options() {\n\t\tglobal $paml_options;\n\n\t\t$multisite_reg = get_site_option( 'registration' );\n\n\t\techo '<div id=\"additional-settings\">';\n\n\t\tif ( ( get_option( 'users_can_register' ) && ! is_multisite() ) || ( $multisite_reg == 'all' || $multisite_reg == 'blog' || $multisite_reg == 'user' ) )\n\t\t\techo '<a href=\"#register\" class=\"modal-login-nav\">' . __( 'Register', 'pressapps' ) . '</a> | ';\n\n\t\techo '<a href=\"#forgotten\" class=\"modal-login-nav\">' . __( 'Lost your password?', 'pressapps' ) . '</a>';\n\n\t\techo '<div class=\"hide-login\"> | <a href=\"#login\" class=\"modal-login-nav\">' . __( 'Back to Login', 'pressapps' ) . '</a></div>';\n\n\t\techo '</div>';\n\t}", "public function register() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->register();\n }\n }", "function jfb_activate() \r\r\n{\r\r\n global $jfb_name, $jfb_version, $opt_jfb_valid, $opt_jfb_api_key;\r\r\n $msg = get_option($opt_jfb_valid)?\"VALID\":(!get_option($opt_jfb_api_key)||get_option($opt_jfb_api_key)==''?\"NOKEY\":\"INVALIDKEY\");\r\r\n jfb_auth($jfb_name, $jfb_version, 1, \"ON: \" . $msg);\r\r\n}", "function casano_login_modal() {\r\n\t\tif ( ! shortcode_exists( 'woocommerce_my_account' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif ( is_user_logged_in() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Don't load login popup on real mobile when header mobile is enabled\r\n\t\t$enable_header_mobile = casano_get_option( 'enable_header_mobile', false );\r\n\t\tif ( $enable_header_mobile && casano_is_mobile() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t?>\r\n <div id=\"login-popup\" class=\"woocommerce-account md-content mfp-with-anim mfp-hide\">\r\n <div class=\"casano-modal-content\">\r\n\t\t\t\t<?php echo do_shortcode( '[woocommerce_my_account]' ); ?>\r\n </div>\r\n </div>\r\n\t\t<?php\r\n\t}", "function adminButton(){\n if($_SESSION['level'] == 2){\n global $url, $lang, $ADMINISTRATION;\n echo '<a type=\"button\" class=\"btn btn-primary col-3\" href=\"'.$url.'/index.php?lang='.$lang.'&page=admin\">'.$ADMINISTRATION.'</a>';\n }\n }", "public function bp_account_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->account_control_centre_alternate_dashboard();\n\t}", "public function actionVerifyRegistration()\n {\n // get hash code from url\n $hash = Yii::app()->getRequest()->getQuery('hash');\n // activate account\n $model = Profiles::model()->findByAttributes(array('PRF_RND'=>$hash));\n if($model!==null){\n $model->PRF_ACTIVE = '1';\n $model->save();\n\t\tYii::app()->user->setFlash('register','Thank you for your verification. You can now login using the following link.');\n//$this->refresh();\n } else {\n\t\tYii::app()->user->setFlash('register','Hash value invalid, cannot verification user.');\n\t }\n\t //echo $hash . \"<br>\\r\\n\";\n\t //print_r($model);\n $this->checkRenderAjax('register',array('model'=>$model,));\n }", "function accueilButton(){\n global $url, $lang, $ACCUEIL;\n if(isConnected()){\n echo '<a type=\"button\" class=\"btn btn-primary col-3\" href=\"'.$url.'/index.php?lang='.$lang.'&page=conferences\">'.$ACCUEIL.'</a>';\n }\n else{\n echo '<a type=\"button\" class=\"btn btn-primary col-3\" href=\"'.$url.'/index.php?lang='.$lang.'&page=connexion\">'.$ACCUEIL.'</a>';\n }\n }", "function generate_activate_button()\n\t{\n\t\tlog_message('debug', 'Account/generate_activate_button');\n\t\t$data = filter_forwarded_data($this);\n\n \t\t$data['bank_links'] = array();\n\n \t\tlog_message('debug', 'Account/generate_activate_button:: [1] post='.json_encode($_POST));\n \t\tif(!empty($_POST['bankname__banks'])){\n\n \t\t\tforeach($_POST['bankname__banks'] As $enteredBank){\n \t\t\t\tif($enteredBank!= ''){\n \t\t\t\t\t$result = $this->_api->get('money/banks', array('offset'=>0, 'limit'=>'1', 'phrase'=>$enteredBank));\n \t\t\t\t\tif($result){\n \t\t\t\t\t\tforeach($result As $bank){\n \t\t\t\t\t\t\t$link = base_url().\"account/show_bank_login/i/\".encrypt_value($bank['bank_id']).\"/n/\".encrypt_value($bank['bank_name']).\"/c/\".encrypt_value($bank['bank_code']);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tarray_push($data['bank_links'], $link);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tarray_push($data['bank_links'], \"\");\n \t\t\t\t\t}\n\n \t\t\t\t}\n \t\t\t}\n\t\t\techo json_encode($data['bank_links']);\n\n \t\t}else echo format_notice($this, \"ERROR: The bank you have provided do not match. Please try again.\");\n\n\t}", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "public static function custom_registration_fields()\n\t\t\t\t\t{\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_before_custom_registration_fields\", get_defined_vars());\n\n\t\t\t\t\t\t$_p = (!empty($_POST)) ? c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST)) : array();\n\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"ws_plugin__s2member_registration\" value=\"'.esc_attr(wp_create_nonce(\"ws-plugin--s2member-registration\")).'\" />'.\"\\n\";\n\n\t\t\t\t\t\t$tabindex = 20; // Incremented tabindex starting with 20.\n\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_password\"])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_user_pass\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-user-pass1\" title=\"'.esc_attr(_x(\"Please type your Password twice to confirm.\", \"s2member-front\", \"s2member\")).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"Password (please type it twice)\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"password\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_user_pass1\" id=\"ws-plugin--s2member-custom-reg-field-user-pass1\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.format_to_edit(@$_p[\"ws_plugin__s2member_custom_reg_field_user_pass1\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-user-pass2\" title=\"'.esc_attr(_x(\"Please type your Password twice to confirm.\", \"s2member-front\", \"s2member\")).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"password\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_user_pass2\" id=\"ws-plugin--s2member-custom-reg-field-user-pass2\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.format_to_edit(@$_p[\"ws_plugin__s2member_custom_reg_field_user_pass2\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<div id=\"ws-plugin--s2member-custom-reg-field-user-pass-strength\" class=\"ws-plugin--s2member-password-strength\"><em>'._x(\"password strength indicator\", \"s2member-front\", \"s2member\").'</em></div>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_user_pass\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_names\"])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<div class=\"ws-plugin--s2member-custom-reg-field-divider-section\"></div>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_first_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-first-name\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"First Name\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"text\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_first_name\" id=\"ws-plugin--s2member-custom-reg-field-first-name\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.esc_attr(@$_p[\"ws_plugin__s2member_custom_reg_field_first_name\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_first_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_last_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-last-name\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"Last Name\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"text\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_last_name\" id=\"ws-plugin--s2member-custom-reg-field-last-name\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.esc_attr(@$_p[\"ws_plugin__s2member_custom_reg_field_last_name\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_last_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"])\n\t\t\t\t\t\t\tif($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level(\"auto-detection\", \"registration\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tabindex = /* Start tabindex at +9 ( +1 below ). */ $tabindex + 9;\n\n\t\t\t\t\t\t\t\t\tforeach(json_decode($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"], true) as $field)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_custom_fields\", get_defined_vars());\n\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\t\t\t\tif /* Field applicable? */(in_array($field[\"id\"], $fields_applicable))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$field_var = preg_replace(\"/[^a-z0-9]/i\", \"_\", strtolower($field[\"id\"]));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$field_id_class = preg_replace(\"/_/\", \"-\", $field_var);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(apply_filters(\"ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display\", true, get_defined_vars()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif /* Starts a new section? */(!empty($field[\"section\"]) && $field[\"section\"] === \"yes\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ws-plugin--s2member-custom-reg-field-divider-section'.((!empty($field[\"sectitle\"])) ? '-title' : '').'\">'.((!empty($field[\"sectitle\"])) ? $field[\"sectitle\"] : '').'</div>';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-'.esc_attr($field_id_class).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<span'.((preg_match(\"/^(checkbox|pre_checkbox)$/\", $field[\"type\"])) ? ' style=\"display:none;\"' : '').'>'.$field[\"label\"].(($field[\"required\"] === \"yes\") ? ' *' : '').'</span></label>'.((preg_match(\"/^(checkbox|pre_checkbox)$/\", $field[\"type\"])) ? '' : '<br />').\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo c_ws_plugin__s2member_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, \"ws_plugin__s2member_custom_reg_field_\", \"ws-plugin--s2member-custom-reg-field-\", \"ws-plugin--s2member-custom-reg-field\", \"\", ($tabindex = $tabindex + 1), \"\", $_p, @$_p[\"ws_plugin__s2member_custom_reg_field_\".$field_var], \"registration\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_custom_fields\", get_defined_vars());\n\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\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\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in\"] && c_ws_plugin__s2member_list_servers::list_servers_integrated())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_opt_in\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-opt-in\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"checkbox\" name=\"ws_plugin__s2member_custom_reg_field_opt_in\" id=\"ws-plugin--s2member-custom-reg-field-opt-in\" class=\"ws-plugin--s2member-custom-reg-field\" value=\"1\"'.(((empty($_p) && $GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in\"] == 1) || @$_p[\"ws_plugin__s2member_custom_reg_field_opt_in\"]) ? ' checked=\"checked\"' : '').' tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo $GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in_label\"].\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_opt_in\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_after_custom_registration_fields\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t}", "public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }", "function add_signup_shortcode()\n\t{ \n\t\n\t\tob_start();\n\t\t\n\t\tif ( !is_user_logged_in() ) \n\t\t{ \n\t\t\t\n\t\t\techo ' <div class=\"woocommerce\">';\n\t\t\t\n\t\t\tif(isset($_POST['register']) && sanitize_text_field ($_POST['register'] ) )\n\t\t\t{\n\t\t\n\t\t\t\t$nonce_check = isset($_POST['_wpnonce_phoe_register_form'])?sanitize_text_field( $_POST['_wpnonce_phoe_register_form'] ):'';\n\n\t\t\t\tif ( ! wp_verify_nonce( $nonce_check, 'phoe_register_form' ) ) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdie( 'Security check failed' ); \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$reg_email = isset($_POST['email'])?sanitize_email($_POST['email']):'';\n\t\t\t\t\n\t\t\t\t$reg_password = isset($_POST['password'])? sanitize_text_field($_POST['password']):'';\n\t\t\t\t\n\t\t\t\t$arr_name = explode(\"@\",$reg_email); \n\t\t\t\t\n\t\t\t\t$temp = $arr_name[0];\n\t\t\t\t\n\t\t\t\t$user = get_user_by( 'email',$reg_email );\t\t\t \n\t\t\t \n\t\t\t\tif($reg_email == '')\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li><strong>Error:</strong> Please provide a valid email address.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t </ul>';\n\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if($reg_password == '')\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li><strong>Error:</strong> Please enter an account password.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t </ul>';\n\t\t\t }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(is_email($reg_email))\n\t\t\t\t\t{ \t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(is_object($user) && $user->user_email == $reg_email)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\techo'<ul class=\"woocommerce-error\">\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<li><strong>Error:</strong> An account is already registered with your email address. Please login.</li>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t </ul>';\n\t\t\t\t\t\t}\n\t\t\t\t\t else\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && empty( $reg_password ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$reg_password = wp_generate_password();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$password_generated = true;\n\n\t\t\t\t\t\t\t\t} elseif ( empty( $reg_password ) ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn new WP_Error( 'registration-error-missing-password', __( 'Please enter an account password.', 'woocommerce' ) );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$password_generated = false;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$userdata=array(\"role\"=>\"customer\",\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_email\"=>$reg_email,\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_login\"=>$temp,\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_pass\"=>$reg_password);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($user_id = wp_insert_user( $userdata ))\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\tdo_action('woocommerce_created_customer', $user_id, $userdata, $password_generated);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$user1 = get_user_by('id',$user_id);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\twp_set_current_user( $user1->ID, $user1->user_login );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t wp_set_auth_cookie( $user1->ID );\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t do_action( 'wp_login', $user1->user_login,$user1 );\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $location = home_url().\"/my-account/\"; \n\t\t\t\t\t\t\t\twp_redirect($location);\n\n\t\t\t\t\t\t\t exit;\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\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<li><strong>Error:</strong> Please provide a valid email address.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</ul>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n?> \n\t\n\t\t\t<div class=\"col-set\" id=\"customer_login\">\n\t\t\t\t<div class=\"col\">\n\t\t\t\t\t<h2>Register</h2>\n\t\t\t\t\t<form method=\"post\" class=\"register\">\t\n\n\t\t\t\t\t\t<?php $nonce_register = wp_create_nonce( 'phoe_register_form' ); ?>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<input type=\"hidden\" value=\"<?php echo $nonce_register; ?>\" name=\"_wpnonce_phoe_register_form\" id=\"_wpnonce_phoe_register_form\" />\n\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t\t\t<label for=\"reg_email\">Email address <span class=\"required\">*</span></label>\n\t\t\t\t\t\t\t<input type=\"email\" class=\"input-text\" name=\"email\" id=\"reg_email\" value=\"<?php echo isset( $reg_email ) ? $reg_email: '' ; ?>\" >\n\t\t\t\t\t\t</p>\t\t\t\n\t\t\t\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t\t\t\t<label for=\"reg_password\">Password <span class=\"required\">*</span></label>\n\t\t\t\t\t\t\t\t<input type=\"password\" class=\"input-text\" name=\"password\" id=\"reg_password \" >\n\t\t\t\t\t\t\t</p>\t\t\t\n\t\t\t\t\t\t<div style=\"left: -999em; position: absolute;\"><label for=\"trap\">Anti-spam</label><input type=\"text\" name=\"email_2\" id=\"trap\" tabindex=\"-1\"></div>\t\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"form-row\">\n\t\t\t\t\t\t\t<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"70c2c9e9dd\"><input type=\"hidden\" name=\"_wp_http_referer\" value=\"<?php echo get_site_url(); ?>/my-account/\">\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button\" name=\"register\" value=\"Register\">\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n<?php \n\n\t\t}\n\t\t\n\t\treturn ob_get_clean();\n\t}", "private function genRegistration()\n {\n ob_start(); ?>\n <form name=\"login\" action=\"./\" method=\"post\">\n <fieldset class=\"uk-fieldset\">\n <legend class=\"uk-legend\">[[legend]]</legend>\n <div class=\"uk-margin\">\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: user\"></span>\n <input class=\"uk-input\" type=\"text\" name=\"username\" value=\"[[value_username]]\"\n placeholder=\"[[placaholder_username]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: mail\"></span>\n <input class=\"uk-input\" type=\"email\" name=\"email\" value=\"[[value_email]]\"\n placeholder=\"[[placaholder_email]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"password\" placeholder=\"[[placaholder_password]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"confirm\" placeholder=\"[[placaholder_confirm]]\">\n </div>\n </div>\n <p>[[terms_and_conditions_text]] <a href=\"../privacy-policy/\">[[terms_and_conditions_link]]</a></p>\n <div class=\"uk-margin-bottom\">\n <input type=\"hidden\" name=\"action\" value=\"registration\">\n <button class=\"uk-button uk-button-default\">[[submit_text]]</button>\n </div>\n </div>\n <p>[[login_text]] <span uk-icon=\"icon: link\"></span> <a href=\"../login/\">[[login_link]]</a></p>\n </fieldset>\n </form>\n <?php return ob_get_clean();\n }", "function dp_login_button() {\n\tif(is_user_logged_in() || !get_option('dp_header_login'))\n\t\treturn; ?>\n\t\t\n\t<div id=\"login-nav\" class=\"user-nav\">\n\t\t\t<div class=\"dropdown\">\n\t\t\t\t<a class=\"dropdown-handle btn btn-black btn-login\" href=\"<?php echo wp_login_url(); ?>\"><?php _e('Log In', 'dp'); ?></a>\n\t\t\t\t\t\n\t\t\t\t<div class=\"dropdown-content\"><div class=\"dropdown-content-inner\">\n\t\t\t\t\t<?php wp_login_form(); ?>\n\t\t\t\t</div></div>\n\t\t\t</div>\n\t\t</div><!-- end #login-nav -->\n<?php }", "protected function display() {\n\t\t\t$objUrl = AppRegistry::get('Url');\n\t\t\t$strActionType = 'signup';\n\t\t\t\n\t\t\tif ($objUrl->getMethod() == 'POST' && $objUrl->getVariable('action') == $strActionType) {\n\t\t\t\tif (!empty($_POST['promo'])) {\n\t\t\t\t\tif (!($blnValidCode = in_array($_POST['promo'], AppConfig::get('BetaPromoCodes')))) {\n\t\t\t\t\t\tAppLoader::includeModel('PromoModel');\n\t\t\t\t\t\t$objPromo = new PromoModel();\n\t\t\t\t\t\tif ($objPromo->loadByCodeAndType($_POST['promo'], 'beta')) {\n\t\t\t\t\t\t\tif ($objPromoRecord = $objPromo->current()) {\n\t\t\t\t\t\t\t\tif (!$objPromoRecord->get('claimed')) {\n\t\t\t\t\t\t\t\t\t$blnValidCode = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('That promo code has already been claimed'));\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\ttrigger_error(AppLanguage::translate('Invalid promo code'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error verifying the promo code'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('A promo code is required to register during the private beta'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!empty($blnValidCode)) {\n\t\t\t\t\t$objUser = new UserModel(array('Validate' => true));\n\t\t\t\t\t$objUser->import(array(\n\t\t\t\t\t\t'username'\t=> !empty($_POST['username']) ? $_POST['username'] : null,\n\t\t\t\t\t\t'email'\t\t=> !empty($_POST['email']) ? $_POST['email'] : null,\n\t\t\t\t\t));\n\t\t\t\t\t$objUser->current()->set('password_plaintext', !empty($_POST['password']) ? $_POST['password'] : null);\n\t\t\t\t\t$objUser->current()->set('password_plaintext_again', !empty($_POST['password_again']) ? $_POST['password_again'] : null);\n\t\t\t\t\t\n\t\t\t\t\tif ($objUser->save()) {\n\t\t\t\t\t\tif (isset($objPromoRecord)) {\n\t\t\t\t\t\t\t$objPromoRecord->set('userid', $objUser->current()->get('__id'));\n\t\t\t\t\t\t\t$objPromoRecord->set('claimed', date(AppRegistry::get('Database')->getDatetimeFormat()));\n\t\t\t\t\t\t\t$objPromo->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($objUserLogin = AppRegistry::get('UserLogin', false)) {\n\t\t\t\t\t\t\t$objUserLogin->handleFormLogin($objUser->current()->get('username'), $objUser->current()->get('password_plaintext'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tCoreAlert::alert(AppLanguage::translate('Welcome to %s, %s!', AppConfig::get('SiteTitle'), $objUser->current()->get('displayname')), true);\t\n\t\t\t\t\t\tAppDisplay::getInstance()->appendHeader('location: ' . AppConfig::get('BaseUrl') . '/');\n\t\t\t\t\t\texit;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAppRegistry::get('Error')->error(AppLanguage::translate('There was an error signing up. Please try again'), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->validateFile($strTemplate = $this->strTemplateDir . $this->strThemeDir . 'beta.phtml')) {\n\t\t\t\tAppDisplay::getInstance()->appendTemplate('content', $strTemplate, array_merge($this->arrPageVars, array(\n\t\t\t\t\t'strCssUrl'\t\t\t=> AppConfig::get('CssUrl'),\n\t\t\t\t\t'strJsUrl'\t\t\t=> AppConfig::get('JsUrl'),\n\t\t\t\t\t'strSubmitUrl'\t\t=> AppRegistry::get('Url')->getCurrentUrl(),\n\t\t\t\t\t'strTokenField'\t\t=> AppConfig::get('TokenField'),\n\t\t\t\t\t'strUsernameField'\t=> AppConfig::get('LoginUsernameField'),\n\t\t\t\t\t'strPasswordField'\t=> AppConfig::get('LoginPasswordField'),\n\t\t\t\t\t'strLoginFlag'\t\t=> AppConfig::get('LoginFlag'),\n\t\t\t\t\t'strActionType'\t\t=> $strActionType,\n\t\t\t\t\t'blnSignupForm'\t\t=> !empty($_GET['promo']) || (!empty($_POST['action']) && $_POST['action'] == $strActionType) || (!empty($_GET['form']) && $_GET['form'] == 'signup'),\n\t\t\t\t\t'blnLoginForm'\t\t=> (!empty($_POST) && empty($_POST['action'])) || (!empty($_GET['form']) && $_GET['form'] == 'login'),\n\t\t\t\t\t'arrErrors'\t\t\t=> AppRegistry::get('Error')->getErrors()\n\t\t\t\t)));\n\t\t\t}\n\t\t}", "function registrationPage() {\n\t\t $display = &new jzDisplay();\n\t\t $be = new jzBackend();\n\t\t $display->preHeader('Register',$this->width,$this->align);\n\t\t $urla = array();\n\n\t\t if (isset($_POST['field5'])) {\n\t\t $user = new jzUser(false);\n\t\t if (strlen($_POST['field1']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field2']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field3']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field4']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field5']) == 0) {\n\t\t echo \"All fields are required.<br>\";\n\t\t }\n\t\t else if ($_POST['field2'] != $_POST['field3']) {\n\t\t echo \"The passwords do not match.<br>\";\n\t\t }\n\t\t else if (($id = $user->addUser($_POST['field1'],$_POST['field2'])) === false) {\n\t\t echo \"Sorry, this username already exists.<br>\";\n\t\t } else {\n\t\t // success!\n\t\t $stuff = $be->loadData('registration');\n\t\t $classes = $be->loadData('userclasses');\n\t\t $settings = $classes[$stuff['classname']];\n\n\t\t $settings['fullname'] = $_POST['field4'];\n\t\t $settings['email'] = $_POST['field5'];\n\t\t $un = $_POST['field1'];\n\t\t $settings['home_dir'] = str_replace('USERNAME',$un,$settings['home_dir']);\n\t\t $user->setSettings($settings,$id);\n\n\t\t echo \"Your account has been created. Click <a href=\\\"\" . urlize($urla);\n\t\t echo \"\\\">here</a> to login.\";\n\t\t $this->footer();\n\t\t return;\n\t\t }\n\t\t }\n\n\t\t ?>\n\t\t\t<form method=\"POST\" action=\"<?php echo urlize($urla); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('action'); ?>\" value=\"<?php echo jz_encode('login'); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('self_register'); ?>\" value=\"<?php echo jz_encode('true'); ?>\">\n\t\t\t<table width=\"100%\" cellpadding=\"5\" style=\"padding:5px;\" cellspacing=\"0\" border=\"0\">\n\t\t\t<tr>\n\t\t\t<td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Username\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field1\" value=\"<?php echo $_POST['field1']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Password\"); ?>\n\t\t\t</font></td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field2\" value=\"<?php echo $_POST['field2']; ?>\"></td></tr>\n\t\t\t <tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t &nbsp;\n\t\t\t</td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field3\" value=\"<?php echo $_POST['field3']; ?>\"></td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Full name\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field4\" value=\"<?php echo $_POST['field4']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Email\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field5\" value=\"<?php echo $_POST['field5']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"100%\" colspan=\"2\" align=\"center\">\n\t\t\t<input class=\"jz_submit\" type=\"submit\" name=\"<?php echo jz_encode('submit_login'); ?>\" value=\"<?php echo word(\"Register\"); ?>\">\n\t\t\t</td></tr></table><br>\n\t\t\t</form>\n\t\t\t<?php\n\t\t $this->footer();\n\t }", "public function add_registration_link_text() {\n\t\t\tprintf(\n\t\t\t\t'<p class=\"ast-woo-form-actions\">\n\t\t\t\t\t%1$s\n\t\t\t\t\t<a href=\"#ast-woo-register\" data-type=\"do-register\" class=\"ast-woo-account-form-link\">\n\t\t\t\t\t\t%2$s\n\t\t\t\t\t</a>\n\t\t\t\t</p>',\n\t\t\t\tapply_filters( 'astra_addon_woo_account_register_heading', __( 'Not a member?', 'astra-addon' ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\tapply_filters( 'astra_addon_woo_account_register_string', __( 'Register', 'astra-addon' ) ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t);\n\t\t}", "function grabUserAccountInfo(){\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t\n\t\t$app \t = JFactory::getApplication();\n\t\t$session = JFactory::getSession();\n\t\t$post \t = $app->input->post->getArray();\n\t\t\n\t\t$session->set('userInfo', $post, 'register');\n\t\t\n\t\t//find step 3 or 4; step 4 = normal registration; step 3 = skip plan\n\t\t$skipPlan \t= $session->get('skipPlan', 0, 'register');\n\t\t$step = ($skipPlan) ? 'step=3' : 'step=4';\n\t\t\n\t\t$link = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield&'.$step, false);\n\t\t$this->setRedirect($link);\n\t\treturn false;\n\t}", "public function showRegistrationForm()\n {\n return view('laboratorio.auth.register');\n \n }", "public function showRegistrationForm()\n {\n return view('frontend.user_registration');\n }", "function popUpWindow($msg = '', $data = array())\n{\n$module = new sociallogin();\n$style = 'style=\"padding:10px 11px 10px 30px;overflow-y:auto;height:auto;\"';\n$left = 'left:44%';\nif (_PS_VERSION_ >= 1.6)\n\t$left = 'left:50%;';\n$top_style = 'style=top:50%;'.$left.'';\n$profilefield = unserialize(Configuration::get('profilefield'));\nif (empty($profilefield))\n\t$profilefield[] = '3';\nif (Configuration::get('user_require_field') == '1')\n{\n\t$top_style_value = 50;\n\t$count_profile_field = count($profilefield);\n\tfor ($i = 1; $i < $count_profile_field - 1; $i++)\n\t\t$top_style_value -= 5;\n\t$top_style = 'style=top:'.$top_style_value.'%;'.$left.'';\n\t$style = 'style=\"padding:10px 11px 10px 30px;\"';\n}\n$profilefield = implode(';', $profilefield);\n$context = Context::getContext();\n$context->controller->addCSS(__PS_BASE_URI__.'modules/sociallogin/css/sociallogin_style.css');\n$context->controller->addjquery();\n$context->controller->addJS(__PS_BASE_URI__.'modules/sociallogin/js/popupjs.js');\n$cookie = $context->cookie;\n$cookie->sl_hidden = microtime();\n?>\n<div id=\"fade\" class=\"LoginRadius_overlay\">\n<div id=\"popupouter\" <?php echo $top_style; ?>>\n<div id=\"popupinner\" <?php echo $style; ?>>\n<div id=\"textmatter\"><strong>\n\t\t<?php\n\t\tif ($msg == '')\n\t\t{\n\t\t\t//echo \"Please fill the following details to complete the registration\";\n\t\t\t$show_msg = Configuration::get('POPUP_TITLE');\n\t\t\techo $msg = (!empty($show_msg) ? $show_msg : $module->l('Please fill the following details to complete the registration', 'sociallogin_functions'));\n\t\t}\n\t\telse\n\t\t\techo $msg;\n\t\t?>\n\t</strong></div>\n<form method=\"post\" name=\"validfrm\" id=\"validfrm\" action=\"\" onsubmit=\"return popupvalidation();\">\n<?php\n$html = '';\nif (Configuration::get('user_require_field') == '1')\n{\n\tif (strpos($profilefield, '1') !== false && (empty($data['fname']) || isset($data['firstname'])))\n\t{\n\t\t$html .= '<div>\n\t\t\t<span class=\"spantxt\">'.$module->l('First Name', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_FNAME\" id=\"SL_FNAME\" placeholder=\"FirstName\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_FNAME')) ? htmlspecialchars(Tools::getValue('SL_FNAME')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\tif (strpos($profilefield, '2') !== false && (empty($data['lname']) || isset($data['lastname'])))\n\t{\n\t\t$html .= '<div>\n\t\t\t<span class=\"spantxt\">'.$module->l('Last Name', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_LNAME\" id=\"SL_LNAME\" placeholder=\"LastName\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_LNAME')) ? htmlspecialchars(Tools::getValue('SL_LNAME')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n}\nif (empty($data['email']) || $data['send_verification_email'] == 'yes')\n{\n\t$width = '';\n\tif (Configuration::get('user_require_field') != '1' || (Configuration::get('user_require_field') == '1' && count(Configuration::get('profilefield')) == 0))\n\t\t$width = 'width:60px;';\n\t$html .= '<div><span class=\"spantxt\" style='.$width.'>'.$module->l('Email', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_EMAIL\" id=\"SL_EMAIL\" placeholder=\"Email\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_EMAIL')) ? htmlspecialchars(Tools::getValue('SL_EMAIL')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n}\nif (Configuration::get('user_require_field') == '1')\n{\n\tif (strpos($profilefield, '6') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('Address', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_ADDRESS\" id=\"SL_ADDRESS\" placeholder=\"Address\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_ADDRESS')) ? htmlspecialchars(Tools::getValue('SL_ADDRESS')) : $data['address']).'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\tif (strpos($profilefield, '8') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('ZIP code', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_ZIP_CODE\" id=\"SL_ZIP_CODE\" placeholder=\"Zip Code\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_ZIP_CODE')) ? htmlspecialchars(Tools::getValue('SL_ZIP_CODE')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\tif (strpos($profilefield, '4') !== false)\n\t{\n\t\t$html .= '<div>\n\t\t\t<span class=\"spantxt\">'.$module->l('City', 'sociallogin_functions').'</span><input type=\"text\" name=\"SL_CITY\" id=\"SL_CITY\" placeholder=\"City\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_CITY')) ? htmlspecialchars(Tools::getValue('SL_CITY')) : $data['city']).'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\t$countries = Db::getInstance()->executeS('\n\t\tSELECT *\n\t\tFROM '._DB_PREFIX_.'country c WHERE c.active =1');\n\tif (strpos($profilefield, '3') !== false)\n\t{\n\t\tif (is_array($countries) && !empty($countries))\n\t\t{\n\t\t\t$html .= '<div id=\"location-country-div\">\n\t\t\t\t\t<span class=\"spantxt\">'.$module->l('Country', 'sociallogin_functions').'</span>\n\t\t\t\t\t<select id=\"location-country\" name=\"location_country\" class=\"inputtxt\"><option value=\"0\">None</option>';\n\t\t\tforeach ($countries as $country)\n\t\t\t{\n\t\t\t\t$country_name = new Country($country['id_country']);\n\t\t\t\t$html .= '<option value=\"'.($country['iso_code']).'\"'.((Tools::getValue('location_country'))\n\t\t\t\t\t&& (Tools::getValue('location_country') == $country['iso_code']) ? ' selected=\"selected\"' : '').'>\n\t\t\t\t\t'.$country_name->name['1'].'</option>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '</select></div>';\n\t\t}\n\t}\n\t$value = true;\n\tif (Tools::getValue('location_country') && strpos($profilefield, '3') !== false)\n\t{\n\t\t$country = new Country(Tools::getValue('location_country'));\n\t\t$value = $country->contains_states;\n\t}\n\tif (strpos($profilefield, '3') !== false && $value)\n\t{\n\t\t$html .= '<div id=\"location-state-div\" style=\"display:none;\">\n\t\t<input id=\"location-state\" type=\"text\" name=\"location-state\" value=\"empty\" />\n\t\t</div>';\n\t}\n\telseif (strpos($profilefield, '3') !== false)\n\t{\n\t\t$country_id = Db::getInstance()->executeS('\n\t\t\tSELECT *\n\t\t\tFROM '._DB_PREFIX_.'country c WHERE c.iso_code= \"'.Tools::getValue('location_country').'\"');\n\t\t$states = State::getStatesByIdCountry($country_id['0']['id_country']);\n\t\tif (is_array($states))\n\t\t{\n\t\t\t$style = '';\n\t\t\tif (empty($states))\n\t\t\t\t$style = 'style=\"display:none;\"';\n\t\t\t$html .= '<div id=\"location-state-div\" '.$style.'>\n\t\t\t\t<span class=\"spantxt\">'.$module->l('State', 'sociallogin_functions').'</span>\n\t\t\t\t<select id=\"location-state\" name=\"location-state\" class=\"inputtxt\">';\n\t\t\tif (empty($states))\n\t\t\t\t$html .= '<option value=\"empty\">None</option>';\n\t\t\tforeach ($states as $state)\n\t\t\t{\n\t\t\t\t$state_name = new State($state['id_state']);\n\t\t\t\t$html .= '<option value=\"'.($state['iso_code']).'\"'.(Tools::getValue('location-state')\n\t\t\t\t\t&& (Tools::getValue('location-state') == $state['iso_code']) ? ' selected=\"selected\"' : '').'>'.$state_name->name.'</option>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '</select></div>';\n\t\t}\n\t}\n\tif (strpos($profilefield, '5') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('Mobile Number', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_PHONE\" id=\"SL_PHONE\" placeholder=\"Mobile Number\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_PHONE')) ? htmlspecialchars(Tools::getValue('SL_PHONE')) : $data['phonenumber']).'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\n\n\tif (strpos($profilefield, '7') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('Address Title').'</span><input type=\"text\" name=\"SL_ADDRESS_ALIAS\"\n\t\tid=\"SL_ADDRESS_ALIAS\" placeholder=\"Please assign an address title for future reference\"\n\t\tvalue= \"'.((Tools::getValue('SL_ADDRESS_ALIAS')) ? htmlspecialchars(Tools::getValue('SL_ADDRESS_ALIAS')) : '').'\" class=\"inputtxt\" />\n\t\t</div>';\n\t}\n}\nif ($html == '')\n\treturn 'noshowpopup';\n$html .= '<div><input type=\"hidden\" name=\"hidden_val\" value=\"'.$cookie->sl_hidden.'\" />\n\t<input type=\"submit\" id=\"LoginRadius\" name=\"LoginRadius\" value=\"'.$module->l('Submit', 'sociallogin_functions').'\"\n\tclass=\"inputbutton\">\n\t<input type=\"button\" value=\"'.$module->l('Cancel', 'sociallogin_functions').'\"\n\tclass=\"inputbutton\" onclick=\"window.location.href=window.location.href;\" />\n\t</div></div>\n\t</form>\n\t</div>\n\t</div>\n\t</div>';\necho $html;\n}", "public function cseSideLoginBox() {\n\n\t\tif(Session::getSess('logged') == false ) {\n\n\t\t\t$this->cseSideLoginBox .= '\n\t\t\t\t<div class=\"grid_up hr dark bold500 radius_5_top textcenter\">Вход в системата</div>\n\t\t\t\t<div class=\"grid_bottom pall_20\">\n\t\t\t\t<form action=\"'. $this->dataInfo['BASE_URL'] .'user/logIn\" method=\"post\">\n\n\t\t\t\t\t<input type=\"text\" name=\"userLogin\" value=\"Име за вход\" class=\"user ml_10 mb_10 radius_5_all boldtext\"/>\n\t\t\t\t\t<input type=\"password\" name=\"userPassword\" value=\"************\" class=\"pass ml_10 radius_5_all boldtext\"/>\n\n\t\t\t\t\t<input type=\"submit\" name=\"login\" class=\"loginButton ml_10 mt_10 boldtext radius_5_all\" value=\"Вход\"/>\n\t\t\t\t\tили <a href=\"'. $this->dataInfo['BASE_URL'] .'user/regUser\" class=\"registerButton\">Регистрация</a>\n\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t';\n\t\t} else {\n\n\t\t\t$username = $this->setUrl('userNameDisplay');\n\t\t\t$this->cseSideLoginBox = '\n\t\t\t\t<div class=\"grid_up hr dark bold500 radius_5_top textcenter\">Потребителски профил</div>\n\t\t\t\t<div class=\"grid_bottom\">\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border pt_5\"><span class=\"boldtext fontSize14\">User Login:</span> <span class=\"it right fontSize15\" style=\"padding-top: 3px;\">'.Session::getSess('userLogin').'</span></p>\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border pt_5\"><span class=\"boldtext fontSize14\">Display Name:</span> <span class=\"it right fontSize15\" style=\"padding-top: 3px;\">'.Session::getSess('userNameDisplay').'</span></p>\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border pt_5\"><span class=\"boldtext fontSize14\">E-mail:</span> <span class=\"it right fontSize15\" style=\"padding-top: 3px;\">'.Session::getSess('userEmail').'</span></p>\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border pt_5\"><span class=\"boldtext fontSize14\">Password:</span> <span class=\"it right fontSize15\" style=\"padding-top: 3px;\">'.Session::getSess('userPassword').'</span></p>\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border pt_5\"><span class=\"boldtext fontSize14\">Last seen:</span> <span class=\"it right fontSize15\" style=\"padding-top: 3px;\">'.$this->getLoginTime().'</span></p>\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border pt_5\"><span class=\"boldtext fontSize14\">Logged at</span> <span class=\"it right fontSize15\" style=\"padding-top: 3px;\">'.date(\"H:i:s, j.m.Y\", Session::getSess('userLogInTime')).'</span></p>\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border pt_5\"><span class=\"boldtext fontSize14\">UniqueID:</span> <span class=\"it right fontSize15\" style=\"padding-top: 3px;\">'.Session::getSess('userUniqueID').'</span></p>\n\t\t\t\t\t<p style=\"margin-top: 1px;\" class=\"border1 info pall_5 border clearfix pt_5\"><span class=\"boldtext left fontSize14\" style=\"padding-top: 3px;\">Rank: '.$this->getUserType().'</span>\n\t\t\t\t<span class=\"right fontSize15\" style=\"padding-top: 3px;\">[ <a href=\"'.$this->dataInfo['BASE_URL'].'user/userProfile/'.$username.'\" class=\"adm\">\n\t\t\t\tРедактиране</a> ]</span>\n\t\t\t\t\t</p>\n\t\t\t\t</div>';\n\n\n\t\t}\n\t}", "public function formLogin() {\n $this->view->addForm();\n }", "public function stripeSignup()\n {\n $connect_url = Config::STRIPE_CONNECT;\n return \"<script> window.location.href = '$connect_url'; </script>\";\n }", "public function optInAction()\n {\n\n $tokenYes = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_yes') ? $this->request->getArgument('token_yes') : ''));\n $tokenNo = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_no') ? $this->request->getArgument('token_no') : ''));\n $userSha1 = preg_replace('/[^a-zA-Z0-9]/', '', $this->request->getArgument('user'));\n\n /** @var \\RKW\\RkwRegistration\\Tools\\Registration $register */\n $register = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('RKW\\\\RkwRegistration\\\\Tools\\\\Registration');\n $check = $register->checkTokens($tokenYes, $tokenNo, $userSha1, $this->request, $data);\n\n // set hash value for changing subscriptions without login\n $hash = '';\n if ($check == 1) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionSaved',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n if (!$frontendUser->getTxRkwnewsletterHash()) {\n $hash = sha1($frontendUser->getUid() . $frontendUser->getEmail() . rand());\n $frontendUser->setTxRkwnewsletterHash($hash);\n $this->frontendUserRepository->update($frontendUser);\n\n } else {\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n }\n\n\n } elseif ($check == 2) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionCanceled',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n\n } else {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.error.subscriptionError',\n 'rkw_newsletter'\n ),\n '',\n \\TYPO3\\CMS\\Core\\Messaging\\AbstractMessage::ERROR\n );\n }\n\n $this->redirect('message', null, null, array('hash' => $hash));\n //===\n }", "function tgl_shortcode_login($atts = null, $content = null)\n{\n wp_enqueue_script( 'tgl-login-js' );\n\n // Load options\n /*$settings = get_option('tgl_settings');\n $setting_api_key = $settings['tgl_api_key'];\n $setting_show_errors = $settings['tgl_show_errors'];*/\n \n // Create output HTML\n $o = '<div class=\"self_service\">' .\n '<div class=\"spinner_container\"><i class=\"fa fa-spinner fa-pulse fa-3x fa-fw\"></i></div>' .\n '<div class=\"field_container\" style=display:none;>' .\n ' <input type=\"text\" id=\"tgl_field_id\" class=\"nicdark_border_grey\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Booking Number\">' .\n ' <input type=\"text\" id=\"tgl_field_name\" class=\"nicdark_border_grey\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Last Name\">' .\n ' <input type=\"text\" id=\"tgl_field_birthday\" class=\"nicdark_border_grey\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Birthday\" onfocus=\"(this.type=\\'date\\')\">' .\n ' <input type=\"submit\" id=\"tgl-login\" value=\"SHOW MY BOOKING\" class=\"wpcf7-form-control wpcf7-submit nicdark_bg_green nicdark_center\">' . \n '</div>' .\n '<style>.self_service .spinner_container, .self_service .field_container{text-align:center;display:block;}</style>' .\n '</div>';\n \n \n // return output\n return $o;\n}", "function createAccountButton(){\n\t\techo '<form name=\"accounts\" method=\"post\" action=\"CheckBook.php/:Add\">';\n\t\techo '<button type=\"submit\">Add an Account</button>';\n\t\techo '</form>';\n\t}", "public function Register()\n\t{\n $this->redirectUserLoggedIn();\n\t\t$locations=$this->fetch->getInfo('locations');\n\t\t$services_nav=$this->fetch->getInfo('services',5);\n\t\t$web=$this->fetch->getWebProfile('webprofile');\n\t\t$this->load->view('header',['title'=>'Register',\n 'locations'=>$locations,\n 'services_nav'=>$services_nav,\n\t\t\t\t\t\t\t\t'web'=>$web\n\t\t\t\t\t\t]\n\t\t\t\t\t);\n\t\t$this->load->view('register');\n\t\t$this->load->view('footer');\n\t\t$this->load->view('custom_scripts');\n }", "function Login()\n {\n $this->view->ShowLogin();\n }", "function iarb_extauth()\n{\n\tglobal $context, $modSettings;\n\n\tif (empty($modSettings['extauth_master']))\n\t{\n\t\treturn;\n\t}\n\n\t// Registration Screen ?\n\tif ((!empty($context['site_action']) && $context['site_action'] === 'register')\n\t\t&& (isset($_GET['action']) && $_GET['action'] === 'register'))\n\t{\n\t\t// Load the enabled providers\n\t\trequire_once(SUBSDIR . '/Extauth.subs.php');\n\t\t$context['enabled_providers'] = extauth_enabled_providers();\n\n\t\tif ($modSettings['requireAgreement'] && empty($_POST['accept_agreement']))\n\t\t{\n\t\t\tTemplate_Layers::instance()->addBegin('extauth_register');\n\t\t}\n\t}\n}", "private function _show_registration_form(&$xregistration=null, $task='create')\n\t{\n\t\t$username = Request::getString('username', User::get('username'), 'get');\n\t\t$isSelf = (User::get('username') == $username);\n\n\t\t// Get the registration object\n\t\tif (!is_object($xregistration))\n\t\t{\n\t\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\t\t}\n\n\t\t// Push some values to the view\n\t\t$rules = \\Hubzero\\Password\\Rule::all()\n\t\t\t->whereEquals('enabled', 1)\n\t\t\t->rows();\n\n\t\t$password_rules = array();\n\n\t\tforeach ($rules as $rule)\n\t\t{\n\t\t\tif (!empty($rule['description']))\n\t\t\t{\n\t\t\t\t$password_rules[] = $rule['description'];\n\t\t\t}\n\t\t}\n\n\t\t$this->view->registrationUsername = Field::state('registrationUsername', 'RROO', $task);\n\t\t$this->view->registrationPassword = Field::state('registrationPassword', 'RRHH', $task);\n\t\t$this->view->registrationConfirmPassword = Field::state('registrationConfirmPassword', 'RRHH', $task);\n\t\t$this->view->registrationFullname = Field::state('registrationFullname', 'RRRR', $task);\n\t\t$this->view->registrationEmail = Field::state('registrationEmail', 'RRRR', $task);\n\t\t$this->view->registrationConfirmEmail = Field::state('registrationConfirmEmail', 'RRRR', $task);\n\t\t$this->view->registrationOptIn = Field::state('registrationOptIn', 'HHHH', $task);\n\t\t$this->view->registrationCAPTCHA = Field::state('registrationCAPTCHA', 'HHHH', $task);\n\t\t$this->view->registrationTOU = Field::state('registrationTOU', 'HHHH', $task);\n\n\t\tif ($task == 'update')\n\t\t{\n\t\t\tif (empty($this->view->xregistration->login))\n\t\t\t{\n\t\t\t\t$this->view->registrationUsername = Field::STATE_REQUIRED;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->view->registrationUsername = Field::STATE_READONLY;\n\t\t\t}\n\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\tif ($task == 'edit')\n\t\t{\n\t\t\t$this->view->registrationUsername = Field::STATE_READONLY;\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\tif (User::get('auth_link_id') && $task == 'create')\n\t\t{\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\t$fields = Field::all()\n\t\t\t->including(['options', function ($option){\n\t\t\t\t$option\n\t\t\t\t\t->select('*')\n\t\t\t\t\t->ordered();\n\t\t\t}])\n\t\t\t->where('action_' . ($task == 'update' ? 'create' : $task), '!=', Field::STATE_HIDDEN)\n\t\t\t->ordered()\n\t\t\t->rows();\n\n\t\t// Display the view\n\t\t$this->view\n\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER'))\n\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t->set('config', $this->config)\n\t\t\t->set('task', $task)\n\t\t\t->set('fields', $fields)\n\t\t\t->set('showMissing', true)\n\t\t\t->set('isSelf', $isSelf)\n\t\t\t->set('password_rules', $password_rules)\n\t\t\t->set('xregistration', $xregistration)\n\t\t\t->set('registration', $xregistration->_registration)\n\t\t\t->setLayout('default')\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function signIn(){\n\t\t$this->view->render($this,'signIn');\n\t}", "public static function printLogin (){\n\t?>\n\t\n\t\t\t\t<!-- Login Credentials -->\n\t\t\t\t<h3>Google Account Login</h3>\n\t\t\t\t<table class='form-table'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\"><label for='gdocs_user'>Username</label></th>\n\t\t\t\t\t\t\t<td><input id='gdocs_user' type=\"text\" size=\"40\" name=\"gdocs_user\" value=\"<?php echo get_option ('gdocs_user'); ?>\" /><br/><span class='description'><strong>For Google Apps users, append your username with </strong><code>@yourdomain.com</code></span></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\"><label for='gdocs_pwd'>Password</label></th>\n\t\t\t\t\t\t\t<td><input id='gdocs_pwd' type=\"password\" size=\"40\" name=\"gdocs_pwd\" value=\"<?php echo get_option ('gdocs_pwd'); ?>\" /></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\n\t<?php\n\t}", "public function showLogin(){\n $this->data['pagetitle'] = \"Login\";\n $this->data['page'] = 'login';\n // $this->data['pagecontent'] = 'login';\n $this->data['pagebody'] = 'login';\n \n $this->render();\n }" ]
[ "0.67709357", "0.67042327", "0.62745816", "0.6193503", "0.6124903", "0.5984627", "0.59040767", "0.58807456", "0.58584887", "0.58158845", "0.58122087", "0.57709104", "0.57471806", "0.5720803", "0.5713735", "0.5680387", "0.56651187", "0.56461066", "0.56364346", "0.5614515", "0.55509645", "0.554328", "0.5530374", "0.55265224", "0.55246896", "0.5494878", "0.54826546", "0.5464126", "0.54507375", "0.54370403", "0.5427226", "0.54241586", "0.5416738", "0.5414517", "0.5411412", "0.5410065", "0.54041874", "0.53720266", "0.5364088", "0.53623384", "0.5349313", "0.53450036", "0.533856", "0.5337144", "0.5332662", "0.53282225", "0.5321126", "0.5306412", "0.5300873", "0.5297641", "0.52929497", "0.5292006", "0.5281874", "0.5278446", "0.52775306", "0.52720124", "0.5270037", "0.5260677", "0.5259969", "0.5258823", "0.5253284", "0.5251316", "0.52422523", "0.52419597", "0.5241473", "0.5240959", "0.52367747", "0.52264833", "0.5223675", "0.5221746", "0.5219848", "0.52144563", "0.5209894", "0.52093464", "0.520895", "0.5205671", "0.5202718", "0.52026236", "0.5197503", "0.51948017", "0.5194728", "0.5189763", "0.518685", "0.5180719", "0.5177235", "0.5171702", "0.5170823", "0.5168621", "0.51682013", "0.5166249", "0.5161989", "0.51593405", "0.51591074", "0.5156388", "0.51532763", "0.5152316", "0.51521105", "0.5146917", "0.51453346", "0.5144241" ]
0.82411844
0
registration_popup. This method is used to render registration/login dialog box.
public function registration_popup() { ?> <div style="display:none;"> <div id="popup_form_registration" class="main"> <div class="col-main" style="float: none;width:100%;"> <div class="page-title"> <h1>Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></h1> </div> <div id="registerLB"> <form id="registrationForm"> <div class="fieldset"> <h2 class="legend">Registration</h2> <p class="required">* Required Fields</p> <div id="formRegisterSuccess" ></div> <ul class="form-list"> <li class="fields"> <div class="field"> <label class="required" for="name"><em>*</em>Name</label> <div class="input-box"> <input type="text" class="input-text required-entry" value="" title="Name" id="name" name="name"> </div> </div> <div class="field"> <label class="required" for="email"><em>*</em>Email Address</label> <div class="input-box"> <input type="email" spellcheck="false" autocorrect="off" autocapitalize="off" class="input-text required-entry validate-email" value="" title="Email" id="email" name="email"> </div> </div> </li> <li> <label class="required" for="phonenumber"><em>*</em>Phone number</label> <div class="input-box"> <input type="tel" class="input-text required-entry validate-number IsValidCellNumber" value="" title="Phone number" id="phonenumber" name="phonenumber"> </div> </li> </ul> </div> <div class="buttons-set lb-btn-register"> <button class="button" title="Submit" type="submit"><span><span>Submit</span></span></button> </div> <div class="lb-links"> <div > Or <a href="javascript:void(0);" id="lnkLBLogin" style="color:burlywood;">login</a> if already registered. </div> <div> download our <a href="javascript:void(0);" id="lnkDownloadApp" style="color:burlywood;">mobile application</a> </div> </div> </form> </div> <div style="display:none;" id="loginLB"> <form id="loginForm"> <div class="fieldset"> <h2 class="legend">Login</h2> <p class="required">* Required Fields</p> <div id="formLoginLowestSuccess" ></div> <ul class="form-list"> <li> <label class="required" for="txtCardNumber"><em>*</em>Card Number / Phone number / OTP</label> <div class="input-box"> <input type="tel" class="input-text required-entry validate-number IsValidCartNumber" value="" title="Telephone" id="txtCardNumber" name="txtCardNumber" > </div> </li> </ul> </div> <div class="buttons-set lb-btn-register"> <button class="button" title="Submit" type="submit"><span><span>Submit</span></span></button> </div> <div class="lb-links"> <div> Or <a href="javascript:void(0);" id="lnkLBRegister" style="color:burlywood;">click here</a> to register. </div> <div> download our <a href="javascript:void(0);" id="lnkDownloadApp" style="color:burlywood;">mobile application</a> </div> </div> </form> </div> <span id="formLoader" > <img src="<?php echo $this->getSkinUrl("images/opc-ajax-loader.gif") ?>"> </span> </div> </div> </div> <style> .frm_error{ color:red; font-size: 13px; margin: 5px 0 0; } .frm_success{ color:green; font-size: 13px; margin: 5px 0 0; } #formLoader{ display:none; } .lb-btn-register{ margin-bottom: 5px; } .lb-btn-register::after { clear: none; content: ""; display: table; } .lb-links{ color: #636363; font-family: "Helvetica Neue",Verdana,Arial,sans-serif; font-size: 13px; line-height: 1.5; margin-top: -10px; } @media screen and (max-width: 479px) { .lb-btn-register::after { clear: both; content: ""; display: table; } } #popup_form_registration { width: auto; } .connectlbbtn.lb-box { clear: both; padding:5px; } .registrationBtn h2 { font-size: 12px; font-weight: bold; margin: 0 0 5px; } #formRegisterSuccess{ font-size: 13px; margin: 5px 0 0; color: green; } .dialog_content { background-color: #F4F4F4; color: #636363; font-family: Tahoma,Arial,sans-serif; font-size: 10px; overflow: auto; padding-bottom: 5px!important; } .redeem_lbpoints input { margin-bottom: 5px; } .lb-redeem-wrapper{ margin-top: 5px; display: none; } <?php if(strpos($_SERVER['REQUEST_URI'], '/checkout/cart/') !== false){?> .registrationBtn{ background-color: #f4f4f4; border: 1px solid #cccccc; padding: 10px; margin-bottom: 20px; } <?php }?> </style> <script type="text/javascript"> jQuery("#loginLB").hide(); jQuery("#lnkLBLogin").click(function(){ jQuery("#loginLB").show(); jQuery("#registerLB").hide(); jQuery(".dialog_content").css('height','auto'); }); jQuery("#lnkLBRegister").click(function(){ jQuery("#loginLB").hide(); jQuery("#registerLB").show(); jQuery(".dialog_content").css('height','auto'); }); Validation.add('IsValidCartNumber', 'Only 10 or 15 digits are allowed.', function(v) { return (v.length == 10 || v.length == 15); // || /^\s+$/.test(v)); }); Validation.add('IsValidCellNumber', 'Only 10 digits are allowed.', function(v) { return (v.length == 10); // || /^\s+$/.test(v)); }); //var dataForm = new VarienForm('lowest-form-validate', true); var formId = 'registrationForm'; var myForm = new VarienForm(formId, true); var handleSubmit = true; function doAjax() { var postUrl = "<?php echo Mage::getBaseUrl() . 'lb/index/register' ?>"; jQuery(".dialog_content").css('height','auto'); if (myForm.validator.validate()) { var txtName = jQuery("#name"); var txtEmail = jQuery("#email"); var txtPhoneNumber = jQuery("#phonenumber"); var tips = jQuery("#formRegisterSuccess"); tips.text(''); var data = { 'txtName': txtName.val(), 'txtEmail': txtEmail.val(), 'txtPhoneNumber': txtPhoneNumber.val() }; if(handleSubmit){ handleSubmit = false; jQuery("#formLoader").show(); jQuery.post(postUrl, data, function(response) { handleSubmit = true; if(response.status == '1'){ jQuery("#formLoader").hide(); tips.text(response.message).addClass( "frm_success" ); txtName.val(''); txtEmail.val(''); txtPhoneNumber.val(''); jQuery(".dialog_close").trigger('click'); window.location.reload(); } else{ tips.text(response.message).addClass( "frm_error" ); jQuery("#formLoader").hide(); } },'JSON'); } } } // REGISTRATION CALL BACK new Event.observe('registrationForm', 'submit', function(e){ e.stop(); doAjax(); }); // login js var loginFormId = 'loginForm'; var loginForm = new VarienForm(loginFormId, true); jQuery("#loginForm button").click(function(){ var postUrl = "<?php echo Mage::getBaseUrl() . 'lb/index/login' ?>"; var txtCardNumber = jQuery("#txtCardNumber").val(); jQuery(".dialog_content").css('height','auto'); if (loginForm.validator.validate()) { jQuery("#formLoader").show(); jQuery.post(postUrl,{'txtCardNumber':txtCardNumber}, function(response) { if(response.status == '1'){ jQuery("#formLoader").hide(); jQuery(".dialog_close").trigger('click'); Element.show('formLoginLowestSuccess'); jQuery("#formLoginLowestSuccess").html(response.message).addClass( "frm_success" ); jQuery(".connectlbbtn").html(response.replaceBtn); window.location.reload(); } else{ jQuery("#formLoader").hide(); Element.show('formLoginLowestSuccess'); jQuery("#formLoginLowestSuccess").html(response.message).addClass( "frm_error" ); } },'JSON'); } return false; }); // Add connect with loyaltybox button to right side bar /*if(jQuery(".cart-forms").length == 1) { var btnHtml = jQuery(".connectlbbtn").html(); jQuery(".connectlbbtn").html(''); jQuery(".cart-forms").prepend("<div class='discount connectlbbtn'>"+btnHtml+"</div>"); }*/ // End : Add connect with loyaltybox button to right side bar. // LOGOUT CALL BACK jQuery("#lbLogout").click(function(){ var postUrl = "<?php echo Mage::getBaseUrl() . 'lb/index/logout' ?>"; jQuery.post(postUrl, function(response) { if(response.status == '1'){ window.location.reload(); } else{ jQuery("lbMsg").html(response.message).addClass( "frm_error" ); } },'JSON'); }); // end of logout //end of javascript code <?php if(strpos($_SERVER['REQUEST_URI'], '/checkout/cart/') !== false){?> jQuery(".connectlbbtn").parent().addClass('cart-forms'); <?php }else{?> var regBox = jQuery(".connectlbbtn"); jQuery(".add-to-cart").append(regBox); jQuery(".add-to-cart").css("clear","both"); <?php }?> </script> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showRegistrationForm()\n {\n return view('skins.' . config('pilot.SITE_SKIN') . '.auth.register');\n }", "function DisplayLoginPopup()\n\t{\n\t\t$this->LoadPage('generic_popup');\n\t\t$this->Page->SetName(\"Login\");\n\t\t$this->Page->AddObject('UserLogin', COLUMN_ONE, HTML_CONTEXT_POPUP);\n\t\treturn TRUE;\n\t}", "public function RegistrationUnderApproval() {\n $this->Render();\n }", "public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }", "public function displayGoogleRegisterLink()\n {\n if ($this->use_google_login === true) {\n $client = $this->newGoogleClient($this->getGoogleOptions());\n $auth_url = $client->createAuthUrl();\n \n if (isset($auth_url)) {\n echo '<p class=\"google-register oauth-login\"><a href=\"'.$auth_url.'\">'.__('Register with Google', 'okv-oauth').'</a></p>';\n }\n \n if (isset($_REQUEST['error'])) {\n $this->googleRegisterError($_REQUEST['error'], true);\n return false;\n }\n \n if (isset($_COOKIE['google_access_token']) && !empty($_COOKIE['google_access_token'])) {\n $check_user_result = $this->googleRegisterCheckUser();\n if ($check_user_result === false) {\n return false;\n } elseif (is_array($check_user_result)) {\n // check user passed. now it is ready to prepare register form.\n echo '<script>'.\"\\n\";\n echo 'var okvoauth_google_register_got_code = true;'.\"\\n\";\n echo 'var okvoauth_google_wp_user_login = \\''.(isset($check_user_result['wp_user_login']) ? $check_user_result['wp_user_login'] : '').'\\';'.\"\\n\";\n echo 'var okvoauth_google_wp_user_email = \\''.(isset($check_user_result['wp_user_email']) ? $check_user_result['wp_user_email'] : '').'\\';'.\"\\n\";\n echo 'var okvoauth_google_wp_user_avatar = \\''.(isset($check_user_result['wp_user_avatar']) ? $check_user_result['wp_user_avatar'] : '').'\\';'.\"\\n\";\n echo '</script>'.\"\\n\";\n }\n unset($check_user_result);\n }\n \n unset($auth_url, $client);\n return true;\n } else {\n return false;\n }\n }", "public function displayRegisterForm()\n {\n // charger le HTML de notre template\n require OPROFILE_TEMPLATES_DIR . 'register-form.php';\n }", "public function auth_modal()\n\t{\n get_template_part('bbpress/auth-modal'); \n\t}", "public function showRegistrationForm() {\n //parent::showRegistrationForm();\n $data = array();\n\n $data = $this->example_of_user();\n $data['title'] = 'RegisterForm';\n\n return view('frontend.auth.register', $data);\n }", "public function showRegistrationForm()\n {\n return view('privato.auth.register');\n }", "public function registration_button() {\n\n $rewardProgrammeName = Mage::getStoreConfig('lbconfig_section/lb_settings_group/reward_programme_name_field');\n Lb_Points_Helper_Data::$rewardProgrammeName = $rewardProgrammeName;\n if(isset($_SESSION['LB_Session']))\n {\n if(!empty($_SESSION['LB_Session'])) \n {\n $LB_Session = $_SESSION['LB_Session'];\n Lb_Points_Helper_Data::debug_log(\"Rendered session user with his LB Points\", true);\n ?>\n <div class=\"connectlbbtn lb-box\">\n <span class=\"h2\"><?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></span>\n <div class=\"loyaltybox-info-contain\">\n <?php \n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n $remainingPoints = $LB_Session['lb_points'] - $_SESSION['LB_Session']['totalRedeemPoints'];\n else\n $remainingPoints = $LB_Session['lb_points'];\n ?>\n <?php echo \"<strong>Hi \".$LB_Session['Customer Name'].\"</strong> | <a id='lbLogout' href='javascript:void(0);'>Logout(\".Lb_Points_Helper_Data::$rewardProgrammeName.\")</a></br>You have \".$remainingPoints.\" Points in your <strong>\".Lb_Points_Helper_Data::$rewardProgrammeName.\"</strong> account.\"; ?>\n </div>\n <div class=\"lbMsg\"></div>\n </div>\n <?php\n } \n else \n {\n Lb_Points_Helper_Data::debug_log(\"Rendered Connect with Loyalty Box button\", true);\n ?>\n <div class=\"connectlbbtn registrationBtn lb-box\">\n <button class=\"button btn-cart\" onclick=\"return showForm('popup_form_registration')\" title=\"Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?>\" type=\"button\"><span><span>Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></span></span></button>\n <div class=\"lbMsg\"></div>\n </div>\n \n <script type=\"text/javascript\">\n function showForm(id){\n win = new Window({ title: \"Connect with Loyalty Box\", zIndex:3000, destroyOnClose: true, recenterAuto:true, resizable: false, width:400, height:'auto', minimizable: true, maximizable: false, draggable: true});\n win.setContent(id, false, false);\n win.showCenter();\n }\n </script>\n <?php\n Lb_Points_Helper_Data::debug_log(\"End: Rendered Connect with Loyalty Box button\", true);\n }\n }\n else \n {\n Lb_Points_Helper_Data::debug_log(\"Rendered Connect with Loyalty Box button\", true);\n ?>\n <div class=\"connectlbbtn registrationBtn lb-box\">\n <button class=\"button btn-cart\" onclick=\"return showForm('popup_form_registration')\" title=\"Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?>\" type=\"button\"><span><span>Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?></span></span></button>\n <div class=\"lbMsg\"></div>\n </div>\n <script type=\"text/javascript\">\n function showForm(id){\n win = new Window({ title: \"Connect with <?php echo Lb_Points_Helper_Data::$rewardProgrammeName;?>\", zIndex:3000, destroyOnClose: true, recenterAuto:true, resizable: false, width:400, height:'auto', minimizable: true, maximizable: false, draggable: true});\n win.setContent(id, false, false);\n win.showCenter();\n }\n </script>\n <?php\n Lb_Points_Helper_Data::debug_log(\"End: Rendered Connect with Loyalty Box button\", true);\n }\n }", "function popUpWindow($msg = '', $data = array())\n{\n$module = new sociallogin();\n$style = 'style=\"padding:10px 11px 10px 30px;overflow-y:auto;height:auto;\"';\n$left = 'left:44%';\nif (_PS_VERSION_ >= 1.6)\n\t$left = 'left:50%;';\n$top_style = 'style=top:50%;'.$left.'';\n$profilefield = unserialize(Configuration::get('profilefield'));\nif (empty($profilefield))\n\t$profilefield[] = '3';\nif (Configuration::get('user_require_field') == '1')\n{\n\t$top_style_value = 50;\n\t$count_profile_field = count($profilefield);\n\tfor ($i = 1; $i < $count_profile_field - 1; $i++)\n\t\t$top_style_value -= 5;\n\t$top_style = 'style=top:'.$top_style_value.'%;'.$left.'';\n\t$style = 'style=\"padding:10px 11px 10px 30px;\"';\n}\n$profilefield = implode(';', $profilefield);\n$context = Context::getContext();\n$context->controller->addCSS(__PS_BASE_URI__.'modules/sociallogin/css/sociallogin_style.css');\n$context->controller->addjquery();\n$context->controller->addJS(__PS_BASE_URI__.'modules/sociallogin/js/popupjs.js');\n$cookie = $context->cookie;\n$cookie->sl_hidden = microtime();\n?>\n<div id=\"fade\" class=\"LoginRadius_overlay\">\n<div id=\"popupouter\" <?php echo $top_style; ?>>\n<div id=\"popupinner\" <?php echo $style; ?>>\n<div id=\"textmatter\"><strong>\n\t\t<?php\n\t\tif ($msg == '')\n\t\t{\n\t\t\t//echo \"Please fill the following details to complete the registration\";\n\t\t\t$show_msg = Configuration::get('POPUP_TITLE');\n\t\t\techo $msg = (!empty($show_msg) ? $show_msg : $module->l('Please fill the following details to complete the registration', 'sociallogin_functions'));\n\t\t}\n\t\telse\n\t\t\techo $msg;\n\t\t?>\n\t</strong></div>\n<form method=\"post\" name=\"validfrm\" id=\"validfrm\" action=\"\" onsubmit=\"return popupvalidation();\">\n<?php\n$html = '';\nif (Configuration::get('user_require_field') == '1')\n{\n\tif (strpos($profilefield, '1') !== false && (empty($data['fname']) || isset($data['firstname'])))\n\t{\n\t\t$html .= '<div>\n\t\t\t<span class=\"spantxt\">'.$module->l('First Name', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_FNAME\" id=\"SL_FNAME\" placeholder=\"FirstName\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_FNAME')) ? htmlspecialchars(Tools::getValue('SL_FNAME')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\tif (strpos($profilefield, '2') !== false && (empty($data['lname']) || isset($data['lastname'])))\n\t{\n\t\t$html .= '<div>\n\t\t\t<span class=\"spantxt\">'.$module->l('Last Name', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_LNAME\" id=\"SL_LNAME\" placeholder=\"LastName\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_LNAME')) ? htmlspecialchars(Tools::getValue('SL_LNAME')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n}\nif (empty($data['email']) || $data['send_verification_email'] == 'yes')\n{\n\t$width = '';\n\tif (Configuration::get('user_require_field') != '1' || (Configuration::get('user_require_field') == '1' && count(Configuration::get('profilefield')) == 0))\n\t\t$width = 'width:60px;';\n\t$html .= '<div><span class=\"spantxt\" style='.$width.'>'.$module->l('Email', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_EMAIL\" id=\"SL_EMAIL\" placeholder=\"Email\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_EMAIL')) ? htmlspecialchars(Tools::getValue('SL_EMAIL')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n}\nif (Configuration::get('user_require_field') == '1')\n{\n\tif (strpos($profilefield, '6') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('Address', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_ADDRESS\" id=\"SL_ADDRESS\" placeholder=\"Address\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_ADDRESS')) ? htmlspecialchars(Tools::getValue('SL_ADDRESS')) : $data['address']).'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\tif (strpos($profilefield, '8') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('ZIP code', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_ZIP_CODE\" id=\"SL_ZIP_CODE\" placeholder=\"Zip Code\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_ZIP_CODE')) ? htmlspecialchars(Tools::getValue('SL_ZIP_CODE')) : '').'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\tif (strpos($profilefield, '4') !== false)\n\t{\n\t\t$html .= '<div>\n\t\t\t<span class=\"spantxt\">'.$module->l('City', 'sociallogin_functions').'</span><input type=\"text\" name=\"SL_CITY\" id=\"SL_CITY\" placeholder=\"City\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_CITY')) ? htmlspecialchars(Tools::getValue('SL_CITY')) : $data['city']).'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\t$countries = Db::getInstance()->executeS('\n\t\tSELECT *\n\t\tFROM '._DB_PREFIX_.'country c WHERE c.active =1');\n\tif (strpos($profilefield, '3') !== false)\n\t{\n\t\tif (is_array($countries) && !empty($countries))\n\t\t{\n\t\t\t$html .= '<div id=\"location-country-div\">\n\t\t\t\t\t<span class=\"spantxt\">'.$module->l('Country', 'sociallogin_functions').'</span>\n\t\t\t\t\t<select id=\"location-country\" name=\"location_country\" class=\"inputtxt\"><option value=\"0\">None</option>';\n\t\t\tforeach ($countries as $country)\n\t\t\t{\n\t\t\t\t$country_name = new Country($country['id_country']);\n\t\t\t\t$html .= '<option value=\"'.($country['iso_code']).'\"'.((Tools::getValue('location_country'))\n\t\t\t\t\t&& (Tools::getValue('location_country') == $country['iso_code']) ? ' selected=\"selected\"' : '').'>\n\t\t\t\t\t'.$country_name->name['1'].'</option>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '</select></div>';\n\t\t}\n\t}\n\t$value = true;\n\tif (Tools::getValue('location_country') && strpos($profilefield, '3') !== false)\n\t{\n\t\t$country = new Country(Tools::getValue('location_country'));\n\t\t$value = $country->contains_states;\n\t}\n\tif (strpos($profilefield, '3') !== false && $value)\n\t{\n\t\t$html .= '<div id=\"location-state-div\" style=\"display:none;\">\n\t\t<input id=\"location-state\" type=\"text\" name=\"location-state\" value=\"empty\" />\n\t\t</div>';\n\t}\n\telseif (strpos($profilefield, '3') !== false)\n\t{\n\t\t$country_id = Db::getInstance()->executeS('\n\t\t\tSELECT *\n\t\t\tFROM '._DB_PREFIX_.'country c WHERE c.iso_code= \"'.Tools::getValue('location_country').'\"');\n\t\t$states = State::getStatesByIdCountry($country_id['0']['id_country']);\n\t\tif (is_array($states))\n\t\t{\n\t\t\t$style = '';\n\t\t\tif (empty($states))\n\t\t\t\t$style = 'style=\"display:none;\"';\n\t\t\t$html .= '<div id=\"location-state-div\" '.$style.'>\n\t\t\t\t<span class=\"spantxt\">'.$module->l('State', 'sociallogin_functions').'</span>\n\t\t\t\t<select id=\"location-state\" name=\"location-state\" class=\"inputtxt\">';\n\t\t\tif (empty($states))\n\t\t\t\t$html .= '<option value=\"empty\">None</option>';\n\t\t\tforeach ($states as $state)\n\t\t\t{\n\t\t\t\t$state_name = new State($state['id_state']);\n\t\t\t\t$html .= '<option value=\"'.($state['iso_code']).'\"'.(Tools::getValue('location-state')\n\t\t\t\t\t&& (Tools::getValue('location-state') == $state['iso_code']) ? ' selected=\"selected\"' : '').'>'.$state_name->name.'</option>'.\"\\n\";\n\t\t\t}\n\t\t\t$html .= '</select></div>';\n\t\t}\n\t}\n\tif (strpos($profilefield, '5') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('Mobile Number', 'sociallogin_functions').'</span>\n\t\t\t<input type=\"text\" name=\"SL_PHONE\" id=\"SL_PHONE\" placeholder=\"Mobile Number\"\n\t\t\tvalue= \"'.((Tools::getValue('SL_PHONE')) ? htmlspecialchars(Tools::getValue('SL_PHONE')) : $data['phonenumber']).'\" class=\"inputtxt\" />\n\t\t\t</div>';\n\t}\n\n\n\tif (strpos($profilefield, '7') !== false)\n\t{\n\t\t$html .= '<div><span class=\"spantxt\">'.$module->l('Address Title').'</span><input type=\"text\" name=\"SL_ADDRESS_ALIAS\"\n\t\tid=\"SL_ADDRESS_ALIAS\" placeholder=\"Please assign an address title for future reference\"\n\t\tvalue= \"'.((Tools::getValue('SL_ADDRESS_ALIAS')) ? htmlspecialchars(Tools::getValue('SL_ADDRESS_ALIAS')) : '').'\" class=\"inputtxt\" />\n\t\t</div>';\n\t}\n}\nif ($html == '')\n\treturn 'noshowpopup';\n$html .= '<div><input type=\"hidden\" name=\"hidden_val\" value=\"'.$cookie->sl_hidden.'\" />\n\t<input type=\"submit\" id=\"LoginRadius\" name=\"LoginRadius\" value=\"'.$module->l('Submit', 'sociallogin_functions').'\"\n\tclass=\"inputbutton\">\n\t<input type=\"button\" value=\"'.$module->l('Cancel', 'sociallogin_functions').'\"\n\tclass=\"inputbutton\" onclick=\"window.location.href=window.location.href;\" />\n\t</div></div>\n\t</form>\n\t</div>\n\t</div>\n\t</div>';\necho $html;\n}", "public function showRegistrationForm()\n {\n return view('laboratorio.auth.register');\n \n }", "public function showRegistrationForm()\n {\n return view('frontend.user_registration');\n }", "public function showRegistrationForm()\n {\n return redirect()->route('frontend.account.register');\n //return theme_view('account.register');\n }", "public function showRegistrationForm()\n {\n return view('adminlte::auth.register');\n }", "public function showRegistrationForm()\n {\n return view('user.auth.login');\n }", "public function showRegistrationForm()\n {\n $askForAccount = false;\n return view('client.auth.register',compact(\"askForAccount\"));\n }", "public function registration()\n {\n $view = new View('login_registration');\n $view->title = 'Bilder-DB';\n $view->heading = 'Registration';\n $view->display();\n }", "public function getRegistrationForm()\n\t{\n\n\t}", "public function qode_membership_render_login_form() {\n\t\techo qode_membership_get_widget_template_part( 'login-widget', 'login-modal-template' );\n\t}", "public function showRegistrationForm()\n {\n //Custom code here\n return view('auth.register')->with('packages', Package::all()->where('status', 1));\n }", "public function showRegistrationForm()\n {\n return view('admin.auth.register');\n }", "function casano_login_modal() {\r\n\t\tif ( ! shortcode_exists( 'woocommerce_my_account' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif ( is_user_logged_in() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Don't load login popup on real mobile when header mobile is enabled\r\n\t\t$enable_header_mobile = casano_get_option( 'enable_header_mobile', false );\r\n\t\tif ( $enable_header_mobile && casano_is_mobile() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t?>\r\n <div id=\"login-popup\" class=\"woocommerce-account md-content mfp-with-anim mfp-hide\">\r\n <div class=\"casano-modal-content\">\r\n\t\t\t\t<?php echo do_shortcode( '[woocommerce_my_account]' ); ?>\r\n </div>\r\n </div>\r\n\t\t<?php\r\n\t}", "public function showRegistrationForm()\n {\n $navList = Nav::getMenuTree(Nav::orderBy('sort', 'asc')->get()->toArray());\n $categories = Category::getMenuTree(Category::orderBy('sort', 'asc')->select('id', 'name', 'pid')->get()->toArray());\n View::share([\n 'nav_list' => $navList,\n 'category_list' => $categories,\n ]);\n return view('auth.register');\n }", "protected function page_popup () {\n\t\t$skeleton = make::tpl ('skeleton.basic');\n\n\t\t/**\n\t\t * Fetch the body content template\n\t\t */\n\t\t$body = make::tpl ('body.login-widget.popup');\n\n\t\t/**\n\t\t * Fetch the page details\n\t\t */\n\t\t/*$page = new page('terms');*/\n\n\t\t/**\n\t\t * Build the output\n\t\t */\n\t\t$skeleton->assign (\n\t\t\tarray (\n\t\t\t\t'title'\t\t\t=> /*$page->title()*/'Login Widget',\n\t\t\t\t'keywords'\t\t=> /*$page->keywords()*/'',\n\t\t\t\t'description'\t=> /*$page->description()*/'',\n\t\t\t\t'body'\t\t\t=> $body\n\t\t\t)\n\t\t);\n\n\t\toutput::as_html($skeleton,true);\n\n\t}", "public function showRegistrationForm()\n {\n return view('auth.officer-register');\n }", "public function showRegistrationForm()\n {\n return view('auth.register');\n }", "public function actionRegister()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('registration');\n\t}", "public function showRegistrationForm()\n\t{\n\t\t$data = [];\n\t\t\n\t\t// References\n\t\t$data['countries'] = CountryLocalizationHelper::transAll(CountryLocalization::getCountries());\n\t\t$data['genders'] = Gender::trans()->get();\n\t\t\n\t\t// Meta Tags\n\t\tMetaTag::set('title', getMetaTag('title', 'register'));\n\t\tMetaTag::set('description', strip_tags(getMetaTag('description', 'register')));\n\t\tMetaTag::set('keywords', getMetaTag('keywords', 'register'));\n\t\t\n\t\t// return view('auth.register.indexFirst', $data);\n\t\treturn view('auth.register.index', $data);\n\n\t}", "public function showSignUpForm() {\n if(!config('springintoaction.signup.allow')) {\n return view('springintoaction::frontend.signup_closed');\n }\n\n return view('springintoaction::frontend.signup');\n }", "public function registerForm(): Response\n {\n $this->init('You\\'r already loggedIn', '/chatroom');\n return $this->render('register.html.twig');\n }", "public function showRegistrationForm()\n {\n return view('instructor.auth.register');\n }", "function show_register_message_on_login()\n {\n echo '<div>Si no tienes cuenta <a href=\"'.get_permalink(ConstantBD::BD_POST_SIGNUP).'\">registrate</a> en un solo paso. </div>';\n }", "public function showRegisterForm(){\n return view('auth.entreprise-register');\n }", "function login_form_register()\n {\n }", "public function showForm()\n {\n return view('auth.register-step2');\n }", "private function _prepareLoginDialog()\n {\n $floatingDialog = new Point_Model_FloatingDialog();\n $dialogOptions = array(\n \t\t\t\t\t\t'title' \t\t=> 'Login',\n \t\t\t\t\t\t'id'\t\t\t=> 'login_form',\t\n \t\t\t\t\t\t'linkName'\t\t=> 'Sign in',\n \t\t\t\t\t\t'class'\t\t\t=> 'ui-state-default ui-corner-all',\n \t\t\t\t\t\t\n \t\t\t\t\t\t/* Button Style for the css */\n \t\t\t\t\t\t//style=\"padding: .4em 1em .4em 20px; text-decoration: none; position: relative;\"\n \t\t\t\t\t\t'linkCss'\t\t=> array( \n \t\t\t\t\t\t\t\t\t\t\t\t\t'font-size' \t=> '0.85em',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'font-weight'\t=> 'bold',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'line-height'\t=> '1.2em',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'text-decoration'=>'none',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'color'\t\t\t=> '#fff',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'background'\t=> '#88BBD4',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'border'\t\t=> '1px solid #88BBE4',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'padding'\t\t=> '.4em 1em .4em 20px',\n \t\t\t\t\t\t\t\t\t\t\t\t\t'position'\t\t=> 'relative'),\n \t\t\t\t\t\t/* Dialog settings */\n \t\t\t\t\t\t'settings'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' \t=> 450,\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'height'\t=> 300,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'draggable'\t=> 'false',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'modal'\t\t=> 'true',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'resizable'\t=> 'false',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'autoOpen'\t=> 'false'\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'buttons'\t=>\t'{\"Close\":function(){$(this).dialog(\"close\");}}'*/),\t\n\t\t\t\t\t\t\t\t'others'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => '.signin')); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n return $this->view->userDialog = $floatingDialog->setView($this->view)\n \t\t\t\t\t\t\t\t\t\t \t\t->makeDialog($this->_getForm(), $dialogOptions);\n }", "public function ShowRegistrationForm(){\n return view('Auth.register');\n }", "public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }", "private static function printRegForm() {\n\t\t\tinclude 'engine/values/site.values.php';\n\t\t\tif($site_reg_open){\n\t\t\techo \"<form action=\\\"?module=handler&action=registration\\\" method=\\\"post\\\">\n\t\t\t\t <div class=\\\"form_settings\\\">\n\t\t\t\t \t<center><h2>\".strip_tags($site_title).\" - Registration</h2></center>\n\t\t\t\t \t<br>\n\t\t\t\t <p><span>Email</span><input type=\\\"text\\\" name=\\\"email1\\\" tabindex=\\\"1\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Confirm email</span><input type=\\\"text\\\" name=\\\"email2\\\" tabindex=\\\"2\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Name</span><input type=\\\"text\\\" name=\\\"name\\\" tabindex=\\\"3\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Password</span><input type=\\\"password\\\" name=\\\"password1\\\" tabindex=\\\"4\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>Confirm password</span><input type=\\\"password\\\" name=\\\"password2\\\" tabindex=\\\"5\\\" class=\\\"contact\\\"/></p>\n\t\t\t\t <p><span>User agreement</span><textarea class=\\\"contact textarea\\\" name=\\\"useragreement\\\" readonly=\\\"readonly\\\">\".file_get_contents('engine/values/user.agreement.txt').\"</textarea></p>\n\t\t\t\t <p>By pressing submit you agree to the user agreement above.</p>\n\t\t\t\t <p style=\\\"padding-top: 15px\\\"><span>&nbsp;</span><input class=\\\"submit\\\" type=\\\"submit\\\" tabindex=\\\"6\\\" name=\\\"contact_submitted\\\" value=\\\"Submit\\\" /></p>\n\t\t\t\t </div>\n\t\t\t\t</form>\";\n\t\t\t} else {\n\t\t\t\techo \"Registration is currently closed. For more information contact the administrators.\";\n\t\t\t}\n\t\t}", "public function register_show_2()\n {\n return view('fontend.user.verify');\n }", "function RegistrationForm() {\n\t\t$data = Session::get(\"FormInfo.Form_RegistrationForm.data\");\n\n\t\t$use_openid =\n\t\t\t($this->getForumHolder()->OpenIDAvailable() == true) &&\n\t\t\t(isset($data['IdentityURL']) && !empty($data['IdentityURL'])) ||\n\t\t\t(isset($_POST['IdentityURL']) && !empty($_POST['IdentityURL']));\n\n\t\t$fields = singleton('Member')->getForumFields($use_openid, true);\n\n\t\t// If a BackURL is provided, make it hidden so the post-registration\n\t\t// can direct to it.\n\t\tif (isset($_REQUEST['BackURL'])) $fields->push(new HiddenField('BackURL', 'BackURL', $_REQUEST['BackURL']));\n\n\t\t$validator = singleton('Member')->getForumValidator(!$use_openid);\n\t\t$form = new Form($this, 'RegistrationForm', $fields,\n\t\t\tnew FieldList(new FormAction(\"doregister\", _t('ForumMemberProfile.REGISTER','Register'))),\n\t\t\t$validator\n\t\t);\n\n\t\t// Guard against automated spam registrations by optionally adding a field\n\t\t// that is supposed to stay blank (and is hidden from most humans).\n\t\t// The label and field name are intentionally common (\"username\"),\n\t\t// as most spam bots won't resist filling it out. The actual username field\n\t\t// on the forum is called \"Nickname\".\n\t\tif(ForumHolder::$use_honeypot_on_register) {\n\t\t\t$form->Fields()->push(\n\t\t\t\tnew LiteralField(\n\t\t\t\t\t'HoneyPot',\n\t\t\t\t\t'<div style=\"position: absolute; left: -9999px;\">' .\n\t\t\t\t\t// We're super paranoid and don't mention \"ignore\" or \"blank\" in the label either\n\t\t\t\t\t'<label for=\"RegistrationForm_username\">' . _t('ForumMemberProfile.LeaveBlank', 'Don\\'t enter anything here'). '</label>' .\n\t\t\t\t\t'<input type=\"text\" name=\"username\" id=\"RegistrationForm_username\" value=\"\" />' .\n\t\t\t\t\t'</div>'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$member = new Member();\n\n\t\t// we should also load the data stored in the session. if failed\n\t\tif(is_array($data)) {\n\t\t\t$form->loadDataFrom($data);\n\t\t}\n\n\t\t// Optional spam protection\n\t\t$form->enableSpamProtection();\n\n\t\treturn $form;\n\t}", "public function showRegisterForm()\n {\n return view('ui.pages.register');\n }", "public function getRegister()\n {\n return $this->showRegistrationForm();\n }", "public function getRegister()\n {\n return $this->showRegistrationForm();\n }", "function displayRegForm() {\r\n displayUserForm(\"processRegistration.php\", \"registrationForm\", \"Register\",\r\n \"Your name\", \"\",\r\n \"Your email address\", \"\",\r\n \"Your chosen username\", \"\",\r\n \"Your chosen password\", \"Confirm your password\",\r\n true, -1);\r\n}", "function login_popup() {\n //or still be able to either retrieve their password or anything else this controller may be extended to do\n $redirect = $this->auth_travel->is_logged_in(false, false);\n //if they are logged in, we send them back to the dashboard by default, if they are not logging in\n if ($redirect) {\n redirect('profile#personal-info');\n }\n\n $data['seo_title'] = '';\n $data['seo_description'] = '';\n $data['seo_keyword'] = '';\n $data['txtUserName'] = '';\n $data['txtPassword'] = '';\n $this->load->helper('form');\n $data['redirect'] = $this->session->flashdata('redirect');\n $submitted = $this->input->post('submitted');\n if ($submitted) {\n $email = $this->input->post('txtUserName');\n $password = $this->input->post('txtPassword');\n $remember = $this->input->post('remember');\n $redirect = $this->input->post('redirect');\n $login = $this->auth_travel->login_travel($email, $password, $remember);\n if ($login) {\n if ($redirect == '') {\n $redirect = 'profile#personal-info';\n }\n redirect($redirect);\n } else {\n //this adds the redirect back to flash data if they provide an incorrect credentials\n $this->session->set_flashdata('redirect', $redirect);\n $this->session->set_flashdata('error', lang('error_authentication_failed'));\n redirect('login');\n }\n }\n $this->load->view('login_popup', $data);\n }", "public function showRegistrationForm()\n {\n return view('Registration View');\n }", "private function _registerForm()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->plugin->runHooks( 'register_main' );\n\t\t\n\t\t$MySmartBB->template->display( 'register' );\n\t}", "public function getRegistrationForm()\n {\n \treturn view('auth.institute_register'); \n }", "public function showRegistrationForm()\n {\n // get all roles expet root.\n $roles = Role::where('name', '!=', 'root')->get();\n $specialties = Specialty::all();\n\n return view('auth.register')->with([\n 'roles' => $roles, \n 'specialties' => $specialties\n ]);\n }", "public function showRegisterForm()\n {\n return view('estagiarios.auth.register');\n }", "private function genRegistration()\n {\n ob_start(); ?>\n <form name=\"login\" action=\"./\" method=\"post\">\n <fieldset class=\"uk-fieldset\">\n <legend class=\"uk-legend\">[[legend]]</legend>\n <div class=\"uk-margin\">\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: user\"></span>\n <input class=\"uk-input\" type=\"text\" name=\"username\" value=\"[[value_username]]\"\n placeholder=\"[[placaholder_username]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: mail\"></span>\n <input class=\"uk-input\" type=\"email\" name=\"email\" value=\"[[value_email]]\"\n placeholder=\"[[placaholder_email]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"password\" placeholder=\"[[placaholder_password]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"confirm\" placeholder=\"[[placaholder_confirm]]\">\n </div>\n </div>\n <p>[[terms_and_conditions_text]] <a href=\"../privacy-policy/\">[[terms_and_conditions_link]]</a></p>\n <div class=\"uk-margin-bottom\">\n <input type=\"hidden\" name=\"action\" value=\"registration\">\n <button class=\"uk-button uk-button-default\">[[submit_text]]</button>\n </div>\n </div>\n <p>[[login_text]] <span uk-icon=\"icon: link\"></span> <a href=\"../login/\">[[login_link]]</a></p>\n </fieldset>\n </form>\n <?php return ob_get_clean();\n }", "public function showRegisterForm()\n {\n return view('dashboard.user.registerForm');\n }", "public function showRegistrationForm()\n {\n $countries = Country::getCountries();\n\n return view('auth.register', compact('countries'));\n }", "function registrationPage() {\n\t\t $display = &new jzDisplay();\n\t\t $be = new jzBackend();\n\t\t $display->preHeader('Register',$this->width,$this->align);\n\t\t $urla = array();\n\n\t\t if (isset($_POST['field5'])) {\n\t\t $user = new jzUser(false);\n\t\t if (strlen($_POST['field1']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field2']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field3']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field4']) == 0 ||\n\t\t\t\t\tstrlen($_POST['field5']) == 0) {\n\t\t echo \"All fields are required.<br>\";\n\t\t }\n\t\t else if ($_POST['field2'] != $_POST['field3']) {\n\t\t echo \"The passwords do not match.<br>\";\n\t\t }\n\t\t else if (($id = $user->addUser($_POST['field1'],$_POST['field2'])) === false) {\n\t\t echo \"Sorry, this username already exists.<br>\";\n\t\t } else {\n\t\t // success!\n\t\t $stuff = $be->loadData('registration');\n\t\t $classes = $be->loadData('userclasses');\n\t\t $settings = $classes[$stuff['classname']];\n\n\t\t $settings['fullname'] = $_POST['field4'];\n\t\t $settings['email'] = $_POST['field5'];\n\t\t $un = $_POST['field1'];\n\t\t $settings['home_dir'] = str_replace('USERNAME',$un,$settings['home_dir']);\n\t\t $user->setSettings($settings,$id);\n\n\t\t echo \"Your account has been created. Click <a href=\\\"\" . urlize($urla);\n\t\t echo \"\\\">here</a> to login.\";\n\t\t $this->footer();\n\t\t return;\n\t\t }\n\t\t }\n\n\t\t ?>\n\t\t\t<form method=\"POST\" action=\"<?php echo urlize($urla); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('action'); ?>\" value=\"<?php echo jz_encode('login'); ?>\">\n\t\t\t<input type=\"hidden\" name=\"<?php echo jz_encode('self_register'); ?>\" value=\"<?php echo jz_encode('true'); ?>\">\n\t\t\t<table width=\"100%\" cellpadding=\"5\" style=\"padding:5px;\" cellspacing=\"0\" border=\"0\">\n\t\t\t<tr>\n\t\t\t<td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Username\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field1\" value=\"<?php echo $_POST['field1']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Password\"); ?>\n\t\t\t</font></td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field2\" value=\"<?php echo $_POST['field2']; ?>\"></td></tr>\n\t\t\t <tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t &nbsp;\n\t\t\t</td>\n\t\t\t<td width=\"50%\">\n\t\t\t<input type=\"password\" class=\"jz_input\" name=\"field3\" value=\"<?php echo $_POST['field3']; ?>\"></td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Full name\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field4\" value=\"<?php echo $_POST['field4']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"50%\" align=\"right\"><font size=\"2\">\n\t\t\t<?php echo word(\"Email\"); ?>\n\t\t\t</font></td><td width=\"50%\">\n\t\t\t<input type=\"text\" class=\"jz_input\" name=\"field5\" value=\"<?php echo $_POST['field5']; ?>\">\n\t\t\t</td></tr>\n\t\t\t<tr><td width=\"100%\" colspan=\"2\" align=\"center\">\n\t\t\t<input class=\"jz_submit\" type=\"submit\" name=\"<?php echo jz_encode('submit_login'); ?>\" value=\"<?php echo word(\"Register\"); ?>\">\n\t\t\t</td></tr></table><br>\n\t\t\t</form>\n\t\t\t<?php\n\t\t $this->footer();\n\t }", "public function showRegistrationForm()\n {\n if (property_exists($this, 'registerView')) {\n return view($this->registerView);\n }\n\n $roles = Role::assignable()->orderBy('id')->get();\n return view('auth.register', compact('roles'));\n }", "function showform(){\n return view('registration');\n }", "public function showRegistrationForm()\n {\n return view('signup');\n }", "public function showRegistration()\n\t{\n\t\t# if the user is already authenticated then they can't register and they can't log in\n\t\t# so get them out of here.\n\t\tif( userIsAuthenticated() ) {\n\t\t\treturn Redirect::to('profile');\n\t\t}\n\n\t\t# if we get here then forget the redirect value as the user has used the global sign in link\n\t\t# and we won't need to take them anywhere specific after authentication\n\t\tSession::forget('previousPage');\n\n\t\t# error vars, something went wrong!\n\t\tif(Session::has('registration-errors')) {\n\t\t\t$errors = reformatErrors(Session::get('registration-errors')['errors']);\n\t\t\t$message = Session::get('registration-errors')['public'];\n\t\t\t$messageClass = \"danger\";\n\n\t\t\t# grab the old form data\n\t\t\t$input = Input::old();\n\t\t}\n\n\t\t# indicate what we're on to the view. This is used to prevent the auth/register pop up\n\t\t# when viewing these pages\n\t\t$page = \"register\";\n\n\t\t$pageTitle = \"Register\";\n\n\t\treturn View::make('register.index', compact('errors', 'message', 'messageClass', 'input', 'form', 'page', 'pageTitle'));\n\t}", "public function registerFamilyAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authRegisterParent' );\n }", "public function getRegisterView() {\n\t\t$header = $this->loginView->getHTMLForm();\n\t\t$body = $this->registerView->getHTMLForm();\n\t\t$footer = \"\";\n\t\treturn new \\common\\view\\Page(\"Bildblogg - registrera användare\", $header, $body, $footer);\n\t}", "function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show the home page instead (unless we just completed registering an account) */\n if ($this->Model_Account->amILoggedIn()) {\n if (!array_key_exists( 'registerMsg', $_SESSION )) {\n redirect( \"mainpage/index\", \"refresh\" );\n }\n }\n\n/* ... define values for template variables to display on page */\n $data['title'] = \"Account Registration - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"register\";\n\n/* ... complete our flow as we would for a normal page */\n $this->index( $data );\n\n/* ... time to go */\n return;\n }", "private function _show_registration_form(&$xregistration=null, $task='create')\n\t{\n\t\t$username = Request::getString('username', User::get('username'), 'get');\n\t\t$isSelf = (User::get('username') == $username);\n\n\t\t// Get the registration object\n\t\tif (!is_object($xregistration))\n\t\t{\n\t\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\t\t}\n\n\t\t// Push some values to the view\n\t\t$rules = \\Hubzero\\Password\\Rule::all()\n\t\t\t->whereEquals('enabled', 1)\n\t\t\t->rows();\n\n\t\t$password_rules = array();\n\n\t\tforeach ($rules as $rule)\n\t\t{\n\t\t\tif (!empty($rule['description']))\n\t\t\t{\n\t\t\t\t$password_rules[] = $rule['description'];\n\t\t\t}\n\t\t}\n\n\t\t$this->view->registrationUsername = Field::state('registrationUsername', 'RROO', $task);\n\t\t$this->view->registrationPassword = Field::state('registrationPassword', 'RRHH', $task);\n\t\t$this->view->registrationConfirmPassword = Field::state('registrationConfirmPassword', 'RRHH', $task);\n\t\t$this->view->registrationFullname = Field::state('registrationFullname', 'RRRR', $task);\n\t\t$this->view->registrationEmail = Field::state('registrationEmail', 'RRRR', $task);\n\t\t$this->view->registrationConfirmEmail = Field::state('registrationConfirmEmail', 'RRRR', $task);\n\t\t$this->view->registrationOptIn = Field::state('registrationOptIn', 'HHHH', $task);\n\t\t$this->view->registrationCAPTCHA = Field::state('registrationCAPTCHA', 'HHHH', $task);\n\t\t$this->view->registrationTOU = Field::state('registrationTOU', 'HHHH', $task);\n\n\t\tif ($task == 'update')\n\t\t{\n\t\t\tif (empty($this->view->xregistration->login))\n\t\t\t{\n\t\t\t\t$this->view->registrationUsername = Field::STATE_REQUIRED;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->view->registrationUsername = Field::STATE_READONLY;\n\t\t\t}\n\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\tif ($task == 'edit')\n\t\t{\n\t\t\t$this->view->registrationUsername = Field::STATE_READONLY;\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\tif (User::get('auth_link_id') && $task == 'create')\n\t\t{\n\t\t\t$this->view->registrationPassword = Field::STATE_HIDDEN;\n\t\t\t$this->view->registrationConfirmPassword = Field::STATE_HIDDEN;\n\t\t}\n\n\t\t$fields = Field::all()\n\t\t\t->including(['options', function ($option){\n\t\t\t\t$option\n\t\t\t\t\t->select('*')\n\t\t\t\t\t->ordered();\n\t\t\t}])\n\t\t\t->where('action_' . ($task == 'update' ? 'create' : $task), '!=', Field::STATE_HIDDEN)\n\t\t\t->ordered()\n\t\t\t->rows();\n\n\t\t// Display the view\n\t\t$this->view\n\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER'))\n\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t->set('config', $this->config)\n\t\t\t->set('task', $task)\n\t\t\t->set('fields', $fields)\n\t\t\t->set('showMissing', true)\n\t\t\t->set('isSelf', $isSelf)\n\t\t\t->set('password_rules', $password_rules)\n\t\t\t->set('xregistration', $xregistration)\n\t\t\t->set('registration', $xregistration->_registration)\n\t\t\t->setLayout('default')\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function registration() {\n return view('auth.registration');\n }", "public function display_account_register( ){\n\t\tif( $this->is_page_visible( \"register\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_register.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_register.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_register.php' );\n\t\t}\n\t}", "public function registration()\n {\n return view('auth.registration');\n }", "public function showRegistrationForm()\n {\n return redirect('login');\n }", "public function regi_form() {\n $template = $this->loadView('registration_page');\n // $template->set('result', $error);\n $template->render();\n }", "public function popupScreen() {\n\t\t$this->return_val->status = 1;\n\t\t$this->return_val->msg = \"\";\n\t\t$data[\"friends\"] = $this->formatDBFriends($this->CoverModel->getFriends($this->fb_user_info->facebook_id));\n\t\t$this->return_val->popup = $this->load->view(\"coverpopup\", $data, TRUE);\n\t\techo json_encode($this->return_val);\n\t}", "function display_popup_form($form_html)\r\n {\r\n Display :: normal_message($form_html);\r\n }", "function add_signup_shortcode()\n\t{ \n\t\n\t\tob_start();\n\t\t\n\t\tif ( !is_user_logged_in() ) \n\t\t{ \n\t\t\t\n\t\t\techo ' <div class=\"woocommerce\">';\n\t\t\t\n\t\t\tif(isset($_POST['register']) && sanitize_text_field ($_POST['register'] ) )\n\t\t\t{\n\t\t\n\t\t\t\t$nonce_check = isset($_POST['_wpnonce_phoe_register_form'])?sanitize_text_field( $_POST['_wpnonce_phoe_register_form'] ):'';\n\n\t\t\t\tif ( ! wp_verify_nonce( $nonce_check, 'phoe_register_form' ) ) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdie( 'Security check failed' ); \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$reg_email = isset($_POST['email'])?sanitize_email($_POST['email']):'';\n\t\t\t\t\n\t\t\t\t$reg_password = isset($_POST['password'])? sanitize_text_field($_POST['password']):'';\n\t\t\t\t\n\t\t\t\t$arr_name = explode(\"@\",$reg_email); \n\t\t\t\t\n\t\t\t\t$temp = $arr_name[0];\n\t\t\t\t\n\t\t\t\t$user = get_user_by( 'email',$reg_email );\t\t\t \n\t\t\t \n\t\t\t\tif($reg_email == '')\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li><strong>Error:</strong> Please provide a valid email address.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t </ul>';\n\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if($reg_password == '')\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li><strong>Error:</strong> Please enter an account password.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t </ul>';\n\t\t\t }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(is_email($reg_email))\n\t\t\t\t\t{ \t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(is_object($user) && $user->user_email == $reg_email)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\techo'<ul class=\"woocommerce-error\">\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<li><strong>Error:</strong> An account is already registered with your email address. Please login.</li>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t </ul>';\n\t\t\t\t\t\t}\n\t\t\t\t\t else\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && empty( $reg_password ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$reg_password = wp_generate_password();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$password_generated = true;\n\n\t\t\t\t\t\t\t\t} elseif ( empty( $reg_password ) ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn new WP_Error( 'registration-error-missing-password', __( 'Please enter an account password.', 'woocommerce' ) );\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$password_generated = false;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$userdata=array(\"role\"=>\"customer\",\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_email\"=>$reg_email,\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_login\"=>$temp,\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"user_pass\"=>$reg_password);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($user_id = wp_insert_user( $userdata ))\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\tdo_action('woocommerce_created_customer', $user_id, $userdata, $password_generated);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$user1 = get_user_by('id',$user_id);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\twp_set_current_user( $user1->ID, $user1->user_login );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t wp_set_auth_cookie( $user1->ID );\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t do_action( 'wp_login', $user1->user_login,$user1 );\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $location = home_url().\"/my-account/\"; \n\t\t\t\t\t\t\t\twp_redirect($location);\n\n\t\t\t\t\t\t\t exit;\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\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<ul class=\"woocommerce-error\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<li><strong>Error:</strong> Please provide a valid email address.</li>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</ul>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n?> \n\t\n\t\t\t<div class=\"col-set\" id=\"customer_login\">\n\t\t\t\t<div class=\"col\">\n\t\t\t\t\t<h2>Register</h2>\n\t\t\t\t\t<form method=\"post\" class=\"register\">\t\n\n\t\t\t\t\t\t<?php $nonce_register = wp_create_nonce( 'phoe_register_form' ); ?>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<input type=\"hidden\" value=\"<?php echo $nonce_register; ?>\" name=\"_wpnonce_phoe_register_form\" id=\"_wpnonce_phoe_register_form\" />\n\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t\t\t<label for=\"reg_email\">Email address <span class=\"required\">*</span></label>\n\t\t\t\t\t\t\t<input type=\"email\" class=\"input-text\" name=\"email\" id=\"reg_email\" value=\"<?php echo isset( $reg_email ) ? $reg_email: '' ; ?>\" >\n\t\t\t\t\t\t</p>\t\t\t\n\t\t\t\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t\t\t\t<label for=\"reg_password\">Password <span class=\"required\">*</span></label>\n\t\t\t\t\t\t\t\t<input type=\"password\" class=\"input-text\" name=\"password\" id=\"reg_password \" >\n\t\t\t\t\t\t\t</p>\t\t\t\n\t\t\t\t\t\t<div style=\"left: -999em; position: absolute;\"><label for=\"trap\">Anti-spam</label><input type=\"text\" name=\"email_2\" id=\"trap\" tabindex=\"-1\"></div>\t\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"form-row\">\n\t\t\t\t\t\t\t<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"70c2c9e9dd\"><input type=\"hidden\" name=\"_wp_http_referer\" value=\"<?php echo get_site_url(); ?>/my-account/\">\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button\" name=\"register\" value=\"Register\">\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n<?php \n\n\t\t}\n\t\t\n\t\treturn ob_get_clean();\n\t}", "public function showregistrationform(){\n return view('register');\n }", "function new_member_profile_form()\n {\n if ( ! Session::access('can_admin_members')) {\n return Cp::unauthorizedAccess();\n }\n\n Cp::$body_props = \" onload=\\\"document.forms[0].email.focus();\\\"\";\n\n $title = __('members.register_member');\n\n // Build the output\n $r = Cp::formOpen(['action' => 'C=Administration'.AMP.'M=members'.AMP.'P=register_member']);\n\n $r .= Cp::quickDiv('tableHeading', $title);\n $r .= Cp::div('box');\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password'),\n Cp::input_pass('password', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.password_confirm'),\n Cp::input_pass('password_confirm', '', '35', '32', 'input', '300px')\n );\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.screen_name'),\n Cp::input_text('screen_name', '', '40', '50', 'input', '300px')\n );\n\n $r .= '</td>'.PHP_EOL.\n Cp::td('', '45%', '', '', 'top');\n\n $r .= Cp::itemgroup(\n Cp::required().NBS.__('account.email'),\n Cp::input_text('email', '', '35', '100', 'input', '300px')\n );\n\n // Member groups assignment\n if (Session::access('can_admin_mbr_groups')) {\n $query = DB::table('member_groups')\n ->select('group_id', 'group_name')\n ->orderBy('group_name');\n\n if (Session::userdata('group_id') != 1)\n {\n $query->where('is_locked', 'n');\n }\n\n $query = $query->get();\n\n if ($query->count() > 0)\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::quickDiv('defaultBold', __('account.member_group_assignment'))\n );\n\n $r .= Cp::input_select_header('group_id');\n\n foreach ($query as $row)\n {\n $selected = ($row->group_id == 5) ? 1 : '';\n\n // Only SuperAdmins can assigned SuperAdmins\n if ($row->group_id == 1 AND Session::userdata('group_id') != 1) {\n continue;\n }\n\n $r .= Cp::input_select_option($row->group_id, $row->group_name, $selected);\n }\n\n $r .= Cp::input_select_footer();\n }\n }\n\n $r .= '</div>'.PHP_EOL;\n\n // Submit button\n\n $r .= Cp::itemgroup( '',\n Cp::required(1).'<br><br>'.Cp::input_submit(__('cp.submit'))\n );\n $r .= '</form>'.PHP_EOL;\n\n\n Cp::$title = $title;\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem($title);\n Cp::$body = $r;\n }", "public function onSignUp()\n {\n $data = post();\n $data['requires_confirmation'] = $this->requiresConfirmation;\n\n if (app(SignUpHandler::class)->handle($data, (bool)post('as_guest'))) {\n if ($this->requiresConfirmation) {\n return ['.mall-signup-form' => $this->renderPartial($this->alias . '::confirm.htm')];\n }\n\n return $this->redirect();\n }\n }", "public function new_password_form()\n {\n $markers = array();\n $markers['errors'] = $this->Register['Validate']->getErrors();\n if (isset($_SESSION['FpsForm'])) unset($_SESSION['FpsForm']);\n\n\n $markers['action'] = get_url('/users/send_new_password/');\n $source = $this->render('newpasswordform.html', array('context' => $markers));\n\n\n // Navigation PAnel\n $nav = array();\n $nav['navigation'] = get_link(__('Home'), '/') . __('Separator')\n . get_link(h($this->module_title), '/users/') . __('Separator') . __('Password repair');\n $this->_globalize($nav);\n\n\n return $this->_view($source);\n }", "function viewSignUpForm() {\n\t$view = new viewModel();\n\t$view->showSignUpForm();\t\n}", "public function logInRegisterPage();", "public function loginRegister () {\n \treturn view(\"Socialite.login-register\");\n }", "public function registration() {\n $this->load->view('header');\n $this->load->view('user_registration');\n $this->load->view('footer');\n }", "public function showRegistrationForm()\n {\n $jurusan = \\App\\Models\\Jurusan::where('active', 1)->get();\n return view('auth.register', ['jurusan' => $jurusan]);\n }", "public function showRegistrationForm()\n {\n $countries = Country::all();\n $counties = County::all();\n $nationalities = Nationality::all();\n\n return view('auth.register', compact('countries', 'counties', 'nationalities'));\n }", "public function showRegistrationForm()\n {\n $groups = Group::all();\n return view('auth.register', compact('groups'));\n }", "protected function renderSignUp(){\n return '<form class=\"forms\" action=\"'.Router::urlFor('check_signup').'\" method=\"post\">\n <input class=\"forms-text\" type=\"text\" name=\"fullname\" placeholder=\"Nom complet\">\n <input class=\"forms-text\" type=\"text\" name=\"username\" placeholder=\"Pseudo\">\n <input class=\"forms-text\" type=\"password\" name=\"password\" placeholder=\"Mot de passe\">\n <input class=\"forms-text\" type=\"password\" name=\"password_verify\" placeholder=\"Retape mot de passe\">\n <button class=\"forms-button\" name=\"login_button\" type=\"submit\">Créer son compte</button>\n </form>';\n }", "public static function custom_registration_fields()\n\t\t\t\t\t{\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_before_custom_registration_fields\", get_defined_vars());\n\n\t\t\t\t\t\t$_p = (!empty($_POST)) ? c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST)) : array();\n\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"ws_plugin__s2member_registration\" value=\"'.esc_attr(wp_create_nonce(\"ws-plugin--s2member-registration\")).'\" />'.\"\\n\";\n\n\t\t\t\t\t\t$tabindex = 20; // Incremented tabindex starting with 20.\n\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_password\"])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_user_pass\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-user-pass1\" title=\"'.esc_attr(_x(\"Please type your Password twice to confirm.\", \"s2member-front\", \"s2member\")).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"Password (please type it twice)\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"password\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_user_pass1\" id=\"ws-plugin--s2member-custom-reg-field-user-pass1\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.format_to_edit(@$_p[\"ws_plugin__s2member_custom_reg_field_user_pass1\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-user-pass2\" title=\"'.esc_attr(_x(\"Please type your Password twice to confirm.\", \"s2member-front\", \"s2member\")).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"password\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_user_pass2\" id=\"ws-plugin--s2member-custom-reg-field-user-pass2\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.format_to_edit(@$_p[\"ws_plugin__s2member_custom_reg_field_user_pass2\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '<div id=\"ws-plugin--s2member-custom-reg-field-user-pass-strength\" class=\"ws-plugin--s2member-password-strength\"><em>'._x(\"password strength indicator\", \"s2member-front\", \"s2member\").'</em></div>'.\"\\n\";\n\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_user_pass\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_names\"])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<div class=\"ws-plugin--s2member-custom-reg-field-divider-section\"></div>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_first_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-first-name\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"First Name\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"text\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_first_name\" id=\"ws-plugin--s2member-custom-reg-field-first-name\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.esc_attr(@$_p[\"ws_plugin__s2member_custom_reg_field_first_name\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_first_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_last_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-last-name\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<span>'._x(\"Last Name\", \"s2member-front\", \"s2member\").' *</span><br />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"text\" aria-required=\"true\" maxlength=\"100\" autocomplete=\"off\" name=\"ws_plugin__s2member_custom_reg_field_last_name\" id=\"ws-plugin--s2member-custom-reg-field-last-name\" class=\"ws-plugin--s2member-custom-reg-field form-control\" value=\"'.esc_attr(@$_p[\"ws_plugin__s2member_custom_reg_field_last_name\"]).'\" tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_last_name\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"])\n\t\t\t\t\t\t\tif($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level(\"auto-detection\", \"registration\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tabindex = /* Start tabindex at +9 ( +1 below ). */ $tabindex + 9;\n\n\t\t\t\t\t\t\t\t\tforeach(json_decode($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"], true) as $field)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_custom_fields\", get_defined_vars());\n\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\t\t\t\tif /* Field applicable? */(in_array($field[\"id\"], $fields_applicable))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$field_var = preg_replace(\"/[^a-z0-9]/i\", \"_\", strtolower($field[\"id\"]));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$field_id_class = preg_replace(\"/_/\", \"-\", $field_var);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(apply_filters(\"ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display\", true, get_defined_vars()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif /* Starts a new section? */(!empty($field[\"section\"]) && $field[\"section\"] === \"yes\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"ws-plugin--s2member-custom-reg-field-divider-section'.((!empty($field[\"sectitle\"])) ? '-title' : '').'\">'.((!empty($field[\"sectitle\"])) ? $field[\"sectitle\"] : '').'</div>';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-'.esc_attr($field_id_class).'\">'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<span'.((preg_match(\"/^(checkbox|pre_checkbox)$/\", $field[\"type\"])) ? ' style=\"display:none;\"' : '').'>'.$field[\"label\"].(($field[\"required\"] === \"yes\") ? ' *' : '').'</span></label>'.((preg_match(\"/^(checkbox|pre_checkbox)$/\", $field[\"type\"])) ? '' : '<br />').\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo c_ws_plugin__s2member_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, \"ws_plugin__s2member_custom_reg_field_\", \"ws-plugin--s2member-custom-reg-field-\", \"ws-plugin--s2member-custom-reg-field\", \"\", ($tabindex = $tabindex + 1), \"\", $_p, @$_p[\"ws_plugin__s2member_custom_reg_field_\".$field_var], \"registration\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_custom_fields\", get_defined_vars());\n\t\t\t\t\t\t\t\t\t\t\tunset($__refs, $__v);\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\tif($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in\"] && c_ws_plugin__s2member_list_servers::list_servers_integrated())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_before_opt_in\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\t\t\techo '<p>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<label for=\"ws-plugin--s2member-custom-reg-field-opt-in\">'.\"\\n\";\n\t\t\t\t\t\t\t\techo '<input type=\"checkbox\" name=\"ws_plugin__s2member_custom_reg_field_opt_in\" id=\"ws-plugin--s2member-custom-reg-field-opt-in\" class=\"ws-plugin--s2member-custom-reg-field\" value=\"1\"'.(((empty($_p) && $GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in\"] == 1) || @$_p[\"ws_plugin__s2member_custom_reg_field_opt_in\"]) ? ' checked=\"checked\"' : '').' tabindex=\"'.esc_attr(($tabindex = $tabindex + 10)).'\" />'.\"\\n\";\n\t\t\t\t\t\t\t\techo $GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_opt_in_label\"].\"\\n\";\n\t\t\t\t\t\t\t\techo '</label>'.\"\\n\";\n\t\t\t\t\t\t\t\techo '</p>'.\"\\n\";\n\n\t\t\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after_opt_in\", get_defined_vars());\n\t\t\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_during_custom_registration_fields_after\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\n\t\t\t\t\t\tforeach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;\n\t\t\t\t\t\tdo_action(\"ws_plugin__s2member_after_custom_registration_fields\", get_defined_vars());\n\t\t\t\t\t\tunset($__refs, $__v);\n\t\t\t\t\t}", "public function getRegistration()\n {\n //output\n return view('auth.registration');\n }", "public function getPopup() {}", "public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }", "function display() {\n\n\t\t$model = $this->getModel('provider');\n\n\t\t$usersConfig = &JComponentHelper::getParams( 'com_users' );\n\t\tif (!$usersConfig->get( 'allowUserRegistration' )) {\n\t\t\tJError::raiseError( 403, JText::_( 'Access Forbidden' ));\n\t\t\treturn;\n\t\t}\n\n\t\t$user \t=& JFactory::getUser();\n\n\t\tif ( $user->get('guest')) {\n\t\t\tJRequest::setVar('view', 'provider_request');\n\t\t} else {\n\t\t\t$this->setredirect('index.php?option=com_users&task=edit',JText::_('You are already registered.'));\n\t\t}\n\n\n if( !JRequest::getVar( 'view' )) {\n\t\t JRequest::setVar('view', 'provider_request' );\n }\n\n\t\t$view = $this->getView( 'provider_request', 'html' );\n\t\t$view->setModel( $this->getModel( 'provider', 'providerModel' ), true );\n\t\t$view->display();\n\t\t//parent::display();\n\t}", "public function signupForm()\n {\n \t# code...\n \treturn view(\"external-pages.sign-up\");\n }", "public function gluu_sso_form()\n {\n // add taskbar button\n\n $boxTitle = html::div(array('id' => \"prefs-title\", 'class' => 'boxtitle'), $this->gettext('hederGluu'));\n $this->include_stylesheet('GluuOxd_Openid/css/gluu-oxd-css.css');\n $this->include_script('GluuOxd_Openid/js/scope-custom-script.js');\n\n $tableHtml=$this->admin_html();\n unset($_SESSION['message_error']);\n unset($_SESSION['message_success']);\n return html::div(array('class' => ''),$boxTitle . html::div(array('class' => \"boxcontent\"), $tableHtml ));\n }", "public function formRegistrazionePrivato() {\n $this->smarty->display('reg_privato.tpl');\n }", "public function display() {\n\n\t\t// Register WP built-in Thickbox for popup.\n\t\tadd_thickbox();\n\n\t\tparent::display();\n\t}", "public function user_signin_register_pre_register_form($h)\n {\n //include unauthenticated user view\n\t\tinclude \"templates/inc_unauthenticated_user.php\";\n }", "function sdds_registration_form()\n{\n if (!is_user_logged_in())\n {\n global $load_affiliate_css;\n //set to true so css is loaded\n $load_affiliate_css = true;\n $registration_enabled = get_option('users_can_register');\n\n if ($registration_enabled)\n {\n $output = sdds_registration_form_fields();\n }\n else\n {\n $output = __('User registration is not allowed. Contact the site admin to change this setting');\n }\n return $output;\n }\n else\n {\n $output = __(\"You're already logged in\");\n }\n}", "public function showReg()\n {\n //show the form\n if (Auth::check())\n {\n return Redirect::route('account');\n }\n\n // Show the page\n return View::make('account.reg');\n }", "public function registrationForm() {\n\n }", "public function getRegistration()\n {\n return view('social.register');\n }", "function register(){\n echo Template::instance()->render('gatorLock/register.php');\n}", "function showLoginForm() {\n}" ]
[ "0.6570414", "0.651452", "0.6450565", "0.64338094", "0.63390696", "0.6301324", "0.62267715", "0.62121123", "0.61955094", "0.6168004", "0.6158292", "0.6154698", "0.61509985", "0.6123401", "0.61215955", "0.6116056", "0.60746676", "0.6066945", "0.6065777", "0.6047308", "0.60373676", "0.6033634", "0.60259676", "0.60127515", "0.6011206", "0.59849125", "0.5983473", "0.59768194", "0.5958762", "0.5958426", "0.5955417", "0.5922865", "0.5920573", "0.59032404", "0.58996874", "0.58714944", "0.58526486", "0.58484125", "0.58470285", "0.5836846", "0.58346236", "0.5817499", "0.5806707", "0.5795502", "0.5795502", "0.57811093", "0.57663167", "0.57549745", "0.57510245", "0.5740574", "0.5739954", "0.5728655", "0.5722033", "0.5721796", "0.57088834", "0.5707887", "0.5696332", "0.56896937", "0.5682742", "0.5675401", "0.56727827", "0.56663775", "0.5657666", "0.5653934", "0.5649702", "0.5648523", "0.5638285", "0.56349283", "0.5626975", "0.56263703", "0.5621055", "0.5617956", "0.5616355", "0.5613623", "0.5613072", "0.56108385", "0.5610238", "0.56008786", "0.55920815", "0.55816585", "0.55683315", "0.5566072", "0.5553317", "0.55496496", "0.5539343", "0.5532483", "0.55238605", "0.55158657", "0.5515673", "0.5510882", "0.5508545", "0.55081433", "0.5505951", "0.54941136", "0.54921913", "0.549017", "0.5488548", "0.5479994", "0.54793906", "0.54682136" ]
0.7435636
0
redeem_points. This method is used to render Redeem Points form
public function redeem_points() { $rewardProgrammeName = Mage::getStoreConfig('lbconfig_section/lb_settings_group/reward_programme_name_field'); Lb_Points_Helper_Data::$rewardProgrammeName = $rewardProgrammeName; if(isset($_SESSION['LB_Session'])) { if(!empty($_SESSION['LB_Session'])) { $LB_Session = $_SESSION['LB_Session']; Lb_Points_Helper_Data::debug_log("Rendered session user with his LB Points", true); ?> <div class="redeem_lbpoints lb-box"> <form id="frmRedeemPoints" onsubmit=" return false;"> <label> Want to Redeem Loyalty Points? <a class="btnShowRedeem" href="javascript:void(0);" >Click here</a> to redeem. </label> <div class="lb-redeem-wrapper"> <label>Enter Loyalty Points</label> <input type="text" class="input-text required-entry lb-double" value="" title="Enter Loyalty points" placeholder="Enter Loyalty points" id="txtRedeemPoints" name="txtRedeemPoints"> <div class="redeemMsg"></div> <div class="button-wrapper"> <button id="btnRedeemPoints" value="Redeem" class="button" title="Redeem" type="button"><span><span>Redeem</span></span></button> <!-- button value="Cancel" class="button btnShowRedeem" title="Cancel" type="button"><span><span>Cancel</span></span></button --> </div> </div> </form> </div> <script> // Redeem points jQuery(".btnShowRedeem").click(function(){ jQuery(".lb-redeem-wrapper").toggle('display'); }); var frmRedeemPoints = 'frmRedeemPoints'; var redeemPoints = new VarienForm(frmRedeemPoints, true); Validation.add('lb-double', 'Please enter a number greater than 0 in this field.', function(v) { return (v > 0); // || /^\s+$/.test(v)); }); jQuery("#btnRedeemPoints").click(function(){ if (redeemPoints.validator.validate()) { jQuery(this).attr('disabled','disabled'); var postUrl = "<?php echo Mage::getBaseUrl() . 'lb/index/redeem' ?>"; var txtRedeemPoints = jQuery("#txtRedeemPoints").val(); jQuery.post(postUrl,{'txtRedeemPoints':txtRedeemPoints},function(response) { if(response.status == '1'){ jQuery(".redeemMsg").html(response.message).addClass( "frm_success" ); window.location.reload(); } else{ jQuery(".redeemMsg").html(response.message).addClass( "frm_error" ); jQuery("#btnRedeemPoints").removeAttr('disabled'); } },'JSON'); } }); </script> <style> .lb-box { background-color: #f4f4f4; border: 1px solid #cccccc; padding: 10px; margin-bottom: 20px; } .lb-redeem-wrapper label,.redeemMsg{ padding-bottom: 5px; } </style> <?php } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redeemAction(){\n $txtRedeemPoints = $_POST['txtRedeemPoints'];\n $quoteData = Mage::getSingleton('checkout/session')->getQuote();\n \n $CartContentsTotal = $quoteData['subtotal'];\n $CartTotal = $quoteData['grand_total'];\n \n if(!empty($txtRedeemPoints)){\n $LB_Session = $_SESSION['LB_Session'];\n if (!empty($LB_Session)) {\n // confirm loyalty points available or not and update to session if available.\n $CardOrPhoneNumber = $LB_Session['Phone Number'];\n $CardPoints = Lb_Points_Helper_Data::getCardPoints($CardOrPhoneNumber);\n $InquiryResult = $CardPoints->InquiryResult;\n $balances = $InquiryResult->balances;\n $Balance = $balances->balance;\n foreach ($Balance as $balValue) {\n if ($balValue->valueCode == 'Discount') {\n $_SESSION['LB_Session']['lb_discount'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_discount_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_discount_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'Points') {\n $_SESSION['LB_Session']['lb_points'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_points_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_points_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'ZAR') {\n $_SESSION['LB_Session']['lb_zar'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_zar_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_zar_exchangeRate'] = $balValue->exchangeRate;\n }\n }\n Lb_Points_Helper_Data::debug_log(\"LB API called : Inquiry to check Points Balance\", true);\n \n $totalRedeemPoints = 0;\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $totalRedeemPoints = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n }\n \n if($totalRedeemPoints == 0){\n $totalRedeemPoints = $txtRedeemPoints;\n }\n \n if ($txtRedeemPoints > 0 && $totalRedeemPoints <= $CartTotal && is_numeric($txtRedeemPoints)) {\n \n if ($_SESSION['LB_Session']['lb_points'] >= $totalRedeemPoints) {\n //self::generate_discount_coupon($txtRedeemPoints, 'fixed_cart', 'REDEEM');\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $_SESSION['LB_Session']['totalRedeemPoints'] = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n else\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n else\n {\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n $message = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and applied discount to your cart.\";\n $messageJson = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and discount is being applied to your cart.\";\n Mage::getSingleton('core/session')->addSuccess($message);\n echo json_encode(array('status' => 1, 'message' => $messageJson));\n }else {\n echo json_encode(array('status' => 0, 'message' => \"You don't have sufficient Loyalty Points to redeem.\"));\n }\n } else {\n echo json_encode(array('status' => 0, 'message' => \"Please enter valid Loyalty Points.\"));\n }\n }\n else\n echo json_encode(array('status' => 0, 'message' => Lb_Points_Helper_Data::$rewardProgrammeName.\" session expired.\"));\n }\n else\n echo json_encode(array('status' => 0, 'message' => \"Please enter loyalty points.\"));\n die;\n }", "function points_vouchers()\n\t\t{\n\t\t\tif ( ! $this->data['user'])\n\t\t\t{\n\t\t\t\t$this->flexi_cart_admin->set_error_message('You must login to view reward points and vouchers.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t$user_id = $this->data['user']->id;\n\n\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t$this->load->model('demo_cart_admin_model');\n\n\t\t\t// Check if POST data has been submitted, if so, call the custom demo model function to handle the submitted data.\n\t\t\tif ($this->input->post('convert_reward_points'))\n\t\t\t{\n\t\t\t\t$this->demo_cart_admin_model->demo_convert_reward_points($user_id);\n\t\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\tredirect(current_url());\n\t\t\t}\n\n\t\t\t$this->load->model('users_model');\n\n\t\t\t// Variable \"person\" is used because \"user\" is already being used for currently signed in user.\n\t\t\t$this->data['person'] = $this->users_model->get_details($user_id);\n\n\t\t\t// Get an array of all the reward vouchers filtered by the id in the url.\n\t\t\t// Using flexi cart SQL functions, join the demo user table with the discount table.\n\t\t\t$sql_where = array($this->flexi_cart_admin->db_column('discounts', 'user') => $user_id);\n\t\t\t// $this->flexi_cart_admin->sql_join('demo_users', 'user_id = '.$this->flexi_cart_admin->db_column('discounts', 'user'));\n\t\t\t$this->data['voucher_data_array'] = $this->flexi_cart_admin->get_db_voucher_query(FALSE, $sql_where)->result_array();\n\n\t\t\t// Get user remaining reward points.\n\t\t\t$summary_data = $this->flexi_cart_admin->get_db_reward_point_summary($user_id);\n\t\t\t$this->data['points_data'] = array(\n\t\t\t\t'total_points' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points')],\n\t\t\t\t'total_points_pending' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_pending')],\n\t\t\t\t'total_points_active' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_active')],\n\t\t\t\t'total_points_active' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_active')],\n\t\t\t\t'total_points_expired' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_expired')],\n\t\t\t\t'total_points_converted' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_converted')],\n\t\t\t\t'total_points_cancelled' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_cancelled')]\n\t\t\t);\n\n\t\t\t// Get an array of a demo user and their related reward points from a custom demo model function, filtered by the id in the url.\n\t\t\t$reward_data = $this->demo_cart_admin_model->demo_reward_point_summary($user_id);\n\t\t\t\n\t\t\t// Note: The custom function returns a multi-dimensional array, of which we only need the first array, so get the first row '$user_data[0]'.\n\t\t\t$this->data['reward_data'] = $reward_data[0];\n\n\t\t\t// Get the conversion tier values for converting reward points to vouchers.\n\t\t\t$conversion_tiers = $this->data['reward_data'][$this->flexi_cart_admin->db_column('reward_points', 'total_points_active')];\n\t\t\t$this->data['conversion_tiers'] = $this->flexi_cart_admin->get_reward_point_conversion_tiers($conversion_tiers);\n\n\t\t\t// Get an array of all reward points for a user.\n\t\t\t$sql_select = array(\n\t\t\t\t$this->flexi_cart_admin->db_column('reward_points', 'order_number'),\n\t\t\t\t$this->flexi_cart_admin->db_column('reward_points', 'description'),\n\t\t\t\t$this->flexi_cart_admin->db_column('reward_points', 'order_date')\n\t\t\t);\t\n\t\t\t$sql_where = array($this->flexi_cart_admin->db_column('reward_points', 'user') => $user_id);\n\t\t\t$this->data['points_awarded_data'] = $this->flexi_cart_admin->get_db_reward_points_query($sql_select, $sql_where)->result_array();\n\t\t\t\n\t\t\t// Call a custom function that returns a nested array of reward voucher codes and the reward point data used to create the voucher.\n\t\t\t$this->data['points_converted_data'] = $this->demo_cart_admin_model->demo_converted_reward_point_history($user_id);\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/points_and_vouchers_view', $this->data);\n\t\t}", "function addpoints(){\n\t\t$this->autoRender = false;\n\t\t\n\t\t//Login Check\n\t\tif (!$this->Session->read('userData')){\n\t\t\t$this->redirect(array('controller' => 'user', 'action' => 'login'));\n\t\t\t$this->set('loggedIn',false);\n\t\t}else{\n\t\t\t$this->set('loggedIn',true);\n\t\t}\n\t\tif ($this->request->is('post')) {\n\t\t\t$data = $this->request->data;\n\t\t\t\n\t\t\t//Validation of input data\n\t\t\t$this->Player->set($this->request->data);\n\t\t\tif ($this->Player->validates(array('fieldList' => array('id', 'points')))) {\n\t\t\t\t// validated inputs\n\t\t\t\ttry {\n\t\t\t\t\t$updated = $this->Player->addPoints($data);\n\t\t\t\t\t$this->redirect(array('controller' => 'player', 'action' => 'index'));\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$this->Session->setFlash('Error adding points', 'default', array('class' => 'bg-danger'));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// invalid inputs\n\t\t\t\t$msg = '';\n\t\t\t\t$errors = $this->Player->validationErrors;\n\t\t\t\tforeach ($errors as $error){ $msg .= $error[0].'<br />'; };\n\t\t\t\t$this->Session->setFlash($msg, 'default', array('class' => 'bg-danger'));\n\t\t\t\t$this->redirect(array('controller' => 'player', 'action' => 'index'));\n\t\t\t}\n\t\t}\n\t}", "public function edit(Points $points)\n {\n //\n }", "function givePoints() {\n if ($this->is()) {\n // ponizsza funkcja jest dostarczona przez PayBack\n // pb_give_points($this->getPaybackLogin(),$this->calcPoints(),$_SESSION['global_order_id']);\n } else return false;\n }", "public function givePointsForRepost(User $user, $points, $state = 'new')\n {\n $person = $this->_em->getRepository('ZenomaniaCoreBundle:Person')->findPersonByUser($user);\n $season = $this->_em->getRepository('ZenomaniaCoreBundle:Season')->findCurrentSeason();\n\n $params = [\n 'season' => $season,\n 'person' => $person,\n 'user' => $user,\n 'points' => $points,\n 'type' => PersonPoints::TYPE_REPOST,\n 'state' => $state,\n 'dt' => new \\DateTime(),\n 'operation_type' => PersonPoints::OPERATION_TYPE_DEBIT\n ];\n\n $personPoints = PersonPoints::fromArray($params);\n $this->_em->persist($personPoints);\n\n $this->_em->flush();\n\n return $personPoints;\n }", "public function getPoints_post() {\n $this->form_validation->set_rules('PointsCategory', 'PointsCategory', 'trim|in_list[Normal,InPlay,Reverse]');\n $this->form_validation->validation($this); /* Run validation */\n\n $PointsData = $this->SnakeDrafts_model->getPoints($this->Post);\n if (!empty($PointsData)) {\n $this->Return['Data'] = $PointsData['Data'];\n }\n }", "public static function get_the_total_redeem_points_for_order($order) {\n $status = get_option('rs_order_status_control');\n global $wpdb;\n $table_name = $wpdb->prefix . 'rsrecordpoints';\n $orderid = $order->id;\n $gettotalredeempoints = $wpdb->get_results(\"SELECT redeempoints FROM $table_name WHERE orderid=$orderid\", ARRAY_A);\n $orderstatus = $order->post_status;\n if (is_array($status)) {\n foreach ($status as $statuses) {\n $statusstr = $statuses;\n }\n }\n $replacestatus = str_replace('wc-completed', $statusstr, $orderstatus);\n if (get_option('rs_enable_msg_for_redeem_points') == 'yes') {\n if (in_array($replacestatus, $status)) {\n $totalredeemvalue = \"\";\n $redeem_total = $gettotalredeempoints;\n if (is_array($redeem_total)) {\n foreach ($redeem_total as $key => $value) {\n $totalredeemvalue+=$value['redeempoints'];\n }\n $msgforredeempoints = get_option('rs_msg_for_redeem_points');\n $roundofftype = get_option('rs_round_off_type') == '1' ? '2' : '0';\n $replacemsgforredeempoints = str_replace('[redeempoints]', $totalredeemvalue != \"\" ? round($totalredeemvalue, $roundofftype) : \"0\", $msgforredeempoints);\n echo '<b>' . $replacemsgforredeempoints . '</b>';\n }\n }\n }\n }", "function point() {\n $item = filter($this->uri->segment(3), 'str', 40);\n\n if ($this->input->is_ajax_request() && $item) {\n return $this->_save($item);\n }\n \n if ( ! $item) {\n redirect(config_item('site_url'));\n }\n\n $point = $this->point->get_by_id($item);\n\n if ( ! $point || empty($point)) {\n log_write(LOG_WARNING, 'Point object not found, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n redirect(config_item('site_url'));\n }\n\n if ($point->item_author != $this->auth->get_user_id() || $point->item_status != STATUS_DRAFT) {\n log_write(LOG_WARNING, 'Point object form access error, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n redirect(config_item('site_url'));\n }\n\n $this->TPLVAR['title'] = 'Редактирование проблемы';\n $this->TPLVAR['data'] = $point;\n $this->TPLVAR['photos'] = $this->media->get_by_point($point->item_id);\n $this->TPLVAR['category'] = $this->category->get_all();\n \n $this->load->view('form', $this->TPLVAR);\n }", "public function makeGiftcard()\n\t{\n\t\t$user_id = Input::get('gc_user_id');\n\t\t$gc_points = Input::get('gc_points');\n\t\t$gc_price = Input::get('gc_price');\n\t\tAuth::user()->points_earned;\n\t\t$email_id = Auth::user()->email ;\n\t\t\n\t\t$set_giftcard_id = 0;\n\t\tif( $gc_points <= Auth::user()->points_earned-Auth::user()->points_spent ){\n\t\t\t\t//echo \"points avaiable\";\n\n\t\t\t\tDB::insert(\"insert into redeem_giftcard(user_id)values($user_id)\");\n\t\t\t\t$last_id = DB::select(\"select id from redeem_giftcard order by id desc limit 1\");\n\t\t\t\t$membership_query = DB::select(\"select attribute_value from user_attributes_varchar where user_id=$user_id limit 1\");\n\t\t\t\t//echo \"sad = \".$last_id;\n\t\t\t\t$getMembership_number = $membership_query[0]->attribute_value;\n\n\t\t\t\tif(empty($getMembership_number))\n\t\t\t\t{\n\t\t\t\t\t$membership_number = 'NULL';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$membership_number = $membership_query[0]->attribute_value;\n\t\t\t\t}\n\n\t\t\t\tif(empty($last_id)){\n\t\t\t\t\t$set_giftcard_id = 1;\n\t\t\t\t}else{\n\t\t\t\t\t$set_giftcard_id = $last_id[0]->id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\t$quantity = 1;\n\t\t\t\tif($gc_price == 500){\n\t\t\t\t\t$reward_id = 1;\n\t\t\t\t\t$description = \"Redeemed Rs.500 - GPRED\".sprintf(\"%04d\",$set_giftcard_id);\t\n\t\t\t\t}else if($gc_price == 1000){\n\t\t\t\t\t$reward_id = 2;\n\t\t\t\t\t$description = \"Redeemed Rs.1000 - GPRED\".sprintf(\"%04d\",$set_giftcard_id);\n\t\t\t\t}else if($gc_price == 1500){\n\t\t\t\t\t$reward_id = 3;\n\t\t\t\t\t$description = \"Redeemed Rs.1500 - GPRED\".sprintf(\"%04d\",$set_giftcard_id);\n\t\t\t\t}\n\t\t\t\t$pointsRedeemed = $quantity * $gc_points;\n\t\t\t\tDB::insert(\"insert into reward_points_redeemed(user_id,order_id,points_redeemed,description)\n\t\t\t\t\t\t\tvalues('$user_id','$reward_id','$pointsRedeemed','$description')\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$spent = $gc_points * $quantity;\n\t\t\t\t\n\t\t\t\tDB::update('UPDATE users SET points_spent = points_spent + '.$spent.' WHERE id = '.$user_id);\n\t\t\t\t\n\t\t\t\t$sent = Mail::send('site.pages.rewards_request_mail',\n\t\t\t\t\t\t['quantity'=> $quantity,\n\t\t\t\t\t\t 'email_id'=> $email_id,\n\t\t\t\t\t\t 'membership_number'=> $membership_number,\n\t\t\t\t\t\t 'description'=> $description,\n\t\t\t\t\t\t 'points_spent'=> $spent,\n\t\t\t\t\t\t 'set_giftcard_id'=> $set_giftcard_id,], function($message) {\n\t\t\t\t\t\t$message->from('[email protected]', 'WowTables by GourmetItUp');\n\n\t\t\t\t\t\t$message->to('[email protected]')->subject('Rewards Request');\n\t\t\t\t\t\t$message->cc('[email protected]', '[email protected]');\n\t\t\t\t});\n\t\t\t\tif($sent)\n\t\t\t\t{\n\t\t\t\t\t$msg = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$msg = 2;\n\t\t\t\t}\n\n\t\t\t\t Mail::send('site.pages.rewards_request_mail_user',\n\t\t\t\t\t\t['quantity'=> $quantity,\n\t\t\t\t\t\t 'email_id'=> $email_id,\n\t\t\t\t\t\t 'membership_number'=> $membership_number,\n\t\t\t\t\t\t 'description'=> $description,\n\t\t\t\t\t\t 'points_spent'=> $spent,\n\t\t\t\t\t\t 'set_giftcard_id'=> $set_giftcard_id,], function($message) use ($email_id) {\n\t\t\t\t\t\t$message->from('[email protected]', 'WowTables by GourmetItUp');\n\n\t\t\t\t\t\t$message->to($email_id)->subject('Your Gourmet Rewards redemption request was successful');\n\t\t\t\t\t\t//$message->cc('[email protected]', '[email protected]');\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$msg = 3;\n\t\t\t}\n\t\t\techo json_encode ( array('message' => $msg,'giftcard_id' => 'GPRED'.sprintf(\"%04d\",$set_giftcard_id)));\n\t}", "public function redeembivapoints($orderId){\n\t\t$this->db->where('CustomerMail', $this->session->userdata('useremail'));\n\t\t$this->db->select_sum('EarnedPotint');\n\t\t$this->db->from('tbl_bvpoint_data');\n\t\t$query = $this->db->get();\n\t\t$sumvalue=$query->row()->EarnedPotint;\n\t\t//echo $sumvalue;\n\t\tif($sumvalue>100){\n\t\t\t$redeempoint=100;\n\t\t}\n\t\telse{\n\t\t\t$redeempoint=$sumvalue;\n\t\t}\n\n\t\t$redeempoint=-1*abs($redeempoint);\n\t\t$note=\"Purchased (#ORDBPH\".$orderId.\") And Redeemed \".$redeempoint.\" Biva Points\";\n\t\t$data=array(\n\t\t\t'CustomerMail' => $this->session->userdata('useremail'),\n\t\t\t'TrDate' => date('Y/m/d H:i:s'),\n\t\t\t'OrderId' => $orderId,\n\t\t\t'ReferedTo' => null,\n\t\t\t'EarnedPotint' => $redeempoint,\n\t\t\t'Note' => $note,\n\n\t\t);\n\t\t$this->db->insert('tbl_bvpoint_data', $data);\n\t}", "public static function update_reward_points_for_google_plus_share() {\n $userid = get_current_user_id();\n global $wpdb;\n $table_name = $wpdb->prefix . 'rspointexpiry'; \n $banning_type = FPRewardSystem::check_banning_type($userid);\n if ($banning_type != 'earningonly' && $banning_type != 'both') {\n if (get_option('timezone_string') != '') {\n $timezonedate = date_default_timezone_set(get_option('timezone_string'));\n } else {\n $timezonedate = date_default_timezone_set('UTC');\n }\n\n if (isset($_POST['state']) && ($_POST['postid']) && ($_POST['currentuserid'])) {\n $getregularprice = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($_POST['postid'], '_regular_price');\n $postid = $_POST['postid'];\n $currentuserid = $_POST['currentuserid']; \n $getarrayids[] = $_POST['postid'];\n $oldoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsgoogleshares');\n if (!empty($oldoption)) {\n if (!in_array($_POST['postid'], $oldoption)) {\n $mergedata = array_merge((array) $oldoption, $getarrayids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleshares', $mergedata);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }else {\n _e('You already Shared this post on Goole+1', 'rewardsystem');\n }\n }else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleshares', $getarrayids);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }\n \n if ($_POST['state'] == 'off') {\n $getarrayunlikeids[] = $_POST['postid'];\n $oldunlikeoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsgoogleplusunlikes');\n if (!empty($oldunlikeoption)) {\n if (!in_array($_POST['postid'], $oldunlikeoption)) {\n $mergedunlikedata = array_merge((array) $oldunlikeoption, $getarrayunlikeids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleplusunlikes', $mergedunlikedata);\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n } else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleplusunlikes', $getarrayunlikeids);\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n }\n echo \"Ajax Call Successfully Triggered\"; \n }\n do_action('fp_reward_point_for_google_plus_share');\n exit();\n }\n }", "public function gopointReedem($goPointsToken)\n\t{\n\t\t$ch = new Curl();\n\t\t\n\t\t$this->headers['Authorization'] = 'Bearer ' . $this->authToken;\n\t\t\n\t\t$data = [];\n\t\t\n\t\treturn $ch->post(GojekID::BASE_ENDPOINT . Action::gopointReedem . '?' . http_build_query([ 'points_token_id' => $goPointsToken ]), $data, $this->headers)->getResponse();\n\t}", "public function send_redeem_request(Request $request) {\n\n // Get admin configured - Minimum Provider Credit\n\n $minimum_redeem = Setting::get('minimum_redeem' , 1);\n\n // Get Provider Remaining Credits \n\n $redeem_details = Redeem::where('user_id' , $request->id)->first();\n\n if($redeem_details) {\n\n\n $remaining = $redeem_details->remaining;\n\n // check the provider have more than minimum credits\n\n if($remaining > $minimum_redeem) {\n\n $redeem_amount = abs($remaining - $minimum_redeem);\n\n // Check the redeems is not empty\n\n if($redeem_amount) {\n\n // Save Redeem Request\n\n $redeem_request = new RedeemRequest;\n\n $redeem_request->user_id = $request->id;\n\n $redeem_request->request_amount = $redeem_amount;\n\n $redeem_request->status = false;\n\n $redeem_request->save();\n\n // Update Redeems details \n\n $redeem_details->remaining = abs($redeem_details->remaining-$redeem_amount);\n\n $redeem_details->save();\n\n $response_array = ['success' => true];\n\n } else {\n\n $response_array = ['success' => false , 'error_messages' => Helper::error_message(159) , 'error_code' => 159];\n }\n\n } else {\n $response_array = ['success' => false , 'error_messages' => Helper::error_message(158) ,'error_code' => 158];\n }\n\n } else {\n $response_array = ['success' => false , 'error_messages' => Helper::error_message(161) , 'error_code' => 161];\n }\n\n\n return response()->json($response_array , 200);\n\n }", "public function redeembp(){\n\t\t$this->db->where('CustomerMail', $this->session->userdata('useremail'));\n\t\t$this->db->select_sum('EarnedPotint');\n\t\t$this->db->from('tbl_bvpoint_data');\n\t\t$query = $this->db->get();\n\t\t$sumvalue=$query->row()->EarnedPotint;\n\t\t//echo $sumvalue;\n\t\tif($sumvalue>100){\n\t\t\t$redeempoint=100;\n\t\t}\n\t\telse{\n\t\t\t$redeempoint=$sumvalue;\n\t\t}\n\t\treturn round($redeempoint*0.25);\n\t}", "public function index()\n {\n $user = Auth::user();\n $depositPoint = DB::table('deposits')->where('user_id', $user->id)->sum('deposit_club_point');\n\n if($depositPoint >= 10000){\n\n if(!$user->is_merchant == 1){\n\n //for normal customer\n $user->balance = $user->balance + ($depositPoint * (1/10000));\n $user->update();\n\n $wallet = new Wallet;\n $wallet->user_id = $user->id;\n $wallet->amount = $depositPoint * (1/10000);\n $wallet->payment_method = 'Club Point Convert';\n $wallet->payment_details = 'Club Point Convert';\n $wallet->approval = 1;\n $wallet->save();\n\n $convertpoint = new Deposit;\n $convertpoint->user_id = $user->id;\n $convertpoint->deposit_club_point = $depositPoint * (-1);\n if( $convertpoint->save() ){\n flash('Your points successfully Converted into BDH')->success();\n return redirect()->back();\n }\n } else {\n\n //for Merchent\n $convertpoint = new Deposit;\n $convertpoint->user_id = $user->id;\n $convertpoint->deposit_amount = $depositPoint * (1/10000);\n $convertpoint->deposit_club_point = $depositPoint * (-1);\n if( $convertpoint->save() ){\n flash('Your points successfully Converted into BDH')->success();\n return redirect()->back();\n }\n }\n }\n flash('You can Convert your point after earn 10,000 points')->error();\n return redirect()->back();\n }", "public function viewAction()\n {\n $points = new Facepalm_Model_Points();\n $this->_helper->assertHasParameter('id');\n\n $pointId = $this->_getParam('id');\n $point = $points->find($pointId)->current();\n\n $this->_helper->assertResourceExists($point);\n\n #var_dump($point->toArray()); exit();\n $form = new Facepalm_Form_Comment();\n $form->getElement('point_id')->setValue($pointId);\n\n $this->view->point = $point;\n $this->view->form = $form;\n }", "public function action()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('c_title', 'c_cost', 'c_one_per_member'), array('id' => $id, 'c_enabled' => 1));\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $c_title = get_translated_text($rows[0]['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n $cost = $rows[0]['c_cost'];\n $next_url = build_url(array('page' => '_SELF', 'type' => 'action_done', 'id' => $class, 'sub_id' => $id), '_SELF');\n $points_left = available_points(get_member());\n\n // Check points\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n return do_template('POINTSTORE_CUSTOM_ITEM_SCREEN', array('_GUID' => 'bc57d8775b5471935b08f85082ba34ec', 'TITLE' => $title, 'ONE_PER_MEMBER' => ($rows[0]['c_one_per_member'] == 1), 'COST' => integer_format($cost), 'REMAINING' => integer_format($points_left - $cost), 'NEXT_URL' => $next_url));\n }", "public static function update_reward_points_for_vk_like() {\n $userid = get_current_user_id();\n global $wpdb;\n $table_name = $wpdb->prefix . 'rspointexpiry'; \n $banning_type = FPRewardSystem::check_banning_type($userid);\n if ($banning_type != 'earningonly' && $banning_type != 'both') {\n if (get_option('timezone_string') != '') {\n $timezonedate = date_default_timezone_set(get_option('timezone_string'));\n } else {\n $timezonedate = date_default_timezone_set('UTC');\n }\n\n if (isset($_POST['state']) && ($_POST['postid']) && ($_POST['currentuserid'])) {\n $getregularprice = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($_POST['postid'], '_regular_price');\n $postid = $_POST['postid'];\n $currentuserid = $_POST['currentuserid']; \n $getarrayids[] = $_POST['postid'];\n $oldoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsvklike');\n if (!empty($oldoption)) {\n if (!in_array($_POST['postid'], $oldoption)) {\n $mergedata = array_merge((array) $oldoption, $getarrayids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvklike', $mergedata);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $pointsredeemed= '0';\n self::rs_insert_vk_like_points($pointsredeemed,$getregularprice,$postid,$orderid, $checklevel,$currentuserid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }else {\n _e(\"You have already liked this post on VK.Com\",'rewardsystem');\n }\n }else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvklike', $getarrayids);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed= '0';\n $reasonindetail = '';\n self::rs_insert_vk_like_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }\n \n if ($_POST['state'] == 'off') {\n $getarrayunlikeids[] = $_POST['postid'];\n $oldunlikeoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsvkunlikes');\n if (!empty($oldunlikeoption)) {\n if (!in_array($_POST['postid'], $oldunlikeoption)) {\n $mergedunlikedata = array_merge((array) $oldunlikeoption, $getarrayunlikeids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvkunlikes', $mergedunlikedata);\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $pointsredeemed= '0';\n self::rs_insert_vk_like_revised_points($pointsredeemed,$getregularprice,$postid,$orderid, $checklevel,$currentuserid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n } else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvkunlikes', $getarrayunlikeids);\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $pointsredeemed= '0';\n self::rs_insert_vk_like_revised_points($pointsredeemed,$getregularprice,$postid,$orderid, $checklevel,$currentuserid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n }\n echo \"Ajax Call Successfully Triggered\"; \n }\n do_action('fp_reward_point_for_vk_like');\n exit();\n }\n }", "public function redeemGift(Request $request){\n\t\t$user = Auth::user();\n\t\t$user->load(['progression', 'rewards']); \n\t\t$reward_id = request('reward');\n\t\t$pivot_id = request('pivot');\n\t\tLog::info(\"here we go\");\n\t\t$info = $request->all();\n\t\tLog::info($info);\n\t\tLog::info($reward_id);\n\t\tLog::info($request->all());\n\t\tif($reward_id === 5){\n\t\t\t$user->progression->awardExperience(500);\n\t\t\t//announce\n\t\t}\n\t\t$reward = Reward::find($reward_id);\n\t\t//$user->rewards()->having('id', $reward_id)->update(['status' => 'redeemed']);\n\t\t$user->rewards()->wherePivot('id', $pivot_id)->updateExistingPivot($reward_id, ['status' => 'redeemed']);\n\t\t$return = User::find($user->id); \n\t\t$return->load(['progression', 'rewards']);\n\t\treturn $return;\n\n\t}", "public function getPoints_post() {\n $this->form_validation->set_rules('PointsCategory', 'PointsCategory', 'trim|in_list[Normal,InPlay,Reverse]');\n $this->form_validation->validation($this); /* Run validation */\n\n $PointsData = $this->Sports_model->getPoints($this->Post);\n if (!empty($PointsData)) {\n $this->Return['Data'] = $PointsData['Data'];\n }\n }", "public function render_post_pricing_form( $post ) {\n if ( ! LaterPay_Helper_User::can( 'laterpay_edit_individual_price', $post ) ) {\n return;\n }\n\n $post_prices = get_post_meta( $post->ID, 'laterpay_post_prices', true );\n\n if ( ! is_array( $post_prices ) ) {\n $post_prices = array();\n }\n\n $post_default_category = array_key_exists( 'category_id', $post_prices ) ? (int) $post_prices['category_id'] : 0;\n $post_revenue_model = array_key_exists( 'revenue_model', $post_prices ) ? $post_prices['revenue_model'] : 'ppu';\n $post_price_type = array_key_exists( 'type', $post_prices ) ? $post_prices['type'] : '';\n $post_status = $post->post_status;\n\n // category default price data\n $category_price_data = null;\n $category_default_price_revenue_model = null;\n $categories_of_post = wp_get_post_categories( $post->ID );\n\n if ( ! empty( $categories_of_post ) ) {\n\n $category_price_data = LaterPay_Helper_Pricing::get_category_price_data_by_category_ids( $categories_of_post );\n\n $new_category_data = LaterPay_Helper_Pricing::recalculate_post_price( $post->ID, $post_default_category, $post_price_type, $category_price_data, $categories_of_post );\n\n if ( false !== $new_category_data ) {\n $post_default_category = $new_category_data['category_id'];\n $category_default_price_revenue_model = $new_category_data['revenue_model'];\n }\n\n }\n\n // get price data\n $global_default_price = get_option( 'laterpay_global_price' );\n $global_default_price_revenue_model = get_option( 'laterpay_global_price_revenue_model' );\n\n $price = LaterPay_Helper_Pricing::get_post_price( $post->ID, true );\n $post_price_type = LaterPay_Helper_Pricing::get_post_price_type( $post->ID );\n\n // set post revenue model according to the selected price type\n if ( $post_price_type === LaterPay_Helper_Pricing::TYPE_CATEGORY_DEFAULT_PRICE ) {\n $post_revenue_model = $category_default_price_revenue_model;\n } elseif ( $post_price_type === LaterPay_Helper_Pricing::TYPE_GLOBAL_DEFAULT_PRICE ) {\n $post_revenue_model = $global_default_price_revenue_model;\n }\n\n // Get Data of all Categories.\n $category_price_model = LaterPay_Model_CategoryPriceWP::get_instance();\n $empty_all_category_default_prices = ( empty( $category_price_model->get_categories_with_defined_price() ) ? true : false );\n\n // get currency settings for current region\n $currency_settings = LaterPay_Helper_Config::get_currency_config();\n\n echo '<input type=\"hidden\" name=\"laterpay_pricing_post_content_box_nonce\" value=\"' . esc_attr( wp_create_nonce( $this->config->plugin_base_name ) ) . '\" />';\n $view_args = array(\n 'post_id' => $post->ID,\n 'post_price_type' => $post_price_type,\n 'post_status' => $post_status,\n 'post_revenue_model' => $post_revenue_model,\n 'price' => $price,\n 'global_price' => (float) get_option( 'laterpay_global_price' ),\n 'currency' => $currency_settings,\n 'category_prices' => $category_price_data,\n 'no_category_price_set' => $empty_all_category_default_prices,\n 'post_default_category' => (int) $post_default_category,\n 'global_default_price' => $global_default_price,\n 'global_default_price_revenue_model' => $global_default_price_revenue_model,\n 'category_default_price_revenue_model' => $category_default_price_revenue_model,\n 'price_ranges' => $currency_settings,\n );\n\n $this->assign( 'laterpay', $view_args );\n\n $this->render( 'backend/partials/post-pricing-form' );\n }", "public function action_done()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n post_param_integer('confirm'); // Make sure POSTed\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), array('id' => $id, 'c_enabled' => 1), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $row = $rows[0];\n\n $cost = $row['c_cost'];\n\n $c_title = get_translated_text($row['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n // Check points\n $points_left = available_points(get_member());\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n if ($row['c_one_per_member'] == 1) {\n // Test to see if it's been bought\n $test = $GLOBALS['SITE_DB']->query_select_value_if_there('sales', 'id', array('purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details2' => strval($row['id']), 'memberid' => get_member()));\n if (!is_null($test)) {\n warn_exit(do_lang_tempcode('ONE_PER_MEMBER_ONLY'));\n }\n }\n\n require_code('points2');\n charge_member(get_member(), $cost, $c_title);\n $sale_id = $GLOBALS['SITE_DB']->query_insert('sales', array('date_and_time' => time(), 'memberid' => get_member(), 'purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details' => $c_title, 'details2' => strval($row['id'])), true);\n\n require_code('notifications');\n $subject = do_lang('MAIL_REQUEST_CUSTOM', comcode_escape($c_title), null, null, get_site_default_lang());\n $username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());\n $message_raw = do_notification_lang('MAIL_REQUEST_CUSTOM_BODY', comcode_escape($c_title), $username, null, get_site_default_lang());\n dispatch_notification('pointstore_request_custom', 'custom' . strval($id) . '_' . strval($sale_id), $subject, $message_raw, null, null, 3, true, false, null, null, '', '', '', '', null, true);\n\n $member = get_member();\n\n // Email member\n require_code('mail');\n $subject_line = get_translated_text($row['c_mail_subject']);\n if ($subject_line != '') {\n $message_raw = get_translated_text($row['c_mail_body']);\n $email = $GLOBALS['FORUM_DRIVER']->get_member_email_address($member);\n $to_name = $GLOBALS['FORUM_DRIVER']->get_username($member, true);\n mail_wrap($subject_line, $message_raw, array($email), $to_name, '', '', 3, null, false, null, true);\n }\n\n // Show message\n $url = build_url(array('page' => '_SELF', 'type' => 'browse'), '_SELF');\n return redirect_screen($title, $url, do_lang_tempcode('ORDER_GENERAL_DONE'));\n }", "function action()\n\t{\n\t\t$class=str_replace('hook_pointstore_','',strtolower(get_class($this)));\n\n\t\t$id=get_param_integer('sub_id');\n\t\t$rows=$GLOBALS['SITE_DB']->query_select('pstore_customs',array('c_title','c_cost','c_one_per_member'),array('id'=>$id,'c_enabled'=>1));\n\t\tif (!array_key_exists(0,$rows)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\n\t\t$c_title=get_translated_text($rows[0]['c_title']);\n\t\t$title=get_page_title('PURCHASE_SOME_PRODUCT',true,array(escape_html($c_title)));\n\n\t\t$cost=$rows[0]['c_cost'];\n\t\t$next_url=build_url(array('page'=>'_SELF','type'=>'action_done','id'=>$class,'sub_id'=>$id),'_SELF');\n\t\t$points_left=available_points(get_member());\n\n\t\t// Check points\n\t\tif (($points_left<$cost) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('_CANT_AFFORD',integer_format($cost),integer_format($points_left)));\n\t\t}\n\n\t\treturn do_template('POINTSTORE_CUSTOM_ITEM_SCREEN',array('_GUID'=>'bc57d8775b5471935b08f85082ba34ec','TITLE'=>$title,'COST'=>integer_format($cost),'REMAINING'=>integer_format($points_left-$cost),'NEXT_URL'=>$next_url));\n\t}", "public function actionOfferEstimation()\n {\n if( $formData = Yii::$app->session->get(\"formData\") )\n {\n $viewData['formData'] = $formData['ValuationForm'];\n return $this->render( 'offer-estimation-view' , $viewData );\n }\n // no data is saved to session (i.e. no form submitted)\n return Yii::$app->response->redirect(Yii::$app->params['baseUrl']);\n }", "function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}", "function action_done()\n\t{\n\t\t$class=str_replace('hook_pointstore_','',strtolower(get_class($this)));\n\n\t\tpost_param_integer('confirm'); // Make sure POSTed\n\t\t$id=get_param_integer('sub_id');\n\t\t$rows=$GLOBALS['SITE_DB']->query_select('pstore_customs',array('id','c_title','c_cost','c_one_per_member'),array('id'=>$id,'c_enabled'=>1));\n\t\tif (!array_key_exists(0,$rows)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\n\t\t$cost=$rows[0]['c_cost'];\n\n\t\t$c_title=get_translated_text($rows[0]['c_title']);\n\t\t$title=get_page_title('PURCHASE_SOME_PRODUCT',true,array(escape_html($c_title)));\n\n\t\t// Check points\n\t\t$points_left=available_points(get_member());\n\t\tif (($points_left<$cost) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('_CANT_AFFORD',integer_format($cost),integer_format($points_left)));\n\t\t}\n\n\t\tif ($rows[0]['c_one_per_member']==1)\n\t\t{\n\t\t\t// Test to see if it's been bought\n\t\t\t$test=$GLOBALS['SITE_DB']->query_value_null_ok('sales','id',array('purchasetype'=>'PURCHASE_CUSTOM_PRODUCT','details2'=>strval($rows[0]['id']),'memberid'=>get_member()));\n\t\t\tif (!is_null($test))\n\t\t\t\twarn_exit(do_lang_tempcode('ONE_PER_MEMBER_ONLY'));\n\t\t}\n\n\t\trequire_code('points2');\n\t\tcharge_member(get_member(),$cost,$c_title);\n\t\t$sale_id=$GLOBALS['SITE_DB']->query_insert('sales',array('date_and_time'=>time(),'memberid'=>get_member(),'purchasetype'=>'PURCHASE_CUSTOM_PRODUCT','details'=>$c_title,'details2'=>strval($rows[0]['id'])),true);\n\n\t\trequire_code('notifications');\n\t\t$subject=do_lang('MAIL_REQUEST_CUSTOM',comcode_escape($c_title),NULL,NULL,get_site_default_lang());\n\t\t$username=$GLOBALS['FORUM_DRIVER']->get_username(get_member());\n\t\t$message_raw=do_lang('MAIL_REQUEST_CUSTOM_BODY',comcode_escape($c_title),$username,NULL,get_site_default_lang());\n\t\tdispatch_notification('pointstore_request_custom','custom'.strval($id).'_'.strval($sale_id),$subject,$message_raw,NULL,NULL,3,true);\n\n\t\t// Show message\n\t\t$url=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');\n\t\treturn redirect_screen($title,$url,do_lang_tempcode('ORDER_GENERAL_DONE'));\n\t}", "public function ex_points(){\r\n $maps['is_on_sale'] = 1;\r\n $maps['type'] = 0;\r\n $info = D('goods')->where($maps)->select();\r\n // var_dump($info);die;\r\n $mapps['is_forbid'] = 0;\r\n $r = D('store')->where($mapps)->select();\r\n $this->assign('r',$r);\r\n $this->assign('info',$info);\r\n $this->display();\r\n }", "public function gainReputation($points)\n {\n $this->increment('reputation', $points);\n }", "public function actionNew()\n\t{\n\t\t$model=new Points;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\t\n\t\t$_brands = Brands::model()->thisClient()->findAll(array(\n\t\t\t'select'=>'BrandId, BrandName', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$brands = array();\n\t\tforeach($_brands as $row) {\n\t\t\t$brands[$row->BrandId] = $row->BrandName;\n\n\t\t}\n\t\t\n\t\t$_campaigns = Campaigns::model()->findAll(array(\n\t\t\t'select'=>'CampaignId, BrandId, CampaignName', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$campaigns = array();\n\t\tforeach($_campaigns as $row) {\n\t\t\t$campaigns[$row->CampaignId] = $row->CampaignName;\n\n\t\t}\n\t\t\n\t\t$_channels = Channels::model()->findAll(array(\n\t\t\t'select'=>'ChannelId, BrandId, CampaignId, ChannelName', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$channels = array();\n\t\tforeach($_channels as $row) {\n\t\t\t$channels[$row->ChannelId] = $row->ChannelName;\n\n\t\t}\n\t\t\n\t\t$_rewardslist = RewardsList::model()->findAll(array(\n\t\t\t'select'=>'RewardId, Title', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$rewardslist = array();\n\t\tforeach($_rewardslist as $row) {\n\t\t\t$rewardslist[$row->RewardId] = $row->Title;\n\n\t\t}\n\n\t\tif(isset($_POST['Points']))\n\t\t{\n\t\t\t// echo \"<pre>\"; var_dump($_POST); exit;\n\t\t\t$model->attributes=$_POST['Points'];\n\t\t\t$model->setAttribute(\"DateCreated\", new CDbExpression('NOW()'));\n\t\t\t$model->setAttribute(\"CreatedBy\", Yii::app()->user->id);\n\t\t\t$model->setAttribute(\"DateUpdated\", new CDbExpression('NOW()'));\n\t\t\t$model->setAttribute(\"UpdatedBy\", Yii::app()->user->id);\n\t\t\t\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\t$utilLog = new Utils;\n\t\t\t\t$utilLog->saveAuditLogs();\n\t\t\t\t$this->redirect(array('view','id'=>$model->PointsId));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create2',array(\n\t\t\t'model'=>$model,\n\t\t\t'brand_id'=>$brands,\n\t\t\t'channel_id'=>$channels,\n\t\t\t'campaign_list'=>$campaigns,\n\t\t\t'rewardlist_id'=>$rewardslist,\n\t\t));\n\t}", "public function actionRevisedratesreport()\n {\n $res = AllocationManager::getRevisedRatesData();\n return $this->render('revised-rates-report',['res' => $res]);\n\n }", "public function setPointsEarned($pointsEarned)\n {\n $this->pointsEarned = $pointsEarned;\n return $this;\n }", "public function regenerer($points = null)\n\t{\n\t\tif (isset($points)){\n\t\t\t$this->vie += $points;\n\t\t} else {\n\t\t\t$this->vie = 100;\n\t\t}\n\t}", "public static function update_reward_points_for_twitter_tweet() {\n $userid = get_current_user_id();\n global $wpdb;\n $table_name = $wpdb->prefix . 'rspointexpiry'; \n $banning_type = FPRewardSystem::check_banning_type($userid);\n if ($banning_type != 'earningonly' && $banning_type != 'both') {\n if (get_option('timezone_string') != '') {\n $timezonedate = date_default_timezone_set(get_option('timezone_string'));\n } else {\n $timezonedate = date_default_timezone_set('UTC');\n }\n\n if (isset($_POST['state']) && ($_POST['postid']) && ($_POST['currentuserid'])) {\n $getregularprice = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($_POST['postid'], '_regular_price');\n $postid = $_POST['postid'];\n $currentuserid = $_POST['currentuserid']; \n $getarrayids[] = $_POST['postid'];\n $oldoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rstwittertweet');\n if (!empty($oldoption)) {\n if (!in_array($_POST['postid'], $oldoption)) {\n $mergedata = array_merge((array) $oldoption, $getarrayids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rstwittertweet', $mergedata);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_twitter_tweet($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_twitter_tweet_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }else {\n _e('You already Tweet this post', 'rewardsystem');\n }\n }else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rstwittertweet', $getarrayids);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_twitter_tweet_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n } \n echo \"Ajax Call Successfully Triggered\"; \n }\n do_action('fp_reward_point_for_twitter_tweet');\n exit();\n }\n }", "function userAddPoints($points)\n\t{\n\t\t$pns = $this->DB->database_select('users', 'points', array('username' => session_get('username')), 1);\n\t\t$add_points = $pns['points'] + $points;\n\t\t$gid = $this->user_getgroup();\n\t\t$next_gid = $gid+1;\n\t\t$points_required = $this->DB->database_select('groups', '*', array('gid' => $next_gid), 1); //Has user has acquired enough points to make a new group rank?\n\t\t$points_required = $points_required['points'];\n\t\t$newPnts = $this->DB->database_update('users',\n\t\t\t\t\t\t array('points' => $add_points), array('username' => session_get('username')));\n\t\tif($add_points >= $points_required && $gid < 4) //User has made enough points to progress rank!\n\t\t{\n\t\t\t$this->doPromote = true;\n\t\t\t$this->DB->database_update('users', array('gid' => $next_gid), array('username' => session_get('username')));\n\t\t}\n\t}", "public function charges()\n\t{\n\t\t$data['title'] = 'Charges';\n\t\t$data['rentspaceroomtypeaircon'] = $this->getrentspaceroomtypeaircon();\n\t\t$data['rentspaceroomtypefemale'] = $this->getrentspaceroomtypefemale();\n\t\t$data['rentspaceroomtypemale'] = $this->getrentspaceroomtypemale();\n\t\t$data['natureofactivity'] = $this-> getnatureofactivity();\n\t\t$data['rentspaceventtype'] = $this->getrentspaceeventtype();\n\t\t$data['ratetype'] = $this->getratetype();\n\n\t\t$this->template\n\t\t\t->set_layout('student_template')\n\t\t\t->build('charges',$data);\n\n\t}", "public function rechargeEspeceCarte()\n {\n $fkagence = $this->userConnecter->fk_agence;\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $telephone = trim(str_replace(\"+\", \"00\", $this->utils->securite_xss($_POST['phone'])));\n $data['benef'] = $this->compteModel->beneficiaireByTelephone1($telephone);\n $data['soldeAgence'] = $this->utils->getSoldeAgence($fkagence);\n\n $params = array('view' => 'compte/recharge-espece-carte');\n $this->view($params, $data);\n }", "public function givePointsForInvite(UserReferralCode $referralCode, User $user, $points)\n {\n $season = $this->_em->getRepository('ZenomaniaCoreBundle:Season')->findCurrentSeason();\n\n $params = [\n 'season' => $season,\n 'user' => $referralCode->getUser(),\n 'points' => $points,\n 'type' => PersonPoints::TYPE_INVITE,\n 'state' => 'none',\n 'dt' => new \\DateTime(),\n 'operation_type' => PersonPoints::OPERATION_TYPE_DEBIT\n ];\n\n $personPoints = PersonPoints::fromArray($params);\n\n $this->_em->persist($personPoints);\n\n $this->_em->getRepository('ZenomaniaCoreBundle:UserReferralCode')->addActivation($referralCode, $user, false);\n\n $this->_em->flush();\n }", "public function mycred_pro_reward_order_points( $order_id ){\n\n\t\tif ( ! function_exists( 'mycred' ) ) return;\n\n\t\t// Get Order\n\t\t$order = wc_get_order( $order_id );\n\n\t\t$items_number = 0;\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\t\t\t$quantity = $item->get_quantity();\n\t\t\t$items_number += $quantity;\n\t\t}\n\n\t\t// Load myCRED\n\t\t$mycred = mycred();\n\n\t\t// Do not payout if order was paid using points\n\t\tif ( $order->get_payment_method() == 'mycred' ) return;\n\n\t\tif ( ! $mycred ) return;\n\n\t\t// Make sure user only gets points once per order\n\t\tif ( $mycred->has_entry( 'reward', $order_id, $order->get_user_id() ) ) return;\n\n\t\t// Reward example 10 * order items in points.\n\t\t$reward = 10 * $items_number;\n\n\t\t// Add reward\n\t\t$mycred->add_creds(\n\t\t\t'reward',\n\t\t\t$order->get_user_id(),\n\t\t\t$reward,\n\t\t\t'Reward for store purchase',\n\t\t\t$order_id,\n\t\t\tarray( 'ref_type' => 'post' )\n\t\t);\n\t}", "function reffer_amount() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\tif (!empty($user_id)) {\n\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue_sum('refferal_records', 'refferal_frnd_id', $user_id, 'refferal_amount');\n\t\t\t$user_reffer_amount = $records[0]['total'];\n\t\t\tif (!empty($user_reffer_amount)) {\n\t\t\t\t$user_reffer_amount = $user_reffer_amount;\n\t\t\t} else {\n\t\t\t\t$user_reffer_amount = '0';\n\t\t\t}\n\t\t\t$post = array(\"status\" => \"true\", 'reffer_amount' => $refferal_amount, 'user_total_reffer_amount' => $user_reffer_amount, 'user_id' => $user_id);\n\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", 'message' => 'missing parameter', 'user_id' => $user_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function show(Points $points)\n {\n //\n }", "public static function rs_insert_vk_like_points($pointsredeemed,$getregularprice,$postid,$orderid,$level,$currentuserid,$totalearnedpoints,$totalredeempoints,$reasonindetail){\n \n $rewardpoints = array('0');\n $rewardpercents = array('0'); \n\n //Product Level Points and Percent\n $gettype = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_social_rewardsystem_options_vk');\n $getpoints = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempoints_vk');\n $getpercent = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempercent_vk');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $getpercent / 100;\n $getaveragepoints = $getaverage * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforproductlevel = $pointswithvalue / $pointconversionvalue;\n\n //Category Level Points and Percent\n $categorylist = wp_get_post_terms($postid, 'product_cat');\n $getcount = count($categorylist);\n $term = get_the_terms($postid,'product_cat');\n if(is_array($term)){\n foreach ($term as $terms){\n $termid = $terms->term_id;\n $categorylevelrewardtype = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_vk_enable_rs_rule');\n $categorylevelrewardpoints = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_vk_rs_category_points');\n $categorylevelrewardpercents = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_vk_rs_category_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $categorylevelrewardpercents / 100;\n $getaveragepoints = $categorylevelrewardpercents * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforcategorylevel = $pointswithvalue / $pointconversionvalue;\n \n //Global Level Points and Percent\n $global_reward_type = get_option('rs_global_social_reward_type_vk');\n $global_reward_points = get_option('rs_global_social_vk_reward_points');\n $global_reward_percent = get_option('rs_global_social_vk_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $global_reward_percent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n \n if($getcount > 1){ \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n } else { \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n } \n } \n }else {\n $global_reward_type = get_option('rs_global_social_reward_type_vk');\n $global_reward_points = get_option('rs_global_social_vk_reward_points');\n $global_reward_percent = get_option('rs_global_social_vk_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $global_reward_percent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n }\n $getcategorypoints = max($rewardpoints);\n $getcategorypercent = max($rewardpercents);\n $restrictuserpoints = get_option('rs_max_earning_points_for_user');\n $enabledisablemaxpoints = get_option('rs_enable_disable_max_earning_points_for_user');\n $totalredeempoints = '0';\n $totalearnedpoints = '0';\n $refuserid = '0';\n $variationid = '0';\n $reasonindetail = '';\n $noofdays = get_option('rs_point_to_be_expire');\n if(($noofdays != '0')&& ($noofdays != '')){\n $date = time() + ($noofdays * 24 * 60 * 60); \n }else{\n $date = '999999999999';\n }\n switch ($level) {\n case '1':\n if ($gettype == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid); \n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getpoints;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed, $date,'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid); \n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforproductlevel;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed, $date,'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n } \n }\n break;\n case '2':\n if ($categorylevelrewardtype == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid); \n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypoints;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed, $date,'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid); \n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypercent;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n } \n }\n break;\n case '3':\n if ($global_reward_type == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid); \n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $global_reward_points;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed, $date,'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid); \n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforgloballevel;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date, 'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed, $date,'RPVL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,'0',$date,'RPVL',$equearnamt,'0','0',$postid,$variationid,$refuserid,'',$totalpoints,'','0'); \n } \n }\n break;\n }\n }", "public function showPenaltyCalculator()\n {\n return view('developers.installment_account_ledgers.penalty_calculator', compact('ledger_properties','buyer'));\n }", "public function enterPointsAction(Request $request)\n {\n $pointsForm = $this->createPointsForm($this->get('session')->get('playerIds', []));\n\n $pointsForm->handleRequest($request);\n\n if ($pointsForm->isSubmitted()) {\n $pointsOfGame = $pointsForm->getData()['points'];\n if ($pointsOfGame > 0) {\n $data = $this->calculateGameResult($pointsForm->getData());\n } else {\n $data = -4;\n }\n\n // if given data is not valid, throw several form errors and redirect to action again\n if (!is_array($data)) {\n if ($data === -1) {\n $pointsForm->addError(new FormError('There must be at least one winner'));\n } elseif ($data === -2) {\n $pointsForm->addError(new FormError('Four winners are one too many'));\n } elseif ($data === -3) {\n $pointsForm->addError(new FormError('One player is selected twice'));\n } elseif ($data === -4) {\n $pointsForm->addError(new FormError('The value of points must be at least 1'));\n }\n\n return $this->render(\n 'index/enter_points.html.twig',\n ['pointsForm' => $pointsForm->createView()]\n );\n }\n\n $round = new Round($pointsOfGame, $pointsForm->get('bockRound')->getData());\n\n $playerIds = [];\n // if data is okay, save points to database\n $participants = new ArrayCollection();\n foreach ($data as $item) {\n $player = $this->getPlayerById($item['playerId']);\n $playerIds[] = $item['playerId'];\n $newPoints = $player->getPoints() + $item['points'];\n $player->setPoints($newPoints);\n $participant = new Participant($round, $player, $item['points']);\n $participants->add($participant);\n }\n $round->setParticipants($participants);\n $this->getEm()->persist($round);\n $this->getEm()->flush();\n\n $this->get('session')->set('playerIds', $playerIds);\n\n /** @var SubmitButton $saveButton */\n $saveButton = $pointsForm->get('save');\n $nextAction = $saveButton->isClicked() ? 'app_doko_showscoreboard' : 'app_doko_enterpoints';\n\n return $this->redirectToRoute($nextAction);\n }\n\n return $this->render(\n 'index/enter_points.html.twig',\n ['pointsForm' => $pointsForm->createView()]\n );\n }", "public function getPointsEarned()\n {\n return $this->pointsEarned;\n }", "public function givePointsForTicketRegistration(User $user, $points)\n {\n $person = $this->_em->getRepository('ZenomaniaCoreBundle:Person')->findPersonByUser($user);\n $season = $this->_em->getRepository('ZenomaniaCoreBundle:Season')->findCurrentSeason();\n\n $params = [\n 'season' => $season,\n 'person' => $person,\n 'user' => $user,\n 'points' => $points,\n 'type' => PersonPoints::TYPE_TICKET_REGISTER,\n 'state' => 'none',\n 'dt' => new \\DateTime(),\n 'operation_type' => PersonPoints::OPERATION_TYPE_DEBIT\n\n ];\n\n $personPoints = PersonPoints::fromArray($params);\n $this->_em->persist($personPoints);\n\n $this->_em->flush();\n }", "public function add_points(Request $request)\n {\n $data = DB::table('point_value_settings')->get();\n $id = \"\";\n\n if(!empty($request->id)){\n $id = $request->id;\n try {\n\t\t\t\t$get_data = DB::table('point_value_settings')->where('id', $id)->get()->toArray();\n\t\t\t\tif(empty($get_data)){\n\t\t\t\t $request->session()->flash('alert-danger', \"No Records Founds\");\n\t\t\t\t} \n } catch(\\Illuminate\\Database\\QueryException $ex){\n $request->session()->flash('alert-danger', $ex->getMessage());\n }\n }\n return view('point_value_settings.add_points', compact('id', 'data'));\n }", "public function showInvestmentForm()\n\t{\n\t\t//get id of logged in user\n\t\ttry\n\t\t{\n\t\t\t//get user id from auth\n\t\t\t$userId = Auth::id();\n\t\t\t//get investment related data from trait,all count and sum\n\t\t\t$countInvData = $this->GetOwnerDetails($userId);\n\t\t\t//send data to view\n\t \treturn view('owner.add_investment',['countInvData'=>$countInvData]);\n\t\t}\n\t catch(Exception $e){\n\t\t \tabort(403, $e->getMessage());\n\t\t}\n\t}", "public function edit(Premiums $premiums)\n {\n //\n }", "public function store()\n {\n $data = collect(request()->input())->except('_token')->toArray();\n\n $this->validate(request(), [\n 'customer_id' => 'required',\n 'add_deduct' => 'required',\n 'points' => 'required',\n 'notes' => 'required',\n ]);\n\n // Determine add/deduct boolean\n $data['add'] = 0;\n if ($data['add_deduct'] == 'Add') {\n $data['add'] = 1;\n }\n\n // Get employee id\n $customer = Customer::find($data['customer_id']);\n $data['employee_id'] = $customer->employee_id;\n\n $pointModification = PointModification::create($data);\n\n if ($data['add_deduct'] == 'Add') {\n $customer->givePoint(new PointModificationCreated($pointModification));\n } else {\n $customer->reducePoint($data['points']);\n }\n\n session()->flash('success', trans('app.points.success-create', ['action' => strtolower($data['add_deduct']) . 'ed']));\n\n return redirect()->route('admin.points.modifications.index', ['id' => $data['customer_id']]);\n }", "public static function update_reward_points_for_facebook_like() {\n $userid = get_current_user_id(); \n $banning_type = FPRewardSystem::check_banning_type($userid);\n if ($banning_type != 'earningonly' && $banning_type != 'both') {\n if (get_option('timezone_string') != '') {\n $timezonedate = date_default_timezone_set(get_option('timezone_string'));\n } else {\n $timezonedate = date_default_timezone_set('UTC');\n }\n\n if (isset($_POST['state']) && ($_POST['postid']) && ($_POST['currentuserid'])) {\n $getregularprice = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($_POST['postid'], '_regular_price');\n $postid = $_POST['postid'];\n $currentuserid = $_POST['currentuserid']; \n $getarrayids[] = $_POST['postid'];\n $oldoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsfacebooklikes');\n if (!empty($oldoption)) {\n if (!in_array($_POST['postid'], $oldoption)) {\n $mergedata = array_merge((array) $oldoption, $getarrayids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsfacebooklikes', $mergedata);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }else {\n _e('You already liked this post', 'rewardsystem');\n }\n }else {\n update_user_meta($_POST['currentuserid'], '_rsfacebooklikes', $getarrayids);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n } \n \n if ($_POST['state'] == 'off') {\n $getarrayunlikeids[] = $_POST['postid'];\n $oldunlikeoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsfacebookunlikes');\n if (!empty($oldunlikeoption)) {\n if (!in_array($_POST['postid'], $oldunlikeoption)) {\n $mergedunlikedata = array_merge((array) $oldunlikeoption, $getarrayunlikeids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsfacebookunlikes', $mergedunlikedata);\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n } else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsfacebookunlikes', $getarrayunlikeids);\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n }\n \n echo \"Ajax Call Successfully Triggered\"; \n }\n do_action('fp_reward_point_for_facebook_like');\n exit();\n }\n }", "public function getTotalRedeemPoint($data,$id){\n $dm = $data['dm']->getManager();\n $redeems = $dm->createQueryBuilder('AevitasLevisBundle:AbstractRedeem')\n ->field('created')->sort('time', 'desc')->getQuery()->execute();\n $total_redeemed_point = 0;\n if(!empty($redeems)){ \n $index = 0;\n $length_arr = count($redeems);\n \n\n foreach ($redeems as $obj) {\n if (!is_object($obj->getUser())) {\n continue;\n }\n \n $index++;\n if($obj->getUser()->getID() == $id){\n $total_redeemed_point = $total_redeemed_point + $obj->getPoint();\n //if($index == $length_arr){\n //}\n }\n\n }\n return $total_redeemed_point;\n }\n return 0;\n }", "public function remitance()\n {\n $model = new fee_concession_model();\n $return = $model->Get_Remittance();\n $session = $model->GetSession();\n return view('account_process.accounts.remitance')->with(array(\"AS\"=>$return, \"session\"=>$session));\n }", "public function edpPendingLegalOpinion(){\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 $legalOpinionNotGiven=array_diff($edpTotal,$edpLegalList);\n\t\t\n\t\treturn View::make('surveillance.notiEdpLegalOpinionWaiting')\n\t\t\t\t\t\t->with('PageName','EDP: Legal Opinion Not Given')\n\t\t\t\t\t\t->with('active','sia')\n\t\t\t\t\t\t->with('legalOpinionNotGiven',$legalOpinionNotGiven)\n\t\t\t\t;\n\t}", "public function actionProvRegnasRekapData() {\n return $this->render('prov/prov-regnas-rekap-data');\n }", "public function edit(StudentPoint $student_point)\n {\n //\n }", "public function personal_rebate($id, $pv, $product_id)\n {\n $rank = $this->getUserRankId($id);\n $wallet = Wallet::where('user_id', $id)->first();\n \n // $x = 3;\n // $last_highest_rank = 1;\n $rank = $this->getUserRankId($id);\n\n $data = [\n 'user_id' => $id,\n 'rank' => $rank,\n 'total_pv' => $pv,\n 'product_id' => $product_id, \n 'from_user_id'=> $id,\n 'bonus' => 0.20,\n 'bonus_type' => 3,\n 'description' => 'Personal Rebate'\n ];\n\n $this->getPersonalRebate($data); \n }", "public function main($post_id) {\n \n if( !wpjb_candidate_have_access( get_the_ID() ) ) {\n \n if( wpjb_conf( \"cv_members_have_access\" ) == 1 ) {\n $msg = __(\"Only registered candidates have access to this page.\", \"wpjobboard\");\n } elseif( wpjb_conf( \"cv_members_have_access\" ) == 2 ) {\n $msg = sprintf( __('Only premium candidates have access to this page. Get your premium account <a href=\"%s\">here</a>', \"wpjobboard\"), get_the_permalink( wpjb_conf( \"urls_link_cand_membership\" ) ) );\n }\n \n $this->addError( $msg );\n return wpjb_flash();\n }\n \n $resume = wpjb_get_object_from_post_id($post_id);\n /* @var $resume Wpjb_Model_Resume */\n \n $this->view = new stdClass();\n $this->canView($resume->id);\n \n if(!$this->canBrowse($resume->id)) {\n if(wpjb_conf(\"cv_privacy\") == 1) {\n $this->canViewError();\n return false;\n }\n }\n \n $this->view->form_error = null;\n $this->view->tolock = apply_filters(\"wpjb_lock_resume\", array(\"user_email\", \"phone\", \"user_url\"));\n $this->view->current_url = wpjr_link_to(\"resume\", $resume);\n $this->view->resume = $resume;\n \n $this->form = array();\n $this->show = array(\"contact\"=>0, \"purchase\"=>0);\n \n if($this->getRequest()->get(\"form\") == \"contact\") {\n $show[\"contact\"] = 1;\n }\n if($this->getRequest()->get(\"form\") == \"purchase\") {\n $show[\"purchase\"] = 1;\n }\n \n if($this->view->button->contact == 1) {\n $this->form[\"contact\"] = new Wpjb_Form_Resumes_Contact;\n }\n if($this->view->button->purchase == 1) {\n $this->form[\"purchase\"] = new Wpjb_Form_Resumes_Purchase;\n }\n \n $contact = $this->handleContact($resume);\n $purchase = $this->handlePurchase($resume);\n \n if($purchase !== null) {\n return $purchase;\n }\n \n $this->view->f = $this->form;\n $this->view->show = (object)$this->show;\n \n return $this->render(\"resumes\", \"resume\");\n }", "public function getPaybackForm()\n\t{\n\t\t$currentPlayer = Session::get('game.currentPlayer'); \n\t\t$currentLoan = $currentPlayer->getLoanAttribute();\n\n\t\tif ($currentPlayer->getMoneyAttribute() > 0)\n\t\t\t$maxPayback = ($currentLoan > $currentPlayer->getMoneyAttribute()) ? (floor($currentPlayer->getMoneyAttribute()/100000) * 100000) : $currentLoan;\n\t\telse\n\t\t\t$maxPayback = 0;\n\n\t\treturn View::make('loan.payback', compact('currentLoan', 'maxPayback'));\n\t}", "public function PostageForm()\n {\n if (!Checkout::config()->simple_checkout && $this->isDeliverable()) {\n $available_postage = Session::get(\"Checkout.AvailablePostage\");\n \n // Setup form\n $form = Form::create(\n $this,\n 'PostageForm',\n $fields = new FieldList(\n CountryDropdownField::create(\n 'Country',\n _t('Checkout.Country', 'Country')\n ),\n TextField::create(\n \"ZipCode\",\n _t('Checkout.ZipCode', \"Zip/Postal Code\")\n )\n ),\n $actions = new FieldList(\n FormAction::create(\n \"doSetPostage\",\n _t('Checkout.Search', \"Search\")\n )->addExtraClass('btn')\n ->addExtraClass('btn btn-green btn-success')\n ),\n $required = RequiredFields::create(array(\n \"Country\",\n \"ZipCode\"\n ))\n )->addExtraClass('forms')\n ->addExtraClass('forms-inline')\n ->setLegend(_t(\"Checkout.EstimateShipping\", \"Estimate Shipping\"));\n\n\n // If we have stipulated a search, then see if we have any results\n // otherwise load empty fieldsets\n if ($available_postage && $available_postage->exists()) {\n // Loop through all postage areas and generate a new list\n $postage_array = array();\n \n foreach ($available_postage as $area) {\n $area_currency = new Currency(\"Cost\");\n if ($this->IncludesTax()) {\n $area_currency->setValue($area->Total());\n } else {\n $area_currency->setValue($area->Cost);\n }\n $postage_array[$area->ID] = $area->Title . \" (\" . $area_currency->Nice() . \")\";\n }\n\n $fields->add(OptionsetField::create(\n \"PostageID\",\n _t('Checkout.SelectPostage', \"Select Postage\"),\n $postage_array\n ));\n\n $actions\n ->dataFieldByName(\"action_doSetPostage\")\n ->setTitle(_t('Checkout.Update', \"Update\"));\n }\n\n // Check if the form has been re-posted and load data\n $data = Session::get(\"Form.{$form->FormName()}.data\");\n if (is_array($data)) {\n $form->loadDataFrom($data);\n }\n\n // Check if the postage area has been set, if so, Set Postage ID\n $data = array();\n $data[\"PostageID\"] = Session::get(\"Checkout.PostageID\");\n if (is_array($data)) {\n $form->loadDataFrom($data);\n }\n\n // Extension call\n $this->extend(\"updatePostageForm\", $form);\n\n return $form;\n }\n }", "public function setPoints($points) {\n\t\t$this->points = $points;\n\t}", "protected function paymentForm($resume, $pricing) {\n \n if(Wpjb_Model_Company::current()) {\n $dName = Wpjb_Model_Company::current()->company_name;\n $dMail = wp_get_current_user()->user_email;\n } elseif(wp_get_current_user()) {\n $dName = wp_get_current_user()->display_name;\n $dMail = wp_get_current_user()->user_email;\n } else {\n $dName = \"\";\n $dMail = \"\";\n }\n\n $fullname = apply_filters(\"wpjb_candidate_name\", trim($resume->user->first_name.\" \".$resume->user->last_name), $resume->id);\n \n $this->view->pricing = $pricing;\n $this->view->gateways = Wpjb_Project::getInstance()->payment->getEnabled();\n $this->view->pricing_item = __(\"Resume Access\", \"wpjobboard\") . \" &quot;\" . $fullname . \"&quot;\";\n $this->view->defaults = new Daq_Helper_Html(\"span\", array(\n \"id\" => \"wpjb-checkout-defaults\",\n \"class\" => \"wpjb-none\",\n\n \"data-object_id\" => $resume->id,\n \"data-pricing_id\" => $pricing->id,\n \"data-fullname\" => $dName,\n \"data-email\" => $dMail,\n\n ), \" \");\n\n return $this->render(\"default\", \"payment\");\n }", "public function create_ubib_points($customer_id,$order_id,$total){\r\n $points = floor($total/10)*100;\r\n if($points>0){\r\n $this->language->load('total/reward'); \r\n $query = $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"customer_reward SET customer_id = '\" . (int)$customer_id . \"', description = '\" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_id)) . \"', points = '\" . (int)$points . \"', date_added = NOW()\");\r\n }\r\n \r\n //Convert to credits (1000 points => 1 credit)\r\n $query = $this->db->query(\"SELECT SUM(points) AS total FROM `\" . DB_PREFIX . \"customer_reward` WHERE customer_id = '\" . (int)$customer_id . \"' GROUP BY customer_id\");\r\n if ($query->row) {\r\n $credit = 0;\r\n $credit = floor($query->row['total']/1000); \r\n if($credit>0){\r\n $redeem_points = $credit * 1000;\r\n $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"customer_transaction SET customer_id = '\" . (int)$customer_id . \"', order_id = '\" . (int)$order_id . \"', description = 'Converted \".$redeem_points.\" Points To \".$credit.\" Credits', amount = '\" . (float)$credit . \"', date_added = NOW()\");\r\n $query = $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"customer_reward SET customer_id = '\" . (int)$customer_id . \"', description = 'Converted \".$redeem_points.\" Points To \".$credit.\" Credits', points = '\" . (float)-$redeem_points . \"', date_added = NOW()\");\r\n }\r\n }\r\n return true;\r\n }", "public static function updatePointsAfterRank($isRecruiter, $member_id, $points_for_rank){\n\t\t\n\t\tglobal $db; \n\t\t\n\t\t//regular user\n\t\tif ($isRecruiter == 0){\n\t\t\t//set query\n\t\t\t$query_text = \"UPDATE points_users SET current_amount = current_amount + :points_for_rank, \n\t\t\ttotal_amount_ever = total_amount_ever + :points_for_rank WHERE user_id = :member_id\";\n\t\t}\n\t\t//recruiter\n\t\telse {\n\t\t\t//set query\n\t\t\t$query_text = \"UPDATE points_recruiters SET current_amount = current_amount + :points_for_rank, \n\t\t\ttotal_amount_ever = total_amount_ever + :points_for_rank WHERE recruiter_id = :member_id\";\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t//prepare query\n\t\t\t$query_statement = $db->prepare($query_text);\n\t\t\t//bind\n\t\t\t$query_statement->bindValue(':points_for_rank', $points_for_rank);\n\t\t\t$query_statement->bindValue(':member_id', $member_id);\n\t\t\t//execute query\n\t\t\t$query_statement->execute();\n\t\t}\n\t\t\t\n\t\tcatch (PDOException $ex) {\n\t\t$error_message = $ex->getMessage();\n\t\t$result = array('error_message' => $error_message);\n\t\treturn $result;\n\t\t}\n\t\t\n\t\t//no errors, return null\n\t\treturn null; \n\t\t\n\t}", "public function assignGrades()\n {\n if(isset($this->data['EarningRatePrisoner']) && is_array($this->data['EarningRatePrisoner']) && $this->data['EarningRatePrisoner']!='')\n {\n if(isset($this->data['EarningRatePrisoner']['uuid']) && $this->data['EarningRatePrisoner']['uuid']=='')\n {\n $uuidArr=$this->EarningRatePrisoner->query(\"select uuid() as code\");\n $this->request->data['EarningRatePrisoner']['uuid']=$uuidArr[0][0]['code'];\n } \n if(isset($this->data['EarningRatePrisoner']['date_of_assignment']) && $this->data['EarningRatePrisoner']['date_of_assignment']!=\"\" )\n {\n $this->request->data['EarningRatePrisoner']['date_of_assignment']=date('Y-m-d',strtotime($this->data['EarningRatePrisoner']['date_of_assignment']));\n }\n if($this->EarningRatePrisoner->save($this->data))\n {\n $this->Session->write('message_type','success');\n $this->Session->write('message','Saved successfully');\n $this->redirect('/earningRates/assignGrades'); \n } \n else\n {\n $this->Session->write('message_type','error');\n $this->Session->write('message','saving failed');\n }\n\n }\n /*\n *Code for delete the Earning Rates\n */\n if(isset($this->data['EarningRatePrisonerDelete']['id']) && (int)$this->data['EarningRatePrisonerDelete']['id'] != 0){\n $this->EarningRatePrisoner->id=$this->data['EarningRatePrisonerDelete']['id'];\n $this->EarningRatePrisoner->saveField('is_trash',1);\n\n $this->Session->write('message_type','success');\n $this->Session->write('message','Deleted Successfully !');\n $this->redirect(array('action'=>'assignGrades'));\n }\n /*\n *Code for edit the Earning Rates\n */\n if(isset($this->data['EarningRatePrisonerEdit']['id']) && (int)$this->data['EarningRatePrisonerEdit']['id'] != 0){\n if($this->EarningRatePrisoner->exists($this->data['EarningRatePrisonerEdit']['id'])){\n $this->data = $this->EarningRatePrisoner->findById($this->data['EarningRatePrisonerEdit']['id']);\n }\n } \n $gradeslist=$this->EarningRate->find('list',array(\n 'recursive' => -1,\n 'fields' => array(\n 'EarningRate.id',\n 'EarningGrade.name',\n ),\n \"joins\" => array(\n array(\n \"table\" => \"earning_grades\",\n \"alias\" => \"EarningGrade\",\n \"type\" => \"LEFT\",\n \"conditions\" => array(\n \"EarningRate.earning_grade_id = EarningGrade.id\"\n )\n )),\n 'conditions' => array(\n 'EarningRate.is_enable' => 1,\n 'EarningRate.is_trash' => 0,\n ),\n 'order'=>array(\n 'EarningGrade.name'\n )\n )); \n $prisonerlist=$this->Prisoner->find('list',array(\n 'recursive' => -1,\n 'fields' => array(\n 'Prisoner.id',\n 'Prisoner.prisoner_no',\n ),\n 'conditions' => array(\n 'Prisoner.is_enable' => 1,\n 'Prisoner.is_trash' => 0,\n ),\n 'order'=>array(\n 'Prisoner.prisoner_no'\n )\n )); \n\n $this->set(compact('gradeslist','prisonerlist'));\n\n }", "public function recordPointsForOrderEvent($observer){\n\t\tif(Mage::getStoreConfig('rewardpointspro/rewardpointspro/enabled')&& Mage::getStoreConfig('rewardpointspro/display/product_rewards')){ \n\t\t\t$order = $observer->getEvent()->getOrder();\n\t\t\t$items =$order->getItemsCollection();\n\t\t\t$customer_id_from_event = $order->getCustomerId();\n\t\t\t$customerId = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCustomerId();\n\t\t\t$rewardPoints = 0;\n\t\t\t$prodIds = array();\n\t\t\tforeach ($items as $_item) {\n\t\t\t\t$prodIds[] = $_item->getProductId();\n\t\t\t}\n\t\t\t$prod = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('reward_points_pro')->addIdFilter($prodIds);\n\t\t\t//sum up points per product per quantity\n\t\t\tforeach ($items as $_item) {\n\t\t\t$rewardPoints += $prod->getItemById($_item->getProductId())->getRewardPointsPro() * $_item->getQtyOrdered();\n\t\t\t}\n\t\t\t//record points for item into db\n\t\t\t$this->recordPoints($rewardPoints, $customerId);\n\t\t\t$discounted = Mage::getSingleton('customer/session')->getApplyPoints();\n\t\t\t//subtract points for this order\n\t\t\t$this->useCouponPoints($discounted, $customerId); \n\t\t \n\t\t}\n\t\tMage::getSingleton('customer/session')->setdisc(0);\n\t}", "function RenderRow() {\n\t\tglobal $conn, $Security, $Language, $selection_grade_point;\n\n\t\t// Initialize URLs\n\t\t// Call Row_Rendering event\n\n\t\t$selection_grade_point->Row_Rendering();\n\n\t\t// Common render codes for all row types\n\t\t// selection_grade_points_id\n\n\t\t$selection_grade_point->selection_grade_points_id->CellCssStyle = \"\"; $selection_grade_point->selection_grade_points_id->CellCssClass = \"\";\n\t\t$selection_grade_point->selection_grade_points_id->CellAttrs = array(); $selection_grade_point->selection_grade_points_id->ViewAttrs = array(); $selection_grade_point->selection_grade_points_id->EditAttrs = array();\n\n\t\t// grade_point\n\t\t$selection_grade_point->grade_point->CellCssStyle = \"\"; $selection_grade_point->grade_point->CellCssClass = \"\";\n\t\t$selection_grade_point->grade_point->CellAttrs = array(); $selection_grade_point->grade_point->ViewAttrs = array(); $selection_grade_point->grade_point->EditAttrs = array();\n\n\t\t// min_grade\n\t\t$selection_grade_point->min_grade->CellCssStyle = \"\"; $selection_grade_point->min_grade->CellCssClass = \"\";\n\t\t$selection_grade_point->min_grade->CellAttrs = array(); $selection_grade_point->min_grade->ViewAttrs = array(); $selection_grade_point->min_grade->EditAttrs = array();\n\n\t\t// max_grade\n\t\t$selection_grade_point->max_grade->CellCssStyle = \"\"; $selection_grade_point->max_grade->CellCssClass = \"\";\n\t\t$selection_grade_point->max_grade->CellAttrs = array(); $selection_grade_point->max_grade->ViewAttrs = array(); $selection_grade_point->max_grade->EditAttrs = array();\n\t\tif ($selection_grade_point->RowType == EW_ROWTYPE_VIEW) { // View row\n\n\t\t\t// selection_grade_points_id\n\t\t\t$selection_grade_point->selection_grade_points_id->ViewValue = $selection_grade_point->selection_grade_points_id->CurrentValue;\n\t\t\t$selection_grade_point->selection_grade_points_id->CssStyle = \"\";\n\t\t\t$selection_grade_point->selection_grade_points_id->CssClass = \"\";\n\t\t\t$selection_grade_point->selection_grade_points_id->ViewCustomAttributes = \"\";\n\n\t\t\t// grade_point\n\t\t\t$selection_grade_point->grade_point->ViewValue = $selection_grade_point->grade_point->CurrentValue;\n\t\t\t$selection_grade_point->grade_point->CssStyle = \"\";\n\t\t\t$selection_grade_point->grade_point->CssClass = \"\";\n\t\t\t$selection_grade_point->grade_point->ViewCustomAttributes = \"\";\n\n\t\t\t// min_grade\n\t\t\t$selection_grade_point->min_grade->ViewValue = $selection_grade_point->min_grade->CurrentValue;\n\t\t\t$selection_grade_point->min_grade->CssStyle = \"\";\n\t\t\t$selection_grade_point->min_grade->CssClass = \"\";\n\t\t\t$selection_grade_point->min_grade->ViewCustomAttributes = \"\";\n\n\t\t\t// max_grade\n\t\t\t$selection_grade_point->max_grade->ViewValue = $selection_grade_point->max_grade->CurrentValue;\n\t\t\t$selection_grade_point->max_grade->CssStyle = \"\";\n\t\t\t$selection_grade_point->max_grade->CssClass = \"\";\n\t\t\t$selection_grade_point->max_grade->ViewCustomAttributes = \"\";\n\n\t\t\t// selection_grade_points_id\n\t\t\t$selection_grade_point->selection_grade_points_id->HrefValue = \"\";\n\t\t\t$selection_grade_point->selection_grade_points_id->TooltipValue = \"\";\n\n\t\t\t// grade_point\n\t\t\t$selection_grade_point->grade_point->HrefValue = \"\";\n\t\t\t$selection_grade_point->grade_point->TooltipValue = \"\";\n\n\t\t\t// min_grade\n\t\t\t$selection_grade_point->min_grade->HrefValue = \"\";\n\t\t\t$selection_grade_point->min_grade->TooltipValue = \"\";\n\n\t\t\t// max_grade\n\t\t\t$selection_grade_point->max_grade->HrefValue = \"\";\n\t\t\t$selection_grade_point->max_grade->TooltipValue = \"\";\n\t\t} elseif ($selection_grade_point->RowType == EW_ROWTYPE_EDIT) { // Edit row\n\n\t\t\t// selection_grade_points_id\n\t\t\t$selection_grade_point->selection_grade_points_id->EditCustomAttributes = \"\";\n\t\t\t$selection_grade_point->selection_grade_points_id->EditValue = $selection_grade_point->selection_grade_points_id->CurrentValue;\n\t\t\t$selection_grade_point->selection_grade_points_id->CssStyle = \"\";\n\t\t\t$selection_grade_point->selection_grade_points_id->CssClass = \"\";\n\t\t\t$selection_grade_point->selection_grade_points_id->ViewCustomAttributes = \"\";\n\n\t\t\t// grade_point\n\t\t\t$selection_grade_point->grade_point->EditCustomAttributes = \"\";\n\t\t\t$selection_grade_point->grade_point->EditValue = ew_HtmlEncode($selection_grade_point->grade_point->CurrentValue);\n\n\t\t\t// min_grade\n\t\t\t$selection_grade_point->min_grade->EditCustomAttributes = \"\";\n\t\t\t$selection_grade_point->min_grade->EditValue = ew_HtmlEncode($selection_grade_point->min_grade->CurrentValue);\n\n\t\t\t// max_grade\n\t\t\t$selection_grade_point->max_grade->EditCustomAttributes = \"\";\n\t\t\t$selection_grade_point->max_grade->EditValue = ew_HtmlEncode($selection_grade_point->max_grade->CurrentValue);\n\n\t\t\t// Edit refer script\n\t\t\t// selection_grade_points_id\n\n\t\t\t$selection_grade_point->selection_grade_points_id->HrefValue = \"\";\n\n\t\t\t// grade_point\n\t\t\t$selection_grade_point->grade_point->HrefValue = \"\";\n\n\t\t\t// min_grade\n\t\t\t$selection_grade_point->min_grade->HrefValue = \"\";\n\n\t\t\t// max_grade\n\t\t\t$selection_grade_point->max_grade->HrefValue = \"\";\n\t\t}\n\n\t\t// Call Row Rendered event\n\t\tif ($selection_grade_point->RowType <> EW_ROWTYPE_AGGREGATEINIT)\n\t\t\t$selection_grade_point->Row_Rendered();\n\t}", "function reffer_amount(){\n\t$user_id=$_REQUEST['user_id'];\n\tif(!empty($user_id)){\n\t $reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue_sum('refferal_records', 'refferal_frnd_id', $user_id,'refferal_amount');\n\t\t$user_reffer_amount = $records[0]['total'];\n\t\tif(!empty($user_reffer_amount)){\n\t\t\t$user_reffer_amount=$user_reffer_amount;\n\t\t}else{\n\t\t\t$user_reffer_amount='0';\n\t\t}\n\t\t\t$post = array(\"status\" => \"true\",'reffer_amount'=>$refferal_amount,'user_total_reffer_amount'=>$user_reffer_amount,'user_id'=>$user_id);\n\t\t\n\t\t}else{\n\t\t\t$post = array(\"status\" => \"false\",'message'=>'missing parameter','user_id'=>$user_id);\n\t\t}\n\t\t\techo $this -> json($post);\n}", "public function expenseFormAction()\n\t{\n\t\tView::renderTemplate('Expense/addExpense.html', [\n\t\t\t'date' => date('Y-m-d'),\n\t\t\t'payments' => Payment::getPaymentsCategories(),\n\t\t\t'expenses' => Expense::getExpensesCategories()\n\t\t]);\n\t}", "function getPoints() {\n return $this->points;\n }", "public function actionProvRegnasRekapFenomena() {\n return $this->render('prov/prov-regnas-rekap-fenomena');\n }", "public static function rs_insert_google_plus_share_points($pointsredeemed,$getregularprice,$postid, $level,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail){\n \n $rewardpoints = array('0');\n $rewardpercents = array('0'); \n\n //Product Level Points and Percent\n $gettype = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_social_rewardsystem_options_google');\n $getpoints = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempoints_google');\n $getpercent = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempercent_google');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $getpercent / 100;\n $getaveragepoints = $getaverage * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforproductlevel = $pointswithvalue / $pointconversionvalue;\n\n //Category Level Points and Percent\n $categorylist = wp_get_post_terms($postid, 'product_cat');\n $getcount = count($categorylist);\n $term = get_the_terms($postid,'product_cat');\n if(is_array($term)) {\n foreach ($term as $terms) {\n $termid = $terms->term_id; \n $categorylevelrewardtype = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_google_enable_rs_rule');\n $categorylevelrewardpoints = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_google_rs_category_points');\n $categorylevelrewardpercents = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_google_rs_category_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $categorylevelrewardpercents / 100;\n $getaveragepoints = $categorylevelrewardpercents * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforcategorylevel = $pointswithvalue / $pointconversionvalue;\n \n //Global Level Points and Percent\n $global_reward_type = get_option('rs_global_social_reward_type_google');\n $global_reward_points = get_option('rs_global_social_google_reward_points');\n $global_reward_percent = get_option('rs_global_social_google_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $global_reward_percent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n \n if($getcount > 1){ \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n } else { \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n }\n }\n }else {\n $global_reward_type = get_option('rs_global_social_reward_type_google');\n $global_reward_points = get_option('rs_global_social_google_reward_points');\n $global_reward_percent = get_option('rs_global_social_google_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $global_reward_percent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n }\n \n $getcategorypoints = max($rewardpoints);\n $getcategorypercent = max($rewardpercents);\n $restrictuserpoints = get_option('rs_max_earning_points_for_user');\n $enabledisablemaxpoints = get_option('rs_enable_disable_max_earning_points_for_user');\n $order_id = '0';\n $variationid = '0';\n $refuserid = '0';\n $equredeemamt = '0';\n $pointsredeemed = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $noofdays = get_option('rs_point_to_be_expire');\n if(($noofdays != '0')&& ($noofdays != '')){\n $date = time() + ($noofdays * 24 * 60 * 60); \n }else{\n $date = '999999999999';\n }\n switch ($level) {\n case '1':\n if ($gettype == '1') { \n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getpoints;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n \n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforproductlevel;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n case '2':\n if ($categorylevelrewardtype == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypoints;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypercent;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n case '3':\n if ($global_reward_type == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $global_reward_points;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforgloballevel;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n }\n }", "public function changePoint() {\r\n if ( !$this->session->userdata('isAdminTps') ) {\r\n redirect('public/home','refresh');\r\n }\r\n\r\n if ( empty($_POST) ) {\r\n redirect('admin/data/group','refresh');\r\n } else {\r\n\r\n if ($_POST['n_point'] == '0') :\r\n redirect('admin/data/group'); \r\n endif;\r\n \r\n\r\n $fields = ['thn_ajaran','smt','kode_kel','nbi','nilai_huruf'];\r\n\r\n foreach ($fields as $field) {\r\n \r\n foreach ($_POST[$field] as $key => $value) {\r\n $datanya[$key][$field] = $value; \r\n }\r\n\r\n }\r\n \r\n // Proses update nilai huruf oleh admin\r\n foreach ($datanya as $participant) {\r\n $thn_ajaran = $participant['thn_ajaran'];\r\n $smt = $participant['smt'];\r\n $kode_kel = $participant['kode_kel'];\r\n $nbi = $participant['nbi'];\r\n $nilai_huruf = $participant['nilai_huruf'];\r\n\r\n $updateData = ['nilai_huruf' => $nilai_huruf];\r\n\r\n $updatePoint = $this->M_anggota->update($thn_ajaran,$smt,$kode_kel,$nbi,$updateData);\r\n\r\n } \r\n\r\n redirect('admin/data/group/detailGroup/'.$kode_kel,'refresh');\r\n }\r\n\r\n }", "public function newAction()\n {\n $user = $this->getCurrentUser();\n $form = new Facepalm_Form_Point($user, null);\n\n if ($this->getRequest()->isPost()) {\n $post = $this->getRequest()->getPost();\n if ($form->isValid($post)) {\n $point = $form->persist();\n\n $this->_helper->sendNotifications(\n $point, $this->getCurrentUser()\n );\n\n $this->_helper->getStaticHelper('redirector')\n ->gotoSimpleAndExit('index');\n }\n }\n\n $this->view->form = $form;\n }", "public function actionKnprRegnasRekapData() {\n return $this->render('knpr/knpr-regnas-rekap-data');\n }", "function generateRequest($points){\n\t\t// then add an entry with from this->api->auth->modelid to searched persons\n\t\t$this['request_from_id'] = $this->api->auth->model->id;\n\t\t$this['currently_requested_to_id'] = 1;\n\t\t$this['points_required'] = $points;\n\t\t$this->save();\n\t}", "public function search()\n {\n auth_admin();\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $post = $this->input->post();\n $query = $this->Redeem_Point->GetAllRedeem($post['card_id'], $post['username'], $post['police_number'],\n $post['vin_number']);\n if ($query->num_rows() > 0) {\n $no = 0;\n $path_uri = $this->path_uri;\n foreach ($query->result_array() as $buf) {\n $no++;\n $id = $buf['id'];\n $uname = $buf['username'];\n $car = $buf['brands'] . ' ' . $buf['types'] . ' ' . $buf['series'] . ' ' . $buf['model']; // . ' ' . $buf['transmisi'] . ' ' . $buf['engine'] . ' ' . $buf['car_cc'] . ' ' .$buf['color'];\n $pnumber = $buf['police_number'];\n $vnumber = $buf['vin_number'];\n $reward = $buf['point_reward'];\n // $reward\t\t= $buf['stnk_date'];\n\n $edit_href = ($reward > 0) ? site_url($path_uri . '/edit/' . $id) : '#';\n $list_data[] = array(\n 'no' => $no,\n 'id' => $id,\n 'uname' => $uname,\n 'car' => $car,\n 'reward' => $reward,\n 'pnumber' => $pnumber,\n 'vnumber' => $vnumber,\n 'edit_href' => $edit_href,\n 'hist' => '<a href=\"javascript:void(0)\" onclick=\"show(\\'' . $id . '\\');\">view</a>'\n );\n }\n $dbuf = array(\n 'base_url' => base_url(),\n 'file_app' => $this->ctrl,\n 'menu_title' => $this->title,\n 'list_data' => $list_data,\n 'path_app' => $this->path,\n );\n\n $data = $this->parser->parse($this->template . '/list_item.html', $dbuf, true);\n echo $data, exit;\n }\n }\n echo '0', exit;\n }", "public function offers_redeemed()\n {\n return $this->belongsToMany('Offer', 'user_redeem', 'nonmember_id', 'offer_id');\n }", "function getvip()\r\n{\r\n require_once(\"heading.php\");\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n $total_points = mysql_fetch_row(mysql_query(\"SELECT `points` FROM point_system WHERE `accountid` = '$user_id';\"));\r\n $total_points = $total_points[0];\r\n if($total_points <= 0)\r\n $total_points = (int)0;\r\n mysql_select_db($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']) ;\r\n $old_userid = (int)0;\r\n $old_userid = mysql_fetch_row(mysql_query(\"SELECT `id` FROM account WHERE `username` = '$user_name';\"));\r\n $old_userid = $old_userid[0];\r\n $vip_level = mysql_fetch_row(mysql_query(\"SELECT `gmlevel` FROM account WHERE `username` = '$user_name';\"));\r\n $vip_level = $vip_level[0]; \r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n \r\nif($total_points > ($vip_cost-1))\r\n {\r\n if($vip_level < 3)\r\n {\r\n $vip_level = $vip_level + 1;\r\n if($user_name != NULL)\r\n mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', 'VIP$vip_level', '$datetime', '$user_name', 'Yes');\");\r\n else mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', 'VIP$vip_level', '$datetime', 'Error!!', 'No');\");\r\n mysql_query(\"UPDATE point_system SET `points` = `points` - $vip_cost WHERE `accountid` = '$user_id';\");\r\n mysql_select_db($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']) ;\r\n mysql_query(\"UPDATE account SET `gmlevel` = $vip_level WHERE username = '$user_name';\");\r\n\t mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n $output .= \"<div class=\\\"top\\\"><h1>$user_name VIP Granted!</h1></div><center>\";\r\n }\r\n else $output .= \"<div class=\\\"top\\\"><h1>$user_name You are already Max VIP!</h1></div><center>\";\r\n }\r\nelse $output .= \"<div class=\\\"top\\\"><h1>$user_name you do not have enough points upgrade to VIP!</h1></div><center>\";\r\nrequire_once(\"footer.php\");\r\n}", "function process($data)\n {\n \t$this->referees = $referees = $this->getReferees();\n \n // Calc total points for each referee\n foreach($this->referees as $referee) \n {\n \t$points = $this->getMadisonRefereePoints($referee->id);\n \t\n \t$referee->pending = $points['pending'];\n \t$referee->processed = $points['processed'];\n \t\n \t$referee->pending_rt = $points['pending_rt'];;\n \t$referee->processed_rt = $points['processed_rt'];\n }\n $this->buildPickLists($referees,$data);\n \n /* And render it */ \n return $this->renderx();\n }", "public function process_offer()\n {\n if (isset($_POST[$this->token . '_nonce']) && wp_verify_nonce($_POST[$this->token . '_nonce'], $this->token . '_submit_offer')) {\n global $wpdb;\n $quiz_id = sanitize_text_field($_POST['quiz_id']);\n $user_id = sanitize_text_field($_POST['user_id']);\n $last_name = sanitize_text_field($_POST['last_name']);\n $address = sanitize_text_field($_POST['address']);\n $address_2 = sanitize_text_field($_POST['address_2']);\n $city = sanitize_text_field($_POST['city']);\n $state = sanitize_text_field($_POST['state']);\n $zip_code = sanitize_text_field($_POST['zip_code']);\n $phone = sanitize_text_field($_POST['phone']);\n\n // Get the prospect data saved previously\n $subscriber = $wpdb->get_row('SELECT frontdesk_id, email FROM ' . $this->table_name . ' WHERE id = \\'' . $user_id . '\\' ORDER BY id DESC LIMIT 0,1');\n\n // Update the FrontDesk prospect if exists\n if ($subscriber->frontdesk_id != null) {\n $this->frontdesk->setApiKey(get_post_meta($quiz_id, 'api_key', true))\n ->updateProspect($subscriber->frontdesk_id, [\n 'email' => $subscriber->email,\n 'last_name' => $last_name,\n 'address' => $address,\n 'address_2' => $address_2,\n 'city' => $city,\n 'state' => $state,\n 'zip_code' => $zip_code,\n 'phone' => $phone\n ]);\n }\n\n // Update the prospect data\n $wpdb->query($wpdb->prepare(\n 'UPDATE ' . $this->table_name . '\n\t\t\t SET last_name = %s, address = %s, address2 = %s, phone = %s\n\t\t\t WHERE id = \\'' . $user_id . '\\'',\n [\n $last_name,\n $address . ', ' . $city . ', ' . $state . ' ' . $zip_code,\n $address_2,\n $phone\n ]\n ));\n\n echo json_encode('success');\n die();\n }\n }", "public function execute()\n {\n //Add to Reward Point History\n $cusId = $_POST['cusId'];\n $amount = $_POST['amount'];\n $type = $_POST['action'];\n $point = $_POST['point'];\n $comment = $_POST['comment'];\n\n $model = $this->dataExample->create();\n //validate\n if ($type == 'Add' && $amount >= 0)\n {\n $model->addData([\n \"customer_id\" => $cusId,\n \"action\" => 'Admin Point Change',\n \"point\" => $amount,\n \"type\" => 1,\n \"order_id\" => null,\n \"author\" => 'Admin',\n \"sort_order\" => 1,\n \"comment\" => $comment\n ]);\n }\n if ($type == 'Deduct')\n {\n if ($amount >= 0 && $amount <= $point)\n {\n $rw = $amount * -1;\n $model->addData([\n \"customer_id\" => $cusId,\n \"action\" => 'Admin Point Change',\n \"point\" => $rw,\n \"type\" => 1,\n \"order_id\" => null,\n \"author\" => 'Admin',\n \"sort_order\" => 1,\n \"comment\" => $comment\n ]);\n }\n else {\n $this->messageManager->addWarning( __('Amount in valid.') );\n }\n }\n $model->save();\n\n //Update to Reward Point\n $cusId = $_POST['cusId'];\n $amount = $_POST['amount'];\n $type = $_POST['action'];\n $point = $_POST['point'];\n\n if ($type == 'Add' && $amount >= 0)\n {\n $total = $amount + $point;\n }\n if ($type == 'Deduct')\n {\n if ($amount >= 0 && $amount <= $point)\n {\n $total = $point - $amount;\n }\n else {\n $this->messageManager->addWarning( __('Amount in valid.') );\n }\n }\n $post = $this->dataPoint->create();\n $postUpdate = $post->load($cusId);\n $postUpdate->setPoint($total);\n $postUpdate->save();\n\n\n $saveData = $model->save();\n $postData = $postUpdate->save();\n if ($saveData && $postData) {\n $this->messageManager->addSuccess(__('Insert Record Successfully !'));\n }\n }", "public function update(Request $request, Points $points)\n {\n //\n }", "public static function display_layer() { \n ?>\n\n <tr class=\"rate_row\">\n <td><?php _e('From', 'woocommerce-bundle-rate-shipping') ?> <span class=\"start_count\"><?php echo $_POST['start_count'] ?></span> \n <?php _e('to', 'woocommerce-bundle-rate-shipping') ?> <input type=\"text\" name=\"<?php echo $_POST['products_input'] ?>\" class=\"bundle_rate_products\" /> \n <?php _e('products', 'woocommerce-bundle-rate-shipping') ?>\n </td>\n <td><input type=\"text\" name=\"<?php echo $_POST['cost_input'] ?>\" value=\"\" />\n <td><button class=\"remove_bundle_layer button\"><?php _e('Remove', 'woocommerce-bundle-rate-shipping') ?></button></td>\n </tr> \n\n <?php\n \n die;\n }", "public function action_revisar()\n\t{\n $this->view = View::factory( 'controller/supplier/despacho/revisar' );\n \n //IF USER SUBMITTED FORM \n\t$ID_DESPACHO = $this->request->param('params');\n $pedidos = DB::query(Database::SELECT, \"SELECT Distinct(`ID_PEDIDO`) FROM `pedido_despacho_x_producto` WHERE `ESTADO` in ('EN PROCESO','COMPRADO') AND `ID_DESPACHO` = \".$ID_DESPACHO.\"\")->execute()->as_array();\n $this->view->set( 'pedidos', $pedidos);\n $despacho = ORM::factory('despacho')->where('ID_DESPACHO', '=', $ID_DESPACHO)->find();\n $this->view->set( 'despacho', $despacho );\n $user = ORM::factory('user')->where('ID_USUARIO', '=', $despacho->ID_USUARIO)->find();\n $this->view->set( 'user', $user->ID_USUARIO );\n $validar = count($pedidos);\n $this->view->set( 'validar', $validar );\n \n //VALIDATE POST\n if( $this->request->post() )\n {\n \n try\n { \n $values= $this->request->post();\n $proceso = 0;\n $pedidoProceso = array();\n echo Debug::vars($values);\n foreach ($values as $key=>$value) {\n if(strpos($value, 'Comprar')!== false)\n {\n $proceso = 1;\n } \n if(strpos($value, 'Enviar')!== false)\n {\n $proceso = 2;\n } \n if(strpos($value, 'Entregar')!== false)\n {\n $proceso = 3;\n } \n if(strpos($value, 'Cancelar')!== false)\n {\n $proceso = 4;\n } \n if(strpos($key, 'ID_PEDIDO_')!== false)\n {\n $aux = explode('_', $key);\n $pedidoProceso = $pedidoProceso + array($aux[2]=>$aux[2]);\n }\n }\n switch ($proceso)\n {\n case 1:foreach ($pedidoProceso as $value) {\n DB::update('pedido_despacho_x_producto')->set(array('ID_DESPACHO'=>$ID_DESPACHO,'ESTADO'=>'COMPRADO'))->where('ID_PEDIDO', '=', $value)\n ->execute(); \n }\n FlashMessenger::factory()->set_message('success', Kohana::message('admin', 'admin:despacho:estado:comprado'));\n break;\n case 2:foreach ($pedidoProceso as $value) {\n DB::update('pedido_despacho_x_producto')->set(array('ID_DESPACHO'=>$ID_DESPACHO,'ESTADO'=>'ENVIADO'))->where('ID_PEDIDO', '=', $value)\n ->execute(); \n }\n FlashMessenger::factory()->set_message('success', Kohana::message('admin', 'admin:despacho:estado:enviado'));\n break;\n case 3:foreach ($pedidoProceso as $value) {\n $producto = ORM::factory('pedidodespachoxproducto')->where('ID_PEDIDO', '=', $value)->find_all();\n foreach ($producto as $value2) {\n $cantidad = ORM::factory('productoxbodega')->where('ID_PRODUCTO', '=', $value2->ID_PRODUCTO)->find();\n $valor = $cantidad->CANTIDAD + $value2->CANTIDAD;\n DB::update('producto_x_bodega')->set(array('CANTIDAD'=>$valor,))->where('ID_PRODUCTO', '=', $value2->ID_PRODUCTO)->execute(); \n }\n DB::update('pedido_despacho_x_producto')->set(array('ID_DESPACHO'=>$ID_DESPACHO,'ESTADO'=>'ENTREGADO'))->where('ID_PEDIDO', '=', $value)\n ->execute(); \n }\n \n FlashMessenger::factory()->set_message('success', Kohana::message('admin', 'admin:despacho:estado:entregado'));\n break;\n case 4:foreach ($pedidoProceso as $value) {\n DB::update('pedido_despacho_x_producto')->set(array('ID_DESPACHO'=>$ID_DESPACHO,'ESTADO'=>'CANCELADO'))->where('ID_PEDIDO', '=', $value)\n ->execute(); \n }\n FlashMessenger::factory()->set_message('error', Kohana::message('admin', 'admin:despacho:estado:cancelado'));\n break;\n default : HTTP::redirect('supplier/main');\n break;\n } \n }\n catch(Exception $e)\n {\n echo $e->getMessage();\n FlashMessenger::factory()->set_message('error', $e->getMessage());\n }\n HTTP::redirect('supplier/despacho/procesar/');\n } \n $this->view->set( '$despacho', $despacho );\n\t}", "public function getPointsApp_post() {\n $this->form_validation->set_rules('PointsCategory', 'PointsCategory', 'trim|in_list[Normal,InPlay,Reverse]');\n $this->form_validation->validation($this); /* Run validation */\n\n $PointsData = $this->Sports_model->getPointsApp($this->Post);\n if (!empty($PointsData)) {\n $this->Return['Data'] = $PointsData['Data'];\n }\n }", "public function pay()\n {\n \n return view('admin.products.pay');\n \n }", "function setReward($points, $rewardArray, $name, $email){\n\t\tif(($rewardArray['500'] != 500) && ($points >= 500)){ //one time award at 500 points\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 => 500\";\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'Chat_'.RandomString(10);\n\t\t\t$ckey = '';\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Have an interview with our expert staff and be highlighted on our blog and homepage.', $name, $email, $code);\n\t\t} elseif($points >= $rewardArray['100']){ // every 100\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 6;\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('20% off any single non-sale item', $name, $email, $code); \n\t\t}\n\t\t\n\t\tif($points > $rewardArray['250']){ //every 250\n\t\t\t$rewardArray['250'] += 250;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 2;//free shipping coupon\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Free Ground shipping for US domestic or $10 off intenational shipping', $name, $email, $code);\n\t\t}\n\t\t\n\t}", "protected function _beforeToHtml()\n {\n /* below actions were taken to display the rewards points\n that the logged-in customer will get once the order is placed */\n $quote = $this->_checkoutSession->getQuote();\n $lastOrder = $this->_checkoutSession->getLastRealOrder();\n $address = $quote->getIsVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();\n $isVirtualProductMessageAvailable = $this->isVirtualProductAvailable($lastOrder);\n if ($isVirtualProductMessageAvailable) {\n $lastOrder->setIsVirtualProductMessageAvailable($isVirtualProductMessageAvailable);\n }\n\n $quote->setBaseGrandTotal($lastOrder->getBaseGrandTotal());\n $address->setBaseShippingAmount($lastOrder->getBaseShippingAmount());\n $address->setBaseShippingTaxAmount($lastOrder->getBaseShippingTaxAmount());\n\n return parent::_beforeToHtml();\n }", "public function setPoints($points)\n {\n $this->points = $points;\n\n return $this;\n }", "public function setPoints($points)\n {\n $this->points = $points;\n\n return $this;\n }", "public function offer() {\n\n return view('offer');\n }", "public function add_evaluation_points(request $request){\n\t\t\n\t\t$validator = \\Validator::make($request->all(), [\n\t\t\t\t'question_for'=>'required',\n\t\t\t\t'Question'=>'required',\n\t\t\t\t'Suggestion'=>'required',\n\t\t\t\t'Status'=>'required',\n\t\t\t\t//'client_comment'=>'required',\n\t\t\t\t//'business_analysis'=>'required'\n\t\t\t]);\n \n\t\tif($validator->fails()){\n\t\t\treturn response()->json($validator->messages(), 500);\n\t\t}\n \n\t\t$role_id = $request->Input('question_for');\n\t\t$Question=$request->Input('Question');\n\t\t$Suggestion=$request->Input('Suggestion');\n\t\t$Status=$request->Input('Status');\n\t\t\n\t\t\n\t\t\n\t\t$data=array(\n\t\t\t'settings_id' => $role_id,\n\t\t\t'text'=> $Question,\n\t\t\t'suggestion'=>$Suggestion,\n\t\t\t'status'=>$Status,\n\t\t\t//'user_id'=>$user = \\Auth::user()->id,\n\t\t\t//'created_at'=>date(\"Y-m-d h:i:s\"),\n\t\t);\n \n\t\tif($request->Input('id')){\n\t\t\t$result=DB::table('evaluation_points')\n\t\t\t->where('id', $request->Input('id'))\n\t\t\t->update($EvaluationPointController_data);\n\t\t\treturn $result=\"update\";\n\t\t}\n\t\telse{\n\t\t\t$result=DB::table('evaluation_points')->insert($data);\t\n\t\t}\n\t\tif($result)\n\t\treturn 1;\n\t}", "function freelancer_review_action() {\n global $user_ID;\n $args = $_POST;\n $project_id = $args['project_id'];\n \n $status = get_post_status($project_id);\n \n $bid_id_accepted = get_post_meta($project_id, 'accepted', true);\n \n $author_bid = (int)get_post_field('post_author', $bid_id_accepted);\n \n $freelancer_id = get_post_field('post_author', $bid_id_accepted);\n \n /*\n * validate data\n */\n if (!isset($args['score']) || empty($args['score'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('You have to rate this project.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n if (!isset($args['comment_content']) || empty($args['comment_content'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('Please post a review for this freelancer.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n \n /*\n * check permission\n */\n if ($user_ID !== $author_bid || !$user_ID) {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You don\\'t have permission to review.', ET_DOMAIN)\n ));\n }\n \n /*\n * check status of project\n */\n if ($status !== 'complete') {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You can\\'t not reivew on this project.', ET_DOMAIN)\n ));\n }\n \n /**\n * check user reviewed project owner or not\n * @author Dan\n */\n $role = ae_user_role($user_ID);\n $type = 'em_review';\n if ($role == FREELANCER) {\n $type = 'fre_review';\n }\n \n $comment = get_comments(array(\n 'status' => 'approve',\n 'type' => $type,\n 'post_id' => $project_id\n ));\n \n if (!empty($comment)) {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You have reviewed on this project.', ET_DOMAIN)\n ));\n }\n \n // end check user review project owner\n \n // add review\n $args['comment_post_ID'] = $project_id;\n $args['comment_approved'] = 1;\n $this->comment_type = 'fre_review';\n $review = Fre_Review::get_instance(\"fre_review\");\n \n $comment = $review->insert($args);\n \n if (!is_wp_error($comment)) {\n \n /**\n * fire action after freelancer review employer base on project\n * @param int $int project id\n * @param Array $args submit args (rating score, comment)\n * @since 1.2\n * @author Dakachi\n */\n do_action('fre_freelancer_review_employer', $project_id, $args);\n \n //update project, bid, bid author, project author after review\n $this->update_after_fre_review($project_id, $comment);\n wp_send_json(array(\n 'success' => true,\n 'msg' => __(\"Your review has been submitted.\", ET_DOMAIN)\n ));\n } else {\n \n // revert bid status\n wp_update_post(array(\n 'ID' => $bid_id_accepted,\n 'post_status' => 'publish'\n ));\n \n wp_send_json(array(\n 'success' => false,\n 'msg' => $comment->get_error_message()\n ));\n }\n }", "public static function rs_insert_facebook_like_points($pointsredeemed,$getregularprice,$postid, $level,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail){\n \n $rewardpoints = array('0');\n $rewardpercents = array('0'); \n\n //Product Level Points and Percent\n $gettype = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_social_rewardsystem_options_facebook');\n $getpoints = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempoints_facebook');\n $getpercent = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempercent_facebook');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $getpercent / 100;\n $getaveragepoints = $getaverage * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforproductlevel = $pointswithvalue / $pointconversionvalue;\n\n //Category Level Points and Percent\n $categorylist = wp_get_post_terms($postid, 'product_cat');\n $getcount = count($categorylist);\n $term = get_the_terms($postid,'product_cat');\n if(is_array($term)){\n foreach ($term as $terms) {\n $termid = $terms->term_id;\n $categorylevelrewardtype = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_facebook_enable_rs_rule');\n $categorylevelrewardpoints = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_facebook_rs_category_points');\n $categorylevelrewardpercents = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_facebook_rs_category_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $getpercent / 100;\n $getaveragepoints = $categorylevelrewardpercents * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforcategorylevel = $pointswithvalue / $pointconversionvalue;\n \n //Global Level Points and Percent\n $global_reward_type = get_option('rs_global_social_reward_type_facebook');\n $global_reward_points = get_option('rs_global_social_facebook_reward_points');\n $global_reward_percent = get_option('rs_global_social_facebook_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $getpercent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n \n if($getcount > 1){ \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n } else { \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n }\n }\n }else {\n $global_reward_type = get_option('rs_global_social_reward_type_facebook');\n $global_reward_points = get_option('rs_global_social_facebook_reward_points');\n $global_reward_percent = get_option('rs_global_social_facebook_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $global_reward_percent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n }\n \n $getcategorypoints = max($rewardpoints);\n $getcategorypercent = max($rewardpercents);\n $order_id = '0';\n $variationid = '0';\n $refuserid = '0';\n $equredeemamt = '0';\n $pointsredeemed = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $restrictuserpoints = get_option('rs_max_earning_points_for_user');\n $enabledisablemaxpoints = get_option('rs_enable_disable_max_earning_points_for_user');\n $noofdays = get_option('rs_point_to_be_expire');\n if(($noofdays != '0')&& ($noofdays != '')){\n $date = time() + ($noofdays * 24 * 60 * 60); \n }else{\n $date = '999999999999';\n }\n switch ($level) {\n case '1':\n if ($gettype == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getpoints;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$postid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n \n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforproductlevel;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$postid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed, $date,'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n case '2':\n if ($categorylevelrewardtype == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypoints;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$postid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed, $date,'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypercent;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$postid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($orderuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n case '3':\n if ($global_reward_type == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $global_reward_points;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$postid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($orderuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed, $date,'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed, $date,'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforgloballevel;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date, 'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$postid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($orderuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed, $date,'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed, $date,'RPFL',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPFL',$equearnamt,$equredeemamt,$order_id,$postid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n }\n }", "function supplier_post_editing( $supplier_id ) {\n\t\t// Get all post editing charges of supplier\n\t\t$post_editing_charges = $this->users_model->get_post_editing_charges( intval( $supplier_id ) );\n\n\t\t// Set up data for UI\n\t\t$data = array( 'post_editing_charges' => $post_editing_charges );\n\t\t$this->logtrino_ui->_set_data( $data );\n\n\t\t// Render overview table\n\t\t$this->logtrino_ui->_render( 'users/widget/post_editing_overview' );\n\t}", "public function points_balance($type, $user_id, $node_type, $node_id = null)\n {\n global $db, $system;\n /* check if points enabled */\n if (!$system['points_enabled']) {\n return;\n }\n switch ($node_type) {\n case 'post':\n $points_per_node = $system['points_per_post'];\n break;\n\n case 'comment':\n $points_per_node = $system['points_per_comment'];\n break;\n\n case 'posts_reactions':\n case 'posts_photos_reactions':\n case 'posts_comments_reactions':\n $points_per_node = $system['points_per_reaction'];\n break;\n }\n switch ($type) {\n case 'add':\n /* check user daily limits */\n if ($this->get_remaining_points($user_id) == 0) {\n return;\n }\n /* add points */\n $db->query(sprintf(\"UPDATE users SET user_points = user_points + %s WHERE user_id = %s\", secure($points_per_node, 'int'), secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n /* update the node as earned */\n switch ($node_type) {\n case 'post':\n $db->query(sprintf(\"UPDATE posts SET points_earned = '1' WHERE post_id = %s\", secure($node_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'comment':\n $db->query(sprintf(\"UPDATE posts_comments SET points_earned = '1' WHERE comment_id = %s\", secure($node_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'posts_reactions':\n $db->query(sprintf(\"UPDATE posts_reactions SET points_earned = '1' WHERE id = %s\", secure($node_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'posts_photos_reactions':\n $db->query(sprintf(\"UPDATE posts_photos_reactions SET points_earned = '1' WHERE id = %s\", secure($node_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'posts_comments_reactions':\n $db->query(sprintf(\"UPDATE posts_comments_reactions SET points_earned = '1' WHERE id = %s\", secure($node_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n }\n break;\n\n case 'delete':\n /* delete points */\n $db->query(sprintf('UPDATE users SET user_points = IF(user_points-%1$s<=0,0,user_points-%1$s) WHERE user_id = %2$s', secure($points_per_node, 'int'), secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n }\n }", "public function givePointsForPromoCouponRegistration(User $user, $points)\n {\n $person = $this->_em->getRepository('ZenomaniaCoreBundle:Person')->findPersonByUser($user);\n $season = $this->_em->getRepository('ZenomaniaCoreBundle:Season')->findCurrentSeason();\n\n $params = [\n 'season' => $season,\n 'person' => $person,\n 'user' => $user,\n 'points' => $points,\n 'type' => PersonPoints::TYPE_PROMO_COUPON,\n 'state' => 'none',\n 'dt' => new \\DateTime(),\n 'operation_type' => PersonPoints::OPERATION_TYPE_DEBIT\n ];\n\n $personPoints = PersonPoints::fromArray($params);\n $this->_em->persist($personPoints);\n\n $this->_em->flush();\n }", "function gen_char()\r\n{\r\n require_once(\"heading.php\");\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n $total_points = mysql_fetch_row(mysql_query(\"SELECT `points` FROM point_system WHERE `accountid` = '$user_id';\"));\r\n $total_points = $total_points[0];\r\n if($total_points <= 0)\r\n $total_points = (int)0;\r\n $gend_char = $_GET[\"gend_char\"];\r\n mysql_select_db($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); ;\r\n $old_userid = (int)0;\r\n $old_userid = mysql_fetch_row(mysql_query(\"SELECT `account` FROM characters WHERE `name` = '$gend_char';\"));\r\n $old_userid = $old_userid[0];\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n if($user_id == $old_userid)\r\n {\r\nif($total_points > ($ch_gend_cost-1))\r\n {\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n if($user_name != NULL)\r\n mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', 'Change Gender', '$datetime', '$gend_char', 'No');\");\r\n else mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', '$gend_char', '$datetime', 'Error!!', 'No');\");\r\n mysql_query(\"UPDATE point_system SET `points` = `points` - $ch_gend_cost WHERE `accountid` = '$user_id';\");\r\n $output .= \"<div class=\\\"top\\\"><h1>$user_name, Your char has been flagged for gender change, Contact a GM ingame.</h1></div><center>\";\r\n }\r\nelse $output .= \"<div class=\\\"top\\\"><h1>$user_name, you do not have enough points to change $move_char 's gender!</h1></div><center>\";\r\n}\r\nelse $output .= \"<div class=\\\"top\\\"><h1>$user_name, $gend_char Is not your char!</h1></div><center>\";\r\n\r\n require_once(\"footer.php\");\r\n}", "public static function decreasePointsUser($member_id, $pointsToDecrease, $isRecruiter){\n\t\t\n\t\tglobal $db; \n\t\t\n\t\tif ($isRecruiter == 0) {\n\t\t\t//set query\n\t\t\t$query_text = \"UPDATE points_users SET current_amount = current_amount - :pointsToDecrease \n\t\t\tWHERE user_id = :member_id\";\n\t\t}\n\t\telse {\n\t\t\t//set query\n\t\t\t$query_text = \"UPDATE points_recruiters SET current_amount = current_amount - :pointsToDecrease \n\t\t\tWHERE recruiter_id = :member_id\";\n\t\t}\n\t\t\n\t\t\t\n\t\ttry {\n\t\t\t//prepare query\n\t\t\t$query_statement = $db->prepare($query_text);\n\t\t\t//bind\n\t\t\t$query_statement->bindValue(':pointsToDecrease', $pointsToDecrease);\n\t\t\t$query_statement->bindValue(':member_id', $member_id);\n\t\t\t//execute query\n\t\t\t$query_statement->execute();\n\t\t}\n\t\t\t\n\t\tcatch (PDOException $ex) {\n\t\t$error_message = $ex->getMessage();\n\t\t$result = array('error_message' => $error_message);\n\t\treturn $result;\n\t\t}\n\t\t\n\t\t//no errors, return null\n\t\treturn null;\n\t\t\n\t}" ]
[ "0.67140895", "0.66167986", "0.5845974", "0.5793979", "0.57863957", "0.57825184", "0.5688812", "0.5618296", "0.56000495", "0.55366266", "0.5496469", "0.549352", "0.5492733", "0.5475493", "0.54700106", "0.54416525", "0.5430484", "0.5411562", "0.5396062", "0.5374926", "0.53734684", "0.53182596", "0.5314186", "0.5306995", "0.52973807", "0.5294949", "0.5294812", "0.52667993", "0.5257058", "0.52366114", "0.52268815", "0.51730424", "0.51700085", "0.5167948", "0.516218", "0.5161305", "0.5132532", "0.5123661", "0.511015", "0.51052535", "0.51035917", "0.50992024", "0.5097725", "0.50819707", "0.5064861", "0.50640875", "0.50613767", "0.5054155", "0.5031718", "0.5028742", "0.5007172", "0.5006604", "0.5000008", "0.49961388", "0.49957106", "0.49928972", "0.49796128", "0.49685347", "0.49644527", "0.49558523", "0.495495", "0.4952644", "0.4951912", "0.4949366", "0.49425757", "0.49317732", "0.49214333", "0.49113435", "0.490848", "0.4886903", "0.48792437", "0.48769832", "0.48744005", "0.48739862", "0.48680195", "0.48635367", "0.4853313", "0.48509306", "0.48491153", "0.48490432", "0.48434418", "0.4843226", "0.48385093", "0.48371202", "0.4835867", "0.4818689", "0.48156217", "0.48035377", "0.47965994", "0.47923627", "0.47923627", "0.4791398", "0.47879732", "0.47868708", "0.47835898", "0.47810712", "0.47686616", "0.47639865", "0.47552177", "0.47540238" ]
0.77689725
0
Returns the download file name (same as the local file pointed to)
public function get_file_name() { if( is_null( $this->file_name ) ) return NULL; $pos1 = strrpos( $this->file_name, '/' ); $pos2 = strrpos( $this->file_name, '.' ); return false === $pos2 ? substr( $this->file_name, false === $pos1 ? 0 : $pos1 + 1 ) : substr( $this->file_name, false === $pos1 ? 0 : $pos1 + 1, $pos2 - $pos1 - 1 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilename()\n {\n return $this->target->getUri();\n }", "public function getFilename();", "public function getFilename();", "public function local_filename()\n\t{\n if (!$this->local_file) {\n $this->get_local_file();\n }\n return $this->local_file;\n\t}", "public function getFilename() {}", "public function getName()\n {\n if (is_null($this->download_url))\n return false;\n\n $uri = explode('/', $this->download_url);\n return array_pop($uri);\n }", "public function getDownloadLink() {\n $link = \"\";\n\n if($this->FileID)\n $link = $this->File()->Link();\n\n return $link;\n }", "protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }", "public function getFilename() {\n return $this->getData('file');\n }", "public function get_file_name() {\n\t\treturn $this->file;\n\t}", "public function getFileName()\n {\n return realpath($this->node->getAttribute('fileName', ''));\n }", "public function getFileName()\n {\n return basename($this->path);\n }", "function GetFileName() {\n \treturn $this->FilePost[$this->ObjClientSide]['name'];\n }", "public function getFilename()\n {\n return static::filename($this->path);\n }", "public function getFilename() : string\n {\n return $this->fileName;\n }", "private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }", "public function fullFilename()\n {\n $ext = '.xml';\n if (strpos(strtolower($this->url), '.csv') > 0)\n $ext = '.csv';\n return $this->filename . $ext;\n }", "public function getFilename(): string\n {\n return $this->filename;\n }", "public function getFilename(): string\n {\n return $this->filename;\n }", "function getFilename();", "public function getFileName();", "public function getFileName();", "public function getFileName();", "public function getFileUrl(){\n $url = config('kontaktformular.fileDownloadUrl');\n //Prüfen ob $url auf / endet\n if(substr($url, -1) != '/'){\n $url .= '/';\n }\n return $url . $this->file_hash .'/' . $this->file_name .'/'. $this->id;\n }", "public function getFileName()\n {\n $value = $this->get(self::FILENAME);\n return $value === null ? (string)$value : $value;\n }", "protected function ___filename() {\n\t\treturn $this->pagefiles->path . $this->basename;\n\t}", "function getFilename($downloadUrl) {\n // Get everything after the last slash of the URL.\n $filenameParts = array();\n preg_match('([^/]+$)', $downloadUrl, $filenameParts);\n $filename = $filenameParts[0];\n\n // If the last part after the slash has query parameters after the filename (like on file hosting sites), remove them.\n if (strpos($filename, '?') !== FALSE) {\n $filenameParts = explode('?', $filename);\n $filename = $filenameParts[0];\n }\n\n return $filename;\n}", "public function getFilename()\n {\n return '';\n }", "public function getFilename() {\n return $this->path;\n }", "public function getFilename(): string\n {\n return $this->getServer(self::SCRIPT_FILENAME);\n }", "public function filename()\n\t{\n\t\treturn $this->_filename();\n\t}", "protected function _getFileName($url) {\n \n $elements = split('/', $url); \n $filename = $elements[count($elements) - 1];\n\n return substr($filename, 0);\n }", "private function get_real_filename( $file_url )\n {\n $path = $this->getConfig( 'content_dir' ) . $file_url . $this->getConfig( 'content_ext' );\n return realpath( $path );\n }", "public function getFilenamePlain() : string\n {\n return $this->getFilename(true);\n }", "public function get_file_name(){\n return $this->file_name;\n }", "private function fileName()\n\t{\n\t\treturn $this->files[count($this->files) - 1];\n\t}", "public function getFilename()\n {\n $file = basename($this->srcPath);\n\n $ops = str_replace(array('&', ':', ';', '?', '.', ','), '-', $this->operations);\n return trim($ops . '-' . $file, './');\n }", "function _getFileName()\r\n\t{\r\n\t\t$f = $this->pathHomeDir . '/' . $this->pathLocale . '/' . $this->pathFile . \".\" . $this->pathEx;\r\n\t\treturn $f;\r\n\t}", "public function getFileName(){\n return $this->finalFileName;\n }", "public function getDownloadPath() {}", "public function filename() : string {\n return $this->name;\n }", "function getRealFilename($torrentLink)\n{\n\t$torrentFile = end(explode('/', $torrentLink));\n\tif ( preg_match('/\\.torrent$/i', $torrentFile) ) {\n\t\treturn $torrentFile;\n\t}\n\telse {\n\t\t$headers = get_headers3($torrentLink);\n\t\t// echo 'h: ';\n\t\t\n\t\tif($headers) {\n\t\t\tforeach($headers as $header)\n\t\t\t{\n\t\t\t\tif (strpos(strtolower($header),'content-disposition') !== false)\n\t\t\t\t{\n\t\t\t\t\t$tmp_name = explode('=', $header);\n\t\t\t\t\tif ($tmp_name[1]) return trim($tmp_name[1],'\";\\'');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\techo 'unable to get headers for ' . $torrentLink;\n\t\t}\n\n\t\t$stripped_url = preg_replace('/\\\\?.*/', '', $torrentLink);\n\t\treturn basename($stripped_url);\n\t}\n}", "function trpdownload_marker_csv_get_filename($vars) {\n $filename = $vars['download_args']['safe_site_name'] \n . '.sequence_features.' \n . date('YMj-his');\n\n return $filename;\n}", "public function getFilename()\n\t\t{\n\t\t\treturn $this->_fileName;\n\t\t}", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }", "public function filename() {\n\t\treturn $this->wire('hooks')->isHooked('Pagefile::filename()') ? $this->__call('filename', array()) : $this->___filename();\n\t}", "protected function _getFileName() {\n\n\t\t\treturn \t$this->_cacheFolder.$this->_getHash($this->_cacheFile).$this->_cacheExtension;\n\n\t\t}", "public function get_filename()\n {\n }", "public function getFileName()\n {\n return $this->language.'/'.strtolower($this->getName());\n }", "public function getFilename() {\n return $this->filename;\n }", "private function get_filename( $fileroute = '' )\n\t{\n\t\treturn substr( $filename, strrpos( $filename, '/' ) + 1);\t\n\t}", "public function fileName()\n {\n return $this->getCleanString(self::$_file_name_clean);\n }", "public function getFilename() {\n\t\treturn $this->filename;\n\t}", "public function getFilename() {\n\t\treturn $this->filename;\n\t}", "public function getFileUrl()\n {\n\n return get_bloginfo('url') . \"/\" . $this->getFileName();\n\n }", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "public function getFilename()\n {\n return $this->_filename;\n }", "public function getFilename()\n\t\t{\n\t\t\treturn $this->filename;\n\t\t}", "public function getFileName()\n {\n return $this->filename;\n }", "public function getFileName()\n {\n return $this->filename;\n }", "public function getFileName()\n {\n $fileName = $this->getInfo('fileName');\n if (!$fileName) {\n $fileName = $this->getInfo('title');\n }\n if (!$fileName) {\n $fileName = Zend_Controller_Front::getInstance()->getRequest()->getParam('controller') . '-' . date(\"Ymd\");\n }\n return $fileName . '.csv';\n }", "public function getFileName() {\n return $this->name;\n }", "public function get_full_file_name() {\r\n return (string) $this->full_file;\r\n }", "public function getFilename()\r\n {\r\n return pathinfo($this->filename, PATHINFO_BASENAME);\r\n }", "public function getFileName() {\n\t\treturn $this->filename;\n\t}", "public function getFileName(): string;", "function file_name ($url) {\n $filename = md5( $url );\n return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );\n }", "public function downloadFile();", "public function getFilename()\n {\n return 'test-file';\n }", "public function getFileName()\n {\n return basename($this->file, '.' . $this->getExtension());\n }", "public function getClientFilename()\n {\n return $this->fileInfo['name'];\n }", "private function pathFilename() {\n return $this->directory . \"/\" . $this->formatFilename();\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFilename()\n {\n if (!$this->fileName) {\n $matcher = $this->getFileMatcher();\n $this->fileName = $this->searchFile($matcher);\n }\n\n return $this->fileName;\n }", "public function filename(): string;", "public function getFilename()\n {\n return $this->filename . '.pdf';\n }", "function getFilename() {\n\t\treturn $this->_Filename;\n\t}", "public function getFileName() {\n\t \t return $this->fileName;\n\t }", "public function getFilename()\n {\n return null;\n }", "public function name() {\n\t\treturn basename($this->path);\n\t}", "public function getFileName() {\n\n return $this->_fileName;\n }", "public function getFile()\n {\n $file = Input::file('report');\n $filename = $this->doSomethingLikeUpload($file);\n\n // Return it's location\n return $filename;\n }", "public function getFull_Filename(){\n \t return $this->filename; \n\t}", "public function getFileName()\n {\n return $this->getParam('flowFilename');\n }", "public function fcpoGetMandateFilename() \n {\n $sOxid = $this->getId();\n $sQuery = \"SELECT fcpo_filename FROM fcpopdfmandates WHERE oxorderid = '{$sOxid}'\";\n $sFile = $this->_oFcpoDb->GetOne($sQuery);\n\n return $sFile;\n }", "function getFilename($url, $path)\n{\n # ex: response-content-disposition=attachment%3B%20filename%3D%22AdobeStock_112670342.jpeg%\n $query_re = '/filename.+?(AdobeStock_\\d+\\.\\w+)(?:%|\\'|\")/';\n if (preg_match($query_re, $url, $matches) && $matches[1] !== null) {\n $name = $matches[1];\n } else {\n # strip leading slash if exists\n if (strpos($path, '/') === 0) {\n $name = substr($path, 1);\n } else {\n $name = $path;\n }\n };\n return $name;\n}", "function getFilename()\n {\n return $this->filename;\n }", "public function name() : string {\n return $this->file->name;\n }", "public function getName()\n {\n return $this->_path['filename'];\n }", "public function getFilename(){\n \n return $this->filename;\n \n }" ]
[ "0.7409006", "0.7333371", "0.7333371", "0.7318911", "0.7271395", "0.7229691", "0.7217836", "0.7216582", "0.71897864", "0.7132924", "0.7082579", "0.7053854", "0.7049149", "0.7033133", "0.70321727", "0.70267975", "0.69946355", "0.69714326", "0.69714326", "0.69564563", "0.6949734", "0.6949734", "0.6949734", "0.69451874", "0.69223154", "0.69118905", "0.6907487", "0.6903343", "0.6867959", "0.6856787", "0.68541914", "0.6848728", "0.6847462", "0.6840744", "0.6823987", "0.68229324", "0.68141115", "0.6781561", "0.6771984", "0.6767449", "0.6763044", "0.67503303", "0.67233545", "0.67225677", "0.67189056", "0.67189056", "0.67189056", "0.67189056", "0.67189056", "0.67189056", "0.6713197", "0.6711932", "0.6706016", "0.66919893", "0.66823107", "0.6660326", "0.66593343", "0.66575676", "0.6652125", "0.6652125", "0.66503656", "0.6645625", "0.6645625", "0.664473", "0.66430676", "0.6641132", "0.6641132", "0.66390055", "0.66366565", "0.6629171", "0.66253555", "0.661583", "0.6601083", "0.6600119", "0.6595731", "0.6594411", "0.6592094", "0.65901804", "0.65848845", "0.6572934", "0.6572934", "0.6572934", "0.6572934", "0.6572934", "0.6572563", "0.6572089", "0.65591675", "0.6558634", "0.65569067", "0.6548049", "0.65471226", "0.65455085", "0.6542444", "0.65322906", "0.65241283", "0.650915", "0.6508475", "0.65055555", "0.6497158", "0.6479304", "0.64775544" ]
0.0
-1
Returns the download file type (based on the local file pointed to)
public function get_data_type() { if( is_null( $this->file_name ) ) return NULL; $pos = strrpos( $this->file_name, '.' ); return false === $pos ? '' : substr( $this->file_name, $pos + 1 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFileType()\n\t{\n\t\tif (is_dir($this->getFullPath()))\n\t\t{\n\t\t\treturn 'directory';\n\t\t}\n\t\tif (is_link($this->getFullPath()))\n\t\t{\n\t\t\treturn 'link';\n\t\t}\n\t\tif (is_file($this->getFullPath()))\n\t\t{\n\t\t\treturn 'file';\n\t\t}\n\t\treturn 'unknown';\n\n\t}", "function fn_get_file_type($filename, $not_available_result = 'application/octet-stream')\n{\n $file_type = $not_available_result;\n\n $types = fn_get_ext_mime_types('ext');\n\n $ext = fn_strtolower(fn_get_file_ext($filename));\n\n if (!empty($types[$ext])) {\n $file_type = $types[$ext];\n }\n\n return $file_type;\n}", "public static function getType() {\n\t\treturn \"File\";\n\t}", "public function getFileType() {\n return $this->type;\n }", "public function getFileType()\n {\n return $this->fileType;\n }", "function _getFileType( $filename )\n\t{\n\t\t//\tno filetype given, extract from filename\n\t\treturn\tsubstr( strrchr( $filename, '.' ), 1 );\n\t}", "function _file_get_type($file) {\n $ext = file_ext($file);\n if (preg_match(\"/$ext/i\", get_setting(\"image_ext\")))\n return IMAGE;\n if (preg_match(\"/$ext/i\", get_setting(\"audio_ext\")))\n return AUDIO;\n if (preg_match(\"/$ext/i\", get_setting(\"video_ext\")))\n return VIDEO;\n if (preg_match(\"/$ext/i\", get_setting(\"document_ext\")))\n return DOCUMENT;\n if (preg_match(\"/$ext/i\", get_setting(\"archive_ext\")))\n return ARCHIVE;\n }", "function getMimeType() ;", "public function type() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$type = null;\n\n\t\t\t// We can't use the file command on windows\n\t\t\tif (!defined('PHP_WINDOWS_VERSION_MAJOR')) {\n\t\t\t\t$type = shell_exec(sprintf(\"file -b --mime %s\", escapeshellarg($file->path())));\n\n\t\t\t\tif ($type && strpos($type, ';') !== false) {\n\t\t\t\t\t$type = strstr($type, ';', true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback because of fileinfo bug: https://bugs.php.net/bug.php?id=53035\n\t\t\tif (!$type) {\n\t\t\t\t$info = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t\t$type = finfo_file($info, $file->path());\n\t\t\t\tfinfo_close($info);\n\t\t\t}\n\n\t\t\t// Check the mimetype against the extension or $_FILES type\n\t\t\t// If they are different, use the upload type since fileinfo returns invalid mimetypes\n\t\t\t// This could be problematic in the future, but unknown better alternative\n\t\t\t$extType = $file->data('type') ?: MimeType::getTypeFromExt($file->ext());\n\n\t\t\tif ($type !== $extType) {\n\t\t\t\t$type = $extType;\n\t\t\t}\n\n\t\t\treturn $type;\n\t\t});\n\t}", "function get_file_type($file_mimetype)\n{\n // Get mimetype from file\n $mimetype = explode('/', $file_mimetype);\n\n switch ($mimetype[0]) {\n case 'image':\n return 'image';\n break;\n case 'video':\n return 'video';\n break;\n case 'audio':\n return 'audio';\n break;\n default:\n return 'file';\n }\n}", "public function getFsType() {}", "public function getFileType() {\n\n return $this->fileType;\n }", "function get_file_type($file)\n {\n global $image_types, $movie_types;\n \n $pos = strrpos($file, \".\");\n if ($pos === false) {\n return \"Unknown File\";\n }\n \n $ext = rtrim(substr($file, $pos + 1), \"~\");\n if (in_array($ext, $image_types)) {\n $type = \"Image File\";\n \n } elseif (in_array($ext, $movie_types)) {\n $type = \"Video File\";\n \n } elseif (in_array($ext, $archive_types)) {\n $type = \"Compressed Archive\";\n \n } elseif (in_array($ext, $document_types)) {\n $type = \"Type Document\";\n \n } elseif (in_array($ext, $font_types)) {\n $type = \"Type Font\";\n \n } else {\n $type = \"File\";\n }\n \n return (strtoupper($ext) . \" \" . $type);\n }", "Function getFileType(){\n\t\t$it = $this->info['origSize'][2];\n\t\tswitch($it){\n\t\t\tcase IMAGETYPE_GIF: $r = \"gif\"; break;\n\t\t\tcase IMAGETYPE_JPEG: $r = \"jpg\"; break;\n\t\t\tcase IMAGETYPE_PNG: $r = \"png\"; break;\n\t\t\tcase IMAGETYPE_BMP: $r = \"bmp\"; break;\n\t\t\tcase IMAGETYPE_WBMP: $r = \"wbmp\"; break;\n\t\t\tcase IMAGETYPE_WEBP: $r = \"webp\"; break;\n\t\t\tdefault:\n\t\t\t\t$r = false;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $r;\n\t}", "private function getFileType()\n {\n $uriString = $this->uri->getPath();\n\n if (substr($uriString, strlen($uriString) - 1) == \"/\") {\n return 'html';\n }\n\n $pathParts = pathinfo($uriString);\n\n if (!array_key_exists('extension', $pathParts)) {\n return 'html';\n } else {\n $extension = $pathParts['extension'];\n if ($extension === \"\") {\n return 'html';\n } else {\n // @todo if ? and # are set this function will not work correct\n $pos = max((int)strpos($extension, \"?\"), (int)strpos($extension, \"#\"));\n if ($pos === 0) {\n $pos = strlen($extension);\n }\n return substr($extension, 0, $pos);\n }\n }\n }", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType()\n {\n return $this->file['type'];\n }", "public function getType()\n {\n return MimeType::detectByFilename($this->fullPath);\n }", "function get_mime($file) {\n\t// Since in php 5.3 this is a mess...\n\t/*if(function_exists('finfo_open')) {\n\t\treturn finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file); \n\t} else {\n\t\tif(function_exists('mime_content_type')) {\n\t\t\treturn mime_content_type($file);\n\t\t} else {\n\t\t\treturn \"application/force-download\";\n\t\t}\n\t}*/\n\t$mimetypes = array(\n\t\t\"php\"\t=> \"application/x-php\",\n\t\t\"js\"\t=> \"application/x-javascript\",\n\t\t\n\t\t\"css\"\t=> \"text/css\",\n\t\t\"html\"\t=> \"text/html\",\n\t\t\"htm\"\t=> \"text/html\",\n\t\t\"txt\"\t=> \"text/plain\",\n\t\t\"xml\"\t=> \"text/xml\",\n\t\t\n\t\t\"bmp\"\t=> \"image/bmp\",\n\t\t\"gif\"\t=> \"image/gif\",\n\t\t\"jpg\"\t=> \"image/jpeg\",\n\t\t\"png\"\t=> \"image/png\",\n\t\t\"tiff\"\t=> \"image/tiff\",\n\t\t\"tif\"\t=> \"image/tif\",\n\t);\n\t$file_mime = $mimetypes[pathinfo($file, PATHINFO_EXTENSION)];\n\tif(check_value($file_mime)) {\n\t\treturn $file_mime;\n\t} else {\n\t\treturn \"application/force-download\";\n\t}\n}", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function type()\n\t{\n\t\treturn self::lookup($this->file);\n\t}", "public function getXsiTypeName() {\n return \"DownloadFormat\";\n }", "abstract public function getMimeType();", "public function getExtendedType()\n {\n return 'file';\n }", "public function getMimeType(): string;", "function getMIMEType( $sFileName = \"\" ) { \r\n $sFileName = strtolower( trim( $sFileName ) ); \r\n if( ! strlen( $sFileName ) ) return \"\"; \r\n \r\n $aMimeType = array( \r\n \"txt\" => \"text/plain\" , \r\n \"pdf\" => \"application/pdf\" , \r\n \"zip\" => \"application/x-compressed\" , \r\n \r\n \"html\" => \"text/html\" , \r\n \"htm\" => \"text/html\" , \r\n \r\n \"avi\" => \"video/avi\" , \r\n \"mpg\" => \"video/mpeg \" , \r\n \"wav\" => \"audio/wav\" , \r\n \r\n \"jpg\" => \"image/jpeg \" , \r\n \"gif\" => \"image/gif\" , \r\n \"tif\" => \"image/tiff \" , \r\n \"png\" => \"image/x-png\" , \r\n \"bmp\" => \"image/bmp\" \r\n ); \r\n $aFile = split( \"\\.\", basename( $sFileName ) ) ; \r\n $nDiminson = count( $aFile ) ; \r\n $sExt = $aFile[ $nDiminson - 1 ] ; // get last part: like \".tar.zip\", return \"zip\" \r\n \r\n return ( $nDiminson > 1 ) ? $aMimeType[ $sExt ] : \"\"; \r\n}", "function fn_get_mime_content_type($filename, $check_by_extension = true, $not_available_result = 'application/octet-stream')\n{\n $type = '';\n\n if (class_exists('finfo')) {\n $finfo_handler = @finfo_open(FILEINFO_MIME);\n if ($finfo_handler !== false) {\n $type = @finfo_file($finfo_handler, $filename);\n list($type) = explode(';', $type);\n @finfo_close($finfo_handler);\n }\n }\n\n if (empty($type) && function_exists('mime_content_type')) {\n $type = @mime_content_type($filename);\n }\n\n if (empty($type) && $check_by_extension && strpos(fn_basename($filename), '.') !== false) {\n $type = fn_get_file_type(fn_basename($filename), $not_available_result);\n }\n\n return !empty($type) ? $type : $not_available_result;\n}", "function get_download_type($user_type = NULL) {\n\n if ($user_type == 'download') {\n return 'Download';\n } else if ($user_type == 'download_evt_map') {\n return 'Event Map';\n } else if ($user_type == 'download_ses_map') {\n return 'Session Profile';\n } else if ($user_type == 'download_exe_pro') {\n return 'Speaker Profile';\n } else if ($user_type == 'download_exh_pro') {\n return 'Exhibitor Profile';\n } else {\n return $user_type;\n }\n }", "public function typeOfFile($path);", "function getfiletype($path){\n\t$extension = getextension($path);\n\tif($extension!=null)\n\t{\n if (isset($_ENV['MIME_TYPES']['binary'][$extension])){\n return 'binary';\n } else if (isset($_ENV['MIME_TYPES']['ascii'][$extension])){\n return 'ascii';\n }\n }\n return null;\n}", "final public function getFile()\n {\n return 'file';\n }", "function getMimeType ()\n\t{\n\t\treturn $this->mainType.'/'.$this->subType;\n\t}", "function getFileMimetype($file_path)\n {\n if (function_exists('finfo_open'))\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $file_path);\n finfo_close($finfo);\n }\n elseif (function_exists('mime_content_type'))\n {\n $type = mime_content_type($file);\n }\n else\n {\n // Unable to get the file mimetype!\n $type = '';\n }\n return $type;\n }", "public function getMimeType()\n\t{\n\t\treturn mime_content_type($this->tmp_name);\n\t}", "public function getMimeType(): string\n {\n return $this->filesystem->mimeType(\n $this->resource->getPath()\n ) ?: 'application/octet-stream';\n }", "function getMimeType() {\n\t\treturn $this->getParam(self::PARAM_DISTRIBUTOR_MIMETYPE);\n\t}", "function getType() {\n\t\treturn $this->data_array['filetype'];\n\t}", "public function getMimeType()\r\n {\r\n if (array_key_exists($this->getExtension(), $this->fileTypes)) {\r\n return $this->fileTypes[$this->getExtension()]['type'];\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "public static function fileMimeType($filename)\r\n {\r\n $extension = FileUtility::getFileExtension($filename);\r\n\r\n foreach (file('lib/mime.types') as $line)\r\n {\r\n $line = str_replace(' ', \"\\t\", $line);\r\n if (strpos($line, \"\\t\" . $extension) !== false)\r\n {\r\n $array = explode(\"\\t\", $line);\r\n return $array[0];\r\n }\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "function typeoffile($file){ //list( $mutes, $date, $type, $ext) = explode( '.', $file );\n $type= explode( '.', $file )[2];\n return $type;\n}", "function get_content_type($url){\n\t\t\t\t\t\t$mime_types = array(\n\t\t\t\t\t\t\t\"pdf\"=>\"application/pdf\"\n\t\t\t\t\t\t\t,\"exe\"=>\"application/octet-stream\"\n\t\t\t\t\t\t\t,\"zip\"=>\"application/zip\"\n\t\t\t\t\t\t\t,\"docx\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"doc\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"xls\"=>\"application/vnd.ms-excel\"\n\t\t\t\t\t\t\t,\"ppt\"=>\"application/vnd.ms-powerpoint\"\n\t\t\t\t\t\t\t,\"gif\"=>\"image/gif\"\n\t\t\t\t\t\t\t,\"png\"=>\"image/png\"\n\t\t\t\t\t\t ,\"ico\"=>\"image/ico\"\n\t\t\t\t\t\t ,\"jpeg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"jpg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"mp3\"=>\"audio/mpeg\"\n\t\t\t\t\t\t ,\"wav\"=>\"audio/x-wav\"\n\t\t\t\t\t\t ,\"mpeg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpe\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mov\"=>\"video/quicktime\"\n\t\t\t\t\t\t ,\"avi\"=>\"video/x-msvideo\"\n\t\t\t\t\t\t ,\"3gp\"=>\"video/3gpp\"\n\t\t\t\t\t\t ,\"css\"=>\"text/css\"\n\t\t\t\t\t\t ,\"jsc\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"js\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"php\"=>\"text/html\"\n\t\t\t\t\t\t ,\"htm\"=>\"text/html\"\n\t\t\t\t\t\t ,\"html\"=>\"text/html\"\n\t\t\t\t\t\t ,\"xml\"=>\"application/xml\"\n\t\t\t\t\t\t \n\t\t\t\t\t\t);\n\t\t\t\t\t\t$var = explode('.', $url);\n\t\t\t\t\t\t$extension = strtolower(end($var));\n\t\t\t\t\t\tif(isset($mime_types[$extension])){\n\t\t\t\t\t\t return $mime_types[$extension];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 'other';\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "private function _getFileType($fileName)\n {\n $safeFileName = escapeshellarg($fileName);\n return trim(exec(\"file -b $safeFileName\"));\n\n//return $this->getFileType2($fileName);\n }", "public static function getMimeTypeForFile(string $filename): string\n\t{\n\t\t// In case the path is a Bitly, strip any query string before getting extension\n\t\t$qpos = strpos($filename, '?');\n\t\tif (false !== $qpos) {\n\t\t\t$filename = substr($filename, 0, $qpos);\n\t\t}\n\n\t\treturn self::getMimeTypeFromExtension(self::mb_pathinfo($filename, PATHINFO_EXTENSION)) ?? 'application/octet-stream';\n\t}", "public function getMimeType()\n {\n return CFileHelper::getMimeType($this->file->getTempName());\n }", "public function getFileExtension(){\n\n if($this->isPhoto()){\n return \"jpg\";\n }\n\n if($this->isVideo()){\n return \"mp4\";\n }\n\n return \"bin\";\n\n }", "function _mimetype($virtualpath) \r\n {\r\n\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype: $virtualpath \",\"cby_webdav\",\"_mimetype\");\r\n\t\t\t$t3io=$this->CFG->t3io;\r\n\r\n if (@$t3io->T3IsDir($virtualpath)) {\r\n // directories are easy\r\n return \"httpd/unix-directory\"; \r\n } else if (function_exists(\"mime_content_type\")) {\r\n // use mime magic extension if available\r\n $mime_type = mime_content_type($virtualpath);\r\n } else if ($this->_can_execute(\"file\")) {\r\n // it looks like we have a 'file' command, \r\n // lets see it it does have mime support\r\n $fp = popen(\"file -i '$virtualpath' 2>/dev/null\", \"r\");\r\n $reply = fgets($fp);\r\n pclose($fp);\r\n \r\n // popen will not return an error if the binary was not found\r\n // and find may not have mime support using \"-i\"\r\n // so we test the format of the returned string \r\n \r\n // the reply begins with the requested filename\r\n if (!strncmp($reply, \"$virtualpath: \", strlen($virtualpath)+2)) { \r\n $reply = substr($reply, strlen($virtualpath)+2);\r\n // followed by the mime type (maybe including options)\r\n if (preg_match('|^[[:alnum:]_-]+/[[:alnum:]_-]+;?.*|', $reply, $matches)) {\r\n $mime_type = $matches[0];\r\n }\r\n }\r\n } \r\n \r\n if (empty($mime_type)) {\r\n // Fallback solution: try to guess the type by the file extension\r\n // TODO: add more ...\r\n // TODO: it has been suggested to delegate mimetype detection \r\n // to apache but this has at least three issues:\r\n // - works only with apache\r\n // - needs file to be within the document tree\r\n // - requires apache mod_magic \r\n // TODO: can we use the registry for this on Windows?\r\n // OTOH if the server is Windos the clients are likely to \r\n // be Windows, too, and tend do ignore the Content-Type\r\n // anyway (overriding it with information taken from\r\n // the registry)\r\n // TODO: have a seperate PEAR class for mimetype detection?\r\n switch (strtolower(strrchr(basename($virtualpath), \".\"))) {\r\n case \".html\":\r\n case \".textpic\":\r\n case \".txt\":\r\n case \".[unknown]\":\r\n $mime_type = \"text/html\";\r\n break;\r\n case \".gif\":\r\n $mime_type = \"image/gif\";\r\n break;\r\n case \".jpg\":\r\n $mime_type = \"image/jpeg\";\r\n break;\r\n default: \r\n $mime_type = \"application/octet-stream\";\r\n break;\r\n }\r\n }\r\n\t\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype>: $mime_type \",\"cby_webdav\",\"_mimetype\");\r\n \r\n return $mime_type;\r\n }", "function getFileType()\n {\n try\n {\n list($this->m_Width, $this->m_height, $this->m_type, $this->m_attr) = getimagesize($this->m_ImagePath);\n return $this->m_type;\n }\n catch (Exception $ex)\n {\n return 0;\n }\n }", "public function getMimeType()\n {\n if (!class_exists('finfo', false)) return $this->type;\n $info = new \\finfo(FILEINFO_MIME);\n return $info->file($this->tmp);\n }", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "public function getMimeType(){\n return (new \\finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);\n }", "function _mime_content_type($filename) {\n $finfo = finfo_open();\n $fileinfo = finfo_file($finfo, $filename, FILEINFO_MIME);\n finfo_close($finfo);\n return reset(explode(\";\",$fileinfo));\n \n \n //hiphop workaround hiphop does not work with inotify\n //exec(\"file \".str_replace(\" \",\"\\ \",$filename).\" --mime\",$output);\n \n $half = explode(\": \",$output[0]);\n $done = explode(\"; \",$half[1]);\n return $done[0];\n }", "public function mime() : string {\n return $this->file->type;\n }", "public function get_content_type( $type ) {\n $content_type = \"text/plain\";\n switch($type){\n case 'csv':\n $content_type = \"text/csv\";\n break;\n case 'txt':\n default:\n $break;\n }\n return $content_type;\n }", "public function getMimeType()\n {\n $this->mime_type = null;\n\n if ($this->exists === false) {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n if (function_exists('finfo_open')) {\n $php_mime = finfo_open(FILEINFO_MIME);\n $this->mime_type = strtolower(finfo_file($php_mime, $this->temp));\n finfo_close($php_mime);\n\n } elseif (function_exists('mime_content_type')) {\n $this->mime_type = mime_content_type($this->temp);\n\n } else {\n throw new \\RuntimeException\n ('Ftp Filesystem: getMimeType either finfo_open or mime_content_type are required in PHP');\n }\n\n return;\n }", "public function GetMimeType() {\n\n if ($this->IsValid() && $this->MimeType === null) {\n if (function_exists('mime_content_type')) {\n $this->MimeType= mime_content_type($this->TmpName);\n } elseif (function_exists('finfo_open')) {\n $fInfo= finfo_open(FILEINFO_MIME);\n $this->MimeType= finfo_file($fInfo, $this->TmpName);\n finfo_close($fInfo);\n }\n }\n return $this->MimeType;\n }", "private static function guessFileType($filename) {\n\t\tif (substr_compare($filename, '.zip', -4) === 0) {\n\t\t\treturn 'zip';\n\t\t} elseif (substr_compare($filename, '.opml', -5) === 0 ||\n\t\t substr_compare($filename, '.xml', -4) === 0) {\n\t\t\treturn 'opml';\n\t\t} elseif (substr_compare($filename, '.json', -5) === 0 &&\n\t\t strpos($filename, 'starred') !== false) {\n\t\t\treturn 'json_starred';\n\t\t} elseif (substr_compare($filename, '.json', -5) === 0) {\n\t\t\treturn 'json_feed';\n\t\t} else {\n\t\t\treturn 'unknown';\n\t\t}\n\t}", "public function getMimeType()\n {\n return Formats::getFormatMimeType($this->format);\n }", "public function detectMimeType()\n {\n static::checkFileinfoExtension();\n\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n\n return (($this->isWrapped() || $this->isTemp()) ?\n $finfo->buffer($this->getRaw())\n : $finfo->file($this->getPathname())\n );\n }", "public function get_file_type_id() {\n return 'sql';\n }", "public function getLatestFile($type){\r\n if(IpxCache::get(self::$latest_file_tag)){\r\n return IpxCache::get(self::$latest_file_tag);\r\n }\r\n\r\n $files_list = $this->getDataFilesList();\r\n $latest_file = '';\r\n foreach($files_list as $file){\r\n if($file['type'] == $type){\r\n $latest_file = $file['name'];\r\n break;\r\n }\r\n }\r\n IpxCache::put(self::$latest_file_tag, $latest_file, 1440);\r\n return $latest_file;\r\n }", "public function getMimeType() {\n return explode('/', $this->contentType)[0];\n }", "protected function _getFile($type, $file)\n {\n if ($type == 'class') {\n $file = $this->_class_dir . \"$file\";\n }\n \n if ($type == 'package') {\n $file = $this->_package_dir . \"$file\";\n }\n \n return $file;\n }", "function get_mimetype($name) {\n\t// We're only allowing archives.\n\tif (!substr_count($_FILES[$name]['name'],'.tar.gz') &&\n\t\t!substr_count($_FILES[$name]['name'],'.tgz') &&\n\t\t!substr_count($_FILES[$name]['name'],'.zip')) {\n\n\t\treturn FALSE;\n\t}\n\n\tif (substr_count($_FILES[$name]['name'],'.tar.gz') ||\n\t\tsubstr_count($_FILES[$name]['name'],'.tgz')) {\n\n\t\treturn 'application/x-gzip';\n\t} else {\n\t\treturn 'application/zip';\n\t}\n}", "public function getFileType()\n {\n return '.md';\n }", "private function _getFileMimeType($file)\n {\n return mime_content_type($file);\n }", "public function getMimeType()\n {\n return $this->getGuessedInternetMediaType();\n }", "function get_file_type_from_mimetype($mimetype)\n{\n return explode('/', $mimetype)[1];\n}", "protected function readMimeType()\n {\n $ext = pathinfo($this->filename, PATHINFO_EXTENSION);\n $this->mimeType = PMF_Attachment_MimeType::guessByExt($ext);\n\n return $this->mimeType;\n }", "function getmimetype($path){\n\t$extension = getextension($path);\n $filetype = getfiletype($path);\n if ($filetype != null){\n return $_ENV['MIME_TYPES'][$filetype][$extension];\n } else {\n return 'text/plain';\n }\n}", "function getTargetFileExtension() ;", "private function getNewResourceMimeType(\r\n\t\t\t$wp) {\r\n\t\t// $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension\r\n\t\t// $fileMimeType finfo_file($finfo, $_FILES[\"file1\"][\"name\"]);\r\n\t\t// finfo_close($finfo);\r\n\t\t$filetype = wp_check_filetype ( $_FILES [\"file1\"] [\"name\"] );\r\n\t\treturn $filetype ['type'];\r\n\t}", "function _mime_content_type($filename) {\n if (!file_exists($filename) || !is_readable($filename)) return false;\n if(class_exists('finfo')){\n $result = new finfo();\n if (is_resource($result) === true) {\n return $result->file($filename, FILEINFO_MIME_TYPE);\n }\n }\n \n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filename);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';')) list($mimeType,) = explode(';', $mimeType);\n return $mimeType;\n }\n \n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filename);\n }\n \n\n // Trying to get mimetype from images\n $imageData = getimagesize($filename);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n // Trying exec\n if (function_exists('exec')) {\n $mimeType = exec(\"/usr/bin/file -i -b $filename\");\n if(strpos($mimeType,';')){\n $mimeTypes = explode(';',$mimeType);\n return $mimeTypes[0];\n }\n if (!empty($mimeType)) return $mimeType;\n }\n return false;\n }", "public function getType() {\n\t\tif ($this->getIsDir()) {\n\t\t\treturn '<DIR>';\n\t\t} else {\n\t\t\treturn $this->getExtension().' file';\n\t\t}\n\t}", "protected function _getMimeType()\n\t{\n\t\treturn 'text/text';\n\t}", "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public static function get_mime_type($filename)\n {\n // If the finfo module is compiled into PHP, use it.\n $path = BASE_PATH . DIRECTORY_SEPARATOR . $filename;\n if (class_exists('finfo') && file_exists($path)) {\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n return $finfo->file($path);\n }\n\n // Fallback to use the list from the HTTP.yml configuration and rely on the file extension\n // to get the file mime-type\n $ext = strtolower(File::get_file_extension($filename));\n // Get the mime-types\n $mimeTypes = HTTP::config()->uninherited('MimeTypes');\n\n // The mime type doesn't exist\n if (!isset($mimeTypes[$ext])) {\n return 'application/unknown';\n }\n\n return $mimeTypes[$ext];\n }", "public function getMimetype();", "function get_mime_type($file, $real_filename = null, $use_native_functions = true) {\n if (function_exists('mime_content_type') && $use_native_functions) {\n $mime_type = trim(mime_content_type($file));\n if (!$mime_type) {\n return 'application/octet-stream';\n } // if\n $mime_type = explode(';', $mime_type);\n return $mime_type[0];\n } else if (function_exists('finfo_open') && function_exists('finfo_file') && $use_native_functions) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mime_type;\n } else {\n if ($real_filename) {\n $file = $real_filename;\n } // if\n \n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-flash',\n 'flv' => 'video/x-flv',\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n \n $extension = strtolower(get_file_extension($file));\n if (array_key_exists($extension, $mime_types)) {\n return $mime_types[$extension];\n } else {\n return 'application/octet-stream';\n } // if\n } // if\n }", "public function mimeType(): string\n {\n return $this->mimeType ??= FileSystem::mimeType($this->path);\n }", "function get_file($local_file, $server_file, $format = null)\n {\n\n $only = null;\n if ($format != '') {\n $only = $this->only_format($server_file, $format);\n if ($only == false) {\n echo \"Толькo формати jpg, png, gif\\n\";\n\n return false;\n }\n }\n\n if (ftp_get($this->connect, $local_file, $server_file, FTP_BINARY)) {\n echo \"Произведена запись в $local_file\\n\";\n } else {\n echo \"Не удалось завершить операцию\\n\";\n }\n }", "public function getMimeType() {\n\t\treturn parent::getMimeType();\n\t}", "public function getExtendedType()\n {\n return FileType::class;\n }", "function getMimeType($filename)\n{\n\t$mimeType = '';\n\n\t// Check only existing readable files\n\tif (!file_exists($filename) || !is_readable($filename))\n\t{\n\t\treturn '';\n\t}\n\n\t// Try finfo, this is the preferred way\n\tif (function_exists('finfo_open'))\n\t{\n\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t$mimeType = finfo_file($finfo, $filename);\n\t\tfinfo_close($finfo);\n\t}\n\t// No finfo? What? lets try the old mime_content_type\n\telseif (function_exists('mime_content_type'))\n\t{\n\t\t$mimeType = mime_content_type($filename);\n\t}\n\t// Try using an exec call\n\telseif (function_exists('exec'))\n\t{\n\t\t$mimeType = @exec(\"/usr/bin/file -i -b $filename\");\n\t}\n\n\t// Still nothing? We should at least be able to get images correct\n\tif (empty($mimeType))\n\t{\n\t\t$imageData = elk_getimagesize($filename, 'none');\n\t\tif (!empty($imageData['mime']))\n\t\t{\n\t\t\t$mimeType = $imageData['mime'];\n\t\t}\n\t}\n\n\t// Account for long responses like text/plain; charset=us-ascii\n\tif (!empty($mimeType) && strpos($mimeType, ';'))\n\t{\n\t\tlist($mimeType,) = explode(';', $mimeType);\n\t}\n\n\treturn $mimeType;\n}", "public function getFile($type = 'document')\n {\n return $this->files()->where('type' , '=', $type)->get()->first();\n }", "public function getFileExtension();", "public function getType() {\n if (!isset($_FILES[$this->_file])) {\n return false;\n }\n \n return $_FILES[$this->_file]['type'];\n }", "public function getFileType($attribute)\n {\n if (empty($attribute) || !$this->hasAttribute($attribute)) {\n throw new Exception(\"getFileUrl: Unknown attribute \" . $attribute . \" on model \" . get_class($this));\n }\n $path = $this->getUploadPath() . $this->$attribute;\n\n // Check cache\n $cacheKey = md5($path . '_mime');\n $mimeType = Yii::$app->fs_cache->get($cacheKey);\n\n if ($mimeType === false) {\n $mimeType = '';\n if (Yii::$app->get('fs')->has($path)) {\n switch (Yii::$app->get('fs')->getMimetype($path)) {\n case 'application/pdf':\n $mimeType = 'pdf';\n break;\n case 'image/png':\n case 'image/jpg':\n case 'image/jpeg':\n $mimeType = 'image';\n break;\n default:\n $mimeType = 'other';\n }\n }\n\n if ($mimeType != '') {\n // Build dependency key (changed on upload of new file)\n $this->setFileTypeCache($cacheKey, $mimeType, $attribute);\n }\n }\n return $mimeType;\n }", "public function getTypeString()\n {\n switch ( $this->fileStructure->type )\n {\n case self::IS_DIRECTORY:\n return \"d\";\n\n case self::IS_FILE:\n return \"-\";\n\n case self::IS_SYMBOLIC_LINK:\n return \"l\";\n\n case self::IS_LINK:\n return \"h\";\n\n default:\n return \"Z\";\n }\n }", "public function getContentType()\n {\n return $this->mediaFile->getContentType();\n }", "public function getTemplateType() : string\r\n {\r\n // After adding HEIC files, we also need to exclude them \r\n // from being displayed like regular images. \r\n $validImgMime = array(\r\n 'image/bmp',\r\n 'image/gif',\r\n 'image/jpg',\r\n 'image/jpeg',\r\n 'image/png',\r\n 'image/tiff'\r\n );\r\n\r\n $fileType = explode('/', $this->mime_type, 2)[0];\r\n if($fileType == 'image' && !in_array($this->mime_type, $validImgMime))\r\n {\r\n $fileType = 'file';\r\n }\r\n else if(!in_array($fileType, array('image', 'audio', 'video')))\r\n {\r\n $fileType = 'file';\r\n }\r\n return $fileType;\r\n }", "public function getMimeType() : string\n {\n $mimeType = $this->mimeType;\n if ($this->shouldBeCompressed()) {\n $mimeType = $this->compression->getMimeType();\n }\n return $mimeType;\n }", "private function getType(UploadedFile $file)\n {\n $mime = $file->getMimeType();\n\n return $mime ? explode('/', $mime)[0] : 'n/a';\n }", "public function type($path)\n {\n return $this->asyncFs->file($path)->type();\n }" ]
[ "0.73739064", "0.7001428", "0.69537437", "0.69223684", "0.6913249", "0.6859061", "0.6851662", "0.68191105", "0.6817714", "0.67854935", "0.6780049", "0.67727184", "0.6626763", "0.66175765", "0.6614213", "0.6608274", "0.6608274", "0.6608274", "0.6608274", "0.65973896", "0.6594193", "0.6581882", "0.6538045", "0.6538045", "0.6538045", "0.6538045", "0.6538045", "0.65049845", "0.6500014", "0.6498067", "0.64931136", "0.6489995", "0.6486856", "0.6465502", "0.6460674", "0.64471614", "0.6442098", "0.6409988", "0.64067805", "0.6395421", "0.63939166", "0.6360305", "0.63581246", "0.63567173", "0.633944", "0.6334447", "0.6332223", "0.63089335", "0.63017124", "0.6263752", "0.6252663", "0.6227435", "0.6186142", "0.6180127", "0.6158364", "0.61366427", "0.61262995", "0.61251754", "0.6124906", "0.61068916", "0.61001664", "0.6093871", "0.609323", "0.60931593", "0.6083934", "0.6069803", "0.6066558", "0.6066117", "0.6049235", "0.60396636", "0.60394025", "0.6024804", "0.60186577", "0.6018068", "0.60177857", "0.60045725", "0.60044426", "0.6004183", "0.60032463", "0.59985006", "0.59854275", "0.5981956", "0.59797883", "0.5976624", "0.5959813", "0.595876", "0.59531057", "0.59496826", "0.59272134", "0.5925169", "0.59224665", "0.5922359", "0.59222794", "0.59204674", "0.5911421", "0.5900209", "0.58997685", "0.5899675", "0.58966553", "0.58706385" ]
0.5969543
84
Returns the download file type (based on the local file pointed to)
public function set_file_name( $file_name ) { // check to make sure the file exists if( !is_file( $file_name ) ) throw lib::create( 'exception\runtime', sprintf( 'Filename %s doesn\'t exist.', $file_name ), __METHOD__ ); $this->file_name = $file_name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFileType()\n\t{\n\t\tif (is_dir($this->getFullPath()))\n\t\t{\n\t\t\treturn 'directory';\n\t\t}\n\t\tif (is_link($this->getFullPath()))\n\t\t{\n\t\t\treturn 'link';\n\t\t}\n\t\tif (is_file($this->getFullPath()))\n\t\t{\n\t\t\treturn 'file';\n\t\t}\n\t\treturn 'unknown';\n\n\t}", "function fn_get_file_type($filename, $not_available_result = 'application/octet-stream')\n{\n $file_type = $not_available_result;\n\n $types = fn_get_ext_mime_types('ext');\n\n $ext = fn_strtolower(fn_get_file_ext($filename));\n\n if (!empty($types[$ext])) {\n $file_type = $types[$ext];\n }\n\n return $file_type;\n}", "public static function getType() {\n\t\treturn \"File\";\n\t}", "public function getFileType() {\n return $this->type;\n }", "public function getFileType()\n {\n return $this->fileType;\n }", "function _getFileType( $filename )\n\t{\n\t\t//\tno filetype given, extract from filename\n\t\treturn\tsubstr( strrchr( $filename, '.' ), 1 );\n\t}", "function _file_get_type($file) {\n $ext = file_ext($file);\n if (preg_match(\"/$ext/i\", get_setting(\"image_ext\")))\n return IMAGE;\n if (preg_match(\"/$ext/i\", get_setting(\"audio_ext\")))\n return AUDIO;\n if (preg_match(\"/$ext/i\", get_setting(\"video_ext\")))\n return VIDEO;\n if (preg_match(\"/$ext/i\", get_setting(\"document_ext\")))\n return DOCUMENT;\n if (preg_match(\"/$ext/i\", get_setting(\"archive_ext\")))\n return ARCHIVE;\n }", "function getMimeType() ;", "public function type() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$type = null;\n\n\t\t\t// We can't use the file command on windows\n\t\t\tif (!defined('PHP_WINDOWS_VERSION_MAJOR')) {\n\t\t\t\t$type = shell_exec(sprintf(\"file -b --mime %s\", escapeshellarg($file->path())));\n\n\t\t\t\tif ($type && strpos($type, ';') !== false) {\n\t\t\t\t\t$type = strstr($type, ';', true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback because of fileinfo bug: https://bugs.php.net/bug.php?id=53035\n\t\t\tif (!$type) {\n\t\t\t\t$info = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t\t$type = finfo_file($info, $file->path());\n\t\t\t\tfinfo_close($info);\n\t\t\t}\n\n\t\t\t// Check the mimetype against the extension or $_FILES type\n\t\t\t// If they are different, use the upload type since fileinfo returns invalid mimetypes\n\t\t\t// This could be problematic in the future, but unknown better alternative\n\t\t\t$extType = $file->data('type') ?: MimeType::getTypeFromExt($file->ext());\n\n\t\t\tif ($type !== $extType) {\n\t\t\t\t$type = $extType;\n\t\t\t}\n\n\t\t\treturn $type;\n\t\t});\n\t}", "function get_file_type($file_mimetype)\n{\n // Get mimetype from file\n $mimetype = explode('/', $file_mimetype);\n\n switch ($mimetype[0]) {\n case 'image':\n return 'image';\n break;\n case 'video':\n return 'video';\n break;\n case 'audio':\n return 'audio';\n break;\n default:\n return 'file';\n }\n}", "public function getFsType() {}", "public function getFileType() {\n\n return $this->fileType;\n }", "function get_file_type($file)\n {\n global $image_types, $movie_types;\n \n $pos = strrpos($file, \".\");\n if ($pos === false) {\n return \"Unknown File\";\n }\n \n $ext = rtrim(substr($file, $pos + 1), \"~\");\n if (in_array($ext, $image_types)) {\n $type = \"Image File\";\n \n } elseif (in_array($ext, $movie_types)) {\n $type = \"Video File\";\n \n } elseif (in_array($ext, $archive_types)) {\n $type = \"Compressed Archive\";\n \n } elseif (in_array($ext, $document_types)) {\n $type = \"Type Document\";\n \n } elseif (in_array($ext, $font_types)) {\n $type = \"Type Font\";\n \n } else {\n $type = \"File\";\n }\n \n return (strtoupper($ext) . \" \" . $type);\n }", "Function getFileType(){\n\t\t$it = $this->info['origSize'][2];\n\t\tswitch($it){\n\t\t\tcase IMAGETYPE_GIF: $r = \"gif\"; break;\n\t\t\tcase IMAGETYPE_JPEG: $r = \"jpg\"; break;\n\t\t\tcase IMAGETYPE_PNG: $r = \"png\"; break;\n\t\t\tcase IMAGETYPE_BMP: $r = \"bmp\"; break;\n\t\t\tcase IMAGETYPE_WBMP: $r = \"wbmp\"; break;\n\t\t\tcase IMAGETYPE_WEBP: $r = \"webp\"; break;\n\t\t\tdefault:\n\t\t\t\t$r = false;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $r;\n\t}", "private function getFileType()\n {\n $uriString = $this->uri->getPath();\n\n if (substr($uriString, strlen($uriString) - 1) == \"/\") {\n return 'html';\n }\n\n $pathParts = pathinfo($uriString);\n\n if (!array_key_exists('extension', $pathParts)) {\n return 'html';\n } else {\n $extension = $pathParts['extension'];\n if ($extension === \"\") {\n return 'html';\n } else {\n // @todo if ? and # are set this function will not work correct\n $pos = max((int)strpos($extension, \"?\"), (int)strpos($extension, \"#\"));\n if ($pos === 0) {\n $pos = strlen($extension);\n }\n return substr($extension, 0, $pos);\n }\n }\n }", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType()\n {\n return $this->file['type'];\n }", "public function getType()\n {\n return MimeType::detectByFilename($this->fullPath);\n }", "function get_mime($file) {\n\t// Since in php 5.3 this is a mess...\n\t/*if(function_exists('finfo_open')) {\n\t\treturn finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file); \n\t} else {\n\t\tif(function_exists('mime_content_type')) {\n\t\t\treturn mime_content_type($file);\n\t\t} else {\n\t\t\treturn \"application/force-download\";\n\t\t}\n\t}*/\n\t$mimetypes = array(\n\t\t\"php\"\t=> \"application/x-php\",\n\t\t\"js\"\t=> \"application/x-javascript\",\n\t\t\n\t\t\"css\"\t=> \"text/css\",\n\t\t\"html\"\t=> \"text/html\",\n\t\t\"htm\"\t=> \"text/html\",\n\t\t\"txt\"\t=> \"text/plain\",\n\t\t\"xml\"\t=> \"text/xml\",\n\t\t\n\t\t\"bmp\"\t=> \"image/bmp\",\n\t\t\"gif\"\t=> \"image/gif\",\n\t\t\"jpg\"\t=> \"image/jpeg\",\n\t\t\"png\"\t=> \"image/png\",\n\t\t\"tiff\"\t=> \"image/tiff\",\n\t\t\"tif\"\t=> \"image/tif\",\n\t);\n\t$file_mime = $mimetypes[pathinfo($file, PATHINFO_EXTENSION)];\n\tif(check_value($file_mime)) {\n\t\treturn $file_mime;\n\t} else {\n\t\treturn \"application/force-download\";\n\t}\n}", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function type()\n\t{\n\t\treturn self::lookup($this->file);\n\t}", "public function getXsiTypeName() {\n return \"DownloadFormat\";\n }", "abstract public function getMimeType();", "public function getExtendedType()\n {\n return 'file';\n }", "public function getMimeType(): string;", "function getMIMEType( $sFileName = \"\" ) { \r\n $sFileName = strtolower( trim( $sFileName ) ); \r\n if( ! strlen( $sFileName ) ) return \"\"; \r\n \r\n $aMimeType = array( \r\n \"txt\" => \"text/plain\" , \r\n \"pdf\" => \"application/pdf\" , \r\n \"zip\" => \"application/x-compressed\" , \r\n \r\n \"html\" => \"text/html\" , \r\n \"htm\" => \"text/html\" , \r\n \r\n \"avi\" => \"video/avi\" , \r\n \"mpg\" => \"video/mpeg \" , \r\n \"wav\" => \"audio/wav\" , \r\n \r\n \"jpg\" => \"image/jpeg \" , \r\n \"gif\" => \"image/gif\" , \r\n \"tif\" => \"image/tiff \" , \r\n \"png\" => \"image/x-png\" , \r\n \"bmp\" => \"image/bmp\" \r\n ); \r\n $aFile = split( \"\\.\", basename( $sFileName ) ) ; \r\n $nDiminson = count( $aFile ) ; \r\n $sExt = $aFile[ $nDiminson - 1 ] ; // get last part: like \".tar.zip\", return \"zip\" \r\n \r\n return ( $nDiminson > 1 ) ? $aMimeType[ $sExt ] : \"\"; \r\n}", "function fn_get_mime_content_type($filename, $check_by_extension = true, $not_available_result = 'application/octet-stream')\n{\n $type = '';\n\n if (class_exists('finfo')) {\n $finfo_handler = @finfo_open(FILEINFO_MIME);\n if ($finfo_handler !== false) {\n $type = @finfo_file($finfo_handler, $filename);\n list($type) = explode(';', $type);\n @finfo_close($finfo_handler);\n }\n }\n\n if (empty($type) && function_exists('mime_content_type')) {\n $type = @mime_content_type($filename);\n }\n\n if (empty($type) && $check_by_extension && strpos(fn_basename($filename), '.') !== false) {\n $type = fn_get_file_type(fn_basename($filename), $not_available_result);\n }\n\n return !empty($type) ? $type : $not_available_result;\n}", "function get_download_type($user_type = NULL) {\n\n if ($user_type == 'download') {\n return 'Download';\n } else if ($user_type == 'download_evt_map') {\n return 'Event Map';\n } else if ($user_type == 'download_ses_map') {\n return 'Session Profile';\n } else if ($user_type == 'download_exe_pro') {\n return 'Speaker Profile';\n } else if ($user_type == 'download_exh_pro') {\n return 'Exhibitor Profile';\n } else {\n return $user_type;\n }\n }", "public function typeOfFile($path);", "function getfiletype($path){\n\t$extension = getextension($path);\n\tif($extension!=null)\n\t{\n if (isset($_ENV['MIME_TYPES']['binary'][$extension])){\n return 'binary';\n } else if (isset($_ENV['MIME_TYPES']['ascii'][$extension])){\n return 'ascii';\n }\n }\n return null;\n}", "final public function getFile()\n {\n return 'file';\n }", "function getMimeType ()\n\t{\n\t\treturn $this->mainType.'/'.$this->subType;\n\t}", "function getFileMimetype($file_path)\n {\n if (function_exists('finfo_open'))\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $file_path);\n finfo_close($finfo);\n }\n elseif (function_exists('mime_content_type'))\n {\n $type = mime_content_type($file);\n }\n else\n {\n // Unable to get the file mimetype!\n $type = '';\n }\n return $type;\n }", "public function getMimeType()\n\t{\n\t\treturn mime_content_type($this->tmp_name);\n\t}", "public function getMimeType(): string\n {\n return $this->filesystem->mimeType(\n $this->resource->getPath()\n ) ?: 'application/octet-stream';\n }", "function getMimeType() {\n\t\treturn $this->getParam(self::PARAM_DISTRIBUTOR_MIMETYPE);\n\t}", "function getType() {\n\t\treturn $this->data_array['filetype'];\n\t}", "public function getMimeType()\r\n {\r\n if (array_key_exists($this->getExtension(), $this->fileTypes)) {\r\n return $this->fileTypes[$this->getExtension()]['type'];\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "public static function fileMimeType($filename)\r\n {\r\n $extension = FileUtility::getFileExtension($filename);\r\n\r\n foreach (file('lib/mime.types') as $line)\r\n {\r\n $line = str_replace(' ', \"\\t\", $line);\r\n if (strpos($line, \"\\t\" . $extension) !== false)\r\n {\r\n $array = explode(\"\\t\", $line);\r\n return $array[0];\r\n }\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "function typeoffile($file){ //list( $mutes, $date, $type, $ext) = explode( '.', $file );\n $type= explode( '.', $file )[2];\n return $type;\n}", "function get_content_type($url){\n\t\t\t\t\t\t$mime_types = array(\n\t\t\t\t\t\t\t\"pdf\"=>\"application/pdf\"\n\t\t\t\t\t\t\t,\"exe\"=>\"application/octet-stream\"\n\t\t\t\t\t\t\t,\"zip\"=>\"application/zip\"\n\t\t\t\t\t\t\t,\"docx\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"doc\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"xls\"=>\"application/vnd.ms-excel\"\n\t\t\t\t\t\t\t,\"ppt\"=>\"application/vnd.ms-powerpoint\"\n\t\t\t\t\t\t\t,\"gif\"=>\"image/gif\"\n\t\t\t\t\t\t\t,\"png\"=>\"image/png\"\n\t\t\t\t\t\t ,\"ico\"=>\"image/ico\"\n\t\t\t\t\t\t ,\"jpeg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"jpg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"mp3\"=>\"audio/mpeg\"\n\t\t\t\t\t\t ,\"wav\"=>\"audio/x-wav\"\n\t\t\t\t\t\t ,\"mpeg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpe\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mov\"=>\"video/quicktime\"\n\t\t\t\t\t\t ,\"avi\"=>\"video/x-msvideo\"\n\t\t\t\t\t\t ,\"3gp\"=>\"video/3gpp\"\n\t\t\t\t\t\t ,\"css\"=>\"text/css\"\n\t\t\t\t\t\t ,\"jsc\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"js\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"php\"=>\"text/html\"\n\t\t\t\t\t\t ,\"htm\"=>\"text/html\"\n\t\t\t\t\t\t ,\"html\"=>\"text/html\"\n\t\t\t\t\t\t ,\"xml\"=>\"application/xml\"\n\t\t\t\t\t\t \n\t\t\t\t\t\t);\n\t\t\t\t\t\t$var = explode('.', $url);\n\t\t\t\t\t\t$extension = strtolower(end($var));\n\t\t\t\t\t\tif(isset($mime_types[$extension])){\n\t\t\t\t\t\t return $mime_types[$extension];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 'other';\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "private function _getFileType($fileName)\n {\n $safeFileName = escapeshellarg($fileName);\n return trim(exec(\"file -b $safeFileName\"));\n\n//return $this->getFileType2($fileName);\n }", "public static function getMimeTypeForFile(string $filename): string\n\t{\n\t\t// In case the path is a Bitly, strip any query string before getting extension\n\t\t$qpos = strpos($filename, '?');\n\t\tif (false !== $qpos) {\n\t\t\t$filename = substr($filename, 0, $qpos);\n\t\t}\n\n\t\treturn self::getMimeTypeFromExtension(self::mb_pathinfo($filename, PATHINFO_EXTENSION)) ?? 'application/octet-stream';\n\t}", "public function getMimeType()\n {\n return CFileHelper::getMimeType($this->file->getTempName());\n }", "public function getFileExtension(){\n\n if($this->isPhoto()){\n return \"jpg\";\n }\n\n if($this->isVideo()){\n return \"mp4\";\n }\n\n return \"bin\";\n\n }", "function _mimetype($virtualpath) \r\n {\r\n\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype: $virtualpath \",\"cby_webdav\",\"_mimetype\");\r\n\t\t\t$t3io=$this->CFG->t3io;\r\n\r\n if (@$t3io->T3IsDir($virtualpath)) {\r\n // directories are easy\r\n return \"httpd/unix-directory\"; \r\n } else if (function_exists(\"mime_content_type\")) {\r\n // use mime magic extension if available\r\n $mime_type = mime_content_type($virtualpath);\r\n } else if ($this->_can_execute(\"file\")) {\r\n // it looks like we have a 'file' command, \r\n // lets see it it does have mime support\r\n $fp = popen(\"file -i '$virtualpath' 2>/dev/null\", \"r\");\r\n $reply = fgets($fp);\r\n pclose($fp);\r\n \r\n // popen will not return an error if the binary was not found\r\n // and find may not have mime support using \"-i\"\r\n // so we test the format of the returned string \r\n \r\n // the reply begins with the requested filename\r\n if (!strncmp($reply, \"$virtualpath: \", strlen($virtualpath)+2)) { \r\n $reply = substr($reply, strlen($virtualpath)+2);\r\n // followed by the mime type (maybe including options)\r\n if (preg_match('|^[[:alnum:]_-]+/[[:alnum:]_-]+;?.*|', $reply, $matches)) {\r\n $mime_type = $matches[0];\r\n }\r\n }\r\n } \r\n \r\n if (empty($mime_type)) {\r\n // Fallback solution: try to guess the type by the file extension\r\n // TODO: add more ...\r\n // TODO: it has been suggested to delegate mimetype detection \r\n // to apache but this has at least three issues:\r\n // - works only with apache\r\n // - needs file to be within the document tree\r\n // - requires apache mod_magic \r\n // TODO: can we use the registry for this on Windows?\r\n // OTOH if the server is Windos the clients are likely to \r\n // be Windows, too, and tend do ignore the Content-Type\r\n // anyway (overriding it with information taken from\r\n // the registry)\r\n // TODO: have a seperate PEAR class for mimetype detection?\r\n switch (strtolower(strrchr(basename($virtualpath), \".\"))) {\r\n case \".html\":\r\n case \".textpic\":\r\n case \".txt\":\r\n case \".[unknown]\":\r\n $mime_type = \"text/html\";\r\n break;\r\n case \".gif\":\r\n $mime_type = \"image/gif\";\r\n break;\r\n case \".jpg\":\r\n $mime_type = \"image/jpeg\";\r\n break;\r\n default: \r\n $mime_type = \"application/octet-stream\";\r\n break;\r\n }\r\n }\r\n\t\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype>: $mime_type \",\"cby_webdav\",\"_mimetype\");\r\n \r\n return $mime_type;\r\n }", "function getFileType()\n {\n try\n {\n list($this->m_Width, $this->m_height, $this->m_type, $this->m_attr) = getimagesize($this->m_ImagePath);\n return $this->m_type;\n }\n catch (Exception $ex)\n {\n return 0;\n }\n }", "public function getMimeType()\n {\n if (!class_exists('finfo', false)) return $this->type;\n $info = new \\finfo(FILEINFO_MIME);\n return $info->file($this->tmp);\n }", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "public function getMimeType(){\n return (new \\finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);\n }", "function _mime_content_type($filename) {\n $finfo = finfo_open();\n $fileinfo = finfo_file($finfo, $filename, FILEINFO_MIME);\n finfo_close($finfo);\n return reset(explode(\";\",$fileinfo));\n \n \n //hiphop workaround hiphop does not work with inotify\n //exec(\"file \".str_replace(\" \",\"\\ \",$filename).\" --mime\",$output);\n \n $half = explode(\": \",$output[0]);\n $done = explode(\"; \",$half[1]);\n return $done[0];\n }", "public function mime() : string {\n return $this->file->type;\n }", "public function get_content_type( $type ) {\n $content_type = \"text/plain\";\n switch($type){\n case 'csv':\n $content_type = \"text/csv\";\n break;\n case 'txt':\n default:\n $break;\n }\n return $content_type;\n }", "public function getMimeType()\n {\n $this->mime_type = null;\n\n if ($this->exists === false) {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n if (function_exists('finfo_open')) {\n $php_mime = finfo_open(FILEINFO_MIME);\n $this->mime_type = strtolower(finfo_file($php_mime, $this->temp));\n finfo_close($php_mime);\n\n } elseif (function_exists('mime_content_type')) {\n $this->mime_type = mime_content_type($this->temp);\n\n } else {\n throw new \\RuntimeException\n ('Ftp Filesystem: getMimeType either finfo_open or mime_content_type are required in PHP');\n }\n\n return;\n }", "private static function guessFileType($filename) {\n\t\tif (substr_compare($filename, '.zip', -4) === 0) {\n\t\t\treturn 'zip';\n\t\t} elseif (substr_compare($filename, '.opml', -5) === 0 ||\n\t\t substr_compare($filename, '.xml', -4) === 0) {\n\t\t\treturn 'opml';\n\t\t} elseif (substr_compare($filename, '.json', -5) === 0 &&\n\t\t strpos($filename, 'starred') !== false) {\n\t\t\treturn 'json_starred';\n\t\t} elseif (substr_compare($filename, '.json', -5) === 0) {\n\t\t\treturn 'json_feed';\n\t\t} else {\n\t\t\treturn 'unknown';\n\t\t}\n\t}", "public function GetMimeType() {\n\n if ($this->IsValid() && $this->MimeType === null) {\n if (function_exists('mime_content_type')) {\n $this->MimeType= mime_content_type($this->TmpName);\n } elseif (function_exists('finfo_open')) {\n $fInfo= finfo_open(FILEINFO_MIME);\n $this->MimeType= finfo_file($fInfo, $this->TmpName);\n finfo_close($fInfo);\n }\n }\n return $this->MimeType;\n }", "public function getMimeType()\n {\n return Formats::getFormatMimeType($this->format);\n }", "public function detectMimeType()\n {\n static::checkFileinfoExtension();\n\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n\n return (($this->isWrapped() || $this->isTemp()) ?\n $finfo->buffer($this->getRaw())\n : $finfo->file($this->getPathname())\n );\n }", "public function get_file_type_id() {\n return 'sql';\n }", "public function getLatestFile($type){\r\n if(IpxCache::get(self::$latest_file_tag)){\r\n return IpxCache::get(self::$latest_file_tag);\r\n }\r\n\r\n $files_list = $this->getDataFilesList();\r\n $latest_file = '';\r\n foreach($files_list as $file){\r\n if($file['type'] == $type){\r\n $latest_file = $file['name'];\r\n break;\r\n }\r\n }\r\n IpxCache::put(self::$latest_file_tag, $latest_file, 1440);\r\n return $latest_file;\r\n }", "public function getMimeType() {\n return explode('/', $this->contentType)[0];\n }", "protected function _getFile($type, $file)\n {\n if ($type == 'class') {\n $file = $this->_class_dir . \"$file\";\n }\n \n if ($type == 'package') {\n $file = $this->_package_dir . \"$file\";\n }\n \n return $file;\n }", "function get_mimetype($name) {\n\t// We're only allowing archives.\n\tif (!substr_count($_FILES[$name]['name'],'.tar.gz') &&\n\t\t!substr_count($_FILES[$name]['name'],'.tgz') &&\n\t\t!substr_count($_FILES[$name]['name'],'.zip')) {\n\n\t\treturn FALSE;\n\t}\n\n\tif (substr_count($_FILES[$name]['name'],'.tar.gz') ||\n\t\tsubstr_count($_FILES[$name]['name'],'.tgz')) {\n\n\t\treturn 'application/x-gzip';\n\t} else {\n\t\treturn 'application/zip';\n\t}\n}", "public function getFileType()\n {\n return '.md';\n }", "private function _getFileMimeType($file)\n {\n return mime_content_type($file);\n }", "public function getMimeType()\n {\n return $this->getGuessedInternetMediaType();\n }", "protected function readMimeType()\n {\n $ext = pathinfo($this->filename, PATHINFO_EXTENSION);\n $this->mimeType = PMF_Attachment_MimeType::guessByExt($ext);\n\n return $this->mimeType;\n }", "function get_file_type_from_mimetype($mimetype)\n{\n return explode('/', $mimetype)[1];\n}", "function getTargetFileExtension() ;", "private function getNewResourceMimeType(\r\n\t\t\t$wp) {\r\n\t\t// $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension\r\n\t\t// $fileMimeType finfo_file($finfo, $_FILES[\"file1\"][\"name\"]);\r\n\t\t// finfo_close($finfo);\r\n\t\t$filetype = wp_check_filetype ( $_FILES [\"file1\"] [\"name\"] );\r\n\t\treturn $filetype ['type'];\r\n\t}", "function getmimetype($path){\n\t$extension = getextension($path);\n $filetype = getfiletype($path);\n if ($filetype != null){\n return $_ENV['MIME_TYPES'][$filetype][$extension];\n } else {\n return 'text/plain';\n }\n}", "function _mime_content_type($filename) {\n if (!file_exists($filename) || !is_readable($filename)) return false;\n if(class_exists('finfo')){\n $result = new finfo();\n if (is_resource($result) === true) {\n return $result->file($filename, FILEINFO_MIME_TYPE);\n }\n }\n \n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filename);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';')) list($mimeType,) = explode(';', $mimeType);\n return $mimeType;\n }\n \n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filename);\n }\n \n\n // Trying to get mimetype from images\n $imageData = getimagesize($filename);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n // Trying exec\n if (function_exists('exec')) {\n $mimeType = exec(\"/usr/bin/file -i -b $filename\");\n if(strpos($mimeType,';')){\n $mimeTypes = explode(';',$mimeType);\n return $mimeTypes[0];\n }\n if (!empty($mimeType)) return $mimeType;\n }\n return false;\n }", "public function getType() {\n\t\tif ($this->getIsDir()) {\n\t\t\treturn '<DIR>';\n\t\t} else {\n\t\t\treturn $this->getExtension().' file';\n\t\t}\n\t}", "protected function _getMimeType()\n\t{\n\t\treturn 'text/text';\n\t}", "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public static function get_mime_type($filename)\n {\n // If the finfo module is compiled into PHP, use it.\n $path = BASE_PATH . DIRECTORY_SEPARATOR . $filename;\n if (class_exists('finfo') && file_exists($path)) {\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n return $finfo->file($path);\n }\n\n // Fallback to use the list from the HTTP.yml configuration and rely on the file extension\n // to get the file mime-type\n $ext = strtolower(File::get_file_extension($filename));\n // Get the mime-types\n $mimeTypes = HTTP::config()->uninherited('MimeTypes');\n\n // The mime type doesn't exist\n if (!isset($mimeTypes[$ext])) {\n return 'application/unknown';\n }\n\n return $mimeTypes[$ext];\n }", "public function getMimetype();", "public function get_data_type()\n {\n if( is_null( $this->file_name ) ) return NULL;\n $pos = strrpos( $this->file_name, '.' );\n return false === $pos ? '' : substr( $this->file_name, $pos + 1 );\n }", "function get_mime_type($file, $real_filename = null, $use_native_functions = true) {\n if (function_exists('mime_content_type') && $use_native_functions) {\n $mime_type = trim(mime_content_type($file));\n if (!$mime_type) {\n return 'application/octet-stream';\n } // if\n $mime_type = explode(';', $mime_type);\n return $mime_type[0];\n } else if (function_exists('finfo_open') && function_exists('finfo_file') && $use_native_functions) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mime_type;\n } else {\n if ($real_filename) {\n $file = $real_filename;\n } // if\n \n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-flash',\n 'flv' => 'video/x-flv',\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n \n $extension = strtolower(get_file_extension($file));\n if (array_key_exists($extension, $mime_types)) {\n return $mime_types[$extension];\n } else {\n return 'application/octet-stream';\n } // if\n } // if\n }", "public function mimeType(): string\n {\n return $this->mimeType ??= FileSystem::mimeType($this->path);\n }", "function get_file($local_file, $server_file, $format = null)\n {\n\n $only = null;\n if ($format != '') {\n $only = $this->only_format($server_file, $format);\n if ($only == false) {\n echo \"Толькo формати jpg, png, gif\\n\";\n\n return false;\n }\n }\n\n if (ftp_get($this->connect, $local_file, $server_file, FTP_BINARY)) {\n echo \"Произведена запись в $local_file\\n\";\n } else {\n echo \"Не удалось завершить операцию\\n\";\n }\n }", "public function getMimeType() {\n\t\treturn parent::getMimeType();\n\t}", "public function getExtendedType()\n {\n return FileType::class;\n }", "function getMimeType($filename)\n{\n\t$mimeType = '';\n\n\t// Check only existing readable files\n\tif (!file_exists($filename) || !is_readable($filename))\n\t{\n\t\treturn '';\n\t}\n\n\t// Try finfo, this is the preferred way\n\tif (function_exists('finfo_open'))\n\t{\n\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t$mimeType = finfo_file($finfo, $filename);\n\t\tfinfo_close($finfo);\n\t}\n\t// No finfo? What? lets try the old mime_content_type\n\telseif (function_exists('mime_content_type'))\n\t{\n\t\t$mimeType = mime_content_type($filename);\n\t}\n\t// Try using an exec call\n\telseif (function_exists('exec'))\n\t{\n\t\t$mimeType = @exec(\"/usr/bin/file -i -b $filename\");\n\t}\n\n\t// Still nothing? We should at least be able to get images correct\n\tif (empty($mimeType))\n\t{\n\t\t$imageData = elk_getimagesize($filename, 'none');\n\t\tif (!empty($imageData['mime']))\n\t\t{\n\t\t\t$mimeType = $imageData['mime'];\n\t\t}\n\t}\n\n\t// Account for long responses like text/plain; charset=us-ascii\n\tif (!empty($mimeType) && strpos($mimeType, ';'))\n\t{\n\t\tlist($mimeType,) = explode(';', $mimeType);\n\t}\n\n\treturn $mimeType;\n}", "public function getFileExtension();", "public function getFile($type = 'document')\n {\n return $this->files()->where('type' , '=', $type)->get()->first();\n }", "public function getType() {\n if (!isset($_FILES[$this->_file])) {\n return false;\n }\n \n return $_FILES[$this->_file]['type'];\n }", "public function getFileType($attribute)\n {\n if (empty($attribute) || !$this->hasAttribute($attribute)) {\n throw new Exception(\"getFileUrl: Unknown attribute \" . $attribute . \" on model \" . get_class($this));\n }\n $path = $this->getUploadPath() . $this->$attribute;\n\n // Check cache\n $cacheKey = md5($path . '_mime');\n $mimeType = Yii::$app->fs_cache->get($cacheKey);\n\n if ($mimeType === false) {\n $mimeType = '';\n if (Yii::$app->get('fs')->has($path)) {\n switch (Yii::$app->get('fs')->getMimetype($path)) {\n case 'application/pdf':\n $mimeType = 'pdf';\n break;\n case 'image/png':\n case 'image/jpg':\n case 'image/jpeg':\n $mimeType = 'image';\n break;\n default:\n $mimeType = 'other';\n }\n }\n\n if ($mimeType != '') {\n // Build dependency key (changed on upload of new file)\n $this->setFileTypeCache($cacheKey, $mimeType, $attribute);\n }\n }\n return $mimeType;\n }", "public function getTypeString()\n {\n switch ( $this->fileStructure->type )\n {\n case self::IS_DIRECTORY:\n return \"d\";\n\n case self::IS_FILE:\n return \"-\";\n\n case self::IS_SYMBOLIC_LINK:\n return \"l\";\n\n case self::IS_LINK:\n return \"h\";\n\n default:\n return \"Z\";\n }\n }", "public function getMimeType() : string\n {\n $mimeType = $this->mimeType;\n if ($this->shouldBeCompressed()) {\n $mimeType = $this->compression->getMimeType();\n }\n return $mimeType;\n }", "public function getContentType()\n {\n return $this->mediaFile->getContentType();\n }", "public function getTemplateType() : string\r\n {\r\n // After adding HEIC files, we also need to exclude them \r\n // from being displayed like regular images. \r\n $validImgMime = array(\r\n 'image/bmp',\r\n 'image/gif',\r\n 'image/jpg',\r\n 'image/jpeg',\r\n 'image/png',\r\n 'image/tiff'\r\n );\r\n\r\n $fileType = explode('/', $this->mime_type, 2)[0];\r\n if($fileType == 'image' && !in_array($this->mime_type, $validImgMime))\r\n {\r\n $fileType = 'file';\r\n }\r\n else if(!in_array($fileType, array('image', 'audio', 'video')))\r\n {\r\n $fileType = 'file';\r\n }\r\n return $fileType;\r\n }", "private function getType(UploadedFile $file)\n {\n $mime = $file->getMimeType();\n\n return $mime ? explode('/', $mime)[0] : 'n/a';\n }", "public function type($path)\n {\n return $this->asyncFs->file($path)->type();\n }" ]
[ "0.73735523", "0.7001462", "0.6953557", "0.69217557", "0.69131577", "0.6858751", "0.6851595", "0.6818716", "0.68157536", "0.6784673", "0.67799926", "0.6772565", "0.6626658", "0.6617097", "0.66142374", "0.66080946", "0.66080946", "0.66080946", "0.66080946", "0.65966463", "0.6592405", "0.65820616", "0.6537487", "0.6537487", "0.6537487", "0.6537487", "0.6537487", "0.65031105", "0.65009487", "0.64977896", "0.6493856", "0.6489446", "0.6486849", "0.646507", "0.6460453", "0.6445324", "0.6440729", "0.64104486", "0.64066744", "0.6393982", "0.6393481", "0.6359778", "0.6357903", "0.6355272", "0.6339537", "0.63341993", "0.6332181", "0.6308438", "0.630126", "0.6263553", "0.6252107", "0.6228348", "0.6185853", "0.6179142", "0.61576724", "0.6136877", "0.6125282", "0.6124617", "0.6124186", "0.61050665", "0.60996425", "0.6093427", "0.60933894", "0.6092773", "0.6082775", "0.60690385", "0.6065798", "0.60651404", "0.6048654", "0.6039428", "0.6039396", "0.60240924", "0.601837", "0.6017039", "0.60169107", "0.6005719", "0.6003256", "0.6003029", "0.6002478", "0.59980613", "0.59854645", "0.5981982", "0.5979184", "0.5975919", "0.5969449", "0.5959756", "0.5957879", "0.5953325", "0.59492344", "0.59276265", "0.59245414", "0.59236985", "0.5921102", "0.5920757", "0.59200937", "0.59115726", "0.5899539", "0.58992475", "0.5898698", "0.5895629", "0.58675504" ]
0.0
-1
Reads and returns the file to download.
public function finish() { return file_get_contents( $this->file_name ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read() {\n\t\tif ($this->f && filesize($this->path) > 0) {\n\t\t\treturn fread($this->f, filesize($this->path));\n\t\t}\n\t\treturn '';\n\t}", "public function downloadFile();", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "public function read()\n\t{\n\t\treturn file_get_contents($this->getPath());\n\t}", "public function download(){\n\t\treturn $this->fpdi->Output($this->fileName, 'D');\n\t}", "public function download()\n {\n return Storage::download(request('path'));\n }", "function downloadFile(){\n $file = basename($_GET['file']);\n $file = \"../temp/\".$file; \n if (!$file) { // file does not exist\n die('file not found');\n } else {\n header(\"Cache-Control: public\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Disposition: attachment; filename=$file\");\n header(\"Content-Type: application/txt\");\n header(\"Content-Transfer-Encoding: binary\");\n // read the file from disk\n readfile($file);\n }\n }", "public function read_file() {\t\t\r\n\t\t$file = $this->filepath;\r\n\t\t\r\n\t\tif(file_exists($file)) {\r\n\t\t\t$this->_content = file_get_contents($file);\t\r\n\t\t} \r\n\t}", "public function read()\n {\n if(Cache::exist($this->key))\n {\n return Cache::get($this->key);\n }\n else\n {\n if(File::exist($this->file))\n {\n if(!static::$cache->hasKey($this->key))\n {\n $file = new Reader($this->file);\n \n if($file->is('php'))\n {\n $data = static::send($file->require());\n }\n else\n {\n $data = static::send($file->lines());\n }\n\n static::$cache->set($this->key, $data);\n\n return $data;\n }\n else\n {\n return static::$cache->get($this->key);\n }\n }\n }\n }", "protected function getFileContents() {\n $path = $this->getFilePath();\n return file_get_contents($path);\n }", "protected function get_file() {\n\n\t\t$file = '';\n\n\t\tif ( @file_exists( $this->file ) ) {\n\n\t\t\tif ( ! is_writeable( $this->file ) ) {\n\t\t\t\t$this->is_writable = false;\n\t\t\t}\n\n\t\t\t$file = @file_get_contents( $this->file );\n\n\t\t} else {\n\n\t\t\t@file_put_contents( $this->file, '' );\n\t\t\t@chmod( $this->file, 0664 );\n\n\t\t}\n\n\t\treturn $file;\n\t}", "protected function get_file() {\r\n\t\t$file = '';\r\n\r\n\t\tif ( @file_exists( $this->file ) ) {\r\n\t\t\tif ( ! is_writeable( $this->file ) ) {\r\n\t\t\t\t$this->is_writable = false;\r\n\t\t\t}\r\n\r\n\t\t\t$file = @file_get_contents( $this->file );\r\n\t\t} else {\r\n\t\t\t@file_put_contents( $this->file, '' );\r\n\t\t\t@chmod( $this->file, 0664 );\r\n\t\t}\r\n\r\n\t\treturn $file;\r\n\t}", "public function getFile();", "public function getFile();", "public function read($file);", "function GetFile($filename){\n $filename = 'brown' . DIRECTORY_SEPARATOR . $filename;\n $handle = fopen($filename, 'r');\n $contents = fread($handle, filesize($filename));\n fclose($handle);\n return $contents;\n}", "public function read(): string\n {\n if ($this->exists()) {\n return file_get_contents($this->path) ?: '';\n }\n\n return '';\n }", "function get_file_contents($filename) {\r\n if (!function_exists('file_get_contents')) {\r\n $fhandle = fopen($filename, 'r');\r\n $fcontents = fread($fhandle, filesize($filename));\r\n fclose($fhandle);\r\n } else {\r\n $fcontents = file_get_contents($filename);\r\n }\r\n\r\n return $fcontents;\r\n }", "public function downloadAction()\n\t{\n\t\t$settings = $this->getProgressParameters();\n\n\t\tif (!empty($settings['downloadParams']['filePath']) && !empty($settings['downloadParams']['fileName']))\n\t\t{\n\t\t\t$file = new Main\\IO\\File($settings['downloadParams']['filePath']);\n\t\t\tif ($file->isExists())\n\t\t\t{\n\t\t\t\t$response = new Main\\Engine\\Response\\File(\n\t\t\t\t\t$file->getPath(),\n\t\t\t\t\t$settings['downloadParams']['fileName'],\n\t\t\t\t\t$settings['downloadParams']['fileType']\n\t\t\t\t);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Error('File not found'));\n\t}", "public function download($file_to_be_downloaded)\n {\n $response = $this->doRequest('/path/data/' . $file_to_be_downloaded, 'get');\n $removeheaders = $this->getBody($response);\n return file_put_contents($file_to_be_downloaded, $removeheaders);\n }", "public function read() {\n\n\t\t$document = $this->getHandle();\n\t\ttry {\n\t\t\t$document->load($this->fileInfo->getPathname());\n\t\t} catch(Exception $e) {\n\t\t\tthrow new ReadException(\"Cannot read from resource: {$this->fileInfo->getPathname()}\", 0, $e);\n\t\t}\n\n\t\treturn $document;\n\t}", "final function getFile();", "public function download()\n {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . $this->getFilename());\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . $this->getSize());\n \\Oka\\Web\\Buffer::Clean();\n\n $this->read();\n exit;\n }", "public function getFile()\n {\n $challenge = $this->getHttpChallenge();\n if ($challenge !== false) {\n return new File($challenge->getToken(), $challenge->getToken() . '.' . $this->digest);\n }\n return false;\n }", "function file_read ($filename) {\r\n $fd = fopen($filename, 'r') or die(\"Can't open file $filename for read!\");\r\n $theData = fread($fd, filesize($filename));\r\n fclose($fd);\r\n return $theData;\r\n }", "public function downloadFile()\n {\n // Check for request forgeries.\n Session::checkToken('get') or jexit(Text::_('JINVALID_TOKEN'));\n\n $model = $this->getModel();\n $model->downloadFile();\n }", "public function getFile()\n {\n header('Content-type: ' . $this->mime_type);\n header('Content-Disposition: attachment; filename=' . $this->original_name);\n \n echo gzuncompress(base64_decode($this->content));\n \n die();\n }", "public function getFile ();", "public function readFile() {\n $content = $this->getFileContents();\n return json_decode($content, 1);\n }", "public function read($path) {\n return file_get_contents($path);\n }", "public function download()\n {\n $this->user->downloaded();\n\n return response()->download($this->user->me()->data->file);\n }", "protected function getFile($filename){\n\t\t$myfile = fopen($filename, \"r\") or die(\"Unable to open file!\");\n\t\t$ret = fread($myfile,filesize($filename));\n\t\tfclose($myfile);\n\t\treturn $ret;\n\t}", "public function get()\n {\n if(is_null($this->contents) && $this->exists())\n $this->contents = file_get_contents($this->getPath());\n\n return $this->contents;\n }", "public function read($fileName)\n {\n $data=$this->fileAction('r',$fileName);\n return $data;\n }", "public function getFileContents()\r\n {\r\n $this->fileContents = $this->fileContents ?? file_get_contents($this->file);\r\n\r\n return $this->fileContents;\r\n }", "public static function _download_file($file_url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_POST, 0); \n\tcurl_setopt($ch,CURLOPT_URL,$file_url); \n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$file_content = curl_exec($ch);\n\tcurl_close($ch);\n //return file content \n return $file_content;\n }", "function read($name) {\n return @file_get_contents($this->path . \"/$name\");\n }", "function readFile(){\n $this->setHeaders();\n $this->readContent();\n\n }", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "function Get_File_Contents($Filename) {\n //return 'hello';\n $File_Handle = fopen($Filename, \"r\");\n $File_Contents = fread($File_Handle, filesize($Filename));\n fclose($File_Handle);\n return $File_Contents;\n }", "public static function getFile() {}", "function fileGetContents($filename);", "function downloadFile($filename, $downloadPath)\n{\n App::set_response_header('Content-Type', 'text/plain');\n App::set_response_header('Pragma', 'no-cache');\n App::set_response_header(\n 'Content-Disposition',\n \"attachment; filename={$filename}\"\n );\n readfile($downloadPath);\n}", "public function get_local_file()\n\t{\n $this->delete_local_file();\n // Downloads a local copy of the file.\n $pieces = explode(\".\", $this->location);\n $this->local_file = sys_get_temp_dir().'/'.str_random(32) . '.' . $pieces[count($pieces) - 1];\n $s3 = AWS::createClient('s3');\n $result = $s3->getObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location,\n 'SaveAs' => $this->local_file\n )\n );\n // Wait until the file is downloaded\n $size = -10;\n do {\n $old_size = $size;\n sleep(0.25);\n if(file_exists($this->local_file)) {\n $size = filesize($this->local_file);\n }\n } while ($old_size < 0 && $old_size != $size);\n\t}", "public static function read_file($file) {\n\t\tif(self::has_file($file)) {\n\t\t\t$time = filemtime($file);\n\t\t\tif(Registry::get(\"site.newest_file\") < $time) {\n\t\t\t\tRegistry::set(\"site.newest_file\",$time);\n\t\t\t}\n\t\t\treturn file_get_contents($file);\n\t\t} else {\n\t\t\tdie(\"Disk::read_file: File '\".$file.\"' does not exist!\");\n\t\t}\n\t}", "public function read($path);", "public function get($file)\n {\n $path = $this->getPath($file);\n\n if ( ! file_exists($path)) throw new FileDoesNotExist;\n\n return file_get_contents($path);\n }", "public function getFile() {}", "public function getFile() {}", "function file_get_contents($filename=false)\n\t{\n\t\tif (!is_file($filename) || !is_readable($filename)) {\n\t\t\treturn false;\n\t\t}\n\t\t$handle = fopen($filename, \"r\");\n\t\t$contents = fread($handle, filesize($filename));\n\t\tfclose($handle);\n\t\treturn $contents;\n\t}", "function get_file($filename){\n if($fp = fopen($filename, 'rb')){\n $return = fread($fp, filesize($filename));fclose($fp);return $return;}\n else{\n return FALSE;}\n }", "public function read($path)\n {\n return file_get_contents($path);\n }", "public function fileGetContents($url)\n {\n $rawResponse = file_get_contents($url, false, $this->stream);\n $this->responseHeaders = $http_response_header;\n\n return $rawResponse;\n }", "function read_file($filename) \r\n\t{\r\n\t\t$filename = $this->root . $filename;\r\n\r\n\t\tif (!file_exists($filename))\r\n\t\t{\r\n\t\t\t$this->error(\"phemplate::read_file(): file $filename does not exist.\", 'fatal');\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$tmp = false;\r\n\t\t\r\n\t\t$filesize = filesize($filename);\r\n\t\tif ($filesize)\r\n\t\t{\r\n\t\t\t$tmp = fread($fp = fopen($filename, 'r'), $filesize);\r\n\t\t\tfclose($fp);\r\n\t\t}\r\n\t\treturn $tmp;\r\n\t}", "public function read(string $file): string;", "function reading_file($file_txt) {\n\t$data_txt = $file_txt;\n\t$fh = fopen($data_txt, \"r\");\n\t$file = file_get_contents($data_txt);\n\treturn $file;\n}", "public function getContents($file);", "public function getDownload(Request $request)\n {\n //dd($request->filename);\n $file = storage_path() . '/app/public/' . $request->filename;\n return response()->file($file);\n }", "public function get(): string\n {\n if ( ! $this->isReadable() ) {\n throw new FileSystemException(\n 'File access denied'\n );\n }\n\n return file_get_contents($this->directory->getPath().'/'.$this->filename);\n }", "function downloadFromFile($file, $name = '') {\n\t\t$result['output'] = array();\n\t\t$result['status'] = false;\n\t\treturn $result;\n\t}", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile() {\n return $this->file;\n }", "public function getFile() {\n return $this->file;\n }", "function get_file(){\n extract($this->_url_params);\n /**\n * @var string $file_name\n * @var int $project_id\n */\n $this->load_view(false);\n if(!isset($file_name, $project_id)) goto redirect;\n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();\n $logged_in = $project->login_check();\n if($logged_in AND $project->verify($project_id)){\n $file_type = null;\n switch($file_name){\n case 'SpeciesRelation.txt': $file_type = Constants::EXPORT_SPECIES_RELATION; break;\n case 'DistantMatrix.txt' : $file_type = Constants::EXPORT_DISTANT_MATRIX; break;\n case 'NeighbourTree.jpg' : $file_type = Constants::EXPORT_NEIGHBOUR_TREE; break;\n case 'UPGMATree.jpg' : $file_type = Constants::EXPORT_UPGMA_TREE;\n }\n if($file_type == null) goto redirect;\n $file = $project->export($project_id, $file_type);\n if($file == null){\n redirect:\n $this->redirect(isset($_SERVER['HTTP_REFERER']) ?\n $_SERVER['HTTP_REFERER'] :\n Config::WEB_DIRECTORY . 'projects');\n exit();\n }\n header('Content-Type: ' . $file['mime']);\n header('Content-Disposition: attachment; filename=\"' . $file['name'] . '\"');\n readfile($file['path']);\n exit();\n }\n goto redirect;\n }", "public function getFile() {\n\n return $this->file;\n }", "public function getFile(): string\n {\n return $this->filePath;\n }", "function Get_File_Contents($fileName)\n{\n //return 'hello';\n $fileHandle = fopen($fileName, \"r\");\n $fileContents = fread($fileHandle, filesize($fileName));\n fclose($fileHandle);\n return $fileContents;\n}", "protected function fileRead($filename,$submissionService){\n\t\t$wsFile = new ODSubmission_WSFile;\n\t\t$wsFile->mode = $submissionService->WSFILE_MODE['MODE_INLINED'];\n\t\t$wsFile->name = $this->shortFileName($filename);\n\t\t$myfile = fopen($filename,'r');\n\t\t$wsFile->content = (fread($myfile, filesize ($filename)));\n\t\tfclose($myfile);\t\t\t\n\t\treturn $wsFile;\n\t}", "public function download() {\n $this->autoRender = false;\n $filename = $this->request->params['pass'][3];\n $orgfilename = $this->request->params['pass'][4];\n// pr($this->request->params); exit;\n $this->response->file(\n 'webroot/uploads/post/files/' . $filename, array(\n 'download' => true,\n 'name' => $orgfilename\n )\n );\n// return $this->response;\n }", "function download_activity_file($filename)\n\t{\n\t\t$this->http_set_content_type(NULL);\n\t\t$this->load_url(\"activities/$filename\", 'get');\n\t\treturn $this->http_response_body;\n\t}", "public function getFile()\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n\r\n $access_full_path = $this->_get_access_full_path();\r\n $filename = $this->input->get_post('filename');\r\n $alt = $this->input->get_post('alt');\r\n\r\n // insert userlog\r\n if (empty($alt))\r\n {\r\n $this->_insert_userlog(Userlog_model::FILE_PREVIEW);\r\n }\r\n\r\n if ($this->files_model->is_document($filename))\r\n {\r\n header('Location: /files/preview?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n if ($this->files_model->is_extension($filename, 'nes'))\r\n {\r\n header('Location: /files/jsnes?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n if ( ! $this->files_model->is_browser_viewable($filename))\r\n {\r\n header('Location: /files/show_download?'. $_SERVER['QUERY_STRING']);\r\n return;\r\n }\r\n\r\n $this->files_model->get_file($access_full_path, $filename, $alt);\r\n }", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "function cemhub_download_flat_file($file_name) {\n $file_details = cemhub_retrieve_file_details($file_name);\n\n if ($file_details) {\n drupal_add_http_header('Content-type', 'octet/stream');\n drupal_add_http_header('Content-disposition', \"attachment; filename=\" . $file_details->filename . \";\");\n drupal_add_http_header('Cache-Control', 'private');\n drupal_add_http_header('Content-Length', filesize($file_details->uri));\n readfile($file_details->uri);\n drupal_exit();\n }\n}", "function read_remote_file($url)\n{\n\t$fp = fopen($url,\"r\");\n\tif (!$fp) return false;\n\n\t$text = '';\n\twhile ( !feof($fp) )\n\t{\n\t\t$text .= fgets($fp,4096);\n\t}\n\n\treturn $text;\n}", "public function download() {\n $file_name = get('name');\n// return \\Response::download(temp_path($file_name));\n return \\Response::download(storage_path('app') . '/' . $file_name);\n }", "public function get_file()\n {\n return $this->file;\n }", "public function getFileAction($name)\n {\n return $this->container->get('lighthart_document_downloader.downloader')->getResponseForFile($name, true);\n }", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string;", "public function download()\n {\n $hashids = new Hashids(Configure::read('Security.salt'));\n $pk = $hashids->decode($this->request->query['i'])[0];\n $this->loadModel($this->request->query['m']);\n $data = $this->{$this->request->query['m']}->find('first', array(\n 'recursive' => -1,\n 'conditions' => array(\n \"{$this->request->query['m']}.\" . $this->{$this->request->query['m']}->primaryKey => $pk\n ),\n 'fields' => array(\n \"{$this->request->query['m']}.{$this->request->query['f']}\"\n )\n ));\n $file = json_decode($data[$this->request->query['m']][$this->request->query['f']], true);\n\n header('Content-length: ' . $file['size']);\n header('Content-type: ' . $file['type']);\n header('Content-Disposition: inline; filename=' . $file['name']);\n echo base64_decode($file['content']);\n\n die();\n }", "function GetFromCache()\n {\n return File::GetContents($this->file);\n }", "public function download($file)\n {\n\n return Storage::download('private/'.$file);\n }", "public function get()\n {\n // Remove old one\n if(file_exists(Cyaneus::path()->draft)) {\n exec(escapeshellcmd('rm -r '.Cyaneus::path()->draft).' 2>&1', $rmr_output, $rmr_error);\n }\n\n $wget = '/usr/bin/wget --no-check-certificate ';\n $url = Cyaneus::path()->repositoryUrl;\n $file = __DIR__.DIRECTORY_SEPARATOR.'file.zip';\n\n exec(escapeshellcmd($wget.$url.' -O '.$file).' 2>&1', $wget_output, $wget_error);\n\n if($wget_error) {\n throw new \\RuntimeException('An error has occurred with wget: '.var_export($wget_output, true));\n }\n\n $this->extract($file);\n }", "function return_file($filename, $format='json') {\n\t$curl=curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $filename);\n\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curl, CURLOPT_FRESH_CONNECT, true);\n\tcurl_setopt($curl, CURLOPT_VERBOSE, 1);\n\tcurl_setopt($curl, CURLOPT_HEADER, 0);\n\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/'.$format));\n\tcurl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');\n\t$file=curl_exec($curl);\n\tcurl_close($curl);\n\treturn $file;\n}", "abstract public function read($path);", "public function readFile($path);", "public function readAll() {\n //$max_len = \\filesize($this->file->getAbsolutePath());\n //return $this->readString($max_len);\n return \\file_get_contents($this->file->getAbsolutePath());\n }", "protected function getResource()\n {\n if (is_resource($this->path)) {\n return $this->path;\n }\n\n if (!$this->isRemoteFile() && !is_readable($this->path)) {\n throw new TelegramSDKException('Failed to create InputFile entity. Unable to read resource: '.$this->path.'.');\n }\n\n return Psr7\\Utils::tryFopen($this->path, 'rb');\n }", "public function download(Request $request, File $file)\n { \n $this->authorize(\"download\", $file);\n \n return Storage::download($file->path, $file->original_name);\n }" ]
[ "0.71673274", "0.71088624", "0.69872904", "0.6952505", "0.6687242", "0.66233164", "0.66114634", "0.6607903", "0.65300924", "0.65085924", "0.65050757", "0.6425199", "0.6388983", "0.6388983", "0.63611376", "0.6359732", "0.6322204", "0.63123226", "0.63040704", "0.6294973", "0.62806374", "0.6214163", "0.6198165", "0.6194721", "0.61877275", "0.61847264", "0.61809164", "0.61746377", "0.61723614", "0.6156413", "0.6144976", "0.6139122", "0.61293495", "0.6105017", "0.610435", "0.6094284", "0.6091094", "0.60903424", "0.60888684", "0.6086751", "0.60819346", "0.6068846", "0.6061017", "0.6053156", "0.6052702", "0.60414195", "0.6035772", "0.6028714", "0.6025931", "0.6007527", "0.5983239", "0.5973787", "0.59703416", "0.59688824", "0.5955841", "0.5937179", "0.59355336", "0.59351426", "0.5933708", "0.59331805", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.59276146", "0.5919171", "0.5919171", "0.59098196", "0.5908882", "0.59074485", "0.5903744", "0.5902197", "0.59021384", "0.59000415", "0.58983207", "0.589415", "0.589415", "0.58839566", "0.5878757", "0.58786994", "0.58770657", "0.58757967", "0.5875165", "0.5875165", "0.5875165", "0.5874943", "0.5873107", "0.586965", "0.58647907", "0.58630127", "0.58627987", "0.58613586", "0.58607495", "0.58585256", "0.5855966" ]
0.0
-1
Make everything public because we access it from the outside.
public function __set($property, $value) { $this->{$property} = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPublic() {}", "public function setPublic()\n {\n $this->private = false;\n }", "public static function public(): self {\n return new self(self::PUBLIC);\n }", "public function esPublica()\n {\n return false;\n }", "function isPublic();", "public function init() {\n \n $this->_helper->acl->allow('public',null);\n }", "public function metodo_publico() {\n }", "private function public_hooks()\n\t{\n\t}", "private function metodo_privado() {\n }", "private function private_method() {}", "public function truycapvao_private_cha(){\n }", "public function publicFunction();", "private function privateDummy()\n {\n }", "public function is_public(): bool;", "public function index()\n {\n //private\n }", "public static function right_public(){return false;}", "protected function protectedDummy()\n {\n }", "private function __construct() {\n // <private>\n }", "public function loadPublic()\n {\n // Disable debug, because startup almost complete\n Settings::toggleDebug(false);\n // Load standard public, to be safe require once\n require_once Constants::path_public . '/index.php';\n // Set startup complete, so debug can't enable itself again.\n Constants::$startup_complete = true;\n }", "public function setPrivate()\n {\n $this->private = true;\n }", "public function someStuff()\n {\n \n }", "final public function finalPublicMethod()\n {\n }", "private function __() {\n }", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n // nothing to do here\n }", "private function load_public_styles() {\n\n\t}", "public function usePublicApi()\n {\n $this->level = 'pub';\n\n return $this;\n }", "public function init() {\r\n\t}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function getPrivate(){\n return \"I am a private function\";\n }", "protected function protected_method() {}", "public function __construct() {\n $this->checkAccess();\n }", "public function setPublic($public)\n {\n $this->_public = $public;\n }", "private function __construct () {}", "public static function makePublic()\n {\n $acl = new ACL();\n $acl->addReferrer(self::READ, '*');\n $acl->allowListings();\n\n return $acl;\n }", "public function init(){\n\t}", "public function init(){\n\t}", "public function __init(){}", "public function init() {\n\n\t}", "public function init() {\n\n\t}", "public function isPublic()\n {\n return $this->_public;\n }", "public function protect() {\n\t}", "public function run()\n {\n //leeg private\n\n }", "final private function __construct(){\r\r\n\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 function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.7133353", "0.6917764", "0.6904975", "0.6824424", "0.6743375", "0.66790897", "0.6669116", "0.65659714", "0.6556964", "0.6530521", "0.6448707", "0.6440878", "0.64277667", "0.6375224", "0.63717484", "0.6340395", "0.6311019", "0.62953675", "0.6292711", "0.6260868", "0.6243258", "0.6236109", "0.6221264", "0.62096304", "0.62096304", "0.62096304", "0.62096304", "0.62096304", "0.62090564", "0.6191841", "0.61881506", "0.6171736", "0.61669636", "0.61669636", "0.61669636", "0.61669636", "0.6166474", "0.6166474", "0.6166474", "0.6166474", "0.6166474", "0.6166474", "0.6165605", "0.6165605", "0.6164815", "0.61529344", "0.61504775", "0.6145685", "0.6144918", "0.6143577", "0.6141114", "0.6141114", "0.6140717", "0.6135036", "0.6135036", "0.612256", "0.6114465", "0.6107199", "0.6104465", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982", "0.6103982" ]
0.0
-1
Make everything public because we access it from the outside.
public function __get($property) { return property_exists($this, $property) ? $this->{$property} : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPublic() {}", "public function setPublic()\n {\n $this->private = false;\n }", "public static function public(): self {\n return new self(self::PUBLIC);\n }", "public function esPublica()\n {\n return false;\n }", "function isPublic();", "public function init() {\n \n $this->_helper->acl->allow('public',null);\n }", "public function metodo_publico() {\n }", "private function public_hooks()\n\t{\n\t}", "private function metodo_privado() {\n }", "private function private_method() {}", "public function truycapvao_private_cha(){\n }", "public function publicFunction();", "private function privateDummy()\n {\n }", "public function is_public(): bool;", "public function index()\n {\n //private\n }", "public static function right_public(){return false;}", "protected function protectedDummy()\n {\n }", "private function __construct() {\n // <private>\n }", "public function loadPublic()\n {\n // Disable debug, because startup almost complete\n Settings::toggleDebug(false);\n // Load standard public, to be safe require once\n require_once Constants::path_public . '/index.php';\n // Set startup complete, so debug can't enable itself again.\n Constants::$startup_complete = true;\n }", "public function setPrivate()\n {\n $this->private = true;\n }", "public function someStuff()\n {\n \n }", "final public function finalPublicMethod()\n {\n }", "private function __() {\n }", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n // nothing to do here\n }", "private function load_public_styles() {\n\n\t}", "public function usePublicApi()\n {\n $this->level = 'pub';\n\n return $this;\n }", "public function init() {\r\n\t}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function getPrivate(){\n return \"I am a private function\";\n }", "protected function protected_method() {}", "public function __construct() {\n $this->checkAccess();\n }", "private function __construct () {}", "public function setPublic($public)\n {\n $this->_public = $public;\n }", "public static function makePublic()\n {\n $acl = new ACL();\n $acl->addReferrer(self::READ, '*');\n $acl->allowListings();\n\n return $acl;\n }", "public function init(){\n\t}", "public function init(){\n\t}", "public function __init(){}", "public function init() {\n\n\t}", "public function init() {\n\n\t}", "public function isPublic()\n {\n return $this->_public;\n }", "public function protect() {\n\t}", "public function run()\n {\n //leeg private\n\n }", "final private function __construct(){\r\r\n\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 function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.71316296", "0.6916206", "0.6904269", "0.6822979", "0.67419606", "0.66791105", "0.6668659", "0.6567315", "0.655599", "0.65308005", "0.64492095", "0.644033", "0.64277", "0.6373375", "0.63708216", "0.63399905", "0.6310447", "0.6296023", "0.62909293", "0.62596905", "0.6242225", "0.6235171", "0.62221885", "0.62104243", "0.62104243", "0.62104243", "0.62104243", "0.62104243", "0.62092954", "0.6191686", "0.6187468", "0.61725503", "0.61684096", "0.61684096", "0.61684096", "0.61684096", "0.6167914", "0.6167914", "0.6167914", "0.6167914", "0.6167914", "0.6167914", "0.6167044", "0.6167044", "0.6163934", "0.6152852", "0.61492205", "0.6146139", "0.6143904", "0.614298", "0.61419064", "0.61419064", "0.6141542", "0.6135847", "0.6135847", "0.61200565", "0.6112932", "0.61062837", "0.6105671", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154", "0.6105154" ]
0.0
-1
Laravel compatibility. For your own callbacks it is recommended to use kahlan before/after callbacks.
protected function beforeApplicationDestroyed(callable $callback) { $this->afterEachCallbacks[] = $callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function before() {}", "public function before() {}", "protected function before(){}", "protected function after(){}", "protected function after(){}", "protected function after(){}", "public function after() {}", "public function _before()\n {\n }", "public function before_run() {}", "protected function _after()\n {\n }", "public function after_run() {}", "public function before(\\Closure $before);", "protected function after(){\n\n }", "public function before_run(){}", "protected function _before()\n {\n }", "public function after($callback);", "protected function after()\n {\n }", "protected function after()\n {\n }", "function after_save() {}", "protected function _before()\n\t{\n\t\t\n\t}", "public function before()\n {\n }", "protected function after_foo()\n {\n }", "public function after_run(){}", "abstract protected function after();", "public function afterSave()\n {\n\n }", "protected abstract function before();", "public function before()\n\t{\n\t}", "public function beforeEnd () {\n }", "abstract protected function before();", "public function after(\\Closure $after);", "protected function before()\n {\n }", "protected function after(): void\n {\n }", "public function after()\n\t{\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "function after_create() {}", "public function before($callback)\r\n {\r\n // TODO: Implement before() method.\r\n }", "protected function after() {\n }", "protected function before(): void\n {\n }", "public function onAfterSave();", "abstract function before();", "protected function _after()\n {\n }", "public function __after()\t{\n\t}", "public static function _before() : void {\n\t}", "protected function before() {\n }", "public function afterSetup()\n {\n }", "abstract function after();", "public static function after() {\n\n\t}", "public function after_update() {}", "public function registerCallbacks()\n {\n parent::registerCallbacks();\n }", "function before_save(){}", "public function beforeSetup()\n {\n }", "function after_validation() {}", "public function before()\n {\n }", "public function before()\n {\n }", "public function before()\n {\n }", "protected function before(){\n\n }", "public function before_save() {\n \n }", "public function before_save() {\n \n }", "public static function booted($callback){\n \\Illuminate\\Foundation\\Application::booted($callback);\n }", "protected function beforeMethod()\n {\n }", "public function afterUserMethodAdvice()\n {\n }", "protected function afterSave() {\n\n }", "protected function onBeforeSave()\n {\n }", "public function after()\n {\n }", "public function after()\n {\n }", "public function after()\n {\n }", "public function after()\n {\n }", "public function after()\n {\n }", "public function onBeforeSave();", "public function before(\\Closure $callback)\n {\n $this->affirmCallable($callback, \"before\");\n $this->before = $callback;\n }", "public function boot()\n {\n Event::listen('eloquent.created: *', function($data,$data2) {\n $this->save_event('crear',$data2);\n });\n\n Event::listen('eloquent.updated: *', function($data,$data2) {\n $this->save_event('actualizar',$data2);\n });\n\n Event::listen('eloquent.deleting: *', function($data,$data2) {\n $this->save_event('borrar',$data2);\n });\n }", "public function after_insert() {}", "function before_create() {}", "public function before(Closure $callback)\n\t{\n\t\t$this->globalMiddlewares['before'][] = $callback;\n\t}", "protected static function boot()\n {\n parent::boot();\n\n static::created(function($model)\n {\n //dd($model);\n });\n\n static::updated(function($model)\n {\n //dd($model);\n });\n\n\n }", "public static function boot() {\n parent::boot();\n\n // create a event to happen on updating\n static::updating(function($table) {\n $table->updated_by = Auth::user()->username;\n });\n\n // create a event to happen on saving\n static::creating(function($table) {\n if (Auth::check()){\n $table->created_by = Auth::user()->username;\n }\n });\n }", "public static function bootOnimage(): void\n {\n static::saving(function (Model $model) {\n $model->onimageSavingObserver();\n });\n\n static::saved(function (Model $model) {\n $model->onimageSavedObserver();\n });\n\n// static::deleting(function (Model $model) {\n// return $model->deleteTranslations();\n// });\n//\n// static::retrieved(function (Model $model) {\n// $model->getTranslations();\n// $model->getAvailableTranslations();\n// });\n }", "protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n// static::saved(function ($slider) {\r\n// $slider->saveSlides(request('slides', []));\r\n// $slider->clearCache();\r\n// });\r\n }", "protected function hook_beforeSave(){}", "public static function _after() : void {\n\t}", "public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }", "protected function beforeSave() {\n\n }", "public function boot()\n\t{\n\t\tCategory::creating(function ($category) {\n $category->slug = Helper::slugify($category->name);\n return true;\n });\t\n Product::creating(function ($product) {\n $product->slug = Helper::slugify($product->name);\n return true;\n });\n\n News::creating(function ($news) {\n $news->slug = Helper::slugify($news->name);\n return true;\n });\n\n\n Category::updating(function ($category) {\n $category->slug = Helper::slugify($category->name);\n return true;\n });\t\n\n Product::updating(function ($product) {\n $product->slug = Helper::slugify($product->name);\n return true;\n });\n News::updating(function ($news) {\n $news->slug = Helper::slugify($news->name);\n return true;\n });\t\n\n\n\t}", "public function afterAction() {\n }", "public static function boot()\n {\n parent::boot();\n\n self::created(function ($productProvider) {\n $product = ProductModel::find($productProvider->product);\n if (!$product->franchise){\n $product->updatePrice();\n }\n });\n\n self::updated(function ($productProvider) {\n $product = ProductModel::find($productProvider->product);\n if (!$product->franchise){\n $product->updatePrice();\n }\n });\n }", "public function afterSave(){\n\t}", "public static function boot()\n {\n parent::boot();\n\n if (Auth::check()) {\n // create a event to happen on creating\n static::creating(function ($table) {\n $table->created_by = Auth::user()->id;\n $table->updated_by = Auth::user()->id;\n $table->company_id = 3; //Auth::user()->company_id;\n });\n\n // create a event to happen on updating\n static::updating(function ($table) {\n $table->updated_by = Auth::user()->id;\n });\n }\n }", "public static function boot()\n {\n parent::boot();\n\n if (Auth::check()) {\n // create a event to happen on creating\n static::creating(function ($table) {\n $table->created_by = Auth::user()->id;\n $table->updated_by = Auth::user()->id;\n $table->company_id = 3; //Auth::user()->company_id;\n });\n\n // create a event to happen on updating\n static::updating(function ($table) {\n $table->updated_by = Auth::user()->id;\n });\n }\n }", "function before(\\Closure $closure)\n{\n pho\\before($closure);\n}", "public function beforeSave(){\n\t}", "public function boot()\n {\n Ubication::created(function ($ubication){\n Event::fire(new UbicationCreated($ubication));\n });\n }", "public function testEventCallBackPatch()\n {\n }", "public function before($callback)\n {\n $this->app['events']->listen(Events\\JobProcessing::class, $callback);\n }", "public function before($callback)\n {\n $this->app['events']->listen(Events\\JobProcessing::class, $callback);\n }", "protected function after() {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "public static function boot()\n {\n parent::boot();\n\n // Create uid when creating automation.\n static::creating(function ($event) {\n // Create new uid\n $event->createUid();\n\n // Update custom order\n $event->createCustomOrder();\n });\n\n // Create first campaign when auto event created.\n static::created(function ($event) {\n // Create first campaign\n $event->createFirstCampaign();\n });\n\n // when auto event is deleted\n static::deleting(function ($event) {\n // Update auto campaign series\n $next_event = $event->nextEvent;\n if(is_object($next_event)) {\n $next_event->previous_event_id = $event->previous_event_id;\n $next_event->save();\n }\n\n // Delete all campaigns\n $event->campaigns()->delete();\n });\n }", "public static function boot()\n {\n parent::boot();\n static::deleting(function($obj) {\n\n InvoiceDetail::where('ref_id',$obj->id)->delete();\n\n });\n }", "public function boot()\n {\n Location::saved(function ($location) {\n if ($location->original['home'] != $location->attributes['home']) { //if record has changed\n event(new LocationHomeStateChanged($location));\n }\n });\n\n Location::saved(function ($location) {\n //comparing dates so the carbon comparison is used\n if (Carbon::createFromTimestamp($location->original['last_movement'])->ne(Carbon::createFromTimestamp($location->attributes['last_movement']))) { //if record has changed\n event(new LocationLastMovementChanged($location));\n }\n });\n }", "public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }", "public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }" ]
[ "0.6495536", "0.6495536", "0.6485029", "0.6418024", "0.6418024", "0.6418024", "0.6339981", "0.6322196", "0.6321845", "0.6255866", "0.62441593", "0.6234491", "0.6227883", "0.62154925", "0.6157297", "0.6153621", "0.6068361", "0.6068361", "0.60623664", "0.6039423", "0.60374796", "0.6027728", "0.60260385", "0.6015828", "0.6011315", "0.59910804", "0.5980451", "0.59803253", "0.5974469", "0.5969751", "0.5965152", "0.59637636", "0.59539837", "0.5951026", "0.5951026", "0.5940946", "0.59296066", "0.59212446", "0.5920217", "0.59192634", "0.5915387", "0.5913778", "0.59136415", "0.59036916", "0.58839935", "0.58799124", "0.58767277", "0.5874755", "0.5869136", "0.5865987", "0.5834843", "0.5824801", "0.58192664", "0.5814822", "0.5814551", "0.581442", "0.58001584", "0.57940644", "0.57940644", "0.5789985", "0.5789759", "0.57774556", "0.57679945", "0.5761678", "0.57453483", "0.574457", "0.5744487", "0.5743513", "0.5743513", "0.5734069", "0.5708042", "0.5705965", "0.57045513", "0.5686929", "0.56852955", "0.5671558", "0.566733", "0.56500477", "0.5644524", "0.56442946", "0.5642687", "0.5641345", "0.56407666", "0.5628612", "0.562291", "0.56067485", "0.5603862", "0.5587705", "0.5587705", "0.55808437", "0.5572275", "0.55672085", "0.5563839", "0.5561856", "0.5561856", "0.55530757", "0.55443", "0.5538629", "0.5534867", "0.5507577", "0.5507577" ]
0.0
-1