query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Le asigna la tarea enviada al userId en bonita | public function tomarTarea(){
$id = $this->input->post('id');
$rsp = $this->bpm->setUsuario($id, userId());
$rsp['status'] ? $rsp['user_id'] = userId() : '';
echo json_encode($rsp);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUserId($userId);",
"public function setUserId($userId) {\n $this->userId = $userId;\n }",
"protected function getUserId() {}",
"protected function getUserId() {}",
"function setUserId($userId) {\n\t\treturn $this->setData('userId', $userId);\n\t}",
"function setUserId($userId)\n {\n $this->userId = $userId;\n }",
"public function userId($user);",
"abstract protected function getUserId() ;",
"public function setUserId() {\n $this->user_id = $user_id;\n }",
"private function set_userId(int $userId)\n {\n $this->_id = $userId;\n }",
"public function setUserId($userId) {\n $this->userId = $userId;\n }",
"public function setUserId($userId) {\n $this->userId = $userId;\n }",
"public function setCreatedBy($userID);",
"public function setUserId()\n {\n if(isset($_GET['userId']))\n {\n echo 'const userId = '.$_GET['userId'].';';\n }\n else\n {\n $config = new Config;\n echo 'const userId = '.$config->defaultUser.';';\n }\n }",
"function activateUser($userId);",
"public function setUser($userId) {\n\t\t\t $_SESSION['userId'] = $userId;\n\t\t}",
"private function _savePendingUserIdentity($userId)\n {\n $userData = new stdClass();\n $userData->{User::COLUMN_USERID} = $userId;\n $userData->sessionId = session_id();\n $userData->lastLogin = date('Y-m-d H:i:s');\n Zend_Auth::getInstance()->getStorage()->write($userData);\n }",
"public function getId_user(){\n return $this->id_user;\n }",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserData($userId);",
"public function setUserid($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_90'));\n\t\tif(!Validator::AccountId($value)) throw new Exception(lang('error_90'));\n\t\t\n\t\t$this->_userid = $value;\n\t}",
"function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }"
] | [
"0.685299",
"0.66359013",
"0.6614994",
"0.6614994",
"0.65699494",
"0.6549939",
"0.6530877",
"0.652304",
"0.6479834",
"0.6451907",
"0.6401829",
"0.6401829",
"0.63743633",
"0.6358955",
"0.6298803",
"0.62905884",
"0.6288275",
"0.6238404",
"0.61651033",
"0.61651033",
"0.61651033",
"0.61651033",
"0.61651033",
"0.61651033",
"0.61651033",
"0.61651033",
"0.61651033",
"0.615517",
"0.6145244",
"0.613573"
] | 0.6806322 | 1 |
Check if "height" has been set | public function hasHeight() : bool; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasHeight()\n {\n return $this->height !== null;\n }",
"public function hasImageHeight()\n {\n return $this->image_height !== null;\n }",
"public function isAutoHeight() {\n\t\tif ($this->_height==0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function setHeight($height)\n {\n if(is_numeric($height) && $height > 0)\n {\n $this->height = (int)$height;\n \n return true;\n }\n \n return false;\n }",
"public function setHeight($height) {}",
"function set_height($height) {\n $this->height = $height;\n }",
"public function setHeight($height);",
"public function setHeight($height);",
"protected function checkHeight(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_Height) && $this->_Height !== null && $this->_Height !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_Height} is not a valid value for Height\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}",
"public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}",
"function getHeight() {\n\t\t}",
"public function r_height($value = null)\n {\n $this->r_height = $value;\n }",
"public function testHeightWithInteger()\n {\n $this->box->setHeight(300);\n static::assertEquals(300, $this->box->getHeight());\n }",
"public function isManualHeightMode()\n {\n return ($this->HeightMode == self::HEIGHT_MANUAL);\n }",
"function getHeight();",
"public function getDefaultHeight() : ?float;",
"public function getHeight() {\n $height = false;\n if (isset($this->_height)) {\n $height = $this->_height;\n }\n\n return $height;\n }",
"final public function get_height()\n {\n return $this->height;\n }",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function setHeightAttribute($height = null)\n\t{\n\t\t$this->attributes['height'] = intval($height);\n\t}",
"function get_height() {\n //based on image height\n return $this->_height;\n }",
"public function setHeight($value)\n {\n return $this->setProperty(\"Height\", $value, true);\n }",
"public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }",
"public function testDefaultHeight()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $height = $view->get('height');\n \n $this->assertNull($height);\n }"
] | [
"0.79277056",
"0.7188172",
"0.7042197",
"0.69540477",
"0.69267553",
"0.6717599",
"0.67155147",
"0.67155147",
"0.6697209",
"0.6588197",
"0.6493271",
"0.6438556",
"0.6433856",
"0.6419823",
"0.6398155",
"0.6343338",
"0.63297224",
"0.62741965",
"0.62739795",
"0.62729853",
"0.62729853",
"0.62729853",
"0.62729853",
"0.62729853",
"0.6272496",
"0.62608916",
"0.6246483",
"0.6245865",
"0.6243967",
"0.62245077"
] | 0.7917462 | 1 |
Get a default "height" value, if any is available | public function getDefaultHeight() : ?float; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }",
"public function testDefaultHeight()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $height = $view->get('height');\n \n $this->assertNull($height);\n }",
"public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }",
"final public function get_height()\n {\n return $this->height;\n }",
"function getHeight() {\n\t\t$myHeight = $this->getElementText(DOMIT_RSS_ELEMENT_HEIGHT);\n\n\t\tif ($myHeight == '') {\n\t\t\t$myHeight = '31';\n\t\t}\n\t\telse if (intval($myHeight) > 400) {\n\t $myHeight = '400';\n\t\t}\n\n\t\treturn $myHeight;\n\t}",
"public function initialHeight()\n {\n return $this->setRightOperand(PVar::INITIAL_HEIGHT);\n }",
"public function getHeight()\n\t{\n\t\tif (substr($this->getContainerStyle('height'), -2, 2) != 'px')\n\t\t\treturn false;\n\n\t\treturn intval(substr($this->getContainerStyle('height'), 0, -2));\n\t}",
"public function r_height($value = null)\n {\n $this->r_height = $value;\n }",
"public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }",
"public function getStyleHeight()\n\t{\n\t\tif (!$this->getBox()->isForMeasurement()) {\n\t\t\treturn '0';\n\t\t}\n\t\t$height = $this->getBox()->getStyle()->getRules('height');\n\t\tif ('auto' === $height) {\n\t\t\treturn null;\n\t\t}\n\t\t$percentPos = strpos($height, '%');\n\t\tif (false !== $percentPos) {\n\t\t\t$widthInPercent = substr($height, 0, $percentPos);\n\t\t\t$closestBoxDimensions = $this->getBox()->getClosestBox()->getDimensions();\n\t\t\tif (null !== $closestBoxDimensions->getHeight()) {\n\t\t\t\t$parentHeight = $closestBoxDimensions->getInnerHeight();\n\t\t\t\tif ($parentHeight) {\n\t\t\t\t\treturn Math::percent($widthInPercent, $parentHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn $height;\n\t\t}\n\t\treturn null;\n\t}",
"public function getHeight($width = null) {}",
"public function getHeight($width = null) {}",
"protected function height() {\n return $this->height;\n }",
"public function getHeight() : ?float ;",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getCapHeight() {}",
"public function getCapHeight() {}",
"public function getCapHeight() {}",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->data->height;\n }",
"public function getHeight()\r\n {\r\n return $this->height;\r\n }",
"function getHeight() {\n\t\t}",
"public function getHeight()\n {\n if (null === $this->height && !$this->initialised) {\n $this->refreshDimensions();\n }\n\n if (null === $this->height) {\n $height = getenv('LINES');\n if (false !== $height) {\n $this->height = (int) trim($height);\n }\n }\n\n return $this->height ?: static::DEFAULT_HEIGHT;\n }",
"public function getHeight()\n {\n return $this->height;\n }"
] | [
"0.7458024",
"0.71031207",
"0.7059774",
"0.69578683",
"0.6941431",
"0.69215465",
"0.69151694",
"0.68585867",
"0.6852155",
"0.6851212",
"0.68489146",
"0.68489146",
"0.6848284",
"0.68094987",
"0.6799212",
"0.6799121",
"0.6799121",
"0.6799121",
"0.6799121",
"0.6799121",
"0.67986935",
"0.6751598",
"0.6751598",
"0.6751598",
"0.6744383",
"0.6724125",
"0.670683",
"0.66799605",
"0.66637063",
"0.66302216"
] | 0.83512485 | 0 |
Base constructor for ACL, make acl_user table if exists | public function __construct(array $params = [])
{
$this->getConnect();
if (!empty($params['groupTable'])) {
$this->groupTable = $params['groupTable'];
}
if (!$this->conn->tableExists('acl_user')) {
$this->conn->createTable('acl_user', [
'`id` int(10) unsigned NOT NULL AUTO_INCREMENT',
'`user` int(11) unsigned NOT NULL',
'`role` int(11) unsigned DEFAULT NULL',
'`perm` int(11) unsigned DEFAULT NULL',
'PRIMARY KEY (`id`)'
], 'ENGINE=MyISAM DEFAULT CHARSET=utf8');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n parent::__construct();\n\n $this->setTable(Auth::table('role-user', 'role_user', false));\n }",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->set_table('users');\n\t}",
"public function __construct() {\n parent::__construct();\n Session::tiempo();\n $this->_aclm = $this->loadModel('acl');\n }",
"function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->tableName = \"user\";\n\t\t$this->keyField = \"user_id\";\n\t\t$this->columnNames = array(\"username\", \"password\", \"description\", \"quote\");\n\t}",
"public function init()\n {\n parent::init();\n\n foreach ($this->rules as $rule) {\n if (isset($rule['roles']) && !empty($rule['roles'])) {\n $this->user = Instance::ensure($this->user, User::class);\n break;\n }\n }\n\n foreach ($this->rules as $i => $rule) {\n if (is_array($rule)) {\n $this->rules[$i] = \\Yii::createObject(array_merge([\n 'class' => AccessControlRule::class\n ], $rule));\n }\n }\n }",
"public function __construct()\n\t\t{\n\t\t\t$this->tableName = 'users';\n\t\t\t//$this->id=$id;\n\t\t\tparent::__construct();\n\t\t}",
"public function __construct($table) {\n if(strcmp($table, \"user\") == 0){\n $this->_dbTable = new Application_Model_DbTable_User();\n }\n else{\n $this->_dbTable = new Application_Model_DbTable_Organization();\n }\n \n }",
"public function createAcl() {\r\n\t\t\r\n\t\t// create authorization adapter and load with roles from database\r\n\t\tZend_Registry::set('_acl', new Zend_Acl());\r\n\t\t\r\n\t\t$this->setRoles();\r\n\t\t\r\n\t\t$this->setResources();\r\n\t\t\r\n\t\t$this->setPermissions();\r\n\t}",
"public function __construct()\n\t{\n\t\t/** Parse fields **/\n\t\t//$this->fields = include TABLEBASE.DS.'table_user.php';\n\t\t/** Set primary key **/\n\t\t$this->pk\t = 'id';\n\t\t/** Set name,parent call**/\n\t\tparent::__construct();\n\t}",
"public function __construct()\n {\n $this->addRole(new Zend_Acl_Role('unregistered'))\n ->add(new Zend_Acl_Resource('public'))\n ->add(new Zend_Acl_Resource('error'))\n ->add(new Zend_Acl_Resource('index'))\n ->allow('unregistered', array('public', 'error', 'index'));\n\n // ACL for user\n $this->addRole(new Zend_Acl_Role('user'), 'unregistered')\n ->add(new Zend_Acl_Resource('user'))\n ->allow('user', 'user');\n\n\n // ACL for operatore\n $this->addRole(new Zend_Acl_Role('operatore'), 'unregistered')\n ->add(new Zend_Acl_Resource('operatore'))\n ->allow('operatore', 'operatore');\n\n }",
"public function __construct(Laradmin $laradmin){\n $this->perm=$laradmin->permission;\n \n //Get table access info\n $temp=new UserGroup();\n $this->tableSourceId=Source::getTableSourceIdFromModel($temp);\n unset($temp);\n }",
"public function __construct($options, $authClass = false)\n {\n if ( $authClass !== false ) {\n $this->_authClass = $authClass;\n }\n \n $pattern = '/^tbl/';\n foreach ($this->_cfg['acl'] as $key=>$tbl) {\n if ( preg_match($pattern, $key) ) {\n $options = $this->_fixOptions($key, $options);\n }\n }\n \n // user configuration\n $this->_cfg = self::_arrayMerge($this->_cfg, $options);\n \n // fill names of tables\n $this->tables['user'] = $this->_cfg['auth']['table'];\n $this->tables['group'] = $this->_cfg['acl']['tblgroup'];\n $this->tables['usergroup'] = $this->_cfg['acl']['tblusergroup'];\n $this->tables['resource'] = $this->_cfg['acl']['tblresource'];\n $this->tables['resourceuser'] = $this->_cfg['acl']['tblresourceuser'];\n $this->tables['resourcegroup'] = $this->_cfg['acl']['tblresourcegroup'];\n \n /**\n * constants of system groups\n */\n if ( !defined('AUTHACL_GROUP_SUPERUSER') ) {\n define('AUTHACL_GROUP_SUPERUSER', $this->_cfg['acl']['superuser']);\n }\n if ( !defined('AUTHACL_GROUP_NOTREGISTERED') ) {\n define('AUTHACL_GROUP_NOTREGISTERED', $this->_cfg['acl']['notregisteredusers']);\n }\n if ( !defined('AUTHACL_GROUP_REGISTERED') ) {\n define('AUTHACL_GROUP_REGISTERED', $this->_cfg['acl']['registeredusers']);\n }\n if ( !defined('AUTHACL_ROOTPATH') ) {\n define('AUTHACL_ROOTPATH', $this->_cfg['acl']['rootpath']);\n }\n if ( !defined('AUTHACL_ROOT_DIR') ) {\n define('AUTHACL_ROOT_DIR', dirname(__FILE__));\n }\n \n $_driverPath = AUTHACL_ROOT_DIR . \"/Driver/{$this->_cfg['acl']['driver']}.php\";\n \n if ( !file_exists($_driverPath) ) {\n throw new Exception('Not found driver file ' . $_driverPath);\n }\n \n $_driverClass = \"AuthAcl_Driver_{$this->_cfg['acl']['driver']}\";\n \n $this->_driver = new $_driverClass($this->_cfg);\n $this->_authObj = new $this->_authClass($this->_cfg['auth']['driver'], $this->_cfg['auth'], $this->loginFunction);\n }",
"public function __construct()\n\t{\n\t\t$this->addRole(new Zend_Acl_Role('liv1'))\n\t\t\t ->add(new Zend_Acl_Resource('liv1'))\n\t\t\t ->add(new Zend_Acl_Resource('error'))\n\t\t\t ->add(new Zend_Acl_Resource('index'))\n\t\t\t ->allow('liv1', array('liv1','error','index'));\n\t\t\t \n\t\t// ACL per utente liv2\n\t\t$this->addRole(new Zend_Acl_Role('liv2'), 'liv1')\n\t\t\t ->add(new Zend_Acl_Resource('liv2'))\n\t\t\t ->allow('liv2','liv2')\n ->deny('liv2','liv1',array('login','registrazione'));\n \n // ACL per organizzazione (liv3)\n\t\t$this->addRole(new Zend_Acl_Role('liv3'), 'liv1')\n\t\t\t ->add(new Zend_Acl_Resource('liv3'))\n\t\t\t ->allow('liv3','liv3')\n ->deny('liv3','liv1',array('login','registrazione'));\n\t\t\t\t \n\t\t// ACL per amministratore (liv4)\n\t\t$this->addRole(new Zend_Acl_Role('liv4'), 'liv1')\n\t\t\t ->add(new Zend_Acl_Resource('liv4'))\n ->deny('liv4','liv1',array('login','registrazione'))\n\t\t\t ->allow('liv4','liv4');\n\t}",
"function __construct() {\n // Initialize the dbms pointer.\n AbstractMapper::__construct();\n\n // Initialize table name.\n $this->tableName = \"user_sub_users\";\n }",
"public function __construct()\n {\n parent::__construct();\n\n log_message('debug', 'Auth Model Loaded');\n \n $this->config->load('ag_auth');\n $this->load->database();\n\n $this->user_table = $this->config->item('auth_user_table');\n $this->group_table = $this->config->item('auth_group_table');\n }",
"function __construct() {\r\n parent::__construct();\r\n $this->auth->no_cache();\r\n $this->auth->is_logged_in();\r\n $this->load->model('service_model');\r\n $this->load->model('company_model');\r\n\r\n define(\"USER_ROLE\", $this->auth->get_user_role());\r\n }",
"function __construct()\n\t\t{\n\t\t\tparent::__construct('users', 'user_id');\n\t\t}",
"public function __construct()\n {\n $this->acl = new Zend_Acl();\n }",
"public function __construct() {\n //parent::__construct();\n\n $model = new AclModel();\n //$sections = new Sections();\n $privileges = new PrivilegesModel();\n $roles = new Roles();\n\n $this->recursiveRolesFill($roles->getTree());\n\n foreach($privileges->getResourcesArray() as $name)\n {\n $this->addResource($name);\n }\n\n foreach($model->getRules() as $rule)\n {\n $this->allow($rule->role, $rule->resource, $rule->privilege);\n }\n }",
"public function __construct() {\n if (($this->role = self::$cache->get_value(self::ROLE_KEY)) === false) {\n self::$db->prepared_query(\"\n SELECT slug, artist_role_id, sequence, name, title, collection\n FROM artist_role\n ORDER BY artist_role_id\n \");\n $this->role = self::$db->to_array('slug', MYSQLI_ASSOC, false);\n self::$cache->cache_value(self::ROLE_KEY, $this->role, 86400 * 30);\n }\n }",
"protected function __construct() {\r\n\r\n\t\tself::$_bUseCache = (Kwgl_Config::get(array('mode', 'cache', 'acl')) == 1);\r\n\r\n\t\t$this->_initRoles();\r\n\t\t$this->_initResources();\r\n\t\t$this->_initPermissions();\r\n\t}",
"public function __construct($table = \"users\") {\n\t\tparent::__construct();\n\n\t\tif(DataBase::tableExists(PREFIX . $table))\n\t\t\t$this->_table = PREFIX . $table;\n\t\telse\n\t\t\t$this->errorTableDontExist(PREFIX . $table);\n\t}",
"function __construct()\n {\n\t\tparent::__construct();\n\t if(!$this->session->userdata('uid'))\n\t { \n\t\t\tredirect('home');\n\t }\n\t\telse\n\t\t{\n\t\t\t$this->loginuser = $this->Admin_mo->getrow('users',array('uid'=>$this->session->userdata('uid')));\n\t\t}\n\t}",
"public function __construct() {\n $this->sessionManager = new SessionManager;\n $this->router = new Router;\n\n $config = Config::auth();\n $this->setIdUserColumn($config['idUserColumn']);\n $this->setnameUserColumn($config['nameUserColumn']);\n $this->setUserColumn($config['userColumn']);\n $this->setPassColumn($config['passColumn']);\n $this->setLoginController($config['afterAuth']);\n $this->setLogoutController('auth');\n $this->setSessionUserAuth('userAuth');\n $this->setSessionUserInfo('userInfo');\n\n return $this;\n }",
"function __construct()\n {\n $this->tablename = 'tmst_admin';\n \n\t\t$this->fieldlist = array('id_admin','user','pass');\n \n\t\t$this->sql_orderby = 'user';\n\t\t\n\t\t$this->fieldlist['id_admin'] = array('pkey' => 'y');\n\t\t$this->fieldlist['user'] = array('pkey' => 'y');\n\t\t \n\t\t\t\t\n }",
"public function __construct(){\n\t\t\tglobal $db_user;\n\t\t\tparent::__construct($db_user['module']);\n\t\t\t\n\t\t}",
"function __construct()\n {\n $this ->user = User::createInstance();\n }",
"public function __construct() {\n\n $conn = new UserAccount();\n\n if(!$conn->access()) {\n\n $log = new AppLog();\n\n $log->database_log();\n\n }\n\n }",
"public function __construct(){\n $this->table=\"usuarios\";\n parent::__construct($this->table);\n }",
"public function __construct()\n\t{\n\t\tparent::__construct(\"user\");\n\t}"
] | [
"0.72143686",
"0.69024247",
"0.67649955",
"0.6761334",
"0.6641306",
"0.66311324",
"0.6613149",
"0.6567813",
"0.6566103",
"0.6546025",
"0.6545018",
"0.65067434",
"0.6463405",
"0.6455936",
"0.6453794",
"0.6449627",
"0.64205694",
"0.6415868",
"0.6403942",
"0.6382757",
"0.6358371",
"0.62853837",
"0.62823564",
"0.62698954",
"0.6249002",
"0.6208624",
"0.61992747",
"0.6187561",
"0.6185866",
"0.61857796"
] | 0.6976669 | 1 |
Get Products by criteria. | public function getProducts($criteria = [])
{
if (!$criteria instanceof ElementCriteriaModel) {
$criteria = craft()->elements->getCriteria('DigitalProducts_Product', $criteria);
}
return $criteria->find();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }",
"function getProducts()\n {\n $db = $this->getPearDb();\n\n // The query is big, but it does use indexes. Anyway, the involved\n // tables almost never change, so we utilize MySQL's query cache\n $sql = \"(\n # User permissions\n SELECT DISTINCT pe_u.parameterValue AS productId\n FROM user u\n JOIN permission pe_u\n ON pe_u.doerId = u.id\n AND pe_u.allowed = '1'\n AND pe_u.actionId = 6 # 6 = use_product\n WHERE u.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Customer permissions\n SELECT DISTINCT pe_c.parameterValue AS productId\n FROM permission pe_c\n WHERE pe_c.doerId = \" . $this->id . \"\n AND pe_c.allowed = '1'\n AND pe_c.actionId = 6 # 6 = use_product\n\n ) UNION (\n\n SELECT productId\n FROM site s\n WHERE s.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Kollage is always on\n SELECT 1\n\n )\";\n $productIds = $db->getCol($sql);\n $productIds = array_filter(array_unique($productIds), 'intval');\n\n $product = new Vip_Product;\n $product->columnIn('id', $productIds);\n // Customer-specific products are only enabled for that customer.\n $product->addWhereSql('customerId IN (0, ' . $this->id . ')');\n $product->setOrderBySql('sortOrder,title');\n $products = $product->findAll();\n foreach ($products as $product) {\n $product->setCustomer($this);\n }\n\n return $products;\n }",
"public function getBy(array $criteria);",
"protected function products()\n {\n return Product::enabled()->withImages()\n ->where('title', 'like', \"%{$this->query}%\")\n ->orWhere('description', 'like', \"%{$this->query}%\")\n ->orderBy('updated_at', 'desc')\n ->get();\n }",
"public function getMatchingProduct($request);",
"public function getProducts($params, $request);",
"public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }",
"public function getProducts($columns=null, $conditions=null){\n return $this->productsRepository->getProducts($columns, $conditions);\n }",
"public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}",
"public function getProducts(){\n\t\t$user = Auth::user();\n\t\tif($user->hasRole('admin')){\n\t\t\t$products = Product::all();\n\t\t}\n\t\telse if($user->hasRole('distributor') || $user->hasRole('sub_distributor')){\n\t\t\t$products = Product::where('days', '!=', 0)->get();\n\t\t}\n\t\treturn $products;\n\t}",
"public function getSpecific()\n {\n $qb = $this->em->createQueryBuilder();\n $results = $qb->select('p')\n ->from('Plugin\\DoctrineExample\\Entity\\Product', 'p')\n ->orderBy('p.title', 'ASC')->getQuery()->execute();\n return $results;\n }",
"public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}",
"public function findBy($criteria);",
"public function findBy($criteria);",
"public function getProducts($conditionsQuery=\"1\"){\n $products=Db::query(\"SELECT * FROM \".PRODUCT_TABLE_NAME.\" WHERE id IN ( SELECT product_id FROM \".CATEGORY_PRODUCT_TABLE_NAME.\" WHERE category_id='$this->categoryId') AND $conditionsQuery\");\n\n if($products=$products->fetchAll(PDO::FETCH_NAMED)){\n return $products;\n }else{\n return false;\n }\n }",
"public static function getProducts($options = array()) {\n $perPage = isset($options['perPage']) ? $options['perPage'] : config('app.paging');\n \n $obj = static::with(['ratingArr'])->where('status', '=', 'active')->orderBy('id')->paginate($perPage);\n return $obj;\n }",
"function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }",
"public function products($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'products', $_query);\r\n }",
"public function getItemsCriteria() {}",
"public function getItemsCriteria() {}",
"public static function doSelect(Criteria $criteria, PropelPDO $con = null)\n {\n return GsGeneriekeProductenPeer::populateObjects(GsGeneriekeProductenPeer::doSelectStmt($criteria, $con));\n }",
"public function getCriteria();",
"public function findProduct(Request $request)\n {\n $user = auth()->user();\n $limite = 3;\n if ($request->limit) {\n $limite = 10;\n }\n $product = '%'.$request->product.'%';\n $products = DB::select('SELECT products.name,products.id,\n products.code,products.price\n FROM products\n INNER JOIN users ON users.id = products.created_by_id\n WHERE products.name LIKE ? OR products.code LIKE ? AND users.organization_id = ? LIMIT ?',\n [$product,$product,$user->organization_id,$limite]);\n if ($request->limit) {\n $returnHTML = view('product.searchedDataModal',['products'=> $products])->render();\n } else {\n $returnHTML = view('product.searchedData',['products'=> $products])->render();\n }\n return response()->json(array('success' => true, 'html'=>$returnHTML));\n }",
"public function getMatchingProductForId($request);",
"public function get_product($conditions = array()) {\n $this->db->select(array('product.product_id', 'product.name', 'product.url_slug', 'product.description', 'product.price', 'product.image', 'product.product_id', 'product_category.name as category_name', 'product.product_category_id','product_category.url_slug as product_category_url_slug', 'product.product_type_id','product_sizes.size_id as size_id','product_sizes.price as menu_price','sizes.sizes as size'));\n $this->db->from('product');\n $this->db->join('product_category', 'product_category.product_category_id = product.product_category_id');\n $this->db->join('product_sizes', 'product_sizes.product_id = product.product_id','left');\n $this->db->join('sizes', 'product_sizes.size_id = sizes.id','left');\n \n if (!empty($conditions)) {\n $this->db->where($conditions);\n }\n\n $this->db->where(array('product.status' => 1, 'product.deleted' => 0, 'product_category.status' => 1, 'product_category.deleted' => 0));\n\n return $this->db->get()->result_array();\n }",
"public function ProductSearch() {\n\t\t\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$seller_id\t\t\t=\t$search_data['seller_id'];\n\t\t\n\t\t$querydata \t\t= \t$this->_objectManager->create('Webkul\\Marketplace\\Model\\Product')\n\t\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'seller_id',\n\t\t\t\t\t\t\t\t\t['eq' => $seller_id]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'status',\n\t\t\t\t\t\t\t\t\t['eq' =>1]\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->addFieldToSelect('mageproduct_id')\n\t\t\t\t\t\t\t\t->setOrder('mageproduct_id');\n\t\t\t//return \t$querydata->getData();\t\t\t\t\n\t\t\t$collection = $this->_productCollectionFactory->create()->addAttributeToSelect(\n '*'\n );\n\t\t$collection->addAttributeToFilter('entity_id', array('in' => $querydata->getData()));\n\t\t$collection->addAttributeToFilter('name', array('like' => '%'.$search_term.'%'));\n\t\t\t\n\t\treturn $collection->getData();\n\t\t\t\n }",
"function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}",
"public function getProduct();",
"function get_product_by ( $conds = array(), $limit = false, $offset = false ){\n\n\t\t//where clause\n\t\t$this->db->select('rt_products.*, count(rt_touches.type_id) as t_count'); \n \t\t$this->db->from('rt_products');\n \t\t$this->db->join('rt_touches', 'rt_products.id = rt_touches.type_id');\n \t\t$this->db->where('rt_touches.type_name','product');\n \t\t$this->db->where('rt_products.status',1);\n \t\t$this->db->where('rt_touches.shop_id',$conds['shop_id']);\n\n \t\tif ( isset( $conds['cat_id'] )) {\n\t\t\tif ($conds['cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.cat_id', $conds['cat_id'] );\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\tif ($conds['sub_cat_id'] != \"\" ) {\n\t\t\t\tif ($conds['sub_cat_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.sub_cat_id', $conds['sub_cat_id'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n \t\t\n\t\tif ( isset( $conds['search_term'] ) || isset( $conds['date'] )) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\t }\n\n \t\t$this->db->group_by('rt_touches.type_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n \t\t$this->db->order_by('rt_touches.added_date', \"desc\");\n \t\t\n\n \t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n \t\treturn $this->db->get();\n \t\t//print_r($this->db->last_query());die;\n\n\t}",
"function getProducts($name, $categoryID, $salePriceMin, $salePriceMax, $basePriceMin, $basePriceMax)\n{\n global $conn;\n \n $sql = \"SELECT * FROM product WHERE 1=1 \";\n \n if (!empty($name))\n {\n $sql .= \" AND Name LIKE :productName\";\n $namedParameters[\":productName\"] = \"%\" . $name . \"%\";\n }\n \n if (!empty($categoryID))\n {\n $sql .= \" AND CategoryId = :categoryId\";\n $namedParameters[\":categoryId\"] = $categoryID;\n }\n \n if (!empty($salePriceMin) AND !empty($salePriceMax))\n {\n $sql .= \" AND SalePrice >= :salePriceMin AND SalePrice <= :salePriceMax \";\n $namedParameters[\":salePriceMin\"] = $salePriceMin;\n $namedParameters[\":salePriceMax\"] = $salePriceMax;\n }\n \n if (!empty($basePriceMin) AND !empty($basePriceMax))\n {\n $sql .= \" AND BasePrice >= :basePriceMin AND BasePrice <= :basePriceMax\";\n $namedParameters[\":basePriceMin\"] = $basePriceMin;\n $namedParameters[\":basePriceMax\"] = $basePriceMax;\n }\n \n $sql .= \" ORDER BY Name\";\n \n $stmt = $conn->prepare($sql);\n $stmt->execute($namedParameters);\n $records = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $records;\n}"
] | [
"0.69840455",
"0.6899192",
"0.68462396",
"0.6755407",
"0.64861655",
"0.64771706",
"0.64566725",
"0.64454293",
"0.6435958",
"0.64082193",
"0.6389446",
"0.63621557",
"0.635936",
"0.635936",
"0.634835",
"0.6339017",
"0.6320012",
"0.628246",
"0.6265285",
"0.626525",
"0.6254374",
"0.62366825",
"0.6225268",
"0.62247837",
"0.6208329",
"0.619911",
"0.6184802",
"0.61792856",
"0.6178653",
"0.6171265"
] | 0.70282626 | 0 |
Creates a form to delete a SvCfgCalzadaCarril entity. | private function createDeleteForm(SvCfgCalzadaCarril $svCfgCalzadaCarril)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('svcfgcalzadacarril_delete', array('id' => $svCfgCalzadaCarril->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Contabilizar $contabilizar)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('contabilizar_delete', array('id' => $contabilizar->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(SvCfgDisenio $SvCfgDisenio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Svcfgdisenio_delete', array('id' => $SvCfgDisenio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Caisse $caisse)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caisse_delete', array('id' => $caisse->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Etat_civil $etat_civil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('etat_civil_delete', array('id' => $etat_civil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Cancion $cancion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cancion_delete', array('id' => $cancion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(EcoCardiogramaTransesofagico $ecoCardiogramaTransesofagico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ecocardiogramatransesofagico_delete', array('id' => $ecoCardiogramaTransesofagico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Cargaison $cargaison)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cargaison_delete', array('id' => $cargaison->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n $translated = $this->get('translator');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configuracao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $translated->transChoice('txt.excluir',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-danger btn-lg')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Feuil $feuil)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('feuil_delete', array('id' => $feuil->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm1($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('calendarcategories_delete', array('id' => $id)))\n ->setMethod('DELETE')\n /* ->add('submit', 'submit', array('label' => 'Delete')) */\n ->getForm()\n ;\n }",
"protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"private function createDeleteForm(Cahierdescharges $cahierdescharge) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cahierdescharges_delete', array('id' => $cahierdescharge->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Clasificaciontg $clasificaciontg)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clasificaciontg_delete', array('id' => $clasificaciontg->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Centro $centro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('centro_delete', array('id' => $centro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(ActividadAcademica $actividadAcademica)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('delete_actividadacademica', array('actividadAcademica' => $actividadAcademica->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Complect $complect)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclature_complect_delete', array('id' => $complect->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Cours $listeCour)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('listecours_delete', array('id' => $listeCour->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(CfgTipoAlerta $cfgTipoAlertum)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cfgtipoalerta_delete', array('id' => $cfgTipoAlertum->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(TblCursosDocentes $tblCursosDocente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tblcursosdocentes_delete', array('id' => $tblCursosDocente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Caso $caso)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caso_delete', array('id' => $caso->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm ( Maileguak $maileguak )\n {\n return $this->createFormBuilder()\n ->setAction( $this->generateUrl( 'maileguak_delete', array ('id' => $maileguak->getId()) ) )\n ->setMethod( 'DELETE' )\n ->getForm();\n }",
"private function createDeleteForm(Sous_categorie $sous_categorie)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sous_categorie_delete', array('id' => $sous_categorie->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}",
"private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }",
"private function createDeleteForm(Clatesal $clatesal)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clatesal_delete', array(\n\n 'clasificacion' => $clatesal->getClasificacion()->getId(),\n 'categoria'=>$clatesal->getCategoria()->getId(),\n 'tiempoDedicacion'=>$clatesal->getTiempoDedicacion()->getId(),\n\n )))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(ArmasMedico $armasMedico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('armasmedico_delete', array('id' => $armasMedico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }"
] | [
"0.7063467",
"0.69667834",
"0.67409843",
"0.6692823",
"0.66592586",
"0.6619199",
"0.6614296",
"0.6583932",
"0.6559359",
"0.6527039",
"0.65194976",
"0.6517043",
"0.65096676",
"0.64998555",
"0.6472747",
"0.64585733",
"0.64558613",
"0.64399177",
"0.6433952",
"0.64223593",
"0.641798",
"0.6404937",
"0.639871",
"0.63863975",
"0.6382619",
"0.63664633",
"0.6361736",
"0.6352224",
"0.63419145",
"0.633277"
] | 0.79635614 | 0 |
Get event info by URI. | function GetEventByURI($uri_path = '')
{
if ( ! $uri_path) {
return false;
}
$data = $this->db
->join('status', 'status.id_status = event.id_status', 'left')
->join('event_detail', 'event_detail.id_event = event.id_event', 'left')
->join('localization', 'localization.id_localization = event_detail.id_localization', 'left')
->where('is_delete', 0)
->where('publish_date <=', $this->date_now)
->where("(expire_date >= '{$this->date_now}' OR expire_date IS NULL || expire_date = '0000-00-00')")
->where("LCASE({$this->db->dbprefix('event')}.uri_path)", strtolower($uri_path))
->where("LCASE({$this->db->dbprefix('status')}.status_text)", "publish")
->where("LCASE({$this->db->dbprefix('localization')}.iso_1)", $this->lang->get_active_uri_lang())
->order_by('event.id_event', 'desc')
->limit(1)
->get('event')
->row_array();
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEvent();",
"private function getEventByUri($uri, $calendarId){\n\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(DavEvent::model(),'d')\n\t\t\t->addCondition('calendar_id', $calendarId)\n\t\t\t->addCondition('uri', $uri,'=','d');\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t->single()\n\t\t\t->join(DavEvent::model()->tableName(),$joinCriteria, 'd')\n\t\t\t->criteria($whereCriteria);\n\t\t\n\t\treturn \\GO\\Calendar\\Model\\Event::model()->find($findParams);\n\t}",
"public function getEvent()\n {\n // get event\n $this\n ->get('/event')\n ->assertStatus(200);\n }",
"public function getEventDetail()\n {\n // get event detail\n $this\n ->get('/event/detail/'.$this->event->id)\n ->assertStatus(200);\n }",
"public function get($uri);",
"public function getEvent()\n {\n $headers = $this->getHeaders();\n return isset($headers['X-NE-Event']) ? $headers['X-NE-Event'] : null;\n }",
"public function getEvent()\n {\n return $this->getData('event');\n }",
"private function loadEvent()\n {\n $api_event = $this->product->getWebUrlApi() . \"segments?_sort=id&_order=desc&_start=0&_end=26&is_displayed=1\";\n $api_event = $this->httpClient->get($api_event);\n $api_event = json_decode($api_event->getRawBody(), true);\n return $api_event;\n }",
"public static function get_event_basic_eid($eid) {\n\t\t\t// #1 default value\n\t\t\t$event = array(\n\t\t\t\t\t\t 'url' => '',\n\t\t\t\t\t\t 'image' => DefaultImage::Event. '_small.jpg',\n\t\t\t\t\t\t 'image_large' => DefaultImage::Event.'_large.jpg', \n\t\t\t\t\t\t 'alt' => '', \n\t\t\t\t\t\t 'title' => ''\n\t\t\t\t\t\t );\n\t\t\t\n\t\t\t// #2 get event basic info\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('SELECT logo, title FROM event WHERE eid=? LIMIT 1;');\n\t\t\t$stmt->bind_param('i', $eid);\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result();\n\t\t\tif ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n\t\t\t\t$event['url'] = 'event?eid='.$eid;\n\t\t\t\tif (!empty($row['logo'])) \n\t\t\t\t{\n\t\t\t\t\t$event['image'] = $row['logo'].'_small.jpg';\n\t\t\t\t\t$event['image_large'] = $row['logo'].'_large.jpg';\n\t\t\t\t}\n\t\t\t\t$event['alt'] = strip_tags($row['title']);\n\t\t\t\t$event['title'] = strip_tags($row['title']);\n\t\t\t}\n\t\t\t$stmt->close();\n\t\t\treturn $event;\n\t\t}",
"public function getURI();",
"function detail_events($url)\n {\n $query = $this->db->query(\"SELECT * FROM tbl_events as a JOIN tbl_users as b ON a.user_id = b.id_user WHERE a.slug = '$url'\");\n\n if($query->num_rows() > 0)\n {\n return $query->row();\n }else\n {\n return NULL;\n }\n }",
"public function getEvent($event_uri, $verbose = true)\n {\n $params = [];\n if ($verbose) {\n $params['verbose'] = 'yes';\n }\n\n $event_list = (array)json_decode($this->apiGet($event_uri, $params));\n if (isset($event_list['events']) && isset($event_list['events'][0])) {\n $event = new EventEntity($event_list['events'][0]);\n $this->eventDb->save($event);\n\n foreach ($event->getHosts() as $hostsInfo) {\n if (isset($hostsInfo->host_uri)) {\n $hostsInfo->username = $this->userApi->getUsername($hostsInfo->host_uri);\n $hostsInfo->entity = $this->userApi->getUser($hostsInfo->host_uri);\n }\n }\n return $event;\n }\n\n return false;\n }",
"public function getEvent() {\n $request = $this->getRequest();\n\n if (request('type') == 'event_callback') {\n $event = $request['event'];\n } else {\n $event = $request;\n }\n\n return $event;\n }",
"public function getEvent($name, $method = HTTP_METH_GET)\n {\n $url = '/events/' . $name . '.json';\n return $this->send($url, $method);\n }",
"abstract public function getUri();",
"public static function event() {\n return self::service()->get('events');\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent()\n {\n return $this->event;\n }",
"public function getEvent() {\n return $this->event;\n }",
"public function getCollection($uri, array $queryParams = [])\n {\n $events = (array)json_decode($this->apiGet($uri, $queryParams));\n $meta = array_pop($events);\n\n $collectionData = [];\n foreach ($events['events'] as $item) {\n $event = new EventEntity($item);\n\n foreach ($event->getHosts() as $hostsInfo) {\n if (isset($hostsInfo->host_uri)) {\n $hostsInfo->username = $this->userApi->getUsername($hostsInfo->host_uri);\n }\n }\n\n $collectionData['events'][] = $event;\n\n // save the URL so we can look up by it\n $this->eventDb->save($event);\n }\n $collectionData['pagination'] = $meta;\n\n return $collectionData;\n }",
"public function getEvent()\n {\n $event = array(\n \"eid\" => $this->eid,\n \"name\" => $this->name,\n \"venue\" => $this->venue,\n \"date\" => $this->date,\n \"time\" => $this->time,\n \"type\" => $this->type,\n \"status\" => $this->status\n );\n return $event;\n }",
"public function getEvent($eventId)\n {\n $url = '/events/' . $eventId;\n\n $response = $this->request($url);\n\n $dataWrapper = $this->contentHandler->getEventDataWrapper($response);\n\n return $dataWrapper->getData()->get(0);\n }",
"protected function getEvent(string $event) {\n return $this\n ->mailjet_webhook_events()\n ->where('event', $event)\n ->orderBy('created_at', 'desc')\n ->first();\n }",
"public function getEvent()\n {\n return isset($this->event) ? $this->event : null;\n }",
"public function getUri() {}",
"public function getUri() {}",
"public function getEvent($id)\n {\n\n $cached = $this->getFromCache('event_cache_'.$id);\n if ($cached !== null) {\n return $cached;\n }\n\n // Fetch, event, checkins and RSVPs (only the latter has pictures)\n $event = $this->client->getEvent(array('id' => $id));\n\n $rsvps = $this->client->getRSVPs(\n array('event_id' => $id, 'rsvp' => 'yes', 'order' => 'name', 'fields' => 'host', 'page' => 300)\n );\n\n $event = $event->toArray();\n $event['checkins'] = array();\n $event['rsvps'] = array();\n foreach ($rsvps as $rsvp) {\n $event['rsvps'][] = array(\n 'id' => $rsvp['member']['member_id'],\n 'name' => $rsvp['member']['name'],\n 'photo' => isset($rsvp['member_photo']) ? $rsvp['member_photo'] : null,\n 'host' => $rsvp['host']\n );\n }\n\n $this->saveInCache('event_cache_'.$id, $event);\n\n return $event;\n }",
"abstract public function getEventName();",
"public function getEvent() {\n\t}"
] | [
"0.6369309",
"0.62550056",
"0.61440885",
"0.6005824",
"0.58997524",
"0.5811434",
"0.5769192",
"0.5727823",
"0.5696106",
"0.56900805",
"0.566711",
"0.5621523",
"0.5589314",
"0.555214",
"0.5516269",
"0.5495286",
"0.548315",
"0.548315",
"0.548315",
"0.5454822",
"0.5448647",
"0.54152685",
"0.541471",
"0.5399902",
"0.5368285",
"0.53661126",
"0.53661126",
"0.5327683",
"0.5317434",
"0.53146964"
] | 0.69409263 | 0 |
Get the default editing service. | public function get() {
$editing_service = new DefaultPlaceEditingService(
$this->commandBus,
$this->uuidGenerator,
$this->placeJsonLdRepository,
$this->placeCommandFactory,
$this->placeRepository
);
if ($this->config->get('publication_date')) {
$publicationDate = \DateTimeImmutable::createFromFormat(
'Y-m-d H:i:s',
(string) $this->config->get('publication_date') . ' 00:00:00'
);
$editing_service = $editing_service->withFixedPublicationDateForNewOffers($publicationDate);
}
return $editing_service;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getService ()\n {\n if (null === $this->_service) {\n $this->setService('Default_Service_Spirit');\n }\n return $this->_service;\n }",
"protected function getRouting_ResourcesLocator_DefaultService()\n {\n return $this->services['routing.resources_locator.default'] = new \\phpbb\\routing\\resources_locator\\default_resources_locator('./../', 'production', ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'});\n }",
"public function get_service() {\n\n\t\treturn $this->provider_instance;\n\t}",
"protected function getA2lixTranslationForm_Default_Service_TranslationService()\n {\n return $this->services['a2lix_translation_form.default.service.translation'] = new \\A2lix\\TranslationFormBundle\\TranslationForm\\TranslationForm($this->get('form.registry'), $this->get('doctrine'));\n }",
"function get_default_page_to_edit()\n {\n }",
"protected function getVictoireBlog_ArticleSettings_Form_TypeService()\n {\n return $this->services['victoire_blog.article_settings.form.type'] = new \\Victoire\\Bundle\\BlogBundle\\Form\\ArticleSettingsType($this->get('doctrine.orm.default_entity_manager'));\n }",
"protected function getSwiftmailer_Mailer_DefaultService()\n {\n return $this->services['swiftmailer.mailer.default'] = new \\Swift_Mailer($this->get('swiftmailer.mailer.default.transport'));\n }",
"protected function getA2lixTranslationForm_Default_Type_TranslatedentityService()\n {\n $this->services['a2lix_translation_form.default.type.translatedentity'] = $instance = new \\A2lix\\TranslationFormBundle\\Form\\Type\\TranslatedEntityType();\n\n $instance->setRequest(NULL);\n\n return $instance;\n }",
"public function getContentService(){\n if(null === $this->contentService)\n $this->contentService = $this->getServiceLocator()->get('content_service');\n return $this->contentService;\n }",
"public function getSlideService(){\n if(null === $this->slideService)\n $this->slideService = $this->getServiceLocator()->get('slide_service');\n return $this->slideService;\n }",
"protected function getWorkspaceService() {}",
"protected function getWorkspaceService() {}",
"protected function getEditModule() {}",
"public function service()\r\n {\r\n return $this->service;\r\n }",
"public function getService()\n {\n\n if (preg_match('/^2\\./', $this->getVersion())) {\n $service = 'get';\n } else {\n $service = 'objects';\n }\n\n return $service;\n\n }",
"public function service() {\n return $this->service;\n }",
"public function getServiceLocator()\n {\n if (empty($this->serviceLocator)) {\n $class = $this->defaultServiceLocator;\n $this->serviceLocator = new $class();\n }\n\n return $this->serviceLocator;\n }",
"public function getUpdateForm()\n {\n return new UpdateBlogFormService;\n }",
"public function getEditingThemeId()\n {\n $theme = \\Phpfox::model('layout_theme')\n ->select()\n ->where('is_editing=?', 1)\n ->first();\n\n if (!empty($theme)) {\n return $theme->getId();\n }\n\n return 'default';\n }",
"public function getEdit()\n\t{\n\t}",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function edit(Service $service)\n {\n //\n }",
"public function edit(Service $service)\n {\n //\n }",
"public function edit(Service $service)\n {\n //\n }",
"public function edit(Service $service)\n {\n //\n }",
"public function service()\n {\n return $this->service;\n }",
"protected function service()\n {\n return new Service();\n }",
"protected function getA2lixTranslationForm_Default_Type_TranslationsformsService()\n {\n return $this->services['a2lix_translation_form.default.type.translationsforms'] = new \\A2lix\\TranslationFormBundle\\Form\\Type\\TranslationsFormsType($this->get('a2lix_translation_form.default.service.translation'), $this->get('a2lix_translation_form.default.listener.translationsforms'), $this->get('a2lix_translation_form.default.service.parameter_locale_provider'));\n }",
"public function getService()\n {\n return null;\n }",
"abstract function get_crud_service();"
] | [
"0.6098191",
"0.60196674",
"0.5873266",
"0.58377963",
"0.5827025",
"0.55958503",
"0.5575934",
"0.55286473",
"0.55135185",
"0.5478375",
"0.54738855",
"0.54738855",
"0.5472626",
"0.545844",
"0.54470694",
"0.5445974",
"0.5443236",
"0.54409003",
"0.54353774",
"0.5422558",
"0.54094696",
"0.53951323",
"0.53951323",
"0.53951323",
"0.53951323",
"0.5395039",
"0.53878796",
"0.53774905",
"0.5375372",
"0.5371965"
] | 0.7202705 | 0 |
Get all templates from DB | public function getTemplatesFromDB(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllTemplates(){ //return all templates in database to the select to choose from templates\n return TemplatesResource::collection(TemplateProject::all());\n }",
"public function getTemplates(){\n\t\n\t\tif( empty($this->_templates) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 't.tmpl_id AS value, t.tmpl_name AS text' );\n\t\t\t$query->from( '#__zbrochure_templates AS t' );\n\t\t\t$query->where( 't.tmpl_published = 1' );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_templates = $this->_db->loadObjectList();\n\n\t\t}\n\t\t\n\t\treturn $this->_templates;\n\t\n\t}",
"function getTemplates() {\n\n // Lets load the data if it doesn't already exist\n if (empty($this->_data)) {\n\n // constructs the query\n $query = ' SELECT * '\n . ' FROM #__templateck';\n\n // retrieves the data\n $this->_data = $this->_getList($query);\n }\n\n return $this->_data;\n }",
"function ListTemplates()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $Config;\r\n\t\t\t\r\n\t\t\t$sql = \"select * from templates order by TemplateDisplayName asc\" ; \r\n\t\t\treturn $this->get_results($sql);\t\t\r\n\t }",
"public function index() {\n $templates = Template::all();\n return $templates;\n }",
"public function getAllSMSTemplates()\n {\n $selectTempsql = 'SELECT temp_id, temp_name FROM ' . _DB_PREFIX_ . 'onehop_sms_templates';\n $selectTempsql .= ' WHERE 1 Order By temp_name ASC';\n $templateRes = Db::getInstance()->ExecuteS($selectTempsql);\n return $templateRes;\n }",
"public function getAllTemplates() {\n $pages = Templates::templates()->get();\n\n return response()->json($pages);\n }",
"public function get_templates()\n {\n $template = new MailTemplate();\n return $template->findAll();\n }",
"public function getAllSlideTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:SlideTemplate')\n ->findAll();\n }",
"function getAllPageTemplates() {\n global $wpdb;\n return $wpdb->get_col(\"SELECT DISTINCT meta_value FROM wp_postmeta WHERE meta_key = '_wp_page_template'\"); \n }",
"function customcert_get_templates() {\n global $DB;\n\n return $DB->get_records_menu('customcert_template', array(), 'name ASC', 'id, name');\n}",
"public function getTemplates()\n {\n return $this->hasMany(Template::className(), ['atk_id' => 'id']);\n }",
"public function getTemplates()\n {\n $finder = Finder::create()\n ->files()\n ->name('*.sql')\n ->in($this->rootDir.'/../templates')\n ;\n\n $templates = [];\n\n /** @var SplFileInfo $file */\n foreach ($finder as $file) {\n $templates[] = $file->getRelativePathname();\n }\n\n return $templates;\n }",
"protected function getTemplates()\r\n\t{\r\n\t\t$templates = array();\r\n\t\tforeach ($this->getProjectDao()->getAllModelTemplates() as $template)\r\n\t\t\t$templates[$template->ID] = $template->Template;\r\n\t\treturn $templates;\r\n\t}",
"public function fetchAll()\n {\n $templateTypeTable = new Api_Model_DbTable_TemplateType();\n\n $rowset = $templateTypeTable->fetchAll(null, 'name');\n\n $templateTypes = new Set();\n foreach ($rowset as $row) {\n $templateType = Type::factory($row);\n\n $templateTypes->addItem($templateType);\n }\n\n return $templateTypes;\n }",
"public function GetSavedTemplates() {\n\t\t$templates = &drupal_static(__FUNCTION__, NULL, $this->reset);\n\n\t\tif (!isset($templates)) {\n\t\t\t$templates = db_select('{'.ACQUIA_COMPOSER_TEMPLATES_TABLE.'}', 'ac')\n\t\t\t\t->fields('ac')\n\t\t\t\t->execute()\n\t\t\t\t->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\tif (!count($templates)) {\n\t\t\t\t$templates = array();\n\t\t\t}\n\t\t}\n\t\treturn $templates;\n\t}",
"function templates()\n {\n return [];\n }",
"public function getTemplates() {\n $pages = Templates::templates()->paginate(Templates::getPageSize());\n\n return response()->json($pages);\n }",
"function fetch_templates( $module_id = false ) // fetch templates for module or all or global\n\t{\n\t\tif( $module_id ) {\n\t\t\t$this->db->where( 'module_id', $module_id );\n\t\t}\n\t\t$query=$this->db->get( 'templates' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->result_array();\n\t}",
"public function getTemplates (){\n $dir = conf::pathHtdocs() . \"/templates\";\n $templates = file::getFileList($dir, array('dir_only' => true));\n\n $ary = array ();\n foreach ($templates as $val){\n $info = $this->getSingleTemplate($val);\n if (empty($info)) {\n continue;\n }\n $ary[] = $info;\n }\n return $ary;\n }",
"private function find_templates () {\r\n\t\t$results = array();\r\n\r\n\t\t$files = WooDojo_Utils::glob_php( '*.php', GLOB_MARK, $this->templates_dir );\r\n\r\n\t\tif ( is_array( $files ) && count( $files ) > 0 ) {\r\n\t\t\tforeach ( $files as $k => $v ) {\r\n\t\t\t\t$data = $this->get_template_data( $v );\r\n\t\t\t\tif ( is_object( $data ) && isset( $data->title ) ) {\r\n\t\t\t\t\t$results[$v] = $data->title;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}",
"public function getCreatedTemplates ()\n {\n // Get all the templates\n $table = DB::select('select id_template, name_template, created_at, icon from ezz_templates');\n return response()->json([\n 'templates' => $table\n ], 200);\n }",
"public function getTemplateList() {\n\t\t$aArgs = func_get_args();\n\t\t$aRet = call_user_func_array( array( $this, 'getTemplates' ), $aArgs );\n\t\treturn implode( '|', $aRet );\n\t}",
"public function getAllScreenTemplates() {\n return $this->container->get('doctrine')\n ->getRepository('Os2DisplayCoreBundle:ScreenTemplate')\n ->findAll();\n }",
"public function getTemplates0()\n {\n return $this->hasMany(Template::className(), ['background_id' => 'id']);\n }",
"function getPrintTemplates(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"print_templates\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['group_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getGroupPrintTemplates'], $aParams);\r\n\t\t$sListPrintTemplateId = \"\";\r\n\t\t$aListPrintTemplateName = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListPrintTemplateId == \"\"){\r\n\t\t\t\t$sListPrintTemplateId = $aLigne[\"printtemplate_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListPrintTemplateId .= \"|\".$aLigne[\"printtemplate_id\"];\r\n\t\t\t}\r\n $aListPrintTemplateName[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['print_templates'] = $sListPrintTemplateId;\r\n $this->aFields['print_templates_label'] = implode(',', $aListPrintTemplateName);\r\n }\r\n }",
"public function allEmailTemplateForDataTable()\n {\n return $this->emailTemplateRepository->getAllEmailTemplateForDataTable();\n }",
"public function selectgetTemplate()\n {\n $queryString=\"SELECT * FROM Templates WHERE Active ='1' \";\n $this->result = @$this->dbConnection->query($queryString);\n\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }",
"public function getTemplates()\n {\n return $this->templates;\n }",
"public function getTemplates()\n {\n return $this->templates;\n }"
] | [
"0.8262818",
"0.7802904",
"0.7788046",
"0.7597968",
"0.73624873",
"0.7150043",
"0.70923656",
"0.7080438",
"0.70491445",
"0.7039374",
"0.70229",
"0.70114887",
"0.7009191",
"0.69464266",
"0.6906768",
"0.68943524",
"0.6741189",
"0.6728478",
"0.67074895",
"0.6686109",
"0.66610825",
"0.6650865",
"0.66347086",
"0.6626556",
"0.6615125",
"0.65892076",
"0.657038",
"0.65014386",
"0.64879924",
"0.64879924"
] | 0.8624964 | 0 |
Copy images to storage | public function copyImages(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function copyImages()\n {\n $media = [\n 'slider-woman-on-the-beach.jpg'\n ];\n\n $this->mediaMigration->copyMediaFiles($media, self::MIGRATION_MODULE, 'scandiweb/slider/s/l');\n }",
"private function copyToStorage(Image $image) {\n \t$attrs = $image->attributesToArray();\n\t $this->command->info(\"Copying '{$attrs['path']}' to public folder\");\n \t$filePath = dirname(__FILE__).\"/Images/{$attrs['path']}\";\n \tStorage::put(\"public/images/{$attrs['id']}/{$attrs['path']}\", file_get_contents($filePath));\n }",
"protected function copyImagesDirectory()\n\t{\n\t\t$params = $this->getParams();\n\n\t\tif ($params->path != '') {\n\t\t\t$date = JFactory::getDate()->toFormat('%Y%m%d');\n\n\t\t\t$src = JPATH_SITE.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images-backup-'.$date;\n\t\t\tJFolder::move($src, $dest);\n\n\t\t\t$src = $params->path.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images';\n\t\t\tJFolder::copy($src, $dest);\n\t\t}\n\t}",
"public function archiveImages() {\n try {\n $destination = storage_path('archive/images/' . date('Y') . '/' . date('m') . '/' . date('d'));\n $directory = storage_path('video/images');\n $this->filesystem->copyDirectory($directory, $destination);\n\n } catch (\\Exception $e) {\n throw new ArchiveException('Error archive images: ' . $e->getTraceAsString());\n }\n }",
"function storeImages()\n {\n }",
"public function save()\n {\n $dir = $this->pathTmpImage;\n\n $files = scandir($dir);\n\n foreach ($files as $file) {\n if ($file == $_POST['image']) { \n copy($this->pathTmpImage . $file, $this->pathResult . $file);\n }\n }\n\n //$this->dbInsert($_POST['image']);\n\n unlink($this->pathTmpImage . $_POST['image']);\n }",
"function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}",
"private function generate()\n {\n $originalImages = Storage::files(env('PHOTO_PATH'));\n\n foreach ($originalImages as $originalImage) {\n $pieces = explode('/', $originalImage);\n\n $exp = explode('.', end($pieces));\n\n $extension = end($exp);\n\n array_pop($exp);\n\n $imageId = implode('.', $exp);\n\n $photos = [];\n\n foreach ($this->dimensions as $key => $dimension) {\n $fileName = env('PHOTO_PATH_RESIZE') . \"{$imageId}_{$key}.$extension\";\n\n if (! Storage::exists($fileName)) {\n $img = Image::make(Storage::get($originalImage));\n $img->resize($dimension['width'], $dimension['height']);\n\n Storage::put($fileName, (string)$img->encode(), 'public');\n\n if (Storage::exists($fileName)) {\n $photos[$key] = asset(Storage::url($fileName));\n }\n }\n }\n\n /**\n * Save on Storage\n */\n if (count($photos)) {\n $photo = new Photo();\n $photo->name = $imageId;\n $photo->photos = $photos;\n $photo->photos = $photos;\n $photo->save();\n }\n }\n }",
"protected function combineImages() {}",
"function movesiteimages()\n\t{\n\t\n\t\tglobal $option, $mainframe;\n\n\t\t//we'll need access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\n\t\t// define where the images are and where we want to put them\n\n\t\t$searchpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$destpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_cirriculum\". DS . \"tmp\" ;\n\n\t\t//read all the image files and put them in an array.\n\t\t$img_files = JFolder::files($searchpath, '.*');\n\n\t\t//Now we need some stuff from the JFile:: class to move all files into the new folder\n\t\tforeach ($img_files as $file) {\n\t\t\tJFile::move($searchpath. DS . $file, $destpath . DS. $file);\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'All images have moved into the site folder' );\n\t\n\t}",
"protected function importLayoutImages_processCopiedImages(){\n\t\t\n\t\t\n\t\tforeach($this->arrImportImages as $key=>$arrImage){\n\t\t\t\n\t\t\t//get image ID\n\t\t\t$imageID = $this->insertAttachmentByImage($arrImage);\n\t\t\tif(empty($imageID))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t//update image id\n\t\t\t$arrImage[\"imageid\"] = $imageID;\n\t\t\t$this->arrImportImages[$key] = $arrImage;\n\t\t}\n\t\t\n\t}",
"function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }",
"function images_add_folder($image_data_url,$folder_name)\r\n{\r\n\t \r\n\t\r\n\t foreach($image_data_url as $file)\r\n {\r\n //get image contents\r\n $image = file_get_contents($file);\r\n\t\t\t\t\t $f_name=explode (\"?\",$file);\r\n\t\t\t\t $image_url=explode('/',$f_name[0]);\r\n $only_name=$image_url[count($image_url)-1];\r\n //put image contents\r\n file_put_contents($folder_name.\"/\".$only_name, $image);\r\n\t\t\t }\r\n}",
"public function uploadImage($images)\n {\n foreach ($images as $image) {\n $extension = $image->getClientOriginalExtension();\n $file = $image->move('storage/', uniqid('img_') . '.' . $extension);\n $image = new ClinicImage(['path' => $file->getPathname()]);\n $this->images()->save($image);\n }\n }",
"public function saveImage(Request $request){\n $x = explode('/', __DIR__);\n $path = [];\n for($i = 0; $i < count($x); $i++){\n if($x[$i] != 'app')\n array_push($path, $x[$i]);\n else\n break;\n }\n array_push($path, 'public', 'images', 'temp'. $request->ip(). '.jpg');\n $path = implode('/', $path);\n if(!file_exists($path)){\n fopen($path, 'w');\n }\n copy($request->image, $path);\n return response()->json(['code' => 200, 'message' => 'success', 'response' => $path])->header('Cache-control', 'no-cache');\n\n }",
"public function processImages()\n \t{\n $this->save();\n if (! $this->errorMessage)\n \t\t parent::uploadImages('image', 'RecipeImage', \"recipeID\");\n \n \t}",
"function upload_image2($images) {\n\n $image_urls = array();\n\n foreach ($images as $image) {\n $src_url = $image['src'];\n $dst_url = $image['dst'];\n $type = $image['image_type'];\n\n if($stored_url = upload_image($dst_url, $src_url)) {\n $image_urls[$type] = $stored_url;\n }\n }\n return $image_urls;\n}",
"public static function PutImagesOnAnother($srcContainer,$srcImages,$dest,$alpha=false)\r\n {\r\n if(!is_array($srcImages)||empty($srcImages)|| $srcContainer=='' || $dest=='')\r\n return \"Check PutImagesOnAnother Function arguments\";\r\n // we will get the image type from extension. no hard work\r\n $ext=FileExtension($srcContainer);\r\n $background=Graphics::CreateImage($srcContainer); //this will be used as background \r\n if($background===-1)\r\n return \"<br> Image extension not supported ($ext).\";\r\n $containerWidth=ImageSX($background);\r\n $containerHeight=ImageSY($background);\r\n $container=ImageCreateTrueColor($containerWidth,$containerHeight); \r\n if($container===false)\r\n return \"<br> Image processing error on server.\";\r\n $black=ImageColorAllocate($container,255,255,255);\r\n imagefill($container,0,0,$black);\r\n ImageCopy($container,$background,0,0,0,0,$containerWidth,$containerHeight);\r\n\r\n imagealphablending($container,$alpha);\r\n $error='';\r\n foreach($srcImages as $aSrcImg)\r\n {\r\n if(!file_exists($aSrcImg['src']))\r\n {\r\n $error.=\"<br> image not found\".$aSrcImg['src'];\r\n continue;\r\n }\r\n\r\n $content=Graphics::CreateImage($aSrcImg['src']);\r\n if($content===-1)\r\n {\r\n $error.=\"<br> Image extension not supported ($ext).\".$aSrcImg['src'];\r\n continue;\r\n }\r\n if(!$content)\r\n {\r\n $error.=\"<br> Image processing error on server.\".$aSrcImg['src'];\r\n continue;\r\n }\r\n //all is well\r\n //x,y top of the img src to put on\r\n $x=0; //where to put?\r\n $y=0;\r\n $contentWidth=ImageSX($content);\r\n $contentHeight=ImageSY($content);\r\n //calculating position of top-left\r\n if(isset($aSrcImg['isCenter']) && $aSrcImg['isCenter']==true)\r\n {\r\n $x=Floor($containerWidth/2);\r\n $y=Floor($containerHeight/2);\r\n }\r\n else //do with x, y\r\n { \r\n if(isset($aSrcImg['x']))\r\n $x=$aSrcImg['x'];\r\n if(isset($aSrcImg['y']))\r\n $y=$aSrcImg['y'];\r\n }\r\n imagealphablending($content,$alpha); \r\n ImageCopy($container,$content,$x,$y,0,0,$contentWidth,$contentHeight);\r\n //ImageCopyMerge($container,$content,$x,$y,0,0,$contentWidth,$contentHeight,100);\r\n ImageDestroy($content);\r\n }\r\n if(Graphics::SaveImage($container,$dest,$ext))\r\n $error.=\"<br> Image Saved at $dest\";\r\n else $error.=\"<br> Image was not saved\";\r\n if($error=='')\r\n return true;\r\n return $error;\r\n\r\n\r\n }",
"public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}",
"public function run()\n {\n Image::truncate();\n $data = [];\n for ($i = 1; $i <= 13; $i++) {\n $data[] = ['media_id' => 'pd-cover-' . $i . '.jpg'];\n $data[] = ['media_id' => 'pd-info-' . $i . '.jpg'];\n }\n\n Image::insert($data);\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'img' => 'required',\n ]);\n $file = $request->file('img');\n // $file = $request->file('img')->store('public/files');\n $img = Image::make($file)->fit(1096,1096);\n \n // paste another image \n $frame = Frame::latest()->value('frame');\n\n $theFrame = Storage::get($frame);\n \n $img->insert($theFrame);\n return $img->response('jpg');\n \n \n }",
"public function run()\n {\n // Laptops\n for ($i = 1; $i <= 2000; $i++) {\n Image::create([\n 'product_id' => $i,\n 'file' => '1 - Copy (' . $i . ').jpg',\n ]);\n }\n\n }",
"protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }",
"public function copyFiles($destination);",
"private function copyResources()\n {\n $sResourcesDirectory = $this->getViewRootDirectory();\n $sResourcesDirectory = substr($sResourcesDirectory, 0, strrpos($sResourcesDirectory, 'View'));\n $sResourcesDirectory .= 'Resources' . DIRECTORY_SEPARATOR;\n\n // copy css\n foreach (glob($sResourcesDirectory . 'css/*') as $sResourceFile) {\n $sCopyPath = WWW_PATH . substr($sResourceFile, strlen($sResourcesDirectory));\n Directory::create(dirname($sCopyPath));\n copy($sResourceFile, $sCopyPath);\n }\n\n // copy js\n foreach (glob($sResourcesDirectory . 'js/*') as $sResourceFile) {\n $sCopyPath = WWW_PATH . substr($sResourceFile, strlen($sResourcesDirectory));\n Directory::create(dirname($sCopyPath));\n copy($sResourceFile, $sCopyPath);\n }\n }",
"public function set_images($files){\n\t\t$image_dir = \"{$GLOBALS['core_path']}/user_content/item_images/{$this->id}\";\n\t\t\n\t\tif (!file_exists($image_dir)){\n\t\t\tmkdir($image_dir, 0750);\n\t\t}\n\t\t\n\t\tforeach (glob(\"{$image_dir}/*.png\") as $existing){\n\t\t\tunlink($existing);\n\t\t}\n\t\t\n\t\tforeach ($files as $key => $image_file){\n\t\t\t$image = imagecreatefromstring(file_get_contents($image_file));\n\t\t\t\t\n\t\t\t$preview = self::resize_image($image, item_image::PREVIEW_WIDTH, item_image::PREVIEW_HEIGHT);\n\t\t\t$cover = self::resize_image($image, item_image::COVER_WIDTH, item_image::COVER_HEIGHT);\n\t\t\t$thumb = self::resize_image($image, item_image::THUMB_WIDTH, item_image::THUMB_HEIGHT);\n\t\t\t\t\n\t\t\timagepng($preview, \"{$image_dir}/{$key}_preview.png\", 9);\n\t\t\timagepng($cover, \"{$image_dir}/{$key}_cover.png\", 9);\n\t\t\timagepng($thumb, \"{$image_dir}/{$key}_thumb.png\", 9);\n\t\t\timagepng($image, \"{$image_dir}/{$key}_full.png\", 9);\n\t\t\t\t\n\t\t\timagedestroy($preview);\n\t\t\timagedestroy($cover);\n\t\t\timagedestroy($image);\n\t\t\timagedestroy($thumb);\n\t\t\t\t\n\t\t\tunlink($image_file);\n\t\t}\n\t}",
"protected function _copyTempProductImages($tempImages) {\n\n $tempPath = config('front.temp_path');\n $productPath = config('front.product_path') . store()->id . '/';\n $images = [];\n\n if (count($tempImages)) {\n\n foreach ($tempImages as $k => $image) {\n\n $imageSize = [];\n\n if (check_file($tempPath . $image) && count($this->_productImgSizes)) {\n\n foreach ($this->_productImgSizes as $size) {\n\n $nameBySize = str_replace(_const('TOBEREPLACED'), \"_{$size}\", $image);\n if (copy($tempPath . $nameBySize, $productPath . $nameBySize)) {\n $imageSize[$size] = $nameBySize;\n }\n\n delete_file($tempPath . $nameBySize);\n }\n\n delete_file($tempPath . $image);\n }\n\n if (count($imageSize)) {\n $images[$k] = $imageSize;\n }\n }\n }\n\n return new Collection($images);\n }",
"public function copy_image($image_id=null, $foreign_key=null) {\n\t // test function\n\t $this->Image->image_clone($image_id, $foreign_key);\n\t exit;\n }",
"public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }",
"private static function purgeImages() {\n self::purgeFiles(self::getInterimImageFolder(), self::$interim_image_expiry);\n }"
] | [
"0.74411803",
"0.7068767",
"0.6778374",
"0.6717099",
"0.6654278",
"0.6540883",
"0.63669074",
"0.6115651",
"0.59764445",
"0.59682953",
"0.58841497",
"0.5808245",
"0.58032787",
"0.5763859",
"0.5722151",
"0.57065827",
"0.56740564",
"0.55958104",
"0.55422777",
"0.55406654",
"0.55352354",
"0.55340946",
"0.5523544",
"0.5512501",
"0.5499868",
"0.54940134",
"0.54931664",
"0.54701453",
"0.5465405",
"0.5462297"
] | 0.822315 | 0 |
Get validation rules for updating a template | public function getValidationRulesUpdate(): array; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUpdateRules()\n {\n return [\n \"id\" => \"required\"\n ];\n }",
"public function getRulesForUpdate()\r\n\t{\r\n\t \treturn $this->rules_for_update ? $this->rules_for_update : array();\r\n\t}",
"abstract protected function getValidationRules();",
"public function getValidationUpdateRules(): array\n {\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}",
"private function getRules()\n {\n return array(\n 'name' => new Pattern\\Name,\n 'height' => new Pattern\\Height,\n 'lat' => array(\n 'required' => true,\n 'rules' => array('Latitude')\n ),\n 'lng' => array(\n 'required' => true,\n 'rules' => array('Longitude')\n ),\n 'api_key' => array(\n 'required' => true,\n 'rules' => array(\n 'NotEmpty' => array(\n 'message' => 'Google API key can not be empty'\n )\n )\n ),\n 'style' => array(\n 'required' => false,\n 'rules' => array('Json')\n )\n );\n }",
"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 }",
"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 $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 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 }",
"protected function updateValidations()\n {\n switch (Input::get('form')) {\n\n case 'user-basic':\n $rules = [\n 'name' => 'required|max:50',\n 'last_name' => 'nullable|max:50',\n 'description' => 'nullable|max:1200',\n ];\n break;\n case 'user-update':\n $rules = [\n 'username' => 'required|max:18|alpha_num',\n 'name' => 'required|max:50',\n 'last_name' => 'nullable|max:50',\n 'email' => 'required|email|max:100',\n 'status' => 'required|integer',\n 'description' => 'nullable|max:1200',\n 'roles' => 'nullable|array',\n ];\n break;\n case 'password-update':\n $rules = [\n 'old_password' => 'required|alpha_dash|max:18',\n 'password' => 'required|alpha_dash|confirmed|different:old_password|max:18',\n 'password_confirmation' => 'required|alpha_dash|max:18',\n ];\n break;\n case 'avatar-update':\n $rules = [\n 'avatar' => 'required|image|max:1024',\n ];\n break;\n default:\n $rules = [];\n }\n return $rules;\n }",
"public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }",
"private function updateRules()\n {\n return [\n 'data.type' => 'required|in:events',\n 'data.attributes.name' => 'max:30|min:5',\n 'data.attributes.description' => 'min:1|max:255',\n 'data.attributes.date' => 'date',\n 'data.relationships.users' => 'required_with:data.relationships',\n 'data.relationships.users.data.*.type' => 'required_with:data.relationships|in:users',\n 'data.relationships.users.data.*.id' => 'required_with:data.relationships|numeric'\n ];\n }",
"public static function getRules()\n {\n return (new static)->getValidationRules();\n }",
"public static function validationRulesNew()\n {\n return [\n 'name' => 'required|unique:faucets,name|min:5',\n 'url' => 'required|unique:faucets,url',\n 'interval_minutes' => 'required|integer',\n 'min_payout' => 'required|numeric',\n 'max_payout' => 'required|numeric',\n 'faucet_payment_processors[]' => 'each:exists,faucet_payment_processors, id',\n 'has_ref_program' => 'required|boolean',\n 'ref_payout_percent' => 'required|numeric|min:0',\n 'comments' => 'string',\n 'is_paused' => 'required|boolean',\n 'meta_title' => 'string|max:70',\n 'meta_description' => 'string|max:160',\n 'meta_keywords' => 'string|max:255'\n ];\n }",
"public function getValidationRules() : array;",
"public function rules()\n {\n $rules = [];\n $rules[ 'color' ] = 'required';\n $rules[ 'number' ] = 'required';\n $rules[ 'transmission' ] = 'required|numeric|gt:0';\n $rules[ 'model' ] = 'required|numeric|gt:0';\n $rules[ 'rent_price_per_day' ] = 'required';\n $rules[ 'year' ] = 'required';\n\n $data = $this->validationData();\n \n $method = $this->method();//POST || PUT\n\n //update -> PUT \n if ( $method === \"PUT\" )\n {\n if ( isset( $data[ 'fileuploader-list-file' ] ) && !empty( $data[ 'fileuploader-list-file' ] ) )\n {\n $rules[ 'file.*' ] = 'required|mimes:jpeg,jpg,png|max:1024';\n }\n } else\n {\n $rules[ 'file.*' ] = 'required|mimes:jpeg,jpg,png|max:1024';\n $rules[ 'fileuploader-list-file' ] = 'required';\n }\n\n return $rules;\n }",
"public function getRules()\n {\n return $this->validator->getRules();\n }",
"abstract public function getValidationRules(): array;",
"public function getValidationRules()\n {\n return [];\n }",
"public function updateRules(): array\n {\n return [\n 'Universidad' => 'required|string|min:2|max:20',\n 'carrera' => 'required|string|min:2|max:50',\n ];\n }",
"public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }",
"public function getUpdateValidators()\n {\n $validators = $this->getCreateValidators();\n $validators['author_type_id'] = new sfValidatorDoctrineChoice(array(\n 'model' => Doctrine_Core::getTable('Deadline')->getRelation('AuthorType')->getAlias(),\n 'required' => false,\n ));\n $validators['subreddit_id'] = new sfValidatorDoctrineChoice(array(\n 'model' => Doctrine_Core::getTable('Deadline')->getRelation('Subreddit')->getAlias(),\n 'required' => false,\n ));\n return $validators;\n }",
"public function getValidationCreateRules(): array\n {\n }",
"public function getRules()\n {\n return $this->validation_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}",
"protected function getValidRules()\n {\n return $this->validRules;\n }",
"public function rules()\n {\n $id = $this->route()->parameter('widget');\n\n $rules = [\n //'reference' => 'required|min:2|unique:widgets',\n 'module_id' => 'required|numeric',\n 'placement' => 'required',\n 'order_column' => 'required',\n 'order_column_type' => 'required',\n 'type' => 'required',\n 'select_type' => 'required',\n 'number_for_latest' => 'numeric|nullable',\n // 'order' => 'nullable|numeric',\n 'is_active' => 'required|boolean'\n ];\n\n if (request()->method() == 'POST') {\n $rules['reference'] = 'required|min:2|unique:' . (new Widget())->getTable() . ',reference';\n } else {\n // $rules['reference'] = 'required|min:2|unique:' . (new Widget())->getTable() . ',reference,' . $id . ',id';\n }\n\n foreach (config('translatable.locales') as $k => $locale) {\n $rules[$locale . '.name'] = 'required|min:3';\n // $rules[$locale . '.description'] = 'nullable|min:3';\n }\n\n return $rules;\n }",
"public function rules()\n {\n $dynamic_rules = [\n 'company_name' => 'required|string|min:1|max:255',\n 'company_email' => 'nullable|email|max:400',\n 'company_website' => 'nullable|url|max:200',\n 'company_logo_upload' => 'nullable|image',\n ];\n\n if ($this->routeIs(\"*.update\")) {\n return array_merge($dynamic_rules, [\n 'company_name' => 'filled|string|min:1|max:255',\n ]);\n }\n\n return $dynamic_rules;\n }"
] | [
"0.73560274",
"0.7029944",
"0.6998964",
"0.69760776",
"0.695345",
"0.67695546",
"0.67648745",
"0.6729979",
"0.6683829",
"0.66539997",
"0.6649985",
"0.66413826",
"0.66347283",
"0.6589461",
"0.6586514",
"0.65696627",
"0.65399384",
"0.6539754",
"0.65358686",
"0.65288645",
"0.6527938",
"0.6526238",
"0.6508364",
"0.64971584",
"0.6475383",
"0.6465412",
"0.64476067",
"0.6440161",
"0.6436494",
"0.6422712"
] | 0.73301095 | 1 |
End Action controllers for generating enlistment report Start Action controllers for generating attendance report generate_voc_program_attendance_report function. commit 10/11/2018 | public function generate_voc_program_attendance_report(){
$this->crud->credibilityAuth(array('Administrator','Registrar'));
// get inputs
$condition= array('vocational_program'=>$this->input->post('vocational_program'),'batch_year'=> $this->input->post('batch_year_id'));
$range1 = $this->input->post('date_range1');
$range2 = $this->input->post('date_range2');
// get necessary report data
$voc_program= $this->vocational_program_model->getVocationalPrograms('s',array('voc_program_id'=>$condition['vocational_program']));
$students = $this->admin_model->getStudentsBasicInfo($condition,'a');
$attendance = $this->admin_model->getStudentAttendanceByVocationalProgram($students,$range1,$range2,$condition['batch_year']);
$att_record = $this->admin_model->getStudentDailyAttendanceRecord($students,$range1,$range2,$condition['batch_year']);
$att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');
// generate report data in pdf or csv format from admin_report_model
if((!empty($condition['vocational_program']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){
if(!empty($attendance)){
if($this->input->post('export_csv')){
$this->admin_report_model->generateStudentAttendanceByVocationalProgramCsv($attendance,$att_record,$att_dates,$voc_program,$range1,$range2);
exit;
}else if($this->input->post('export_pdf')){
$this->admin_report_model->generateVocProgramAttendanceReportPdf($attendance,$voc_program,$range1,$range2);
}
}
$this->session->set_flashdata('warning', 'No reports found!.');
redirect('attendance_report');
}
$this->session->set_flashdata('danger', 'Invalid input.');
redirect('attendance_report');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generate_subject_code_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }",
"public function generate_subject_code_remarks_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }",
"public function pcAttendance_report() {\n BackendMenu::setContext('Olabs.Oims', 'reports', 'pcattendance_report');\n $this->searchFormWidget = $this->createAttendanceSearchFormWidget();\n $this->pageTitle = 'Petty Contractor Attendance Report';\n $reports = array();\n\n $oimsSetting = \\Olabs\\Oims\\Models\\Settings::instance();\n\n $searchForm = $this->searchFormWidget;\n\n $this->vars['search'] = false;\n $this->vars['msg'] = false;\n $this->vars['searchFormWidget'] = $searchForm;\n $this->vars['reports'] = $reports;\n\n $this->vars['oimsSetting'] = $oimsSetting;\n }",
"function generateMeetingAttendanceReport($args) {\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$ercMembers = Request::getUserVar('ercMembers');\r\n\t\t\r\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\r\n\t\tif ($fromDate != null) $fromDate = date('Y-m-d H:i:s', $fromDate);\r\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\r\n\t\tif ($toDate != null) $toDate = date('Y-m-d H:i:s', $toDate);\r\n\t\t$meetingDao = DAORegistry::getDAO('MeetingDAO');\r\n\t\t$userDao = DAORegistry::getDAO('UserDAO');\r\n\t\t\r\n\t\theader('content-type: text/comma-separated-values');\r\n\t\theader('content-disposition: attachment; filename=meetingAttendanceReport-' . date('Ymd') . '.csv');\r\n\t\t\r\n\t\t$columns = array(\r\n\t\t'lastname' => Locale::translate('user.lastName'),\r\n\t\t'firstname' => Locale::translate('user.firstName'),\r\n\t\t'middlename' => Locale::translate('user.middleName'),\r\n\t\t'meeting_date' => Locale::translate('editor.reports.meetingDate'),\r\n\t\t'present' => Locale::translate('editor.reports.isPresent'),\r\n\t\t'reason_for_absence' => Locale::translate('editor.reports.reason')\r\n\t\t);\r\n\t\t$yesNoArray = array('present');\r\n\t\t$yesnoMessages = array( 0 => Locale::translate('common.no'), 1 => Locale::translate('common.yes'));\r\n\t\t$fp = fopen('php://output', 'wt');\r\n\t\tString::fputcsv($fp, array_values($columns));\r\n\t\t\r\n\t\tforeach ($ercMembers as $member) {\r\n\t\t\t$user = $userDao->getUser($member);\r\n\t\t\tlist($meetingsIterator) = $meetingDao->getMeetingReportByReviewerId($member, $fromDate, $toDate);\r\n\t\t\r\n\t\t\t$meetings = array();\r\n\t\t\twhile ($row =& $meetingsIterator->next()) {\r\n\t\t\t\tforeach ($columns as $index => $junk) {\r\n\t\t\t\t\tif (in_array($index, $yesNoArray)) {\r\n\t\t\t\t\t\t$columns[$index] = $yesnoMessages[$row[$index]];\r\n\t\t\t\t\t} elseif ($index == \"lastname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getLastName();\r\n\t\t\t\t\t} elseif ($index == \"firstname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getFirstName();\r\n\t\t\t\t\t} elseif ($index == \"middlename\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getMiddleName();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$columns[$index] = $row[$index];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tString::fputcsv($fp, $columns);\r\n\t\t\t\tunset($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}",
"public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }",
"function attendance_report() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $student_id = $student_id = $this->session->userdata('parent_id');\n if ($this->input->post('month') != '' && $this->input->post('year') != '') {\n $page_data['month'] = $this->input->post('month');\n $page_data['year'] = $this->input->post('year');\n } else {\n $page_data['month'] = '';\n $page_data['year'] = '';\n }\n $page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['student_id'] = $student_id;\n $page_data['page_name'] = 'attendance_report';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $this->load->view('backend/index', $page_data);\n }",
"public function generate()\n {\n $reportType = Input::get('report_type');\n $from = Input::get('from');\n $to = Input::get('to');\n $disciplineId = Input::get('discipline');\n $info = explode(',', Input::get('info'));\n $id = $info[1];\n $type = $info[0];\n $license = array_key_exists(2, $info) ? $info[2] : '0';\n\n $from = empty($from) ? null : date('Y-m-d', strtotime($from));\n $to = empty($to) ? null : date('Y-m-d', strtotime($to));\n \n if (! $reportType) {\n Flash::danger('Please select a <strong>Report Type</strong>.');\n return Redirect::route('reports.index')->withInput();\n }\n\n if (empty($from)) {\n Flash::danger('Please enter a <strong>From Date</strong> to generate report.');\n return Redirect::route('reports.index')->withInput();\n }\n\n // all route params\n $routeParams = [$disciplineId, $type, $id, $license, $from, $to];\n\n switch ($reportType) {\n case 'site_summary':\n return Redirect::route('reports.site_summary', $routeParams);\n break;\n\n case 'scheduled_exams':\n return Redirect::route('reports.scheduled_exams', $routeParams);\n break;\n\n case 'retake_summary':\n return Redirect::route('reports.retake_summary', $routeParams);\n break;\n\n case 'skills_detail':\n return Redirect::route('reports.skills_detail', $routeParams);\n break;\n\n case 'knowledge_detail':\n return Redirect::route('reports.knowledge_detail', $routeParams);\n break;\n\n case 'pass_fail':\n // if admin / agency / staff show a page to select facility and instructor\n /*if(Auth::user()->ability(['Admin', 'Staff', 'Agency'], []))\n {\n return Redirect::route('reports.select_facility', [$from, $to]);\n }*/\n\n // Otherwise just show the regular pass/fail report\n return Redirect::route('reports.pass_fail', $routeParams);\n break;\n\n default:\n Flash::warning('This report type is not yet supported.', 'Warning');\n return Redirect::route('reports.index');\n\n }\n }",
"function meetingAttendanceReport($args, &$request){\r\n\t\timport ('classes.meeting.form.MeetingAttendanceReportForm');\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$meetingAttendanceReportForm= new MeetingAttendanceReportForm($args, $request);\r\n\t\t$isSubmit = Request::getUserVar('generateMeetingAttendance') != null ? true : false;\r\n\t\t\r\n\t\tif ($isSubmit) {\r\n\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\tif($meetingAttendanceReportForm->validate()){\t\r\n\t\t\t\t\t$this->generateMeetingAttendanceReport($args);\r\n\t\t\t}else{\r\n\t\t\t\tif ($meetingAttendanceReportForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t}\r\n\t}",
"public function attendance(){\n\t\t\t$data['title'] = 'Students Attendences Course name '; \n\n\t\t\t$course_code = $_GET['course_code'];\n\t\t\t\n\t\t\t$ids = $this->register_model->ids($course_code);\n\n\t\t\t$course_id;\n\t\t\tforeach ($ids as $id) {\n\t\t\t\t\t$course_id = $id['id'];\n\t\t\t\t\t$data['course_name'] = $id['course_name'];\n\t\t\t}\t\t\t\n\t\t\t$data['courses'] = $this->register_model->get_attendance($course_id);\n\n\t\t\t$this->load->view('admin/header1');\n\t\t\t$this->load->view('admin/attendance', $data);\n\t\t\t$this->load->view('admin/footer');\n\t\t}",
"public function attendance_sheet_export_to_pdf($action, $attendance_id, $student_id = 0, $course_id = '')\n {\n $attendance = new Attendance();\n $courseInfo = CourseManager::get_course_information($course_id);\n $attendance->set_course_id($courseInfo['code']);\n $groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : null;\n $data_array = array();\n $data_array['attendance_id'] = $attendance_id;\n $data_array['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);\n\n $filter_type = 'today';\n\n if (!empty($_REQUEST['filter'])) {\n $filter_type = $_REQUEST['filter'];\n }\n\n $my_calendar_id = null;\n if (is_numeric($filter_type)) {\n $my_calendar_id = $filter_type;\n $filter_type = 'calendar_id';\n }\n\n $data_array['attendant_calendar'] = $attendance->get_attendance_calendar(\n $attendance_id,\n $filter_type,\n $my_calendar_id,\n $groupId\n );\n\n if (api_is_allowed_to_edit(null, true) || api_is_drh()) {\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, 0, $groupId);\n } else {\n if (!empty($student_id)) {\n $user_id = intval($student_id);\n } else {\n $user_id = api_get_user_id();\n }\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, $user_id, $groupId);\n $data_array['faults'] = $attendance->get_faults_of_user($user_id, $attendance_id, $groupId);\n $data_array['user_id'] = $user_id;\n }\n\n $data_array['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);\n\n // Set headers pdf.\n $courseCategory = CourseManager::get_course_category($courseInfo['category_code']);\n $teacherInfo = CourseManager::get_teacher_list_from_course_code($courseInfo['code']);\n $teacherName = null;\n foreach ($teacherInfo as $teacherData) {\n if ($teacherName != null) {\n $teacherName = $teacherName.\" / \";\n }\n $teacherName .= api_get_person_name($teacherData['firstname'], $teacherData['lastname']);\n }\n\n // Get data table\n $data_table = array();\n $head_table = array('#', get_lang('Name'));\n foreach ($data_array['attendant_calendar'] as $class_day) {\n $head_table[] =\n api_format_date($class_day['date_time'], DATE_FORMAT_NUMBER_NO_YEAR).' '.\n api_format_date($class_day['date_time'], TIME_NO_SEC_FORMAT);\n }\n $data_table[] = $head_table;\n $data_attendant_calendar = $data_array['attendant_calendar'];\n $data_users_presence = $data_array['users_presence'];\n $count = 1;\n\n if (!empty($data_array['users_in_course'])) {\n foreach ($data_array['users_in_course'] as $user) {\n $cols = 1;\n $result = array();\n $result['count'] = $count;\n $result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']);\n foreach ($data_array['attendant_calendar'] as $class_day) {\n if ($class_day['done_attendance'] == 1) {\n if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) {\n $result[$class_day['id']] = get_lang('UserAttendedSymbol');\n } else {\n $result[$class_day['id']] = '<span style=\"color:red\">'.get_lang('UserNotAttendedSymbol').'</span>';\n }\n } else {\n $result[$class_day['id']] = ' ';\n }\n $cols++;\n }\n $count++;\n $data_table[] = $result;\n }\n }\n $max_cols_per_page = 12; //10 dates + 2 name and number\n $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10\n $rows = count($data_table);\n\n if ($cols > $max_cols_per_page) {\n $number_tables = round(($cols-2)/$max_dates_per_page);\n $headers = $data_table[0];\n $all = array();\n $tables = array();\n $changed = 1;\n\n for ($i= 0; $i <= $rows; $i++) {\n $row = isset($data_table[$i]) ? $data_table[$i] : null;\n $key = 1;\n $max_dates_per_page = 10;\n $item = isset($data_table[$i]) ? $data_table[$i] : null;\n $count_j = 0;\n\n if (!empty($item)) {\n foreach ($item as $value) {\n if ($count_j >= $max_dates_per_page) {\n $key++;\n $max_dates_per_page = $max_dates_per_page_original*$key;\n //magic hack\n $tables[$key][$i][] = $tables[1][$i][0];\n $tables[$key][$i][] = $tables[1][$i][1];\n }\n $tables[$key][$i][] = $value;\n $count_j++;\n }\n }\n }\n\n $content = null;\n if (!empty($tables)) {\n foreach ($tables as $sub_table) {\n $content .= Export::convert_array_to_html($sub_table).'<br /><br />';\n }\n }\n } else {\n $content = Export::convert_array_to_html(\n $data_table,\n array('header_attributes' => array('align' => 'center'))\n );\n }\n\n $params = array(\n 'filename' => get_lang('Attendance').'-'.api_get_local_time(),\n 'pdf_title' => $courseInfo['title'],\n 'course_code' => $courseInfo['code'],\n 'add_signatures' => true,\n 'orientation' => 'landscape',\n 'pdf_teachers' => $teacherName,\n 'pdf_course_category' => $courseCategory['name'],\n 'format' => 'A4-L',\n 'orientation' => 'L'\n );\n\n Export::export_html_to_pdf($content, $params);\n exit;\n }",
"function report() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n if (!empty($_POST)) {\n if (isset($_POST['type'])) {\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n $resultData = $this->webservicemodel->getReportData($getData);\n if ($resultData) {\n $exportData = array();\n foreach ($resultData as $record) {\n $total_due = $record[\"costo_base\"] + $record[\"importo_tasse_volo\"] + $record[\"importo_aeroporto_aggiuntivo\"] + $record[\"supplementi\"];\n $balance = round(( $total_due - $record[\"pagamenti\"]), 2);\n\n $exportRecord = array(\n 'Accompagnatore' => $record['accompagnatore'],\n 'Collaboratore' => $record['collaboratore'],\n 'Prodotto' => $record['prodotto'],\n 'Codice Prodotto' => $record['codice_prodotto'],\n 'Passeggero' => $record['passeggero'],\n 'Tipologia Passeggero' => $record['tipologia_passeggero'],\n 'Total Due' => $total_due,\n 'Balance' => $balance\n );\n array_push($exportData, $exportRecord);\n }\n $this->load->library('export');\n $this->export->to_excel($exportData, 'webservicereport');\n } else\n redirect('webservice');\n }\n else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n// $data['report_data'] = $this->webservicemodel->getReportData($getData);\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report_data', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report_data', $data);\n }\n }\n } else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n\n $data['tipologia_passeggero'] = $this->webservicemodel->getDistinctDataByField('tipologia_passeggero');\n $data['glf'] = $this->webservicemodel->getDistinctDataByField('glf');\n $data['accompagnatore'] = $this->webservicemodel->getDistinctDataByField('accompagnatore');\n $data['collaboratore'] = $this->webservicemodel->getDistinctDataByField('collaboratore');\n $data['codice_prodotto'] = $this->webservicemodel->getDistinctDataByField('codice_prodotto');\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report', $data);\n }\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }",
"function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course AND Exam_Remark IS NULL\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course AND Exam_Remark IS NULL\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}",
"public function feVisitReportAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$comment\t= isset($params['comment'])?$params['comment']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$fe_report = array(); \n\n\t\t\t\t\t$fe_report['comment'] = $comment;\n\n\t\t\t\t\t$fe_report['farmer_code'] = $farmer_code;\n\t\t\t\t\t$fe_report['farmer_id'] = $farmerID;\n\t\t\t\t\t$fe_report['fe_code'] = $LoginID;\n\t\t\t\t\t$fe_report['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$fe_report['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_fevisit_report', $fe_report);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Fe report Detail Inserted successfully.', 'fe_report_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}",
"public function tms_report() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayText = \"Total Amount Received for Paid invoices :\";\n $export_url = '?payStatus=1';\n } else if ($_POST['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayText = \"Total Amount Due for unpaid invoices :\";\n $export_url = '?payStatus=2';\n }\n $data['text'] = $displayText;\n $year = $_POST['yearVal'];\n $month = $_POST['monthVal'];\n $training_score1 = $_POST['trainingStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['payStatus'] == '1') {\n $data['result'] = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_POST['payStatus'] == '2') {\n $data['result'] = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }",
"public function actionReport()\n\t{\n\t\t$model = new AutoChores();\n\t\t$results = array();\n\t\t$errors = array();\n\t\t$isPrint = 0;\n\t\t//exit;\n\t\tif(isset($_REQUEST['go'])){\n\t\t if(!isset($_REQUEST['go']))\n \t\t $isPrint = 1;\n\t\t\tif(empty($_REQUEST['from_date'])){\n\t\t\t\t$errors[\"from_date\"] = \"Invalid From Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['to_date'])){\n\t\t\t\t$errors[\"to_date\"] = \"Invalid To Date\";\n\t\t\t}\n\t\t\tif(empty($_REQUEST['farm'])){\n\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}else {\n\t\t\t\t$qtxt =\"SELECT farm_herd FROM herd_setup WHERE farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t$res =$command->queryColumn();\n\n\t\t\t\tif($_REQUEST['farm'] != 'A' && (!isset($res[0]) || $res[0] != $_REQUEST['farm']))\n\t\t\t\t\t$errors[\"farm\"] = \"Invalid Farm & Herd\";\n\t\t\t}\n\t\t\tif(count($errors) == 0) {\n\t\t\t\t$results1 = $this->dateRange($_REQUEST['from_date'], $_REQUEST['to_date'],'+1 day','m/d/Y');\n\t\t\t\tforeach ($results1 as $result) {\n\t\t\t\t\t$qtxt = \"SELECT * FROM chores WHERE date = '\".$result.\"' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND farm_herd = '\".$_REQUEST['farm'].\"' \";\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res =$command->queryAll();\n\t\t\t\t\t//$results[$result] = $res;\n\n\t\t\t\t\t//D\n\t\t\t\t\t$qtxt = \"SELECT * FROM auto_chores WHERE generated_by = 'D' AND disabled = 'N' \";\n\t\t\t\t\tif($_REQUEST['farm'] != 'A')\n\t\t\t\t\t\t$qtxt .= \" AND (farm_herd = '\".$_REQUEST['farm'].\"' OR generated_by = 'A') \";\n\n\t\t\t\t\t$qtxt1 = \" ADDDATE(date_asof, days_after) = '\".$result.\"' \";\n\t\t\t\t\t$qtxt2 = \" ADDDATE(date_asof, (days_after+(times_occur*days_between))) = '\".$result.\"' AND times_occur >= 2\";\n\t\t\t\t\t$qtxt .= \" AND ((\".$qtxt1.\") OR (\".$qtxt2.\")) \";\n\n\n\t\t\t\t\t$command =Yii::app()->db->createCommand($qtxt);\n\t\t\t\t\t$res1 =$command->queryAll();\n\t\t\t\t\t$results[$result] = array_merge($res,$res1);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$model->addErrors($errors);\n\t\t\t}\n\t\t}\n\n\n\t\t$this->render('report',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'results'=>$results,\n\t\t 'isPrint'=>$isPrint,\n\n\t\t));\n\t}",
"public function actionOutputIndex()\n {\n\t\tset_time_limit(0);\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t\n\t\t\n\t\t$sort = Yii::$app->request->queryParams['sort']?Yii::$app->request->queryParams['sort']:'signdate';\n\t\t\n\t\tif($sort{0}==\"-\"){\n\t\t\t$orderBy = substr($sort,1).\" desc\";\n\t\t}else{\n\t\t\t$orderBy = \" {$sort} ASC\";\n\t\t}\n\t\t$result = $dataProvider->query->orderBy($orderBy)->asArray()->all();\n\t\t// var_dump($result);exit;\n $arr = [];\n $ic = 1; \n foreach($result as $r) {\n\t\t\t$r['signtime1'] = $r[\"signtime1\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime1\"];\n\t\t\t$r['signtime2'] = $r[\"signtime2\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime2\"];\n\t\t\t\n\t\t\t\n\t\t\t$r['signstatus'] = $r['signstatus_valid']?:$r['signstatus'];\n\t\t\t$r['latetime'] = $r['latetime']-$r['latetime_valid'];\n\t\t\t$r['overtime'] = $r['overtime_valid'];\n $arr[] = $r;\n }\n\t\t$header = [\n 'id' => 'ID',\n 'personnel_id' => '员工ID',\n 'employeeid' => '工号',\n 'username' => '员工姓名',\n 'signdate' => '签到日期',\n 'dayofweek' => '星期几',\n 'signtime1' => '上班签到',\n 'signtime2' => '下班签到',\n 'timediff' => '工作时长',\n 'signstatus' => '签到状态',\n 'latetime' => '迟到分钟',\n 'overtime' => '加班时长',\n 'memo' => '备注',\n ];\n\t\t$columns = array_keys($header);\n\t\t\n\t\t \n \\moonland\\phpexcel\\Excel::export([\n\t\t\t'isMultipleSheet' => true,\n\t\t\t'models' => [\n\t\t\t\t'考勤报表' => $arr, \n\t\t\t],\n\t\t\t'columns' => [\n\t\t\t\t'考勤报表' => $columns,\n\t\t\t], \n\t\t\t'headers' => [\n\t\t\t\t'考勤报表' => $header, \n\t\t\t],\n ]);\n }",
"public function genattpdf($getatt){\n\t\t$data['getatt']=$getatt;\n\t\t\tforeach($getatt as $row){\n\t\t\t\t$asmid=$row->ca_asmid;\n\t\t\t\t$centerid=$row->ca_centername;\n\t\t\t\t$cname = $this->commodel->get_listspfic1('admissionstudent_enterenceexamcenter','eec_name','eec_id',$centerid)->eec_name;\n\t\t\t\t$year=date('Y');\n \t \t// move file to directory code for photo\n\t\t\t\t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year;\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t}\n\n \t \t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence';\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t\t }\n\n\t\t\t\t$this->acadyear = $this->usermodel->getcurrentAcadYear();\n\t\t\t\t\t\t\n\t\t\t\t//add pdf code to store and view pdf file\n\t\t\t\t$temp = $this->load->view('enterenceadmin/attendencepdf', $data, TRUE);\n\t\t\t\t//$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$cname.'.pdf';\n\t\t\t\t$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$centerid.'.pdf';\n\t\t\t\t$this->commodel->genpdf($temp,$pth);\n\t\t\t\t$master = array(\n\t\t \t\t'ca_attendencesheetstatus' => 'Y',\n\t \t \t\t);\n \t\t\t\t$this->commodel->updaterec('admissionstudent_centerallocation', $master,'ca_asmid',$asmid);\n\t\t\t\t$this->logger->write_logmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\");\n \t\t$this->logger->write_dblogmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\" );\n\t\t\t}\n\t}",
"public function indexAction()\n {\n\t\t$this->verifySessionRights();\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$employee=$this->getConnectedEmployee();\n\t\t$this->setActivity($employee->getName().\" \".$employee->getFirstname().\"'s Agenda is consulted by this user\");\n\t\t$aTimes = $this->getAgendaTime();\n\t\t$aDates = $this->getDatesOfWeek();\t\n\t\t$aDkey = array_keys($aDates);\n\t\t$aAgenda = $this->generateAgenda($employee,$aTimes,$aDates);\n\t\t$aFormatdate = $this->formatDate($aDates);\n//print_r($aAgenda);\n/*\necho $aAgenda[4]['endpm'];\necho \"<br>\".$this->getCreatingTsHour();\nif(isset($aAgenda[4]['endpm']) and $this->getCreatingTsHour()>0 and $this->getCreatingTsHour()<$aAgenda[4]['endpm']) \n\techo \"yes\";\nelse \n\techo \"No\";\nexit(0);\n*/\n \treturn $this->render('BoHomeBundle:Agenda:index.html.twig', array(\n \t\t'employee' => $employee,\n\t\t\t'agenda'=>$aAgenda,\n\t\t\t'datekeys'=>$aDkey,\n\t\t\t'dates'=>$aDates,\n\t\t\t'cth'=>$this->getCreatingTsHour(),//cth is the time when the teacher can do the timesheet \n\t\t\t'higham'=>$this->getHighEndAm($aAgenda),\n\t\t\t'formatdates'=>$aFormatdate,\n\t\t\t'ttkeys'=>array_keys($aTimes),\n\t\t\t'today'=> new \\DateTime(date(\"d-m-Y\")),\n\t\t\t'times'=>$aTimes,\n\t\t\t'pm'=>\"tabeau-bord\",\n\t\t\t'sm'=>\"agenda\",\n \t));\n }",
"public function reportDatewiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"public function index(){\t\n\t\t// set the page title\n\t\t$this->set('title_for_layout', 'Approve Waive Off Request- HRIS - BigOffice');\n\t\t\n\t\t// get employee list\t\t\n\t\t$emp_list = $this->HrAttWaive->get_team($this->Session->read('USER.Login.id'),'L');\n\t\t$format_list = $this->Functions->format_dropdown($emp_list, 'u','id','first_name', 'last_name');\t\t\n\t\t$this->set('empList', $format_list);\n\t\t\n\t\n\t\t// when the form is submitted for search\n\t\tif($this->request->is('post')){\n\t\t\t$url_vars = $this->Functions->create_url(array('keyword','emp_id','from','to'),'HrAttWaive'); \n\t\t\t$this->redirect('/hrattwaive/?'.$url_vars);\t\t\t\n\t\t}\t\t\t\t\t\n\t\t\n\t\tif($this->params->query['keyword'] != ''){\n\t\t\t$keyCond = array(\"MATCH (reason) AGAINST ('\".$this->params->query['keyword'].\"' IN BOOLEAN MODE)\"); \n\t\t}\n\t\tif($this->params->query['emp_id'] != ''){\n\t\t\t$empCond = array('HrAttWaive.app_users_id' => $this->params->query['emp_id']); \n\t\t}\n\t\t// for date search\n\t\tif($this->params->query['from'] != '' || $this->params->query['to'] != ''){\n\t\t\t$from = $this->Functions->format_date_save($this->params->query['from']);\n\t\t\t$to = $this->Functions->format_date_save($this->params->query['to']);\t\t\t\n\t\t\t$dateCond = array('HrAttWaive.created_date between ? and ?' => array($from, $to)); \n\t\t}\n\t\t\n\t\t\n\t\t// fetch the attendance data\t\t\n\t\t$this->paginate = array('fields' => array('id', 'created_date',\t\"date_format(HrAttWaive.date, '%Y-%m') as month\",\n\t\t\"date_format(HrAttWaive.date, '%M, %Y') as month_display\", 'HrEmployee.first_name', 'HrEmployee.last_name','status','approve_date', 'HrEmployee.id', 'count(*) no_req'),\n\t\t'limit' => 10,'conditions' => array($keyCond, \n\t\t$empCond, $dateCond, 'is_draft' => 'N'), 'group' => array('HrEmployee.id',\"date_format(HrAttWaive.date, '%Y-%m')\"),\n\t\t'order' => array('HrAttWaive.created_date' => 'desc'));\n\t\t$data = $this->paginate('HrAttWaive');\n\t\t\n\t\t$this->set('att_data', $data);\n\t\t\n\t\t\n\t\n\t\tif(empty($data)){\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>You have no waive-off request to approve', 'default', array('class' => 'alert alert'));\t\n\t\t}\n\t\t\n\t\t\n\t}",
"public function invoice_audit_trail_export_PDF() {\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $query = $this->reportsModel->get_invoice_audit_trail($tenant_id, NULL, NULL, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n $this->load->helper('pdf_reports_helper');\n return invoice_audit_trail_report_PDF($query, $tenant_details);\n }",
"public function makeReport()\n {\n }",
"function admin_export_patients($id=NULL) // template for new classes\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['home_clinic'] = $_SESSION['location_id'];\r\n\t\t$data['title'] = \"Export Patients\";\r\n\t\t$data['form_purpose'] = \t\"new_export\";\r\n $data['now_id'] = time();\r\n\t\t$data['unsynched_list'] = $this->madmin_rdb->get_unsynched_patients($data['home_clinic']);\r\n\t\t$data['synched_list'] = $this->madmin_rdb->get_unsynched_patients($data['home_clinic'],TRUE);\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_emr_wap\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_wap\";\r\n $new_body = \"ehr/emr_newpage_wap\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_export_patients_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\t\r\n }",
"public function reportTodayAttendent()\n {\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n return view('report.reportTodayAttendent')->with('shift',$shift)->with('dept',$dept);\n }",
"public function dtexamattemptreport()\n {\n $condition = \"\";\n $search_type = $this->input->post('search_type');\n $date_type = $this->input->post('date_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $data['searchlist'] = $this->customlib->get_searchtype();\n $data['date_type'] = $this->customlib->date_type();\n\n $data['date_typeid'] = '';\n if (isset($search_type) && $search_type != '') {\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $search_type;\n } else {\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n\n if (isset($_POST['date_type']) && $_POST['date_type'] != '') {\n\n $data['date_typeid'] = $_POST['date_type'];\n\n if ($search_type == 'exam_from_date') {\n\n $condition .= \" and date_format(onlineexam.exam_from,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n } elseif ($date_type == 'exam_to_date') {\n $condition .= \" and date_format(onlineexam.exam_to,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n }\n\n } else {\n\n $condition .= \" and date_format(onlineexam.created_at,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n }\n\n $result = $this->onlineexam_model->onlineexamatteptreport($condition);\n $sch_setting = $this->sch_setting_detail;\n $resultlist = json_decode($result);\n $dt_data = array();\n\n if (!empty($resultlist->data)) {\n foreach ($resultlist->data as $resultlist_key => $student_value) {\n\n $exams = explode(',', $student_value->exams);\n\n $exam_name = '';\n $exam_from = '';\n $exam_to = '';\n $exam_duration = '';\n $exam_publish = \"\";\n $exam_resultpublish = \"\";\n $exam_publishprint = \"\";\n $exam_resultpublishprint = \"\";\n foreach ($exams as $exams_key => $exams_value) {\n $exam_details = explode('@', $exams_value);\n\n if (count($exam_details) == 9) {\n\n $exam_name .= $exam_details[1];\n $exam_from .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[3]));\n $exam_to .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[4]));\n $exam_duration .= $exam_details[5];\n $exam_publish .= ($exam_details[7] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n $exam_resultpublish .= ($exam_details[8] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n\n $exam_publishprint .= ($exam_details[7] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n $exam_resultpublishprint .= ($exam_details[8] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n\n $exam_name .= '<br>';\n $exam_from .= \"<br>\";\n $exam_to .= \"<br>\";\n $exam_duration .= \"<br>\";\n $exam_publish .= \"<br>\";\n $exam_resultpublish .= \"<br>\";\n $exam_publishprint .= \"<br>\";\n $exam_resultpublishprint .= \"<br>\";\n }\n }\n\n $row = array();\n $row[] = $this->customlib->getFullName($student_value->firstname, $student_value->middlename, $student_value->lastname, $sch_setting->middlename, $sch_setting->lastname);\n $row[] = $student_value->admission_no;\n\n $row[] = $student_value->class;\n $row[] = $student_value->section;\n $row[] = $exam_name;\n $row[] = $exam_from;\n $row[] = $exam_to;\n $row[] = $exam_duration;\n $row[] = $exam_publish . $exam_publishprint;\n $row[] = $exam_resultpublish . $exam_resultpublishprint;\n\n $dt_data[] = $row;\n }\n\n }\n $json_data = array(\n \"draw\" => intval($resultlist->draw),\n \"recordsTotal\" => intval($resultlist->recordsTotal),\n \"recordsFiltered\" => intval($resultlist->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }",
"function action_report($low, $high) {\n\n $range_l = '';\n $range_h = '';\n\n if(strcmp($low, '1000-01-01 00:00:00') == 0) {\n $range_l = \"site's beginning\";\n } else {\n $range_l = $low;\n }\n\n if(strcmp($high, '9999-12-31 23:59:59') == 0) {\n $range_h = \"now\";\n } else {\n $range_h = $high;\n }\n\n $freq_patient = user_freq($low, $high, \"Patient\");\n $freq_nurse = user_freq($low, $high, \"Nurse\");\n $freq_doctor = user_freq($low, $high, \"Doctor\");\n $freq_admin = user_freq($low, $high, \"Admin\");\n\n $total_patient = total_action_user($low, $high, \"Patient\");\n $total_nurse = total_action_user($low, $high, \"Nurse\");\n $total_doctor = total_action_user($low, $high, \"Doctor\");\n $total_admin = total_action_user($low, $high, \"Admin\");\n\n $freq_login = action_freq($low, $high, \"Logged In\");\n $freq_logout = action_freq($low, $high, \"Logged Out\");\n $freq_newuser = action_freq($low, $high, \"Created New User\");\n $freq_modrec = action_freq($low, $high, \"Modified Record\");\n $freq_apmt = action_freq($low, $high, \"Scheduled Appointment\");\n $freq_prescript = action_freq($low, $high, \"Prescription Written\");\n\n $total_login = total_action_action($low, $high, \"Logged In\");\n $total_logout = total_action_action($low, $high, \"Logged Out\");\n $total_newuser = total_action_action($low, $high, \"Created New User\");\n $total_modrec = total_action_action($low, $high, \"Modified Record\");\n $total_apmt = total_action_action($low, $high, \"Scheduled Appointment\");\n $total_prescript = total_action_action($low, $high, \"Prescription Written\");\n\n echo \"<h2>Activity report for interval from \".$range_l.\" to \".$range_h.\"</h2><br>\";\n \n echo \"<h3>Average Daily Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$freq_patient.\"</center></td><td><center>\".$freq_nurse.\"</center></td><td><center>\".$freq_doctor.\"</center></td><td><center>\".$freq_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Total number of Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$total_patient.\"</center></td><td><center>\".$total_nurse.\"</center></td><td><center>\".$total_doctor.\"</center></td><td><center>\".$total_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Average Daily Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$freq_login.\" </td><td>Logouts: \".$freq_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$freq_newuser.\" </td><td>Records Modified: \".$freq_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$freq_apmt.\"</td><td>Prescriptions Written: \".$freq_prescript.\"</td></tr></table>\";\n\n echo \"<h3>Total number of Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$total_login.\" </td><td>Logouts: \".$total_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$total_newuser.\" </td><td>Records Modified: \".$total_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$total_apmt.\"</td><td>Prescriptions Written: \".$total_prescript.\"</td></tr></table>\";\n\n\n }",
"public function overAllSummaryReportView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('door_holiday',0)->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // attendent holiday count\n $attendent_holiday_count = DB::table('holiday')->where('attendent_holiday',0)->where('holiday_date',$from)->count();\n // total staff\n $total_staff_count = DB::table('users')->where('trasfer_status',0)->whereNotIn('type',[10])->count();\n // total teacher count \n $total_teacher_count = DB::table('users')->where('trasfer_status',0)->where('type',3)->count();\n // total staff enter into the campus\n $total_staff_enter_into_campus = DB::table('tbl_door_log')->where('type',1)->whereNotIn('user_type',[10])->where('enter_date',$from)->distinct('user_id')->count('user_id');\n\n // total staff leave\n $total_staff_leave_count = DB::table('tbl_leave')->where('final_request_from',$from)->where('status',1)->count();\n $total_teacher_leave_count = DB::table('tbl_leave')\n ->join('users', 'users.id', '=', 'tbl_leave.user_id')\n ->select('tbl_leave.*')\n ->where('users.type', 3)\n ->where('final_request_from',$from)\n ->where('status',1)\n ->count();\n $total_teacher_attendent_in_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->distinct('teacherId')->count('teacherId');\n // total class of this day\n $total_class_count = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->count();\n\n // total teacher attendent class\n $teacher_taken_total_class_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->count();\n #--------------------------------- student section------------------------------------#\n $total_student_count = DB::table('student')\n ->join('semister', 'student.semister_id', '=', 'semister.id')\n ->select('student.*')\n ->where('student.year', $from_year)\n ->where('student.status', 0)\n ->where('semister.status',1)\n ->count();\n $total_student_enter_into_campus = DB::table('tbl_door_log')->where('type',2)->where('enter_date',$from)->distinct('student_id')->count('student_id');\n $total_student_enter_into_class = DB::table('student_attendent')->where('created_at',$from)->distinct('studentId')->count('studentId');\n // total hours class of this day\n $total_class_hour_in_routine = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->get();\n // total hours class held\n $total_hours_class_held_query = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->get(); \n\n return view('view_report.overAllSummaryReportView')\n ->with('total_staff_count',$total_staff_count)\n ->with('total_teacher_count',$total_teacher_count)\n ->with('total_staff_enter_into_campus',$total_staff_enter_into_campus)\n ->with('total_staff_leave_count',$total_staff_leave_count)\n ->with('total_teacher_leave_count',$total_teacher_leave_count)\n ->with('total_teacher_attendent_in_class',$total_teacher_attendent_in_class)\n ->with('total_class_count',$total_class_count)\n ->with('teacher_taken_total_class_class',$teacher_taken_total_class_class)\n ->with('from',$from)\n ->with('attendent_holiday_count',$attendent_holiday_count)\n ->with('total_student_count',$total_student_count)\n ->with('total_student_enter_into_campus',$total_student_enter_into_campus)\n ->with('total_student_enter_into_class',$total_student_enter_into_class)\n ->with('total_class_hour_in_routine',$total_class_hour_in_routine)\n ->with('total_hours_class_held_query',$total_hours_class_held_query)\n ;\n }",
"public function actionOutputStatistical()\n {\n\t\tset_time_limit(0);\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->statistictalSearch(Yii::$app->request->queryParams);\n\t\t \n\t\t$sort = Yii::$app->request->queryParams['sort']?Yii::$app->request->queryParams['sort']:'signdate';\n\t\t\n\t\tif($sort{0}==\"-\"){\n\t\t\t$orderBy = substr($sort,1).\" desc\";\n\t\t}else{\n\t\t\t$orderBy = \" {$sort} ASC\";\n\t\t}\n\t\t$result = $dataProvider->query->orderBy($orderBy)->asArray()->all();\n $arr = []; \n foreach($result as $r) {\n $arr[] = $r;\n }\n\t\t$header = [\n 'year' => '年', \n 'month' => '月', \n 'personnel_id' => '员工ID', \n 'username' => '员工姓名', \n 'overtime' => '当月加班时长(计算)', \n 'overtime_valid' => '当月加班时长(有效)', \n ];\n\t\t$columns = array_keys($header);\n \\moonland\\phpexcel\\Excel::export([\n 'isMultipleSheet' => true,\n\t\t\t'models' => [\n\t\t\t\t'考勤统计' => $arr, \n\t\t\t],\n\t\t\t'columns' => [\n\t\t\t\t'考勤统计' => $columns,\n\t\t\t], \n\t\t\t'headers' => [\n\t\t\t\t'考勤统计' => $header, \n\t\t\t],\n ]);\n }",
"public function basicreport()\n\t{\n\t\t\n\t\t$disp_msg = $this->session->flashdata('disp_msg');\n\t\t\n\t\t\n\t\t$search_filters = array();\n\t\t$search_results = array();\n\t\t\n\t\t$search_query = \"SELECT * FROM postpatch_schedule WHERE 1=1 \";\n\t\t\n\t\tif (!empty($_POST)) {\n\t\t\tif(!empty($_POST['dpa_flexinet_id']) && count($_POST['dpa_flexinet_id'])>0) {\n\t\t\t\t$dpavals = implode(\"' , '\", $_POST['dpa_flexinet_id']);\n\t\t\t\t$search_query .= \" AND dpa_flexinet IN ('\".$dpavals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['verificationstatus']) && count($_POST['verificationstatus'])>0) {\n\t\t\t\t$verfstatusvals = implode(\"' , '\", $_POST['verificationstatus']);\n\t\t\t\t$search_query .= \" AND verificationstatus IN ('\".$verfstatusvals.\"') \";\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($_POST['scheduledate']) && count($_POST['scheduledate'])>0) {\n\t\t\t\t$scdvals = implode(\"' , '\", $_POST['scheduledate']);\n\t\t\t\t$search_query .= \" AND scheduledate IN ('\".$scdvals.\"') \";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$search_query_res = $this->commonclass->execute_rawquery($search_query);\n\t\t$search_results = $search_query_res->result_array();\n\t\t\n\t\t$dpa_emps = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(dpa_flexinet) as dpa_flexinet ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($dpa_emps)>0) {\n\t\t\tforeach($dpa_emps as $onedpa) {\n\t\t\t\t$search_filters['dpa'][] = $onedpa['dpa_flexinet'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$verf_status_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(verificationstatus) as verificationstatus ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($verf_status_res)>0) {\n\t\t\tforeach($verf_status_res as $oneverif) {\n\t\t\t\t$search_filters['verf_status'][] = $oneverif['verificationstatus'];\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$scheduledate_res = $this->commonclass->retrive_records('postpatch_schedule', ' DISTINCT(scheduledate) as scheduledate ', \"\",array(\"dpa_flexinet\" => \"ASC\"),'');\n\t\tif (count($scheduledate_res)>0) {\n\t\t\tforeach($scheduledate_res as $oneverif1) {\n\t\t\t\t$search_filters['scheduledates'][$oneverif1['scheduledate']] = ($oneverif1['scheduledate'] != \"0000-00-00\") ? $this->commonclass->dateformat1($oneverif1['scheduledate']) : \"00/00/0000\";\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t## ____________ Data sending to the template starts ____________ ##\n\t\t$data['disp_msg'] = $disp_msg; # display messages\n\t\t$data['search_filters'] = $search_filters; # search_filters\n\t\t$data['search_results'] = $search_results; # search_filters\n\t\t//$data['postpatch_uploads'] = $postpatch_uploads; # postpatch_schedule\n\t\t\n\t\t## ____________ Data sending to the template ends here ____________ ##\n\t\t\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/header', $data); # html view page\n\t\t$this->load->view('admin/report1-page', $data); # html view page\n\t\t$this->load->view('layout/'.$this->sel_theam_path.'/footer', $data); # html view page\n\t}",
"public function reportDatewiseClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }"
] | [
"0.76985073",
"0.7221716",
"0.6984586",
"0.6580522",
"0.650633",
"0.6465776",
"0.63977027",
"0.63785875",
"0.6225617",
"0.6208223",
"0.61751956",
"0.614161",
"0.6124895",
"0.61182946",
"0.6103934",
"0.61004525",
"0.6095921",
"0.6072185",
"0.60597414",
"0.603011",
"0.5998244",
"0.5995478",
"0.5983425",
"0.5981332",
"0.59759796",
"0.59372586",
"0.5935564",
"0.5927218",
"0.59226745",
"0.5922098"
] | 0.8395774 | 0 |
generate_subject_code_attendance_report function. commit 10/11/2018 | public function generate_subject_code_attendance_report(){
$this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));
// get inputs
$con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));
$range1 = $this->input->post('date_range1');
$range2 = $this->input->post('date_range2');
// get necessary report data
$students = $this->admin_model->getStudentsBasicInfo($con,'a');
$attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);
$att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);
$att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');
// generate report data in pdf or csv format from admin_report_model
if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){
if(!empty($attendance) && !empty($att_record)){
if($this->input->post('export_csv')){
$this->admin_report_model->generateStudentAttendanceBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);
exit;
}else if($this->input->post('export_pdf')){
$this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);
}
}
$this->session->set_flashdata('warning', 'No reports found!.');
}else{
$this->session->set_flashdata('danger', 'Invalid input.');
}
redirect('attendance_report');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generate_subject_code_remarks_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }",
"public function generate_voc_program_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar'));\n // get inputs\n $condition= array('vocational_program'=>$this->input->post('vocational_program'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $voc_program= $this->vocational_program_model->getVocationalPrograms('s',array('voc_program_id'=>$condition['vocational_program']));\n $students = $this->admin_model->getStudentsBasicInfo($condition,'a');\n $attendance = $this->admin_model->getStudentAttendanceByVocationalProgram($students,$range1,$range2,$condition['batch_year']);\n $att_record = $this->admin_model->getStudentDailyAttendanceRecord($students,$range1,$range2,$condition['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($condition['vocational_program']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceByVocationalProgramCsv($attendance,$att_record,$att_dates,$voc_program,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateVocProgramAttendanceReportPdf($attendance,$voc_program,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n redirect('attendance_report');\n }\n $this->session->set_flashdata('danger', 'Invalid input.');\n redirect('attendance_report');\n \n }",
"public function generate()\n {\n $start_year = $this->_vars['start_year'];\n $start_month = $this->_vars['start_month'];\n $start_day = $this->_vars['start_day'];\n\n $end_year = $this->_vars['end_year'];\n $end_month = $this->_vars['end_month'];\n $end_day = $this->_vars['end_day'];\n\n $code = '';\n\n if (empty($this->_vars['start']) || empty($this->_vars['end'])) {\n return $this->_vacationCode();\n } elseif ($end_year > $start_year + 1) {\n $code .= $this->_yearCheck($start_year + 1, $end_year - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\"\n . $this->_yearCheck($start_year, $start_year);\n if ($start_month < 12) {\n $code .= $this->_monthCheck($start_month + 1, 12)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\\n\"\n . $this->_yearCheck($end_year, $end_year);\n if ($end_month > 1) {\n $code .= $this->_monthCheck(1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\";\n } elseif ($end_year == $start_year + 1) {\n $code .= $this->_yearCheck($start_year, $start_year);\n if ($start_month < 12) {\n $code .= $this->_monthCheck($start_month + 1, 12)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\\n\"\n . $this->_yearCheck($end_year, $end_year);\n if ($end_month > 1) {\n $code .= $this->_monthCheck(1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n}\";\n } elseif ($end_year == $start_year) {\n $code .= $this->_yearCheck($start_year, $start_year);\n if ($end_month > $start_month) {\n if ($end_month > $start_month + 1) {\n $code .= $this->_monthCheck($start_month + 1, $end_month - 1)\n . $this->_vacationCode()\n . \"\\n}\\n\";\n }\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, 31)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\"\n . $this->_monthCheck($end_month, $end_month)\n . $this->_dayCheck(1, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\";\n } elseif ($end_month == $start_month) {\n $code .= $this->_monthCheck($start_month, $start_month)\n . $this->_dayCheck($start_day, $end_day)\n . $this->_vacationCode()\n . \"\\n}\\n}\\n\";\n }\n $code .= \"}\";\n }\n\n return $code;\n }",
"function generateMeetingAttendanceReport($args) {\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$ercMembers = Request::getUserVar('ercMembers');\r\n\t\t\r\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\r\n\t\tif ($fromDate != null) $fromDate = date('Y-m-d H:i:s', $fromDate);\r\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\r\n\t\tif ($toDate != null) $toDate = date('Y-m-d H:i:s', $toDate);\r\n\t\t$meetingDao = DAORegistry::getDAO('MeetingDAO');\r\n\t\t$userDao = DAORegistry::getDAO('UserDAO');\r\n\t\t\r\n\t\theader('content-type: text/comma-separated-values');\r\n\t\theader('content-disposition: attachment; filename=meetingAttendanceReport-' . date('Ymd') . '.csv');\r\n\t\t\r\n\t\t$columns = array(\r\n\t\t'lastname' => Locale::translate('user.lastName'),\r\n\t\t'firstname' => Locale::translate('user.firstName'),\r\n\t\t'middlename' => Locale::translate('user.middleName'),\r\n\t\t'meeting_date' => Locale::translate('editor.reports.meetingDate'),\r\n\t\t'present' => Locale::translate('editor.reports.isPresent'),\r\n\t\t'reason_for_absence' => Locale::translate('editor.reports.reason')\r\n\t\t);\r\n\t\t$yesNoArray = array('present');\r\n\t\t$yesnoMessages = array( 0 => Locale::translate('common.no'), 1 => Locale::translate('common.yes'));\r\n\t\t$fp = fopen('php://output', 'wt');\r\n\t\tString::fputcsv($fp, array_values($columns));\r\n\t\t\r\n\t\tforeach ($ercMembers as $member) {\r\n\t\t\t$user = $userDao->getUser($member);\r\n\t\t\tlist($meetingsIterator) = $meetingDao->getMeetingReportByReviewerId($member, $fromDate, $toDate);\r\n\t\t\r\n\t\t\t$meetings = array();\r\n\t\t\twhile ($row =& $meetingsIterator->next()) {\r\n\t\t\t\tforeach ($columns as $index => $junk) {\r\n\t\t\t\t\tif (in_array($index, $yesNoArray)) {\r\n\t\t\t\t\t\t$columns[$index] = $yesnoMessages[$row[$index]];\r\n\t\t\t\t\t} elseif ($index == \"lastname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getLastName();\r\n\t\t\t\t\t} elseif ($index == \"firstname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getFirstName();\r\n\t\t\t\t\t} elseif ($index == \"middlename\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getMiddleName();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$columns[$index] = $row[$index];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tString::fputcsv($fp, $columns);\r\n\t\t\t\tunset($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}",
"abstract public function buildReport();",
"public function genattpdf($getatt){\n\t\t$data['getatt']=$getatt;\n\t\t\tforeach($getatt as $row){\n\t\t\t\t$asmid=$row->ca_asmid;\n\t\t\t\t$centerid=$row->ca_centername;\n\t\t\t\t$cname = $this->commodel->get_listspfic1('admissionstudent_enterenceexamcenter','eec_name','eec_id',$centerid)->eec_name;\n\t\t\t\t$year=date('Y');\n \t \t// move file to directory code for photo\n\t\t\t\t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year;\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t}\n\n \t \t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence';\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t\t }\n\n\t\t\t\t$this->acadyear = $this->usermodel->getcurrentAcadYear();\n\t\t\t\t\t\t\n\t\t\t\t//add pdf code to store and view pdf file\n\t\t\t\t$temp = $this->load->view('enterenceadmin/attendencepdf', $data, TRUE);\n\t\t\t\t//$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$cname.'.pdf';\n\t\t\t\t$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$centerid.'.pdf';\n\t\t\t\t$this->commodel->genpdf($temp,$pth);\n\t\t\t\t$master = array(\n\t\t \t\t'ca_attendencesheetstatus' => 'Y',\n\t \t \t\t);\n \t\t\t\t$this->commodel->updaterec('admissionstudent_centerallocation', $master,'ca_asmid',$asmid);\n\t\t\t\t$this->logger->write_logmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\");\n \t\t$this->logger->write_dblogmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\" );\n\t\t\t}\n\t}",
"function attendance_report() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $student_id = $student_id = $this->session->userdata('parent_id');\n if ($this->input->post('month') != '' && $this->input->post('year') != '') {\n $page_data['month'] = $this->input->post('month');\n $page_data['year'] = $this->input->post('year');\n } else {\n $page_data['month'] = '';\n $page_data['year'] = '';\n }\n $page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['student_id'] = $student_id;\n $page_data['page_name'] = 'attendance_report';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $this->load->view('backend/index', $page_data);\n }",
"public function dtexamattemptreport()\n {\n $condition = \"\";\n $search_type = $this->input->post('search_type');\n $date_type = $this->input->post('date_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $data['searchlist'] = $this->customlib->get_searchtype();\n $data['date_type'] = $this->customlib->date_type();\n\n $data['date_typeid'] = '';\n if (isset($search_type) && $search_type != '') {\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $search_type;\n } else {\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n\n if (isset($_POST['date_type']) && $_POST['date_type'] != '') {\n\n $data['date_typeid'] = $_POST['date_type'];\n\n if ($search_type == 'exam_from_date') {\n\n $condition .= \" and date_format(onlineexam.exam_from,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n } elseif ($date_type == 'exam_to_date') {\n $condition .= \" and date_format(onlineexam.exam_to,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n }\n\n } else {\n\n $condition .= \" and date_format(onlineexam.created_at,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n }\n\n $result = $this->onlineexam_model->onlineexamatteptreport($condition);\n $sch_setting = $this->sch_setting_detail;\n $resultlist = json_decode($result);\n $dt_data = array();\n\n if (!empty($resultlist->data)) {\n foreach ($resultlist->data as $resultlist_key => $student_value) {\n\n $exams = explode(',', $student_value->exams);\n\n $exam_name = '';\n $exam_from = '';\n $exam_to = '';\n $exam_duration = '';\n $exam_publish = \"\";\n $exam_resultpublish = \"\";\n $exam_publishprint = \"\";\n $exam_resultpublishprint = \"\";\n foreach ($exams as $exams_key => $exams_value) {\n $exam_details = explode('@', $exams_value);\n\n if (count($exam_details) == 9) {\n\n $exam_name .= $exam_details[1];\n $exam_from .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[3]));\n $exam_to .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[4]));\n $exam_duration .= $exam_details[5];\n $exam_publish .= ($exam_details[7] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n $exam_resultpublish .= ($exam_details[8] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n\n $exam_publishprint .= ($exam_details[7] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n $exam_resultpublishprint .= ($exam_details[8] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n\n $exam_name .= '<br>';\n $exam_from .= \"<br>\";\n $exam_to .= \"<br>\";\n $exam_duration .= \"<br>\";\n $exam_publish .= \"<br>\";\n $exam_resultpublish .= \"<br>\";\n $exam_publishprint .= \"<br>\";\n $exam_resultpublishprint .= \"<br>\";\n }\n }\n\n $row = array();\n $row[] = $this->customlib->getFullName($student_value->firstname, $student_value->middlename, $student_value->lastname, $sch_setting->middlename, $sch_setting->lastname);\n $row[] = $student_value->admission_no;\n\n $row[] = $student_value->class;\n $row[] = $student_value->section;\n $row[] = $exam_name;\n $row[] = $exam_from;\n $row[] = $exam_to;\n $row[] = $exam_duration;\n $row[] = $exam_publish . $exam_publishprint;\n $row[] = $exam_resultpublish . $exam_resultpublishprint;\n\n $dt_data[] = $row;\n }\n\n }\n $json_data = array(\n \"draw\" => intval($resultlist->draw),\n \"recordsTotal\" => intval($resultlist->recordsTotal),\n \"recordsFiltered\" => intval($resultlist->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }",
"function generate_weekly_report_txt($c_data=array()){\n\t\t\n\t\tApp::import('Helper','txt');\n\t\t$txt = new txtHelper();\n\t\t$line = array(\"Store number\",\"Terminal\",\"Vendor\",\"Product\",\"Item\",\"Face Value\",\"Billed downloads\",\"Billed returns\",\"Net Billed Downloads\",\"Net Face Value\",\"Net Cost\",\"Net Commission\",\"Merchant\",\"Site\",\"Street\",\"Postcode\",\"City\",\"Duplicate Downloads\",\"All Downloads\",\"Duplicate Returns\",\"All Returns\",\"Net All Downloads\",\"Download Face Value\",\"Download Cost\",\"Download Commission\",\"Return Face Value\",\"Return Cost\",\"Return Commission\",\"From\",\"To\");\n\t\t$txt->addRow($line);\n\t\tif(!empty($c_data)){\n\t\t\tforeach($c_data as $data){\n\t\t\t\n\t\t\t\t$line = array($data['u']['u_id'],'X','X','X',$data['p']['p_id'],'X',$data['0']['total'],'X',$data['0']['total'],'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X');\n\t\t\t\t$txt->addRow($line);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $txt->render(date(\"d_M_Y_h_i_s\").\"_weekly\");\n\t\texit();\n\t}",
"public function report($typeId = null, $reportDate = null, $numOfDays = null, $classId = null, $sectionId = null)\n\t{\t\t\t\n\t\t$year = substr($reportDate, 0, 4);\n\t\t$month = substr($reportDate, 5, 7);\t\t\n\n\t\t$classData = $this->model_classes->fetchClassData($classId);\n\t\t$sectionData = $this->model_section->fetchSectionByClassSection($classId, $sectionId);\n\n\t\t\t// student\t\t\t\n\t\t\t$div = '<div class=\"well\">\n\t\t\t\t<center>\n\t\t\t\t\t<h4> Ngành học: '.$classData['class_name'].'<br> Lớp học : '.$sectionData['section_name'].'<h4>\n\t\t\t\t\t<h4> Năm : '.$year.' - Month :'.$month.'<h4>\t\t\n\t\t\t\t\t<small>\t\n\t\t\t\t\t\t1 : Tiết 1-2 ( 7h00-8h45) <br />\t\t\t\t\n\t\t\t\t\t\t2 : Tiết 3-4 (9h-10h45) <br />\n\t\t\t\t\t\t3 : Tiết 5-6 (13h - 14h45)<br />\n\t\t\t\t\t\t4 : Tiết 7-8 (15h-16h45)<br />\n\t\t\t\t\t\t\t5 : Tiết 9-10 (17h00 - 18h45)<br />\n\t\t\t\t\t</small>\n\t\t\t\t</center>\n\t\t\t</div>\n\n\t\t\t<div style=\"overflow-x:auto;\">\t\t\t\n\t\t\t<table class=\"table table-bordered\" style=\"width:100%;\">\t\t\t\n\t\t\t\t<tbody style=\"width:100%;\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"width:25%;\">Môn học</td>\n\t\t\t\t\t\t';\t\t\n\t\t\t\t\t\t// loop for days\n\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t<td style=\"width:10%;\">'.$i.'</td>';\t\n\t\t\t\t\t\t} // /for\n\t\t\t\t\t$div .= '</tr>';\n\t\t\t\t\t\t\n\t\t\t\t\t$subjectInfo = $this->model_subject->fetchSubjectDataByClass($classId);\n\n\t\t\t\t\tforeach ($subjectInfo as $key => $value) {\n\t\t\t\t\t\t$subjectName = $value['name'];\n\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>'.$subjectName.'</td>';\n\n\t\t\t\t\t\t\tfor($i = 1; $i <= $numOfDays; $i++) {\n\t\t\t\t\t\t\t\t// $attendanceData = $this->model_attendance->getAttendance($i, $reportDate, $value['student_id'], $typeId, $classId, $sectionId);\n\t\t\t\t\t\t\t\t$scheduleData = $this->model_schedule->getAttendance($i, $reportDate, $value['subject_id'], $sectionId);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$div .= '<td>';\n\t\t\t\t\t\t\t\tforeach ($scheduleData as $scheduleKey => $scheduleValue) {\n\n\t\t\t\t\t\t\t\t\tif($scheduleValue['schedule_type'] == 1) {\n\t\t\t\t\t\t\t\t\t\t// Có mặt\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-success\">1</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 2) {\n\t\t\t\t\t\t\t\t\t\t// Vắng\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-primary\">2</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 3) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">3</span>';\t\n\t\t\t\t\t\t\t\t\t} else if($scheduleValue['schedule_type'] == 4) {\n\t\t\t\t\t\t\t\t\t\t// Trễ\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-warning\">4</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Không xác định\n\t\t\t\t\t\t\t\t\t\t$scheduleStatus = '<span class=\"label label-danger\">5</span>';\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$div .= $scheduleStatus;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$div .= '\n\t\t\t\t\t\t\t\t\t</td>';\t\n\t\t\t\t\t\t\t\t} // /for\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t$div .= '</tr>';\t\t\n\t\t\t\t\t} // /foreach\n\t\t\t\t$div .= '</tbody>\n\t\t\t\t</table>\n\t\t\t<div>';\t\t\t\n\t\t\techo $div;\n\t\t\n\n\t\t\n\t}",
"public function Get_Special_Report($semester,$year,$dept_id)\n {\n global $FILE_PATH;\n $semester_id = $this->DEADLINE->Search_Semester_id($semester,$year);\n if($semester_id)\n {\n $temp_course = $this->COURSE->Get_Dept_Course($dept_id,$semester_id);\n $dept_course = array();\n if(!isset($temp_course['status']))\n {\n for($i=0;$i<count($temp_course);$i++)\n {\n array_push($dept_course,$temp_course[$i]['id']);\n }\n }\n $DATA = array();\n $DATA['info'] = array();\n $DATA['download'] = $this->DOWNLOAD_URL.\"?course=all&type=report&dept=\".$dept_id.\"&info=special&semester=\".$semester.\"&year=\".$year;\n $sql = \"SELECT DISTINCT `course_id` FROM `course_hire_special_instructor` WHERE `status` = '1' AND `semester_id` = \".$semester_id;\n $result_course = $this->DB->Query($sql);\n if($result_course)\n {\n for($i=0;$i<count($result_course);$i++)\n {\n if(!in_array($result_course[$i]['course_id'],$dept_course))\n {\n continue;\n }\n $sql = \"SELECT si.`instructor_id`,si.`prefix`,si.`firstname`,si.`lastname`,si.`cv` FROM `course_hire_special_instructor` ci ,`special_instructor` si \";\n $sql.= \"WHERE ci.`instructor_id` = si.`instructor_id` AND ci.`course_id` = '\".$result_course[$i]['course_id'].\"' AND ci.`status` = '1' AND ci.`semester_id` = \".$semester_id;\n $result_instructor = $this->DB->Query($sql);\n $data = array();\n $data['id'] = $result_course[$i]['course_id'];\n $data['name'] = $this->COURSE->Get_Course_Name($data['id']);\n $data['special'] = array();\n if($result_instructor)\n {\n for($j=0;$j<count($result_instructor);$j++)\n {\n $instructor['id'] = $result_instructor[$j]['instructor_id'];\n $instructor['name'] = $result_instructor[$j]['prefix'].' '.$result_instructor[$j]['firstname'].' '.$result_instructor[$j]['lastname'];\n $instructor['cv'] = $this->PERSON->Get_CV($instructor['id']);\n $instructor['pdf'] = $this->VIEW_URL.\"?course=\".$data['id'].\"&id=\".$instructor['id'].\"&type=complete&info=special&semester=\".$semester.\"&year=\".$year;\n array_push($data['special'],$instructor);\n }\n }\n array_push($DATA['info'],$data);\n }\n }\n if(count($DATA['info']) == 0)\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n else\n {\n return $DATA;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n }",
"function generate_xls(){ \n //Would like to ask for term to generate report for. Can we do this?\n global $CFG, $DB, $USER;\n\n\n\n //find all workers\n $workers = $DB->get_records('block_timetracker_workerinfo');\n\n foreach($workers as $worker){\n //demo courses, et. al.\n if($worker->courseid >= 73 && $worker->courseid <= 76){\n continue;\n }\n\n $earnings = get_earnings_this_term($worker->id,$worker->courseid);\n \n $course = $DB->get_record('course', array('id'=>$worker->courseid));\n echo $course->shortname.','.$worker->lastname.','.$worker->firstname.\n ','.$earnings.','.$worker->maxtermearnings.\"\\n\";\n }\n}",
"function php_gen_report($date) {\r\n\r\n $uid = php_get_uid();\r\n $returnStatus['status'] = 'undefined';\r\n\r\n php_database_connect();\r\n\r\n $safe_uid = GetSQLValueString($uid, 'int');\r\n\r\n if (!php_check_convert_resv_date($date, $d, $m, $y)) {\r\n $returnStatus['status'] = 'Date format is incorrect';\r\n return $returnStatus;\r\n }\r\n\r\n //Get the date from the MySQL server.\r\n $query = \"SELECT DATE_FORMAT(NOW(),'%d, %M, %Y %h:%i%p') AS 'current_time'\";\r\n $rs = php_database_query($query);\r\n $timeInfo = mysql_fetch_array($rs);\r\n if (empty($timeInfo)) {\r\n $returnStatus['status'] = 'Cannot get the database server time';\r\n return $returnStatus;\r\n }\r\n\r\n $arrMonth = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');\r\n $strM = $arrMonth[$m];\r\n\r\n $header = '<h2>Reservation Report</h2>';\r\n $header = $header . '<h4>Current Date Time:' . $timeInfo['current_time'] . '</h4>';\r\n $header = $header . '<h4>Selected from:' . $d . ', ' . $strM . ', ' . $y . ' (Maximum 200 records will be shown)</h4>';\r\n\r\n //lookup table to query the output from restID, date, person, special request\r\n #and then lookup the customer name.\r\n $safe_timeslot = GetSQLValueString($y . '-' . $m . '-' . $d, 'date');\r\n\r\n $query = sprintf(\"SELECT id, cust_id, DATE_FORMAT(timeslot, '%%d, %%M, %%Y %%h:%%i%%p') AS datetime_timeslot, person, special_request, HEX(response) AS hex_response FROM resv WHERE rest_id = %s AND DATE(timeslot) >= DATE(%s) ORDER BY timeslot ASC LIMIT 200\", $safe_uid, $safe_timeslot);\r\n $rs = php_database_query($query);\r\n $body = '';\r\n\r\n while ($resvInfo = mysql_fetch_array($rs)) {\r\n $query = sprintf(\"SELECT fullname FROM customer WHERE id = %s\", $resvInfo['cust_id']);\r\n $custResult = php_database_query($query);\r\n $custInfo = mysql_fetch_array($custResult);\r\n if (empty($custInfo)) {\r\n $returnStatus['status'] = 'Cannot get the customer info';\r\n return $returnStatus;\r\n }\r\n\r\n $htmlElement['time'] = $resvInfo['datetime_timeslot'];\r\n $htmlElement['person'] = $resvInfo['person'];\r\n $htmlElement['customer_name'] = $custInfo['fullname'];\r\n $htmlElement['msg'] = $resvInfo['special_request'];\r\n $htmlElement['resv_id'] = $resvInfo['id'];\r\n $htmlElement['response'] = \"undefined\";\r\n\r\n switch (intval($resvInfo['hex_response'])) {\r\n case 0: //pending\r\n $htmlElement['response'] = 'pending';\r\n break;\r\n case 1: //decline\r\n $htmlElement['response'] = 'decline';\r\n break;\r\n case 2: //accept\r\n $htmlElement['response'] = 'accept';\r\n break;\r\n default:\r\n $htmlElement['response'] = 'undefined';\r\n }\r\n\r\n $body = $body . \"<tr><td>\" . $htmlElement['time'] . \"</td><td>\" . $htmlElement['customer_name'] . \"</td><td>\" . $htmlElement['person'] . \"</td><td>\" . $htmlElement['msg'] . \"</td><td>\" . $htmlElement['resv_id'] . \"</td><td>\" . $htmlElement['response'] . \"</td></tr>\\n\";\r\n }\r\n\r\n $body = \"<table><thead><tr><th>Date Time</th><th>Customer Name</th><th>Person</th><th>Special Request</th><th>Resv ID</th><th>Response</th></tr></thead>\\n<tfoot><tr><td colspan=\\\"6\\\">The end</td></tr></tfoot>\\n<tbody>\" . $body . \"</tbody></table>\";\r\n //re-factoring the query string\r\n\r\n $footer = \"\";\r\n\r\n $reportTxt = $header . $body . $footer;\r\n echo $reportTxt;\r\n\r\n $returnStatus['status'] = 'success';\r\n return $returnStatus;\r\n}",
"public function reportTeacherDatewiseAttendent()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n return view('report.reportTeacherDatewiseAttendent')->wit;\n }",
"function generate_report_modelwise($id, $field, $from, $to) {\n switch ($field) {\n case 'tl':\n $fieldName = 'Team_Lead';\n break;\n case 'dse':\n $fieldName = 'DSE';\n break;\n case 'asm':\n $fieldName = 'ASM_SM';\n break;\n case '6':\n $fieldName = 'Team_Lead';\n break;\n case '7':\n $fieldName = 'DSE';\n break;\n case '5':\n $fieldName = 'ASM_SM';\n break;\n }\n $empID = $id;\n $this->db->where('Inv_Dt >=', $from);\n $data = $this->db->get_where('rtl_daily_rep', array($fieldName => $id))->result_array();\n $countArr = array();\n\n foreach ($data as $k => $d) {\n if ($d['Model'] != 'Total_Target') {\n $id = $d['Model'];\n $countVar = 0;\n foreach ($data as $key => $var) {\n if ($id == $var['Model']) {\n $countVar++;\n }\n\n $countArr[strtoupper((string) $d['Model'])]['achieved'] = $countVar;\n $countArr[strtoupper((string) $d['Model'])]['target'] = 0;\n }\n }\n }\n\n $select = array(\n 'target_table_id',\n 'target_table_emp_id',\n 'employe_table_employe_name',\n 'target_table_product',\n 'target_table_product_qty',\n 'target_table_exp_date'\n );\n $toNxt = new DateTime($to);\n $toNxt->modify('+1 day');\n $to = date_format($toNxt,\"Y-m-d\");\n $col = 'target_table_emp_id';\n $Where = (\"DATE (target_table_create) BETWEEN '$from' AND '$to' AND $col = $empID\");\n $this->db->where('target_table_target_level',$field);\n if($field == 6)\n $data['tl'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n if($field == 7)\n $data['dse'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n if($field == 5)\n $data['asm'] = $this->db->join('employe_table', 'employe_table.employe_table_employe_id = target_table_emp_id')\n ->select($select)\n ->get_where('target_table', $Where)\n ->result_array();\n\n switch ($field) {\n case 'tl':\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 'dse':\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 'asm':\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n break;\n case 6:\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['tl'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 7:\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['dse'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n case 5:\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = 0;\n }\n }\n foreach ($data['asm'] as $k => $d) {\n if ($d['target_table_emp_id'] == $empID && $d['target_table_product'] != 'Total_Target') {\n $countArr[(string) $d['target_table_product']]['target'] = $countArr[(string) $d['target_table_product']]['target'] + $d['target_table_product_qty'];\n if (!array_key_exists('achieved', $countArr[$d['target_table_product']])) {\n $countArr[(string) $d['target_table_product']]['achieved'] = 0;\n }\n }\n }\n\n break;\n }\n\n\n\n return $countArr;\n }",
"public function overallSubjectAnalysis($slug)\n {\n \n $user = User::getRecordWithSlug($slug);\n if($isValid = $this->isValidRecord($user))\n return redirect($isValid); \n \n if(!isEligible($slug))\n return back();\n\n $records = array();\n $records = ( new App\\QuizResult())->getOverallSubjectsReport($user);\n if(!$records)\n {\n flash('Ooops..!','No Records available', 'overlay'); \n return back();\n }\n $color_correct = getColor('background',rand(00,9999));\n $color_wrong = getColor('background', rand(00,9999));\n $color_not_attempted = getColor('background', rand(00,9999)); \n $i=0;\n $labels = [];\n $dataset = [];\n $dataset_label = [];\n $bgcolor = [];\n $border_color = [];\n \n $marks_labels = [getPhrase('correct'), getPhrase('wrong'), getPhrase('not_answered')];\n $time_labels = [getPhrase('time_spent_on_correct_answers'), getPhrase('time_spent_on_wrong_answers')];\n\n foreach($records as $record) {\n $record = (object)$record;\n \n //Marks\n $subjects_display[$i]['subject_name'] = $record->subject_name;\n $subjects_display[$i]['correct_answers'] = $record->correct_answers;\n $subjects_display[$i]['wrong_answers'] = $record->wrong_answers;\n $subjects_display[$i]['not_answered'] = $record->not_answered;\n\n // Time\n $subjects_display[$i]['time_spent_on_correct_answers'] = $record->time_spent_on_correct_answers;\n $subjects_display[$i]['time_spent_on_wrong_answers'] = $record->time_spent_on_wrong_answers;\n $subjects_display[$i]['time_to_spend'] = $record->time_to_spend;\n $subjects_display[$i]['time_spent'] = $record->time_spent;\n\n \n $marks_dataset = [$record->correct_answers, $record->wrong_answers, $record->not_answered];\n $time_dataset = [$record->time_spent_on_correct_answers, $record->time_spent_on_wrong_answers];\n $dataset_label = $record->subject_name;\n \n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n \n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n\n \n $marks_data['type'] = 'pie'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $marks_data['title'] = $record->subject_name; \n\n $marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $marks_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['chart_data'][] = (object)$marks_data;\n\n\n $time_data['type'] = 'bar'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $time_data['title'] = $record->subject_name; \n\n $time_data['data'] = (object) array(\n 'labels' => $time_labels,\n 'dataset' => $time_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['time_data'][] = (object)$time_data;\n\n $i++;\n } \n \n $data['chart_data'][] = (object)$marks_data;\n\n $overall_correct_answers = 0;\n $overall_wrong_answers = 0;\n $overall_not_answered = 0;\n\n $overall_time_spent_correct_answers = 0;\n $overall_time_spent_wrong_answers = 0;\n \n foreach($records as $r)\n {\n $r = (object)$r;\n $overall_correct_answers += $r->correct_answers;\n $overall_wrong_answers += $r->wrong_answers;\n $overall_not_answered += $r->not_answered;\n \n $overall_time_spent_correct_answers += $r->time_spent_on_correct_answers;\n $overall_time_spent_wrong_answers += $r->time_spent_on_wrong_answers;\n }\n\n $overall_marks_dataset = [$overall_correct_answers, $overall_wrong_answers, $overall_not_answered];\n $overall_time_dataset = [$overall_time_spent_correct_answers, $overall_time_spent_wrong_answers];\n\n $overall_marks_data['type'] = 'doughnut'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $overall_marks_data['title'] = getPhrase('overall_marks_analysis');\n $overall_marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $overall_marks_dataset,\n 'dataset_label' => getPhrase('overall_marks_analysis'),\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n\n $data['right_bar_path'] = 'student.exams.subject-analysis.right-bar-performance-chart';\n $data['right_bar_data'] = array('right_bar_data' => (object)$overall_marks_data);\n \n $data['overall_data'][] = (object)$overall_marks_data;\n \n $data['subjects_display'] = $records;\n $data['active_class'] = 'analysis';\n $data['title'] = getPhrase('overall_subject_wise_analysis');\n $data['user'] = $user;\n $userid = $user->id;\n $data['layout'] = getLayout();\n\n return view('student.exams.subject-analysis.subject-analysis', $data); \n }",
"public function reportDatewiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"public static function generate()\n {\n $data = array();\n foreach (College::all() as $college) {\n # $current = The current year\n # $should = How many actieve assessors there is needed at the end of the year\n # $count = Count of all the active assessors\n $data[$college->id] = array(\n 'current' => date('Y'),\n 'should' => 1 + round(Assessors::where('fk_college', $college->id)->where('status', 1)->count() / 100 * 110),\n 'count' => Assessors::where('fk_college', $college->id)->where('status', 1)->count()\n );\n }\n return $data;\n }",
"function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function prepare_report($emp, $month, $year){\n\n // echo $emp.' '.$month.' '.$year;\n\t\t$start = date('Y-m-d', strtotime(\"$year-$month-01\")); \n\t $end = date('Y-m-t', strtotime($start));\n\t\t$data['attendance'] = calculate_attendance($emp,$start,$end);\n\t\t\n\t\t//array_walk($data['attendance'], function(&$key, $b) { ucwords(str_replace('_', ' ', $key)) }); \n\t\t$data['at_labels'] = json_encode(['Present','Absent','Half Day','Uninformed Leave','Sandwich Leave','Late Login']); \n\t\t$data['at_values'] = json_encode(array_values($data['attendance'])); \n\t\t\n\t\t$project_data = Project::join('project_assignation','projects.id','project_assignation.project_id')\n\t\t\t\t\t\t\t\t->join('users','project_assignation.employee_id','users.id')\n\t\t\t\t\t\t\t\t->join('eods','eods.user_id','users.id')\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t ->select('projects.project_name','projects.id', DB::Raw('SUM(eods.today_hours) as pr_time'))\n\n\t\t\t\t\t\t\t\t->where('users.id', $emp)\n\t\t\t\t\t\t\t\t->whereMonth('eods.date', $month)\t\n\t\t\t\t\t\t\t\t->whereYear('eods.date', $year)\t \t \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->whereRaw('eods.project_id = projects.id')\n\t\t\t\t\t\t\t\t->groupBy('projects.project_name','projects.id')\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t->get(); \n\n\n\t \n\t\t\n\t\t\t$sum = array_sum(array_column($project_data->toArray(),'pr_time')); \n\n\t\t\t$data['projects'] = $project_data;\n\t\t\tforeach($project_data as $project){\n\t\t\t\t$labels[] = $project->project_name;\n\t\t\t\t$cdata[] = number_format(($project->pr_time*100) / $sum, 2); \n\t\t\t\t//$sdata[] = array('label'=> $project->project_name,'data'=>number_format(($project->pr_time*100) / $sum, 2),'backgroundColor'=>'green','borderColor'=>'red') ;\n\t\t\t\t$sdata[] = array('label'=>$project->project_name,'y'=>number_format(($project->pr_time*100) / $sum, 2));\n\t\t\t}\n\t\t\t\n\n\t\t\tif(!empty($labels) && !empty($cdata)){\n\t\t $data['labels'] = json_encode($labels);\n\t\t $data['cdata'] = json_encode($cdata);\n\t\t $data['sdata'] = json_encode($sdata); \n\t\t\t} \n\t\t\t//print_r($data['sdata']);\n\n\t\t return $data; \n\t}",
"public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }",
"public function reportTeacherMonthlyAttendent()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n return view('report.reportTeacherMonthlyAttendent')->with('year',$year);\n }",
"function stp_getSubject($date_to_use='now') {\r\n\r\n\t// Array of Christian Science Bible Lesson subjects \r\n\t$cs_lesson_subjects = array(\r\n\t\t__('God', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Sacrament', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Life', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Truth', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Love', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Spirit', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Soul', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Mind', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Christ Jesus', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Substance', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Matter', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Reality', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Unreality', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Are Sin, Disease, and Death Real?', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Doctrine of Atonement', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Probation After Death', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Everlasting Punishment', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Adam and Fallen Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Mortals and Immortals', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Soul and Body', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Ancient and Modern Necromancy, <i>alias</i> Mesmerism and Hypnotism, Denounced', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('God the Only Cause and Creator', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('God the Preserver of Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Is the Universe, Including Man, Evolved by Atomic Force?', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Christian Science', 'christian-science-bible-lesson-subjects')\r\n\t\t);\r\n\t\r\n\t// repeat the array since lesson subjects are repeated twice a year in the same order\r\n\t$cs_lesson_subjects = array_merge($cs_lesson_subjects, $cs_lesson_subjects);\r\n\r\n\t// Bonus lesson for years with 53 Sundays\r\n\t$cs_lesson_subjects[] = __('Christ Jesus', 'christian-science-bible-lesson-subjects');\r\n\t\r\n\t// Add a blank entry to the front of the array so we're matching week 1 = [1]\r\n\tarray_unshift($cs_lesson_subjects, \"\");\r\n\r\n\t// Get the lesson for the upcoming next Sunday for any given date\r\n // Use strftime('%U, ...) not date(\"W\", ...) in order to get weeks of the year using Sunday as starting day, not Monday\r\n\t$week_num_sun = (int) strftime('%U', strtotime('next Sunday ' . $date_to_use));\r\n\r\n\treturn $cs_lesson_subjects[$week_num_sun];\r\n\r\n}",
"function getStudentReport( $datetypeselect, $startdate, $enddate, $classyear,\r\n\t\t\t\t $residenceselect, $ethnic, $userselect, $watched, $redflag, $vip,\r\n\t\t\t\t $acpro, $housingwaitlist, $field1, $field2, $field3 ) {\r\n\t\t\r\n\t\t$userid = $_SESSION['userid'];\r\n\t\t\r\n\t\tif( $datetypeselect == 0 ) $left = \"left\";\r\n\t\t\r\n\t\t\r\n\t\tif( $startdate ) $datestuff .= \" and c.datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\tif( $enddate ) $datestuff .= \" and c.datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\r\n\t\t$query = \"\r\n\t\t\tSELECT x.ID,\r\n\t\t\t concat( x.LAST_NAME, ', ', x.FIRST_NAME, ' ', x.MIDDLE_NAME ) as FullName,\r\n\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as AssignedToName,\r\n\t\t\t s.AssignedTo,\r\n\t\t\t x.ENROLL_STATUS,\r\n\t\t\t x.CAMPUS_PHONE,\r\n\t\t\t x.CELL_PHONE,\r\n\t\t\t x.WOOSTER_EMAIL,\r\n\t\t\t x.PRIMARY_EMAIL,\r\n\t\t\t x.CAMPUS_BOX,\r\n\t\t\t x.CLASS_YEAR,\r\n\t\t\t s.AcProbation,\r\n\t\t\t s.HousingWaitList,\r\n\t\t\t s.Field1,\r\n\t\t\t s.Field2,\r\n\t\t\t s.Field3,\r\n\t\t\t s.VIP,\r\n\t\t\t s.RedFlag,\r\n\t\t\t x.HOME_PHONE,\r\n\t\t\t concat( x.HOUSING_BLDG, ' ', x.HOUSING_ROOM ) as HousingAssignment,\r\n\t\t\t x.ETHNIC,\r\n\t\t\t x.ADVISOR\r\n\t\t\tFROM X_PNSY_STUDENT x, students s, users u, contacts c, `contacts-students` cs\r\n\t\t\tWHERE x.ID = s.StudentID AND cs.ContactID = c.ID $datestuff AND cs.StudentID = x.ID\r\n\t\t\tAND s.StudentID IN (SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID)\r\n\t\t\";\r\n\t\t\r\n\t\tif( $classyear ) $query .= \" and x.CLASS_YEAR = '$classyear'\";\r\n\r\n\t\tif( $residenceselect ) $query .= \" and x.HOUSING_BDLG = '$residenceselect'\";\r\n\t\tif( $userselect ) $query .= \" and s.assignedto = '$userselect'\";\r\n\t\tif( isset($watched) ) $query .= \" and x.ID in (select studentid from studentwatch where userid = '$userid')\";\r\n\t\tif( isset($redflag) ) $query .= \" and s.redflag != ''\";\r\n\t\tif( isset($vip) ) $query .= \" and s.vip != ''\";\r\n\t\tif( isset($acpro) ) $query .= \" and s.acprobation = 1\";\r\n\t\tif( isset($housingwaitlist) ) $query .= \" and s.housingwaitlist = 1\";\r\n\t\tif( isset($field1) ) $query .= \" and s.Field1 = 1\";\r\n\t\tif( isset($field2) ) $query .= \" and s.Field2 = 1\";\r\n\t\tif( isset($field3) ) $query .= \" and s.Field3 = 1\";\r\n\t\t$query .= \" group by x.ID order by x.LAST_NAME\";\r\n\t\t\t\t\r\n\t\t$return = array();\r\n\t\t$result = mysql_query( $query );\r\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $return as $rowNumber => $row ) {\r\n\t\t\t\r\n\t\t\t// include the number of contacts\r\n\t\t\t$query = \"select count(*) as NumContacts from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct contactid from `contacts-students` cs\r\n\t\t\t\t\twhere cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContacts'] = $numContactsArray['NumContacts'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContacts'] = false;\r\n\t\t\t\r\n\t\t\t// include the number of contacts in the date range\r\n\t\t\t$query = \"select count(*) as NumContactsInRange from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct c.id from contacts c\r\n\t\t\t\t\tjoin `contacts-students` cs\r\n\t\t\t\t\ton cs.contactid = c.id\r\n\t\t\t\t\tand cs.studentid = '\".$row['ID'].\"'$datestuff\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContactsInRange'] = $numContactsArray['NumContactsInRange'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContactsInRange'] = false;\r\n\t\t\t\r\n\t\t\t// include all the users associated with the contacts\r\n\t\t\t$query = \"select distinct u.ID,\r\n\t\t\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as FullName,\r\n\t\t\t\t\t u.Email\r\n\t\t\t\t from users u, `contacts-users` cu, `contacts-students` cs, contacts c\r\n\t\t\t\t where u.id = cu.userid\r\n\t\t\t\t and cu.contactid = cs.contactid\r\n\t\t\t\t and cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t and cs.contactid = c.id$datestuff\r\n\t\t\t\t \";\r\n\t\t\t$usersArray = array();\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\twhile( $userrow = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\tarray_push( $usersArray, $userrow );\r\n\t\t\t}\r\n\t\t\t$return[$rowNumber]['Users'] = $usersArray;\r\n\t\t\t\r\n\t\t\t$return[$rowNumber]['StartDate'] = $startdate;\r\n\t\t\t$return[$rowNumber]['EndDate'] = $startdate;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}",
"function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}",
"function student_attendance()\n\t{\n\t\t\n\t\t$usercode = $_REQUEST['usercode'];\n\t\t$userdt\t\t\t\t=\t$this->ObjM->get_user_by_usercode($usercode);\n\t\t$yearly_acccount \t= $this->ObjM->student_yearly_acccount($userdt[0]['idcode']);\n\t\t\n\t\t$arr=array('student_yearly_code' =>$yearly_acccount[0]['student_yearly_code'],'attendance_month'=>$_REQUEST['month']);\n\t\t$stud_att\t\t\t\t=\t$this->ObjM->get_student_attendance($arr);\n\t\t\n\t\tif(count($stud_att)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\tfor($i=0;$i<count($stud_att);$i++){\n\t\t\t\t$attendance_date = date('d-m-Y',$stud_att[$i]['attendance_date']);\n\t\t\t\t$json_arr[]=array(\n\t\t\t\t\t'attendance_date'\t\t=>\t$attendance_date,\n\t\t\t\t\t'attendance'\t\t\t=>\t$stud_att[$i]['attendance'],\n\t\t\t\t\t'validation'\t \t\t=>\t'true' );\n\t\t }\n\t\t echo json_encode($json_arr);\n\t\t\texit;\n\t}",
"public function export_tms_report() {\n set_time_limit(0);\n ini_set(\"memory_limit\", \"-1\");\n if (!empty($_GET)) {\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_GET['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n } else if ($_GET['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n }\n $data['text'] = $displayText;\n $year = $_GET['yearVal'];\n $month = $_GET['monthVal'];\n $training_score1 = $_GET['trainingStatus'];\n\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n\n if ($_GET['payStatus'] == '1') {\n $result = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_GET['payStatus'] == '2') {\n $result = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n\n $this->load->helper('export_helper');\n export_tms_report_page($result);\n }",
"public function attendance_sheet_export_to_pdf($action, $attendance_id, $student_id = 0, $course_id = '')\n {\n $attendance = new Attendance();\n $courseInfo = CourseManager::get_course_information($course_id);\n $attendance->set_course_id($courseInfo['code']);\n $groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : null;\n $data_array = array();\n $data_array['attendance_id'] = $attendance_id;\n $data_array['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);\n\n $filter_type = 'today';\n\n if (!empty($_REQUEST['filter'])) {\n $filter_type = $_REQUEST['filter'];\n }\n\n $my_calendar_id = null;\n if (is_numeric($filter_type)) {\n $my_calendar_id = $filter_type;\n $filter_type = 'calendar_id';\n }\n\n $data_array['attendant_calendar'] = $attendance->get_attendance_calendar(\n $attendance_id,\n $filter_type,\n $my_calendar_id,\n $groupId\n );\n\n if (api_is_allowed_to_edit(null, true) || api_is_drh()) {\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, 0, $groupId);\n } else {\n if (!empty($student_id)) {\n $user_id = intval($student_id);\n } else {\n $user_id = api_get_user_id();\n }\n $data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id, $user_id, $groupId);\n $data_array['faults'] = $attendance->get_faults_of_user($user_id, $attendance_id, $groupId);\n $data_array['user_id'] = $user_id;\n }\n\n $data_array['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);\n\n // Set headers pdf.\n $courseCategory = CourseManager::get_course_category($courseInfo['category_code']);\n $teacherInfo = CourseManager::get_teacher_list_from_course_code($courseInfo['code']);\n $teacherName = null;\n foreach ($teacherInfo as $teacherData) {\n if ($teacherName != null) {\n $teacherName = $teacherName.\" / \";\n }\n $teacherName .= api_get_person_name($teacherData['firstname'], $teacherData['lastname']);\n }\n\n // Get data table\n $data_table = array();\n $head_table = array('#', get_lang('Name'));\n foreach ($data_array['attendant_calendar'] as $class_day) {\n $head_table[] =\n api_format_date($class_day['date_time'], DATE_FORMAT_NUMBER_NO_YEAR).' '.\n api_format_date($class_day['date_time'], TIME_NO_SEC_FORMAT);\n }\n $data_table[] = $head_table;\n $data_attendant_calendar = $data_array['attendant_calendar'];\n $data_users_presence = $data_array['users_presence'];\n $count = 1;\n\n if (!empty($data_array['users_in_course'])) {\n foreach ($data_array['users_in_course'] as $user) {\n $cols = 1;\n $result = array();\n $result['count'] = $count;\n $result['full_name'] = api_get_person_name($user['firstname'], $user['lastname']);\n foreach ($data_array['attendant_calendar'] as $class_day) {\n if ($class_day['done_attendance'] == 1) {\n if ($data_users_presence[$user['user_id']][$class_day['id']]['presence'] == 1) {\n $result[$class_day['id']] = get_lang('UserAttendedSymbol');\n } else {\n $result[$class_day['id']] = '<span style=\"color:red\">'.get_lang('UserNotAttendedSymbol').'</span>';\n }\n } else {\n $result[$class_day['id']] = ' ';\n }\n $cols++;\n }\n $count++;\n $data_table[] = $result;\n }\n }\n $max_cols_per_page = 12; //10 dates + 2 name and number\n $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10\n $rows = count($data_table);\n\n if ($cols > $max_cols_per_page) {\n $number_tables = round(($cols-2)/$max_dates_per_page);\n $headers = $data_table[0];\n $all = array();\n $tables = array();\n $changed = 1;\n\n for ($i= 0; $i <= $rows; $i++) {\n $row = isset($data_table[$i]) ? $data_table[$i] : null;\n $key = 1;\n $max_dates_per_page = 10;\n $item = isset($data_table[$i]) ? $data_table[$i] : null;\n $count_j = 0;\n\n if (!empty($item)) {\n foreach ($item as $value) {\n if ($count_j >= $max_dates_per_page) {\n $key++;\n $max_dates_per_page = $max_dates_per_page_original*$key;\n //magic hack\n $tables[$key][$i][] = $tables[1][$i][0];\n $tables[$key][$i][] = $tables[1][$i][1];\n }\n $tables[$key][$i][] = $value;\n $count_j++;\n }\n }\n }\n\n $content = null;\n if (!empty($tables)) {\n foreach ($tables as $sub_table) {\n $content .= Export::convert_array_to_html($sub_table).'<br /><br />';\n }\n }\n } else {\n $content = Export::convert_array_to_html(\n $data_table,\n array('header_attributes' => array('align' => 'center'))\n );\n }\n\n $params = array(\n 'filename' => get_lang('Attendance').'-'.api_get_local_time(),\n 'pdf_title' => $courseInfo['title'],\n 'course_code' => $courseInfo['code'],\n 'add_signatures' => true,\n 'orientation' => 'landscape',\n 'pdf_teachers' => $teacherName,\n 'pdf_course_category' => $courseCategory['name'],\n 'format' => 'A4-L',\n 'orientation' => 'L'\n );\n\n Export::export_html_to_pdf($content, $params);\n exit;\n }",
"public function reportMonthlyAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"function generate_report($req, $res, $isMonthly = true, $timeUnit = null, $uid = 1) {\r\n\tif ($isMonthly) {\r\n\t\tif (is_null ( $timeUnit ) || ! is_numeric ( $timeUnit ) || $timeUnit > 12 || $timeUnit < 1) {\r\n\t\t\t$timeUnit = date ( 'M' );\r\n\t\t}\r\n\t} else {\r\n\t\tif (is_null ( $timeUnit )) {\r\n\t\t\t$timeUnit = date ( 'Y' );\r\n\t\t}\r\n\t}\r\n\t\r\n\trequire_once 'PHPExcel/PHPExcel.php';\r\n\t$objPHPExcel = new PHPExcel ();\r\n\t\r\n\theader ( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' );\r\n\theader ( 'Content-Disposition: attachment;filename=\"report_' . ($isMonthly ? 'monthly' : 'yearly') . date ( 'YMDhm' ) . '.xlsx\"' );\r\n\theader ( 'Cache-Control: max-age=0' );\r\n\t\r\n\t// Set properties\r\n\t$objPHPExcel->getProperties ()->setCreator ( \"Roy Ganor\" )->setTitle ( \"Doctors Report\" )->setSubject ( \"Doctors Report\" )->setDescription ( \"Doctors Report\" );\r\n\t\r\n\twriteSurgeries ( $req, $res, $uid, $objPHPExcel );\r\n\twriteShifts ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSessions ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSurgeons ( $req, $res, $uid, $objPHPExcel );\r\n\twriteOperations ( $req, $res, $uid, $objPHPExcel );\r\n\t\r\n\t$objPHPExcel->setActiveSheetIndex ( 0 );\r\n\t\r\n\t$objWriter = PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' );\r\n\t$objWriter->save ( 'php://output' );\r\n}"
] | [
"0.77966917",
"0.6952219",
"0.6225241",
"0.59348047",
"0.5846901",
"0.58378285",
"0.5793984",
"0.5739033",
"0.57314277",
"0.5726573",
"0.57134396",
"0.57125956",
"0.57031906",
"0.56990755",
"0.5669414",
"0.563711",
"0.5636193",
"0.56284374",
"0.56207716",
"0.55699575",
"0.55605674",
"0.55554706",
"0.55425525",
"0.5519224",
"0.550124",
"0.54917026",
"0.5476998",
"0.5474807",
"0.546664",
"0.54573965"
] | 0.79717195 | 0 |
End Action controllers for generating attendance report Start Action controllers for generating remarks report generate_subject_code_remarks_report function. commit 10/12/2018 | public function generate_subject_code_remarks_report(){
$this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));
// get inputs
$con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));
$range1 = $this->input->post('date_range1');
$range2 = $this->input->post('date_range2');
// get necessary report data
$students = $this->admin_model->getStudentsBasicInfo($con,'a');
$attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);
$att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);
$att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');
// generate report data in pdf or csv format from admin_report_model
if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){
if(!empty($attendance) && !empty($att_record)){
if($this->input->post('export_csv')){
$this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);
exit;
}else if($this->input->post('export_pdf')){
$this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);
}
}
$this->session->set_flashdata('warning', 'No reports found!.');
}else{
$this->session->set_flashdata('danger', 'Invalid input.');
}
redirect('attendance_report');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generate_subject_code_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }",
"public function generate_voc_program_attendance_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar'));\n // get inputs\n $condition= array('vocational_program'=>$this->input->post('vocational_program'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $voc_program= $this->vocational_program_model->getVocationalPrograms('s',array('voc_program_id'=>$condition['vocational_program']));\n $students = $this->admin_model->getStudentsBasicInfo($condition,'a');\n $attendance = $this->admin_model->getStudentAttendanceByVocationalProgram($students,$range1,$range2,$condition['batch_year']);\n $att_record = $this->admin_model->getStudentDailyAttendanceRecord($students,$range1,$range2,$condition['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($condition['vocational_program']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentAttendanceByVocationalProgramCsv($attendance,$att_record,$att_dates,$voc_program,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateVocProgramAttendanceReportPdf($attendance,$voc_program,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n redirect('attendance_report');\n }\n $this->session->set_flashdata('danger', 'Invalid input.');\n redirect('attendance_report');\n \n }",
"public function generate_acknowledgement() {\n \n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $usrid = $this->input->post('usr');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $usrid);\n\n $tanant = $this->courses_model->get_tenant_details();\n \n //sankar code starts here\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n //sankar code ends here\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $Url = base_url() . 'payments/print_ack';\n\n $date = date('M d Y');\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n \n /* skm code start for remark.\n reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($ack_data[class_start_datetime]);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($crsid == 67 || $crsid == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n $tenant_id = TENANT_ID;\n if($tenant_id == 'T12')\n { \n $name = $tanant->contact_name;\n }else{\n\n $name = $gender. $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name];\n }\n \n $message3 = '\n <ol>\n <li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\n <li>Your NRIC, work permit or will be photocopied on the class date</li>\n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n </ol>';\n /* skm end */\n \n echo '<form action=\"' . $Url . '\" method=\"post\"><p> \n <a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n\t\t\t <h2 class=\"panel_heading_style\">Booking Acknowledgment</h2>\t\t\t \n\t\t\n\t\t\t Your seat has been temporarily booked. Please pay the class fees on or before the class start date.\n\t\t\tTemporary booking for <b>' . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course:\"' . $ack_data[crse_name] . ',Class:' . $ack_data[class_name] . ',Certificate Code:' . $ack_data[cert_level] . ' </b>\".</i><br>\n\t\t\t </br><strong>Class start date:</strong> ' . $startdate . '<br>\n\t\t\t </br><strong>Location:</strong> ' . $ack_data[classroom_location] . '<br>\n\t\t\t</br><strong>Contact Details:</strong> ' . $name . ',(Phone: ' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n </br><strong>Remark:</strong> ' . $message3 . '<br>\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/>\n <input type=\"hidden\" value=\"' . $usrid . '\" name=\"userId\"/> \n <input type=\"hidden\" value=\"' . $ack_data . '\" name=\"ackdata\"/>\n <div style=\"clear:both;\"></div><br>\t\t\t \n\t\t\t <span style=\"float:right;\">\n\t\t\t<button class=\"btn btn-primary\" type=\"submit\">Print</button>\n\t\t\t </p></form> ';\n }",
"function attendance_report() {\n if ($this->session->userdata('parent_login') != 1)\n redirect(base_url(), 'refresh');\n $student_id = $student_id = $this->session->userdata('parent_id');\n if ($this->input->post('month') != '' && $this->input->post('year') != '') {\n $page_data['month'] = $this->input->post('month');\n $page_data['year'] = $this->input->post('year');\n } else {\n $page_data['month'] = '';\n $page_data['year'] = '';\n }\n $page_data['student'] = $this->db->get_where('student', array('student_id' => $student_id))->row()->name;\n $page_data['student_id'] = $student_id;\n $page_data['page_name'] = 'attendance_report';\n $image = $this->db->get_where('student', array('student_id' => $student_id))->row()->image;\n $image_url = $this->crud_model->get_image_url('student', $image);\n $page_data['parent_page_title'] = \"<img src='$image_url'\" . 'class=\"img-circle\"' . 'width=\"40\"' . \"/>\" . $page_data['student'];\n $page_data['page_title'] = $page_data['student'];\n $this->load->view('backend/index', $page_data);\n }",
"public function dtexamattemptreport()\n {\n $condition = \"\";\n $search_type = $this->input->post('search_type');\n $date_type = $this->input->post('date_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $data['searchlist'] = $this->customlib->get_searchtype();\n $data['date_type'] = $this->customlib->date_type();\n\n $data['date_typeid'] = '';\n if (isset($search_type) && $search_type != '') {\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $search_type;\n } else {\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n\n if (isset($_POST['date_type']) && $_POST['date_type'] != '') {\n\n $data['date_typeid'] = $_POST['date_type'];\n\n if ($search_type == 'exam_from_date') {\n\n $condition .= \" and date_format(onlineexam.exam_from,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n } elseif ($date_type == 'exam_to_date') {\n $condition .= \" and date_format(onlineexam.exam_to,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n }\n\n } else {\n\n $condition .= \" and date_format(onlineexam.created_at,'%Y-%m-%d') between '\" . $start_date . \"' and '\" . $end_date . \"'\";\n\n }\n\n $result = $this->onlineexam_model->onlineexamatteptreport($condition);\n $sch_setting = $this->sch_setting_detail;\n $resultlist = json_decode($result);\n $dt_data = array();\n\n if (!empty($resultlist->data)) {\n foreach ($resultlist->data as $resultlist_key => $student_value) {\n\n $exams = explode(',', $student_value->exams);\n\n $exam_name = '';\n $exam_from = '';\n $exam_to = '';\n $exam_duration = '';\n $exam_publish = \"\";\n $exam_resultpublish = \"\";\n $exam_publishprint = \"\";\n $exam_resultpublishprint = \"\";\n foreach ($exams as $exams_key => $exams_value) {\n $exam_details = explode('@', $exams_value);\n\n if (count($exam_details) == 9) {\n\n $exam_name .= $exam_details[1];\n $exam_from .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[3]));\n $exam_to .= date($this->customlib->getSchoolDateFormat(), $this->customlib->dateYYYYMMDDtoStrtotime($exam_details[4]));\n $exam_duration .= $exam_details[5];\n $exam_publish .= ($exam_details[7] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n $exam_resultpublish .= ($exam_details[8] == 1) ? \"<i class='fa fa-check-square-o'></i>\" : \"<i class='fa fa-exclamation-circle'></i>\";\n\n $exam_publishprint .= ($exam_details[7] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n $exam_resultpublishprint .= ($exam_details[8] == 1) ? \"<span style='display:none'>Yes</span>\" : \"<span style='display:none'>No</span>\";\n\n $exam_name .= '<br>';\n $exam_from .= \"<br>\";\n $exam_to .= \"<br>\";\n $exam_duration .= \"<br>\";\n $exam_publish .= \"<br>\";\n $exam_resultpublish .= \"<br>\";\n $exam_publishprint .= \"<br>\";\n $exam_resultpublishprint .= \"<br>\";\n }\n }\n\n $row = array();\n $row[] = $this->customlib->getFullName($student_value->firstname, $student_value->middlename, $student_value->lastname, $sch_setting->middlename, $sch_setting->lastname);\n $row[] = $student_value->admission_no;\n\n $row[] = $student_value->class;\n $row[] = $student_value->section;\n $row[] = $exam_name;\n $row[] = $exam_from;\n $row[] = $exam_to;\n $row[] = $exam_duration;\n $row[] = $exam_publish . $exam_publishprint;\n $row[] = $exam_resultpublish . $exam_resultpublishprint;\n\n $dt_data[] = $row;\n }\n\n }\n $json_data = array(\n \"draw\" => intval($resultlist->draw),\n \"recordsTotal\" => intval($resultlist->recordsTotal),\n \"recordsFiltered\" => intval($resultlist->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }",
"public function tms_report() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayText = \"Total Amount Received for Paid invoices :\";\n $export_url = '?payStatus=1';\n } else if ($_POST['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayText = \"Total Amount Due for unpaid invoices :\";\n $export_url = '?payStatus=2';\n }\n $data['text'] = $displayText;\n $year = $_POST['yearVal'];\n $month = $_POST['monthVal'];\n $training_score1 = $_POST['trainingStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['payStatus'] == '1') {\n $data['result'] = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_POST['payStatus'] == '2') {\n $data['result'] = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }",
"public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }",
"function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function download_in_pdf($seq_no)\n\t{\n\t\t$this->load->model('statement_header_model');\n\t\t// $this->load->library('m_pdf');\n\t\t$this->load->model('transactions_model');\n\t\t$statement = $this->statement_header_model->get_statement($seq_no);\n\t\t$start_date = $statement[0]->START_DATE;\n\t\t$end_date = $statement[0]->END_DATE;\n\t\t$internal_key = $statement[0]->INTERNAL_KEY;\n\t\t$data['statement'] = $statement[0];\n\n\t\t// return print_r($statement);\n\t\t$data['transactions'] = $this->transactions_model\n\t\t\t\t->get_trans_history($start_date,$end_date,$internal_key);\n\n\t\t$data['start_date'] = $this->formatDate($start_date);\n\t\t$data['end_date'] = $this->formatDate($end_date);\n\n\n\t\t $this->load->helper('dompdf');\n\t\t $html = $this->load->view('transactions/view_statement2', $data, true);\n \t return pdf_create($html, 'eStatement as of '.$start_date. ' to' .$end_date);\n\t}",
"function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}",
"public function genattpdf($getatt){\n\t\t$data['getatt']=$getatt;\n\t\t\tforeach($getatt as $row){\n\t\t\t\t$asmid=$row->ca_asmid;\n\t\t\t\t$centerid=$row->ca_centername;\n\t\t\t\t$cname = $this->commodel->get_listspfic1('admissionstudent_enterenceexamcenter','eec_name','eec_id',$centerid)->eec_name;\n\t\t\t\t$year=date('Y');\n \t \t// move file to directory code for photo\n\t\t\t\t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year;\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t}\n\n \t \t$desired_dir = 'uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence';\n \t// Create directory if it does not exist\n \tif(is_dir($desired_dir)==false){\n \t\tmkdir(\"$desired_dir\", 0700);\n \t\t }\n\n\t\t\t\t$this->acadyear = $this->usermodel->getcurrentAcadYear();\n\t\t\t\t\t\t\n\t\t\t\t//add pdf code to store and view pdf file\n\t\t\t\t$temp = $this->load->view('enterenceadmin/attendencepdf', $data, TRUE);\n\t\t\t\t//$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$cname.'.pdf';\n\t\t\t\t$pth='uploads/SLCMS/enterenceadmin_student/'.$year.'/attendence/'.$centerid.'.pdf';\n\t\t\t\t$this->commodel->genpdf($temp,$pth);\n\t\t\t\t$master = array(\n\t\t \t\t'ca_attendencesheetstatus' => 'Y',\n\t \t \t\t);\n \t\t\t\t$this->commodel->updaterec('admissionstudent_centerallocation', $master,'ca_asmid',$asmid);\n\t\t\t\t$this->logger->write_logmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\");\n \t\t$this->logger->write_dblogmessage(\"update\", \"Attendence sheet status update yes in admissionstudent_centerallocation\" );\n\t\t\t}\n\t}",
"public function export_tms_report() {\n set_time_limit(0);\n ini_set(\"memory_limit\", \"-1\");\n if (!empty($_GET)) {\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_GET['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n } else if ($_GET['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n }\n $data['text'] = $displayText;\n $year = $_GET['yearVal'];\n $month = $_GET['monthVal'];\n $training_score1 = $_GET['trainingStatus'];\n\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n\n if ($_GET['payStatus'] == '1') {\n $result = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_GET['payStatus'] == '2') {\n $result = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n\n $this->load->helper('export_helper');\n export_tms_report_page($result);\n }",
"public function generate()\n {\n $reportType = Input::get('report_type');\n $from = Input::get('from');\n $to = Input::get('to');\n $disciplineId = Input::get('discipline');\n $info = explode(',', Input::get('info'));\n $id = $info[1];\n $type = $info[0];\n $license = array_key_exists(2, $info) ? $info[2] : '0';\n\n $from = empty($from) ? null : date('Y-m-d', strtotime($from));\n $to = empty($to) ? null : date('Y-m-d', strtotime($to));\n \n if (! $reportType) {\n Flash::danger('Please select a <strong>Report Type</strong>.');\n return Redirect::route('reports.index')->withInput();\n }\n\n if (empty($from)) {\n Flash::danger('Please enter a <strong>From Date</strong> to generate report.');\n return Redirect::route('reports.index')->withInput();\n }\n\n // all route params\n $routeParams = [$disciplineId, $type, $id, $license, $from, $to];\n\n switch ($reportType) {\n case 'site_summary':\n return Redirect::route('reports.site_summary', $routeParams);\n break;\n\n case 'scheduled_exams':\n return Redirect::route('reports.scheduled_exams', $routeParams);\n break;\n\n case 'retake_summary':\n return Redirect::route('reports.retake_summary', $routeParams);\n break;\n\n case 'skills_detail':\n return Redirect::route('reports.skills_detail', $routeParams);\n break;\n\n case 'knowledge_detail':\n return Redirect::route('reports.knowledge_detail', $routeParams);\n break;\n\n case 'pass_fail':\n // if admin / agency / staff show a page to select facility and instructor\n /*if(Auth::user()->ability(['Admin', 'Staff', 'Agency'], []))\n {\n return Redirect::route('reports.select_facility', [$from, $to]);\n }*/\n\n // Otherwise just show the regular pass/fail report\n return Redirect::route('reports.pass_fail', $routeParams);\n break;\n\n default:\n Flash::warning('This report type is not yet supported.', 'Warning');\n return Redirect::route('reports.index');\n\n }\n }",
"public function overallSubjectAnalysis($slug)\n {\n \n $user = User::getRecordWithSlug($slug);\n if($isValid = $this->isValidRecord($user))\n return redirect($isValid); \n \n if(!isEligible($slug))\n return back();\n\n $records = array();\n $records = ( new App\\QuizResult())->getOverallSubjectsReport($user);\n if(!$records)\n {\n flash('Ooops..!','No Records available', 'overlay'); \n return back();\n }\n $color_correct = getColor('background',rand(00,9999));\n $color_wrong = getColor('background', rand(00,9999));\n $color_not_attempted = getColor('background', rand(00,9999)); \n $i=0;\n $labels = [];\n $dataset = [];\n $dataset_label = [];\n $bgcolor = [];\n $border_color = [];\n \n $marks_labels = [getPhrase('correct'), getPhrase('wrong'), getPhrase('not_answered')];\n $time_labels = [getPhrase('time_spent_on_correct_answers'), getPhrase('time_spent_on_wrong_answers')];\n\n foreach($records as $record) {\n $record = (object)$record;\n \n //Marks\n $subjects_display[$i]['subject_name'] = $record->subject_name;\n $subjects_display[$i]['correct_answers'] = $record->correct_answers;\n $subjects_display[$i]['wrong_answers'] = $record->wrong_answers;\n $subjects_display[$i]['not_answered'] = $record->not_answered;\n\n // Time\n $subjects_display[$i]['time_spent_on_correct_answers'] = $record->time_spent_on_correct_answers;\n $subjects_display[$i]['time_spent_on_wrong_answers'] = $record->time_spent_on_wrong_answers;\n $subjects_display[$i]['time_to_spend'] = $record->time_to_spend;\n $subjects_display[$i]['time_spent'] = $record->time_spent;\n\n \n $marks_dataset = [$record->correct_answers, $record->wrong_answers, $record->not_answered];\n $time_dataset = [$record->time_spent_on_correct_answers, $record->time_spent_on_wrong_answers];\n $dataset_label = $record->subject_name;\n \n $bgcolor = [$color_correct,$color_wrong,$color_not_attempted];\n \n $border_color = [$color_correct,$color_wrong,$color_not_attempted];\n\n \n $marks_data['type'] = 'pie'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $marks_data['title'] = $record->subject_name; \n\n $marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $marks_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['chart_data'][] = (object)$marks_data;\n\n\n $time_data['type'] = 'bar'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $time_data['title'] = $record->subject_name; \n\n $time_data['data'] = (object) array(\n 'labels' => $time_labels,\n 'dataset' => $time_dataset,\n 'dataset_label' => $dataset_label,\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n \n $data['time_data'][] = (object)$time_data;\n\n $i++;\n } \n \n $data['chart_data'][] = (object)$marks_data;\n\n $overall_correct_answers = 0;\n $overall_wrong_answers = 0;\n $overall_not_answered = 0;\n\n $overall_time_spent_correct_answers = 0;\n $overall_time_spent_wrong_answers = 0;\n \n foreach($records as $r)\n {\n $r = (object)$r;\n $overall_correct_answers += $r->correct_answers;\n $overall_wrong_answers += $r->wrong_answers;\n $overall_not_answered += $r->not_answered;\n \n $overall_time_spent_correct_answers += $r->time_spent_on_correct_answers;\n $overall_time_spent_wrong_answers += $r->time_spent_on_wrong_answers;\n }\n\n $overall_marks_dataset = [$overall_correct_answers, $overall_wrong_answers, $overall_not_answered];\n $overall_time_dataset = [$overall_time_spent_correct_answers, $overall_time_spent_wrong_answers];\n\n $overall_marks_data['type'] = 'doughnut'; \n //horizontalBar, bar, polarArea, line, doughnut, pie\n $overall_marks_data['title'] = getPhrase('overall_marks_analysis');\n $overall_marks_data['data'] = (object) array(\n 'labels' => $marks_labels,\n 'dataset' => $overall_marks_dataset,\n 'dataset_label' => getPhrase('overall_marks_analysis'),\n 'bgcolor' => $bgcolor,\n 'border_color' => $border_color\n );\n\n $data['right_bar_path'] = 'student.exams.subject-analysis.right-bar-performance-chart';\n $data['right_bar_data'] = array('right_bar_data' => (object)$overall_marks_data);\n \n $data['overall_data'][] = (object)$overall_marks_data;\n \n $data['subjects_display'] = $records;\n $data['active_class'] = 'analysis';\n $data['title'] = getPhrase('overall_subject_wise_analysis');\n $data['user'] = $user;\n $userid = $user->id;\n $data['layout'] = getLayout();\n\n return view('student.exams.subject-analysis.subject-analysis', $data); \n }",
"public function mailReportAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get form id\r\n \t\t */\r\n \t\t$form_id = $this->getAttribute('form_id');\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\t'form_id', make_id($form_id),\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->getFormMailList($form_id, $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.'/form_id/'.make_id($form_id).'/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$this->setDisplay('report');\r\n \t\t\r\n \t}",
"public function reportMonthlyAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"public function generate_ack_receipt() {\n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $userid = $this->input->post('usr');\n $invoice_id = $this->input->post('invoice');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $userid);\n\n $sfc_amount= $this->payments_model->get_sfc_details($invoice_id);\n if(!empty($sfc_amount['othr_mode_of_payment'])){ \n $other_mod_of_payment= \" & Other Mode Of Payment : ($ \".number_format($sfc_amount['other_amount_recd'],2,'.','').\")\";}\n else{\n $other_mod_of_payment=\"\";\n }\n if(($sfc_amount['sfc_claimed']>0))\n { \n $mod = 'Mode of payment: '.$sfc_amount['mode_of_pymnt'].'($ '.number_format($sfc_amount['sfc_claimed'],2,'.','').')'.''.$other_mod_of_payment;\n }else\n {\n $mod = 'Mode of payment: '.$sfc_amount['mode_of_pymnt'].'($ '.number_format($sfc_amount['amount_recd'],2,'.','').')'.''.$other_mod_of_payment;\n }\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n\n $tanant = $this->courses_model->get_tenant_details();\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $date = date('M d Y', strtotime($ack_data['inv_date']));\n $logourl = base_url() . 'logos/' . $this->session->userdata(public_tenant_details)->Logo;\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n $Url = base_url() . 'payments/print_receipt';\n echo ' <form action=\"' . $Url . '\" method=\"post\"><p>\n \n <h2 class=\"panel_heading_style\">Payment Receipt</h2><br><a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n <table width=\"100%\"> \n <tbody>\n <tr>\n <td rowspan=\"4\"><img src=\"' . $logourl . '\" border=\"0\" /></td>\n <td colspan=\"2\">' . $tanant->tenant_name . '</td>\n <td class=\"td_heading\">Receipt No.:</td>\n <td>' . date('Y') . '' . $ack_data['invoice_id'] . '</td>\n </tr>\n <tr>\n <td colspan=\"2\">' . $tanant->tenant_address, $tanant->tenant_city . '</td>\n <td class=\"td_heading\">Receipt Date:</td>\n <td>' . $date . '</td>\n </tr>\n <tr>\n <td colspan=\"4\"></td>\n </tr>\n <tr>\n <td colspan=\"4\">' . $tanant->tenant_contact_num . '</td>\n </tr>\n \n </tbody>\n </table><br>\n \n <p><font style=\"font-size:14px; font-weight:bold;\">Received</font> with thanks SGD ' . $ack_data[total_inv_amount] . ' from <b>' \n . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course: \"' . $ack_data[crse_name] . ' ,Class: '\n . $ack_data[class_name] . ' Certificate Code:' . $ack_data[cert_level] . '</b>\". '.$mod.'</p>\n\n <table class=\"table table-bordered\">\n \n <tbody>\n <tr>\n <td class=\"td_heading\">Class Start Date:</td>\n <td>' . $startdate . '</td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Location:</td>\n <td>' . $ack_data[classroom_location] . '</td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Contact Details:</td>\n <td>' . $gender . $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name] . '(Phone:' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/> \n <input type=\"hidden\" value=\"' . $userid . '\" name=\"userId\"/>\n </tr>\n </tbody>\n </table>\n \n <p>\n\n</br><p class=\"red\"><i>This is a computer generated receipt and does not require a seal or signature.</i></p>\n\n<div style=\"clear:both;\"></div><br>\n<span style=\"float:right;\">\n<button id=\"print_ack_receipt\" class=\"btn btn-primary\" type=\"submit\">Print</button>\n</p> </form> ';\n }",
"public function reportMonthlyClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportMonthlyClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"function report() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n if (!empty($_POST)) {\n if (isset($_POST['type'])) {\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n $resultData = $this->webservicemodel->getReportData($getData);\n if ($resultData) {\n $exportData = array();\n foreach ($resultData as $record) {\n $total_due = $record[\"costo_base\"] + $record[\"importo_tasse_volo\"] + $record[\"importo_aeroporto_aggiuntivo\"] + $record[\"supplementi\"];\n $balance = round(( $total_due - $record[\"pagamenti\"]), 2);\n\n $exportRecord = array(\n 'Accompagnatore' => $record['accompagnatore'],\n 'Collaboratore' => $record['collaboratore'],\n 'Prodotto' => $record['prodotto'],\n 'Codice Prodotto' => $record['codice_prodotto'],\n 'Passeggero' => $record['passeggero'],\n 'Tipologia Passeggero' => $record['tipologia_passeggero'],\n 'Total Due' => $total_due,\n 'Balance' => $balance\n );\n array_push($exportData, $exportRecord);\n }\n $this->load->library('export');\n $this->export->to_excel($exportData, 'webservicereport');\n } else\n redirect('webservice');\n }\n else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['prodotto'] = $this->input->post('txtProdotto');\n $data['codice_prodotto'] = $this->input->post('txtCodiceProdotto');\n $data['passeggero'] = $this->input->post('txtPasseggero');\n $data['tipologia_passeggero'] = $this->input->post('selTipologiaPasseggero');\n $data['glf'] = $this->input->post('selGlf');\n\n $getData = array('accompagnatore' => $data['accompagnatore'], 'collaboratore' => $data['collaboratore'], 'prodotto' => $data['prodotto'], 'codice_prodotto' => $data['codice_prodotto'], 'passeggero' => $data['passeggero'], 'tipologia_passeggero' => $data['tipologia_passeggero'], 'glf' => $data['glf']);\n\n// $data['report_data'] = $this->webservicemodel->getReportData($getData);\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report_data', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report_data', $data);\n }\n }\n } else {\n $data['title'] = 'plus-ed.com | Webservice data report';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Webservice data report';\n\n $data['tipologia_passeggero'] = $this->webservicemodel->getDistinctDataByField('tipologia_passeggero');\n $data['glf'] = $this->webservicemodel->getDistinctDataByField('glf');\n $data['accompagnatore'] = $this->webservicemodel->getDistinctDataByField('accompagnatore');\n $data['collaboratore'] = $this->webservicemodel->getDistinctDataByField('collaboratore');\n $data['codice_prodotto'] = $this->webservicemodel->getDistinctDataByField('codice_prodotto');\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_report', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_report', $data);\n }\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }",
"public function actionReceipt_due_report(){\n\t\t$connection = Yii::app()->db; \n // return $cmdrow->queryAll();\n\t\t$connection = Yii::app()->db; \n\t\t$temp_projects_array = Yii::app()->session['projects_array'];\n\t\t$num_of_projects_counter = count($temp_projects_array);\t\n\t\t$num_of_projects_counter2 = $num_of_projects_counter;\n\t\t$sql1 = \"select * from projects where\";\n\t\t$num_of_projects_counter--;\n\t\twhile($num_of_projects_counter>-1)\n\t\t{\n\t\t\t$sql2[$num_of_projects_counter] = \" id=\".Yii::app()->session['projects_array'][$num_of_projects_counter]['project_id'];\n\t\t\t$num_of_projects_counter--;\n\t\t}\n\t\t\n\t\t$sql_project = $sql1;\n\t\t$sql_project = $sql_project.implode(' or',$sql2);\n\t\t$result_projects = $connection->createCommand($sql_project)->query() or mysql_error();\n\t //////////////////////////////////FUNCTION 3 END///////////////////////////////////////////\n\t $this->render('receipt_due_report',array('projects'=>$result_projects));\n\t\t}",
"public function pcAttendance_report() {\n BackendMenu::setContext('Olabs.Oims', 'reports', 'pcattendance_report');\n $this->searchFormWidget = $this->createAttendanceSearchFormWidget();\n $this->pageTitle = 'Petty Contractor Attendance Report';\n $reports = array();\n\n $oimsSetting = \\Olabs\\Oims\\Models\\Settings::instance();\n\n $searchForm = $this->searchFormWidget;\n\n $this->vars['search'] = false;\n $this->vars['msg'] = false;\n $this->vars['searchFormWidget'] = $searchForm;\n $this->vars['reports'] = $reports;\n\n $this->vars['oimsSetting'] = $oimsSetting;\n }",
"public function Mrrecord() {\n\n $concat_string = '';\n $ret_url = 'Mrrecord';\n if(!empty($this->input->get('page_id'))){\n $concat_string = '?page_id='.$this->input->get('page_id');\n }\n if(!empty($this->input->get('bpg'))){\n $ret_url = $this->input->get('bpg');\n }\n $title = 'Medical Records';\n if(!empty($this->input->get('ptl'))){\n $title = $this->input->get('ptl');\n }\n \n $breadcrumb_links[] = array('title' => $title,'link' => getUrl($ret_url).$concat_string);\n \n $data['breadcrumbs'] = $breadcrumb_links;\n $data['tail'] = 'Details';\n \n $data['page_title'] = \"Medical Records / Details\";\n \n $data['page_current'] = \"medical_record\";\n \n $inputData['patient_id'] = $this->input->get('pid');\n if(empty($inputData['patient_id'])){\n $inputData['patient_id'] = $this->input->post('pid');\n }\n \n $inputData['visit_id'] = $this->input->get('vid');\n $inputData['records'] = '';\n $inputData['offset'] = 0;\n\n $patientData = $this->medicalincidentHandler->getMedicalIncidentVisitDetails($inputData);\n \n if ($patientData['statusCode'] == 200) {\n //echo '<pre>'; print_r($patientData['response']['medicalIncidentVisitData']); echo '</pre>';\n $data['imgpath'] = $this->config->item('hff_media_path');\n $data['pdetails'] = $patientData['response']['patientData'][0];\n $data['userdata'] = $patientData['response']['userData'][0];\n// $data['userdata'] = (isset($patientData['response']['userData'][0]))?$patientData['response']['userData'][0]:null;\n $data['mivdata'] = $patientData['response']['medicalIncidentVisitData'];\n $data['feedback_ids'] = $patientData['response']['feedback_ids'];\n// $data['presc_options'] = $patientData['response']['presc_option_ids'];\n $data['visitid'] = $this->input->get('vid');\n $data['message'] = '';\n } else {\n $data['pdetails'] = '';\n $data['userdata'] = '';\n $data['mivdata'] = '';\n $data['message'] = STATUS_NO_DATA;\n// $data['message'] = $patientData['response']['message'];\n }\n// debugArray($data); exit;\n $data['content'] = \"doctor/doc_mr_number.php\";\n $template = 'templates/doctor_template';\n $this->load->view($template, $data);\n }",
"public function makeReport()\n {\n }",
"public function actionPdfRevisedratesreport()\n {\n $res = AllocationManager::getRevisedRatesData();\n $contents= $this->renderAjax('pdf-revised-rates-report',['res' => $res]);\n $pdf = Yii::$app->pdf;\n\n $pdf->generatePdf( \n $contents,\n null,\n 'Revised Rates Report for Evaluation of Questionnaire Reports',\n '|Page {PAGENO}|'.' '.\\Yii::$app->name,\n [\n 'orientation'=>\\kartik\\mpdf\\Pdf::ORIENT_LANDSCAPE\n ]);\n }",
"public function reportDatewiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"public function reportDatewiseClassWiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseClassWiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }",
"public function tms_report_count() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['pStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayTextCount = \"Total Paid Trainees : \";\n $export_url = '?pStatus=1';\n } else if ($_POST['pStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayTextCount = \"Total Unpaid Trainees : \";\n $export_url = '?payStatus=2';\n }\n \n $year = $_POST['yVal'];\n $month = $_POST['mVal'];\n \n $training_score1 = $_POST['tStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['pStatus'] == '1') {\n $data_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $paidVal1 = $this->calculate_paid($data_res);\n $count=count($data_res);\n $displayTextCount = 'Total Amount Received : ';\n } else if ($_POST['pStatus'] == '2') {\n $data_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status, $year, $month, $training_score);\n $amount_due = $data_res[0]->total_amount_due;\n $paidVal1 = $amount_due;\n $count=$data_res[0]->count;\n $displayTextCount = 'Total Amount Pending : ';\n } else if ($_POST['pStatus'] == '3'){\n $payment_status2 = \"PAID','PARTPAID\";\n $payment_status1 = \"NOTPAID','PARTPAID\";\n $data1_res = $this->reportsModel->tms_unpaid_report_count($tenant_id, $payment_status1, $year, $month, $training_score);\n $data2_res = $this->reportsModel->tms_paid_report_count($tenant_id, $payment_status2, $year, $month, $training_score);\n $amount_due = $data1_res[0]->total_amount_due;\n $paid_amout = $this->calculate_paid($data2_res);\n $count = ($data1_res[0]->count)+count($data2_res);\n $displayTextCount = \"Total Paid + Unpaid Amount : \";\n \n $paidVal1 =$amount_due + $paid_amout;\n \n }\n \n }\n \n $data['text1'] = 'Total Trainee: '.$count;\n $data['amount1'] = $displayTextCount.$paidVal1;\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }",
"function generarRecibo15_txt() {\n $ids = $_REQUEST['ids'];\n $id_pdeclaracion = $_REQUEST['id_pdeclaracion'];\n $id_etapa_pago = $_REQUEST['id_etapa_pago'];\n//---------------------------------------------------\n// Variables secundarios para generar Reporte en txt\n $master_est = null; //2;\n $master_cc = null; //2;\n\n if ($_REQUEST['todo'] == \"todo\") { // UTIL PARA EL BOTON Recibo Total\n $cubo_est = \"todo\";\n $cubo_cc = \"todo\";\n }\n\n $id_est = $_REQUEST['id_establecimientos'];\n $id_cc = $_REQUEST['cboCentroCosto'];\n\n if ($id_est) {\n $master_est = $id_est;\n } else if($id_est=='0') {\n $cubo_est = \"todo\";\n }\n\n if ($id_cc) {\n $master_cc = $id_cc;\n } else if($id_cc == '0'){\n $cubo_cc = \"todo\";\n }\n //\n $dao = new PlameDeclaracionDao();\n $data_pd = $dao->buscar_ID($id_pdeclaracion);\n $fecha = $data_pd['periodo'];\n\n //---\n $dao_ep = new EtapaPagoDao();\n $data_ep = $dao_ep->buscar_ID($id_etapa_pago);\n ;\n\n $_name_15 = \"error\";\n if ($data_ep['tipo'] == 1):\n $_name_15 = \"1RA QUINCENA\";\n elseif ($data_ep['tipo'] == 2):\n $_name_15 = \"2DA QUINCENA\";\n endif;\n\n\n $nombre_mes = getNameMonth(getFechaPatron($fecha, \"m\"));\n $anio = getFechaPatron($fecha, \"Y\");\n\n\n $file_name = '01.txt';//NAME_COMERCIAL . '-' . $_name_15 . '.txt';\n $file_name2 = '02.txt';//NAME_COMERCIAL . '-BOLETA QUINCENA.txt';\n $fpx = fopen($file_name2, 'w');\n $fp = fopen($file_name, 'w');\n \n //..........................................................................\n $FORMATO_0 = chr(27).'@'.chr(27).'C!';\n $FORMATO = chr(18).chr(27).\"P\";\n $BREAK = chr(13) . chr(10);\n //$BREAK = chr(14) . chr(10);\n //chr(27). chr(100). chr(0)\n $LINEA = str_repeat('-', 80);\n//..............................................................................\n// Inicio Exel\n//.............................................................................. \n fwrite($fp,$FORMATO); \n \n\n\n // paso 01 Listar ESTABLECIMIENTOS del Emplearo 'Empresa'\n $dao_est = new EstablecimientoDao();\n $est = array();\n $est = $dao_est->listar_Ids_Establecimientos(ID_EMPLEADOR);\n $pagina = 1;\n\n // paso 02 listar CENTROS DE COSTO del establecimento. \n if (is_array($est) && count($est) > 0) {\n //DAO\n $dao_cc = new EmpresaCentroCostoDao();\n $dao_pago = new PagoDao();\n $dao_estd = new EstablecimientoDireccionDao();\n\n // -------- Variables globales --------// \n $TOTAL = 0;\n $SUM_TOTAL_CC = array();\n $SUM_TOTAL_EST = array();\n\n\n\n for ($i = 0; $i < count($est); $i++) { // ESTABLECIMIENTO\n //echo \" i = $i establecimiento ID=\".$est[$i]['id_establecimiento'];\n //echo \"<br>\";\n //$SUM_TOTAL_EST[$i]['establecimiento'] = strtoupper(\"Establecimiento X ==\" . $est[$i]['id_establecimiento']);\n $bandera_1 = false;\n if ($est[$i]['id_establecimiento'] == $master_est) {\n $bandera_1 = true;\n } else if ($cubo_est == \"todo\") {\n $bandera_1 = true;\n }\n\n if ($bandera_1) {\n \n // if($bander_ecc){\n \n $SUM_TOTAL_EST[$i]['monto'] = 0;\n //Establecimiento direccion Reniec\n $data_est_direc = $dao_estd->buscarEstablecimientoDireccionReniec($est[$i]['id_establecimiento']/* $id_establecimiento */);\n\n $SUM_TOTAL_EST[$i]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n\n $ecc = array();\n $ecc = $dao_cc->listar_Ids_EmpresaCentroCosto($est[$i]['id_establecimiento']);\n // paso 03 listamos los trabajadores por Centro de costo \n\n for ($j = 0; $j < count($ecc); $j++) {\n\n $bandera_2 = false;\n if ($ecc[$j]['id_empresa_centro_costo'] == $master_cc) {\n $bandera_2 = true;\n } else if ($cubo_est == 'todo' || $cubo_cc == \"todo\") { // $cubo_est\n $bandera_2 = true;\n }\n \n if ($bandera_2) {\n //$contador_break = $contador_break + 1;\n // LISTA DE TRABAJADORES\n $data_tra = array();\n $data_tra = $dao_pago->listar_2($id_etapa_pago, $est[$i]['id_establecimiento'], $ecc[$j]['id_empresa_centro_costo']);\n\n if (count($data_tra)>0) {\n \n $SUM_TOTAL_CC[$i][$j]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n $SUM_TOTAL_CC[$i][$j]['centro_costo'] = strtoupper($ecc[$j]['descripcion']);\n $SUM_TOTAL_CC[$i][$j]['monto'] = 0;\n\n //fwrite($fp, $LINEA); \n fwrite($fp, NAME_EMPRESA); \n //$worksheet->write(($row + 1), ($col + 1), NAME_EMPRESA);\n //$data_pd['periodo'] $data_pd['fecha_modificacion']\n $descripcion1 = date(\"d/m/Y\");\n \n fwrite($fp, str_pad(\"FECHA : \", 56, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($descripcion1, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PAGINA :\", 69, \" \", STR_PAD_LEFT)); \n fwrite($fp, str_pad($pagina, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad($_name_15/*\"1RA QUINCENA\"*/, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PLANILLA DEL MES DE \" . strtoupper($nombre_mes) . \" DEL \" . $anio, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"LOCALIDAD : \" . $data_est_direc['ubigeo_distrito']);\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"CENTRO DE COSTO : \" . strtoupper($ecc[$j]['descripcion']));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n //$worksheet->write($row, $col, \"##################################################\");\n \n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"N \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad(\"DNI\", 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"APELLIDOS Y NOMBRES\", 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"IMPORTE\", 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"FIRMA\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n \n $pag = 0;\n $num_trabajador = 0;\n for ($k = 0; $k < count($data_tra); $k++) {\n $num_trabajador = $num_trabajador +1; \n if($num_trabajador>24):\n fwrite($fp,chr(12));\n $num_trabajador=0;\n endif;\n \n $data = array();\n $data = $data_tra[$k]; \n //$DIRECCION = $SUM_TOTAL_EST[$i]['establecimiento'];\n // Inicio de Boleta \n \n generarRecibo15_txt2($fpx, $data, $nombre_mes, $anio,$pag);\n $pag = $pag +1;\n\n \n // Final de Boleta\n $texto_3 = $data_tra[$k]['apellido_paterno'] . \" \" . $data_tra[$k]['apellido_materno'] . \" \" . $data_tra[$k]['nombres']; \n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(($k + 1) . \" \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($data_tra[$k]['num_documento'], 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(limpiar_caracteres_especiales_plame($texto_3), 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad($data_tra[$k]['sueldo'], 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"_______________\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n \n // por persona\n $SUM_TOTAL_CC[$i][$j]['monto'] = $SUM_TOTAL_CC[$i][$j]['monto'] + $data_tra[$k]['sueldo'];\n }\n\n\n $SUM_TOTAL_EST[$i]['monto'] = $SUM_TOTAL_EST[$i]['monto'] + $SUM_TOTAL_CC[$i][$j]['monto'];\n \n //--- LINE\n fwrite($fp, $BREAK);\n //fwrite($fp, $LINEA);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"TOTAL \" . $SUM_TOTAL_CC[$i][$j]['centro_costo'] . \" \" . $SUM_TOTAL_EST[$i]['establecimiento'], 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$j]['monto'], 2));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n\n fwrite($fp,chr(12));\n $pagina = $pagina + 1;\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK);\n $TOTAL = $TOTAL + $SUM_TOTAL_CC[$i][$j]['monto'];\n //$row_a = $row_a + 5;\n }//End Trabajadores\n }//End Bandera.\n }//END FOR CCosto\n\n\n // CALCULO POR ESTABLECIMIENTOS\n /* $SUM = 0.00;\n for ($z = 0; $z < count($SUM_TOTAL_CC[$i]); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_CC[$i][$z]['centro_costo'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$z]['monto'], 2));\n fwrite($fp, $BREAK);\n\n\n $SUM = $SUM + $SUM_TOTAL_CC[$i][$z]['monto'];\n }\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM, 2));\n */\n\n //fwrite($fp, $BREAK . $BREAK);\n \n }\n }//END FOR Est\n\n /*\n fwrite($fp, str_repeat('*', 85));\n fwrite($fp, $BREAK);\n fwrite($fp, \"CALCULO FINAL ESTABLECIMIENTOS \");\n fwrite($fp, $BREAK);\n\n //$worksheet->write(($row+4), ($col + 1), \".::RESUMEN DE PAGOS::.\");\n $SUM = 0;\n for ($z = 0; $z < count($SUM_TOTAL_EST); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_EST[$z]['establecimiento'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_EST[$z]['monto'], 2));\n fwrite($fp, $BREAK);\n $SUM = $SUM + $SUM_TOTAL_EST[$z]['monto'];\n }\n */\n \n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(number_format_var($TOTAL), 15, ' ',STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n \n \n }//END IF\n//..............................................................................\n// Inicio Exel\n//..............................................................................\n //|---------------------------------------------------------------------------\n //| Calculos Finales\n //|\n //|---------------------------------------------------------------------------\n //\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n\n\n fclose($fp);\n fclose($fpx);\n // $workbook->close();\n // .........................................................................\n // SEGUNDO ARCHIVO\n //..........................................................................\n\n\n\n\n\n\n\n\n\n\n $file = array();\n $file[] = $file_name;\n $file[] = ($file_name2);\n ////generarRecibo15_txt2($id_pdeclaracion, $id_etapa_pago);\n\n\n $zipfile = new zipfile();\n $carpeta = \"file-\" . date(\"d-m-Y\") . \"/\";\n $zipfile->add_dir($carpeta);\n\n for ($i = 0; $i < count($file); $i++) {\n $zipfile->add_file(implode(\"\", file($file[$i])), $carpeta . $file[$i]);\n //$zipfile->add_file( file_get_contents($file[$i]),$carpeta.$file[$i]);\n }\n\n header(\"Content-type: application/octet-stream\");\n header(\"Content-disposition: attachment; filename=zipfile.zip\");\n\n echo $zipfile->file();\n}",
"public function payments_received_reports_pdf() {\n ini_set('memory_limit', '256M');\n $tenant_id = $this->tenant_id;\n $company = $this->classTraineeModel->get_company_for_paidinvoice($tenant_id);\n $companies = array();\n foreach ($company as $row) {\n $companies[$row->company_id] = $row->company_name;\n }\n $company = $this->input->get('company');\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_payment_recd($records_per_page, NULL, NULL, $order_by, $company, $invoice_id, $start_date, $end_date);\n $tabledata_count = count($tabledata);\n $pids = array();\n for ($i = 0; $i < $tabledata_count; $i++) {\n $pids[] = $tabledata[$i]->pymnt_due_id;\n }\n $tb_extra = $this->reportsModel->get_payment_recd_trainee_company($pids);\n $tabledataextra = array();\n for ($i = 0; $i < count($tb_extra); $i++) {\n $tabledataextra[$tb_extra[$i]->pymnt_due_id] = $tb_extra[$i];\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return payments_recd_report_pdf($tabledataextra, $tabledata, $tenant_details, $companies);\n }",
"function report()\n {\n if ($this->acl->otentikasi2($this->title) == TRUE){\n $cur = $this->input->post('ccurrency');\n $start = $this->input->post('start');\n $end = $this->input->post('end');\n\n $data['currency'] = $cur;\n $data['start'] = tglin($start);\n $data['end'] = tglin($end);\n $data['rundate'] = tglin(date('Y-m-d'));\n $data['log'] = $this->decodedd->log;\n\n // Property Details\n $data['company'] = $this->properti['name'];\n\n $result = null;\n foreach ($this->model->report($cur,$start,$end)->result() as $res) {\n $result[] = array (\"id\"=>$res->id, \"no\"=>$res->no, \"notes\"=>$res->notes, \"dates\"=>tglin($res->dates), \n \"currency\"=>$res->currency, \"from\"=>$this->get_acc($res->from), \"to\"=>$this->get_acc($res->to), \n \"posted\"=>$res->approved, \"amount\"=>$res->amount);\n }\n $data['result'] = $result; $this->output = $data;\n }else { $this->reject_token(); }\n $this->response('content');\n }"
] | [
"0.78921235",
"0.6877639",
"0.63729405",
"0.63677514",
"0.6346944",
"0.6255291",
"0.60872173",
"0.6075249",
"0.5999765",
"0.59749573",
"0.5970591",
"0.5963558",
"0.5930038",
"0.59207654",
"0.5920088",
"0.5911183",
"0.58961457",
"0.58660185",
"0.58473986",
"0.5843417",
"0.5839251",
"0.58361727",
"0.5826392",
"0.5813611",
"0.58129823",
"0.5805866",
"0.58003485",
"0.57954794",
"0.5791967",
"0.5782226"
] | 0.84146255 | 0 |
Given the dialog rows, create the dialog using field templates to create individual rows | function calculate_dialog($drows, $value, $title, $langtag, $formtype = 'table') {
require_once 'modules/Checklist/fillout.php';
$tlist = getTranslatables($langtag);
$tout = array();
$this->importall = "{$this->baseurl}/audit/importall";
$this->import2lab = "{$this->baseurl}/audit/import2lab";
$this->cancelimport = "{$this->baseurl}/audit/cancelimport";
$title = $drows[0]['title'];
$tout[] = <<<"END"
<div style="margin-left:200px;"><h1 style="margin-bottom:10px;">{$title}
<button id="helpbutton" onclick="return toggleHelp();">Help</button> </h1> </div>
<div style="margin:15px 0;">
END;
$tout[] = '<table border=0 style="width:900px;">';
$hid = array();
foreach($drows as $row) {
$pos = $row['position'];
// if ($pos ==0) continue;
$type = $row['field_type'];
$arow = array();
$field_label = get_lang_text($row['field_label'], '', ''); // , $row ['ltdefault'], $row ['ltlang'] );
$arow['field_label'] = $field_label .
':';
$arow['varname'] = $row['field_name'];
$varname = $arow['varname'];
$arow['baseurl'] = $this->baseurl;
$arow['field_length'] = 0; //$row['field_length'];
$info = $row['info'];
switch ($type) {
case '' :
logit("ROW: " . print_r($row, true));
break;
case 'hidden' :
$val = get_arrval($value, $varname, '');
$hid[] = "<input type=\"hidden\" name=\"{$varname}\" value=\"{$val}\">";
break;
case 'file' :
$tout[] = <<<"END"
<tr>
<td class="n f right" style="width:200px;">
<td class="n f" style="width:600px;">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
{$field_label}: <input name="uploadedfile" type="file" />
</td>
</tr>
END;
break;
case 'text' :
$info = str_replace('"', '\"', $info);
// logit("TEXT: {$info}");
$audit = $this->audit;
eval("\$lines = \"$info\"; ");
$tout[] = <<<"END"
<tr>
<td class="n f right" style="width:200px;">
<td class="n f" style="width:600px;"><div id="help2" style="font-size:1.4em;line-height:1.3em;">{$lines}</div></td>
</tr>
END;
break;
case 'info' :
$tout[] = <<<"END"
<tr>
<td class="n f right" style="width:200px;">
<td class="n f" style="width:600px;"><div id="help" style="display:none;">{$info}</div></td>
</tr>
END;
break;
case 'info2' :
$tout[] = <<<"END"
<tr>
<td class="n f right" style="width:200px;">
<td class="n f" style="width:600px;"><div id="help2" style="">{$info}</div></td>
</tr>
END;
break;
case 'heading' :
$tout[] = <<<"END"
<tr>
<td class="n f right" style="width:50px;">
<td class="n f" style="width:750px;"><h3>{$field_label}</h3></td>
</tr>
END;
break;
case 'submit_button' :
$arow['field_label'] = $field_label;
//$arow['baseurl'] = $baseurl;
$arow['homeurl'] = "{$this->baseurl}/audit/main";
// logit("HURL: {$arow['homeurl']}");
$field_label = '';
default :
$inp = call_user_func("dialog_{$type}", $arow, $value, $tlist);
$tout[] = <<<"END"
<tr>
<td class="n f right" style="width:300px;">
<label for="{$varname}" style="" class="inp">{$field_label}</label>
</td><td class="n f" style="width:500px;">{$inp}</td>
</tr>
END;
}
}
$tout[] = '</table></div></div>';
$tout[] = implode("\n", $hid);
// logit('dialog: '. print_r($tout, true));
return implode("\n", $tout);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 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}",
"private function _make_row($data) {\n $options = array(\n \"id\" => $data->fid_cust\n );\n\n $query = $this->Master_Customers_model->get_details($options)->row();\n $value = $this->Sales_Invoices_model->get_invoices_total_summary($data->id);\n $originalDate = $data->inv_date;\n $newDate = date(\"d-M-Y\", strtotime($originalDate));\n $row_data = array(\n \n anchor(get_uri(\"sales/s_invoices/view/\" . $data->id.\"/\".str_replace(\"/\", \"-\", $data->code)), \"#\".$data->code),\n modal_anchor(get_uri(\"master/customers/view/\" . $data->fid_cust), $query->name, array(\"class\" => \"view\", \"title\" => \"Customers \".$query->name, \"data-post-id\" => $data->fid_cust)),\n $this->_get_invoices_status_label($data),\n $data->email_to,\n $newDate,\n $data->currency,\n to_currency($value->invoice_total)\n\n );\n\n if($data->status != \"posting\"){\n $row_data[] = anchor(get_uri(\"sales/s_invoices/edit/\".$data->id), \"<i class='fa fa-pencil'></i>\", array(\"class\" => \"edit\", \"title\" => lang('edit_client')))\n . js_anchor(\"<i class='fa fa-times fa-fw'></i>\", array('title' => lang('delete_client'), \"class\" => \"delete\", \"data-id\" => $data->id, \"data-action-url\" => get_uri(\"sales/s_invoices/delete\"), \"data-action\" => \"delete\"));\n\n }\n $row_data[] = anchor(get_uri(\"sales/s_invoices/view/\").$data->id, \"<i class='fa fa-eye'></i>\", array(\"class\" => \"view\", \"title\" => lang('view'), \"data-post-id\" => $data->id));\n\n return $row_data;\n }",
"function buildRows(&$rows ) {\n require_once 'CRM/Utils/HilreportsUtils.php';\n $this->modifyColumnHeaders( );\n $this->calculateAantalContacts();\n $this->setCustomGroupIdExtraGegevens();\n $rowNumber = 0;\n /*\n * eerste rij met totalen\n */\n $rows[$rowNumber]['label'] = \"<strong>TOTAAL:</strong>\";\n $rows[$rowNumber]['aantal'] = $this->_aantalContacts;\n $rows[$rowNumber]['percentage'] = \"100%\";\n $rowNumber++;\n $this->_aantalRijen++;\n /*\n * build rows for land van herkomst\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Land van herkomst:\");\n $this->addRowsLandVanHerkomst($rows, $rowNumber);\n /*\n * build rows for economische status\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Economische status\");\n $this->addRowsOptionValue($rows, $rowNumber, \"Economische status\", \"econ_status\");\n /*\n * build rows for burgerlijke staat\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Burgerlijke staat\");\n $this->addRowsOptionValue($rows, $rowNumber, \"Burgerlijke staat\", \"burg_staat\");\n /*\n * build rows for ethnisch culturele achtergrond\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Ethnisch/culturele achtergrond\");\n $this->addRowsOptionValue($rows, $rowNumber, \"Ethnisch/culturele achtergrond\", \"cult_ethn\");\n /*\n * build rows for nationaliteit\n */\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Nationaliteit\");\n $this->addRowsText($rows, $rowNumber, \"nationaliteit\");\n /*\n * build rows for geslacht\n */\n $this->_optionGroupId = 3;\n $this->insertEmptyLine($rowNumber, $rows);\n $this->insertHeaderLine($rowNumber, $rows, \"Geslacht:\");\n $this->addRowsOptionValue($rows, $rowNumber, \"\", \"geslacht\");\n }",
"public static function formrow(){\n\n\n $forms = \"<tr class='row100 body'>\\n\";\n $forms .= \"<td class='cell100 column1'>\";\n return $forms;\n }",
"private function fillTemplate() {\n\t\tglobal $tpl;\n\t\t$tpl->addCss('./Customizing/global/plugins/Services/Repository/RepositoryObject/Review/templates/default/css/Review.css');\n\t\t$path_to_il_tpl = ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'Review')->getDirectory();\n\t\t$custom_tpl = new ilTemplate(\"tpl.matrix_row.html\", true, true, $path_to_il_tpl);\n foreach ((array) $this->checkboxes as $chbox) {\n\t\t\t$chbox->insert($custom_tpl);\n }\n\n\t\t$this->setHTML($custom_tpl->get());\n }",
"public function display_rows() {\n\n\t\t// Get the records registered in the prepare_items method\n\t\t$records = $this->items;\n\n\t\t// Get the columns registered in the get_columns and get_sortable_columns methods\n\t\tlist( $columns, $hidden ) = $this->get_column_info();\n\n\t\t// Loop for each record\n\t\tif ( ! empty( $records ) ) {\n\t\t\tforeach ( $records as $rec ) {\n\n\t\t\t\t// Open the line\n\t\t\t\techo '<tr id=\"record_' . $rec->ID . '\">';\n\t\t\t\tforeach ( $columns as $column_name => $column_display_name ) {\n\n\t\t\t\t\t// Style attributes for each col\n\t\t\t\t\t$class = \"class='$column_name column-$column_name'\";\n\t\t\t\t\t$style = '';\n\t\t\t\t\tif ( in_array( $column_name, $hidden ) ) {\n\t\t\t\t\t\t$style = ' style=\"display:none;\"';\n\t\t\t\t\t}\n\t\t\t\t\t$attributes = $class . $style;\n\n\t\t\t\t\tswitch ( $column_name ) {\n\t\t\t\t\t\tcase 'title':\n\t\t\t\t\t\t\t$edit_link = admin_url( 'admin.php?page=wo_edit_client&id=' . $rec->ID );\n\t\t\t\t\t\t\techo '<td ' . $attributes . '><strong><a href=\"' . $edit_link . '\" title=\"Edit\">' . stripslashes( $rec->post_title ) . '</a></strong>\n\t\t\t\t\t\t<div class=\"row-actions\">\n\t\t\t\t\t\t<span class=\"edit\"><a href=\"' . $edit_link . '\" title=\"' . __( 'Edit Client', 'wp-oauth' ) . '\">' . __( 'Edit', 'wp-oauth' ) . '</a> | </span>\n\t\t\t\t\t\t<span class=\"trash\"><a class=\"submitdelete\" title=\"' . __( 'delete this client', 'wp-oauth' ) . '\" onclick=\"wo_remove_client(\\'' . $rec->ID . '\\');\" href=\"#\">' . __( 'Delete', 'wp-oauth' ) . '</a> </span>';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// case \"user_id\": echo '<td '.$attributes.'>'.stripslashes($rec->user_id).'</td>'; break;\n\t\t\t\t\t\tcase 'client_id':\n\t\t\t\t\t\t\techo '<td ' . $attributes . '>' . get_post_meta( $rec->ID, 'client_id', true ) . '</td>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Close the line\n\t\t\t\techo '</tr>';\n\t\t\t}\n\t\t}\n\t}",
"function bot_wtc_output_rows() // outputs the rows for the html table in the bot_wtc_tab\n{\n\tglobal $bot_items;\n\n\t$selectInput_for_position = array('insertBefore'=>'before','insertAfter'=>'after'); // position values for the txp function selectInput\n\t$db_values = bot_wtc_fetch_db(); // array of values from the db\n\n $destination_selectInput = bot_all_items_selectinput();\n\t$items_selectInput = bot_contextual_selectinput();\n\n\t// builds rows for new item sections list\n\t$sections= bot_get_sections(); // get sections array\n\t$new_item_sections_rows = '';\n\tforeach ($sections as $key => $value) {\n\t\t$new_item_sections_row = '<label>'.checkbox('new_item_sections[]', $key, '0').$value.'</label><br />';\n\t\t$new_item_sections_rows .= $new_item_sections_row;\n }\n $new_item_sections_rows .= '<p ><a href=\"#\" class=\"bot_all\">'.gTxt(\"all\").'</a> | <a href=\"#\" class=\"bot_none\">'.gTxt(\"none\").'</a></p>'; // hide all/none\n\n\t// new item insertion\n\t$rows = \"\";\n\t$input_row = tr(\n\t\ttd(selectInput('new_item',bot_contextual_selectinput(), '', '1'), '', 'bot_hilight')\n\t\t.td(selectInput('new_item_position', $selectInput_for_position, '', '1'))\n\t\t.td(selectInput('new_item_destination',bot_all_items_selectinput(), '', '1'))\n\t\t.td('<p><a href=\"#\" class=\"bot_push\">'.gTxt(\"tag_section_list\").'</a></p><div class=\"bot_collapse\">'.$new_item_sections_rows.'</div>')\n\t\t.td(finput('text','new_item_class', ''))\n\t\t.td()\n\t\t);\n\t\t$rows .= $input_row;\n\n\t// other rows - output if at least one record was already set\n\tif ($db_values){\n\t\tfor ($i = 0; $i < count( $db_values ); $i++){\n\t\t\t// data for \"sections to show\" selectinput - decides wether a section is checked or not\n\t\t\t$bot_hide_in_this_sections_array = explode('|', $db_values[$i]['sections']);\n\t\t\t$item_sections_rows = '';\n\t\t\tforeach ($sections as $key => $value) { // if section is in db mark as checked\n\t\t\t $checked = in_array($key, $bot_hide_in_this_sections_array) ? '1': '0';\n\t\t\t\t$item_sections_row = '<label>'.checkbox('bot_wtc_sections_for_id_'.$db_values[$i]['id'].'[]', $key, $checked).$value.'</label><br />';\n\t\t\t\t$item_sections_rows .= $item_sections_row;\n\t\t }\n\t\t $item_sections_rows .= '<p><a href=\"#\" class=\"bot_all\">'.gTxt(\"all\").'</a> | <a href=\"#\" class=\"bot_none\">'.gTxt(\"none\").'</a></p>'; // hide all/none\n\t\t\t$single_row = tr(\n\t\t\ttd(selectInput('item[]',bot_contextual_selectinput($db_values[$i]['item']), $db_values[$i]['item'],'0'), '', 'bot_hilight')\n\t\t\t.td(selectInput('item_position[]', $selectInput_for_position, $db_values[$i]['position'], '1'))\n\t\t\t.td(selectInput('item_destination[]',bot_all_items_selectinput(), $db_values[$i]['destination'],'1'))\n \t\t\t.td('<p><a href=\"#\" class=\"bot_push\">'.gTxt(\"tag_section_list\").'</a></p><div class=\"bot_collapse\">'.$item_sections_rows.'</div>')\n\t\t\t.td(finput('text', 'item_class[]', $db_values[$i]['class']))\n\t\t\t.td(checkbox('bot_delete_id[]', $db_values[$i]['id'], '0').'<label for=\"bot_delete_id\"> '.gTxt('delete').'</label>'))\n\t\t\t.hInput('bot_wtc_id[]', $db_values[$i]['id']);\n\n\t\t\t$rows .= $single_row;\n\t\t}\n\t};\n\treturn $rows;\n}",
"function RenderRow() {\n\t\tglobal $Security, $Language, $gsLanguage;\n\n\t\t// Initialize URLs\n\t\t$this->AddUrl = $this->GetAddUrl();\n\t\t$this->EditUrl = $this->GetEditUrl();\n\t\t$this->CopyUrl = $this->GetCopyUrl();\n\t\t$this->DeleteUrl = $this->GetDeleteUrl();\n\t\t$this->ListUrl = $this->GetListUrl();\n\t\t$this->SetupOtherOptions();\n\n\t\t// Call Row_Rendering event\n\t\t$this->Row_Rendering();\n\n\t\t// Common render codes for all row types\n\t\t// empleado_id\n\t\t// codigo\n\t\t// cui\n\t\t// nombre\n\t\t// apellido\n\t\t// direccion\n\t\t// departamento_origen_id\n\t\t// municipio_id\n\t\t// telefono_residencia\n\t\t// telefono_celular\n\t\t// fecha_nacimiento\n\t\t// nacionalidad\n\t\t// estado_civil\n\t\t// sexo\n\t\t// igss\n\t\t// nit\n\t\t// licencia_conducir\n\t\t// area_id\n\t\t// departmento_id\n\t\t// seccion_id\n\t\t// puesto_id\n\t\t// observaciones\n\t\t// tipo_sangre_id\n\t\t// estado\n\n\t\tif ($this->RowType == EW_ROWTYPE_VIEW) { // View row\n\n\t\t// codigo\n\t\t$this->codigo->ViewValue = $this->codigo->CurrentValue;\n\t\t$this->codigo->ViewCustomAttributes = \"\";\n\n\t\t// cui\n\t\t$this->cui->ViewValue = $this->cui->CurrentValue;\n\t\t$this->cui->ViewCustomAttributes = \"\";\n\n\t\t// nombre\n\t\t$this->nombre->ViewValue = $this->nombre->CurrentValue;\n\t\t$this->nombre->ViewCustomAttributes = \"\";\n\n\t\t// apellido\n\t\t$this->apellido->ViewValue = $this->apellido->CurrentValue;\n\t\t$this->apellido->ViewCustomAttributes = \"\";\n\n\t\t// direccion\n\t\t$this->direccion->ViewValue = $this->direccion->CurrentValue;\n\t\t$this->direccion->ViewCustomAttributes = \"\";\n\n\t\t// departamento_origen_id\n\t\tif (strval($this->departamento_origen_id->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`departamento_origen_id`\" . ew_SearchString(\"=\", $this->departamento_origen_id->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `departamento_origen_id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `departamento_origen`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->departamento_origen_id, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->departamento_origen_id->ViewValue = $this->departamento_origen_id->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->departamento_origen_id->ViewValue = $this->departamento_origen_id->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->departamento_origen_id->ViewValue = NULL;\n\t\t}\n\t\t$this->departamento_origen_id->ViewCustomAttributes = \"\";\n\n\t\t// municipio_id\n\t\tif (strval($this->municipio_id->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`municipio_id`\" . ew_SearchString(\"=\", $this->municipio_id->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `municipio_id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `municipio`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->municipio_id, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->municipio_id->ViewValue = $this->municipio_id->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->municipio_id->ViewValue = $this->municipio_id->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->municipio_id->ViewValue = NULL;\n\t\t}\n\t\t$this->municipio_id->ViewCustomAttributes = \"\";\n\n\t\t// telefono_residencia\n\t\t$this->telefono_residencia->ViewValue = $this->telefono_residencia->CurrentValue;\n\t\t$this->telefono_residencia->ViewCustomAttributes = \"\";\n\n\t\t// telefono_celular\n\t\t$this->telefono_celular->ViewValue = $this->telefono_celular->CurrentValue;\n\t\t$this->telefono_celular->ViewCustomAttributes = \"\";\n\n\t\t// fecha_nacimiento\n\t\t$this->fecha_nacimiento->ViewValue = $this->fecha_nacimiento->CurrentValue;\n\t\t$this->fecha_nacimiento->ViewValue = ew_FormatDateTime($this->fecha_nacimiento->ViewValue, 7);\n\t\t$this->fecha_nacimiento->ViewCustomAttributes = \"\";\n\n\t\t// nacionalidad\n\t\tif (strval($this->nacionalidad->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`nacionalidad_id`\" . ew_SearchString(\"=\", $this->nacionalidad->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `nacionalidad_id`, `nacionalidad` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `nacionalidad`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->nacionalidad, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->nacionalidad->ViewValue = $this->nacionalidad->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->nacionalidad->ViewValue = $this->nacionalidad->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->nacionalidad->ViewValue = NULL;\n\t\t}\n\t\t$this->nacionalidad->ViewCustomAttributes = \"\";\n\n\t\t// estado_civil\n\t\t$this->estado_civil->ViewValue = $this->estado_civil->CurrentValue;\n\t\tif (strval($this->estado_civil->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`estado_civil_id`\" . ew_SearchString(\"=\", $this->estado_civil->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `estado_civil_id`, `estado_civil` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `estado_civil`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->estado_civil, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->estado_civil->ViewValue = $this->estado_civil->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->estado_civil->ViewValue = $this->estado_civil->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->estado_civil->ViewValue = NULL;\n\t\t}\n\t\t$this->estado_civil->ViewCustomAttributes = \"\";\n\n\t\t// sexo\n\t\t$this->sexo->ViewValue = $this->sexo->CurrentValue;\n\t\tif (strval($this->sexo->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`sexo_id`\" . ew_SearchString(\"=\", $this->sexo->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `sexo_id`, `sexo` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `sexo`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->sexo, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->sexo->ViewValue = $this->sexo->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->sexo->ViewValue = $this->sexo->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->sexo->ViewValue = NULL;\n\t\t}\n\t\t$this->sexo->ViewCustomAttributes = \"\";\n\n\t\t// igss\n\t\t$this->igss->ViewValue = $this->igss->CurrentValue;\n\t\t$this->igss->ViewCustomAttributes = \"\";\n\n\t\t// nit\n\t\t$this->nit->ViewValue = $this->nit->CurrentValue;\n\t\t$this->nit->ViewCustomAttributes = \"\";\n\n\t\t// licencia_conducir\n\t\t$this->licencia_conducir->ViewValue = $this->licencia_conducir->CurrentValue;\n\t\t$this->licencia_conducir->ViewCustomAttributes = \"\";\n\n\t\t// area_id\n\t\t$this->area_id->ViewValue = $this->area_id->CurrentValue;\n\t\tif (strval($this->area_id->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`area_id`\" . ew_SearchString(\"=\", $this->area_id->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `area_id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `area`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->area_id, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->area_id->ViewValue = $this->area_id->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->area_id->ViewValue = $this->area_id->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->area_id->ViewValue = NULL;\n\t\t}\n\t\t$this->area_id->ViewCustomAttributes = \"\";\n\n\t\t// departmento_id\n\t\tif (strval($this->departmento_id->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`departamento_id`\" . ew_SearchString(\"=\", $this->departmento_id->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `departamento_id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `departamento`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->departmento_id, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->departmento_id->ViewValue = $this->departmento_id->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->departmento_id->ViewValue = $this->departmento_id->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->departmento_id->ViewValue = NULL;\n\t\t}\n\t\t$this->departmento_id->ViewCustomAttributes = \"\";\n\n\t\t// seccion_id\n\t\tif (strval($this->seccion_id->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`seccion_id`\" . ew_SearchString(\"=\", $this->seccion_id->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `seccion_id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `seccion`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->seccion_id, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->seccion_id->ViewValue = $this->seccion_id->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->seccion_id->ViewValue = $this->seccion_id->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->seccion_id->ViewValue = NULL;\n\t\t}\n\t\t$this->seccion_id->ViewCustomAttributes = \"\";\n\n\t\t// puesto_id\n\t\tif (strval($this->puesto_id->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`puesto_id`\" . ew_SearchString(\"=\", $this->puesto_id->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `puesto_id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `puesto`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->puesto_id, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->puesto_id->ViewValue = $this->puesto_id->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->puesto_id->ViewValue = $this->puesto_id->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->puesto_id->ViewValue = NULL;\n\t\t}\n\t\t$this->puesto_id->ViewCustomAttributes = \"\";\n\n\t\t// observaciones\n\t\t$this->observaciones->ViewValue = $this->observaciones->CurrentValue;\n\t\t$this->observaciones->ViewCustomAttributes = \"\";\n\n\t\t// tipo_sangre_id\n\t\tif (strval($this->tipo_sangre_id->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`tipo_sangre_id`\" . ew_SearchString(\"=\", $this->tipo_sangre_id->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `tipo_sangre_id`, `tipo_sangre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipo_sangre`\";\n\t\t$sWhereWrk = \"\";\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->tipo_sangre_id, $sWhereWrk); // Call Lookup selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->tipo_sangre_id->ViewValue = $this->tipo_sangre_id->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->tipo_sangre_id->ViewValue = $this->tipo_sangre_id->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->tipo_sangre_id->ViewValue = NULL;\n\t\t}\n\t\t$this->tipo_sangre_id->ViewCustomAttributes = \"\";\n\n\t\t// estado\n\t\t$this->estado->ViewValue = $this->estado->CurrentValue;\n\t\t$this->estado->ViewCustomAttributes = \"\";\n\n\t\t\t// codigo\n\t\t\t$this->codigo->LinkCustomAttributes = \"\";\n\t\t\t$this->codigo->HrefValue = \"\";\n\t\t\t$this->codigo->TooltipValue = \"\";\n\n\t\t\t// cui\n\t\t\t$this->cui->LinkCustomAttributes = \"\";\n\t\t\t$this->cui->HrefValue = \"\";\n\t\t\t$this->cui->TooltipValue = \"\";\n\n\t\t\t// nombre\n\t\t\t$this->nombre->LinkCustomAttributes = \"\";\n\t\t\t$this->nombre->HrefValue = \"\";\n\t\t\t$this->nombre->TooltipValue = \"\";\n\n\t\t\t// apellido\n\t\t\t$this->apellido->LinkCustomAttributes = \"\";\n\t\t\t$this->apellido->HrefValue = \"\";\n\t\t\t$this->apellido->TooltipValue = \"\";\n\n\t\t\t// direccion\n\t\t\t$this->direccion->LinkCustomAttributes = \"\";\n\t\t\t$this->direccion->HrefValue = \"\";\n\t\t\t$this->direccion->TooltipValue = \"\";\n\n\t\t\t// departamento_origen_id\n\t\t\t$this->departamento_origen_id->LinkCustomAttributes = \"\";\n\t\t\t$this->departamento_origen_id->HrefValue = \"\";\n\t\t\t$this->departamento_origen_id->TooltipValue = \"\";\n\n\t\t\t// municipio_id\n\t\t\t$this->municipio_id->LinkCustomAttributes = \"\";\n\t\t\t$this->municipio_id->HrefValue = \"\";\n\t\t\t$this->municipio_id->TooltipValue = \"\";\n\n\t\t\t// telefono_residencia\n\t\t\t$this->telefono_residencia->LinkCustomAttributes = \"\";\n\t\t\t$this->telefono_residencia->HrefValue = \"\";\n\t\t\t$this->telefono_residencia->TooltipValue = \"\";\n\n\t\t\t// telefono_celular\n\t\t\t$this->telefono_celular->LinkCustomAttributes = \"\";\n\t\t\t$this->telefono_celular->HrefValue = \"\";\n\t\t\t$this->telefono_celular->TooltipValue = \"\";\n\n\t\t\t// fecha_nacimiento\n\t\t\t$this->fecha_nacimiento->LinkCustomAttributes = \"\";\n\t\t\t$this->fecha_nacimiento->HrefValue = \"\";\n\t\t\t$this->fecha_nacimiento->TooltipValue = \"\";\n\n\t\t\t// nacionalidad\n\t\t\t$this->nacionalidad->LinkCustomAttributes = \"\";\n\t\t\t$this->nacionalidad->HrefValue = \"\";\n\t\t\t$this->nacionalidad->TooltipValue = \"\";\n\n\t\t\t// estado_civil\n\t\t\t$this->estado_civil->LinkCustomAttributes = \"\";\n\t\t\t$this->estado_civil->HrefValue = \"\";\n\t\t\t$this->estado_civil->TooltipValue = \"\";\n\n\t\t\t// sexo\n\t\t\t$this->sexo->LinkCustomAttributes = \"\";\n\t\t\t$this->sexo->HrefValue = \"\";\n\t\t\t$this->sexo->TooltipValue = \"\";\n\n\t\t\t// igss\n\t\t\t$this->igss->LinkCustomAttributes = \"\";\n\t\t\t$this->igss->HrefValue = \"\";\n\t\t\t$this->igss->TooltipValue = \"\";\n\n\t\t\t// nit\n\t\t\t$this->nit->LinkCustomAttributes = \"\";\n\t\t\t$this->nit->HrefValue = \"\";\n\t\t\t$this->nit->TooltipValue = \"\";\n\n\t\t\t// licencia_conducir\n\t\t\t$this->licencia_conducir->LinkCustomAttributes = \"\";\n\t\t\t$this->licencia_conducir->HrefValue = \"\";\n\t\t\t$this->licencia_conducir->TooltipValue = \"\";\n\n\t\t\t// area_id\n\t\t\t$this->area_id->LinkCustomAttributes = \"\";\n\t\t\t$this->area_id->HrefValue = \"\";\n\t\t\t$this->area_id->TooltipValue = \"\";\n\n\t\t\t// departmento_id\n\t\t\t$this->departmento_id->LinkCustomAttributes = \"\";\n\t\t\t$this->departmento_id->HrefValue = \"\";\n\t\t\t$this->departmento_id->TooltipValue = \"\";\n\n\t\t\t// seccion_id\n\t\t\t$this->seccion_id->LinkCustomAttributes = \"\";\n\t\t\t$this->seccion_id->HrefValue = \"\";\n\t\t\t$this->seccion_id->TooltipValue = \"\";\n\n\t\t\t// puesto_id\n\t\t\t$this->puesto_id->LinkCustomAttributes = \"\";\n\t\t\t$this->puesto_id->HrefValue = \"\";\n\t\t\t$this->puesto_id->TooltipValue = \"\";\n\n\t\t\t// observaciones\n\t\t\t$this->observaciones->LinkCustomAttributes = \"\";\n\t\t\t$this->observaciones->HrefValue = \"\";\n\t\t\t$this->observaciones->TooltipValue = \"\";\n\n\t\t\t// tipo_sangre_id\n\t\t\t$this->tipo_sangre_id->LinkCustomAttributes = \"\";\n\t\t\t$this->tipo_sangre_id->HrefValue = \"\";\n\t\t\t$this->tipo_sangre_id->TooltipValue = \"\";\n\n\t\t\t// estado\n\t\t\t$this->estado->LinkCustomAttributes = \"\";\n\t\t\t$this->estado->HrefValue = \"\";\n\t\t\t$this->estado->TooltipValue = \"\";\n\t\t}\n\n\t\t// Call Row Rendered event\n\t\tif ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)\n\t\t\t$this->Row_Rendered();\n\t}",
"protected function createDialog() {\n $dialog = parent::createDialog();\n $dialog->fields = $this->builder()->getFields();\n return $dialog;\n }",
"function ReplaceContentOneRow( $row, $template_html )\n{\n //replace fields with values in template\n $content = $template_html;\n foreach($row as $field => $value)\n {\n $content = str_replace(\"@@$field@@\", $value, $content);\n }\n\n return $content;\n}",
"function ReplaceContentOneRow( $row, $template_html )\n{\n //replace fields with values in template\n $content = $template_html;\n foreach($row as $field => $value)\n {\n $content = str_replace(\"@@$field@@\", $value, $content);\n }\n\n return $content;\n}",
"function RenderRow() {\r\n\t\tglobal $Security, $Language, $gsLanguage;\r\n\r\n\t\t// Initialize URLs\r\n\t\t$this->AddUrl = $this->GetAddUrl();\r\n\t\t$this->EditUrl = $this->GetEditUrl();\r\n\t\t$this->CopyUrl = $this->GetCopyUrl();\r\n\t\t$this->DeleteUrl = $this->GetDeleteUrl();\r\n\t\t$this->ListUrl = $this->GetListUrl();\r\n\t\t$this->SetupOtherOptions();\r\n\r\n\t\t// Call Row_Rendering event\r\n\t\t$this->Row_Rendering();\r\n\r\n\t\t// Common render codes for all row types\r\n\t\t// Dni_Tutor\r\n\t\t// Apellidos_Nombres\r\n\t\t// Edad\r\n\t\t// Domicilio\r\n\t\t// Tel_Contacto\r\n\t\t// Fecha_Nac\r\n\t\t// Cuil\r\n\t\t// MasHijos\r\n\t\t// Id_Estado_Civil\r\n\t\t// Id_Sexo\r\n\t\t// Id_Relacion\r\n\t\t// Id_Ocupacion\r\n\t\t// Lugar_Nacimiento\r\n\t\t// Id_Provincia\r\n\t\t// Id_Departamento\r\n\t\t// Id_Localidad\r\n\t\t// Fecha_Actualizacion\r\n\t\t// Usuario\r\n\r\n\t\tif ($this->RowType == EW_ROWTYPE_VIEW) { // View row\r\n\r\n\t\t// Dni_Tutor\r\n\t\t$this->Dni_Tutor->ViewValue = $this->Dni_Tutor->CurrentValue;\r\n\t\t$this->Dni_Tutor->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Apellidos_Nombres\r\n\t\t$this->Apellidos_Nombres->ViewValue = $this->Apellidos_Nombres->CurrentValue;\r\n\t\t$this->Apellidos_Nombres->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Edad\r\n\t\t$this->Edad->ViewValue = $this->Edad->CurrentValue;\r\n\t\t$this->Edad->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Domicilio\r\n\t\t$this->Domicilio->ViewValue = $this->Domicilio->CurrentValue;\r\n\t\t$this->Domicilio->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Tel_Contacto\r\n\t\t$this->Tel_Contacto->ViewValue = $this->Tel_Contacto->CurrentValue;\r\n\t\t$this->Tel_Contacto->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Fecha_Nac\r\n\t\t$this->Fecha_Nac->ViewValue = $this->Fecha_Nac->CurrentValue;\r\n\t\t$this->Fecha_Nac->ViewValue = ew_FormatDateTime($this->Fecha_Nac->ViewValue, 7);\r\n\t\t$this->Fecha_Nac->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Cuil\r\n\t\t$this->Cuil->ViewValue = $this->Cuil->CurrentValue;\r\n\t\t$this->Cuil->ViewCustomAttributes = \"\";\r\n\r\n\t\t// MasHijos\r\n\t\tif (strval($this->MasHijos->CurrentValue) <> \"\") {\r\n\t\t\t$this->MasHijos->ViewValue = $this->MasHijos->OptionCaption($this->MasHijos->CurrentValue);\r\n\t\t} else {\r\n\t\t\t$this->MasHijos->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->MasHijos->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Estado_Civil\r\n\t\tif (strval($this->Id_Estado_Civil->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Estado_Civil`\" . ew_SearchString(\"=\", $this->Id_Estado_Civil->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Estado_Civil`, `Descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `estado_civil`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Estado_Civil->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Estado_Civil, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Estado_Civil->ViewValue = $this->Id_Estado_Civil->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Estado_Civil->ViewValue = $this->Id_Estado_Civil->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Estado_Civil->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Estado_Civil->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Sexo\r\n\t\tif (strval($this->Id_Sexo->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Sexo`\" . ew_SearchString(\"=\", $this->Id_Sexo->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Sexo`, `Descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `sexo_personas`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Sexo->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Sexo, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Sexo->ViewValue = $this->Id_Sexo->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Sexo->ViewValue = $this->Id_Sexo->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Sexo->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Sexo->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Relacion\r\n\t\tif (strval($this->Id_Relacion->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Relacion`\" . ew_SearchString(\"=\", $this->Id_Relacion->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Relacion`, `Desripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipo_relacion_alumno_tutor`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Relacion->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Relacion, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t$sSqlWrk .= \" ORDER BY `Desripcion` ASC\";\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Relacion->ViewValue = $this->Id_Relacion->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Relacion->ViewValue = $this->Id_Relacion->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Relacion->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Relacion->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Ocupacion\r\n\t\tif (strval($this->Id_Ocupacion->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Ocupacion`\" . ew_SearchString(\"=\", $this->Id_Ocupacion->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Ocupacion`, `Descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `ocupacion_tutor`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Ocupacion->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Ocupacion, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Ocupacion->ViewValue = $this->Id_Ocupacion->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Ocupacion->ViewValue = $this->Id_Ocupacion->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Ocupacion->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Ocupacion->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Lugar_Nacimiento\r\n\t\t$this->Lugar_Nacimiento->ViewValue = $this->Lugar_Nacimiento->CurrentValue;\r\n\t\t$this->Lugar_Nacimiento->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Provincia\r\n\t\tif (strval($this->Id_Provincia->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Provincia`\" . ew_SearchString(\"=\", $this->Id_Provincia->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Provincia`, `Nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `provincias`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Provincia->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Provincia, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t$sSqlWrk .= \" ORDER BY `Nombre` ASC\";\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Provincia->ViewValue = $this->Id_Provincia->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Provincia->ViewValue = $this->Id_Provincia->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Provincia->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Provincia->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Departamento\r\n\t\tif (strval($this->Id_Departamento->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Departamento`\" . ew_SearchString(\"=\", $this->Id_Departamento->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Departamento`, `Nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `departamento`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Departamento->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Departamento, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t$sSqlWrk .= \" ORDER BY `Nombre` ASC\";\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Departamento->ViewValue = $this->Id_Departamento->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Departamento->ViewValue = $this->Id_Departamento->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Departamento->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Departamento->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Localidad\r\n\t\tif (strval($this->Id_Localidad->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Localidad`\" . ew_SearchString(\"=\", $this->Id_Localidad->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Localidad`, `Nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `localidades`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Localidad->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Localidad, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t$sSqlWrk .= \" ORDER BY `Nombre` ASC\";\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Localidad->ViewValue = $this->Id_Localidad->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Localidad->ViewValue = $this->Id_Localidad->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Localidad->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Localidad->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Fecha_Actualizacion\r\n\t\t$this->Fecha_Actualizacion->ViewValue = $this->Fecha_Actualizacion->CurrentValue;\r\n\t\t$this->Fecha_Actualizacion->ViewValue = ew_FormatDateTime($this->Fecha_Actualizacion->ViewValue, 7);\r\n\t\t$this->Fecha_Actualizacion->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Usuario\r\n\t\t$this->Usuario->ViewValue = $this->Usuario->CurrentValue;\r\n\t\t$this->Usuario->ViewCustomAttributes = \"\";\r\n\r\n\t\t\t// Dni_Tutor\r\n\t\t\t$this->Dni_Tutor->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Dni_Tutor->HrefValue = \"\";\r\n\t\t\t$this->Dni_Tutor->TooltipValue = \"\";\r\n\r\n\t\t\t// Apellidos_Nombres\r\n\t\t\t$this->Apellidos_Nombres->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Apellidos_Nombres->HrefValue = \"\";\r\n\t\t\t$this->Apellidos_Nombres->TooltipValue = \"\";\r\n\r\n\t\t\t// Edad\r\n\t\t\t$this->Edad->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Edad->HrefValue = \"\";\r\n\t\t\t$this->Edad->TooltipValue = \"\";\r\n\r\n\t\t\t// Domicilio\r\n\t\t\t$this->Domicilio->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Domicilio->HrefValue = \"\";\r\n\t\t\t$this->Domicilio->TooltipValue = \"\";\r\n\r\n\t\t\t// Tel_Contacto\r\n\t\t\t$this->Tel_Contacto->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Tel_Contacto->HrefValue = \"\";\r\n\t\t\t$this->Tel_Contacto->TooltipValue = \"\";\r\n\r\n\t\t\t// Fecha_Nac\r\n\t\t\t$this->Fecha_Nac->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Fecha_Nac->HrefValue = \"\";\r\n\t\t\t$this->Fecha_Nac->TooltipValue = \"\";\r\n\r\n\t\t\t// Cuil\r\n\t\t\t$this->Cuil->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Cuil->HrefValue = \"\";\r\n\t\t\t$this->Cuil->TooltipValue = \"\";\r\n\r\n\t\t\t// MasHijos\r\n\t\t\t$this->MasHijos->LinkCustomAttributes = \"\";\r\n\t\t\t$this->MasHijos->HrefValue = \"\";\r\n\t\t\t$this->MasHijos->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Estado_Civil\r\n\t\t\t$this->Id_Estado_Civil->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Estado_Civil->HrefValue = \"\";\r\n\t\t\t$this->Id_Estado_Civil->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Sexo\r\n\t\t\t$this->Id_Sexo->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Sexo->HrefValue = \"\";\r\n\t\t\t$this->Id_Sexo->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Relacion\r\n\t\t\t$this->Id_Relacion->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Relacion->HrefValue = \"\";\r\n\t\t\t$this->Id_Relacion->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Ocupacion\r\n\t\t\t$this->Id_Ocupacion->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Ocupacion->HrefValue = \"\";\r\n\t\t\t$this->Id_Ocupacion->TooltipValue = \"\";\r\n\r\n\t\t\t// Lugar_Nacimiento\r\n\t\t\t$this->Lugar_Nacimiento->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Lugar_Nacimiento->HrefValue = \"\";\r\n\t\t\t$this->Lugar_Nacimiento->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Provincia\r\n\t\t\t$this->Id_Provincia->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Provincia->HrefValue = \"\";\r\n\t\t\t$this->Id_Provincia->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Departamento\r\n\t\t\t$this->Id_Departamento->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Departamento->HrefValue = \"\";\r\n\t\t\t$this->Id_Departamento->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Localidad\r\n\t\t\t$this->Id_Localidad->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Localidad->HrefValue = \"\";\r\n\t\t\t$this->Id_Localidad->TooltipValue = \"\";\r\n\r\n\t\t\t// Fecha_Actualizacion\r\n\t\t\t$this->Fecha_Actualizacion->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Fecha_Actualizacion->HrefValue = \"\";\r\n\t\t\t$this->Fecha_Actualizacion->TooltipValue = \"\";\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Usuario->HrefValue = \"\";\r\n\t\t\t$this->Usuario->TooltipValue = \"\";\r\n\t\t}\r\n\r\n\t\t// Call Row Rendered event\r\n\t\tif ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)\r\n\t\t\t$this->Row_Rendered();\r\n\t}",
"function make_table ($rows){\n if (($rows['supply_type'] == 'prepaid' \n && $rows['status'] == 'initiated') ||\n ($rows['supply_type'] == 'postpaid' \n && $rows['status'] == 'supplied')){ // Only display Prepaid supplies that have been initiated and Postpaid supplies that have been delivered\n $pay = '<a href=\"pay.php?supply_id='.$rows['id'].'\" target=\"pay_frame\"> \n <small data-toggle=\"modal\" data-target=\"#payModal\">Pay</small>\n </a>'; // Open the transfer iframe in a Modal window\n } else {\n $pay = '<small class=\"text-danger\">Pay</small>';\n }\n\n\n\n\n $row = '\n <tr>\n <td>'.$rows['supplier_name'].'</td>\n <td>'.$rows['quantity_desc'].' of <strong>'.$rows['item_name'].'</strong></td>\n <td>'.$rows['status'].' ('.$rows['supply_type'].')</td>\n <td>N'.number_format($rows['amount'],2,\".\",\",\").'</td>\n <td>'.$rows['supply_order_date'].'</td>\n <td>'.$pay.'</td>\n </tr>\n ';\n return $row;\n }",
"protected function constructGrid()\n {\n // jquery script for loading first page of grid\n $table = \"\n <script type=\\\"text/javascript\\\">\n // load first page\n WschangeModelPagination(\n '$this->_id',\n '$this->_action',\n '$this->_modelName',\n '$this->noDataText',\n $this->itemsPerPage,\n $this->showEdit,\n '$this->_order',\n '$this->_formId',\n 0,\n '$this->_id'+'_0',\n '$this->_edit_action',\n '$this->_delete_action'\n );\n </script>\n \";\n\n // container for edit dialog\n if ($this->showEdit) {\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'\"></div>';\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'_new\"></div>';\n }\n\n // title\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-1\">';\n $table .= '<h1>'.$this->_model->metaName.'</h1>';\n $table .= '</div>';\n $table .= '</div>';\n\n // add and search controls\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-2\">';\n $table .= '<form class=\"uk-form uk-form-horizontal\">';\n $table .= '<fieldset data-uk-margin>';\n // new item button\n if ($this->showEdit) {\n $table .= '<button class=\"uk-button uk-button-success\"'\n .' data-uk-modal=\"{target:\\'#'.$this->_formId\n .'_new\\', center:true}\"'\n .' id=\"btn_create_'.$this->_id.'\"'\n .' type=\"button\" onclick=\"WseditModelID('\n .'\\''.$this->_formId.'_new\\', '\n .'\\''.$this->_modelName.'\\', '\n .'0, \\''.$this->_edit_action.'\\')\">';\n $table .= '<i class=\"uk-icon-plus\"></i>';\n $table .= '</button>';\n }\n // search control\n $table .= '<input';\n $table .= ' type=\"text\" id=\"search_'.$this->_id.'\"';\n $table .= '/>';\n $table .= '<button class=\"uk-button\"'\n .' id=\"btn_search_'.$this->_id\n .'\" type=\"button\" onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .'0, \\''.$this->_id.'\\'+\\'_0\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\">';\n $table .= '<i class=\"uk-icon-search\"></i>';\n $table .= '</button>';\n\n $table .= '</fieldset>';\n $table .= '</form>';\n $table .= '</div>';\n $table .= '</div>';\n\n // Grid View table\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-1-1\">';\n $table .= '<div class=\"uk-overflow-container\">';\n $table .= '<table class=\"uk-table uk-table-hover uk-table-striped\">';\n $table .= '<thead>';\n $table .= '<tr>';\n foreach ($this->_model->columns as $column) {\n if (!in_array($column, $this->_model->hiddenColumns)) {\n if (isset($this->_model->columnHeaders[$column])) {\n $table .= '<th>'\n .$this->_model->columnHeaders[$column];\n $table .= '</th>';\n } else {\n $table .= '<th>'.$column.'</th>';\n }\n }\n }\n if ($this->showEdit) {\n $table .= '<th></th>';\n }\n $table .= '</tr>';\n $table .= '</thead>';\n\n // container of table data loaded from AJAX request\n $table .= '<tbody id=\"'.$this->_id.'\"></tbody>';\n\n // end of grid table\n $table .= '</table>';\n $table .= '</div>';\n $table .= '</div>';\n $table .= '</div>';\n\n // get number ow rows from query so that we can make pager\n $db = new WsDatabase();\n $countQuery = 'SELECT COUNT(*) AS nrows FROM '.$this->_model->tableName;\n $result = $db->query($countQuery);\n $this->nRows = intval($result[0]['nrows']);\n $db->close();\n\n // number of items in pager\n $nPages = $this->getPagination($this->nRows);\n\n // construct pager\n $table .= '<ul class=\"uk-pagination uk-pagination-left\">';\n // links to pages\n for ($i = 0; $i < $nPages; $i++) {\n $table .= '<li>';\n $table .= '\n <a id=\"'.$this->_id.'_'.$i.'\"\n href=\"javascript:void(0)\"\n onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .$i.',\\''.$this->_id.'_'.$i.'\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\"/>'\n .($i+1).'</a>';\n $table .= '</li>';\n }\n // end of pager\n $table .= '</ul>';\n\n // end of master div element\n $table .= '<br/>';\n\n $table .= '<script type=\"text/javascript\">'\n .'$(\"#search_'.$this->_id.'\").keydown(function(event) {'\n .' if(event.keyCode == 13) {'\n .' event.preventDefault();'\n .' $(\"#btn_search_'.$this->_id.'\").click();'\n .' }'\n .'});'\n .'</script>';\n\n unset($i, $nPages, $db, $result, $countQuery);\n return $table;\n }",
"function _getSiteImportTableHTML($fields, $values = array())\n\t{\n\t\t\n\t\t$headlines = array(\n\t\t\tarray(\n\t\t\t\"dat\" => $GLOBALS[\"l_siteimport\"][\"fieldName\"]\n\t\t), array(\n\t\t\t\"dat\" => $GLOBALS[\"l_siteimport\"][\"startMark\"]\n\t\t), array(\n\t\t\t\"dat\" => $GLOBALS[\"l_siteimport\"][\"endMark\"]\n\t\t)\n\t\t);\n\t\t\n\t\t$content = array();\n\t\tif (count($fields) > 0) {\n\t\t\t$i = 0;\n\t\t\tforeach ($fields as $name => $type) {\n\t\t\t\t$row = array();\n\t\t\t\t$row[0][\"dat\"] = htmlspecialchars($name) . '<input type=\"hidden\" name=\"fields[' . $i . '][name]\" value=\"' . htmlspecialchars(\n\t\t\t\t\t\t$name) . '\">';\n\t\t\t\t$index = $this->_getIndexOfValues($values, $name);\n\t\t\t\tif ($index > -1) {\n\t\t\t\t\t$valpre = $values[$index][\"pre\"];\n\t\t\t\t\t$valpost = $values[$index][\"post\"];\n\t\t\t\t} else {\n\t\t\t\t\t$valpre = \"\";\n\t\t\t\t\t$valpost = \"\";\n\t\t\t\t}\n\t\t\t\t$row[1][\"dat\"] = '<textarea name=\"fields[' . $i . '][pre]\" style=\"width:160px;height:80px\" wrap=\"off\">' . htmlspecialchars(\n\t\t\t\t\t\t$valpre) . '</textarea>';\n\t\t\t\t$row[2][\"dat\"] = '<textarea name=\"fields[' . $i . '][post]\" style=\"width:160px;height:80px\" wrap=\"off\">' . htmlspecialchars(\n\t\t\t\t\t\t$valpost) . '</textarea>';\n\t\t\t\tarray_push($content, $row);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\treturn htmlDialogBorder3(420, 270, $content, $headlines, \"middlefont\", \"\", \"\", \"fields\", \"margin-top:5px;\");\n\t}",
"function RenderRow() {\n\t\tglobal $Security, $Language, $gsLanguage;\n\n\t\t// Initialize URLs\n\t\t$this->ViewUrl = $this->GetViewUrl();\n\t\t$this->EditUrl = $this->GetEditUrl();\n\t\t$this->InlineEditUrl = $this->GetInlineEditUrl();\n\t\t$this->CopyUrl = $this->GetCopyUrl();\n\t\t$this->InlineCopyUrl = $this->GetInlineCopyUrl();\n\t\t$this->DeleteUrl = $this->GetDeleteUrl();\n\n\t\t// Call Row_Rendering event\n\t\t$this->Row_Rendering();\n\n\t\t// Common render codes for all row types\n\t\t// id\n\t\t// fecha_tamizaje\n\t\t// id_centro\n\t\t// apellidopaterno\n\t\t// apellidomaterno\n\t\t// nombre\n\t\t// ci\n\t\t// fecha_nacimiento\n\t\t// dias\n\t\t// semanas\n\t\t// meses\n\t\t// sexo\n\t\t// discapacidad\n\t\t// id_tipodiscapacidad\n\t\t// resultado\n\t\t// resultadotamizaje\n\t\t// tapon\n\t\t// tipo\n\t\t// repetirprueba\n\t\t// observaciones\n\t\t// id_apoderado\n\t\t// id_referencia\n\n\t\tif ($this->RowType == EW_ROWTYPE_VIEW) { // View row\n\n\t\t// id\n\t\t$this->id->ViewValue = $this->id->CurrentValue;\n\t\t$this->id->ViewCustomAttributes = \"\";\n\n\t\t// fecha_tamizaje\n\t\t$this->fecha_tamizaje->ViewValue = $this->fecha_tamizaje->CurrentValue;\n\t\t$this->fecha_tamizaje->ViewValue = ew_FormatDateTime($this->fecha_tamizaje->ViewValue, 0);\n\t\t$this->fecha_tamizaje->ViewCustomAttributes = \"\";\n\n\t\t// id_centro\n\t\tif (strval($this->id_centro->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_centro->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `institucionesdesalud`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_centro->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_centro, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_centro->ViewValue = $this->id_centro->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_centro->ViewValue = $this->id_centro->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_centro->ViewValue = NULL;\n\t\t}\n\t\t$this->id_centro->ViewCustomAttributes = \"\";\n\n\t\t// apellidopaterno\n\t\t$this->apellidopaterno->ViewValue = $this->apellidopaterno->CurrentValue;\n\t\t$this->apellidopaterno->ViewCustomAttributes = \"\";\n\n\t\t// apellidomaterno\n\t\t$this->apellidomaterno->ViewValue = $this->apellidomaterno->CurrentValue;\n\t\t$this->apellidomaterno->ViewCustomAttributes = \"\";\n\n\t\t// nombre\n\t\t$this->nombre->ViewValue = $this->nombre->CurrentValue;\n\t\t$this->nombre->ViewCustomAttributes = \"\";\n\n\t\t// ci\n\t\t$this->ci->ViewValue = $this->ci->CurrentValue;\n\t\t$this->ci->ViewCustomAttributes = \"\";\n\n\t\t// fecha_nacimiento\n\t\t$this->fecha_nacimiento->ViewValue = $this->fecha_nacimiento->CurrentValue;\n\t\t$this->fecha_nacimiento->ViewValue = ew_FormatDateTime($this->fecha_nacimiento->ViewValue, 0);\n\t\t$this->fecha_nacimiento->ViewCustomAttributes = \"\";\n\n\t\t// dias\n\t\t$this->dias->ViewValue = $this->dias->CurrentValue;\n\t\t$this->dias->ViewCustomAttributes = \"\";\n\n\t\t// semanas\n\t\t$this->semanas->ViewValue = $this->semanas->CurrentValue;\n\t\t$this->semanas->ViewCustomAttributes = \"\";\n\n\t\t// meses\n\t\t$this->meses->ViewValue = $this->meses->CurrentValue;\n\t\t$this->meses->ViewCustomAttributes = \"\";\n\n\t\t// sexo\n\t\tif (strval($this->sexo->CurrentValue) <> \"\") {\n\t\t\t$this->sexo->ViewValue = $this->sexo->OptionCaption($this->sexo->CurrentValue);\n\t\t} else {\n\t\t\t$this->sexo->ViewValue = NULL;\n\t\t}\n\t\t$this->sexo->ViewCustomAttributes = \"\";\n\n\t\t// discapacidad\n\t\t$this->discapacidad->ViewValue = $this->discapacidad->CurrentValue;\n\t\tif (strval($this->discapacidad->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->discapacidad->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `discapacidad`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->discapacidad->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->discapacidad, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->discapacidad->ViewValue = $this->discapacidad->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->discapacidad->ViewValue = $this->discapacidad->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->discapacidad->ViewValue = NULL;\n\t\t}\n\t\t$this->discapacidad->ViewCustomAttributes = \"\";\n\n\t\t// id_tipodiscapacidad\n\t\t$this->id_tipodiscapacidad->ViewValue = $this->id_tipodiscapacidad->CurrentValue;\n\t\t$this->id_tipodiscapacidad->ViewCustomAttributes = \"\";\n\n\t\t// resultado\n\t\t$this->resultado->ViewValue = $this->resultado->CurrentValue;\n\t\t$this->resultado->ViewCustomAttributes = \"\";\n\n\t\t// resultadotamizaje\n\t\t$this->resultadotamizaje->ViewValue = $this->resultadotamizaje->CurrentValue;\n\t\t$this->resultadotamizaje->ViewCustomAttributes = \"\";\n\n\t\t// tapon\n\t\tif (strval($this->tapon->CurrentValue) <> \"\") {\n\t\t\t$this->tapon->ViewValue = $this->tapon->OptionCaption($this->tapon->CurrentValue);\n\t\t} else {\n\t\t\t$this->tapon->ViewValue = NULL;\n\t\t}\n\t\t$this->tapon->ViewCustomAttributes = \"\";\n\n\t\t// tipo\n\t\tif (strval($this->tipo->CurrentValue) <> \"\") {\n\t\t\t$this->tipo->ViewValue = $this->tipo->OptionCaption($this->tipo->CurrentValue);\n\t\t} else {\n\t\t\t$this->tipo->ViewValue = NULL;\n\t\t}\n\t\t$this->tipo->ViewCustomAttributes = \"\";\n\n\t\t// repetirprueba\n\t\tif (strval($this->repetirprueba->CurrentValue) <> \"\") {\n\t\t\t$this->repetirprueba->ViewValue = $this->repetirprueba->OptionCaption($this->repetirprueba->CurrentValue);\n\t\t} else {\n\t\t\t$this->repetirprueba->ViewValue = NULL;\n\t\t}\n\t\t$this->repetirprueba->ViewCustomAttributes = \"\";\n\n\t\t// observaciones\n\t\t$this->observaciones->ViewValue = $this->observaciones->CurrentValue;\n\t\t$this->observaciones->ViewCustomAttributes = \"\";\n\n\t\t// id_apoderado\n\t\tif ($this->id_apoderado->VirtualValue <> \"\") {\n\t\t\t$this->id_apoderado->ViewValue = $this->id_apoderado->VirtualValue;\n\t\t} else {\n\t\tif (strval($this->id_apoderado->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_apoderado->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombres` AS `DispFld`, `apellidopaterno` AS `Disp2Fld`, `apellidopaterno` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `apoderado`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_apoderado->LookupFilters = array(\"dx1\" => '`nombres`', \"dx2\" => '`apellidopaterno`', \"dx3\" => '`apellidopaterno`');\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_apoderado, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$arwrk[2] = $rswrk->fields('Disp2Fld');\n\t\t\t\t$arwrk[3] = $rswrk->fields('Disp3Fld');\n\t\t\t\t$this->id_apoderado->ViewValue = $this->id_apoderado->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_apoderado->ViewValue = $this->id_apoderado->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_apoderado->ViewValue = NULL;\n\t\t}\n\t\t}\n\t\t$this->id_apoderado->ViewCustomAttributes = \"\";\n\n\t\t// id_referencia\n\t\tif ($this->id_referencia->VirtualValue <> \"\") {\n\t\t\t$this->id_referencia->ViewValue = $this->id_referencia->VirtualValue;\n\t\t} else {\n\t\tif (strval($this->id_referencia->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_referencia->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombrescentromedico` AS `DispFld`, `nombrescompleto` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `referencia`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_referencia->LookupFilters = array(\"dx1\" => '`nombrescentromedico`', \"dx2\" => '`nombrescompleto`');\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_referencia, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$arwrk[2] = $rswrk->fields('Disp2Fld');\n\t\t\t\t$this->id_referencia->ViewValue = $this->id_referencia->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_referencia->ViewValue = $this->id_referencia->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_referencia->ViewValue = NULL;\n\t\t}\n\t\t}\n\t\t$this->id_referencia->ViewCustomAttributes = \"\";\n\n\t\t\t// fecha_tamizaje\n\t\t\t$this->fecha_tamizaje->LinkCustomAttributes = \"\";\n\t\t\t$this->fecha_tamizaje->HrefValue = \"\";\n\t\t\t$this->fecha_tamizaje->TooltipValue = \"\";\n\n\t\t\t// id_centro\n\t\t\t$this->id_centro->LinkCustomAttributes = \"\";\n\t\t\t$this->id_centro->HrefValue = \"\";\n\t\t\t$this->id_centro->TooltipValue = \"\";\n\n\t\t\t// apellidopaterno\n\t\t\t$this->apellidopaterno->LinkCustomAttributes = \"\";\n\t\t\t$this->apellidopaterno->HrefValue = \"\";\n\t\t\t$this->apellidopaterno->TooltipValue = \"\";\n\n\t\t\t// apellidomaterno\n\t\t\t$this->apellidomaterno->LinkCustomAttributes = \"\";\n\t\t\t$this->apellidomaterno->HrefValue = \"\";\n\t\t\t$this->apellidomaterno->TooltipValue = \"\";\n\n\t\t\t// nombre\n\t\t\t$this->nombre->LinkCustomAttributes = \"\";\n\t\t\t$this->nombre->HrefValue = \"\";\n\t\t\t$this->nombre->TooltipValue = \"\";\n\n\t\t\t// ci\n\t\t\t$this->ci->LinkCustomAttributes = \"\";\n\t\t\t$this->ci->HrefValue = \"\";\n\t\t\t$this->ci->TooltipValue = \"\";\n\n\t\t\t// fecha_nacimiento\n\t\t\t$this->fecha_nacimiento->LinkCustomAttributes = \"\";\n\t\t\t$this->fecha_nacimiento->HrefValue = \"\";\n\t\t\t$this->fecha_nacimiento->TooltipValue = \"\";\n\n\t\t\t// dias\n\t\t\t$this->dias->LinkCustomAttributes = \"\";\n\t\t\t$this->dias->HrefValue = \"\";\n\t\t\t$this->dias->TooltipValue = \"\";\n\n\t\t\t// semanas\n\t\t\t$this->semanas->LinkCustomAttributes = \"\";\n\t\t\t$this->semanas->HrefValue = \"\";\n\t\t\t$this->semanas->TooltipValue = \"\";\n\n\t\t\t// meses\n\t\t\t$this->meses->LinkCustomAttributes = \"\";\n\t\t\t$this->meses->HrefValue = \"\";\n\t\t\t$this->meses->TooltipValue = \"\";\n\n\t\t\t// sexo\n\t\t\t$this->sexo->LinkCustomAttributes = \"\";\n\t\t\t$this->sexo->HrefValue = \"\";\n\t\t\t$this->sexo->TooltipValue = \"\";\n\n\t\t\t// discapacidad\n\t\t\t$this->discapacidad->LinkCustomAttributes = \"\";\n\t\t\t$this->discapacidad->HrefValue = \"\";\n\t\t\t$this->discapacidad->TooltipValue = \"\";\n\n\t\t\t// id_tipodiscapacidad\n\t\t\t$this->id_tipodiscapacidad->LinkCustomAttributes = \"\";\n\t\t\t$this->id_tipodiscapacidad->HrefValue = \"\";\n\t\t\t$this->id_tipodiscapacidad->TooltipValue = \"\";\n\n\t\t\t// resultado\n\t\t\t$this->resultado->LinkCustomAttributes = \"\";\n\t\t\t$this->resultado->HrefValue = \"\";\n\t\t\t$this->resultado->TooltipValue = \"\";\n\n\t\t\t// resultadotamizaje\n\t\t\t$this->resultadotamizaje->LinkCustomAttributes = \"\";\n\t\t\t$this->resultadotamizaje->HrefValue = \"\";\n\t\t\t$this->resultadotamizaje->TooltipValue = \"\";\n\n\t\t\t// tapon\n\t\t\t$this->tapon->LinkCustomAttributes = \"\";\n\t\t\t$this->tapon->HrefValue = \"\";\n\t\t\t$this->tapon->TooltipValue = \"\";\n\n\t\t\t// tipo\n\t\t\t$this->tipo->LinkCustomAttributes = \"\";\n\t\t\t$this->tipo->HrefValue = \"\";\n\t\t\t$this->tipo->TooltipValue = \"\";\n\n\t\t\t// repetirprueba\n\t\t\t$this->repetirprueba->LinkCustomAttributes = \"\";\n\t\t\t$this->repetirprueba->HrefValue = \"\";\n\t\t\t$this->repetirprueba->TooltipValue = \"\";\n\n\t\t\t// observaciones\n\t\t\t$this->observaciones->LinkCustomAttributes = \"\";\n\t\t\t$this->observaciones->HrefValue = \"\";\n\t\t\t$this->observaciones->TooltipValue = \"\";\n\n\t\t\t// id_apoderado\n\t\t\t$this->id_apoderado->LinkCustomAttributes = \"\";\n\t\t\t$this->id_apoderado->HrefValue = \"\";\n\t\t\t$this->id_apoderado->TooltipValue = \"\";\n\n\t\t\t// id_referencia\n\t\t\t$this->id_referencia->LinkCustomAttributes = \"\";\n\t\t\t$this->id_referencia->HrefValue = \"\";\n\t\t\t$this->id_referencia->TooltipValue = \"\";\n\t\t} elseif ($this->RowType == EW_ROWTYPE_SEARCH) { // Search row\n\n\t\t\t// fecha_tamizaje\n\t\t\t$this->fecha_tamizaje->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->fecha_tamizaje->EditCustomAttributes = \"\";\n\t\t\t$this->fecha_tamizaje->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($this->fecha_tamizaje->AdvancedSearch->SearchValue, 0), 8));\n\t\t\t$this->fecha_tamizaje->PlaceHolder = ew_RemoveHtml($this->fecha_tamizaje->FldCaption());\n\n\t\t\t// id_centro\n\t\t\t$this->id_centro->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->id_centro->EditCustomAttributes = \"\";\n\n\t\t\t// apellidopaterno\n\t\t\t$this->apellidopaterno->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->apellidopaterno->EditCustomAttributes = \"\";\n\t\t\t$this->apellidopaterno->EditValue = ew_HtmlEncode($this->apellidopaterno->AdvancedSearch->SearchValue);\n\t\t\t$this->apellidopaterno->PlaceHolder = ew_RemoveHtml($this->apellidopaterno->FldCaption());\n\n\t\t\t// apellidomaterno\n\t\t\t$this->apellidomaterno->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->apellidomaterno->EditCustomAttributes = \"\";\n\t\t\t$this->apellidomaterno->EditValue = ew_HtmlEncode($this->apellidomaterno->AdvancedSearch->SearchValue);\n\t\t\t$this->apellidomaterno->PlaceHolder = ew_RemoveHtml($this->apellidomaterno->FldCaption());\n\n\t\t\t// nombre\n\t\t\t$this->nombre->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->nombre->EditCustomAttributes = \"\";\n\t\t\t$this->nombre->EditValue = ew_HtmlEncode($this->nombre->AdvancedSearch->SearchValue);\n\t\t\t$this->nombre->PlaceHolder = ew_RemoveHtml($this->nombre->FldCaption());\n\n\t\t\t// ci\n\t\t\t$this->ci->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->ci->EditCustomAttributes = \"\";\n\t\t\t$this->ci->EditValue = ew_HtmlEncode($this->ci->AdvancedSearch->SearchValue);\n\t\t\t$this->ci->PlaceHolder = ew_RemoveHtml($this->ci->FldCaption());\n\n\t\t\t// fecha_nacimiento\n\t\t\t$this->fecha_nacimiento->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->fecha_nacimiento->EditCustomAttributes = \"\";\n\t\t\t$this->fecha_nacimiento->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($this->fecha_nacimiento->AdvancedSearch->SearchValue, 0), 8));\n\t\t\t$this->fecha_nacimiento->PlaceHolder = ew_RemoveHtml($this->fecha_nacimiento->FldCaption());\n\n\t\t\t// dias\n\t\t\t$this->dias->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->dias->EditCustomAttributes = \"\";\n\t\t\t$this->dias->EditValue = ew_HtmlEncode($this->dias->AdvancedSearch->SearchValue);\n\t\t\t$this->dias->PlaceHolder = ew_RemoveHtml($this->dias->FldCaption());\n\n\t\t\t// semanas\n\t\t\t$this->semanas->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->semanas->EditCustomAttributes = \"\";\n\t\t\t$this->semanas->EditValue = ew_HtmlEncode($this->semanas->AdvancedSearch->SearchValue);\n\t\t\t$this->semanas->PlaceHolder = ew_RemoveHtml($this->semanas->FldCaption());\n\n\t\t\t// meses\n\t\t\t$this->meses->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->meses->EditCustomAttributes = \"\";\n\t\t\t$this->meses->EditValue = ew_HtmlEncode($this->meses->AdvancedSearch->SearchValue);\n\t\t\t$this->meses->PlaceHolder = ew_RemoveHtml($this->meses->FldCaption());\n\n\t\t\t// sexo\n\t\t\t$this->sexo->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->sexo->EditCustomAttributes = \"\";\n\t\t\t$this->sexo->EditValue = $this->sexo->Options(TRUE);\n\n\t\t\t// discapacidad\n\t\t\t$this->discapacidad->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->discapacidad->EditCustomAttributes = \"\";\n\t\t\t$this->discapacidad->EditValue = ew_HtmlEncode($this->discapacidad->AdvancedSearch->SearchValue);\n\t\t\tif (strval($this->discapacidad->AdvancedSearch->SearchValue) <> \"\") {\n\t\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->discapacidad->AdvancedSearch->SearchValue, EW_DATATYPE_NUMBER, \"\");\n\t\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `discapacidad`\";\n\t\t\t$sWhereWrk = \"\";\n\t\t\t$this->discapacidad->LookupFilters = array();\n\t\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t\t$this->Lookup_Selecting($this->discapacidad, $sWhereWrk); // Call Lookup Selecting\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t\t$arwrk = array();\n\t\t\t\t\t$arwrk[1] = ew_HtmlEncode($rswrk->fields('DispFld'));\n\t\t\t\t\t$this->discapacidad->EditValue = $this->discapacidad->DisplayValue($arwrk);\n\t\t\t\t\t$rswrk->Close();\n\t\t\t\t} else {\n\t\t\t\t\t$this->discapacidad->EditValue = ew_HtmlEncode($this->discapacidad->AdvancedSearch->SearchValue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->discapacidad->EditValue = NULL;\n\t\t\t}\n\t\t\t$this->discapacidad->PlaceHolder = ew_RemoveHtml($this->discapacidad->FldCaption());\n\n\t\t\t// id_tipodiscapacidad\n\t\t\t$this->id_tipodiscapacidad->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->id_tipodiscapacidad->EditCustomAttributes = \"\";\n\t\t\t$this->id_tipodiscapacidad->EditValue = ew_HtmlEncode($this->id_tipodiscapacidad->AdvancedSearch->SearchValue);\n\t\t\t$this->id_tipodiscapacidad->PlaceHolder = ew_RemoveHtml($this->id_tipodiscapacidad->FldCaption());\n\n\t\t\t// resultado\n\t\t\t$this->resultado->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->resultado->EditCustomAttributes = \"\";\n\t\t\t$this->resultado->EditValue = ew_HtmlEncode($this->resultado->AdvancedSearch->SearchValue);\n\t\t\t$this->resultado->PlaceHolder = ew_RemoveHtml($this->resultado->FldCaption());\n\n\t\t\t// resultadotamizaje\n\t\t\t$this->resultadotamizaje->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->resultadotamizaje->EditCustomAttributes = \"\";\n\t\t\t$this->resultadotamizaje->EditValue = ew_HtmlEncode($this->resultadotamizaje->AdvancedSearch->SearchValue);\n\t\t\t$this->resultadotamizaje->PlaceHolder = ew_RemoveHtml($this->resultadotamizaje->FldCaption());\n\n\t\t\t// tapon\n\t\t\t$this->tapon->EditCustomAttributes = \"\";\n\t\t\t$this->tapon->EditValue = $this->tapon->Options(FALSE);\n\n\t\t\t// tipo\n\t\t\t$this->tipo->EditCustomAttributes = \"\";\n\t\t\t$this->tipo->EditValue = $this->tipo->Options(FALSE);\n\n\t\t\t// repetirprueba\n\t\t\t$this->repetirprueba->EditCustomAttributes = \"\";\n\t\t\t$this->repetirprueba->EditValue = $this->repetirprueba->Options(FALSE);\n\n\t\t\t// observaciones\n\t\t\t$this->observaciones->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->observaciones->EditCustomAttributes = \"\";\n\t\t\t$this->observaciones->EditValue = ew_HtmlEncode($this->observaciones->AdvancedSearch->SearchValue);\n\t\t\t$this->observaciones->PlaceHolder = ew_RemoveHtml($this->observaciones->FldCaption());\n\n\t\t\t// id_apoderado\n\t\t\t$this->id_apoderado->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->id_apoderado->EditCustomAttributes = \"\";\n\t\t\t$this->id_apoderado->EditValue = ew_HtmlEncode($this->id_apoderado->AdvancedSearch->SearchValue);\n\t\t\t$this->id_apoderado->PlaceHolder = ew_RemoveHtml($this->id_apoderado->FldCaption());\n\n\t\t\t// id_referencia\n\t\t\t$this->id_referencia->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->id_referencia->EditCustomAttributes = \"\";\n\t\t\t$this->id_referencia->EditValue = ew_HtmlEncode($this->id_referencia->AdvancedSearch->SearchValue);\n\t\t\t$this->id_referencia->PlaceHolder = ew_RemoveHtml($this->id_referencia->FldCaption());\n\t\t}\n\t\tif ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) // Add/Edit/Search row\n\t\t\t$this->SetupFieldTitles();\n\n\t\t// Call Row Rendered event\n\t\tif ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)\n\t\t\t$this->Row_Rendered();\n\t}",
"function buildWidgets(&$table,$row) {\n //print_r($this);\n $this->table = &$table;\n $widgets = array(\n // format:\n //name display, width, pos , span , \n 'name' => array(null, 1 , 1),\n 'type' => array(null, 2 , 1),\n 'length' => array(null, 3 , 1),\n 'notnull' => array('n', 4 , 1),\n 'isIndex' => array('I', 5 , 1),\n 'sequence' => array('+', 6 , 1),\n 'unique' => array('u', 7 , 1),\n 'default' => array(null, 8 , 2)\n \n );\n \n foreach ($widgets as $string=>$config) {\n \n switch($string) {\n \n case 'name':\n case 'length':\n case 'default':\n $this->widgets[$string] = &new GtkEntry;\n $this->widgets[$string]->set_text((string) $this->$string);\n $this->widgets[$string]->connect('changed',array(&$this,'callbackSetValue'),$string);\n $this->widgets[$string]->connect('leave-notify-event', array(&$this->table->database,'save'));\n if ($string == 'name') {\n $this->widgets[$string]->connect_after('drag_begin',array(&$this,'callbackNamePressed'));\n $this->widgets[$string]->connect_after('drag-end',array(&$this,'callbackNameReleased'));\n $this->widgets[$string]->show();\n //$this->widgets[$string]->show();\n // $this->widgets[$string]->realize();\n $this->widgets[$string]->connect('drag_data_get', array(&$this,'callbackDropAsk'));\n $this->widgets[$string]->drag_source_set(\n GDK_BUTTON1_MASK|GDK_BUTTON3_MASK, \n array(array('text/plain', 0, -1)),\n GDK_ACTION_COPY\n );\n $this->widgets[$string]->connect('drag_data_received', array(&$this,'callbackDropReceived'));\n $this->widgets[$string]->drag_dest_set(\n GTK_DEST_DEFAULT_ALL, \n array(array('text/plain', 0, -1)) ,\n GDK_ACTION_COPY);\n\n }\n break;\n \n case 'type':\n $this->widgets[$string] = &new GtkEntry;\n $this->widgets[$string]->set_text((string) $this->$string);\n $this->widgets[$string]->connect('button-press-event',array(&$this,'callbackTypePressed'),$string);\n $this->widgets[$string]->set_editable(false); \n break;\n case 'notnull':\n case 'isIndex':\n case 'sequence':\n case 'unique':\n $this->widgets[$string] = &new GtkToggleButton($config[0]);\n $this->widgets[$string]->set_active((int) $this->$string);\n $this->widgets[$string]->connect('toggled',array(&$this,'callbackSetValue'),$string);\n \n break;\n case 'delete':\n $this->widgets[$string] = &new GtkButton('X');\n $this->widgets[$string]->connect('pressed',array(&$this,'callbackRowDelete'));\n break;\n \n } \n \n \n $this->table->addCell($this->widgets[$string],$config[1],$row, $config[2], GTK_EXPAND|GTK_FILL);\n $this->widgets[$string]->show();\n }\n $this->setSizes();\n \n $this->deleteMenuItem = &new GtkMenuItem($this->name);\n $this->deleteMenuItem->show();\n $this->deleteMenuItem->connect('activate',array(&$this,'callbackRowDelete'));\n $this->table->deleteMenu->add( $this->deleteMenuItem);\n $this->setVisable();\n \n \n \n }",
"private function _make_item_row($data) {\n $item = \"<b>$data->title</b>\";\n if ($data->description) {\n $item.=\"<br /><span>\" . nl2br($data->description) . \"</span><br><span style='float:right;'>\".$data->category.\"<span>\";\n }\n $type = $data->unit_type ? $data->unit_type : \"\";\n\n $val = $this->Sales_Invoices_model->get_details(array(\"id\" => $data->fid_invoices))->row();\n\n if($val->status != \"posting\"){\n return array(\n modal_anchor(get_uri(\"sales/s_invoices/item_modal_form\"), \"<i class='fa fa-pencil'></i>\", array(\"class\" => \"edit\", \"title\" => lang('edit_invoice'), \"data-post-id\" => $data->id)).js_anchor(\"<i class='fa fa-times fa-fw'></i>\", array('title' => lang('delete'), \"class\" => \"delete\", \"data-id\" => $data->id, \"data-action-url\" => get_uri(\"sales/s_invoices/delete_item\"), \"data-action\" => \"delete\")),\n $item,\n to_decimal_format($data->quantity) . \" \" . $type,\n to_currency($data->rate),\n to_currency($data->total),\n\n\n );\n\n }else{\n return array(\n \" \",\n $item,\n to_decimal_format($data->quantity) . \" \" . $type,\n to_currency($data->rate),\n to_currency($data->total)\n\n \n\n );\n\n }\n }",
"public function manageAddRow(array &$vars) \n {\n $view = $this->getView('add_row');\n Loader::loadHelpers($view, array('Form', 'Html', 'Widget'));\n\n $view->set('vars', (object) $vars);\n return $view->fetch();\n }",
"public function renderCreateModalHTML()\n {\n $input_form = \"<div class=\\\"form-group\\\">\n <label for=\\\"{{label}}\\\">{{label}}</label>\n <input type=\\\"{{type}}\\\" class=\\\"form-control\\\" id=\\\"create_input_{{label}}\\\">\n </div>\";\n $break_line = \"\\n\";\n\n $form_result = \"\";\n $columns = $this->getShowColumnCreateModal();\n foreach ($columns as $name => $type) {\n $input_type = 'text';\n\n if ($type == \"bigint\" OR $type == \"integer\"){\n $input_type = 'number';\n }elseif ($type == \"string\"){\n $input_type = 'text';\n }elseif ($type == \"datetime\"){\n $input_type = 'datetime-local';\n }\n\n $one_form = str_replace(\n [\n '{{label}}','{{type}}'\n ],\n [\n $name, $input_type\n ],\n $input_form\n );\n $form_result = $form_result.$one_form.$break_line;\n }\n\n return $form_result;\n }",
"function create_row($name, $type, $description, $pattern) {\n $id = strtolower(preg_replace('/[^\\w\\-\\.]+/', '', str_replace(' ', '-', $name)));\n $id = str_replace('.', '-', $id); // periods break the js code, because they are not valid in selector ids\n\n $row = '<div class=\"row border-bottom align-items-center\">';\n $row .= '<div class=\"col-12 col-md-3 small-h\">';\n $row .= '<h4 id=\"' . $id . '\" class=\"module-row-name-id\">';\n $row .= '<code>' . $name . '</code>';\n $row .= '<span class=\"text-muted\"> (' . $type . ')</span>';\n $row .=\n '<a href=#' .\n $id .\n ' class=\"header-link scroll_to_link me-2\"><span class=\"fas fa-link\" aria-hidden=\"true\"></span></a>';\n $row .= '</h4>';\n $row .= '</div>';\n $row .= '<div class=\" col-12 col-md' . ($pattern != '' ? '-5' : '-7') . '\">';\n $row .= '<span class=\"small\">' . parse_md($description)['content'] . '</span>';\n $row .= '</div>';\n $row .= '<div class=\"col-12 col-md' . ($pattern != '' ? '-4' : '-1') . ' ms-auto\">';\n if ($pattern != '') {\n $row .= '<code class=\"float-end\">' . $pattern . '</code>';\n }\n $row .= '</div>';\n\n $row .= '</div>';\n return $row;\n}",
"function RenderRow() {\n\t\tglobal $Security, $Language, $gsLanguage;\n\n\t\t// Initialize URLs\n\t\t$this->ViewUrl = $this->GetViewUrl();\n\t\t$this->EditUrl = $this->GetEditUrl();\n\t\t$this->InlineEditUrl = $this->GetInlineEditUrl();\n\t\t$this->CopyUrl = $this->GetCopyUrl();\n\t\t$this->InlineCopyUrl = $this->GetInlineCopyUrl();\n\t\t$this->DeleteUrl = $this->GetDeleteUrl();\n\n\t\t// Call Row_Rendering event\n\t\t$this->Row_Rendering();\n\n\t\t// Common render codes for all row types\n\t\t// id\n\n\t\t$this->id->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// nombre_contacto\n\t\t// name\n\t\t// lastname\n\t\t// email\n\t\t// address\n\t\t// phone\n\t\t// cell\n\t\t// is_active\n\n\t\t$this->is_active->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// created_at\n\t\t// id_sucursal\n\t\t// documentos\n\n\t\t$this->documentos->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// DateModified\n\t\t$this->DateModified->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// DateDeleted\n\t\t$this->DateDeleted->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// CreatedBy\n\t\t$this->CreatedBy->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// ModifiedBy\n\t\t$this->ModifiedBy->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// DeletedBy\n\t\t$this->DeletedBy->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// latitud\n\t\t$this->latitud->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// longitud\n\t\t$this->longitud->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// tipoinmueble\n\t\t// id_ciudad_inmueble\n\t\t// id_provincia_inmueble\n\t\t// imagen_inmueble01\n\n\t\t$this->imagen_inmueble01->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_inmueble02\n\t\t// imagen_inmueble03\n\t\t// imagen_inmueble04\n\t\t// imagen_inmueble05\n\t\t// imagen_inmueble06\n\n\t\t$this->imagen_inmueble06->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_inmueble07\n\t\t$this->imagen_inmueble07->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_inmueble08\n\t\t$this->imagen_inmueble08->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// tipovehiculo\n\t\t// id_ciudad_vehiculo\n\t\t// id_provincia_vehiculo\n\t\t// imagen_vehiculo01\n\n\t\t$this->imagen_vehiculo01->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_vehiculo02\n\t\t// imagen_vehiculo03\n\n\t\t$this->imagen_vehiculo03->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_vehiculo04\n\t\t$this->imagen_vehiculo04->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_vehiculo05\n\t\t// imagen_vehiculo06\n\t\t// imagen_vehiculo07\n\t\t// imagen_vehiculo08\n\n\t\t$this->imagen_vehiculo08->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// tipomaquinaria\n\t\t// id_ciudad_maquinaria\n\t\t// id_provincia_maquinaria\n\t\t// imagen_maquinaria01\n\n\t\t$this->imagen_maquinaria01->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_maquinaria02\n\t\t// imagen_maquinaria03\n\t\t// imagen_maquinaria04\n\n\t\t$this->imagen_maquinaria04->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// imagen_maquinaria05\n\t\t// imagen_maquinaria06\n\t\t// imagen_maquinaria07\n\t\t// imagen_maquinaria08\n\n\t\t$this->imagen_maquinaria08->CellCssStyle = \"white-space: nowrap;\";\n\n\t\t// tipomercaderia\n\t\t// imagen_mercaderia01\n\t\t// documento_mercaderia\n\t\t// tipoespecial\n\t\t// imagen_tipoespecial01\n\t\t// email_contacto\n\n\t\tif ($this->RowType == EW_ROWTYPE_VIEW) { // View row\n\n\t\t// nombre_contacto\n\t\t$this->nombre_contacto->ViewValue = $this->nombre_contacto->CurrentValue;\n\t\t$this->nombre_contacto->ViewCustomAttributes = \"\";\n\n\t\t// name\n\t\t$this->name->ViewValue = $this->name->CurrentValue;\n\t\t$this->name->ViewCustomAttributes = \"\";\n\n\t\t// lastname\n\t\t$this->lastname->ViewValue = $this->lastname->CurrentValue;\n\t\t$this->lastname->ViewCustomAttributes = \"\";\n\n\t\t// email\n\t\t$this->_email->ViewValue = $this->_email->CurrentValue;\n\t\t$this->_email->ViewCustomAttributes = \"\";\n\n\t\t// address\n\t\t$this->address->ViewValue = $this->address->CurrentValue;\n\t\t$this->address->ViewCustomAttributes = \"\";\n\n\t\t// phone\n\t\t$this->phone->ViewValue = $this->phone->CurrentValue;\n\t\t$this->phone->ViewCustomAttributes = \"\";\n\n\t\t// cell\n\t\t$this->cell->ViewValue = $this->cell->CurrentValue;\n\t\t$this->cell->ViewCustomAttributes = \"\";\n\n\t\t// created_at\n\t\t$this->created_at->ViewValue = $this->created_at->CurrentValue;\n\t\t$this->created_at->ViewValue = ew_FormatDateTime($this->created_at->ViewValue, 17);\n\t\t$this->created_at->ViewCustomAttributes = \"\";\n\n\t\t// id_sucursal\n\t\tif (strval($this->id_sucursal->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_sucursal->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `sucursal`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_sucursal->LookupFilters = array(\"dx1\" => '`nombre`');\n\t\t$lookuptblfilter = \"`id`='\".$_SESSION[\"sucursal\"].\"'\";\n\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_sucursal, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_sucursal->ViewValue = $this->id_sucursal->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_sucursal->ViewValue = $this->id_sucursal->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_sucursal->ViewValue = NULL;\n\t\t}\n\t\t$this->id_sucursal->ViewCustomAttributes = \"\";\n\n\t\t// tipoinmueble\n\t\tif (strval($this->tipoinmueble->CurrentValue) <> \"\") {\n\t\t\t$arwrk = explode(\",\", $this->tipoinmueble->CurrentValue);\n\t\t\t$sFilterWrk = \"\";\n\t\t\tforeach ($arwrk as $wrk) {\n\t\t\t\tif ($sFilterWrk <> \"\") $sFilterWrk .= \" OR \";\n\t\t\t\t$sFilterWrk .= \"`nombre`\" . ew_SearchString(\"=\", trim($wrk), EW_DATATYPE_STRING, \"\");\n\t\t\t}\n\t\t$sSqlWrk = \"SELECT `nombre`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipoinmueble`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->tipoinmueble->LookupFilters = array(\"dx1\" => '`nombre`');\n\t\t$lookuptblfilter = \"`tipo`='INMUEBLE'\";\n\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->tipoinmueble, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$this->tipoinmueble->ViewValue = \"\";\n\t\t\t\t$ari = 0;\n\t\t\t\twhile (!$rswrk->EOF) {\n\t\t\t\t\t$arwrk = array();\n\t\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t\t$this->tipoinmueble->ViewValue .= $this->tipoinmueble->DisplayValue($arwrk);\n\t\t\t\t\t$rswrk->MoveNext();\n\t\t\t\t\tif (!$rswrk->EOF) $this->tipoinmueble->ViewValue .= ew_ViewOptionSeparator($ari); // Separate Options\n\t\t\t\t\t$ari++;\n\t\t\t\t}\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->tipoinmueble->ViewValue = $this->tipoinmueble->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->tipoinmueble->ViewValue = NULL;\n\t\t}\n\t\t$this->tipoinmueble->ViewCustomAttributes = \"\";\n\n\t\t// id_ciudad_inmueble\n\t\tif (strval($this->id_ciudad_inmueble->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_ciudad_inmueble->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `departamento`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_ciudad_inmueble->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_ciudad_inmueble, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_ciudad_inmueble->ViewValue = $this->id_ciudad_inmueble->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_ciudad_inmueble->ViewValue = $this->id_ciudad_inmueble->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_ciudad_inmueble->ViewValue = NULL;\n\t\t}\n\t\t$this->id_ciudad_inmueble->ViewCustomAttributes = \"\";\n\n\t\t// id_provincia_inmueble\n\t\tif (strval($this->id_provincia_inmueble->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_provincia_inmueble->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `provincia`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_provincia_inmueble->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_provincia_inmueble, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_provincia_inmueble->ViewValue = $this->id_provincia_inmueble->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_provincia_inmueble->ViewValue = $this->id_provincia_inmueble->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_provincia_inmueble->ViewValue = NULL;\n\t\t}\n\t\t$this->id_provincia_inmueble->ViewCustomAttributes = \"\";\n\n\t\t// tipovehiculo\n\t\tif (strval($this->tipovehiculo->CurrentValue) <> \"\") {\n\t\t\t$arwrk = explode(\",\", $this->tipovehiculo->CurrentValue);\n\t\t\t$sFilterWrk = \"\";\n\t\t\tforeach ($arwrk as $wrk) {\n\t\t\t\tif ($sFilterWrk <> \"\") $sFilterWrk .= \" OR \";\n\t\t\t\t$sFilterWrk .= \"`nombre`\" . ew_SearchString(\"=\", trim($wrk), EW_DATATYPE_STRING, \"\");\n\t\t\t}\n\t\t$sSqlWrk = \"SELECT `nombre`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipoinmueble`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->tipovehiculo->LookupFilters = array(\"dx1\" => '`nombre`');\n\t\t$lookuptblfilter = \"`tipo`='VEHICULO'\";\n\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->tipovehiculo, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$this->tipovehiculo->ViewValue = \"\";\n\t\t\t\t$ari = 0;\n\t\t\t\twhile (!$rswrk->EOF) {\n\t\t\t\t\t$arwrk = array();\n\t\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t\t$this->tipovehiculo->ViewValue .= $this->tipovehiculo->DisplayValue($arwrk);\n\t\t\t\t\t$rswrk->MoveNext();\n\t\t\t\t\tif (!$rswrk->EOF) $this->tipovehiculo->ViewValue .= ew_ViewOptionSeparator($ari); // Separate Options\n\t\t\t\t\t$ari++;\n\t\t\t\t}\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->tipovehiculo->ViewValue = $this->tipovehiculo->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->tipovehiculo->ViewValue = NULL;\n\t\t}\n\t\t$this->tipovehiculo->ViewCustomAttributes = \"\";\n\n\t\t// id_ciudad_vehiculo\n\t\tif (strval($this->id_ciudad_vehiculo->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_ciudad_vehiculo->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `departamento`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_ciudad_vehiculo->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_ciudad_vehiculo, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_ciudad_vehiculo->ViewValue = $this->id_ciudad_vehiculo->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_ciudad_vehiculo->ViewValue = $this->id_ciudad_vehiculo->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_ciudad_vehiculo->ViewValue = NULL;\n\t\t}\n\t\t$this->id_ciudad_vehiculo->ViewCustomAttributes = \"\";\n\n\t\t// id_provincia_vehiculo\n\t\tif (strval($this->id_provincia_vehiculo->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_provincia_vehiculo->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `provincia`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_provincia_vehiculo->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_provincia_vehiculo, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_provincia_vehiculo->ViewValue = $this->id_provincia_vehiculo->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_provincia_vehiculo->ViewValue = $this->id_provincia_vehiculo->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_provincia_vehiculo->ViewValue = NULL;\n\t\t}\n\t\t$this->id_provincia_vehiculo->ViewCustomAttributes = \"\";\n\n\t\t// tipomaquinaria\n\t\tif (strval($this->tipomaquinaria->CurrentValue) <> \"\") {\n\t\t\t$arwrk = explode(\",\", $this->tipomaquinaria->CurrentValue);\n\t\t\t$sFilterWrk = \"\";\n\t\t\tforeach ($arwrk as $wrk) {\n\t\t\t\tif ($sFilterWrk <> \"\") $sFilterWrk .= \" OR \";\n\t\t\t\t$sFilterWrk .= \"`nombre`\" . ew_SearchString(\"=\", trim($wrk), EW_DATATYPE_STRING, \"\");\n\t\t\t}\n\t\t$sSqlWrk = \"SELECT `nombre`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipoinmueble`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->tipomaquinaria->LookupFilters = array(\"dx1\" => '`nombre`');\n\t\t$lookuptblfilter = \"`tipo`='MAQUINARIA'\";\n\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->tipomaquinaria, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$this->tipomaquinaria->ViewValue = \"\";\n\t\t\t\t$ari = 0;\n\t\t\t\twhile (!$rswrk->EOF) {\n\t\t\t\t\t$arwrk = array();\n\t\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t\t$this->tipomaquinaria->ViewValue .= $this->tipomaquinaria->DisplayValue($arwrk);\n\t\t\t\t\t$rswrk->MoveNext();\n\t\t\t\t\tif (!$rswrk->EOF) $this->tipomaquinaria->ViewValue .= ew_ViewOptionSeparator($ari); // Separate Options\n\t\t\t\t\t$ari++;\n\t\t\t\t}\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->tipomaquinaria->ViewValue = $this->tipomaquinaria->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->tipomaquinaria->ViewValue = NULL;\n\t\t}\n\t\t$this->tipomaquinaria->ViewCustomAttributes = \"\";\n\n\t\t// id_ciudad_maquinaria\n\t\tif (strval($this->id_ciudad_maquinaria->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_ciudad_maquinaria->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `departamento`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_ciudad_maquinaria->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_ciudad_maquinaria, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_ciudad_maquinaria->ViewValue = $this->id_ciudad_maquinaria->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_ciudad_maquinaria->ViewValue = $this->id_ciudad_maquinaria->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_ciudad_maquinaria->ViewValue = NULL;\n\t\t}\n\t\t$this->id_ciudad_maquinaria->ViewCustomAttributes = \"\";\n\n\t\t// id_provincia_maquinaria\n\t\tif (strval($this->id_provincia_maquinaria->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`id`\" . ew_SearchString(\"=\", $this->id_provincia_maquinaria->CurrentValue, EW_DATATYPE_NUMBER, \"\");\n\t\t$sSqlWrk = \"SELECT `id`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `provincia`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->id_provincia_maquinaria->LookupFilters = array();\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->id_provincia_maquinaria, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$this->id_provincia_maquinaria->ViewValue = $this->id_provincia_maquinaria->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->id_provincia_maquinaria->ViewValue = $this->id_provincia_maquinaria->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->id_provincia_maquinaria->ViewValue = NULL;\n\t\t}\n\t\t$this->id_provincia_maquinaria->ViewCustomAttributes = \"\";\n\n\t\t// tipomercaderia\n\t\tif (strval($this->tipomercaderia->CurrentValue) <> \"\") {\n\t\t\t$arwrk = explode(\",\", $this->tipomercaderia->CurrentValue);\n\t\t\t$sFilterWrk = \"\";\n\t\t\tforeach ($arwrk as $wrk) {\n\t\t\t\tif ($sFilterWrk <> \"\") $sFilterWrk .= \" OR \";\n\t\t\t\t$sFilterWrk .= \"`id_tipoinmueble`\" . ew_SearchString(\"=\", trim($wrk), EW_DATATYPE_NUMBER, \"\");\n\t\t\t}\n\t\t$sSqlWrk = \"SELECT `id_tipoinmueble`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipoinmueble`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->tipomercaderia->LookupFilters = array();\n\t\t$lookuptblfilter = \"`tipo`='MERCADERIA'\";\n\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->tipomercaderia, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$this->tipomercaderia->ViewValue = \"\";\n\t\t\t\t$ari = 0;\n\t\t\t\twhile (!$rswrk->EOF) {\n\t\t\t\t\t$arwrk = array();\n\t\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t\t$this->tipomercaderia->ViewValue .= $this->tipomercaderia->DisplayValue($arwrk);\n\t\t\t\t\t$rswrk->MoveNext();\n\t\t\t\t\tif (!$rswrk->EOF) $this->tipomercaderia->ViewValue .= ew_ViewOptionSeparator($ari); // Separate Options\n\t\t\t\t\t$ari++;\n\t\t\t\t}\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->tipomercaderia->ViewValue = $this->tipomercaderia->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->tipomercaderia->ViewValue = NULL;\n\t\t}\n\t\t$this->tipomercaderia->ViewCustomAttributes = \"\";\n\n\t\t// documento_mercaderia\n\t\t$this->documento_mercaderia->ViewValue = $this->documento_mercaderia->CurrentValue;\n\t\t$this->documento_mercaderia->ViewCustomAttributes = \"\";\n\n\t\t// tipoespecial\n\t\tif (strval($this->tipoespecial->CurrentValue) <> \"\") {\n\t\t\t$arwrk = explode(\",\", $this->tipoespecial->CurrentValue);\n\t\t\t$sFilterWrk = \"\";\n\t\t\tforeach ($arwrk as $wrk) {\n\t\t\t\tif ($sFilterWrk <> \"\") $sFilterWrk .= \" OR \";\n\t\t\t\t$sFilterWrk .= \"`id_tipoinmueble`\" . ew_SearchString(\"=\", trim($wrk), EW_DATATYPE_NUMBER, \"\");\n\t\t\t}\n\t\t$sSqlWrk = \"SELECT `id_tipoinmueble`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipoinmueble`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->tipoespecial->LookupFilters = array(\"dx1\" => '`nombre`');\n\t\t$lookuptblfilter = \"`tipo`='ESPECIAL'\";\n\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->tipoespecial, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$this->tipoespecial->ViewValue = \"\";\n\t\t\t\t$ari = 0;\n\t\t\t\twhile (!$rswrk->EOF) {\n\t\t\t\t\t$arwrk = array();\n\t\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t\t$this->tipoespecial->ViewValue .= $this->tipoespecial->DisplayValue($arwrk);\n\t\t\t\t\t$rswrk->MoveNext();\n\t\t\t\t\tif (!$rswrk->EOF) $this->tipoespecial->ViewValue .= ew_ViewOptionSeparator($ari); // Separate Options\n\t\t\t\t\t$ari++;\n\t\t\t\t}\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->tipoespecial->ViewValue = $this->tipoespecial->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->tipoespecial->ViewValue = NULL;\n\t\t}\n\t\t$this->tipoespecial->ViewCustomAttributes = \"\";\n\n\t\t// email_contacto\n\t\tif (strval($this->email_contacto->CurrentValue) <> \"\") {\n\t\t\t$sFilterWrk = \"`login`\" . ew_SearchString(\"=\", $this->email_contacto->CurrentValue, EW_DATATYPE_STRING, \"\");\n\t\t$sSqlWrk = \"SELECT `login`, `nombre` AS `DispFld`, `apellido` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `oficialcredito`\";\n\t\t$sWhereWrk = \"\";\n\t\t$this->email_contacto->LookupFilters = array(\"dx1\" => '`nombre`', \"dx2\" => '`apellido`');\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\n\t\t$this->Lookup_Selecting($this->email_contacto, $sWhereWrk); // Call Lookup Selecting\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\n\t\t\t\t$arwrk = array();\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\n\t\t\t\t$arwrk[2] = $rswrk->fields('Disp2Fld');\n\t\t\t\t$this->email_contacto->ViewValue = $this->email_contacto->DisplayValue($arwrk);\n\t\t\t\t$rswrk->Close();\n\t\t\t} else {\n\t\t\t\t$this->email_contacto->ViewValue = $this->email_contacto->CurrentValue;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->email_contacto->ViewValue = NULL;\n\t\t}\n\t\t$this->email_contacto->ViewCustomAttributes = \"\";\n\n\t\t\t// nombre_contacto\n\t\t\t$this->nombre_contacto->LinkCustomAttributes = \"\";\n\t\t\t$this->nombre_contacto->HrefValue = \"\";\n\t\t\t$this->nombre_contacto->TooltipValue = \"\";\n\n\t\t\t// name\n\t\t\t$this->name->LinkCustomAttributes = \"\";\n\t\t\t$this->name->HrefValue = \"\";\n\t\t\t$this->name->TooltipValue = \"\";\n\n\t\t\t// lastname\n\t\t\t$this->lastname->LinkCustomAttributes = \"\";\n\t\t\t$this->lastname->HrefValue = \"\";\n\t\t\t$this->lastname->TooltipValue = \"\";\n\n\t\t\t// email\n\t\t\t$this->_email->LinkCustomAttributes = \"\";\n\t\t\t$this->_email->HrefValue = \"\";\n\t\t\t$this->_email->TooltipValue = \"\";\n\n\t\t\t// address\n\t\t\t$this->address->LinkCustomAttributes = \"\";\n\t\t\t$this->address->HrefValue = \"\";\n\t\t\t$this->address->TooltipValue = \"\";\n\n\t\t\t// phone\n\t\t\t$this->phone->LinkCustomAttributes = \"\";\n\t\t\t$this->phone->HrefValue = \"\";\n\t\t\t$this->phone->TooltipValue = \"\";\n\n\t\t\t// cell\n\t\t\t$this->cell->LinkCustomAttributes = \"\";\n\t\t\t$this->cell->HrefValue = \"\";\n\t\t\t$this->cell->TooltipValue = \"\";\n\n\t\t\t// created_at\n\t\t\t$this->created_at->LinkCustomAttributes = \"\";\n\t\t\t$this->created_at->HrefValue = \"\";\n\t\t\t$this->created_at->TooltipValue = \"\";\n\n\t\t\t// id_sucursal\n\t\t\t$this->id_sucursal->LinkCustomAttributes = \"\";\n\t\t\t$this->id_sucursal->HrefValue = \"\";\n\t\t\t$this->id_sucursal->TooltipValue = \"\";\n\n\t\t\t// tipoinmueble\n\t\t\t$this->tipoinmueble->LinkCustomAttributes = \"\";\n\t\t\t$this->tipoinmueble->HrefValue = \"\";\n\t\t\t$this->tipoinmueble->TooltipValue = \"\";\n\n\t\t\t// tipovehiculo\n\t\t\t$this->tipovehiculo->LinkCustomAttributes = \"\";\n\t\t\t$this->tipovehiculo->HrefValue = \"\";\n\t\t\t$this->tipovehiculo->TooltipValue = \"\";\n\n\t\t\t// tipomaquinaria\n\t\t\t$this->tipomaquinaria->LinkCustomAttributes = \"\";\n\t\t\t$this->tipomaquinaria->HrefValue = \"\";\n\t\t\t$this->tipomaquinaria->TooltipValue = \"\";\n\n\t\t\t// tipomercaderia\n\t\t\t$this->tipomercaderia->LinkCustomAttributes = \"\";\n\t\t\t$this->tipomercaderia->HrefValue = \"\";\n\t\t\t$this->tipomercaderia->TooltipValue = \"\";\n\n\t\t\t// tipoespecial\n\t\t\t$this->tipoespecial->LinkCustomAttributes = \"\";\n\t\t\t$this->tipoespecial->HrefValue = \"\";\n\t\t\t$this->tipoespecial->TooltipValue = \"\";\n\n\t\t\t// email_contacto\n\t\t\t$this->email_contacto->LinkCustomAttributes = \"\";\n\t\t\t$this->email_contacto->HrefValue = \"\";\n\t\t\t$this->email_contacto->TooltipValue = \"\";\n\t\t} elseif ($this->RowType == EW_ROWTYPE_SEARCH) { // Search row\n\n\t\t\t// nombre_contacto\n\t\t\t$this->nombre_contacto->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->nombre_contacto->EditCustomAttributes = \"\";\n\t\t\t$this->nombre_contacto->EditValue = ew_HtmlEncode($this->nombre_contacto->AdvancedSearch->SearchValue);\n\t\t\t$this->nombre_contacto->PlaceHolder = ew_RemoveHtml($this->nombre_contacto->FldTitle());\n\n\t\t\t// name\n\t\t\t$this->name->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->name->EditCustomAttributes = \"\";\n\t\t\t$this->name->EditValue = ew_HtmlEncode($this->name->AdvancedSearch->SearchValue);\n\t\t\t$this->name->PlaceHolder = ew_RemoveHtml($this->name->FldTitle());\n\n\t\t\t// lastname\n\t\t\t$this->lastname->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->lastname->EditCustomAttributes = \"\";\n\t\t\t$this->lastname->EditValue = ew_HtmlEncode($this->lastname->AdvancedSearch->SearchValue);\n\t\t\t$this->lastname->PlaceHolder = ew_RemoveHtml($this->lastname->FldTitle());\n\n\t\t\t// email\n\t\t\t$this->_email->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->_email->EditCustomAttributes = \"\";\n\t\t\t$this->_email->EditValue = ew_HtmlEncode($this->_email->AdvancedSearch->SearchValue);\n\t\t\t$this->_email->PlaceHolder = ew_RemoveHtml($this->_email->FldTitle());\n\n\t\t\t// address\n\t\t\t$this->address->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->address->EditCustomAttributes = \"\";\n\t\t\t$this->address->EditValue = ew_HtmlEncode($this->address->AdvancedSearch->SearchValue);\n\t\t\t$this->address->PlaceHolder = ew_RemoveHtml($this->address->FldTitle());\n\n\t\t\t// phone\n\t\t\t$this->phone->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->phone->EditCustomAttributes = \"\";\n\t\t\t$this->phone->EditValue = ew_HtmlEncode($this->phone->AdvancedSearch->SearchValue);\n\t\t\t$this->phone->PlaceHolder = ew_RemoveHtml($this->phone->FldTitle());\n\n\t\t\t// cell\n\t\t\t$this->cell->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->cell->EditCustomAttributes = \"\";\n\t\t\t$this->cell->EditValue = ew_HtmlEncode($this->cell->AdvancedSearch->SearchValue);\n\t\t\t$this->cell->PlaceHolder = ew_RemoveHtml($this->cell->FldTitle());\n\n\t\t\t// created_at\n\t\t\t$this->created_at->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->created_at->EditCustomAttributes = \"\";\n\t\t\t$this->created_at->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($this->created_at->AdvancedSearch->SearchValue, 17), 17));\n\t\t\t$this->created_at->PlaceHolder = ew_RemoveHtml($this->created_at->FldTitle());\n\n\t\t\t// id_sucursal\n\t\t\t$this->id_sucursal->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->id_sucursal->EditCustomAttributes = \"\";\n\n\t\t\t// tipoinmueble\n\t\t\t$this->tipoinmueble->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->tipoinmueble->EditCustomAttributes = \"\";\n\n\t\t\t// tipovehiculo\n\t\t\t$this->tipovehiculo->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->tipovehiculo->EditCustomAttributes = \"\";\n\n\t\t\t// tipomaquinaria\n\t\t\t$this->tipomaquinaria->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->tipomaquinaria->EditCustomAttributes = \"\";\n\n\t\t\t// tipomercaderia\n\t\t\t$this->tipomercaderia->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->tipomercaderia->EditCustomAttributes = \"\";\n\n\t\t\t// tipoespecial\n\t\t\t$this->tipoespecial->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->tipoespecial->EditCustomAttributes = \"\";\n\n\t\t\t// email_contacto\n\t\t\t$this->email_contacto->EditAttrs[\"class\"] = \"form-control\";\n\t\t\t$this->email_contacto->EditCustomAttributes = \"\";\n\t\t}\n\t\tif ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) // Add/Edit/Search row\n\t\t\t$this->SetupFieldTitles();\n\n\t\t// Call Row Rendered event\n\t\tif ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)\n\t\t\t$this->Row_Rendered();\n\t}",
"function PKG_OptionPageRender($layout)\n{\n\tfor ($i=0; $i < count($layout); $i++)\n\t\t{\n\t\t\tswitch($layout[$i]['type'])\n\t\t\t\t{\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo(\"<tr><td colspan=\\\"2\\\">\".$layout[$i]['text'].\"</td></tr>\\n\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase \"line\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo(\"<tr><td colspan=\\\"2\\\"><hr></td></tr>\\n\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase \"title\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo(\"<tr><td colspan=\\\"2\\\"><br><span class=\\\"title\\\">\".$layout[$i]['text'].\"</span><hr></td></tr>\\n\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase \"infobox\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$infoBox = MSG_showMessageBoxHeader(\"infotable\",$layout[$i]['text'],700,true).MSG_showMessageBoxFooter(true);\n\t\t\t\t\t\t\techo(\"<tr><td colspan=\\\"2\\\">$infoBox</td></tr>\\n\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\tcase \"inputline\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Define the dialog element\n\t\t\t\t\t\t\t$layout[$i]['value'] = HTML_input($layout[$i]['name'], $layout['allvalues'][$layout[$i]['name']], $layout[$i]['size'], $layout[$i]['maxlength'], INPUT_TYPE_text);\n\n\t\t\t\t\t\t\t//Show it\n\t\t\t\t\t\t\techo(\"<tr><td>\".$layout[$i]['text'].\"</td><td>\".constant($layout[$i]['name']).\"</td></tr>\\n\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t};\n\n\n\t\t\t\t\tcase \"selection\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$arr = array();\n\n\t\t\t\t\t\t\t//Generate the array for the options\n\t\t\t\t\t\t\tfor ($nr=0; isset($layout[$i][\"option\".$nr]); $nr++)\n\t\t\t\t\t\t\t\t$arr[$layout[$i]['option'.$nr]] = $layout[$i]['option'.$nr];\n\n\t\t\t\t\t\t\t//Define the dialog element\n\t\t\t\t\t\t\t$layout[$i]['value'] = HTML_selection($layout[$i]['name'], $arr, SELTYPE_selection, true, $layout['allvalues'][$layout[$i]['name']]);\n\n\t\t\t\t\t\t\t//Show it\n\t\t\t\t\t\t\techo(\"<tr><td>\".$layout[$i]['text'].\"</td><td>\".constant($layout[$i]['name']).\"</td></tr>\\n\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase \"textarea\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$layout[$i]['value'] = HTML_textArea($layout[$i]['name'], $layout[$i]['cols'], $layout[$i]['rows'], $layout['allvalues'][$layout[$i]['name']]);\n\n\t\t\t\t\t\t\t//Show it\n\t\t\t\t\t\t\techo(\"<tr><td>\".$layout[$i]['text'].\"</td><td>\".constant($layout[$i]['name']).\"</td></tr>\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t};\n\n\t\t\t\t};\n\t\t};\n}",
"function RenderRow() {\r\n\t\tglobal $Security, $Language, $gsLanguage;\r\n\r\n\t\t// Initialize URLs\r\n\t\t// Call Row_Rendering event\r\n\r\n\t\t$this->Row_Rendering();\r\n\r\n\t\t// Common render codes for all row types\r\n\t\t// Id_Reasignacion\r\n\t\t// Titular_Original\r\n\t\t// Dni\r\n\t\t// NroSerie\r\n\t\t// Nuevo_Titular\r\n\t\t// Dni_Nuevo_Tit\r\n\t\t// Id_Motivo_Reasig\r\n\t\t// Observacion\r\n\t\t// Fecha_Reasignacion\r\n\t\t// Usuario\r\n\t\t// Fecha_Actualizacion\r\n\r\n\t\tif ($this->RowType == EW_ROWTYPE_VIEW) { // View row\r\n\r\n\t\t// Id_Reasignacion\r\n\t\t$this->Id_Reasignacion->ViewValue = $this->Id_Reasignacion->CurrentValue;\r\n\t\t$this->Id_Reasignacion->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Titular_Original\r\n\t\t$this->Titular_Original->ViewValue = $this->Titular_Original->CurrentValue;\r\n\t\tif (strval($this->Titular_Original->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Apellidos_Nombres`\" . ew_SearchString(\"=\", $this->Titular_Original->CurrentValue, EW_DATATYPE_MEMO, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Apellidos_Nombres`, `Apellidos_Nombres` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `personas`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Titular_Original->LookupFilters = array(\"dx1\" => \"`Apellidos_Nombres`\");\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Titular_Original, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Titular_Original->ViewValue = $this->Titular_Original->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Titular_Original->ViewValue = $this->Titular_Original->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Titular_Original->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Titular_Original->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Dni\r\n\t\t$this->Dni->ViewValue = $this->Dni->CurrentValue;\r\n\t\t$this->Dni->ViewCustomAttributes = \"\";\r\n\r\n\t\t// NroSerie\r\n\t\t$this->NroSerie->ViewValue = $this->NroSerie->CurrentValue;\r\n\t\tif (strval($this->NroSerie->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`NroSerie`\" . ew_SearchString(\"=\", $this->NroSerie->CurrentValue, EW_DATATYPE_STRING, \"\");\r\n\t\t$sSqlWrk = \"SELECT `NroSerie`, `NroSerie` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `equipos`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->NroSerie->LookupFilters = array(\"dx1\" => \"`NroSerie`\");\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->NroSerie, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->NroSerie->ViewValue = $this->NroSerie->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->NroSerie->ViewValue = $this->NroSerie->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->NroSerie->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->NroSerie->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Nuevo_Titular\r\n\t\t$this->Nuevo_Titular->ViewValue = $this->Nuevo_Titular->CurrentValue;\r\n\t\tif (strval($this->Nuevo_Titular->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Apellidos_Nombres`\" . ew_SearchString(\"=\", $this->Nuevo_Titular->CurrentValue, EW_DATATYPE_MEMO, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Apellidos_Nombres`, `Apellidos_Nombres` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `personas`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Nuevo_Titular->LookupFilters = array(\"dx1\" => \"`Apellidos_Nombres`\");\r\n\t\t$lookuptblfilter = \"`NroSerie`='0'\";\r\n\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Nuevo_Titular, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Nuevo_Titular->ViewValue = $this->Nuevo_Titular->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Nuevo_Titular->ViewValue = $this->Nuevo_Titular->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Nuevo_Titular->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Nuevo_Titular->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Dni_Nuevo_Tit\r\n\t\t$this->Dni_Nuevo_Tit->ViewValue = $this->Dni_Nuevo_Tit->CurrentValue;\r\n\t\t$this->Dni_Nuevo_Tit->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Id_Motivo_Reasig\r\n\t\tif (strval($this->Id_Motivo_Reasig->CurrentValue) <> \"\") {\r\n\t\t\t$sFilterWrk = \"`Id_Motivo_Reasig`\" . ew_SearchString(\"=\", $this->Id_Motivo_Reasig->CurrentValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t$sSqlWrk = \"SELECT `Id_Motivo_Reasig`, `Descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `motivo_reasignacion`\";\r\n\t\t$sWhereWrk = \"\";\r\n\t\t$this->Id_Motivo_Reasig->LookupFilters = array();\r\n\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t$this->Lookup_Selecting($this->Id_Motivo_Reasig, $sWhereWrk); // Call Lookup selecting\r\n\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t$arwrk = array();\r\n\t\t\t\t$arwrk[1] = $rswrk->fields('DispFld');\r\n\t\t\t\t$this->Id_Motivo_Reasig->ViewValue = $this->Id_Motivo_Reasig->DisplayValue($arwrk);\r\n\t\t\t\t$rswrk->Close();\r\n\t\t\t} else {\r\n\t\t\t\t$this->Id_Motivo_Reasig->ViewValue = $this->Id_Motivo_Reasig->CurrentValue;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->Id_Motivo_Reasig->ViewValue = NULL;\r\n\t\t}\r\n\t\t$this->Id_Motivo_Reasig->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Observacion\r\n\t\t$this->Observacion->ViewValue = $this->Observacion->CurrentValue;\r\n\t\t$this->Observacion->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Fecha_Reasignacion\r\n\t\t$this->Fecha_Reasignacion->ViewValue = $this->Fecha_Reasignacion->CurrentValue;\r\n\t\t$this->Fecha_Reasignacion->ViewValue = ew_FormatDateTime($this->Fecha_Reasignacion->ViewValue, 7);\r\n\t\t$this->Fecha_Reasignacion->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Usuario\r\n\t\t$this->Usuario->ViewValue = $this->Usuario->CurrentValue;\r\n\t\t$this->Usuario->ViewCustomAttributes = \"\";\r\n\r\n\t\t// Fecha_Actualizacion\r\n\t\t$this->Fecha_Actualizacion->ViewValue = $this->Fecha_Actualizacion->CurrentValue;\r\n\t\t$this->Fecha_Actualizacion->ViewValue = ew_FormatDateTime($this->Fecha_Actualizacion->ViewValue, 0);\r\n\t\t$this->Fecha_Actualizacion->ViewCustomAttributes = \"\";\r\n\r\n\t\t\t// Id_Reasignacion\r\n\t\t\t$this->Id_Reasignacion->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Reasignacion->HrefValue = \"\";\r\n\t\t\t$this->Id_Reasignacion->TooltipValue = \"\";\r\n\r\n\t\t\t// Titular_Original\r\n\t\t\t$this->Titular_Original->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Titular_Original->HrefValue = \"\";\r\n\t\t\t$this->Titular_Original->TooltipValue = \"\";\r\n\r\n\t\t\t// Dni\r\n\t\t\t$this->Dni->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Dni->HrefValue = \"\";\r\n\t\t\t$this->Dni->TooltipValue = \"\";\r\n\r\n\t\t\t// NroSerie\r\n\t\t\t$this->NroSerie->LinkCustomAttributes = \"\";\r\n\t\t\t$this->NroSerie->HrefValue = \"\";\r\n\t\t\t$this->NroSerie->TooltipValue = \"\";\r\n\r\n\t\t\t// Nuevo_Titular\r\n\t\t\t$this->Nuevo_Titular->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Nuevo_Titular->HrefValue = \"\";\r\n\t\t\t$this->Nuevo_Titular->TooltipValue = \"\";\r\n\r\n\t\t\t// Dni_Nuevo_Tit\r\n\t\t\t$this->Dni_Nuevo_Tit->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Dni_Nuevo_Tit->HrefValue = \"\";\r\n\t\t\t$this->Dni_Nuevo_Tit->TooltipValue = \"\";\r\n\r\n\t\t\t// Id_Motivo_Reasig\r\n\t\t\t$this->Id_Motivo_Reasig->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Id_Motivo_Reasig->HrefValue = \"\";\r\n\t\t\t$this->Id_Motivo_Reasig->TooltipValue = \"\";\r\n\r\n\t\t\t// Observacion\r\n\t\t\t$this->Observacion->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Observacion->HrefValue = \"\";\r\n\t\t\t$this->Observacion->TooltipValue = \"\";\r\n\r\n\t\t\t// Fecha_Reasignacion\r\n\t\t\t$this->Fecha_Reasignacion->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Fecha_Reasignacion->HrefValue = \"\";\r\n\t\t\t$this->Fecha_Reasignacion->TooltipValue = \"\";\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Usuario->HrefValue = \"\";\r\n\t\t\t$this->Usuario->TooltipValue = \"\";\r\n\r\n\t\t\t// Fecha_Actualizacion\r\n\t\t\t$this->Fecha_Actualizacion->LinkCustomAttributes = \"\";\r\n\t\t\t$this->Fecha_Actualizacion->HrefValue = \"\";\r\n\t\t\t$this->Fecha_Actualizacion->TooltipValue = \"\";\r\n\t\t} elseif ($this->RowType == EW_ROWTYPE_SEARCH) { // Search row\r\n\r\n\t\t\t// Id_Reasignacion\r\n\t\t\t$this->Id_Reasignacion->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Id_Reasignacion->EditCustomAttributes = \"\";\r\n\t\t\t$this->Id_Reasignacion->EditValue = ew_HtmlEncode($this->Id_Reasignacion->AdvancedSearch->SearchValue);\r\n\t\t\t$this->Id_Reasignacion->PlaceHolder = ew_RemoveHtml($this->Id_Reasignacion->FldCaption());\r\n\r\n\t\t\t// Titular_Original\r\n\t\t\t$this->Titular_Original->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Titular_Original->EditCustomAttributes = \"\";\r\n\t\t\t$this->Titular_Original->EditValue = ew_HtmlEncode($this->Titular_Original->AdvancedSearch->SearchValue);\r\n\t\t\tif (strval($this->Titular_Original->AdvancedSearch->SearchValue) <> \"\") {\r\n\t\t\t\t$sFilterWrk = \"`Apellidos_Nombres`\" . ew_SearchString(\"=\", $this->Titular_Original->AdvancedSearch->SearchValue, EW_DATATYPE_MEMO, \"\");\r\n\t\t\t$sSqlWrk = \"SELECT `Apellidos_Nombres`, `Apellidos_Nombres` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `personas`\";\r\n\t\t\t$sWhereWrk = \"\";\r\n\t\t\t$this->Titular_Original->LookupFilters = array(\"dx1\" => \"`Apellidos_Nombres`\");\r\n\t\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t\t$this->Lookup_Selecting($this->Titular_Original, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t\t$arwrk = array();\r\n\t\t\t\t\t$arwrk[1] = ew_HtmlEncode($rswrk->fields('DispFld'));\r\n\t\t\t\t\t$this->Titular_Original->EditValue = $this->Titular_Original->DisplayValue($arwrk);\r\n\t\t\t\t\t$rswrk->Close();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->Titular_Original->EditValue = ew_HtmlEncode($this->Titular_Original->AdvancedSearch->SearchValue);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$this->Titular_Original->EditValue = NULL;\r\n\t\t\t}\r\n\t\t\t$this->Titular_Original->PlaceHolder = ew_RemoveHtml($this->Titular_Original->FldCaption());\r\n\r\n\t\t\t// Dni\r\n\t\t\t$this->Dni->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Dni->EditCustomAttributes = \"\";\r\n\t\t\t$this->Dni->EditValue = ew_HtmlEncode($this->Dni->AdvancedSearch->SearchValue);\r\n\t\t\t$this->Dni->PlaceHolder = ew_RemoveHtml($this->Dni->FldCaption());\r\n\r\n\t\t\t// NroSerie\r\n\t\t\t$this->NroSerie->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->NroSerie->EditCustomAttributes = \"\";\r\n\t\t\t$this->NroSerie->EditValue = ew_HtmlEncode($this->NroSerie->AdvancedSearch->SearchValue);\r\n\t\t\tif (strval($this->NroSerie->AdvancedSearch->SearchValue) <> \"\") {\r\n\t\t\t\t$sFilterWrk = \"`NroSerie`\" . ew_SearchString(\"=\", $this->NroSerie->AdvancedSearch->SearchValue, EW_DATATYPE_STRING, \"\");\r\n\t\t\t$sSqlWrk = \"SELECT `NroSerie`, `NroSerie` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `equipos`\";\r\n\t\t\t$sWhereWrk = \"\";\r\n\t\t\t$this->NroSerie->LookupFilters = array(\"dx1\" => \"`NroSerie`\");\r\n\t\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t\t$this->Lookup_Selecting($this->NroSerie, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t\t$arwrk = array();\r\n\t\t\t\t\t$arwrk[1] = ew_HtmlEncode($rswrk->fields('DispFld'));\r\n\t\t\t\t\t$this->NroSerie->EditValue = $this->NroSerie->DisplayValue($arwrk);\r\n\t\t\t\t\t$rswrk->Close();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->NroSerie->EditValue = ew_HtmlEncode($this->NroSerie->AdvancedSearch->SearchValue);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$this->NroSerie->EditValue = NULL;\r\n\t\t\t}\r\n\t\t\t$this->NroSerie->PlaceHolder = ew_RemoveHtml($this->NroSerie->FldCaption());\r\n\r\n\t\t\t// Nuevo_Titular\r\n\t\t\t$this->Nuevo_Titular->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Nuevo_Titular->EditCustomAttributes = \"\";\r\n\t\t\t$this->Nuevo_Titular->EditValue = ew_HtmlEncode($this->Nuevo_Titular->AdvancedSearch->SearchValue);\r\n\t\t\tif (strval($this->Nuevo_Titular->AdvancedSearch->SearchValue) <> \"\") {\r\n\t\t\t\t$sFilterWrk = \"`Apellidos_Nombres`\" . ew_SearchString(\"=\", $this->Nuevo_Titular->AdvancedSearch->SearchValue, EW_DATATYPE_MEMO, \"\");\r\n\t\t\t$sSqlWrk = \"SELECT `Apellidos_Nombres`, `Apellidos_Nombres` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `personas`\";\r\n\t\t\t$sWhereWrk = \"\";\r\n\t\t\t$this->Nuevo_Titular->LookupFilters = array(\"dx1\" => \"`Apellidos_Nombres`\");\r\n\t\t\t$lookuptblfilter = \"`NroSerie`='0'\";\r\n\t\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\r\n\t\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t\t$this->Lookup_Selecting($this->Nuevo_Titular, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\t\tif ($rswrk && !$rswrk->EOF) { // Lookup values found\r\n\t\t\t\t\t$arwrk = array();\r\n\t\t\t\t\t$arwrk[1] = ew_HtmlEncode($rswrk->fields('DispFld'));\r\n\t\t\t\t\t$this->Nuevo_Titular->EditValue = $this->Nuevo_Titular->DisplayValue($arwrk);\r\n\t\t\t\t\t$rswrk->Close();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->Nuevo_Titular->EditValue = ew_HtmlEncode($this->Nuevo_Titular->AdvancedSearch->SearchValue);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$this->Nuevo_Titular->EditValue = NULL;\r\n\t\t\t}\r\n\t\t\t$this->Nuevo_Titular->PlaceHolder = ew_RemoveHtml($this->Nuevo_Titular->FldCaption());\r\n\r\n\t\t\t// Dni_Nuevo_Tit\r\n\t\t\t$this->Dni_Nuevo_Tit->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Dni_Nuevo_Tit->EditCustomAttributes = \"\";\r\n\t\t\t$this->Dni_Nuevo_Tit->EditValue = ew_HtmlEncode($this->Dni_Nuevo_Tit->AdvancedSearch->SearchValue);\r\n\t\t\t$this->Dni_Nuevo_Tit->PlaceHolder = ew_RemoveHtml($this->Dni_Nuevo_Tit->FldCaption());\r\n\r\n\t\t\t// Id_Motivo_Reasig\r\n\t\t\t$this->Id_Motivo_Reasig->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Id_Motivo_Reasig->EditCustomAttributes = \"\";\r\n\t\t\tif (trim(strval($this->Id_Motivo_Reasig->AdvancedSearch->SearchValue)) == \"\") {\r\n\t\t\t\t$sFilterWrk = \"0=1\";\r\n\t\t\t} else {\r\n\t\t\t\t$sFilterWrk = \"`Id_Motivo_Reasig`\" . ew_SearchString(\"=\", $this->Id_Motivo_Reasig->AdvancedSearch->SearchValue, EW_DATATYPE_NUMBER, \"\");\r\n\t\t\t}\r\n\t\t\t$sSqlWrk = \"SELECT `Id_Motivo_Reasig`, `Descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `motivo_reasignacion`\";\r\n\t\t\t$sWhereWrk = \"\";\r\n\t\t\t$this->Id_Motivo_Reasig->LookupFilters = array();\r\n\t\t\tew_AddFilter($sWhereWrk, $sFilterWrk);\r\n\t\t\t$this->Lookup_Selecting($this->Id_Motivo_Reasig, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\t$rswrk = Conn()->Execute($sSqlWrk);\r\n\t\t\t$arwrk = ($rswrk) ? $rswrk->GetRows() : array();\r\n\t\t\tif ($rswrk) $rswrk->Close();\r\n\t\t\t$this->Id_Motivo_Reasig->EditValue = $arwrk;\r\n\r\n\t\t\t// Observacion\r\n\t\t\t$this->Observacion->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Observacion->EditCustomAttributes = \"\";\r\n\t\t\t$this->Observacion->EditValue = ew_HtmlEncode($this->Observacion->AdvancedSearch->SearchValue);\r\n\t\t\t$this->Observacion->PlaceHolder = ew_RemoveHtml($this->Observacion->FldCaption());\r\n\r\n\t\t\t// Fecha_Reasignacion\r\n\t\t\t$this->Fecha_Reasignacion->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Fecha_Reasignacion->EditCustomAttributes = \"\";\r\n\t\t\t$this->Fecha_Reasignacion->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($this->Fecha_Reasignacion->AdvancedSearch->SearchValue, 7), 7));\r\n\t\t\t$this->Fecha_Reasignacion->PlaceHolder = ew_RemoveHtml($this->Fecha_Reasignacion->FldCaption());\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Usuario->EditCustomAttributes = \"\";\r\n\t\t\t$this->Usuario->EditValue = ew_HtmlEncode($this->Usuario->AdvancedSearch->SearchValue);\r\n\t\t\t$this->Usuario->PlaceHolder = ew_RemoveHtml($this->Usuario->FldCaption());\r\n\r\n\t\t\t// Fecha_Actualizacion\r\n\t\t\t$this->Fecha_Actualizacion->EditAttrs[\"class\"] = \"form-control\";\r\n\t\t\t$this->Fecha_Actualizacion->EditCustomAttributes = \"\";\r\n\t\t\t$this->Fecha_Actualizacion->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($this->Fecha_Actualizacion->AdvancedSearch->SearchValue, 0), 8));\r\n\t\t\t$this->Fecha_Actualizacion->PlaceHolder = ew_RemoveHtml($this->Fecha_Actualizacion->FldCaption());\r\n\t\t}\r\n\t\tif ($this->RowType == EW_ROWTYPE_ADD ||\r\n\t\t\t$this->RowType == EW_ROWTYPE_EDIT ||\r\n\t\t\t$this->RowType == EW_ROWTYPE_SEARCH) { // Add / Edit / Search row\r\n\t\t\t$this->SetupFieldTitles();\r\n\t\t}\r\n\r\n\t\t// Call Row Rendered event\r\n\t\tif ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)\r\n\t\t\t$this->Row_Rendered();\r\n\t}",
"function genSubmitRow(){\n\t\t$row = array();\n\t\tarray_pad($row, sizeof($this->table[0]), '');\n\n\t\tif($this->state->isNewEntry()){\n\t\t\t$textField = 'text';\n\t\t\t$row[0] = $this->translator->markupAttributes('input', '',array('type'=>'text', 'name'=>'user'));\n\t\t\t$row[1] = $this->translator->markupAttributes('input','',array('type'=>'submit', 'name'=>'submit', 'value'=>'Submit'));\n\n\n\t\t\tfor($count = 2; $count < sizeof($this->table[0]); $count++) $row[$count] = $this->translator->markupAttributes('input', '',array('type'=>'checkbox', 'name'=>$count));\n\t\t\n\t\t}\n\t\telse{\n\t\t\t$row[0] = '';\n\t\t\t$row[1] = $this->translator->markupAttributes('input','',array('type'=>'submit', 'name'=>'new', 'value'=>'New'));\n\n\t\t\tfor($count = 2; $count < sizeof($this->table[0]); $count++) $row[$count] = '';\n\t\t}\n\n\t\treturn $row;\n\t}",
"public function modalContent() {\n\n $fields = array( __( 'Template Rule Settings', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ) => array() );\n $sKey = key( $fields );\n\n //------------------------------------------------------------------\n // GENERIC PARAM\n //------------------------------------------------------------------\n\n $helpContent = $this->helpContent( __( 'Choose the value of this generic param.', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ),\n __( 'Choose the value of this generic param. It is set only for process flowing, and it is not used anywhere in your WordPress environment.', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ) );\n\n $fields[$sKey][] = array(\n array(\n 'type' => WPDKUIControlType::CUSTOM,\n 'content' => $helpContent\n )\n );\n\n $fields[$sKey][] = array(\n array(\n 'type' => WPDKUIControlType::TEXT,\n 'name' => $this->_model->id() . '-generic-param',\n 'value' => $this->_model->genericParam(),\n 'label' => array(\n 'value' => __( 'Generic Param', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ),\n 'data' => array( 'placement' => 'right' )\n ),\n 'size' => 24,\n 'title' => __( 'Enter the value of this generic param. It is set only for process flowing, and it is not used anywhere in your WordPress environment.', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN )\n )\n );\n\n $layout = new WPDKUIControlsLayout( $fields );\n\n // Build output buffer\n $outputBuffer = '<form name=\"' . $this->_model->id() . '-form\" method=\"POST\" action=\"\">' .\n $layout->html() .\n '</form>';\n\n return $outputBuffer;\n\n }",
"public function manageAddRow(array &$vars)\n {\n // Load the view into this object, so helpers can be automatically added to the view\n $this->view = new View('add_row', 'default');\n $this->view->base_uri = $this->base_uri;\n $this->view->setDefaultView('components' . DS . 'modules' . DS . 'ispapi' . DS);\n\n // Load the helpers required for this view\n Loader::loadHelpers($this, ['Form', 'Html', 'Widget']);\n\n // Set unspecified checkboxes\n if (!empty($vars)) {\n if (empty($vars['sandbox'])) {\n $vars['sandbox'] = 'false';\n }\n }\n\n $this->view->set('vars', (object)$vars);\n\n return $this->view->fetch();\n }",
"function build_row($row)\n{\n\t$name = $row->getColumnVal('Name');\n\t$id = $row->getColumnVal('Id');\n\n\t// Setup the columns you want to work with\n\t$idCol = $row->getCol('Id');\n\t$nameCol = $row->getCol('Name');\n\t$actionCol = $row->getCol('Action');\n\t$typeCol = $row->getCol('Type');\n\n\t// Set some HTML properties on the give column\n\t$idCol->setProp('width','50');\n\t$typeCol->setProp('width','50');\n\t$typeCol->addClass('center');\n\n\t// Add some CSS classes to the action column\n\t$actionCol\n\t\t-> addClass('center')\n\t\t-> addClass('btn');\n\n\t// Add an action link to the Action column\n\t$row->addLink('Action', \"examples.php?id=$id\", '[edit]', \"\", \"no-un\");\n\t$row->addLink('Action', \"examples.php?id=$id\", '[delete]', \"\", \"no-un\");\n\n\t// Set an ID on the row\n\t$row->setProp('id', \"tr_$id\");\n\n\t// set the background of the strawberry column to black\n\tif($name == \"Strawberry\")\n\t{\n\t\t// get an instance of the column and set a css class\n\t\t$nameCol->addClass('strawberry');\n\t}\n\n\t// set the background of the entire shoe row to red\n\tif($name == \"Chocolate\")\t\n\t{\n\t\t$row->addClass('chocolate');\n\t}\n\n\t// change one of the cell values\n\tif($name == \"Banana\")\t\n\t{\n\t\t$row->setVal('Name', $name . \" (favorite) <img src='https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcROTNegrNoPzMFMcpQ4pl7tko9LMwgoXuZyjTmX8vpUuPS_RfZr' />\");\n\t}\n\n\treturn $row;\n}",
"public function generate()\n {\n switch ($this->sColumn) {\n case 'description':\n $this->oForm->addElement(\n new Textarea(\n t('Description:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,20,4000)',\n 'value' => $this->sVal,\n 'validation' => new Str(20, 4000),\n 'required' => 1\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'punchline':\n $this->oForm->addElement(\n new Textbox(\n t('Punchline/Headline:'),\n 'punchline',\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,5,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(5, 150)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'country':\n $this->oForm->addElement(\n new Country(\n t('Country:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'value' => $this->sVal,\n 'required' => 1\n ]\n )\n );\n break;\n\n case 'city':\n $this->oForm->addElement(\n new Textbox(\n t('City:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 150),\n 'required' => 1\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'state':\n $this->oForm->addElement(\n new Textbox(\n t('State/Province:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 150)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'zipCode':\n $this->oForm->addElement(\n new Textbox(\n t('Postal Code:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,15)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 15)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'middleName':\n $this->oForm->addElement(\n new Textbox(\n t('Middle Name:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('name'),\n 'onblur' => 'CValid(this.value,this.id)',\n 'value' => $this->sVal,\n 'validation' => new Name\n ]\n )\n );\n $this->addCheckErrSpan('name');\n break;\n\n case 'height':\n $this->oForm->addElement(\n new Height(\n t('Height:'),\n $this->sColumn,\n [\n 'value' => $this->sVal\n ]\n )\n );\n break;\n\n case 'weight':\n $this->oForm->addElement(\n new Weight(\n t('Weight:'),\n $this->sColumn,\n [\n 'value' => $this->sVal\n ]\n )\n );\n break;\n\n case 'website':\n case 'socialNetworkSite':\n $sLabel = $this->sColumn === 'socialNetworkSite' ? t('Social Media Profile:') : t('Website:');\n $sDesc = $this->sColumn === 'socialNetworkSite' ? t('The URL of your social profile, such as Facebook, Instagram, Snapchat, LinkedIn, ...') : t('Your Personal Website/Blog (any promotional/affiliated contents will be removed)');\n $this->oForm->addElement(\n new Url(\n $sLabel,\n $this->sColumn, [\n 'id' => $this->getFieldId('url'),\n 'onblur' => 'CValid(this.value,this.id)',\n 'description' => $sDesc,\n 'value' => $this->sVal\n ]\n )\n );\n $this->addCheckErrSpan('url');\n break;\n\n case 'phone':\n $this->oForm->addElement(\n new Phone(\n t('Phone Number:'),\n $this->sColumn,\n array_merge(\n [\n 'id' => $this->getFieldId('phone'),\n 'onblur' => 'CValid(this.value, this.id)',\n 'value' => $this->sVal,\n ],\n self::setCustomValidity(\n t('Enter full number with area code.')\n ),\n )\n )\n );\n $this->addCheckErrSpan('phone');\n break;\n\n default:\n $sLangKey = strtolower($this->sColumn);\n $sClass = '\\PFBC\\Element\\\\' . $this->getFieldType();\n $this->oForm->addElement(new $sClass(t($sLangKey), $this->sColumn, ['value' => $this->sVal]));\n }\n\n return $this->oForm;\n }"
] | [
"0.6556198",
"0.59870917",
"0.5853361",
"0.58523697",
"0.58466697",
"0.57442164",
"0.56297654",
"0.56246775",
"0.56168485",
"0.55968034",
"0.5580604",
"0.5580604",
"0.55728126",
"0.55656314",
"0.55607",
"0.5549679",
"0.5540511",
"0.55240744",
"0.55177873",
"0.55157965",
"0.5498747",
"0.5486041",
"0.5480066",
"0.54696697",
"0.54664576",
"0.5456584",
"0.5443879",
"0.54436094",
"0.5436692",
"0.54130995"
] | 0.5987105 | 1 |
Given lab rows show in a table | public function makeLabLines($rows, $cb = false) {
$rev_level = rev('getLevels', $this->tlist);
$rev_affil = rev('getAffiliations', $this->tlist);
$rev_type = rev('getLTypes', $this->tlist);
$edit_users = array('ADMIN','USER','APPROVER');
$ct = 0;
$tout = array();
$tout[] = '<table style="margin-left:50px;color:black;">';
$tout[] = "<tr class='even'>";
if ($cb) {
$first = "<td style='width:55px;'>Select/<br />Deselect All</td>";
} else {
$first = "<td style='width:55px;'></td>";
}
$etop = '';
#if (in_array($this->usertype, $edit_users)) {
# $etop = "<td style='width:50px;'></td>";
#}
$tout[] = <<<"END"
{$first}
<td style='width:100px;font-weight:bold;'>Lab Number</td>
<td style='width:200px;font-weight:bold;'>Labname</td>
<td style='width:85px;font-weight:bold;'>Country</td>
<td style='width:100px;font-weight:bold;'>Level</td>
<td style='width:145px;font-weight:bold;'>Affiliation</td>
<td style='width:145px;font-weight:bold;'>SLMTA Lab Type</td>
{$etop}</tr>
END;
foreach($rows as $row) {
//logit("LAB: " . print_r($row, true));
$ct ++;
$cls = ($ct % 2 == 0) ? 'even' : 'odd';
$edit = '';
#if (in_array($this->usertype, $edit_users)) {
# $edit = "<a href=\"{$this->baseurl}/lab/edit/{$row['id']}\"" .
# " class=\"btn btn-mini btn-warning\">Edit</a>";
#}
$line = '';
if ($cb) {
$name = "cb_{$row['id']}";
$line .= "<td style='width:40px;padding:2px 0;'>" .
"<input type='checkbox' name='{$name}' id='{$name}'></td>";
} else if ($this->labnum == $row['labnum']) {
$cls = 'hilight';
$line .= "<td><div style=\"color:red;\">Selected</div></td>";
} else {
$butt = "<a href=\"{$this->baseurl}/lab/choose/{$row['id']}\"" .
" class=\"btn btn-mini btn-success\">Select</a>";
$line .= "<td style='width:55px;padding:2px 0;'>{$butt}</td>";
}
//$tout[] = "<tr class='{$cls}'>";
$tout[] = <<<"END"
<tr class="{$cls}">
{$line}
<td>{$row['labnum']}</td>
<td>{$row['labname']}</td>
<td>{$row['country']}</td>
<td><p class="small">{$rev_level[$row['lablevel']]}</p></td>
<td><p class="small">{$rev_affil[$row['labaffil']]}</p></td>
<td><p class="small">{$rev_type[$row['slmta_labtype']]}</p></td>
END;
if ($edit != '')
$tout[] = "<td style='width:40px;padding:2px 0;'>{$edit}</td>";
$tout[] = '</tr>';
// "<td style='width:45px;font-weight:bold;'>SLMTA</td>" .
// <td>{$sl}</td>
}
$tout[] = '</table>';
$this->view->showlines = implode("\n", $tout);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exibeLab($lab, $qtdLinha, $qtdColuna){\n echo '<table border=\"0\" cellspacing=\"1\" cellpadding=\"20\" align=\"center\" style=\"margin-top:20px;\" >';\n for ($l=0; $l<$qtdLinha; $l++){\n echo '<tr>';\n for ($c=0; $c<$qtdColuna; $c++){\n if ($lab[$l][$c] == 0){\n echo '<td style=\"background-color:white\"></td>';\n }elseif ($lab[$l][$c] == 1){\n echo '<td style=\"background-color:black\"></td>';\n }elseif ($lab[$l][$c] == 3){\n echo '<td style=\"background-color:red\"></td>';\n }elseif ($lab[$l][$c] == 4){\n echo '<td style=\"background-color:black\"></td>';\n }elseif ($lab[$l][$c] == 5){\n echo '<td style=\"background-color:#5F9EA0;\"></td>';\n }\n }\n echo '</tr>';\n }\n echo \"</table>\";\n }",
"function draw_table($rows) {\n \n echo \"<table border=1 cellspacing=1>\"; //Set up border and spacing\n echo \"<tr>\"; //Begin the table row insertion for header row\n \n foreach($rows[0] as $key => $item) {\n \n echo \"<th>$key</th>\";\n \n }\n \n echo \"</tr>\";\n \n // Insert data into each row\n foreach ($rows as $row) {\n \n echo \"<tr>\";\n \n foreach ($row as $key => $item) {\n \n echo \"<td>$item</td>\"; //Table data\n \n }\n \n echo \"</tr>\";\n \n }\n \n echo \"</table>\";\n \n }",
"private function showRows()\n\t{\n\t\techo '<tbody>';\n\t\t\n\t\t\tforeach ($this->data_show as $key => $row)\n\t\t\t{\n\t\t\t\techo '<tr>\n\t\t\t\t\t<td class=\"details-control\" data-row_id=\"row_' . $key . '\"></td>';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($row as $col => $val)\n\t\t\t\t\t\tif( in_array($col, $this->col_show) )\n\t\t\t\t\t\t\techo '<td>' . $val . '</td>';\n\t\t\t\t\n\t\t\t\techo '</tr>';\n\t\t\t}\n\t\t\n\t\techo '</tbody>';\n\t}",
"function display() {\r\n echo '<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\r\n echo '<tr>'; \r\n for ($pos = 0; $pos < 9; $pos++) { \r\n echo $this->show_cell($pos); \r\n if ($pos % 3 == 2) {\r\n echo '</tr><tr>';\r\n } \r\n }\r\n echo '</tr>';\r\n echo '</table>';\r\n }",
"public function display_rows()\n {\n }",
"public function display_rows()\n {\n }",
"public function visualizzazione(){\n $nameColumn = $this->getColumnName();\n $tuple = $this->read();\n foreach($nameColumn as $nome){\n $x = ' <td> '. $nome . ' </td> ';\n echo $x;\n }\n \n foreach($tuple as $ris){\n $str ='<tr> <td> '.$ris->getId(). ' </td> '.\n '<td> '.$ris->getNome(). '</td>'.\n '<td> '.$ris->getUsername(). '</td>'.\n '<td> '.$ris->getPassword(). '</td>'.\n '<td> '.$ris->getEmail(). '</td>'.\n '<td> '.$ris->getMuseo(). '</td>'.\n '</tr>';\n echo $str;\n };\n }",
"function showDataTable(){\n\t\t$output = \"\";\n\t\t// print the table\n\t\t$output .= \"<table summary=\\\"\".$this->summary.\"\\\">\\n\";\n\t\t// print the caption\n\t\t$output .= \"<caption>\".$this->caption.\"</caption>\\n\";\n\t\t$output .= $this->showHeader();\n\t\t// initialise variables\n\t\t$altCounter = 0;\n\t\t$altClass = \"\";\n\t\t$h = 1;\n\t\t// loop each row\n\t\tfor ($x=0; $x<count($this->rows); $x++) {\n\t\t\t// if it is time to show the header\n\t\t\tif ($h==$this->headerRepeat){\n\t\t\t\t// show the header\n\t\t\t\t$output .= $this->showHeader();\n\t\t\t\t$h = 1;\n\t\t\t}\n\t\t\t$row = $this->rows[$x];\n\t\t\t// alternate the row classes\n\t\t\tif ($this->altClasses){\n\t\t\t\tif ($this->altClasses[$altCounter]!=\"\"){ $altClass = \" class=\\\"\".$this->altClasses[$altCounter].\"\\\"\"; } else { $altClass=\"\"; }\n\t\t\t\tif ($altCounter==count($this->altClasses)-1){ $altCounter=0; } else { $altCounter++; }\n\t\t\t}\n\t\t\t// set the parameters to nothing\n\t\t\t$params = \"\";\n\t\t\t// if there are parameters for this row set\n\t\t\tif (count($this->rowParams[$x])>0){\n\t\t\t\t// loop the parameters\n\t\t\t\twhile (list($attribute, $parameter) = each($this->rowParams[$x])) {\n\t\t\t\t\t// if the parameter is 'class'\n\t\t\t\t\tif (strtolower($attribute)==\"class\"){\n\t\t\t\t\t\t// replace the altClass variable\n\t\t\t\t\t\t$altClass = \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t} else{\n\t\t\t\t\t\t// otherwise build the parameters\n\t\t\t\t\t\t$params .= \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// print the row\n\t\t\t$output .= \"\t<tr$altClass$params>\\n\";\n\t\t\t\t// set the colSpan to 0\n\t\t\t\t$colSpan = 0;\n\t\t\t\t$colSpanAttribute = \"\";\n\t\t\t\t// if this row has less columns than the number of fields\n\t\t\t\tif (count($row)<count($this->fields)){\n\t\t\t\t\t$colSpan = (count($this->fields)-count($row))+1;\n\t\t\t\t}\n\t\t\t\t// loop each cell\n\t\t\t\tfor ($i=0; $i<count($row); $i++) {\n\t\t\t\t\t$value = $row[$i];\n\t\t\t\t\t$value = $this->formatField($i, $x);\n\t\t\t\t\t// make the colspan attribute\n\t\t\t\t\tif ($colSpan>0 && $i==(count($row)-1)){ $colSpanAttribute = \" colspan=\\\"$colSpan\\\"\"; }\n\t\t\t\t\t// print the cell\n\t\t\t\t\t$output .= \"\t\t<td$colSpanAttribute>\".$value.\"</td>\\n\";\n\t\t\t\t}\n\t\t\t// end the row\n\t\t\t$output .= \"\t</tr>\\n\";\n\t\t\t// increment the header repeat variable\n\t\t\t$h++;\n\t\t}\n\t\t// end the table\n\t\t$output .= \"</table>\\n\\n\";\n\t\tprint $output;\n\t}",
"function display() {\n echo'<table cols=\"3\" style=\"font-size:large; font-weight:bold\">';\n echo'<tr>'; //first row\n for ($pos = 0; $pos < 9; $pos++) {\n echo $this->show_cell($pos);\n if ($pos % 3 == 2)\n echo '</tr><tr>'; //next square is in a new row\n }\n echo'</tr>';\n echo'</table>';\n }",
"function ispis_tablice($ucenici)\n {\n echo '<table border=1>';\n foreach ($ucenici as $key => $ime) {\n echo '<tr><td>'\n .$key.'</td>;\n <td>'.$ime.'</td>;\n </tr>';\n }\n echo '</table>';\n }",
"function label($array){\n //\n //Get the fields \n $fields= $this->fields->get_array();\n //\n //Ouptut a table\n echo \"<div name='{$this->entity->name}'>\";\n echo $this->header();\n //\n //Loop through the array and display the results in a table \n foreach ($array as $row) {\n //\n //Step through the columns\n foreach($fields as $field){\n //\n //Get the indexes of the field\n $name= is_null($field->alias) ? $field->column->name:$field->alias;\n //\n //Get the field value\n $value = $row[$name];\n \n echo \"<span> $name :<span>$value></span>\"; \n }\n }\n echo \"</div>\"; \n }",
"function table($text) {\n\t\t$output = \"\";\n\t\tif (!empty($text)) {\n\t\t\t$output .= '<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\">';\n\t\t\t$array = explode(\"\\n\", $text);\n\t\t\tfor ($i=0; $i<count($array); $i++) {\n\t\t\t\tif (!empty($array[$i])) {\n\t\t\t\t\t$row = explode(\":\", $array[$i], 2);\n\t\t\t\t\t$title = isset($row[0]) ? $row[0] : '';\n\t\t\t\t\t$data = isset($row[1]) ? $row[1] : '';\n\t\t\t\t\tif ($i%2 == 0) {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_a\"><td class=\"form_title\" width=\"30%\">'.$title.'</td><td bgcolor=\"#EBF1F6\" width=\"70%\">'.$data.'</td></tr>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_b\"><td class=\"form_title\">'.$title.'</td><td bgcolor=\"#FFFFFF\">'.$data.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '</table>';\n\t\t}\n\n\t\treturn $output;\n\t}",
"function Escenario($lista){\r\necho \"<table class='tg' border='1' style='margin:auto;'>\";\r\n echo \"<tr>\";\r\n echo \"<th colspan='6'>ESCENARIO</th>\";\r\n echo \"<tr>\";\r\n echo \"<th></th>\r\n <th>1</th>\r\n <th>2</th>\r\n <th>3</th>\r\n <th>4</th> \r\n <th>5</th>\r\n </tr>\";\r\n \r\n$i=1;\r\n// Imprimimos el contenido de la tabla\r\nforeach ($lista as $fila) {\r\n echo \"<tr>\";\r\n echo \"<th>\";\r\n echo $i;\r\n echo \"</th>\";\r\n foreach ($fila as $silla) {\r\n echo \"<td>\";\r\n echo $silla;\r\n echo \"</td>\";\r\n }\r\n echo \"</tr>\";\r\n $i++;\r\n }\r\necho \"</table>\";\r\n}",
"public function table()\n\t{\n\t\t$this->datatables->select('testcat.test_id AS test_id, testcat_id, gender, age, score, percentile, percentile.id AS id');\n\t\t$this->datatables->from('percentile');\n\t\t$this->datatables->join('testcat', 'testcat.id = percentile.testcat_id');\n\n\t\t$this->datatables->edit_column('test_id', '$1', 'test_get_link_by_id(test_id)');\n\t\t$this->datatables->edit_column('testcat_id', '$1', 'testcat_get_link_by_id(testcat_id)');\n\t\t$this->datatables->edit_column('gender', '$1', 'gender(gender)');\n\t\t$this->datatables->edit_column('id', '$1', 'percentile_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}",
"function viewTable($parks)\n{\n return formatTable($parks);\n}",
"function buildRow($network){\n $offset = 0;\n $i = 0;\n while($i < 7){\n $currentTitle = getTitle($network, getTime($offset));\n if (count($currentTitle) == 0){\n echo '<td colspan=\"1\">Local Programming</td>';\n $collumns = 1;\n $offset += 30;\n }\n else{\n $collumns = (int)($currentTitle[0]['RUNTIME'] / 30);\n if($i + $collumns > 7 ){\n $collumns = 2;\n }\n else if ($i + $collumns == 7){\n $collumns += 1;\n }\n echo '<td colspan=\"'. $collumns.'\"><a href = \"/phase5/pages/info.php?id= ' . $currentTitle[0]['ID']. '\">' . $currentTitle[0]['TITLE'] . '</td> ';\n $offset += $currentTitle[0]['RUNTIME'] ;\n }\n $i += $collumns; \n }\n}",
"public function displayTable(array $rows): void\n {\n $table = new Table(new ConsoleOutput());\n $table\n ->setHeaders(array_keys($rows[0]))\n ->setRows($rows)\n ;\n $table->render();\n }",
"function display_rows() {\r\n\r\n # Get the records registered in the prepare_items method\r\n $records = $this->items;\r\n\r\n //Loop for each record\r\n if(!empty($records)){foreach($records as $rec){\r\n $custom_data = unserialize($rec->custom_data);\r\n\r\n echo '<tr id=\"record_'.$rec->id.'\">';\r\n echo '<td>'.stripslashes($rec->created_on).'</td>';\r\n echo '<td>'.stripslashes($rec->type).'</td>';\r\n echo '<td>'.stripslashes($rec->ip).'</td>';\r\n echo '<td>'.stripslashes($custom_data['personal']['OS']['name']).'</td>';\r\n echo '<td>'.stripslashes($custom_data['personal']['browser']['name']).'</td>';\r\n echo '<td>'.stripslashes($custom_data['personal']['location']['name']).'</td>';\r\n echo '<td>\r\n <a href=\"\" data-post=\"action=detailed_log&type=' .$rec->type. '&id=' .$rec->id. '&detail=full&ip=' .$rec->ip. '\" data-type=\"modal\" data-toggle=\"tooltip\" title=\"Show details\"><div class=\"dashicons dashicons-list-view\"></div></a>\r\n <a href=\"admin.php?page=cybercure_security_detected_attacks&type=' .$rec->type. '&delete=' .$rec->id. '\" data-toggle=\"tooltip\" title=\"Delete entry\"><div class=\"dashicons dashicons-trash\"></div></a>\r\n </td></tr>';\r\n }}\r\n }",
"function printTable ($rows, $cols) {\n echo \"<table border=1>\";\n\n for ($i=0; $i<$rows; $i++) {\n echo \"<tr>\";\n for ($j=0; $j<$cols; $j++) {\n echo \"<td> Content </td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }",
"function printTable($arg_array)\r\n\t\t{\r\n\t\techo \"<table border=1>\";\r\n\t\tforeach($arg_array[0] as $key=>$value)\r\n\t\t\t{\r\n\t\t\techo \"<th>\".$key.\"</th>\";\r\n\t\t\t}\r\n\t\techo \"<tr>\";\r\n\t\tforeach($arg_array as $row =>$record)\r\n\t\t\t{\r\n\t\t\tforeach($record as $column_head => $value)\r\n\t\t\t\t{\r\n\t\t\t\techo \"<td>\".$value.\"</td>\";\r\n\t\t\t\t}\r\n\t\t\techo \"</tr>\";\t\r\n\t\t\t}\r\n\t\techo \"</table>\";\r\n\t\t}",
"public function table()\n\t{\n\t\t$this->datatables->select('experiment_id, user_id_caller, id');\n\t\t$this->datatables->from('caller');\n\n\t\t$this->datatables->edit_column('experiment_id', '$1', 'experiment_get_link_by_id(experiment_id)');\n\t\t$this->datatables->edit_column('user_id_caller', '$1', 'user_get_link_by_id(user_id_caller)');\n\t\t$this->datatables->edit_column('id', '$1', 'caller_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}",
"function display_rows() {\n \n //Get the records registered in the prepare_items method\n $records = $this->items;\n \n //Get the columns registered in the get_columns and get_sortable_columns methods\n list( $columns, $hidden ) = $this->get_column_info();\n \n //Loop for each record\n if(!empty($records)){foreach($records as $rec){\n \n // Format the status output\n if ( strtotime($rec->until) <= 0 ) {\n $rec->until = false;\n } else {\n //$rec->until = __('Membership ended','wpwt').\": \".strftime('%Y-%m-%d',strtotime($rec->until));\n $rec->until = ' | Active until '.strftime('%Y-%m-%d',strtotime($rec->until));\n }\n $rec->since = __('Applied','wpwt').\": \".strftime('%Y-%m-%d',strtotime($rec->since));\n \n // Pre-define the edit link\n //$editlink = '/wp-admin/link.php?action=edit&link_id='.(int)$rec->link_id;\n\n //Open the line\n echo \"<tr id=\\\"record_\".$rec->groupID.\"\\\" class=\\\"row-active-\".$rec->active.\"\\\">\\n\";\n foreach ( $columns as $column_name => $column_display_name ) {\n \n //Style attributes for each col\n $class = \"class='$column_name column-$column_name'\";\n \n // Create output in cell\n switch ( $column_name ) {\n case \"col_what\": echo \"<td \".$class.\">\".$this->show_what($rec).\"</td>\\n\"; break;\n case \"col_user\": echo \"<td \".$class.\">\".$this->add_actions($rec).\"</td>\\n\"; break;\n case \"col_groupName\": echo \"<td \".$class.\">\".$rec->groupName.\"</td>\\n\"; break;\n case \"col_application\": echo \"<td \".$class.\">\".$rec->application\n .\"<br><b>\".$rec->since.\"</b></td>\\n\"; break;\n }\n }\n \n //Close the line\n echo \"</tr>\\n\";\n }}\n }",
"function Row($data)\n{\n $nb=0;\n for($i=0;$i<count($data);$i++)\n $nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));\n $h=5*$nb;\n //Issue a page break first if needed\n $this->CheckPageBreak($h);\n //Draw the cells of the row\n for($i=0;$i<count($data);$i++)\n {\n $w=$this->widths[$i];\n $a=isset($this->aligns[$i]) ? $this->aligns[$i] : 'C'; //sets the alignment of text inside the cell\n //Save the current position\n $x=$this->GetX();\n $y=$this->GetY();\n //Draw the border\n $this->Rect($x,$y,$w,$h);\n //Print the text\n $this->MultiCell($w,5,$data[$i],0,$a);\n //Put the position to the right of the cell\n $this->SetXY($x+$w,$y);\n }\n //Go to the next line\n $this->Ln($h);\n}",
"function tableauToHTML(array $tab)\n{\n echo \"<table>\";\n foreach ($tab as $i => $ligne) {\n echo \"<tr>\";\n foreach ($ligne as $j => $valeur) {\n echo \"<td>$valeur</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}",
"function it_should_make_the_example_table()\n {\n \t$table = '| Tables | Are | Cool |' . PHP_EOL . \n\t\t\t\t '|----------|:-------------:|------:|' . PHP_EOL .\n\t\t\t\t '| col 1 is | left-aligned | $1600 |' . PHP_EOL .\n\t\t\t\t '| col 2 is | centered | $12 |' . PHP_EOL .\n\t\t\t\t '| col 3 is | right-aligned | $1 |' . PHP_EOL;\n\n \t$this->headers(['Tables','Are','Cool']) //headers\n\t\t\t->align(['L','C','R']) // set column alignment\n\t\t\t->rows([ // add multiple rows at once\n\t\t\t\t['col 1 is', 'left-aligned', '$1600'],\n\t\t\t\t['col 2 is', 'centered', '$12'],\n\t\t\t])\n\t\t\t->row(['col 3 is', 'right-aligned', '$1'])\n\t\t\t->render()\n\t\t\t->shouldReturn($table);\n }",
"function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }",
"public function drawTable()\n {\n echo \"<table border='1'>\";\n for ($i = 0; $i < $this->m; $i++) {\n echo \"<tr>\";\n for ($j = 0; $j < $this->n; $j++) {\n if ($this->isInSolution($i, $j, $this->matrix)) {\n echo \"<td bgcolor='#9acd32'>\";\n } else {\n echo \"<td>\";\n }\n echo $this->matrix[$i][$j];\n echo \"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }",
"function titulopersonal(){\n print (\"\\n<tr>\");\n if($this->titulo !=\"\")\n foreach ($this->titulo as $titulo){\n print (\"\\n<th>$titulo</th>\");\n }\n print (\"\\n<tr>\"); \n }",
"public function fullTableRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($in as $k => $v){\n if(!isset($v)) $v = 'n/a';\n $out .= '<td><a title=\"'.$k.'\">'.$v.'</a></td>';\n }\n return('<tr>'.$out.'</tr>');\n }",
"function table_table_row($values,$escape=false)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\tif (($escape) && ((!is_object($value)) || ($value->pure_lang!==true)))\n\t\t\t$value=make_string_tempcode(escape_html(is_object($value)?$value->evaluate():$value));\n\n\t\t$cells->attach(do_template('TABLE_TABLE_ROW_CELL',array('_GUID'=>'700a982eb2262149295816ddee91b0e7','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_ROW',array('_GUID'=>'a4efacc07ecb165e37c355559f476ae9','CELLS'=>$cells));\n}"
] | [
"0.7079118",
"0.6730648",
"0.6729151",
"0.6586235",
"0.6490279",
"0.64900094",
"0.64703673",
"0.6467509",
"0.6372382",
"0.63648754",
"0.6352889",
"0.6337399",
"0.6312124",
"0.62397605",
"0.6234957",
"0.6219381",
"0.62049246",
"0.6203714",
"0.6181953",
"0.61750436",
"0.6170919",
"0.6158584",
"0.613919",
"0.6134124",
"0.6127882",
"0.6126645",
"0.61265516",
"0.6115431",
"0.61129427",
"0.60995245"
] | 0.6785565 | 1 |
Gets the invoice timestamp. | public function getInvoiceTimestamp(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getInvoiceDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->invoiceDate;\r\n\t}",
"function getTimestamp() {\r\r\n\t\treturn $this->timestamp;\r\r\n\t}",
"public function getTimestamp();",
"public function getTimestamp();",
"public function getTimestamp();",
"public function getTimestamp()\n\t{\n\t\treturn $this->getValue('timestamp');\n\t}",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"public function getTimestamp()\n { return $this->get('timestamp'); }",
"public function getTimestamp() {\n return $this->timestamp;\n }",
"public function getTimestamp() {\n return $this->timestamp;\n }",
"public function getTimestamp()\n {\n return $this->timestamp;\n }",
"private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }",
"public function getTimestamp() \n\t{\n\t\treturn $this->timestamp;\n\t}",
"function getTimestamp() {\n return $this->time_stamp;\n }",
"public function getTimestamp()\n {\n return $this->_timestamp;\n }",
"public function getTimestamp()\n {\n return $this->proxyBase->timestamp;\n }",
"public function getTimestamp() {\n\n return $this->timestamp;\n }",
"public function getTimestamp()\n\t\t\t{\n\t\t\t\treturn $this->timestamp;\n\t\t\t}",
"public function getTimestamp()\n {\n return $this->dateIssued->getTimestamp();\n }",
"public function getTimestamp()\r\n {\r\n return $this->_timestamp;\r\n }"
] | [
"0.70949066",
"0.70701075",
"0.70630103",
"0.70630103",
"0.70630103",
"0.70532495",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7046818",
"0.7016278",
"0.69950724",
"0.69950724",
"0.69841284",
"0.6980688",
"0.6969136",
"0.6966403",
"0.6960639",
"0.69595903",
"0.6957801",
"0.6940367",
"0.69123375",
"0.6911759"
] | 0.89875394 | 0 |
Returns route that can be matched against specified methods. | public function withMethods(array $methods): Route; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getRoutesForMethod($method);",
"public function test_match_withSupportedMethod()\n {\n $route = new Route('GET|POST', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if method provided is supported by the route instanciated with more than one method.'\n );\n }",
"function match($methods, $uri, $action)\n {\n Route::match($methods, $uri, $action);\n }",
"public function match($methods, $uri, $action)\n {\n return $this->addRoute(\\array_map('strtoupper', (array) $methods), $uri, $action);\n }",
"public function match($methods, $pattern, $fn)\n {\n\n $pattern = $this->baseRoute . '/' . trim($pattern, '/');\n $pattern = $this->baseRoute ? rtrim($pattern, '/') : $pattern;\n\n $params = [];\n foreach(explode('/',$pattern) as $item){\n if(strpos($item, '{') !== false && strpos($item, '}') !== false){\n $is_required = strpos($item, '?') !== false?false:true;\n $params[str_replace(['}','{','?'],'',$item)] = array('required'=>$is_required);\n }\n }\n $routeName = is_string($fn)\n ? strtolower(preg_replace(\n '/[^\\w]/i', '.', str_replace($this->namespace, '', $fn)\n ))\n : null;\n\n $routeName = (!is_null($this->defaultName))?$this->defaultName.'.'.$routeName:$routeName;\n\n $middlewares = [];\n\n if(!is_null($this->defaultMiddleware)){\n $middlewares = (is_string($this->defaultMiddleware))?[$this->defaultMiddleware]:(is_array($this->defaultMiddleware)?$this->defaultMiddleware:[]);\n }\n\n foreach (explode('|', $methods) as $method) {\n $this->routes[] = [\n 'method' => $method,\n 'pattern' => $pattern,\n 'fn' => $fn,\n 'name'=>$routeName,\n 'fields'=>$params,\n 'middlewares'=> $middlewares\n ];\n }\n return $this;\n }",
"public function route(string $requestUri, string $requestMethod);",
"public function getRoutesOf(String $method)\n {\n $method = strtoupper($method);\n\n if (!isset($this->routes[$method])) return null;\n\n return $this->routes[$method];\n }",
"public function match($methods, $path, $action)\n {\n $methods = array_map('strtoupper', (array) $methods);\n\n return $this->addRoute($methods, $path, $action);\n }",
"public function getDynamic(string $regex, string $method = null): Route|null;",
"public function findMatch(\\string $uri, \\string $method);",
"public function match($url=null, $method=null)\n{\n foreach(RouteCollection::group($method) as $route)\n {\n $regex = $route->convertPattern();\n if(preg_match($regex, $url, $matches))\n {\n array_shift($matches);\n $this->matches = $matches;\n $this->route = $route;\n $route->register('matches', $matches);\n $route->register('regex', $regex);\n return $route->parameters();\n }\n }\n return false;\n}",
"private function match($uri, $method)\n\t{\n\t\tif(isset($this->routes[$method]) and !empty($this->routes[$method]))\n\t\t{\n\t\t\tforeach(array_keys($this->route[$method]) as $route)\n\t\t\t{\n\t\t\t\tforeach($this->choices as $search => $replace)\n\t\t\t\t{\n\t\t\t\t\t$route = str_replace($search, $replace, $route);\n\t\t\t\t}\n\n\t\t\t\tif($route == '(.+)')\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'parameters' => $uri,\n\t\t\t\t\t\t'before' => $this->routes[$method][$route]['before'],\n\t\t\t\t\t\t'callback' => $this->routes[$method][$route]['callback'],\n\t\t\t\t\t\t'after' => $this->routes[$method][$route]['after'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\telseif(preg_match('#^'.$route.'$#i', $uri, $matches))\n\t\t\t\t{\n\t\t\t\t\t$parameters = [];\n\n\t\t\t\t\tfor($i = 1, $count = count($matches); $i < $count; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$parameters[] = $matches[$i];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'parameters' => $parameters,\n\t\t\t\t\t\t'before' => $this->routes[$method][$route]['before'],\n\t\t\t\t\t\t'callback' => $this->routes[$method][$route]['callback'],\n\t\t\t\t\t\t'after' => $this->routes[$method][$route]['after'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function testRouterAddByAddRouteSeveralMethods($method)\n {\n $router = new Router();\n\n $router->any([\"GET\", \"POST\"], \"user\", function () {\n return \"user\";\n });\n\n $router->always(function () {\n return \"always\";\n });\n\n $res = $router->handle(\"user\", $method);\n if ($method === \"GET\" || $method === \"POST\") {\n $this->assertEquals(\"user\", $res);\n }\n\n if (!($method === \"GET\" || $method === \"POST\")) {\n $this->assertEquals(\"always\", $res);\n }\n\n $routes = $router->getAll();\n $this->assertEquals(2, count($routes));\n }",
"public function getRoutesByMethod()\n {\n return collect($this->getRoutes())\n ->groupBy(function (Route $route) {\n return $route->methods();\n })\n ->map(function (Collection $routes) {\n return $routes->mapWithKeys(function (Route $route) {\n return [$route->getDomain().$route->uri => $route];\n })->all();\n })\n ->all();\n }",
"public function getRoutes($method = null)\n {\n if (null !== $method) {\n return (isset($this->routes[$method])) ? $this->routes[$method] : null;\n } else {\n return $this->routes;\n }\n }",
"public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}",
"private static function route($method, $request){\n\t\t $params = array(\n\t\t\t\t\t\t\t'splat' => array(),\n\t\t\t\t\t\t\t'captures' => array()\n\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t// If the HTTP method and the request exactly match an existing route,\n\t\t\tif(isset(self::$routes[$method][$request])){\n\t\t\t\n\t\t\t\t// Then we store the anonymous function defined for that route.\n\t\t\t\t$function = self::$routes[$method][$request];\n\t\t\t\n\t\t\t/*\tIf there is no exact match, we check to see if there are any routes that match when you treat\n\t\t\t\tthem as regexes. We also treat named parameter and splat segments as matches. */\n\t\t\t} elseif( ($route = self::reverse_preg_match_array($request, array_keys(self::$routes[$method]), array('#\\*(/|$)#', '/:[A-Za-z0-9]+/'))) && $route !== false ) {\n\t\t\t\n\t\t\t\t// If multiple matching routes were returned, we pick the last one.\n\t\t\t\t$route = end($route);\n\t\t\t\t\n\t\t\t\t// Once we've found the matching route, we retrieve and store its anonymous function.\n\t\t\t\t$function = self::$routes[$method][$route];\n\t\t\t\t\n\t\t\t\t/*\tNext, we need to construct the $params array to pass into the anonymous function. In\n\t\t\t\t\torder to do that, we need to extract all the path segments where the user's request\n\t\t\t\t\tmatched a regex pattern, named parameter, or splat segment. We call a helper\n\t\t\t\t\tfunction to extract these path segments for us. Since these path segments are the\n\t\t\t\t\tonly ones for which the request differs from the defined route, it's simple to\n\t\t\t\t\textract them. */\n\t\t\t\t$changes = self::url_diff($request, $route);\n\t\t\t\t\n\t\t\t\t// We go through each difference, and store the appropriate value in $params:\n\t\t\t\tforeach($changes as $change){\n\t\t\t\t\n\t\t\t\t\t// A difference is stored as an array that contains the route segment as its only key, with the corresponding request segment as the value.\n\t\t\t\t\tforeach($change as $index => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a named parameter (i.e. it starts with a colon ):\n\t\t\t\t\t\tif(preg_match('/^:/', $index)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Strip off the leading colon,\n\t\t\t\t\t\t\t$index = preg_replace('/^:/', '', $index);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// and add the key-value pair to the $params array.\n\t\t\t\t\t\t\t$params[$index] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a splat,\n\t\t\t\t\t\t} elseif ($index == '*'){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// add the request segment to the end of the $params['splat'] array.\n\t\t\t\t\t\t\t$params['splat'][] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the current route segment is a regex (or, if the request has more segments than the route\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// add the request segment to the end of the $params['captures'] array.\n\t\t\t\t\t\t\t$params['captures'][] = $value;\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// If we've found a matching route, then $function will already be set. If we haven't, we'll use the not_found function.\n\t\t\tif(!isset($function)){\n\t\t\t\t$function = self::$not_found;\n\t\t\t}\n\t\t\t\n\t\t\t// Return the function for matched route, and the $params to pass into it when executed. \n\t\t\treturn array($function, $params);\n\t\t}",
"public static function match($methods, $pattern, $callback)\n\t{\n\t\tforeach ($methods as $method) {\n\t\t\tself::route(strtoupper($method), $pattern, $callback);\n\t\t}\n\t}",
"public function getRouteMatch();",
"public static function getRoutes();",
"public static function getRoutes();",
"public function test_route_method_string() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );\n\t}",
"public function match($methods, $match, $rewrite = null, $closure = null);",
"public function match($requestUrl = null, $requestMethod = null)\n {\n\n $params = [];\n\n // set Request Url if it isn't passed as parameter\n if ($requestUrl === null) {\n $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';\n }\n\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n\n // Strip query string (?a=b) from Request Url\n if (($strpos = strpos($requestUrl, '?')) !== false) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n\n $lastRequestUrlChar = $requestUrl[strlen($requestUrl) - 1];\n\n // set Request Method if it isn't passed as a parameter\n if ($requestMethod === null) {\n $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n }\n\n foreach ($this->routes as $handler) {\n list($methods, $route, $target, $name) = $handler;\n\n $method_match = (stripos($methods, $requestMethod) !== false);\n\n if ($route === '*') {\n // * wildcard (matches all)\n $match = true;\n } elseif (isset($route[0]) && $route[0] === '@') {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif (($position = strpos($route, '[')) === false) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n // Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)\n if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position - 1] !== '/')) {\n continue;\n }\n\n $regex = $this->compileRoute($route);\n $match = preg_match($regex, $requestUrl, $params) === 1;\n }\n\n if ($match) {\n if ($params) {\n foreach ($params as $key => $value) {\n if (is_numeric($key)) {\n unset($params[$key]);\n }\n }\n }\n\n // Method did not match, continue to next route.\n if (!$method_match) {\n $this->methodError = true;\n continue;\n } else {\n $this->methodError = false;\n }\n\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name\n ];\n }\n }\n\n if ($this->methodError) {\n return self::METHOD_ERROR;\n } else {\n return self::NO_MATCH;\n }\n }",
"function match_and_exec($method, $path)\n {\n $possible_routes = $this->routes[$method];\n foreach($possible_routes as $route)\n {\n $result = $route->match($path);\n if (is_array($result) == false)\n {\n continue;\n }\n return $route->call($result);\n }\n return false;\n }",
"public function match($requestUrl = null, $requestMethod = null)\n {\n $params = [];\n // set Request Url if it isn't passed as parameter\n if ( $requestUrl === null ) {\n $requestUrl = Server::isSetted('REQUEST_URI') ? Server::get('REQUEST_URI') : '/';\n }\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n // Strip query string (?a=b) from Request Url\n if ( ($strpos = strpos($requestUrl, '?')) !== false ) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n $lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';\n // set Request Method if it isn't passed as a parameter\n if ( $requestMethod === null ) {\n $requestMethod = Server::isSetted('REQUEST_METHOD') ? Server::get('REQUEST_METHOD') : 'GET';\n }\n foreach ($this->routes as $handler) {\n list($methods,$route,$target,$name,$permissions) = $handler;\n $method = (stripos($methods,$requestMethod) !== false);\n // Method did not match, continue to next route.\n if ( !$method ) {\n continue;\n }\n if ( $route === '*' ) {\n // * wildcard (matches all)\n $match = true;\n } elseif ( isset($route[0]) && $route[0] === '@' ) {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif ( ($position = strpos($route, '[')) === false ) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n if ( strncmp($requestUrl,$route,$position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/') ) {\n continue;\n }\n $regex = $this->compileRoute($route);\n $match = preg_match($regex,$requestUrl,$params) === 1;\n }\n if ( $match ) {\n if ( $params ) {\n foreach ($params as $key => $value) {\n if ( TypeCheck::isInt($key) ) {\n unset($params[$key]);\n }\n }\n }\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name,\n 'permissions' => $permissions\n ];\n }\n }\n return false;\n }",
"public function test_route_method_array() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame(\n\t\t\t$routes['/test-ns/test'][0]['methods'],\n\t\t\tarray(\n\t\t\t\t'GET' => true,\n\t\t\t\t'POST' => true,\n\t\t\t)\n\t\t);\n\t}",
"public static function route();",
"public function test_match_withUnsupportedMethod()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertFalse(\n $route->match('POST', '/home'),\n 'match() must return false method provided is not supported by the route.'\n );\n }",
"static public function validUriMethodProvider()\n {\n return array(\n array('/foo', 'GET'),\n array('/', 'POST'),\n array('*', 'OPTIONS'),\n array('baz:1234', 'CONNECT'),\n array('http://example.com', 'GET'),\n array('/a/b/?d=e&f=g', 'FAKEMETHOD'),\n array('/some+encoded/%aa%bb%cc/text', 'HEAD')\n );\n }"
] | [
"0.76350987",
"0.72354025",
"0.71437126",
"0.6987343",
"0.6827819",
"0.6740208",
"0.6739182",
"0.6672395",
"0.6671263",
"0.6658784",
"0.66331995",
"0.6502796",
"0.6476182",
"0.6460012",
"0.64570296",
"0.6456512",
"0.642763",
"0.64084524",
"0.6405221",
"0.64032155",
"0.64032155",
"0.6388064",
"0.63579637",
"0.6321336",
"0.63109213",
"0.6307321",
"0.630189",
"0.62637687",
"0.6242444",
"0.62416023"
] | 0.7759646 | 0 |
Sets up the $categoryWithPermissions array Key is the category name Value is permission with dots | private static function setupCategoriesPermissions()
{
$result = [];
// Looping into userPermissions and getting the category as the key and the value as an array of permissions
foreach(self::$userPermissions as $userPermissionWithDots)
{
// checking if the permission has a menu category or not, it is separated in the DB with |
$userCategoryPermission = explode ('.',$userPermissionWithDots,2);
$userCategory = $userCategoryPermission[0];
// if the permission is without a dot then it is a category only
if(count($userCategoryPermission) > 1)
{
$userPermission = $userCategoryPermission[1];
}
else
{
$userPermission = '';
}
if(is_numeric($userPermission))
{
// If the permission is a number this means it is a role-manage permission
// Add it if the role is in the roles to manage array
if (in_array($userPermission, self::$rolesToManage))
{
$result[$userCategory][] = $userPermission;
}
}
else
{
$result[$userCategory][] = $userPermission;
}
}
self::$categoryWithPermissions = $result;
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store(Request $request)\n {\n $category=new User_category();\n\n $this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n ]);\n\n // User::create($request->all());\n\n\n $category->category_name=$request->input('name');\n $category->category_description=$request->input('description');\n $category->deleted=false;\n\n\n $category->save();\n $category_id=$category->user_category_id;\n\n if (isset($_POST['permissions'])) {\n foreach (($_POST['permissions']) as $permission){\n $perm=new Category_permission();\n $perm->category_id=$category_id;\n $perm->permission_id=$permission;\n $perm->deleted=false;\n $perm->save();\n }\n }\n\n\n // auth()->login();\n\n return redirect('/')->with('success','Category added');\n }",
"function publisher_saveCategoryPermissions($groups, $categoryid, $perm_name)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n\r\n $result = true;\r\n\r\n $module_id = $publisher->getModule()->getVar('mid');\r\n $gperm_handler = xoops_gethandler('groupperm');\r\n // First, if the permissions are already there, delete them\r\n $gperm_handler->deleteByModule($module_id, $perm_name, $categoryid);\r\n\r\n // Save the new permissions\r\n if (count($groups) > 0) {\r\n foreach ($groups as $group_id) {\r\n $gperm_handler->addRight($perm_name, $categoryid, $group_id, $module_id);\r\n }\r\n }\r\n return $result;\r\n}",
"private function updateCategoryAndChildrenForumPermissions($categoryId, $groupId, $permissions, $isAuthOnly) {\n $categoryIds = $this->myForumService->getCategoryIdsDownStream($categoryId);\n\n foreach ($categoryIds as $categoryId) {\n $forumPermission = ForumPermission::where('categoryId', $categoryId)->where('groupId', $groupId)->first();\n\n if ($forumPermission) {\n $forumPermission->permissions = $permissions;\n $forumPermission->isAuthOnly = $isAuthOnly;\n $forumPermission->save();\n } else {\n $forumPermission = new ForumPermission(\n [\n 'categoryId' => $categoryId,\n 'groupId' => $groupId,\n 'permissions' => $permissions,\n 'isAuthOnly' => $isAuthOnly\n ]\n );\n $forumPermission->save();\n }\n }\n }",
"function set_acl_category($category)\n {\n $this->acl_category = $category;\n foreach ($this->plugins as $name => $obj) {\n $this->plugins[$name]->set_acl_category($category);\n }\n }",
"public function savePermissions($permissions, $permissionSettings) {\n\t\t// create inserts\n\t\t$groupInserts = '';\n\t\tforeach ($permissions as $key => $permission) {\n\t\t\t// skip default values\n\t\t\t$noDefaultValue = false;\n\t\t\tforeach ($permission['settings'] as $value) {\n\t\t\t\tif ($value != -1) $noDefaultValue = true;\n\t\t\t}\n\t\t\tif (!$noDefaultValue) {\n\t\t\t\tunset($permissions[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!empty($groupInserts)) $groupInserts .= ',';\n\t\t\t$groupInserts .= '('.$this->categoryID.',\n\t\t\t\t\t '.intval($permission['id']).',\n\t\t\t\t\t '.(implode(', ', ArrayUtil::toIntegerArray($permission['settings']))).')';\n\t\t}\n\t\t\n\t\tif (!empty($groupInserts)) {\n\t\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_linklist_category_to_group\n\t\t\t\t\t\t(categoryID, groupID, \".implode(', ', $permissionSettings).\")\n\t\t\t\tVALUES\t\t\".$groupInserts;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t}",
"public function addMultipleCategoriesToGroup();",
"private function buildForumPermissions($permissions) {\n $forumPermissions = [];\n\n if (!isset($permissions)) {\n return $forumPermissions;\n }\n\n foreach (CategoryPermissions::getAsOptions() as $key => $value) {\n $forumPermissions[$key] = $permissions->permissions & $value;\n }\n\n return $forumPermissions;\n }",
"public function createCategory();",
"public function setPermissions($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->permissions = $arr;\n\n return $this;\n }",
"function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }",
"public function update(Request $request, $id)\n {\n\n $category=User_category::find($id);\n\n $this->validate(request(),[\n 'name'=>'required',\n 'description'=>'required',\n ]);\n\n // User::create($request->all());\n\n\n $category->category_name=$request->input('name');\n $category->category_description=$request->input('description');\n $category->deleted=false;\n\n\n $category->save();\n //$category_id=$category->user_category_id;\n\n if (isset($_POST['permissions'])) {\n foreach (($_POST['permissions']) as $permission){\n $perm=new Category_permission();\n $perm->category_id=$id;\n $perm->permission_id=$permission;\n $perm->deleted=false;\n $perm->save();\n }\n }\n\n\n // auth()->login();\n\n return redirect('/')->with('success','Category updated');\n\n\n }",
"public function setPermissions($permissions) {}",
"function createCategories()\n {\n $currentCategories = $this->loadCategories();\n\n foreach ($this->categories as $category)\n {\n // Skip adding category if it already exists\n if (in_array($category, $currentCategories))\n {\n continue;\n }\n\n // Create a copy of the template array for category properties\n $data = array_merge($this->categoryTemplate);\n\n // Set the category description from the translation key in en-GB.com_cajobboard.sys.ini\n // remove any spaces from the category title when building the translation key\n $data['title'] = Text::_('COM_CAJOBBOARD_CATEGORY_TITLE_' . strtoupper(str_replace(' ', '', $category)));\n\n $data['description'] = $data['title'];\n\n // Initialize a new category\n $category = Table::getInstance('Category');\n\n // Bind passed category parameters to Category model\n $category->bind($data);\n\n // setLocation(integer $referenceId, string $position = 'after')\n $category->setLocation($category->getRootId(), 'last-child');\n\n // Check to make sure our data is valid. check() will auto generate alias if not set above.\n if (!$category->check())\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Store the category\n if (!$category->store(true))\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Build the path for our category and set it in the database\n $category->rebuildPath($category->id);\n }\n\n Table::getInstance('Category')->rebuild();\n }",
"public function getPermissionArrayToNameWise($permission = []) {\n $data = [];\n if(!empty($permission)) {\n foreach ($permission as $permission_key => $permission_array) {\n foreach ($permission_array as $permission_name => $permission_value) {\n $permi = explode('.', $permission_value);\n $data[$permi[0]][$permission_name] = array(\n 'permission' => base64_encode($permission_value),\n 'label' => $permi[1],\n 'can_inherit' => -1,\n );\n //$data[$permi[0]][$permi[1]] = -1; //inherit\n //$data[$permi[0]][$permi[1]] = base64_encode($permi[1]); //inherit\n }\n }\n }\n return $data;\n }",
"public function __construct() {\n $perm_data = 'data/permissions.json';\n if(file_exists($perm_data)) {\n $list = json_decode(file_get_contents($perm_data), true);\n foreach($list as $groupname => $group) {\n if(isset($group['inherit'])) {\n $group['permissions'] = array_merge(\n $group['permissions'],\n $list[$group['inherit']]['permissions']\n );\n }\n $this->permissions[$groupname] = $group['permissions'];\n $this->display_names[$groupname] = $group['display_name'];\n }\n }\n }",
"private function packCategory()\n {\n /** @var modCategory $category */\n $category = $this->modx->newObject('modCategory');\n $category->set('category', self::PKG_NAME);\n\n $this->packCategoryElements($category, 'plugins');\n\n $this->builder->putVehicle($this->builder->createVehicle($category, [\n xPDOTransport::UNIQUE_KEY => 'category',\n xPDOTransport::PRESERVE_KEYS => false,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::RELATED_OBJECTS => true,\n xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [\n 'Plugins' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => 'name'\n ],\n 'PluginEvents' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => ['pluginid','event'],\n ]\n ]\n ]));\n }",
"private function process_permission_array(Request $request, &$temp_permission){\n if($request->permission !== null){\n $checkbox_values = array_map('intval', $request->permission);\n foreach($checkbox_values as $value){\n $checkbox_values = array_map('intval', $request->permission);\n\n $temp_permission[$value] = \"1\";\n \n }\n }\n $temp_permission = implode(',',$temp_permission);\n }",
"function set_rights_of_cat($p_catid, $p_suggest_right, $p_suggest_group_right, &$p_changed){\n// Hauptprozedur. Diese wird aufgerufen um die Rechte einer Kategorie zu setzen, inklusive deren Unterkategorien.\n// $p_catid = KategorienID, welche gesetzt werden soll.\n// $p_suggested_right = Die rechte welche gesetzt werden sollen.\n// $p_changed = Anzahl der Korrekturen oder (-1): Gewuenschte aenderung war nicht zulaessig! \n $database = &JFactory::getDBO();\n // Kategorie laden aus Datenbank.\n $l_sql = \"SELECT parent_id, cat_access, cat_group_access FROM #__jdownloads_cats WHERE cat_id = \".$p_catid;\n $database->setQuery($l_sql);\n $l_catrow = $database->loadObjectList();\n if (!isset($l_catrow[0]) && ($p_catid > 0)){\n // Die Kategorie existiert nicht. Nicht weiterfahren.\n return '';\n }\n // Urspruengliche Rechte der Kategorie lesen.\n $l_rights_from = $l_catrow[0]->cat_access;\n //$l_rights_from_group = $l_catrow[0]->cat_group_access;\n if ($l_catrow[0]->parent_id == 0){\n // Es ist eine Hauptkategorie. Darueberliegende Kategorien muessen nicht nach niedrigen Rechten durchsucht werden.\n $l_rights_to_set = $p_suggest_right;\n } else {\n // Es ist eine Unterkategorie. Darueberliegenden Kategoriebaum nach niedrigen Rechten (=hoeherer Wert) durchsuchen.\n // Damit wird gewaehrleitet, dass eine Unterkategorie keine hoeheren Rechte erhalten kann.\n $l_rights_to_set = get_lowest_rights($p_catid, $p_suggest_right);\n if ($l_rights_to_set > $p_suggest_right) $p_changed = -1;\n }\n // Die Rechte der Kategorie und aller Unter- und Unter-Unter-Kategorien setzen.\n set_rights_to_tree($p_catid, $l_rights_to_set, $l_rights_from, $p_suggest_group_right, $p_changed);\n}",
"public function run()\n {\n $permission = [\n // [\n // 'name' => 'user-list',\n // 'display_name' => 'List Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-create',\n // 'display_name' => 'Create Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-edit',\n // 'display_name' => 'Edit Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-delete',\n // 'display_name' => 'Delete Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-list',\n // 'display_name' => 'List roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-create',\n // 'display_name' => 'Create roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-edit',\n // 'display_name' => 'Edit roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-delete',\n // 'display_name' => 'Delete roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-list',\n // 'display_name' => 'List Question Categories',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-create',\n // 'display_name' => 'Create Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-edit',\n // 'display_name' => 'Edit Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-delete',\n // 'display_name' => 'Delete Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-list',\n // 'display_name' => 'List Questions',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-create',\n // 'display_name' => 'Create Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-edit',\n // 'display_name' => 'Edit Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-delete',\n // 'display_name' => 'Delete Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-list',\n // 'display_name' => 'List Exams',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-create',\n // 'display_name' => 'Create Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-edit',\n // 'display_name' => 'Edit Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-delete',\n // 'display_name' => 'Delete Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n [\n 'name' => 'group-list',\n 'display_name' => 'List Groups',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-create',\n 'display_name' => 'Create Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-edit',\n 'display_name' => 'Edit Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-delete',\n 'display_name' => 'Delete Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-list',\n 'display_name' => 'List Teams',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-create',\n 'display_name' => 'Create Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-edit',\n 'display_name' => 'Edit Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-delete',\n 'display_name' => 'Delete Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n ];\n\n foreach ($permission as $key => $value) {\n Permission::create($value);\n }\n }",
"public function create(Request $request)\n {\n //\n $roles_permission = RolesPermission::where('role_id', Auth::user()->role_id)->get();\n $rolespermission = [];\n foreach ($roles_permission as $rolepermission) {\n array_push($rolespermission, $rolepermission->permission_id);\n }\n if (in_array(10, $rolespermission)) {\n\n $data = $this->validate($request, [\n 'category_id' => 'required',\n ]);\n\n $setting = Setting::first();\n $category = Category::findorfail($data['category_id']);\n return view('backend.subcategories.create', compact('category', 'setting'));\n\n } else {\n return view('backend.permissions.permission');\n }\n }",
"function setPermissions($component, $group, $actions, $permissions)\n\t{\n\t\t$this->jClick($component);\n\t\tif ($component == 'Global Configuration')\n\t\t{\n\t\t\t$this->click('permissions');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->jClick('Options');\n\t\t\t$this->click(\"//dt[contains(span,'Permissions')]\");\n\t\t}\n\t\tif (!is_array($actions)) {\n\t\t\t$actions = array($actions);\n\t\t}\n\t\tif (!is_array($permissions)) {\n\t\t\t$permissions = array($permissions);\n\t\t}\n\t\techo \"Open panel for group '$group'\\n\";\n\t\t$this->click(\"//ul[@id='rules']//li/div[@class='panel']//h3[contains(.,'$group')]\");\n\n\t\tfor ($i = 0; $i < count($actions); $i++) {\n\t\t\t$action = $actions[$i];\n\t\t\t$permission = $permissions[$i];\n\t\t\techo \"Setting $action action for $group to $permission in $component.\\n\";\n\t\t\tswitch ($action)\n\t\t\t{\n\t\t\t\tcase 'Site Login':\n\t\t\t\t\t$doAction = 'login.site';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Admin Login':\n\t\t\t\t\t$doAction = 'login.admin';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Configure':\n\t\t\t\tcase 'Super Admin':\n\t\t\t\t\t$doAction = 'core.admin';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Access Component':\n\t\t\t\t\t$doAction = 'core.manage';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Create':\n\t\t\t\t\t$doAction = 'create';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Delete':\n\t\t\t\t\t$doAction = 'delete';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit':\n\t\t\t\t\t$doAction = 'edit';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit State':\n\t\t\t\t\t$doAction = 'edit.state';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Edit Own':\n\t\t\t\t\t$doAction = 'edit.own';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->select(\"//select[contains(@id,'$doAction')][contains(@title,'$group')]\", \"label=$permission\");\n\t\t}\n\n\t\techo \"Close panel for group '$group'\\n\";\n\t\t$this->click(\"//ul[@id='rules']//li/div[@class='panel']//h3[contains(.,'Public')]\");\n\n\t\tif ($component == 'Global Configuration') {\n\t\t\t$this->click(\"//li[@id='toolbar-save']/a/span\");\n\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\ttry {\n\t\t\t\t$this->assertTrue($this->isElementPresent(\"//dl[@id='system-message'][contains(., 'success')]\"));\n\t\t\t}\n\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Need to click the Save & Close button\n\t\t\t$this->click(\"//button[contains(text(),'Save')][contains(text(),'Close')]\");\n\t\t\tfor ($second = 0; ; $second++) {\n\t\t\t\tif ($second >= 60) $this->fail(\"timeout\");\n\t\t\t\ttry {\n\t\t\t\t\tif (!$this->isElementPresent(\"//dl[contains(@id, 'configuration')]\")) break;\n\t\t\t\t} catch (Exception $e) {}\n\t\t\t\tsleep(1);\n\t\t\t}\n\t\t}\n\t}",
"function _make_cat_compat(&$category)\n {\n }",
"function forum_group_permissions( $perms ){\n\t$perms[ 'forum' ] = 'Can Post to Forum';\n\t$perms[ 'forum_moderate' ] = 'Can Moderate Forum';\n\treturn $perms;\n}",
"public function registerPermissions()\n {\n return []; // Remove this line to activate\n\n return [\n 'milo.food.some_permission' => [\n 'tab' => 'Food',\n 'label' => 'Some permission'\n ],\n ];\n }",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function setPermissions($permissions);"
] | [
"0.5981092",
"0.597878",
"0.58900464",
"0.5832863",
"0.5684485",
"0.56338066",
"0.5620916",
"0.555938",
"0.5548968",
"0.5526383",
"0.53283894",
"0.5316216",
"0.53121877",
"0.530834",
"0.53014857",
"0.5289787",
"0.52774435",
"0.5274407",
"0.5219961",
"0.5214245",
"0.52108973",
"0.52048737",
"0.5199108",
"0.5185846",
"0.5170143",
"0.5170143",
"0.5170143",
"0.5170143",
"0.5170143",
"0.5162537"
] | 0.7674575 | 0 |
Widgets for current permission level Uses the role id to get all widgets linked to the role | public static function getAllowedWidgets($roleId = null)
{
if(is_null($roleId))
$roleId = session('admin.user.role_id');
// Getting an array of the widgets allowed to the current role_id
$allowedWidgets = PermissionModel::where('role_id', $roleId)
->where('permission', 'like', 'widgets.%')
->get()
->pluck('permission')
->map(function($permission){ return explode('.', $permission)[1];})
->toArray();
// Searching the widgets for the widget title and getting its role_widget data too
$widgetsWithRoleWidgets = self::getWidgetsWithRoleWidgets($allowedWidgets, $roleId);
return $widgetsWithRoleWidgets;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function roles_dashboard_update_widget_definitions() {\n\n\t$widget_types = elgg_get_widget_types('all', true);\n\tforeach ($widget_types as $handler => $options) {\n\t\t$context = $options->context;\n\t\t$context[] = 'dashboard';\n\t\t$context = array_unique($context);\n\t\telgg_register_widget_type($handler, $options->name, $options->description, $context, $options->multiple);\n\t}\n\n\t$roles = roles_get_all_selectable_roles();\n\n\t$widget_types = elgg_get_widget_types('dashboard', true);\n\tforeach ($widget_types as $handler => $options) {\n\t\t$context = $options->context;\n\t\tforeach ($roles as $role) {\n\t\t\t$context[] = \"role::{$role->name}\";\n\t\t}\n\t\t$context = array_unique($context);\n\t\telgg_register_widget_type($handler, $options->name, $options->description, $context, $options->multiple);\n\t}\n}",
"private function getWidgets()\n {\n /* Config: menu widget,metodo getGonfig\n * $this->widget\n *\n * Content: array(widget,metodo,);\n */\n\n /*\n * 'config' => $this->widget('menu', 'getConfig', array('perfil-img')),\n * ** array('perfil-img') == array de la posicion y la visibilidad **\n */\n\n /*\n * 'content' => array('menu', 'getMenu', array('perfil-img', 'perfil-img')),\n * ** array('perfil-img', 'perfil-img') ==\n */\n $db = new Database(DB_HOST, DB_NAME, DB_USER, DB_PASS, DB_CHAR);\n $query = $db->query(\"SELECT * FROM \" . DB_PREFIJO . \"widgets\");\n $widget = $query->fetchAll(PDO::FETCH_OBJ);\n $widgets = array();\n foreach ($widget as $key => $valor) {\n $widgets[$valor->nombre] = array('config' => $this->widget('menu', 'getConfig', array($valor->nombre)), 'content' => array('menu', 'getMenu', array($valor->nombre, $valor->view)),);\n }\n $positions = $this->getLayoutPositions();\n $keys = array_keys($widgets);\n foreach ($keys as $k) {\n /* verificar si la posicion del widget esta presente */\n if (isset($positions[$widgets[$k]['config']['position']])) {\n /* verificar si esta deshabilitado para la vista */\n if (!isset($widgets[$k]['config']['hide']) || !in_array(self::$_item, $widgets[$k]['config']['hide'])) {\n /* verificar si esta habilitado para la vista */\n if ($widgets[$k]['config']['show'] === 'all' || in_array(self::$_item, $widgets[$k]['config']['show'])) {\n if (isset($this->_widget[$k])) {\n $widgets[$k]['content'][2] = $this->_widget[$k];\n }\n /* llenar la posicion del layout */\n $positions[$widgets[$k]['config']['position']][] = $this->getWidgetContent($widgets[$k]['content']);\n\n }\n }\n }\n }\n return $positions;\n }",
"protected function retrieve_widgets()\n {\n }",
"protected function retrieve_widgets()\n {\n }",
"public function widgets($params) {\n include_once 'common/widget/WidgetLayoutManager.class.php';\n if ($params['owner_type'] == WidgetLayoutManager::OWNER_TYPE_USER) {\n if ($this->_userCanViewWidget('admindelegation')) {\n include_once 'AdminDelegation_UserWidget.class.php';\n $params['codendi_widgets'][] = 'admindelegation';\n }\n if ($this->_userCanViewWidget('admindelegation_projects')) {\n include_once 'AdminDelegation_ShowProjectWidget.class.php';\n $params['codendi_widgets'][] = 'admindelegation_projects';\n }\n }\n }",
"public function widget_privileges()\n {\n $site_id = Model_Site::current()->id;\n if ($site_id === NULL)\n {\n return $this->_widget_error('Выберите портал!');\n }\n\n $order_by = $this->request->param('acl_prorder', 'position');\n $desc = (bool) $this->request->param('acl_prdesc', '0');\n\n $privileges = Model::fly('Model_Privilege')->find_all_by_site_id($site_id, array(\n 'order_by' => $order_by,\n 'desc' => $desc\n ));\n\n // Set up view\n $view = new View('backend/privileges');\n\n $view->order_by = $order_by;\n $view->desc = $desc;\n\n $view->privileges = $privileges;\n\n return $view->render();\n }",
"protected function get_widgets()\n {\n }",
"public function get_available_widgets()\n {\n }",
"public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}",
"private static function getWidgetsWithRoleWidgets($widgets, $roleId)\n\t{\n\t\t$resultArray = [];\n\n\t\t$widgetsWithRoleWidgets = WidgetModel::whereIn('title', $widgets)\n\t\t\t->with(['RoleWidget' => function($q) use ($roleId){\n\t\t\t\t$q->where('role_id', $roleId);\n\t\t\t}])\n\t\t\t->get()\n\t\t\t->toArray();\n\n\t\t// Handling multiple routes per widget\n\t\tarray_map(function($widget) use(&$resultArray){\n\t\t\t$explodedRoutes = explode(',', $widget['routes']);\n\n\t\t\t// If the widget has many routes i.e. comma separated values\n\t\t\tif( count($explodedRoutes) > 1)\n\t\t\t{\n\t\t\t\t// Explode them and create a new item per widget with the new route\n\t\t\t\tforeach ($explodedRoutes as $route)\n\t\t\t\t{\n\t\t\t\t\t$widget['routes'] = $route;\n\t\t\t\t\t$resultArray[] = $widget;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\t$resultArray[] = $widget;\n\t\t}, $widgetsWithRoleWidgets);\n\n\n\t\t// Array Map to remove un-related role_widgets\n\t\t$resultArray = array_map(function($widgetWithRoleWidget){\n\t\t\t$currectRoute = $widgetWithRoleWidget['routes'];\n\n\t\t\t// If there is many role_widgets we need to delete the ones that is not related to the route of the current widget\n\t\t\tif(count($widgetWithRoleWidget['role_widget']) > 1)\n\t\t\t\t// Looping in the role_widget array that comes from the widgets->with('role_widget')\n\t\t\t\tforeach($widgetWithRoleWidget['role_widget'] as $key=>$roleWidget)\n\t\t\t\t\t// If the role_widget has different route than the one we are handling then remove it\n\t\t\t\t\tif($roleWidget['route'] != $currectRoute)\n\t\t\t\t\t\t// Removing un-related role_widget since it has a wrong order and is causing issues\n\t\t\t\t\t\tunset($widgetWithRoleWidget['role_widget'][$key]);\n\n\t\t\t// Rebasing the array $widgetWithRoleWidget['role_widget'] because some items were removed\n\t\t\t$widgetWithRoleWidget['role_widget'] = array_values($widgetWithRoleWidget['role_widget']);\n\t\t\treturn $widgetWithRoleWidget;\n\t\t},$resultArray);\n\n\t\treturn $resultArray;\n\t}",
"public function widgets()\n {\n\t\t//Many To Many (Polymorphic)\n return $this->morphToMany(Widget::class, 'widgetable');\n }",
"function roles_dashboard_default_widget_contexts($hook, $type, $return, $params) {\n\n\t$roles = roles_get_all_selectable_roles();\n\tif (empty($roles)) {\n\t\treturn;\n\t}\n\n\tforeach ($roles as $role) {\n\t\t// We are not configuring the event information here as we will need to apply some custom logic,\n\t\t// i.e. check relationship between a specific role and a dashboard\n\t\t// @see roles_dashboard_create_default_widgets\n\t\t$return[] = array(\n\t\t\t'name' => $role->getDisplayName(),\n\t\t\t'widget_context' => \"role::{$role->name}\",\n\t\t\t'widget_columns' => ROLES_DASHBOARD_NUM_COLUMNS,\n\t\t);\n\t}\n\n\treturn $return;\n}",
"public function uultra_get_custom_widgets_membership($package_id)\r\n\t{\t\t\r\n\t\t\r\n\t\tif(!get_option('userultra_custom_user_widgets_package_'.$package_id.''))\r\n\t\t{\r\n\t\t\t$custom_widgets = get_option('userultra_custom_user_widgets');\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$custom_widgets = get_option('userultra_custom_user_widgets_package_'.$package_id.'');\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $custom_widgets;\r\n\t\t\r\n\t\r\n\t}",
"function get_list_widget_admin()\n {\n global $active_modules;\n\n $result = [];\n /**\n * List widgets of Admin\n */\n $result['Admin'] = config('Admin::widget.admin');\n\n /**\n * List widgets of Modules\n */\n if ($active_modules) {\n foreach ($active_modules as $mod) {\n $result[$mod] = config($mod . '::widget.admin');\n }\n }\n\n return $result;\n }",
"public function eventRmcommonDashboardRightWidgets(){\n global $xtAssembler, $xtFunctions;\n\n if (!isset($GLOBALS['xtAssembler']))\n $xtAssembler = new XtAssembler();\n\n if ( !$xtAssembler->isSupported() )\n return;\n\n $theme = $xtAssembler->theme();\n\n RMTemplate::get()->add_style('rmc-dashboard.css', 'xthemes');\n\n ?>\n <div class=\"cu-box\">\n <div class=\"box-header\">\n <span class=\"fa fa-caret-up box-handler\"></span>\n <h3><?php _e('Appearance','rmcommon'); ?></h3>\n </div>\n <div class=\"box-content collapsable\" id=\"xthemes-options\">\n <img src=\"<?php echo XOOPS_THEME_URL; ?>/<?php echo $theme->getInfo('dir'); ?>/<?php echo $theme->getInfo('screenshot'); ?>\" class=\"img-thumbnail\">\n <ul class=\"nav nav-pills nav-justified nav-options\">\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/themes.php\" title=\"<?php _e('Manage Themes', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-th-large\"></span>\n </a>\n </li>\n <?php if(method_exists($theme, 'controlPanel')): ?>\n <li>\n <a rel=\"tooltip\" href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/theme.php\" title=\"<?php echo sprintf(__('%s Control Panel', 'xthemes'), $theme->getInfo('name')); ?>\">\n <span class=\"fa fa-dashboard\"></span>\n </a>\n </li>\n <?php endif; ?>\n <?php if($xtAssembler->rootMenus()): ?>\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/navigation.php\" title=\"<?php _e('Menu Maker', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-bars\"></span>\n </a>\n </li>\n <?php endif; ?>\n <?php if($theme->options()): ?>\n <li>\n <a href=\"<?php echo XOOPS_URL; ?>/modules/xthemes/settings.php\" title=\"<?php _E('Theme Settings', 'xthemes'); ?>\" rel=\"tooltip\">\n <span class=\"fa fa-wrench\"></span>\n </a>\n </li>\n <?php endif; ?>\n </ul>\n <small><?php echo $theme->getInfo('description'); ?></small>\n <?php if( $theme->getInfo('social') ): ?>\n <hr>\n <ul class=\"nav nav-pills xthemes-social\">\n <?php foreach( $theme->getInfo('social') as $type => $link ): ?>\n <li>\n <a href=\"<?php echo $link; ?>\" target=\"_blank\">\n <?php echo $xtFunctions->social_icon( $type ); ?>\n </a>\n </li>\n <?php endforeach; ?>\n </ul>\n <?php endif; ?>\n </div>\n </div>\n <?php\n }",
"public function getWidgets()\n {\n return $this->widgets;\n }",
"public function getWidgets()\n {\n return $this->_widgets;\n }",
"public function getWidgets()\n\t\t{\n\t\t\tif(!isset($this->id))\n\t\t\t\treturn FALSE;\n\t\t\t\n\t\t\tglobal $conn;\n\t\t\tglobal $SERVICENTER_WIDGETS;\n\t\t\t\n\t\t\t$g = $conn->prepare(\"SELECT position,widget FROM ServiCenter_Workspace_Widget WHERE workspace = ?\");\n\t\t\t$g->bindParam(1, $this->id);\n\t\t\t$g->execute();\n\t\t\t\n\t\t\t$widgets = [];\n\t\t\t\n\t\t\tforeach($g->fetchAll() as $widgetData)\n\t\t\t{\n\t\t\t\tif(isset($SERVICENTER_WIDGETS[$widgetData['widget']]))\n\t\t\t\t{\n\t\t\t\t\t$widgets[] = [$widgetData['position'], $SERVICENTER_WIDGETS[$widgetData['widget']][0]];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $widgets;\n\t\t}",
"function getWidgets() {\n \t$returnArray = array();\n \tforeach($this->_widgetRegistry as $name => $item) {\n \t\t$returnArray[] = array('name' => $name, 'description' => $item['description']);\n \t}\n \treturn $returnArray;\n }",
"public function get_profile_widgets()\r\n\t{\r\n\t\t\r\n\t\tglobal $xoouserultra;\r\n\t\t\r\n\t\t$user_id = get_current_user_id();\r\n\t\t\r\n\t\t$widgets = array();\r\n\t\t\r\n\t\t//get user package id\r\n\t\t$package_id = get_user_meta($user_id, 'usersultra_user_package_id', true);\r\n\t\t\r\n\t\tif($package_id!='') //user is under a membership pacakge\r\n\t\t{\r\n\t\t\t//get package\r\n\t\t\t$package = $xoouserultra->paypal->get_package($package_id);\r\n\t\t\t\r\n\t\t\t//get widgets layout for this package\r\n\t\t\t$widgets = get_option('userultra_default_user_tabs_package_'.$package_id.'');\r\n\t\t\t\r\n\t\t\t//custom layout package\r\n\t\t\t$custom_package_layout = true;\r\n\t\t\t\t\t\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$custom_package_layout = false;\t\t\t\t\t\t\r\n\t\t\t$widgets = get_option('userultra_default_user_tabs');\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$html = '';\r\n\t\tforeach($widgets as $key => $widget)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//check if is in column\t\t\t\r\n\t\t\tif($this->check_if_active($key))\r\n\t\t\t{\r\n\t\t\t\tif(!$this->uultra_check_if_unused_widget($key) && !$custom_package_layout)\r\n\t\t\t\t{\r\n\t\t\t\r\n\t\t\t\t\t$html .= '<li class=\"uultra-profile-widget ui-state-default rounded\" id=\"'.$key.'\"><a class=\"uultra-btn-widget-elements\" href=\"#\" widget-id=\"'.$key.'\"><span><i class=\"fa '.$widget[\"icon\"].' fa-2x\"></i></span>'.$widget[\"title\"].' <span class=\"uultra-widgets-icon-close-open\" id=\"uultra-widgets-icon-close-open-id-'.$key.'\" style=\"background-position: 0px 0px;\" widget-id=\"'.$key.'\"></span></a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '<div id=\"uultra-widget-adm-cont-id-'.$key.'\" class=\"uultra-widget-user-options-cont\" style=\"display:none\">';\r\n\t\t\t\t\t//get widget options\t\t\t\t\t\r\n\t\t\t\t\t$html .= $this->get_widget_customization_options($key);\r\n\t\t\t\t\t$html .= '</div>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$html .= '</li>';\r\n\t\t\t\t\t\r\n\t\t\t\t}elseif(!$this->uultra_check_if_unused_widget_settings($key, $package_id) && $custom_package_layout){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '<li class=\"uultra-profile-widget ui-state-default rounded\" id=\"'.$key.'\"><a class=\"uultra-btn-widget-elements\" href=\"#\" widget-id=\"'.$key.'\"><span><i class=\"fa '.$widget[\"icon\"].' fa-2x\"></i></span>'.$widget[\"title\"].' <span class=\"uultra-widgets-icon-close-open\" id=\"uultra-widgets-icon-close-open-id-'.$key.'\" style=\"background-position: 0px 0px;\" widget-id=\"'.$key.'\"></span></a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$html .= '<div id=\"uultra-widget-adm-cont-id-'.$key.'\" class=\"uultra-widget-user-options-cont\" style=\"display:none\">';\r\n\t\t\t\t\t//get widget options\t\t\t\t\t\r\n\t\t\t\t\t$html .= $this->get_widget_customization_options($key);\r\n\t\t\t\t\t$html .= '</div>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$html .= '</li>';\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\treturn $html;\r\n\t\t\r\n\t}",
"function roles_dashboard_create_default_widgets($event, $type, $entity) {\n\n\tif ($entity->getSubtype() != MultiDashboard::SUBTYPE) {\n\t\treturn;\n\t}\n\n\t$default_widget_info = elgg_get_config('default_widget_info');\n\n\tif (!$default_widget_info || !$entity->roles_context) {\n\t\treturn;\n\t}\n\n\t// need to be able to access everything\n\t$ia = elgg_set_ignore_access(true);\n\telgg_push_context('create_default_widgets');\n\n\t// pull in by widget context with widget owners as the site\n\t// not using elgg_get_widgets() because it sorts by columns and we don't care right now.\n\t$options = array(\n\t\t'type' => 'object',\n\t\t'subtype' => 'widget',\n\t\t'owner_guid' => elgg_get_site_entity()->guid,\n\t\t'private_setting_name' => 'context',\n\t\t'private_setting_value' => $entity->roles_context,\n\t\t'limit' => 0\n\t);\n\n\t$widgets = elgg_get_entities_from_private_settings($options);\n\t/* @var \\ElggWidget[] $widgets */\n\n\tforeach ($widgets as $widget) {\n\t\t// change the container and owner\n\t\t$new_widget = clone $widget;\n\t\t$new_widget->container_guid = $entity->owner_guid;\n\t\t$new_widget->owner_guid = $entity->owner_guid;\n\n\t\t// pull in settings\n\t\t$settings = get_all_private_settings($widget->guid);\n\n\t\tforeach ($settings as $name => $value) {\n\t\t\t$new_widget->$name = $value;\n\t\t}\n\n\t\tif ($new_widget->save()) {\n\t\t\t// Add to dashboard\n\t\t\tadd_entity_relationship($new_widget->guid, MultiDashboard::WIDGET_RELATIONSHIP, $entity->guid);\n\t\t}\n\t}\n\n\twidget_manager_update_fixed_widgets($entity->roles_context, $entity->owner_guid);\n\n\telgg_set_ignore_access($ia);\n\telgg_pop_context();\n}",
"function wp_list_widgets()\n {\n }",
"public function get_widgets() {\n\n $sidebar_name = sidebar\\Sidebar::get_sidebar_name();\n \n global $wp_registered_widgets;\n\n $sidebars_widgets = get_option( 'sidebars_widgets' );\n\n $sidebar_widgets = [];\n if ( array_key_exists( $sidebar_name, $sidebars_widgets ) ) {\n\n foreach( $sidebars_widgets[$sidebar_name] as $key => $value ) {\n $widget_id = $value;\n $widget_parts = explode( '-', $widget_id );\n $widget_base_id = $widget_parts[0];\n $widget_number = $widget_parts[1];\n $options = get_option( 'widget_' . $widget_base_id );\n\n $widget_title = '';\n if ( is_array( $options[$widget_number] ) ) {\n\n if ( array_key_exists( 'title', $options[$widget_number] ) && !empty( $options[$widget_number]['title'] ) ) {\n $widget_title = $options[$widget_number]['title'];\n }\n else {\n foreach ( $wp_registered_widgets as $w => $rwidget ) {\n if ( $w == $widget_id ) {\n $widget_title = $rwidget['name']; \n }\n else {\n if ($widget_title == '') {\n $widget_title = $widget_id; \n }\n }\n }\n }\n }\n $sidebar_widgets[] = [ $widget_id => $widget_title ];\n }\n\n }\n\n \n return $sidebar_widgets;\n\n }",
"public function getPermissionByRoleID($id);",
"public function getWidgets(){\n $return = [];\n foreach ($this->widgets as $key => $value) {\n $namespance = str_replace([base_path(\"modules\"),base_path(\"contents/templates\"),'.php','/'], ['Modules','Themes','','\\\\'], $value);\n $namespance = str_replace('Themes\\default', 'Themes\\_default', $namespance);\n if(class_exists($namespance) && method_exists($namespance, \"register\")){\n $paths = str_replace(base_path().'/','',$value);\n $ado = [];\n $ado = with(new $namespance)->register();\n $ado[\"paths\"] = $paths;\n $return[$namespance] = $ado;\n }\n }\n return $return;\n }",
"public function getRolePermissions($role_id)\r\n {\r\n $permissions = $this->AdminRoleModel->getPermissions($role_id);\r\n echo $this->load->view('admin/roles/permissions-select', compact('permissions'), TRUE);\r\n }",
"function portal_add_dashboard_widgets() {\n\n if(current_user_can('publish_portal_projects')) {\n\n wp_add_dashboard_widget(\n 'portal_dashboard_overview', // Widget slug.\n 'Projects', // Title.\n 'portal_dashboard_overview_widget_function' // Display function.\n );\n\n\t\twp_add_dashboard_widget(\n\t\t\t'portal_dashboard_timing',\n\t\t\t'Project Calendar',\n\t\t\t'portal_dashboard_calendar_widget'\n\t\t);\n\n }\n\n}",
"public function getWidgetMenu(){\n $layout = $this->getLayout();\n $widgetType = Yii::app()->controller instanceof TopicsController ?\n 'topics' : 'recordView';\n $layoutName = $widgetType.'WidgetLayout';\n $recordViewWidgetLayout = $this->$layoutName;\n\n $hiddenRecordViewWidgetMenu = '';\n foreach ($recordViewWidgetLayout as $widgetClass => $settings) {\n if ($settings['hidden']) {\n $hiddenRecordViewWidgetMenu .=\n '<li>\n <span class=\"x2-hidden-widgets-menu-item '.$widgetType.'-widget\" \n id=\"'.$widgetClass.'\">'.\n CHtml::encode ($settings['label']).\n '</span>\n </li>';\n }\n }\n\n // used to determine where section dividers should be placed\n $hiddenCenter = $hiddenRecordViewWidgetMenu !== '';\n $hiddenRight = !empty ($layout['hiddenRight']);\n\n $menu = '<div id=\"x2-hidden-widgets-menu\">';\n $menu .= '<ul id=\"x2-hidden-recordView-widgets-menu\" \n class=\"x2-hidden-widgets-menu-section\">';\n $menu .= $hiddenRecordViewWidgetMenu;\n $menu .= '</ul>';\n $menu .= '<ul id=\"x2-hidden-right-widgets-menu\" class=\"x2-hidden-widgets-menu-section\">';\n $menu .= '<li '.(($hiddenCenter && $hiddenRight) ? '' : 'style=\"display: none;\"').\n 'class=\"x2-hidden-widgets-menu-divider\"></li>';\n foreach($layout['hiddenRight'] as $name => $widget){\n $menu .= '<li><span class=\"x2-hidden-widgets-menu-item widget-right\" id=\"'.$name.'\">'.\n $widget['title'].'</span></li>';\n }\n $menu .= '</ul>';\n $menu .= '</div>';\n\n return $menu;\n }",
"private function drawPermissions($menu, $roleId, $level = 0)\n {\n $this->id++;\n if(!is_array($menu)) \n {\n return;\n }\n \n $ret = $ret . \"<ul class='permission \"\n . ($level==0?\"root-permission\":\"sub-permission\")\n . \" permission-level-$level' id='permission-{$this->id}'>\";\n\n foreach($menu as $item)\n {\n $link = is_array($item[\"permissions\"]) ? \"<b>{$item[\"title\"]}</b>\" : \"<a href='{$this->urlPath}/permissions/$roleId{$item[\"path\"]}'>{$item[\"title\"]}</a>\";\n\n $ret = $ret . \"<li $style $extra >$link\";\n\n if(is_array($item[\"permissions\"]))\n {\n $this->save = \"<div id='fapi-submit-area'><input type='submit' value='Save'/>\";\n $ret =$ret . \"<div class='permission-box' style='padding-bottom:20px;width:500px'>\n <table width='100%'>\n <thead><tr><td width='50%'></td><td><center>Enabled</center></td><td><center>Disabled</center></td></tr></thead>\";\n foreach($item[\"permissions\"] as $permission)\n {\n $permissionName = str_replace(\".\", \"_\", $permission[\"name\"]);\n $enableChecked = User::getPermission($permissionName, $roleId) == true ? \"checked='checked'\" : \"\";\n $disabledChecked = User::getPermission($permissionName, $roleId) == true ? \"\" : \"checked='checked'\";\n \n $ret .= \"<tr>\n <td>{$permission[\"label\"]}</td>\n <td><center><input type='radio' name='{$permission[\"name\"]}[]' value='1' $enableChecked /></center></td>\n <td>\n <center><input type='radio' name='{$permission[\"name\"]}[]' value='0' $disabledChecked /></center>\n <input type='hidden' name='{$permission[\"name\"]}[]' value = '{$item[\"path\"]}' />\n </td>\n </tr>\";\n }\n $ret .= \"</table></div>\";\n }\n\n if(count($item[\"children\"]>0))\n {\n $ret = $ret \n . $this->drawPermissions($item[\"children\"],$roleId,$level+1);\n }\n $ret = $ret . \"</li>\";\n }\n\n $ret = $ret . \"</ul>\";\n return $ret;\n }",
"protected function getWidget()\n {\n $widgets = $this->getPage()->findAll('css', 'body div.filter-container ul.ui-multiselect-checkboxes');\n\n /** @var NodeElement $widget */\n foreach ($widgets as $widget) {\n if ($widget->isVisible()) {\n return $widget;\n }\n }\n\n self::fail('Could not find widget on page or it\\'s not visible');\n }"
] | [
"0.622101",
"0.5974379",
"0.58389336",
"0.58389336",
"0.5833121",
"0.5819376",
"0.5814579",
"0.5766606",
"0.57638645",
"0.568372",
"0.5662139",
"0.5602385",
"0.5586383",
"0.55735177",
"0.555928",
"0.55482394",
"0.5543467",
"0.55425495",
"0.5511548",
"0.5493753",
"0.54492646",
"0.544343",
"0.5414689",
"0.54077846",
"0.5401044",
"0.5363017",
"0.53536755",
"0.5315067",
"0.53045106",
"0.5286375"
] | 0.73286635 | 0 |
/ viewAddResources Renders the add resources page | public function viewAddResources()
{
echo Template::instance()->render('view/include/head.php');
echo Template::instance()->render('view/include/top-nav.php');
echo Template::instance()->render('view/edit-resources.php');
echo Template::instance()->render('view/include/footer.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_resources()\n\t{\n\t\t\n\t}",
"public function actionAdd()\n\t{\n\t\t$this->render('add');\n\t}",
"public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n $this->_f3->reroute('/Admin');\n }\n\n }",
"public function resources(){\n\t\t$this->verify();\n\t\t$data['title']=\"Resources\";\n\t\t$data['category']=$this->admin_model->fetch_rescources_cat();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('resources/resources', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}",
"public function addAction()\n {\n $this->templatelang->load($this->_controller.'.'.$this->_action);\n\n // Rendering view page\n $this->_view();\n }",
"public function get_add()\n { \n // Render the page\n View::make($this->bundle . '::product.add')->render();\n }",
"public function add()\n\t{\n\t\t$this->template('crud/add');\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()\n {\n //renderView('add');\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function addAction() {\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}",
"public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}",
"public function 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}",
"public function addView()\n {\n return $this->render('Add');\n }",
"public function addAction()\n {\n $post_request = (array) $this->postZingRequest();\n\n /** Handle the request */\n $errors = $this->_handleRequest($post_request);\n\n return $this->renderAdmin('ZingComponentGoogleMapsBundle:Default:form.html.twig', array_merge(\n array(\n 'zing_form_action' => 'Create',\n 'zing_form_errors' => $errors\n ),\n $post_request\n ));\n\n }",
"public function actionAdd() {\n $this->setView('edit');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"private function _addResource()\n {\n //Add Resource\n $this->assets->collection('css_header')\n ->addCss('/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css');\n\n $this->assets->collection('js_footer')\n ->addJs('/plugins/nestable/jquery.nestable.js')\n ->addJs('/plugins/nestable/ui-nestable.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modal.js')\n ->addJs('/plugins/bootstrap-modal/js/bootstrap-modalmanager.js')\n ->addJs('/templates/backend/default/js/ui-modals.js');\n }",
"public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }",
"public function resourceTemplateTeamsAdd(Event $event)\n {\n $view = $event->getTarget();\n\n if ($has_team = $this->currentTeam()){\n $team_id = $has_team->getId();\n\n } else {\n $messanger = new Messenger();\n $messanger->addError(\"You can only make a resource template after you have been added to a team\");\n $team_id = 0;\n echo '<script>$(\\'button:contains(\"Add\")\\').prop(\"disabled\",true);</script>';\n\n }\n echo $view->partial('teams/partial/resource-template/add', ['team_id' => $team_id]);\n\n }",
"public function add() {\n if($this->user->access_level != 3) {\n # If not, redirect them to the films index\n\t \tRouter::redirect(\"/films\");\n }\n \n # Setup view\n $this->template->content = View::instance('v_films_add');\n $this->template->title = \"DER | Add New Film\";\n \n # Pass in template-specific CSS files\n\t $this->template->client_files_head = '<link rel=\"stylesheet\" href=\"/css/bootstrap.css\" type=\"text/css\">\n\t \t<link rel=\"stylesheet\" href=\"/css/signin.css\" type=\"text/css\">\n\t \t<script type=\"text/javascript\" src=\"/js/app.js\"></script>';\n\n # Render template\n echo $this->template;\n }",
"public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }",
"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 }",
"public function addAction()\n {\n return $this->render('OCPlatformBundle:Default:index.html.twig', ['value' => 0]);\n }",
"public function addRequiredResources() {\n // None\n }",
"function showLevelResources()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilToolbar, $lng, $ilCtrl;\n\n\t\t$ilToolbar->addButton(\n\t\t\t$lng->txt(\"skmg_add_resource\"),\n\t\t\t$ilCtrl->getLinkTarget($this, \"addLevelResource\"));\n\t\t\n\t\t$this->setLevelHead();\n\t\t$ilTabs->activateTab(\"level_resources\");\n\t\t\n\t\tinclude_once(\"./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php\");\n\t\t$tab = new ilSkillLevelResourcesTableGUI($this, \"showLevelResources\",\n\t\t\t$this->base_skill_id, $this->tref_id, (int) $_GET[\"level_id\"]);\n\t\t\n\t\t$tpl->setContent($tab->getHTML());\n\t}",
"public function addAction()\n {\n \t$form = MediaForm::create($this->get('form.context'), 'media');\n\n \treturn $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => new Media()));\n }",
"public function add() {\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$model->add();\r\n\t\t\r\n\t\t$this->view = $this->getView(\"languages\");\r\n\t\t$this->view->setModel($model, true);\r\n\t\t$this->view->display();\r\n\t}",
"public function add()\n\t{\n\t\treturn view('pages.add');\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }"
] | [
"0.70956415",
"0.686092",
"0.67862123",
"0.66067195",
"0.65433717",
"0.6538168",
"0.6532919",
"0.6522265",
"0.6388805",
"0.63888025",
"0.62770903",
"0.6261078",
"0.62582153",
"0.6235059",
"0.6217802",
"0.6195584",
"0.61924314",
"0.6179709",
"0.61661065",
"0.6148068",
"0.61478364",
"0.61468506",
"0.6139856",
"0.61157244",
"0.6103925",
"0.60861903",
"0.605729",
"0.604674",
"0.60456693",
"0.6045604"
] | 0.79143375 | 0 |
/ viewEditResources Loads a specific resource for editing and renders the edit resources page | public function viewEditResources()
{
$database = new Database();
$id = $this->_params['id'];
$resource = $database->getResourceById($id);
$availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']
, $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,
$resource['Link'], $resource['active']);
$this->_f3->set('Resource', $availableResource);
echo Template::instance()->render('view/include/head.php');
echo Template::instance()->render('view/include/top-nav.php');
echo Template::instance()->render('view/edit-resources.php');
echo Template::instance()->render('view/include/footer.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $resourceName = \"Resource\", $description = \"Info\",\n $contactName =\"\",$contactEmail = \"\",$contactPhone = \"\",$link = \"\", $active = \"1\" )*/\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['Active']);\n $this->_f3->set('Resource', $availableResource);\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n // fixme add routing\n $this->_f3->reroute('/Admin');\n }\n\n }",
"public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}",
"public function edit(Resource $resource)\n {\n //\n }",
"public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function editAction()\n {\n $curriculumdocId = $this->getRequest()->getParam('id');\n $curriculumdoc = $this->_initCurriculumdoc();\n if ($curriculumdocId && !$curriculumdoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_curriculumdoc')->__('This curriculum doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCurriculumdocData(true);\n if (!empty($data)) {\n $curriculumdoc->setData($data);\n }\n Mage::register('curriculumdoc_data', $curriculumdoc);\n $this->loadLayout();\n\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Training List'))\n ->_title(Mage::helper('bs_curriculumdoc')->__('Curriculum Documents'));\n if ($curriculumdoc->getId()) {\n $this->_title($curriculumdoc->getCdocName());\n } else {\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Add curriculum doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd(intval($id));\n\t\t$game_info = Resource_Service_Games::getResourceGames($info['link']);\n\t\t$this->assign('game_info', $game_info);\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\t$this->assign('info', $info);\n\t}",
"public function editAction()\n {\n $tiles = [];\n // Reuse the parameters from $_REQUEST\n // If we are going to render a full page for edit form, we shall also render the _form_controls\n $tiles[] = Region::create($this->getEditRegionPath(), array_merge($_REQUEST, [\n '_form_controls' => true,\n ]));\n return $this->render($this->findTemplatePath('page.html') , array( 'tiles' => $tiles ));\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function editAction() {}",
"public function edit()\n {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n\n $project = Project::find($_GET['id']);\n require_once('views/projects/edit.php');\n }",
"public function edit($id)\n {\n // include view file\n }",
"public function editAction(): object\n {\n // Sets webpage title\n $title = \"Edit content\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n // Connects to db\n $this->app->db->connect();\n\n // Retrieve content id\n $contentId = getGet(\"id\");\n\n // SQL statement\n $sql = \"SELECT * FROM content WHERE id = ?;\";\n\n // Fetches data from db and stores in $resultset\n $content = $this->app->db->executeFetch($sql, [$contentId]);\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"contentId\" => $contentId,\n \"content\" => $content,\n // \"filters\" => $filters\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/edit\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function editAction()\n {\n $coursedocId = $this->getRequest()->getParam('id');\n $coursedoc = $this->_initCoursedoc();\n if ($coursedocId && !$coursedoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_coursedoc')->__('This course doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCoursedocData(true);\n if (!empty($data)) {\n $coursedoc->setData($data);\n }\n Mage::register('coursedoc_data', $coursedoc);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_coursedoc')->__('Course Document'))\n ->_title(Mage::helper('bs_coursedoc')->__('Course Documents'));\n if ($coursedoc->getId()) {\n $this->_title($coursedoc->getCourseDocName());\n } else {\n $this->_title(Mage::helper('bs_coursedoc')->__('Add course doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"abstract protected function renderEdit();",
"public function actionEdit($id) { }",
"public function editAction() {\n\t\t// Get all todos\n\t\t$todo = new todo;\n\t\t$todo = $todo->Get($this->get['id']);\n\t\t// Filter by passing an argument as array(array('done', '=', '0')) to\n\t\t// GetList. This would for example only select todos that are done.\n\n\t\t// Get template\n\t\t$template = $this->getTemplate('todo_edit');\n\n\t\t// Render template\n\t\treturn $template->render(array('todo' => $todo));\n\t}",
"public function 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}",
"public function editAction(){\n\t\t$id = $this->getInput('id');\n\t\t$info = Ola_Service_Area::get(intval($id)); \n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t $this->assign('info', $info);\t\n\t}",
"public function edit()\n {\n // get resources for display \n $website = Website::where('name','flooflix')->first();\n if (!is_null($website) && !empty($website)) {\n $page = Page::where('website_id', $website->id)->where('name','modifier_carte')->first();\n if(!is_null($page) && !empty($page)){\n $datas = $page->getResourcesToDisplayPage($page);\n } \n }else{\n return view('errors.404');\n }\n return view('Flooflix.forms.editBankCard', compact('datas'));\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function editAction(): void {\n View::renderTemplate('Profile/edit.twig', [\n 'user' => $this->user\n ]);\n }",
"public function editAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$layoutName = $this->_request->getParam('layout'); \n\t\t$this->view->objLayout = $model->getLayout($layoutName);\n\t }",
"public function edit(){\n $factura = parent::find($_GET['id']);\n require_once 'views/employee/layouts/header.php';\n require_once 'views/employee/factura/edit.php';\n require_once 'views/employee/layouts/footer.php';\n\n }",
"public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }",
"public function edit($module_id, $id)\n {\n $module = Module::find($module_id);\n $resource = Resource::find($id);\n if ($resource == null) {\n return back();\n }else{\n return view('resources/edit-resource-title', compact('resource', 'module'));\n }\n }",
"public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }"
] | [
"0.7460722",
"0.69512355",
"0.68485713",
"0.6796208",
"0.67901796",
"0.67579526",
"0.67425245",
"0.6713578",
"0.6629987",
"0.6572274",
"0.6498282",
"0.64602315",
"0.6423282",
"0.6422785",
"0.6415895",
"0.6414357",
"0.64009565",
"0.63885695",
"0.63796145",
"0.6374096",
"0.6373489",
"0.6361037",
"0.6314739",
"0.6312496",
"0.631174",
"0.63032657",
"0.628961",
"0.62786764",
"0.62737644",
"0.627167"
] | 0.8596455 | 0 |
/ postAddResource Checks to see if the user data is valid if so it will add it to the DB if the user data is invalid will reload the add user page. | public function postAddResource()
{
$errors = validateAddResources();
if(!($errors === true)) {
$this->_f3->set('errors', $errors);
echo Template::instance()->render('view/include/head.php');
echo Template::instance()->render('view/include/top-nav.php');
echo Template::instance()->render('view/edit-resources.php');
echo Template::instance()->render('view/include/footer.php');
} else {
$this->_f3->reroute('/Admin');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function post_add_users() {\n\t}",
"public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}",
"public function add()\n {\n $this->request->allowMethod(['post']);\n\n $user = $this->Users->newEmptyEntity();\n\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->getData());\n\n if (!$this->Users->save($user)) {\n throw new ValidationErrorException($user);\n }\n }\n\n $this->set('data', $user);\n }",
"public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}",
"public function add() {\n $user = $this->Users->newEntity();\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->data);\n if ($this->Users->save($user)) {\n $this->Flash->success(__('The user has been saved.'));\n \n return $this->redirect(['action' => 'login']);\n } else {\n $this->Flash->error(__('The user could not be saved. Please, try again.'));\n }\n }\n \n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n }",
"public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }",
"function add() {\n $this->layout = \"no_header\";\n if (!empty($this->data)) {\n if ($this->User->save($this->data)) {\n $this->Session->setFlash(\"Your account has been created successfully\");\n $this->go_back(\"login\");\n }\n }\n }",
"public function createUser(){\n $post = $this->_app->request->post();\n \n // Load the request schema\n $requestSchema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n \n // Get the alert message stream\n $ms = $this->_app->alerts; \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $ms->addMessageTranslated(\"danger\", \"ACCESS_DENIED\");\n $this->_app->halt(403);\n }\n\n // Set up Fortress to process the request\n $rf = new \\Fortress\\HTTPRequestFortress($ms, $requestSchema, $post); \n \n // Sanitize data\n $rf->sanitize();\n \n // Validate, and halt on validation errors.\n $error = !$rf->validate(true);\n \n // Get the filtered data\n $data = $rf->data(); \n \n // Remove csrf_token, password confirmation from object data\n $rf->removeFields(['csrf_token, passwordc']);\n \n // Perform desired data transformations on required fields. Is this a feature we could add to Fortress?\n $data['user_name'] = strtolower(trim($data['user_name']));\n $data['display_name'] = trim($data['display_name']);\n $data['email'] = strtolower(trim($data['email']));\n $data['active'] = 1;\n \n // Check if username or email already exists\n if (UserLoader::exists($data['user_name'], 'user_name')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_USERNAME_IN_USE\", $data);\n $error = true;\n }\n\n if (UserLoader::exists($data['email'], 'email')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_EMAIL_IN_USE\", $data);\n $error = true;\n }\n \n // Halt on any validation errors\n if ($error) {\n $this->_app->halt(400);\n }\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primaryGroup = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Set default values if not specified or not authorized\n if (!isset($data['locale']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"locale\"]))\n $data['locale'] = $this->_app->site->default_locale;\n \n if (!isset($data['title']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"title\"])) {\n // Set default title for new users\n $data['title'] = $primaryGroup->new_user_title;\n }\n \n if (!isset($data['primary_group_id']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"primary_group_id\"])) {\n $data['primary_group_id'] = $primaryGroup->id;\n }\n \n // Set groups to default groups if not specified or not authorized to set groups\n if (!isset($data['groups']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"groups\"])) {\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n $data['groups'] = [];\n foreach ($default_groups as $group_id => $group){\n $data['groups'][$group_id] = \"1\";\n }\n }\n \n // Hash password\n $data['password'] = Authentication::hashPassword($data['password']);\n \n // Create the user\n $user = new User($data);\n\n // Add user to groups, including selected primary group\n $user->addGroup($data['primary_group_id']);\n foreach ($data['groups'] as $group_id => $is_member) {\n if ($is_member == \"1\"){ \n $user->addGroup($group_id); \n }\n }\n \n // Store new user to database\n $user->store(); \n \n // Success message\n $ms->addMessageTranslated(\"success\", \"ACCOUNT_CREATION_COMPLETE\", $data);\n }",
"public function admin_add() {\n if ($this->isAuthorized()) {\n if ($this->request->is('post')) {\n $this->User->create();\n if ($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('The user has been created'));\n return $this->redirect(array(\n 'action' => 'index',\n ));\n } else {\n $this->Session->setFlash(__('The user could not be created. Please, try again.'));\n }\n }\n } else {\n $this->Session->setFlash(__('You do not have permission to do this'));\n return $this->redirect(array(\n 'action' => 'admin_dashboard',\n ));\n }\n }",
"public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}",
"public function add(){\n\t\tif($this->request->is('post'))\n\t\t{\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['role'] = 'user';\n\t\t\tif($this->User->save($this->request->data))\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Usuario creado');\n\t\t\t\treturn $this-redirect(array('action' =>'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Usuario no creado');\n\t\t\t}\n\t\t}\n\n\t}",
"public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}",
"public function addUserAction()\n\t{\n\t\t$user = new User();\n\n\t\t$form = $this->createForm(new UserType, $user);\n\t\t\n\t\t$request = $this->get('request');\n\n\t\tif ($request->getMethod() == 'POST') {\n\t\t\t$form->bind($request);\n\n // Checking the validity of the submission\n\t\t\tif ($form->isValid()) {\n\t\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\t\t$em->persist($user);\n\t\t\t\t$em->flush();\n\n // Redirection to the homepage of Bundle\n\t\t\t\treturn $this->redirect($this->generateUrl('valentin_films_manager_index'));\n\t\t\t}\n\t\t}\n\t\treturn $this->render('ValentinFilmsManagerBundle:Manager:addUser.html.twig', array(\n\t\t\t'form' => $form->createView(),\n\t\t\t));\n\t\t\n\t}",
"public function addUser()\n {\n $categoryList = $this->itemModel->getCategories();\n\n //Check that register button exists and was clicked\n if (isset($_POST[\"user_submit\"])) { \n\n //Insert new row in Account and setting the User's name in database using values inputted in the HTML form\n $username = $_POST['username']; \n\n $newly_registered_account_id = $this->accountModel->registerAccount($username,$_POST[\"password\"],$_POST[\"sfsu_id\"]);\n\n $this->userModel->setUser($newly_registered_account_id,$_POST[\"firstname\"], \n $_POST[\"lastname\"],$_POST[\"country\"],$_POST[\"state\"],\n $_POST[\"address\"],$_POST[\"city\"],$_POST[\"zipcode\"],$_POST[\"phoneNumber\"]);\n\n } else {\n echo '<script language=\"javascript\">';\n echo 'alert(\"accounts.php registerUser bad.\")';\n echo '</script>';\n }\n\n header('location: ' . URL . 'home/index');\n }",
"public static function addUser()\r\n { \r\n $app = \\Slim\\Slim::getInstance();\r\n $request = (object)$app->request->post();\r\n //validate input\r\n $validata = $app->validata;\r\n $validator = $validata::key('email', $validata::email()->notEmpty())\r\n ->key('first_name', $validata::stringType()->notEmpty())\r\n ->key('last_name', $validata::stringType()->notEmpty())\r\n ->key('password', $validata::stringType()->notEmpty())\r\n ->key('company', $validata::intVal())\r\n ->key('city', $validata::stringType()->notEmpty())\r\n ->key('province', $validata::stringType()->notEmpty())\r\n ->key('zip_code', $validata::stringType()->notEmpty())\r\n ->key('address', $validata::stringType()->notEmpty());\r\n $errors = array();\r\n try{\r\n $validator->assert((array) $request);\r\n } catch (\\InvalidArgumentException $e) {\r\n $errors = $e->findMessages(array(\r\n 'email' => '{{name}} must be a valid email',\r\n 'first_name' => '{{name}} is required',\r\n 'last_name' => '{{name}} is required',\r\n 'password' => 'Password is required',\r\n 'company' => 'Company is required',\r\n 'city' => 'City is required',\r\n 'province' => 'State/Province is required',\r\n 'address' => 'Address is required',\r\n 'zip_code' => 'Zipcode is required'\r\n ));\r\n }\r\n\r\n if ($validator->validate((array)$request)) {\r\n if(!PasswordController::isValid($request->password,$request->email)){\r\n $app->halt('400',json_encode(\"Password Formart Wrong\"));\r\n }\r\n \r\n if(!Company::find($request->company)){\r\n $app->halt('400',json_encode(\"Company does not exist\"));\r\n }\r\n if (self::isExist($request->email)){\r\n $app->response->setStatus(400);\r\n return json_encode(\"Email already taken\");\r\n }\r\n\r\n $user = new User;\r\n //$user->name = $request->name;\r\n $user->email = $request->email;\r\n $user->password = PasswordController::encryptPassword($request->password);\r\n $user->first_name = $request->first_name;\r\n $user->last_name = $request->last_name;\r\n if(isset($request->phone))$user->phone = $request->phone;\r\n $user->city = $request->city;\r\n $user->address = $request->address;\r\n $user->province = $request->province;\r\n $user->zip_code = $request->zip_code;\r\n $user->country = $request->country;\r\n $user->active = 0;\r\n $user->save();\r\n $app->response->setStatus(200);\r\n\r\n //send confirm email\r\n if ($user->id) {\r\n $user->companies()->attach($request->company);\r\n $link = WEBSITELINK.'/'.self::$active_api.openssl_encrypt ($user->id, 'AES-256-CBC', self::$pass, 0, self::$iv);\r\n EmailController::newUserConfirmation($user->id,$request->password,$link);\r\n }\r\n return $user->id;\r\n } else {\r\n $app->response->setStatus(400);\r\n $return = [];\r\n foreach (array_values($errors) as $key => $error) {\r\n if($error!=\"\") \r\n array_push($return,array(\"code\"=>$key,\"data\"=>$error));\r\n }\r\n return json_encode($return);\r\n }\r\n\r\n }",
"function __addUser()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //flow control\n $next = true;\n\n if (!isset($_POST['submit'])) {\n //redirect to 'view' url instead\n $this_url = uri_string();\n $redirect = str_replace('add-user', 'view', $this_url);\n redirect($redirect);\n }\n\n //validate form & display any errors\n $validation = $this->__flmFormValidation('add_user');\n if (!$validation) {\n //show error\n $this->notices('error', $this->form_processor->error_message, 'html');\n //halt\n $next = false;\n }\n\n //add to database\n if ($next) {\n $new_users_id = $this->users_model->addUser($this->client_id);\n $this->data['debug'][] = $this->users_model->debug_data;\n\n //was adding successful\n if (!$new_users_id) {\n //show error\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'html');\n //halt\n $next = false;\n }\n }\n\n //update primary contact if selected\n if ($next) {\n if ($this->input->post('client_users_main_contact') == 'on') {\n $this->users_model->updatePrimaryContact($this->client_id, $new_users_id);\n $this->data['debug'][] = $this->users_model->debug_data;\n }\n }\n\n //all is ok\n if ($next) {\n //success\n $this->notices('success', $this->data['lang']['lang_request_has_been_completed'], 'noty');\n\n /*EMAIL - send user an email*/\n $this->__emailer('new_user');\n\n /*EMAIL - send admin notifications*/\n $this->__emailer('admin_notification_new_user');\n\n } else {\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'html');\n }\n\n //load user page\n $this->__clientUsers();\n }",
"function admin_add_user()\n{\n global $app;\n\n $user_data = $app->request()->post();\n $app->getLog()->debug('admin_add_user: ' . var_export($user_data, true));\n try {\n $user = $app->bbs->addUser($user_data['username'], $user_data['password']);\n } catch (Exception $e) {\n $app->getLog()->error('admin_add_user: error for adding user ' . var_export($user_data, true));\n $app->getLog()->error('admin_add_user: exception ' . $e->getMessage());\n $user = null;\n }\n $resp = $app->response();\n if (isset($user) && !is_null($user)) {\n $resp->status(200);\n $msg = getMessageString('admin_modified');\n $answer = json_encode(['user' => $user->getProperties(), 'msg' => $msg]);\n $resp->header('Content-type', 'application/json');\n } else {\n $resp->status(500);\n $resp->header('Content-type', 'text/plain');\n $answer = getMessageString('admin_modify_error');\n }\n $resp->header('Content-Length', strlen($answer));\n $resp->body($answer);\n}",
"public function addAction() {\n $form = new Admin_Form_CreateAdminUser();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n $values = $form->getValues();\n $adminMapper = new Application_Model_Table_AdminUsers();\n $userFound = $adminMapper->fetchByUsername($values['username']);\n if(!$userFound){\n $values['is_active'] = 1;\n $values['is_admin'] = 1;\n $adminUser = $adminMapper->createRow($values);\n $adminUser->hashPassword($values['new_password']);\n $adminUser->save();\n $this->_helper->FlashMessenger->addMessage('The user has been created' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-users', true);\n } else {\n $this->view->messages['error'] = \"This username already exists\";\n }\n }\n }\n $this->view->form = $form;\n }",
"public function addAction() {\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$user = new Users ();\r\n\t\t\t$user->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$user->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$user->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$user->save ();\r\n\t\t}\r\n\t}",
"protected function _addUser($data = null){\n $this->tempData['User'] = $data['User'];\n unset($this->tempData['User']['id']);\n if($this->tempData['User']) {\n return array('success' => true);\n } else {\n return array('success' => false);\n }\n }",
"public function addUserAction()\n {\n $form = new Application_Form_UserEdit();\n $this->view->form = $form;\n\n if ($this->getRequest()->isPost())\n {\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData))\n {\n $username = $form->getValue('username');\n $password = $form->getValue('password');\n $role = $form->getValue('role');\n $first_name = $form->getValue('first_name');\n $last_name = $form->getValue('last_name');\n $email = $form->getValue('email'); \n $user = new Application_Model_DbTable_Users();\n $user->addUser($username, $password, $first_name,\n $last_name, $email, $role);\n $this->_helper->redirector('index', 'index');\n }\n else\n {\n $form->populate($formData);\n }\n }\n }",
"public function addUser($data)\n{\n\t$this->insert($data);\n}",
"public function ajaxUserAdd() {\n if (!empty($_POST)) {\n $username = $_POST['username'];\n $password = $_POST['password'];\n $password_second = $_POST['password_second'];\n /** @var User $user */\n foreach ($this->entityManager->getRepository('Entity\\\\User')->findAll() as $user) {\n if (strtolower($user->getUsername()) == strtolower($username)) {\n header('HTTP/1.0 409 Conflict');\n echo 'Username already taken';\n exit();\n }\n }\n if ($password == $password_second) {\n $user = new User();\n $user->setUsername($username);\n $user->setPassword(password_hash($password, PASSWORD_ARGON2ID));\n\n $this->entityManager->persist($user);\n $this->entityManager->flush();\n\n $user_data = [\n 'id' => $user->getId(),\n 'username' => $user->getUsername(),\n ];\n header('HTTP/1.0 200 OK');\n header('Content-Type: application/json');\n echo json_encode($user_data);\n } else {\n header('HTTP/1.0 418 Password');\n echo 'Passwords should be the same';\n exit();\n }\n } else {\n header('HTTP/1.0 400 Bad Request');\n echo 'Post Data is empty';\n exit();\n }\n }",
"public function addAction()\n {\n $viewModel = new ViewModel(['title' => 'add a user']);\n // if they are trying to add a user account for an existing person...\n $person_id = $this->params()->fromRoute('id');\n // or if there's no person_id route parameter...\n if (! $person_id && isset($this->params()->fromPost()['user'])) {\n // try post parameters\n $user = $this->params()->fromPost()['user'];\n if (isset($user['person']) && ! empty($user['person']['id'])) {\n $person_id = $user['person']['id'];\n }\n }\n $options = [\n 'action' => 'create',\n 'auth_user_role' => $this->auth_user_role,\n 'constrain_email' => true,\n ];\n\n if ($person_id) {\n /** @todo better db efficiency... */\n $person = $this->entityManager\n ->find('InterpretersOffice\\Entity\\Person', $person_id);\n if (! $person) {\n return $viewModel->setVariables(\n ['errorMessage' => \"person with id $person_id not found\"]\n );\n }\n $options['existing_person'] = $person;\n } else {\n $person = null;\n }\n $form = new UserForm($this->entityManager, $options);\n $user = new Entity\\User();\n if ($person) {\n $this->events->trigger(\n 'load-person',\n $this,\n compact('person', 'form')\n );\n $user->setPerson($person);\n $form->get('user')->get('person')->setObject($person);\n }\n\n $form->bind($user);\n $viewModel->form = $form;\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n $form->setData($request->getPost());\n if (! $form->isValid()) {\n return new JsonModel(['status' => 'error',\n 'validation_errors' => $form->getMessages()]);\n }\n $user->setCreated(new \\DateTime());\n $this->entityManager->persist($user);\n if (! $person_id) {\n $this->entityManager->persist($user->getPerson());\n }\n // we could do this in the model instead, with lifecycle callback (?)\n $user->setPassword(bin2hex(openssl_random_pseudo_bytes(8)));\n $this->entityManager->flush();\n $person = $user->getPerson();\n $this->flashMessenger()->addSuccessMessage(\n sprintf(\n 'A user account has been created for %s <strong>%s %s</strong>.',\n $user->getRole(),\n $person->getFirstName(),\n $person->getLastname()\n )\n );\n return new JsonModel(['status' => 'success','validation_errors' => null]);\n }\n\n return $viewModel;\n }",
"protected function _post_validate ($obj)\n {\n parent::_post_validate ($obj);\n\n if (sizeof ($this->_errors) == 0)\n {\n if (! $this->object_exists () || $this->app->user_options->users_can_change_name)\n {\n $name = $this->value_for ('title');\n if (empty ($obj->title) || (strcasecmp ($obj->title, $name) != 0))\n {\n // new user or name has been changed\n\n $user_query = $this->app->user_query ();\n $existing_user = $user_query->object_at_name ($name);\n\n // see if there is a user with that name\n\n if ($existing_user)\n {\n $this->record_error ('title', \"Someone is already using that name.\");\n }\n }\n }\n\n if (! $obj->exists ())\n {\n $password1 = $this->value_for ('password1');\n $password2 = $this->value_for ('password2');\n if (strcasecmp ($password1, $password2))\n {\n $this->record_error ('password2', \"Please make sure the passwords are the same.\");\n }\n }\n }\n }",
"public function postRegister()\n {\n if ($this->request->is('post')) {\n $input = $this->request->getData();\n $validate = $this->Client->newEntity($input);\n\n if ($validate->errors()) {\n $this->set($validate->errors());\n } else {\n $this->Client->insert($input);\n $this->Flash->success('Sign up success');\n }\n $this->register();\n }\n }",
"public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}",
"public function add(){\n Auth::checkUserLogin();\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Add';\n\n $this->_view->error = array();\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n\t\t\t Url::redirect('users/index');\n\t\t }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else{\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('users/index');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout');\n\t}",
"public function addUser(){}",
"public function addUser( $userdata ) {\r\n /* $userdata = [\r\n [ProductCode] => IG7985\r\n [ClientMemberID] => R27586351\r\n [FirstName] => TEST\r\n [LastName] => MURRAY\r\n [Address] => Abb\r\n [City] => Abbivlie\r\n [State] => AL\r\n [Zipcode] => 36310\r\n [Phone] => 3017874905\r\n [Email] => [email protected]\r\n [DOB] => 1938-02-19\r\n [Gender] => M\r\n [RepID] => E104509\r\n [ocenture] => stdClass Object\r\n (\r\n [Status] => Account Created\r\n [ClientMemberID] => R27586351\r\n [MembershipID] => 111849849\r\n [ProductCode] => IG7985\r\n )\r\n ]\r\n */\r\n Logger::log(\"Adding ocenture user to db\"); \r\n\r\n $ocentureData = $userdata['ocenture'];\r\n //ocenture sends us following in case of error, please note spelling of error, it should be Error but it is Erorr from Ocenture.\r\n /*\r\n stdClass::__set_state(array(\r\n 'Status' => 'Erorr',\r\n 'Erorr' => 'DuplicateRecordFault',\r\n ))\r\n */\r\n \r\n if ($ocentureData->Status != 'Erorr') \r\n {\r\n try {\r\n\r\n //insert new user as post \r\n $postId = wp_insert_post([\r\n 'post_title' => \"[{$ocentureData->MembershipID} - {$ocentureData->ProductCode}] {$userdata['FirstName']} {$userdata['LastName']}\", \r\n 'post_type'=>'ocenture',\r\n 'post_status' => 'publish',\r\n ]);\r\n\r\n //adding user meta, to avoid it showing as custom fields \r\n add_post_meta($postId, '_membership_id', $ocentureData->MembershipID);\r\n add_post_meta($postId, '_product_code', $ocentureData->ProductCode);\r\n add_post_meta($postId, '_status', $ocentureData->Status == 'Account Created' ? 1 : 0);\r\n add_post_meta($postId, '_client_member_id', $ocentureData->ClientMemberID); //youngevity id\r\n\r\n add_post_meta($postId, '_rep_id', $userdata['RepID']); \r\n add_post_meta($postId, '_fname', $userdata['FirstName']);\r\n add_post_meta($postId, '_lname', $userdata['LastName']);\r\n add_post_meta($postId, '_email', $userdata['Email']);\r\n add_post_meta($postId, '_phone', $userdata['Phone']);\r\n add_post_meta($postId, '_address', $userdata['Address']);\r\n add_post_meta($postId, '_city', $userdata['City']);\r\n add_post_meta($postId, '_state', $userdata['State']);\r\n add_post_meta($postId, '_zip', $userdata['Zipcode']);\r\n add_post_meta($postId, '_date', time());\r\n\r\n Logger::log(\"Ocenture user added to db, post_id : $postId\");\r\n \r\n } catch (Exception $e) {\r\n\r\n }\r\n }\r\n }"
] | [
"0.6500552",
"0.6489134",
"0.6451038",
"0.6303201",
"0.61842513",
"0.6104865",
"0.6099151",
"0.605396",
"0.6046741",
"0.603245",
"0.59373516",
"0.59210557",
"0.59074485",
"0.59061795",
"0.59047186",
"0.5889217",
"0.58758897",
"0.5873581",
"0.58488464",
"0.5834428",
"0.5826928",
"0.58244485",
"0.5815354",
"0.58090633",
"0.58026814",
"0.5785692",
"0.57701486",
"0.5743747",
"0.5733868",
"0.5708594"
] | 0.70471954 | 0 |
/ postEditResources Checks to see if the user data is valid if so it will update the DB if the user data is invalid will reload the edit user page. | public function postEditResources()
{
$id = $this->_params['id'];
$errors = validateEditResource($id);
if(!($errors === true)) {
$database = new Database();
$resource = $database->getResourceById($id);
/*construct($resourceID = "0", $resourceName = "Resource", $description = "Info",
$contactName ="",$contactEmail = "",$contactPhone = "",$link = "", $active = "1" )*/
$availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']
, $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,
$resource['Link'], $resource['Active']);
$this->_f3->set('Resource', $availableResource);
$this->_f3->set('errors', $errors);
echo Template::instance()->render('view/include/head.php');
echo Template::instance()->render('view/include/top-nav.php');
echo Template::instance()->render('view/edit-resources.php');
echo Template::instance()->render('view/include/footer.php');
} else {
// fixme add routing
$this->_f3->reroute('/Admin');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function post_edit() {\n //try to edit the user\n if (AuxUser::editUser()) {\n //if the edit process worked, redirect to the profile page\n echo '<script>alert(\"User data edited\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"No data was updated, Please confirm that you change at least one field\");</script>';\n Response::redirect('/user/edit', 'refresh');\n }\n }",
"public function p_edit() { if(!$this->user) {\n Router::redirect('/');\n }\n \n $this->user->user_id = DB::instance(DB_NAME)->sanitize($this->user->user_id);\n $q = 'SELECT first_name, last_name, email\n FROM users\n WHERE user_id = \"'.$this->user->user_id.'\"';\n $user = DB::instance(DB_NAME)->select_row($q);\n \n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n \n $_POST['first_name'] = htmlspecialchars($_POST['first_name'], ENT_QUOTES, 'UTF-8');\n $_POST['last_name'] = htmlspecialchars($_POST['last_name'], ENT_QUOTES, 'UTF-8');\n \n $q = 'SELECT count(*)\n FROM users\n WHERE email = \"'.$_POST['email'].'\"'; \n $count = DB::instance(DB_NAME)->select_rows($q); \n //if the user enters an email which already exists in the data base kick them back\n if(intval($count[0]['count(*)']) >= 1) {\n Router::redirect('/users/edit/error');\n } else {\n \n if($_POST['first_name'] != NULL)\n {\n $user['first_name'] = $_POST['first_name'];\n }\n if($_POST['last_name'] != NULL )\n {\n $user['last_name'] = $_POST['last_name'];\n }\n if($_POST['email'] != NULL )\n {\n $user['email'] = $_POST['email'];\n }\n \n \n \n DB::instance(DB_NAME)->update(\"users\", $user, \"WHERE user_id =\".$this->user->user_id);\n Router::redirect('/users/profile/'.$this->user->user_id);\n }\n \n \n }",
"public function getPostEditUser()\n {\n // Render login page if not logged in.\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Edit\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n $form = new EditUserForm($this->di, $user);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/edit\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }",
"public function postEdit()\n {\n // If we are not authentified, redirect to the login page.\n if(Auth::guest()) return Redirect::action('frontend\\UserController@getLogin');\n\n $loggedUser = Auth::user();\n\n $user = API::put('api/v1/user/' . $loggedUser->id, Input::all());\n\n // If the API throws a ValidationException $user will be a JSON string with our errors.\n if(is_string($user)) {\n $errors = json_decode($user, true);\n return Redirect::action('frontend\\UserController@getIndex')\n ->withErrors($errors);\n } else {\n return Redirect::action('frontend\\UserController@getIndex')\n ->with('success', 'Profile edited!');\n }\n }",
"public function actionEdit()\n {\n $userId = User::checkLogged();\n if ($userId == true) {\n $user = User::getUserById($userId);\n } else {\n header (\"Location: /login\");\n }\n\n // Variables for the form\n $firstName = $user['first_name'];\n $lastName = $user['last_name'];\n $email = $user['email'];\n $password = md5($user['password']);\n $birth = $user['birth'];\n $company = $user['company'];\n $address = $user['address'];\n $city = $user['city'];\n $state = $user['state'];\n $postcode = $user['postcode'];\n $country = $user['country'];\n $phone = $user['phone'];\n \n $result = false;\n \n if (isset($_POST['submit'])) {\n $firstName = $_POST['firstName'];\n $lastName = $_POST['lastName'];\n $email = $_POST['email'];\n $password = md5($_POST['password']);\n $birth = $_POST['birth'];\n $company = $_POST['company'];\n $address = $_POST['address'];\n $city = $_POST['city'];\n $state = $_POST['state'];\n $postcode = $_POST['postcode'];\n $country = $_POST['country'];\n $info = $_POST['info'];\n $phone = $_POST['phone'];\n \n // Flag of errors\n $errors = false;\n\n // Validation the fields\n if (!User::checkFirstName($firstName)) {\n $errors[] = 'First name must be at least 2 characters';\n }\n if (!User::checkLastName($lastName)) {\n $errors[] = 'Last name must be at least 2 characters';\n }\n if (!User::checkEmail($email)) {\n $errors[] = 'Email is wrong';\n }\n if (!User::checkPassword($password)) {\n $errors[] = 'Password must be at least 6 characters';\n }\n if (!User::checkPhone($phone)) {\n $errors[] = 'Phone must be at least 10 characters';\n }\n \n if ($errors == false) {\n // If there are no errors\n // Registrate a new user\n $result = User::update($userId, $firstName, $lastName, $email,\n $password, $birth, $company, $address, $city, \n $state, $postcode, $country, $info, $phone);\n } \n }\n \n require_once(ROOT . '/views/cabinet/edit.php');\n return true;\n }",
"function editUserAction()\n {\n $userRp = new UserRepository();\n $validateF = new ValidateFunctions();\n $user = $userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n if ($user != 0) {\n $obj_array = json_decode($user[3], true);\n $pass = $obj_array['user_password'];\n $addedBy = $obj_array['user_added'];\n\n if (!empty($_POST)) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email']];\n\n if ($_SESSION['id'] == $_GET['id']) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email'], $_POST['user_password'], $_POST['user_confirm']];\n }\n if ($this->checkUserInfo($_POST, $_FILES, $requiredFields)) {\n $file = $this->uploadUserImage($_FILES);\n $userInfo = $this->buildUserObject($_POST, $file, $pass, $addedBy);\n $email = $validateF->sanitize($_POST['user_email']);\n $this->updateUserToDatabase($userInfo, $validateF->sanitize($_GET['id']), $email);\n $_SESSION['success'] = ['User edited successfully.'];\n header('Location:index.php?action=index');\n } else{\n header('Location:index.php?action=index');\n }\n } else{\n $modelF = new ModelFunctions();\n $modelF->getAddUserForm();\n }\n } else {\n $_SESSION['error'] = ['User not found.'];\n header('Location:index.php?action=adminUsers');\n }\n\n }",
"function editsubmit() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\ttry\n\t\t{\n\t\t\n\t\t\tif (!empty($_POST['username'])&& !empty($_POST['firstname']) && !empty( $_POST['role']) && !empty($_POST['email']))\n\t\t\t{\n\t\t\t\t$userId=$_POST['userid'];\n\t\t\t\t$userName=$_POST['username'];\n\t\t\t\t$email=$_POST['email'];\n\t\t\t\n\t\t\t\t$firstname=$_POST['firstname'];\n\t\t\t\t$middlename=$_POST['middlename'];\n\t\t\t\t$lastname=$_POST['lastname'];\n\t\t\t\t$role=$_POST['role'];\n\t\t\t\t$phoneres=$_POST['phoneres'];\n\t\t\t\t$phonecell=$_POST['phonecell'];\n\t\t\t\t$isActive=$_POST['status'];\n\t\t\t\t$isLocked=$_POST['locked'];\n\t\t\t\t$comments=$_POST['comments'];\n\t\t\t\t\n\t\t\t \n\t\t\t\tUserModel::Create()->UpdateUser( $userId, $userName,$email, $firstname, $middlename, $lastname, $role, $phoneres, $phonecell, $isActive, $isLocked, $comments);\n\t\t\t\t\n\t\t\t\t$this->renderWithTemplate('users/editsubmit', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t\t$this->viewData['error']= \"Please Enter all the Required Fields and submit\"; \n\t\t\t\t$this->renderWithTemplate('common/error', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->viewData['module']=\"Edit User\";\n\t\t\t$this->viewData['error']= $ex->getMessage(); \n\t\t\t$this->renderWithTemplate('users/error', 'AdminPageBaseTemplate');\n\t\t}\n\t\t\t\n\t\t\t\n\t}",
"public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}",
"private function editResource($request, $resourceForm, $post, $version, $isLastVersion)\n {\n $coAuthors = null;\n $sendNotif = true;\n if (count($post->getCoAuthors())) {\n $coAuthors = clone $post->getCoAuthors();\n }\n if ($request->isMethod('POST')) {\n if ($resourceForm->handleRequest($request)->isValid()) {\n $em = $this->getOEM();\n $em->getConnection()->beginTransaction();\n $postDate = new \\DateTime();\n $create = true;\n\n $postContent = $post->getContent();\n // Purify HTML Content (remove scripts, onclick, etc.)\n $config = \\HTMLPurifier_Config::createDefault();\n // $config->set('HTML.TargetBlank', true);\n $config->set('Attr.AllowedFrameTargets', array('_blank'));\n $config->set('HTML.SafeIframe', true);\n $config->set('URI.SafeIframeRegexp', '%^(http:|https:)?//(www.youtube.com/embed/|player.vimeo.com/video/|www.flickr.com/services/oembed|www.hulu.com/embed|www.google.com/maps/embed|www.dailymotion.com/embed|w.soundcloud.com/player|www.slideshare.net|prezi.com|webtv.ac-versailles.fr|scolawebtv.crdp-versailles.fr|www.audio-lingua.eu|www.xmind.net)%');\n $config->set('Cache.SerializerPermissions', 0775);\n $config->set('Cache.SerializerPath', $this->get('kernel')->getCacheDir().'/htmlpurifier');\n $purifier = new \\HTMLPurifier($config);\n $cleanPostContent = $purifier->purify($postContent);\n\n // User\n $user = $this->getUser();\n\n // Post\n $post\n ->setContent($cleanPostContent)\n ->setStatus($resourceForm->get('submit_draft')->isClicked() ? PostVersion::STATUS_DRAFTING : PostVersion::STATUS_PUBLISHED);\n // reset coauthor if not author of post\n if ($user != $post->getAuthor()) {\n foreach ($coAuthors as $coAuthor) {\n $post->addCoAuthor($coAuthor);\n }\n }\n\n // New version or current ( current if last edit done less than 30 min ago)\n $recentUpdate = ($postDate->getTimestamp() - $version->getUpdateDate()->getTimestamp()) <= 1800;\n if ($isLastVersion && $recentUpdate && $version->getAuthor() == $user) {\n $postVersion = $version;\n $create = false;\n $sendNotif = false;\n } else {\n $postVersion = $this->createObject('post_version');\n }\n $postVersion\n ->setAuthor($user)\n ->setStatus($post->getStatus())\n ->setName($post->getName())\n ->setContent($cleanPostContent)\n ->setUpdateDate($postDate)\n ->setPost($post)\n ;\n\n if ($create) {\n $postVersion->setCreateDate($postDate);\n }\n\n // Group\n $group = false;\n $type = $resourceForm->get('where')->getData();\n\n switch ($type) {\n case Post::TYPE_WALL:\n $post\n ->setType(Post::TYPE_WALL)\n// ->setTargetUser($user)\n ->setPublishedGroup(null)\n ->setPublishedBlog(null)\n ->setPublishedEditor(null)\n ;\n break;\n\n case Post::TYPE_EDITOR:\n if (null !== $editor = $user->getEditor()) {\n $editor->addPost($post);\n $post\n ->setType(Post::TYPE_BLOG)\n ->setPublishedGroup(null)\n ->setPublishedBlog(null)\n ->setPublishedEditor($editor)\n ;\n } else {\n return $this->redirect($this->generateUrl('publish_publications'));\n }\n break;\n\n case Post::TYPE_BLOG:\n if (null !== $blog = $user->getBlog()) {\n $blog->addPost($post);\n $post\n ->setType(Post::TYPE_BLOG)\n ->setPublishedGroup(null)\n ->setPublishedBlog($blog)\n ->setPublishedEditor(null)\n ;\n } else {\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n break;\n\n case Post::TYPE_GROUP:\n if (null !== $group = $post->getPublishedGroup()) {\n $post\n ->setType(Post::TYPE_GROUP)\n ->setPublishedBlog(null)\n ->setPublishedEditor(null)\n ;\n $group->addPost($post);\n $this->persist($group);\n\n $this->get('rpe.logs')->create($user, Log::TYPE_POST_RESOURCE, $user, $group);\n } else {\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n break;\n\n default:\n return $this->redirect($this->generateUrl('publication_edit', array('id' => $post->getId())));\n }\n\n // MEDIAS\n // if (!$create) {\n // foreach ($postVersion->getMedias() as $media) {\n // $postVersion->removeMedia($media);\n // }\n // }\n\n foreach ($post->getMedias() as $media) {\n // Post\n $media\n ->setUser($user)\n ->setType(RpeMedia::TYPE_POST)\n ->setDate($postDate)\n // ->setDescription($post->getName())\n ;\n\n if (false === $media->getPosts()->contains($post)) {\n $media->addPost($post);\n // Version\n }\n $media->addPostVersion($postVersion);\n if (false === $user->getMedias()->contains($media)) {\n $user->addMedia($media);\n }\n };\n\n // Medias added from Library\n $libraryMedias = array_unique($resourceForm->get('library_medias')->getData());\n $userLibraryMedias = $user->getMediasFromIDs($libraryMedias);\n\n foreach ($userLibraryMedias as $media) {\n $media\n ->addPost($post)\n ->addPostVersion($postVersion)\n ;\n };\n\n $post->setUpdateDate($postDate);\n\n if ($post->isCollaborative()) {\n // close or re-open pad editing\n if ($resourceForm->get('pad_close')->getData() or true) {\n // Send \"close\" notifications to members of the group\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_PAD_CLOSE, $user, $post);\n } elseif ($padOldStatus = $post->getMeta('pad_is_closed')) {\n if ($padOldStatus->getValue()) {\n // Send \"re-open\" notifications to members of the group\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_PAD_REOPEN, $user, $post);\n }\n }\n $this->setPostMeta($post, 'pad_is_closed', $resourceForm->get('pad_close')->getData(), 'etherpad');\n }\n\n // Persis & Flush\n $this->persist($user, $post, $postVersion)->flush();\n\n // check media quota\n $user_quota = $user->getDiskQuota();\n foreach ($post->getMedias() as $media) {\n $check_media = $this->checkMediaSize($media, $user_quota);\n if ($check_media === false) {\n $em->getConnection()->rollback();\n return false;\n } else {\n $user_quota += $check_media;\n }\n }\n $this->setUserMeta($user, User::META_MEDIA_DISK_QUOTA, $user_quota);\n $em->getConnection()->commit();\n\n if (false === $resourceForm->get('submit_draft')->isClicked() && $create && $sendNotif) {\n $this->get('rpe.notifications')->wait(Notification::TYPE_RESOURCE_EDIT, $user, $post);\n }\n return $this->redirect($this->generateUrl('publication', array('id' => $post->getId())));\n\n } else {\n throw new \\RuntimeException('Form is not valid...');\n }\n }\n return false;\n }",
"public function editAction()\n {\n\n $id = $this->params()->fromRoute('id');\n $viewModel = new ViewModel(['title' => 'edit a user','id' => $id]);\n $entity = $this->params()->fromRoute('entity', 'user');\n /** @var InterpretersOffice\\Entity\\Repository\\UserRepository $repo */\n $repo = $this->entityManager->getRepository('InterpretersOffice\\Entity\\User');\n $user = $repo->getUser($id, $entity);\n if (! $user) {\n return $viewModel->setVariables(['errorMessage' =>\n \"user with id $id was not found in your database.\"]);\n }\n $this->getEventManager()->trigger('load-user', $this, ['user' => $user,]);\n $form = new UserForm($this->entityManager, [\n 'action' => 'update',\n 'auth_user_role' => $this->auth_user_role,\n 'user' => $user,'constrain_email' => true,\n ]);\n /** @var $person \\InterpretersOffice\\Entity\\Person */\n $person = $user->getPerson();\n\n /** @todo do this initialization somewhere else? */\n $form->get('user')->get('person')->setObject($person);\n /* -------------------------- */\n $viewModel->form = $form;\n $has_related_entities = $this->entityManager\n ->getRepository(Entity\\Person::class)\n ->hasRelatedEntities($person->getId());\n $viewModel->has_related_entities = $has_related_entities;\n\n if ($has_related_entities) {\n $user_input = $form->getInputFilter()->get('user');\n $user_input->get('person')->get('hat')->setRequired(false);\n $user_input->get('role')->setRequired(false);\n }\n $form->bind($user);\n $request = $this->getRequest();\n if ($request->isPost()) {\n $was_disabled = ! $user->isActive();\n $form->setData($request->getPost());\n if (! $form->isValid()) {\n return new JsonModel(['status' => 'error',\n 'validation_errors' => $form->getMessages()]);\n }\n // if they re-enabled the account\n if ($was_disabled && $user->isActive()) {\n $user->setFailedLogins(0);\n }\n $this->entityManager->flush();\n $this->flashMessenger()\n ->addSuccessMessage(sprintf(\n 'The user account for <strong>%s %s</strong> has been updated.',\n $person->getFirstname(),\n $person->getLastname()\n ));\n return new JsonModel(['status' => 'success','validation_errors' => null]);\n }\n\n return $viewModel;\n }",
"public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }",
"private function editAccount()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n //country\n if(!isset($request['country']) || $request['country']==\"\")\n throw_error_msg(\"provide country\");\n\n //sex\n if(!isset($request['sex']) || $request['sex']==\"\")\n throw_error_msg(\"provide sex\");\n\n if(!in_array($request['sex'], array('male','female')))\n throw_error_msg(\"sex must be male/female\");\n\n //dob\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n $is_valid_date = DateTime::createFromFormat('Y-m-d', $request['dob']);\n\n if(!$is_valid_date)\n throw_error_msg(\"dob must be in Y-m-d like 1990-11-18 format\");\n\n if(!isset($request['category']) || $request['category']==\"\")\n throw_error_msg(\"provide category\");\n\n $request['userid'] = userid();\n $userquery->update_user($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($request['userid']);\n \n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $user_info);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function edit_postAction() {\n $info = $this->getPost(array('uid', 'groupid', 'password', 'r_password', 'status'));\n if ($info['password']) {\n //if ($info['password'] == '') $this->output(-1, '密码不能为空.');\n if (strlen($info['password']) < 5 || strlen($info['password']) > 16) $this->output(-1, '用户密码长度5-16位之间');\n if ($info['password'] !== $info['r_password']) $this->output(-1, '两次密码输入不一致');\n }else {\n unset($info['password']);\n }\n $ret = Admin_Service_User::updateUser($info, intval($info['uid']));\n if (!$ret) $this->output(-1, '更新用户失败');\n $this->output(0, '更新用户成功.');\n }",
"function wp_editUser( $args ) {\n\n global $wp_xmlrpc_server, $wp_roles;\n $wp_xmlrpc_server->escape( $args );\n\n $blog_ID = (int) $args[0];\n $user_ID = (int) $args[1];\n $username = $args[2];\n $password = $args[3];\n $content_struct = $args[4];\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n\n $user_info = get_userdata( $user_ID );\n\n if( ! $user_info )\n return new IXR_Error(404, __('Invalid user ID'));\n\n if( ! ( $user_ID == $user->ID || current_user_can( 'edit_users' ) ) )\n return new IXR_Error(401, __('Sorry, you cannot edit this user.'));\n\n // holds data of the user\n $user_data = array();\n $user_data['ID'] = $user_ID;\n\n if ( isset( $content_struct['user_login'] ) )\n return new IXR_Error(401, __('Username cannot be changed'));\n\n if ( isset( $content_struct['user_email'] ) ) {\n\n if( ! is_email( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'Email id is not valid' ) );\n // check whether it is already registered\n if( email_exists( $content_struct['user_email'] ) )\n return new IXR_Error( 403, __( 'This email address is already registered' ) );\n $user_data['user_email'] = $content_struct['user_email'];\n \n }\n\n if( isset ( $content_struct['role'] ) ) {\n\n if ( ! current_user_can( 'edit_users' ) )\n return new IXR_Error( 401, __( 'You are not allowed to change roles for this user' ) );\n\n if( ! isset ( $wp_roles ) )\n $wp_roles = new WP_Roles ();\n if( !array_key_exists( $content_struct['role'], $wp_roles->get_names() ) )\n return new IXR_Error( 403, __( 'The role specified is not valid' ) );\n $user_data['role'] = $content_struct['role'];\n \n }\n\n // only set the user details if it was given\n if ( isset( $content_struct['first_name'] ) )\n $user_data['first_name'] = $content_struct['first_name'];\n\n if ( isset( $content_struct['last_name'] ) )\n $user_data['last_name'] = $content_struct['last_name'];\n\n if ( isset( $content_struct['user_url'] ) )\n $user_data['user_url'] = $content_struct['user_url'];\n\n if ( isset( $content_struct['nickname'] ) )\n $user_data['nickname'] = $content_struct['nickname'];\n\n if ( isset( $content_struct['user_nicename'] ) )\n $user_data['user_nicename'] = $content_struct['user_nicename'];\n\n if ( isset( $content_struct['description'] ) )\n $user_data['description'] = $content_struct['description'];\n\n if( isset ( $content_struct['usercontacts'] ) ) {\n\n $user_contacts = _wp_get_user_contactmethods( $user_data );\n foreach( $content_struct['usercontacts'] as $key => $value ) {\n\n if( ! array_key_exists( $key, $user_contacts ) )\n return new IXR_Error( 401, __( 'One of the contact method specified is not valid' ) );\n $user_data[ $key ] = $value;\n\n }\n\n }\n\n if( isset ( $content_struct['user_pass'] ) )\n $user_data['user_pass'] = $content_struct['user_pass'];\n\n $result = wp_update_user( $user_data );\n\n if ( is_wp_error( $result ) )\n return new IXR_Error( 500, $result->get_error_message() );\n\n if ( ! $result )\n return new IXR_Error( 500, __( 'Sorry, the user cannot be updated. Something wrong happened.' ) );\n\n return $result;\n \n}",
"public function actionEdit() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$first_name = $user['first_name'];\n\t\t$last_name = $user['last_name'];\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$first_name = $_POST['first_name'];\n\t\t\t$last_name = $_POST['last_name'];\n\n\t\t\t$errors = array();\n\n\t\t\tif ($error = Validator::checkName($first_name)) $errors['first_name'] = $error;\n\t\t\tif ($error = Validator::checkName($last_name)) $errors['last_name'] = $error;\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::edit($userId, $first_name, $last_name);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Edit Details\";\n\t\trequire_once(ROOT . '/views/account/edit.php');\n\n\t\treturn true;\n\t}",
"public function edit_post($user_id)\n {\n $auth_token = $this->post('auth_token');\n //$user_id = $this->post('user_id');\n $userData['fname'] = $this->post('fname');\n $userData['lname'] = $this->post('lname');\n $userData['dob'] = $this->post('dob');\n $userData['gender'] = $this->post('gender'); /* Male/Female */\n $userData['address'] = $this->post('address');\n $userData['contact_no'] = $this->post('contact_no');\n $userData['about'] = $this->post('about');\n $userData['updated_date']= time();\n \n //checking auth token\n $record = $this->artists_model->is_valid_token($user_id,$auth_token);\n if($record == 0){\n //redirect to login\n $this->response([\n 'status' => FALSE,\n 'message' => 'Unauthorize user,please login again',\n 'status_code' => 401\n ], REST_Controller::HTTP_UNAUTHORIZED); // UNAUTHORIZED (401) being the HTTP response code\n }\n \n \n \n if( $user_id != '' && $userData['fname'] != '' && $userData['lname'] != '' && $userData['dob'] != '' && $userData['gender'] != '' \n && $userData['address'] != '' && $userData['contact_no'] != '' && $userData['about'] != '')\n {\n $record = $this->artists_model->update_user($user_id,$userData);\n $user_data = $this->artists_model->get_user_details($user_id);\n $message = [\n 'status' => TRUE,\n 'message' => 'User information updated successfully',\n 'user_data' => $user_data,\n 'status_code'=> 200 \n ];\n $this->set_response($message, REST_Controller::HTTP_OK);\n }\n else\n {\n $message = [\n 'status' => FALSE,\n 'message' => 'User information not updated,please enter required fields properly',\n 'status_code'=> 400\n ];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); \n }\n }",
"public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }",
"protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}",
"public function actioneditProfile()\n\t{\t\n\t\t$data = array();\n\t\t$data['city'] = $_POST['city'];\n\t\t\n\t\t\n\t\t$userObj = new Users();\n\t\t$userObj->setData($data);\n\t\t$userObj->insertData($_POST['userId']);\n\t\tYii::app()->user->setFlash('success',\"Successfully updated\");\n\t\t$this->redirect('admin/users');\n\t\t//Yii::app()->user->setFlash('error',\"Please update your profile\");\n\t\t//$this->render('userProfile',$profileData);\n\t\n\t}",
"public function testEditPostBadDataForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t\t'data' => [\n\t\t\t\t'BAD_MODEL' => []\n\t\t\t]\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'2'\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('The deferred save not be saved. Please, try again.'));\n\t\t}\n\t}",
"public function postUserupdate(){\n \n $uid = Input::get('user_id');\n $user = User::find($uid);\n if($user != ''){\n $user->email = Input::get('useremail');\n $user->fullname = Input::get('fullname');\n $user->category = Input::get('category');\n $user->language = Input::get('language');\n $user->enable = Input::get('enable');\n $user->save();\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'User data updated!');\n }else{\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'No such user!');\n }\n\n }",
"public function postAddResource()\n {\n\n $errors = validateAddResources();\n\n if(!($errors === true)) {\n\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n $this->_f3->reroute('/Admin');\n }\n\n }",
"public function edituserActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n // Retrieves contentId\n $username = getPost(\"username\");\n\n if (hasKeyPost(\"doDelete\")) {\n return $this->app->response->redirect(\"admin/deleteuser&username=$username\");\n }\n\n if (hasKeyPost(\"doSave\")) {\n $params = getPost([\n \"firstname\",\n \"lastname\",\n \"email\",\n \"password\",\n \"username\"\n ]);\n\n // Calls editUser method\n $this->admin->editUser($params);\n\n // Redirects\n return $this->app->response->redirect(\"admin/users\");\n }\n }",
"function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }",
"public function editprofile_action()\n {\n Auth::checkAuthentication();\n \n \n $postname = Request::post('user_name');\n $postemail = Request::post('user_email');\n $postbio = Request::post('user_bio');\n\n\n if(Session::get('user_name') != $postname && $postname != null)\n {\n UserModel::editUserName($postname);\n }\n \n if(Session::get('user_email') != $postemail && $postemail != null)\n {\n UserModel::editUserEmail($postemail);\n }\n \n //null is checked in this method\n AvatarModel::createAvatar();\n \n if(Session::get('user_bio') != $postbio && $postbio != null)\n {\n UserModel::editBio($postbio);\n }\n\n return true;\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n\n $loggedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $this->getIdentity()->getId() );\n\n $editedUser = $this\n ->getEntityManager()\n ->getRepository('Core\\Entity\\User')\n ->find( $id );\n\n $form = $this->createForm('\\Panel\\Form\\User\\User', array(\n 'loggedUserRole' => $loggedUser->getRole(),\n 'editedUserRole' => $editedUser->getRole(),\n ));\n\n if($id)\n {\n $form = $form->bindObjectById($id);\n }\n\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $data = array(\n 'name' => $request->getPost()->name,\n 'email' => $request->getPost()->email,\n 'phone' => $request->getPost()->phone,\n 'birthDate' => $request->getPost()->birthDate,\n 'height' => $request->getPost()->height,\n 'tmrModifier' => $request->getPost()->tmrModifier,\n 'goalWeight' => $request->getPost()->goalWeight,\n 'personality' => $request->getPost()->personality,\n 'activityLevel' => $request->getPost()->activityLevel,\n 'isFemale' => $request->getPost()->isFemale,\n 'status' => $request->getPost()->status,\n 'role' => $request->getPost()->role,\n );\n\n if($request->getPost()->password!='')\n {\n $data['password'] = $request->getPost()->password;\n }\n\n $form->setData($data);\n\n if ($form->isValid())\n {\n $entityManager = $this->getEntityManager();\n\n $user = $form->getObject();\n\n if($request->getPost()->password!='')\n {\n $user->setPassword($request->getPost()->password);\n }\n\n $userFromEmail = $entityManager\n ->getRepository('Core\\Entity\\User')\n ->findOneBy(array('email' => $user->getEmail()));\n\n if($userFromEmail==null || $userFromEmail->getId()==$user->getId())\n {\n $entityManager->persist($user);\n $entityManager->flush();\n\n $this->flashMessenger()->addSuccessMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User has been modified.\")\n );\n\n if( $id)\n {\n return $this->redirect()->toRoute(\n 'panel/user/:id', array('id' => $id)\n );\n }\n else\n {\n return $this->redirect()->toRoute('panel/user');\n }\n }\n else\n {\n $form->setData($request->getPost());\n\n $this->flashMessenger()->addErrorMessage(\n $this->getServiceLocator()->get('translator')\n ->translate(\"User hasn't been modified. E-mail already exists.\")\n );\n }\n }\n }\n\n $view = new ViewModel();\n $view->setVariable('user', $form->getObject());\n $view->setVariable('form', $form);\n\n return $view;\n }",
"function update ( $post ) {\n if ( !isset($post['id']) || !User::exists($post['id']) ) {\n \t$_SESSION['fail'] = \"You must select a user\";\n \theader( 'Location: index.php?action=index');\n \texit;\n }\n \n // get the existing user\n $user = User::find( 'first', $post['id']);\n \n // update the values\n $user->first_name = $post['first_name'];\n $user->last_name = $post['last_name'];\n $user->email = $post['email'];\n \n // if the password has been set\n if ( !empty($post['password'])) {\n \t$user->password = $post['password'];\n \t$user->confirm_password = $post['confirm_password'];\n }\n \n \n $user->role = $post['role'];\n \n //save the user\n $user->save(false);\n \n // check if save method\n if ($user->is_invalid()) {\n \t// set the massage\n \t$_SESSION['fail'][] = $user->error->full_messagr();\n \t$_SESSION['fail'][] = 'The user could not be updated.';\n \t\n \t// redirect\n \theader( 'Location: index.php?action=edit&id=' . $user->id);\n \texit;\n }\n \n // refresh session (when login user and updated user are same user)\n if ($user->id == $_SESSION['id']) {\n \t$_SESSION['role'] = $user->role;\n \t$_SESSION['email'] = $user->email;\n }\n \n // set the success message and redirect\n $_SESSION['success'] = 'User was updated successfully.';\n header('Location: index.php?action=index');\n }",
"private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}",
"function actionEditUser($templateVars) {\n\n\t$currentProperty = propertiesGetCurrent();\n\t$currentDivision = divisionsGetCurrent();\n\t$currentDepartment = departmentsGetCurrent();\n\t$currentUser = usersGetCurrent();\n\t\n\tif(!empty($_POST) && isset($_POST['editPropertyForm'])) {\n\t\t\n\t\t$validForm = true;\n\n\t\t$currentUser['firstname'] = $_POST['firstname'];\n\t\tif(empty($currentUser['firstname'])) {\n\t\t\t$templateVars['userFirstnameError'] = 'Please enter a first name for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\t$currentUser['lastname'] = $_POST['lastname'];\n\t\tif(empty($currentUser['lastname'])) {\n\t\t\t$templateVars['userLastnameError'] = 'Please enter a last name for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\t$currentUser['email'] = $_POST['emailname'];\n\t\tif(empty($currentUser['email'])) {\n\t\t\t$templateVars['userEmailError'] = 'Please enter an email for this user';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\tif($validForm == true) {\n\t\t\t$property['name'] = $newPropertyName;\n\t\t\tpropertiesUpdateRecord($property);\n\t\t\tredirectToPage('settings/properties/listing');\n\t\t}\n\t}\n\n\t$templateVars['accessLevels'] = accessLevelsGetAll();\n\t$templateVars['currentProperty'] = $currentProperty;\n\t$templateVars['currentDivision'] = $currentDivision;\n\t$templateVars['currentDepartment'] = $currentDepartment;\n\t$templateVars['currentUser'] = $currentUser;\n\n\treturn $templateVars;\n}",
"public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\n }"
] | [
"0.6944832",
"0.6506544",
"0.64835507",
"0.6443123",
"0.63922614",
"0.637695",
"0.63103336",
"0.6148198",
"0.61414236",
"0.6123014",
"0.6107582",
"0.6100233",
"0.6037071",
"0.60338557",
"0.6010923",
"0.5978386",
"0.59742177",
"0.5962707",
"0.5936845",
"0.59142584",
"0.5901627",
"0.58937055",
"0.58858156",
"0.58852243",
"0.5874045",
"0.58686537",
"0.5856295",
"0.57973945",
"0.5794734",
"0.57757527"
] | 0.71640736 | 0 |
/ deleteResource Does not delete resource rather deactivates the resources | public function deleteResource()
{
$database = new Database();
$id = $this->_params['id'];
$database->deleteResource($id);
$this->_f3->reroute('/Admin');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isDeleteResource();",
"protected function _postDelete()\n {\n $this->clearResources();\n }",
"public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"function deletableResources(){\n\n return $this->resourcesByPermission('delete');\n }",
"public function reactivateResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->reactivateResource($id);\n $this->_f3->reroute('/Admin');\n }",
"public function undeleteAction(){\n\t}",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }",
"public function deleteResources($id) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE FROM resources_activity WHERE actividad=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t}",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();"
] | [
"0.7185629",
"0.6980644",
"0.66985935",
"0.6495744",
"0.64732426",
"0.6464758",
"0.6454451",
"0.63758194",
"0.63742036",
"0.6359977",
"0.62655574",
"0.6264933",
"0.6247014",
"0.61904836",
"0.61854434",
"0.6162815",
"0.61621654",
"0.6136099",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105",
"0.61252105"
] | 0.7421805 | 0 |
/ reactivateResource reactivates resources | public function reactivateResource()
{
$database = new Database();
$id = $this->_params['id'];
$database->reactivateResource($id);
$this->_f3->reroute('/Admin');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function reactivateAction()\n {\n $this->reactivateParameters = $this->reactivateParameters + $this->_reactivateExtraParameters;\n\n parent::reactivateAction();\n }",
"public function reactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeActive', array(\n 'title' => t('Reactivate recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }",
"function _deactivate() {}",
"public function deactivate_resource($resource_id, $page)\n\t{\n\t\tif($this->resource_model->deactivate_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been disabled');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be disabled');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function _deactivate() {\r\n\t\t// Add deactivation cleanup functionality here.\r\n\t}",
"public function recycle(){\n $qry = new InvokePostMethodQuery($this->getResourcePath(),\"recycle\");\n $this->getContext()->addQuery($qry);\n }",
"private function activateResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->activateResource($resource);\n $this->validateActivatedResource($blueprint, $resource);\n }",
"public function deactivate(): void;",
"public function deactivate();",
"public static function deactivate(){\n }",
"public static function deactivate(){\n }",
"abstract public function deactivate();",
"public static function deactivate() {\n\t}",
"public static function deactivate() {\n\n }",
"public static function deactivate()\n\t{\n\n\t}",
"public static function deactivate ()\n\t{\n\t}",
"function deactivate() {\n\t}",
"public function deactivate() {\n\n }",
"public function deactivate() {\n\n }",
"function deactivate() {\n \n $this->reset_caches();\n $this->ext->update_option( 'livefyre_deactivated', 'Deactivated: ' . time() );\n\n }",
"public static function deactivate()\n {\n }",
"public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}",
"public function refresh()\n {\n // Several refresh() calls might happen during one request. If that is the case, the Resource Manager can't know\n // that the first created resource object doesn't have to be persisted / published anymore. Thus we need to\n // delete the resource manually in order to avoid orphaned resource objects:\n if ($this->resource !== null) {\n $this->resourceManager->deleteResource($this->resource);\n }\n\n parent::refresh();\n $this->renderResource();\n }",
"public static function activate() {\n\t\t\tdelete_site_transient('update_themes');\n\t\t\tdelete_site_transient('storefront_latest_tag');\n\t\t}",
"protected function deactivateSelf() {}",
"public function deactivateAction()\n {\n $this->deactivateParameters = $this->deactivateParameters + $this->_deactivateExtraParameters;\n\n parent::deactivateAction();\n }",
"public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}",
"public function register_deactivation();",
"public function deallocate_resource_from_user($resource_id) {\n $sql = 'UPDATE resources\n SET is_allocated = :is_allocated\n WHERE id = :id';\n\n $data = [\n ':id' => $resource_id,\n ':is_allocated' => false,\n ];\n\n $query = $this->pdo->prepare($sql);\n $query->execute($data);\n }",
"function revoke()\n\t{\n\t}"
] | [
"0.64953566",
"0.6302144",
"0.60357034",
"0.589782",
"0.5866548",
"0.58366936",
"0.5817751",
"0.5729667",
"0.5701669",
"0.5700907",
"0.5700907",
"0.5695641",
"0.569047",
"0.56877214",
"0.5616308",
"0.559881",
"0.5586113",
"0.55649954",
"0.55649954",
"0.554401",
"0.55416965",
"0.5470191",
"0.5430438",
"0.54117596",
"0.5391087",
"0.5388591",
"0.5374472",
"0.53197235",
"0.53017205",
"0.52997714"
] | 0.8236729 | 0 |
/ viewResources Loads from the db all active AND current events and renders the resources page | public function viewResources()
{
$database = new Database();
$resources = $database->getAllActiveResourcesNoLimit();
$resourceArray = array();
$i = 1;
foreach ($resources as $resource) {
$availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']
, $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,
$resource['Link'], $resource['active']);
array_push($resourceArray, $availableResource);
$i += 1;
}
$resourceSize = sizeof($resourceArray);
$this->_f3->set('resourcesByActive', $resourceArray);
$this->_f3->set('resourcesSize', $resourceSize);
echo Template::instance()->render('view/include/head.php');
echo Template::instance()->render('view/include/top-nav.php');
echo Template::instance()->render('view/resources.php');
echo Template::instance()->render('view/include/footer.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction() {\n $this->view->events = $this->_events->getEventsAdmin($this->_getParam('page'));\n }",
"public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }",
"public function LoadAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n return $this->render('events/updatesAjax.html.twig', array(\n 'events' => $events,\n ));\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 loadEvents() {\n $events = Event::orderBy('date', 'desc')->paginate(10);\n \n return view('cms.events', ['events' => $events]);\n }",
"public function actionEvents()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('events');\n\t}",
"public function indexAction() {\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t$limit =$this->_getParam('max',5);\n\t\t$currentDay = date('Y') . '-' . date('m') . '-' . date('d');\n\t\t\n\t\t$table = Engine_Api::_()->getItemTable('event');\n\t\t$select = $table->select()\n ->where('category_id = ?', $event->category_id)\n ->where('event_id != ?', $event->getIdentity())\n ->order(\"DATEDIFF('{$currentDay}', starttime) DESC\")\n ->limit($limit);\n\n\t\t$showedEvents = $table->fetchAll($select);\n\t\t$this->view->showedEvents = $showedEvents;\n\t\t// Hide if nothing to show\n\t\tif( count($showedEvents) <= 0 ) {\n\t return $this->setNoRender();\n\t }\n }",
"public function viewAllEvents();",
"public function index()\n {\n \n return EventResource::collection(Event::all());\n\n\n }",
"function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n\n return $this->render('events/index.html.twig', array(\n 'events' => $events,\n ));\n }",
"public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\n ));\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function viewEvents();",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:Event')->findBy(\n ['archived' => '0'],\n ['startDate' => 'DESC']\n );\n\n return $this->render(\n 'event/index.html.twig',\n [\n 'events' => $events,\n ]\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('MALrmBundle:CalendarEvent')->findAll();\n\n\n return $this->render('MALrmBundle:event:index.html.twig', array(\n 'events' => $events,\n ));\n }",
"public function index() {\n $this->seo(array(\n \"title\" => \"All Events List\",\n \"keywords\" => \"events, new events, event management, create event, event tickets, book event tickets\",\n \"description\" => \"Display all the latest events. Filter the events by categories, location and much more. Register yourself to turn your passion into your business\",\n \"view\" => $this->getLayoutView()\n ));\n $view = $this->getActionView();\n\n $title = RequestMethods::get(\"title\", \"\");\n $category = RequestMethods::get(\"category\", \"\");\n $type = RequestMethods::get(\"type\", \"\");\n $limit = RequestMethods::get(\"limit\", 10);\n $page = RequestMethods::get(\"page\", 1);\n $where = array(\n \"title LIKE ?\" => \"%{$title}%\",\n \"category LIKE ?\" => \"%{$category}%\",\n \"type LIKE ?\" => \"%{$type}%\",\n \"live = ?\" => true\n );\n $events = Event::all($where, array(\"*\"), \"created\", \"desc\", $limit, $page);\n $count = Event::count($where);\n\n $view->set(\"events\", $events);\n $view->set(\"limit\", $limit);\n $view->set(\"page\", $page);\n $view->set(\"count\", $count);\n $view->set(\"title\", $title);\n $view->set(\"type\", $type);\n $view->set(\"category\", $category);\n }",
"public function index() {\n\t\t$this->load->helper('date');\n\t\t$data['events'] = $this->event_model->get();\n\t\tfor($iii = 0; $iii < sizeof($data['events']); $iii++) {\n\t\t\t$event_info = $this->event_info_model->get_event($data['events'][$iii]['event_id']);\n\t\t\t$data['events'][$iii]['info'] = $event_info;\n\t\t\tif($event_info != NULL) {\n\t\t\t\t$data['events'][$iii]['account'] = $this->account_model->get($event_info->event_accounts_account_id);\n\t\t\t} else {\n\t\t\t\t$data['events'][$iii]['account'] = NULL;\n\t\t\t}\n\t\t}\n\n\t\t$data['content'] = 'events/index';\n\t\t$data['stylesheets'] = 'events/index_stylesheets';\n\t\t$data['scripts'] = 'events/index_scripts';\n\t\t$data['title'] = 'Events';\n\t\t$data['sub_title'] = 'The page for the events';\n\t\t$this->load->view($this->layout, $data);\n\t}",
"public function viewAction() {\n if (!Engine_Api::_()->core()->hasSubject('siteevent_organizer'))\n $this->respondWithError('unauthorized');\n\n $showEvents = $this->_getParam('showEvents', 1);\n $profileTabs = $this->_getParam('profileTabs', 1);\n $getInfo = $this->_getParam('getInfo', null);\n\n\n $viewtype = $this->_getParam('viewType', 'upcoming');\n\n //GET EVENT SUBJECT\n $organizer = Engine_Api::_()->core()->getSubject();\n if (empty($organizer)) {\n return $this->respondWithError('no_record');\n }\n $response = $organizer->toArray();\n\n $suffix = '';\n if (strpos($response['web_url'], \"http\") === false)\n $suffix = \"http://\";\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $response['facebook_url'] = 'https://facebook.com/' . $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $response['twitter_url'] = 'https://twitter.com/' . $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $response['web_url'] = $suffix . $response['web_url'];\n\n $contentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($organizer);\n $response = array_merge($response, $contentImages);\n $response['countOrganizedEvent'] = $organizer->countOrganizedEvent();\n $response['addedBy'] = $organizer->getOwner()->displayname;\n\n if (isset($getInfo) && !empty($getInfo)) {\n $getInfoArray['Added By'] = $response['addedBy'];\n $getInfoArray['Events Hosted '] = $organizer->countOrganizedEvent();\n\n $allowedInfo = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.hostinfo', array('body', 'sociallinks'));\n\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description']))\n $getInfoArray['Description'] = strip_tags($response['description']);\n }\n\n if (in_array('sociallinks', $allowedInfo)) {\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $getInfoArray['Facebook URL'] = $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $getInfoArray['Twitter URL'] = $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $getInfoArray['Web URL'] = $response['web_url'];\n }\n\n $ratingEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.reviews', 2);\n if ($ratingEnable) {\n $tempRating = Engine_Api::_()->getDbtable('events', 'siteevent')->avgTotalRating(\n array('host_type' => $organizer->getType(), 'host_id' => $organizer->getIdentity(), 'more_than' => 0));\n\n // Added variable for rating to show rating bar\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['total_rating'] = $tempRating;\n } else {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['Total Rating'] = $tempRating;\n }\n }\n\n // Added variable for description to show full description\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description'])) {\n $getInfoArray['description'] = strip_tags($response['description']);\n if (isset($getInfoArray['Description']) && !empty($getInfoArray['Description']))\n unset($getInfoArray['Description']);\n }\n }\n }\n\n if (isset($getInfoArray) && !empty($getInfoArray))\n $this->respondWithSuccess($getInfoArray, true);\n }\n\n// //GET EVENTS PAGINATOR\n// $paginator = Engine_Api::_()->getDbTable('events', 'siteevent')->getSiteeventsPaginator($values, $customProfileFields);\n// $paginator->setItemCountPerPage($this->getRequestParam(\"limit\", 20));\n// $paginator->setCurrentPageNumber($this->getRequestParam(\"page\", 1));\n//\n// //SET VIEW\n// Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n// $response['canCreate'] = Engine_Api::_()->authorization()->isAllowed('siteevent_event', $viewer, 'create');\n// $response[\"getTotalItemCount\"] = $getTotalItemCount = $paginator->getTotalItemCount();\n//\n//\n// if (isset($showEvents) && !empty($showEvents) && empty($getInfo)) {\n// try {\n// $values['viewType'] = $viewtype;\n// $values['host_type'] = 'siteevent_organizer';\n// $values['host_id'] = $organizer->getIdentity();\n//\n//\n// if (!empty($getTotalItemCount)) {\n// foreach ($paginator as $eventObj) {\n// $event = $eventObj->toArray();\n//\n// // ADD OWNER IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj, true);\n// $event = array_merge($event, $getContentImages);\n// $event[\"owner_title\"] = $eventObj->getOwner()->getTitle();\n//\n// // ADD EVENT IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj);\n// $event = array_merge($event, $getContentImages);\n// $tempResponse[] = $event;\n// }\n// $response['events'] = $tempResponse;\n// }\n// } catch (Exception $e) {\n// \n// }\n// }\n\n\n if (isset($profileTabs) && !empty($profileTabs) && empty($getInfo)) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_info',\n 'label' => $this->translate('Info'),\n 'url' => 'advancedevents/organizer/' . $organizer->getIdentity(),\n 'urlParams' => array(\n 'getInfo' => 1\n )\n );\n\n if ($organizer->countOrganizedEvent() > 0) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_events',\n 'label' => $this->translate('Events'),\n 'url' => 'advancedevents/',\n 'totalItemCount' => $organizer->countOrganizedEvent(),\n 'urlParams' => array(\n 'host_type' => 'siteevent_organizer',\n 'host_id' => $organizer->getIdentity()\n )\n );\n }\n\n $response['profileTabs'] = $profileTabsArray;\n }\n $this->respondWithSuccess($response, true);\n }",
"public function viewAddResources()\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function actionIndex()\n {\n if(\\Yii::$app->user->can('verMarcacaoConsulta')) {\n $tempVariable = Medicos::dataByUser(Yii::$app->user->id);\n $times = MarcacaoConsulta::dataByUserBack($tempVariable['id']);\n\n $events = [];\n foreach ($times as $time) {\n\n $temp = Especialidade::dataByEspecialidade($time['id_especialidade']);\n\n\n $Event = new Event();\n $Event->id = $time['id'];\n $Event->backgroundColor = $this->chooseColor($time['status']);\n $Event->title = $temp['tipo'];\n $Event->start = date(($time['date']));\n $Event->url = 'index.php?r=marcacao-consulta/view&id=' . $time['id'];\n $events[] = $Event;\n\n }\n\n return $this->render('index', [\n 'events' => $events,\n ]);\n }\n }",
"public function resources(){\n\t\t$this->verify();\n\t\t$data['title']=\"Resources\";\n\t\t$data['category']=$this->admin_model->fetch_rescources_cat();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('resources/resources', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}",
"public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $dataProvider = new CActiveDataProvider(\n Events::model()->upcoming()->active()\n );\n //$events = Events::model()->findAll(\"start_date>= '\" . date('Y-m-d') . \"' AND is_active=1\");\n $this->render('//events/index', array('dataProvider' => $dataProvider));\n }",
"public function listEventsAction()\n {\n $events = $this->getDoctrine()->getRepository('AppBundle:Event')->findEventsByManager($this->getUser());\n\n return $this->render('AppBundle:frontend/manager:event_list.html.twig', [\n 'events' => $events,\n ]);\n }",
"public function actionIndex()\r\n {\r\n $events = Events::find()->all();\r\n\t\t$tasks = [];\r\n\t\tforeach ($events as $eve) {\r\n\t\t $event = new \\yii2fullcalendar\\models\\Event();\r\n\t\t $event->id = $eve->id;\r\n\t\t $event->title = $eve->title;\r\n\t\t $event->start = $eve->date_created;\r\n\t\t $tasks[] = $event;\t\t\r\n\t\t}\r\n\t\t\r\n return $this->render('index', [\r\n 'events' => $tasks,\r\n ]);\r\n }",
"public function index()\n {\n return view(\"admin.event\")->with([\n \"events\" => Event::query()->orderBy(\"created_at\", \"desc\")->paginate()\n ]);\n }",
"function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }",
"public function action_index()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t//return Response::forge(View::forge('event/index',$data));\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}",
"public function indexAction()\n {\n /* $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('EventBundle:Event')->findAll();\n\n return array(\n 'events' => $events,\n );*/\n return array();\n }",
"public function events()\n {\n $config = SchoolYearConfig::where('is_active', 1)->first();\n\n $events = Update::where('school_year', $config->school_year)->get();\n return view('welcome')->with('events', $events);\n }"
] | [
"0.68937624",
"0.6832855",
"0.6737387",
"0.66969204",
"0.6687211",
"0.66647995",
"0.6630551",
"0.6605819",
"0.65798235",
"0.65522707",
"0.6503299",
"0.64920044",
"0.64855295",
"0.64187247",
"0.6392682",
"0.6380522",
"0.6375011",
"0.63708305",
"0.6357326",
"0.6346072",
"0.6332452",
"0.628499",
"0.62772816",
"0.62079144",
"0.61855423",
"0.6155567",
"0.61506844",
"0.6141002",
"0.61260206",
"0.6114621"
] | 0.7391225 | 0 |
/ WAS WRITTEN BY A TEAMMATE isLoggedIn Checks to see if a "user" is logged in and has access to resource loading edit/add resources page | public function isLoggedIn()
{
$database = new Database();
$loggedIn = $database->getAdminByUsername($_SESSION['user']);
$admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);
if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Resources) !== false && $admin->getActive() == 1) {
$testLogin = true;
} else {
$this->_f3->reroute('/Login');
}
$this->_f3->set('login', $testLogin);
$this->_f3->set('admin', $admin);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isUserLoggedIn() {}",
"protected function isUserLoggedIn() {}",
"static public function isLoggedIn(){\n \treturn (self::getInstance()->getId()>1);\n }",
"function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn();\n\t\t}",
"function isLoggedIn()\n\t{\n\t\tif ( $this->_isAuthorized() ){\t\n\t\t\treturn true;\n\t\t} else return false;\n\t\n\t}",
"function IsLoggedIn() {\t\tif( Member::currentUserID() ) {\r\n\t\t return true;\r\n\t\t}\r\n }",
"abstract protected function isUserLoggedIn() ;",
"public function isCurrentlyLoggedIn() {}",
"public function isLoggedIn();",
"public function isLoggedIn();",
"function isLoggedIn(){\n return $this->auth->isLoggedIn();\n }",
"public function isLoggedIn()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Partner) !== false && $admin->getActive() == 1) {\n $testLogin = true;\n } else {\n $this->_f3->reroute('/Login');\n }\n $this->_f3->set('login', $testLogin);\n $this->_f3->set('admin', $admin);\n }",
"public function isLoggedIn()\n {\n return true;\n }",
"function checkSessionAll(){\r\n \tif($this->Session->check('User')){\r\n \t\t//the user is logged in, allow the wiki edit featur\r\n \t\t//the layout will know more than we do now \r\n \t\t$cuser = $this->Session->read('User');\r\n \t\tif($cuser['account_type'] == 'admin'){\r\n \t\t\t$this->set('admin_enable', true);\r\n \t\t}else{\r\n \t\t\t$this->set('admin_enable', false);\r\n \t\t}\r\n \t\t\r\n \t}else{\r\n \t\t$this->set('admin_enabled', false);\r\n \t}\r\n }",
"public static function isLoggedIn(){\n if(!self::exists('is_logged_in')&& self::get('is_logged_in')!==true){\n \n header('location:' . URL . 'user/login.php');\n exit;\n }\n }",
"function logged_in() {\r\n\t\treturn isset($_SESSION[\"admin_id\"]);\r\n\t}",
"function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }",
"public function is_logged_in() {\n return isset($this->admin_id) && $this->last_login_is_recent();\n \n }",
"protected function isCurrentUserAdmin() {}",
"protected function isCurrentUserAdmin() {}",
"function isRestricted() {\t\n\n\t\tif (isset($_SESSION['logged-in']) && $_SESSION['isAdmin']) {\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Location: restricted.php\");//Instant Re direct to Restricted due to lack of permissions.\n\t\t}\t\t\t\n\t}",
"function logged_in() {\n\t\tif (isset($_SESSION['admin_id'])) {\n\t\t\tif($_SESSION['username'] === \"main_admin\"){ \n\t\t\t\treturn 1; \n\t\t\t}\n\t\t}\n\t\treturn 0; \n\t}",
"function loggedin() {return $this->login_state!=0;}",
"function postasevent_limit_rest_view_to_logged_in_users( $is_allowed, $cmb_controller ) {\n\tif ( ! is_user_logged_in() ) {\n\t\t$is_allowed = false;\n\t}\n\n\treturn $is_allowed;\n}",
"function logged_in() {\n\treturn isset($_SESSION['admin_id']);\n}",
"protected function isLoggedIn()\n\t{\n\t\treturn is_user_logged_in();\n\t}",
"function isLoggedIn(){\r\n APP::import('Component','Auth');\r\n $auth = new AuthComponent;\r\n $auth ->Session = $this->Session;\r\n $user = $auth->user();\r\n return !empty($user);\r\n \r\n }",
"public function is_logged_in() {\n\n\t}",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }",
"function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }"
] | [
"0.6789557",
"0.6789557",
"0.6721296",
"0.67202145",
"0.6572017",
"0.65710735",
"0.6539391",
"0.6513537",
"0.6506057",
"0.6506057",
"0.64774925",
"0.64721805",
"0.63732624",
"0.6345719",
"0.6341831",
"0.6336483",
"0.631939",
"0.6312657",
"0.63074297",
"0.6304597",
"0.63012326",
"0.6276492",
"0.62760854",
"0.6267422",
"0.62671393",
"0.6242948",
"0.6238465",
"0.6237872",
"0.62281257",
"0.62281257"
] | 0.68913954 | 0 |
Return new link position in list | protected function _getNewPosition($position = 0)
{
if (intval($position) > 0) {
while (isset($this->_links[$position])) {
$position++;
}
} else {
$position = 0;
foreach ($this->_links as $k=>$v) {
$position = $k;
}
$position += 10;
}
return $position;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddLink()\n\t\t{\n\t\t\t$n=count($this->links)+1;\n\t\t\t$this->links[$n]=array(0,0);\n\t\t\treturn $n;\n\t\t}",
"public function getSortNewItemsPosition()\n\t{\n\t\treturn $this->new_items_position;\n\t}",
"public function getNextPosition(): Position;",
"abstract function incrementPosition();",
"private function _incrementEntryPointer()\n\t{\n\t\t$this->_setEntryPointer($this->_getEntryPointer() + 1);\n\t}",
"abstract public function getNextIndex();",
"function linkId() \n \t{\n \t\treturn $this->linkId;\n \t}",
"public function get_next_nav_position()\n\t{\n\t\t// get the last record\n\t\t$row = $this->db->order_by('position', 'DESC')->limit(1)->get($this->_table['navigation'])->row();\n\n\t\t// return that record position number +1\n\t\treturn $row->position + 1;\n\t}",
"public function getNext ()\n {\n return prev ( $this->_list ) ;\n }",
"public function link_id()\n {\n return $this->Link_ID;\n }",
"function get_next_mod_index() {\n\t\t$index = $this->mod_index;\n\t\t$this->mod_index++;\n\t\treturn $index;\n\t}",
"public function next_link()\n\t{\n\t\treturn $this->link_to_page($this->get_cur_page() + 1);\n\t}",
"public function get_position(){ return $this->_position;}",
"function getPosition() ;",
"public function getNewLineNo(): int\n {\n return intval($this->newLineNo);\n }",
"public function getPosition(): int\n {\n return $this->position;\n }",
"public function getPosition(): int\n {\n return $this->position;\n }",
"public function position()\n {\n return $this->i;\n }",
"public function key(): int\n {\n return $this->position;\n }",
"public function key(): int\n {\n return $this->position;\n }",
"public function key(): int\n {\n return $this->position;\n }",
"public function getPosition() : int\n {\n $rtn = $this->data['position'];\n\n return $rtn;\n }",
"function getPosition() {\n\t\t}",
"public function getPosition() {}",
"public function getPosition() {}",
"public function setSortNewItemsPosition($a_position)\n\t{\n\t\t$this->new_items_position = (int)$a_position;\n\t}",
"function key() {\r\n return $this->_position;\r\n }",
"function getLink($hash, $newHash) {\n\t\t$link = getDbConnect();\n\t\n\t\t//get the id\n\t\tif ($newHash) \n\t\t\t$id = base_convert($hash, 36, 10);\n\t\telse\n\t\t\t$id = hexdec($hash);\n\n\t\t//do our search\n\t\t$preparedStatement = $link->prepare(\"SELECT url FROM urls WHERE id = :id;\");\n\t\t$preparedStatement->execute(array(\":id\" => $id));\n\t\t$results = $preparedStatement->fetchAll();\n\t\n\t\t//cleanup our URL\n\t\t$url = stripslashes($results[0][\"url\"]);\n\t\t\n\t\t$preparedStatement = $link->prepare(\"UPDATE urls SET visits = visits+1 WHERE id = :id;\");\n\t\t$preparedStatement->execute(array(\":id\" => $id));\n\t\treturn $url;\n\t}",
"public function getPosition()\n {\n return -1;\n }",
"private function incCurrentSitemap()\n {\n $this->current_sitemap = $this->current_sitemap + 1;\n }"
] | [
"0.6248835",
"0.6009544",
"0.5550225",
"0.54498684",
"0.5420793",
"0.5336731",
"0.5322765",
"0.53133106",
"0.52839047",
"0.52218425",
"0.5215148",
"0.52128255",
"0.5184581",
"0.517296",
"0.5140279",
"0.51061803",
"0.51061803",
"0.5105887",
"0.50225216",
"0.50225216",
"0.50225216",
"0.4965805",
"0.495663",
"0.4954861",
"0.4954861",
"0.49428004",
"0.49401236",
"0.49398336",
"0.49257234",
"0.49231276"
] | 0.67542017 | 0 |
Get the class name for the filters, the part after _Agenda_Filter_ | abstract public function getFilterClass(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getFilterClassName($string);",
"abstract public function getFilterName();",
"public static function getFiltername(): string\n {\n return self::FILTERNAME;\n }",
"public function getFilterClass()\n {\n return 'XorAppointmentFilter';\n }",
"protected function filterName(): string\n {\n return Str::snake(class_basename($this));\n }",
"public function getClassFilter()\n {\n return $this->get(self::CLASS_FILTER, null);\n }",
"public static function GET_FILTERS_CLASS(): array\n\t{\n\t\treturn self::$filtersClass;\n\t}",
"public function getName()\n {\n return \"apihour_contractors_filters_type\";\n }",
"function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.paracite.filter.ParaciteRawCitationNlm30CitationSchemaFilter';\n\t}",
"function getClassName() {\n\t\treturn 'lib.pkp.plugins.citationParser.parscit.filter.ParscitRawCitationNlm30CitationSchemaFilter';\n\t}",
"public function getName() {\n return 'apihour_product_list_filters_type';\n }",
"protected function classFilterName($class)\n {\n if (is_object($class)) {\n $class = get_class($class);\n }\n return substr($class, strrpos($class, '\\\\') + 1);\n }",
"function getFilterFileName($filter_name)\n {\n return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Filter'\n . DIRECTORY_SEPARATOR . $filter_name . '.php';\n }",
"public function getFormClassToExtend() {\n return null === ($model = $this->getParentModel()) ? 'BaseFormFilterDoctrine' : sprintf('%sFormFilter', $model);\n }",
"static public function rootNameSpaceForFilters()\n {\n return __NAMESPACE__ .\"\\\\Filter\";\n }",
"public function getFilter(): string;",
"public function getName() {\n return 'apihour_settings_datagrid_filters_type';\n }",
"public function name()\n {\n return __('nova.filters.log_type');\n }",
"function getName($filter=null)\n {\n return _transform('SQLite',$filter);\n }",
"public function getFilterFormClass()\n {\n return 'ClientListFormFilter';\n }",
"public function getName()\n {\n return 'fibe_content_topicfiltertype';\n }",
"public function getConvertedBy()\n {\n return FilterConverter::class;\n }",
"public function getFilter();",
"public function getFilter();",
"function vcex_image_filter_class( $filter = '' ) {\n\tif ( function_exists( 'wpex_image_filter_class' ) ) {\n\t\treturn wpex_image_filter_class( $filter );\n\t}\n}",
"public function getSortFilterName(): string\n {\n return $this->sortFilterName;\n }",
"public function getUllFilterClassName()\n {\n return 'ullPhoneQuickSearchForm';\n }",
"function getName($filter=null)\n {\n return $this->factory->getName($filter);\n }",
"public static function getAfterFilterName()\n {\n return self::$afterFilterName;\n }",
"public function getFilter(){ }"
] | [
"0.76527405",
"0.73842394",
"0.72981423",
"0.72673875",
"0.70962036",
"0.70402944",
"0.6758032",
"0.6728297",
"0.65830535",
"0.6531211",
"0.6508014",
"0.64513385",
"0.6425756",
"0.64106566",
"0.6368361",
"0.6333866",
"0.632712",
"0.6317778",
"0.6281755",
"0.62220657",
"0.6213948",
"0.61842644",
"0.6152717",
"0.6152717",
"0.61476743",
"0.61445767",
"0.60811454",
"0.6073757",
"0.6026578",
"0.5997935"
] | 0.77549744 | 0 |
Set the maximum length of the calculated name field | public function setMaximumCalcLength($length = 200)
{
$this->_maxNameCalcLength = $length;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setMaxLength($maxLength) {}",
"function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }",
"public function setMaxLength($length);",
"function setMaxLength($length) {\n\n $this->field['maxlength'] = $length;\n return $this;\n\n }",
"public function setMaxUsernameLength($length);",
"public function getMaxLength() {}",
"public function getMaxLength();",
"public function setMaxLength($length) {\n $this->maxlength = $length;\n }",
"public function getMaxUsernameLength();",
"public function setMaxLength($max)\n {\n $this->__set(self::FIELD_MAXLENGTH,$max);\n return $this;\n }",
"public function getMaxLength()\n {\n return $this->__get(self::FIELD_MAXLENGTH); \n }",
"public function getLengthMax()\n {\n return $this->lengthMax;\n }",
"public function getLengthLimit()\n {\n }",
"public function getMaxColumnNameLength();",
"protected static function _maxLength() {\n if (self::$_ruleValue) {\n if (strlen(trim(self::$_elementValue)) > self::$_ruleValue) {\n self::setErrorMessage(\"Enter at most \" . self::$_ruleValue . \" charachters only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }",
"public function getMaxLength()\n {\n return $this->maxLength;\n }",
"public function setLengthMax($length)\n {\n if (!$length) {\n $length = self::LENGTH_MAX_MAX;\n }\n \n $this->lengthMax = \\RandData\\Checker::int(\n $length,\n self::LENGTH_MAX_MIN,\n self::LENGTH_MAX_MAX,\n \"lengthMax\"\n );\n }",
"protected function max($length, $field_name, $data)\n {\n if (strlen($data) <= $length) {\n return true;\n } else {\n $this->errors[$field_name][] = \"maximum {$length} char\";\n }\n// $this->errors[$field_name][] = \"maximum {$length} char\";\n// return empty(strlen($data) <= $length) ? false : true;\n }",
"public function setMaxLength(int $max):void {\r\n\t\t$this->maxLength = $max;\r\n\t}",
"public function max($field_name, $value, $max_length)\n {\n if (strlen($value) <= $max_length) {\n return true;\n }\n return ucfirst($field_name).' must have max length of '.$max_length.'.';\n }",
"public function setMaxLength($maxLength) {\n $this->maxLength = $maxLength;\n return $this;\n }",
"function edd_stripe_max_length_statement_descriptor( $html, $args ) {\n\tif ( 'stripe_statement_descriptor' !== $args['id'] ) {\n\t\treturn $html;\n\t}\n\n\t$html = str_replace( '<input type=\"text\"', '<input type=\"text\" maxlength=\"22\"', $html );\n\n\treturn $html;\n}",
"public function getMaxLength() {\n return $this->maxLength;\n }",
"public function setMaxLength($maxLength)\n {\n $this->maxLength = $maxLength;\n return $this;\n }",
"function setLongName($longName)\n {\n if (strlen($longName) > 48) {\n throw new InvalidArgumentException(\"Input must be 48 characters or less\n in length!\");\n }\n $this->_longName = $longName;\n }",
"function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}",
"public function setLength($length);",
"function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}",
"public function increaseLength($minLength = 100) {}",
"public function increaseLength($minLength = 100) {}"
] | [
"0.74492687",
"0.73886585",
"0.7307014",
"0.7132721",
"0.6975488",
"0.6970148",
"0.68450147",
"0.6787955",
"0.67832434",
"0.6746053",
"0.6727918",
"0.67233795",
"0.66960144",
"0.65862185",
"0.6548397",
"0.65476453",
"0.6528528",
"0.65157795",
"0.6489467",
"0.6470448",
"0.6462307",
"0.64474016",
"0.64416933",
"0.6405121",
"0.6366826",
"0.63519627",
"0.6342862",
"0.6339687",
"0.63129395",
"0.63126343"
] | 0.7674192 | 0 |
Set the key for the perpage parameter. | public function withPerPageParam(string $key): self
{
if (empty($key)) {
throw new \InvalidArgumentException('Per-page parameter cannot be an empty string.');
}
$this->perPageParam = $key;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setPageKey($key);",
"public function setPerPage($perPage);",
"public function get_pagination_arg($key)\n {\n }",
"public function withPageParam(string $key): self\n {\n if (empty($key)) {\n throw new \\InvalidArgumentException('Page parameter cannot be an empty string.');\n }\n\n $this->pageParam = $key;\n\n return $this;\n }",
"function MyMod_Paging_NItemsPerPage_Set()\n {\n $val=$this->CGI_VarValue($this->ModuleName.\"_NItemsPerPage\");;\n if (!empty($val) && preg_match('/^\\d+$/',$val))\n {\n $this->NItemsPerPage=$val;\n }\n }",
"function MyMod_Paging_NPages_Set()\n {\n if ($this->NumberOfItems>$this->NItemsPerPage)\n {\n $this->MyMod_Paging_N=intval($this->NumberOfItems/$this->NItemsPerPage);\n $res=$this->NumberOfItems % $this->NItemsPerPage;\n if ($res>0) { $this->MyMod_Paging_N++; }\n }\n elseif ($this->NumberOfItems>0)\n {\n $this->MyMod_Paging_N=1;\n }\n else\n {\n $this->MyMod_Paging_N=0;\n }\n }",
"public static function getParameterKeyPageSize()\n {\n return config('consts.ParameterPageSize');\n }",
"function SetKey( $i ) { $this->_key = $i; $this->SetValue('_key', $i ); }",
"function setPageSize($value)\n {\n $this->_props['PageSize'] = $value;\n }",
"public function handleSetItemsPerPage($perPage){\n $this->perPage = $perPage;\n }",
"public function setPerPage($value){\n setcookie($this->main->module_mode.'_list_per_page_limit', $value, time() + 3600 * 24 * 365, '/admin/');\n $this->per_page = $value;\n }",
"public function setPageNum($num) {\n\t\t$this->pageNum = (int) $num;\t\n\t}",
"public function getPageKey();",
"function setRecordsPerPage($count) {\n $this->records_per_page = $count;\n}",
"protected function GetCacheKey()\n\t{\n\t\treturn $this->params['page'];\n\t}",
"public function set_page($page);",
"private function setPage(){\n\t if(!empty($_GET['page'])){\n\t if($_GET['page']>0){\n\t if($_GET['page'] > $this->pagenum){\n\t return $this->pagenum;\n\t }else{\n\t return $_GET['page'];\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }",
"function setParameter($key, $value) {\n $this->parameters[$key] = $value;\n }",
"private function setNumberOfPages(): void\n {\n $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page);\n }",
"abstract protected function setParameter($key, $value);",
"public function set_param($key, $value)\n {\n }",
"public function setParam($key, $value);",
"public function setJsonpKey($name)\n\t{\n\t\t$this->jsonpKey = $name;\n\t}",
"public function setPerPage(Request $request)\n {\n $value = $request->query($this->PER_PAGE_INDICATOR);\n\n if (!is_null($value)) {\n if (!is_numeric($value)) {\n return $value;\n }\n\n $this->perPage = $value === '0' ? null : intval($value);\n }\n }",
"public function setPageNumber($pageNumber);",
"public function SetNumPages()\n\t\t{\n\t\t\t$this->_pricenumpages = ceil($this->GetNumProducts() / GetConfig('CategoryProductsPerPage'));\n\t\t}",
"function _sf_set_per_page_cookie() {\n\t\tif(!isset($_COOKIE['per_page'])){\n\t\t\t\n\t\t\t// GETS FIRST OPTION\n\t\t\t$opts = _sf_get_per_page_options();\n\t\t\t\n\t\t\t// SETS COOKIE\n\t\t\tsetcookie('per_page', $opts[0], 0, '/');\n\t\t\t\n\t\t}\n\t\t\t\n\t\t//// IF OUR PER PAGE IS SET WE SET THE COOKIE AS WELL\n\t\tif(isset($_GET['per_page'])) {\n\t\t\t\n\t\t\t$options = _sf_get_per_page_options();\n\t\t\t\n\t\t\t///// MAKES SURE ITS A VALID OPTION\n\t\t\tif(in_array($_GET['per_page'], $options)) {\n\t\t\t\t\n\t\t\t\t//// SAVES IT\n\t\t\t\tsetcookie('per_page', $_GET['per_page'], 0, '/');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function setItemsPerPage( $newValue )\n {\n $this->_properties['ItemsPerPage'] = $newValue;\n }",
"public function setPerPage(int $perPage) : self\n {\n $this->perPage = $perPage;\n return $this;\n }",
"function MyMod_Paging_Page_No_Set()\n {\n //$this->MyMod_Paging_No=$this->PresetPage;\n if (empty($this->MyMod_Paging_No))\n {\n $this->MyMod_Paging_No=$this->GetPOST($this->ModuleName.\"_Page\");\n if (empty($this->MyMod_Paging_No))\n {\n $this->MyMod_Paging_No=$this->GetGETOrPOST(\"Page\");\n }\n }\n\n if (\n empty($this->MyMod_Paging_No)\n ||\n $this->MyMod_Paging_No>$this->MyMod_Paging_N\n )\n {\n $this->MyMod_Paging_No=1;\n }\n }"
] | [
"0.73899084",
"0.6549948",
"0.62477964",
"0.6237446",
"0.6220721",
"0.6081021",
"0.6050613",
"0.5877966",
"0.58756673",
"0.5864102",
"0.5797858",
"0.57243615",
"0.56976736",
"0.568367",
"0.566052",
"0.5654659",
"0.5631701",
"0.562285",
"0.561116",
"0.55858237",
"0.5580219",
"0.5566429",
"0.5499785",
"0.5499162",
"0.54916906",
"0.54585207",
"0.5450432",
"0.5446413",
"0.543255",
"0.5429962"
] | 0.68039346 | 1 |
Key/value list of vatRate/vatPriceTotal | public function getVatPriceTotal(): array
{
return $this->vatPriceTotal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getFormattedVats(): array\n {\n $vats = $this->cart->getVats();\n\n foreach ($vats as $key => $vat) {\n $vats[$key]['total'] = TemplateModifiers::formatNumber($vat['total'], 2);\n }\n\n return $vats;\n }",
"public function getTotalsWithVatFromPrices($prices);",
"public function total()\n {\n if ($this->_isCartArray($this->cart()) === TRUE)\n {\n $price = 0;\n $vat = 0;\n foreach ($this->cart() as $key)\n {\n $item_price = ($key['price'] * $key['qty']);\n $item_vat = (($item_price/100)*$key['vat']);\n // $price =+ ($price + ($key['price'] * $key['qty']));\n $price += $item_price;\n $vat += $item_vat;\n }\n\n // $params = $this->_config['vat'];\n // $vat = $this->_formatNumber((($price / 100) * $params));\n\n return array(\n 'sub-total' => $this->_formatNumber($price),\n 'vat' \t\t=> $this->_formatNumber($vat),\n 'total' \t=> $this->_formatNumber($price + $vat)\n );\n }\n }",
"public function pricesProvider()\n {\n return [\n 'sufficient data' => [\n 'period' => 14,\n 'precision' => 2,\n 'prices' => [\n 4834.91,// current\n 4724.89,// previous\n 4555.14,\n 4587.48,\n 4386.69,\n 4310.01,\n 4337.44,\n 4280.68,\n 4316.01,\n 4114.01,\n 4040.0,\n 4016.0,\n 4086.29,\n 4139.98,\n 4108.37,\n 4285.08,\n ],\n 'expected RSI' => [\n 81.19,// current\n 67.86,// previous\n 62.72,\n ],\n ],\n 'insufficient data' => [\n 'period' => 14,\n 'precision' => 2,\n 'prices' => [\n 4834.91,// current\n 4724.89,// previous\n ],\n 'expected RSI' => [],\n ],\n ];\n }",
"public function getTotalVatFromPriceObject(Price $price);",
"public function getTotalsForDisplay()\n {\n $vouchers = $this->getVouchers();\n if (empty($vouchers)) {\n return array();\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n\n $total = array();\n foreach ($vouchers as $voucher) {\n $salePriceInclVat = $voucher['emag_sale_price'] + $voucher['emag_sale_price_vat'];\n\n $total[] = array(\n 'label' => $voucher['emag_voucher_name'] . ':',\n 'amount' => $this->getOrder()->formatPriceTxt($salePriceInclVat),\n 'font_size' => $fontSize,\n );\n }\n\n return $total;\n }",
"public function get_vehicle_total()\n\t{\n\t\t$vehi_id = Input::get('vehi_id');\n\t\t$vehi_data = DB::table('tbl_sales')->where('vehicle_id',$vehi_id)->first();\n\t\t$total_price1 = $vehi_data->total_price;\n\t\t$tbl_rto_taxes=DB::table('tbl_rto_taxes')->where('vehicle_id','=',$vehi_id)->first();\n\t\tif(!empty($tbl_rto_taxes))\n\t\t{\n\t\t\t$registration_tax= $tbl_rto_taxes->registration_tax;\n\t\t\t$number_plate_charge= $tbl_rto_taxes->number_plate_charge;\n\t\t\t$muncipal_road_tax= $tbl_rto_taxes->muncipal_road_tax;\n\t\t\t$total_rto=$registration_tax + $number_plate_charge + $muncipal_road_tax;\n\t\t\t$total_price= $total_price1 + $total_rto;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$total_price= $total_price1;\n\t\t}\n\t\t$sale_id = $vehi_data->id;\n\t\treturn array($sale_id, $total_price);\n\t}",
"function get_price_rate($price)\n { \n $rtn = array();\n foreach ( $price as $key=>$item)\n { // cost\n if($item['rate_type']==2 && $item['customer_level_id']==0)\n $rtn['cost']=$item['zone']; \n //contract\n if($item['rate_type']==1 && $item['customer_level_id']==0)\n $rtn['contract']=$item['zone']; \n //customer L0\n if($item['rate_type']==3 && $item['customer_level_id']==1)\n $rtn['1']=$item['zone']; \n //customer L1\n if($item['rate_type']==3 && $item['customer_level_id']==2)\n $rtn['2']=$item['zone']; \n //customer L2\n if($item['rate_type']==3 && $item['customer_level_id']==3)\n $rtn['3']=$item['zone']; \n //customer L3\n if($item['rate_type']==3 && $item['customer_level_id']==4)\n $rtn['4']=$item['zone']; \n //customer L4\n if($item['rate_type']==3 && $item['customer_level_id']==5)\n $rtn['5']=$item['zone']; \n\n\n\n } \n return $rtn;\n }",
"public function getTotalPriceWithVatFromPriceObject(Price $price);",
"private function getTierPriceStructure()\n {\n return [\n 'children' => [\n 'record' => [\n 'children' => [\n 'website_id' => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'options' => $this->getWebsites(),\n 'value' => $this->getDefaultWebsite(),\n 'visible' => true,\n 'disabled' => false,\n ],\n ],\n ],\n ],\n 'price_value' => [\n 'children' => [\n 'price' => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'addbefore' => $this->getStore()->getBaseCurrency()\n ->getCurrencySymbol(),\n ]\n ]\n ],\n ],\n 'value_type' => [\n 'arguments' => [\n 'data' => [\n 'options' => $this->productPriceOptions->toOptionArray(),\n ]\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ];\n }",
"public function getVatTotal()\n {\n return $this->getUnitTotal()->multiplyWith($this->getVatRate());\n }",
"static function getVATrates(&$country)\n\t{\n\t\t$setEUmemberstates = UIDvalidationAustria::setEUmemberstates();\n\t\t$vatRates = array();\n\t\t$vatRates['country']\t= $country;\n\t\t$vatRates['standard']\t= 0;\n\t\t$vatRates['reduced']\t= 0;\n\t\tif (array_key_exists($country, $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"])) \n\t\t{ \t// Country is member of EU\n\t\t\t$vatRates['standard']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][1];\n\t\t\t$vatRates['reduced']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][2];\n\t\t\tif (isset ($GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][3]) )\n\t\t\t{\n\t\t\t\t$vatRates['reduced_2']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][3];\n\t\t\t}\n\t\t\tif (isset ($GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][4]) )\n\t\t\t{\n\t\t\t\t$vatRates['reduced_3']\t= $GLOBALS[\"UIDvalidationATglobalvars\"][\"arr_eu_memberstates\"][$country][4];\n\t\t\t}\n\t\t}\n\t\treturn $vatRates;\n\t}",
"function get_indicator_price($price,$vat){\r\n $full_price = $price + ($price * $vat);\r\n return $full_price;\r\n}",
"public function getListPrice()\n\t{\n\t\treturn $this->getKeyValue('list_price'); \n\n\t}",
"function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}",
"public function get_visible_price_data() : array {\n\t\treturn [\n\t\t\t'price_data' => [\n\t\t\t\t'min_price' => $this->get_min_price(),\n\t\t\t\t'max_price' => $this->get_max_price(),\n\t\t\t\t'min_discount_price' => $this->get_disc_min_price(),\n\t\t\t\t'max_discount_price' => $this->get_disc_max_price(),\n\t\t\t\t'currency_code' => $this->get_currency_code(),\n\t\t\t\t'discount_percent' => $this->get_discount_percentage(),\n\t\t\t],\n\t\t];\n\t}",
"function calculatePriceForRabatt(){\r\n// @ToDo remove static Values \r\n\r\n\t $basketIns = array_merge($this->basket->get_articles_by_article_type_uid_asuidlist(1)); //,$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponNormalType']),$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponRelatedType'])); // 4 and 5\r\n\t $value = array('net'=>0,'gross'=>0);\r\n\t \r\n\t foreach ($basketIns as $itemObjId) {\r\n\t\t$temp = $this->basket->basket_items[$itemObjId];\r\n\t\t$temp->recalculate_item_sums();\r\n\t\t\r\n\t\t$value['net'] += $temp->get_item_sum_net();\r\n\t\t$value['gross'] += $temp->get_item_sum_gross();\r\n\t }\r\n\r\n\t if($value['net']< 0){\r\n\t\t$value['net'] = 0;\r\n\t }\r\n\r\n\t if($value['gross'] < 0){\r\n\t\t$value['gross'] = 0;\r\n\t }\r\n\t return $value;\r\n\t}",
"public function getVatility()\n {\n return $this->get(self::_VATILITY);\n }",
"private function extractVatRate(array $data)\n {\n if (isset($data['vat_rate'])) {\n $vat_rate = $data['vat_rate'];\n } elseif (isset($data['vat'])) {\n $vat_rate = $data['vat'];\n }\n\n return $vat_rate ?? null;\n }",
"protected function convertPriceList() {\n\t\t$retArray =array();\n\t\t\n\t\tforeach ($this->DetailPriceList as $name => $nameValue) {\n\t\t\t$description = '';\n\t\t\t$unit = '';\n\t\t\t$price = 0;\n\t\t\t$avgPrice = 0;\n\t\t\tif (is_array($nameValue)) {\n\t\t\t\tforeach ($nameValue as $desc => $prices) {\n\t\t\t\t\tif (is_array($prices)) {\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$price = $nameValue;\n\t\t\t\t$avgPrice = $price;\n\t\t\t}\n\t\t\t$retArray[] = array($name,$description, $unit,$price, $avgPrice );\n\t\t}\n\t}",
"public function getPicklistValues()\n\t{\n\t\t$taxes = Vtiger_Inventory_Model::getGlobalTaxes();\n\t\tforeach ($taxes as $key => $tax) {\n\t\t\t$taxes[$key] = $tax['name'] . ' - ' . App\\Fields\\Double::formatToDisplay($tax['value']) . '%';\n\t\t}\n\t\treturn $taxes;\n\t}",
"public function getPricing() : array\n {\n $data = $this->fetchJson();\n $result = [];\n\n foreach ($data['fuel']['types'] as $fuelType) {\n if (!in_array($fuelType['name'], $this->types)) {\n continue;\n }\n\n $result[] = [\n 'name' => $fuelType['name'],\n 'price' => $fuelType['price'] * 100\n ] ;\n }\n\n return $result;\n }",
"private function getItemVatRate(array $line)\n {\n //====================================================================//\n // Line not Taxable\n if (isset($line['taxable']) && !$line['taxable']) {\n return 0;\n }\n //====================================================================//\n // No Taxes Lines\n if (empty($line['tax_lines'])) {\n return 0;\n }\n //====================================================================//\n // Sum Applied VAT Rates\n $vatRate = 0;\n foreach ($line['tax_lines'] as $tax) {\n $vatRate += (100 * $tax['rate']);\n }\n\n return $vatRate;\n }",
"public function getVatCoefficient($vatPercent);",
"public function getSubtotalInvoiced();",
"public function getPrices()\n {\n }",
"public function toOptionArray()\n {\n return [\n ['value' => 20, 'label' => __('VAT20')],\n ['value' => 10, 'label' => __('VAT10')],\n ['value' => 0, 'label' => __('VAT0')],\n ['value' => 110, 'label' => __('VAT110')],\n ['value' => 120, 'label' => __('VAT120')],\n ['value' => null, 'label' => __('VAT Free')],\n ];\n }",
"public function getTemplateVars()\n {\n $cart = $this->context->cart;\n $total = $this->trans(\n '%amount% (tax incl.)',\n [\n '%amount%' => Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH)),\n ]\n );\n\n return [\n 'totalAmount' => $total,\n ];\n }",
"public function getCustomerTaxvat();",
"function fn_get_yandex_checkpoint_price($price = 0.00, $currency = 'RUB')\n{\n return array(\n 'amount' => (float) fn_format_rate_value((float) $price, 'F', 2, '.', '', ''),\n 'currency' => $currency\n );\n}"
] | [
"0.64281356",
"0.61658955",
"0.61197674",
"0.59062016",
"0.5806182",
"0.5791746",
"0.5759514",
"0.56852436",
"0.55438447",
"0.55372775",
"0.5531466",
"0.5474502",
"0.54507136",
"0.5446054",
"0.53707105",
"0.53259575",
"0.5318655",
"0.5294964",
"0.5284472",
"0.5279797",
"0.52741086",
"0.5263678",
"0.5251638",
"0.52299404",
"0.5212059",
"0.5166846",
"0.51550794",
"0.5152646",
"0.5149328",
"0.5146865"
] | 0.68363667 | 0 |
$sql= "SELECT ep.parent_product_id,p.model FROM `".DB_PREFIX."extend_to_product` ep left join product p on p.product_id = ep.parent_product_id WHERE ep.product_id = '" . (int)$product_id . "'"; | public function getProductParent($product_id = 0){
$sql = "SELECT product_id as parent_product_id, model FROM `".DB_PREFIX."product` where product_id = '" . (int)$product_id . "'";
$query = $this->db->query($sql);
return $query->rows;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"public function listProductsPack($params)\n{\n // $prdId = $this->db->real_escape_string($params);\n // $qry = \"SELECT pr.prd_id, pr.prd_sku, pr.prd_name, pr.prd_price, pk.prd_parent \n // FROM ctt_products_packages AS pk\n // INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n // WHERE pk.prd_parent = $prdId AND prd_status =1;\";\n // return $this->db->query($qry);\n}",
"function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }",
"function getProducts($product_id){\n\t\t$this->db->select('product_id,product_code');\n\t\t$this->db->where('product_id',$product_id);\n\t\t$query = $this->db->get($this->tableName);\n\t\t$row = $query->row();\n\t\t$this->db->where('isdeleted',0);\n\t\t$this->db->where('parent_code_id',$row->product_code);\n\t\t$query = $this->db->get($this->tblProducts);\n\t\treturn $query->result();\n\t}",
"function selectProducts() {\n\n\tglobal $db;\n\n\tglobal $result;\n\n\t$query = \"SELECT * FROM products \";\n\t$query .= \"LEFT JOIN sub_category ON products.p_sub_id = sub_category.sub_id\";\n\n\t$result = mysqli_query($db, $query);\n\n\tconfirmQuery($result);\n}",
"function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }",
"public function find($id = 0)\n {\n\n $sql = 'SELECT products.id , product_name, categories.category_name, product_sku FROM `products`\n INNER JOIN product_properties_values on product_properties_values.id_product = products.id\n INNER JOIN categories on categories.id = product_properties_values.property_value\n WHERE products.id = ?';\n\n $sqlData = [(int)$id];\n $app = Application::instance();\n $product['header'] = $this->catalog = $app->db()->getArrayBySqlQuery($sql,$sqlData);\n\n /*$sql = 'SELECT products.product_name, products.product_price, products.product_sku FROM products\n WHERE products.id_parent_product ='. (int)$id\n ;*/\n\n\n $sql = 'SET @SQL = NULL';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'SELECT\n GROUP_CONCAT(DISTINCT\n CONCAT(\\'GROUP_CONCAT(IF(pr.product_property_name = \\\"\\', pr.`product_property_name`, \\'\\\", pp.property_value, NULL)) AS \\', pr.`product_property_name`)\n ) INTO @SQL\n FROM product_properties AS pr';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'SET @SQL = CONCAT(\\'SELECT p .*, \\', @SQL, \\'\n FROM products AS p\n LEFT JOIN product_properties_values AS pp ON (p.id = pp.id_product)\n LEFT JOIN product_properties AS pr ON (pr.id = pp.id_property)\n WHERE p.id_parent_product =' . (int)$id . '\n AND deleted is NULL\n GROUP BY p.id ;\\')';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'PREPARE stmt FROM @SQL';\n $app->db()->getArrayBySqlQuery($sql);\n $sql = 'EXECUTE stmt';\n $product['list'] = $app->db()->getArrayBySqlQuery($sql);\n $sql = 'DEALLOCATE PREPARE stmt';\n $app->db()->getArrayBySqlQuery($sql);\n\n foreach ($product['list'] as $key => $good) {\n $product['list'][$key]['Photo'] = explode(',', $product['list'][$key]['Photo']);\n }\n\n\n $this->product = $product;\n\n\n return $this->product;\n }",
"function tep_subproducts_parent($products_id) {\n\t$product_sub_product_query = tep_db_query(\"select products_parent_id from \" . TABLE_PRODUCTS . \" p where p.products_id = '\" . (int)$products_id . \"'\");\n\t$product_sub_product = tep_db_fetch_array($product_sub_product_query);\n\tif ($product_sub_product['products_parent_id'] > 0){\n\t\treturn $product_sub_product['products_parent_id'];\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function listProductsRelated($params)\n{\n $type = $this->db->real_escape_string($params['type']);\n $prdId = $this->db->real_escape_string($params['prdId']);\n\n if ($type == 'K'){\n $qry = \"SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products AS pr\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE prd_id = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1\n UNION\n SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products_packages AS pk\n INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE pk.prd_parent = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1;\";\n return $this->db->query($qry);\n // cambio ac.prd_id por prd_parent\n } else if($type == 'P') {\n $qry = \"SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products AS pr\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE prd_id = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1\n UNION\n SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_accesories AS ac\n INNER JOIN ctt_products AS pr ON pr.prd_id = ac.prd_parent \n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE ac.prd_parent = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1;\";\n return $this->db->query($qry);\n\n } else {\n $qry = \"SELECT * FROM ctt_products WHERE prd_id = $prdId\";\n return $this->db->query($qry);\n }\n}",
"public static function select_product_by_id($data)\n {\n \n try{\n $product_id=$data['product_id'];\n $productquery = new Query;\n $productdata = $productquery->select(['core_products.*','core_product_categories.category_name','core_product_sub_categories.sub_category_name', 'core_product_models.model_name','core_product_categories.metric','core_product_images.*'])\n ->from('core_products')\n ->leftJoin('core_product_categories', 'core_product_categories.category_id=core_products.category_id')\n ->leftJoin('core_product_sub_categories', 'core_product_sub_categories.sub_category_id=core_products.sub_category_id')\n ->leftJoin('core_product_models', 'core_product_models.model_id=core_products.model_id')\n ->innerJoin('core_product_images', 'core_product_images.product_id=core_products.product_id')\n ->orderBy(['core_products.product_id' => SORT_DESC])\n ->groupBy(['core_products.product_id'])\n ->limit(1)\n ->where(\"core_products.product_id = $product_id\")\n ->all();\n $product = (object)$productdata[0];\n $imagequery = new Query;\n $productimages = $imagequery->select(['*'])\n ->from('core_product_images')\n ->where(\"product_id = $product_id\")\n ->all();\n \n $tax_details = new Query;\n $tax_ids= explode(',',$product->life_tax_details);\n $tax_regions = $tax_details->select(['region_name'])\n ->from('core_regions')\n ->where(['region_id' => $tax_ids])\n ->all();\n $life_tax_details='';\n foreach($tax_regions as $index=>$region_name)\n {\n if($index==0)\n $life_tax_details = $region_name['region_name'];\n else\n $life_tax_details .= ', '.$region_name['region_name'];\n }\n $common_value = \"Not Available\";\n //variable to dispaly product title\n $product_title = $product->equipment_title.' <span><i class=\"fa fa-check-circle\"></i> In Stock</span>';\n \n //variable to display product navigation\n $product_navs ='<li role=\"presentation\" class=\"active\"><a href=\"#cranedetails\" aria-controls=\"details\" role=\"tab\" data-toggle=\"tab\">Details</a></li>\n <li role=\"presentation\"><a href=\"#craneimages\" aria-controls=\"craneimages\" role=\"tab\" data-toggle=\"tab\">Images</a></li>';\n $loadchartcount = 0;\n foreach($productimages as $index=>$image)\n {\n $image = (object)$image;\n if($image->image_type == 2) $loadchartcount++; \n }\n \n if($product->category_id ==1)\n $product_navs .='<li role=\"presentation\"><a href=\"#loadcharts\" aria-controls=\"loadcharts\" role=\"tab\" data-toggle=\"tab\">Load Charts</a></li>';\n $price_type = ''; $place_holder_price_type = '';\n if(@$product->price_type == 1)\n {\n @$price_type = \"Daily\"; \n $place_holder_price_type ='Days';\n }\n else if(@$product->price_type == 2)\n {\n @$price_type = \"Monthly\"; \n $place_holder_price_type ='Months';\n }\n \n //variable to display product details\n $product_details ='<div role=\"tabpanel\" class=\"tab-pane active\" id=\"cranedetails\">\n <div class=\"b-t-b-grey flex\">\n <img width=\"209px\" height=\"194px\" src=\"'.$product->image_url.'\" alt=\"\">\n <p>'.$product->description.'</p>\n </div>\n <div class=\"col-md-6\">\n <ul class=\"cranedtlslist\">\n <li><strong>Code: </strong> '.$product->manual_product_code.'</li>';\n if($product->product_type == 0)\n {\n if($product->hire_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST/'.$price_type.'</li>'; \n else\n $product_details .= '<li><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->hire_price.'/'.$price_type.'</li>'; \n }\n else if($product->product_type == 1)\n {\n if($product->sale_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST </li>'; \n else\n $product_details .= '<li ><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->sale_price.'</li>'; \n }\n else if($product->product_type == 2)\n {\n if($product->hire_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST/'.$price_type.'</li>'; \n else\n $product_details .= '<li><strong>Hire Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->hire_price.'/'.$price_type.'</li>'; \n \n \n if($product->sale_price == -1)\n $product_details .= '<li data-toggle=\"popover\" data-trigger=\"hover\" data-content=\"PRICE ON REQUEST\" onmouseover=\"mousepopover();\"><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> PRICE ON REQUEST </li>'; \n else\n $product_details .= '<li ><strong>Sale Price: </strong> <strong><i class=\"fa fa-rupee\"></i></strong> '.$product->sale_price.'</li>'; \n }\n \n \n $product_details .= '<li><strong>Capacity: </strong> '.$product->capacity.'</li>';\n $product_details .= '<li><strong>Category: </strong> '.$product->category_name.'</li>';\n $product_details .= '<li><strong>Sub category: </strong> '.$product->sub_category_name.'</li>';\n \n \n /*if($product->model_name != '')\n {\n $product_details .= '<li ><strong>Model: </strong>'.$product->model_name.'</li>'; \n }\n if($product->model_other != '')\n {\n $product_details .= '<li ><strong>Model Other: </strong> '.$product->model_other.'</li>'; \n }*/\n\tif($product->model_name != '' && $product->model_name != 'Custom')\n {\n $product_details .= '<li ><strong>Model: </strong>'.$product->model_name.'</li>'; \n }\n if($product->model_other != '')\n {\n //$product_details .= '<li ><strong>Model Other: </strong> '.$product->model_other.'</li>'; \n $product_details .= '<li ><strong>Model: </strong> '.$product->model_other.'</li>'; \n }\n if($product->current_location != '')\n {\n $pos = strrpos( $product->current_location, ',');\n if ($pos > 0) { // try to find the second one\n $npath = substr($product->current_location, 0, $pos);\n $npos = strrpos($npath, ',');\n if ($npos !== false) {\n $currentlocation = substr($product->current_location, $npos+1);\n } \n else {\n $currentlocation =$product->current_location;\n \n }\n }\n $product_details .= '<li ><strong>Location: </strong>'.$currentlocation.'</li>'; \n }\n \n $product_details .= '</ul></div><div class=\"col-md-6\">\n <ul class=\"cranedtlslist\">';\n if($product->category_id == '1')\n {\n if($product->fly_jib)\n $product_details .= '<li ><strong>Fly jib:</strong> '.$product->fly_jib.' meters</li>';\n else\n $product_details .= '<li ><strong>Fly jib:</strong> '.$common_value.'</li>';\n }\n \n if($product->category_id == '1')\n {\n if($product->luffing_jib)\n $product_details .= '<li ><strong>Luffing jib:</strong>'.$product->luffing_jib.' meters</li>'; \n else\n $product_details .= '<li ><strong>Luffing jib:</strong> '.$common_value.'</li>';\n \n }\n if($product->category_id == '1' || $product->category_id == '2')\n {\n if($product->registered_number)\n $product_details .= '<li ><strong>Registered Number:</strong> '.$product->registered_number.'</li>'; \n else\n $product_details .= '<li ><strong>Registered Number:</strong> '.$common_value.'</li>'; \n }\n \n if($life_tax_details)\n $product_details .= '<li ><strong>Life Tax Details:</strong> '.$life_tax_details.'</li>'; \n else\n $product_details .= '<li ><strong>Life Tax Details:</strong> '.$common_value.'</li>'; \n \n if($product->condition != '')\n {\n $product_details .= '<li ><strong>Condition:</strong> '.$product->condition.'</li>'; \n }\n if($product->category_id == '3')\n {\n if($product->bucket_capacity)\n $product_details .= '<li ><strong>Bucket Capacity:</strong> '.$product->bucket_capacity.' Cubic Metres</li>'; \n else\n $product_details .= '<li ><strong>Bucket Capacity:</strong> '.$common_value.'</li>'; \n }\n if($product->manufacture_year != '')\n {\n if($product->manufacture_year)\n $product_details .= '<li ><strong>Manufacture year:</strong> '.$product->manufacture_year.'</li>'; \n else\n $product_details .= '<li ><strong>Manufacture year:</strong> '.$common_value.'</li>'; \n }\n if($product->category_id == '1')\n {\n if($product->boom_length)\n $product_details .= '<li ><strong>Boom Length:</strong> '.$product->boom_length.' meters</li>'; \n else\n $product_details .= '<li ><strong>Boom Length:</strong> '.$common_value.'</li>'; \n }\n if($product->category_id == '5')\n {\n if($product->kelly_length)\n $product_details .= '<li ><strong>Kelly Length: </strong>'.$product->kelly_length.' meters</li>'; \n else\n $product_details .= '<li ><strong>Kelly Length: </strong>'.$common_value.'</li>'; \n } \n if($product->category_id == '3')\n {\n if($product->arm_length)\n $product_details .= '<li ><strong>Arm Length: </strong>'.$product->arm_length.' meters</li>'; \n else\n $product_details .= '<li ><strong>Arm Length: </strong>'.$common_value.'</li>'; \n }\n if($product->category_id == '2')\n {\n if($product->numberof_axles)\n $product_details .= '<li ><strong>Number of axles: </strong> '.$product->numberof_axles.'</li>'; \n else\n $product_details .= '<li ><strong>Number of axles: </strong> '.$common_value.'</li>'; \n }\n \n if($product->dimensions && $product->dimensions!= '0x0x0')\n $product_details .= '<li ><strong>Dimensions: </strong> '.$product->dimensions .'</li>'; \n else\n $product_details .= '<li ><strong>Dimensions: </strong> '.$common_value.'</li>'; \n \n $product_details .='</ul></div></div>';\n \n $gallery_thumb = '';$gallery = '';$load_charts_thumb = '';$load_charts=''; $i=0; $j=0;\n foreach($productimages as $index=>$image)\n {\n $image = (object)$image;\n if($image->image_type == 1)\n {\n \n if($i==0) $active= 'active'; else $active = '';\n $gallery_thumb .='<li><a class=\"thumbnail\" id=\"carousel-selector-'.$i.'\"><img width=\"100px\" height=\"74px\" src=\"'.$image->image_url.'\"></a></li>';\n $gallery .= '<div class=\"item '.$active.'\" data-slide-number=\"'.$i.'\"><img src=\"'.$image->image_url.'\"></div>';\n $i++; \n }\n else if($image->image_type == 2)\n {\n \n if($j==0) $active= 'active'; else $active = '';\n $load_charts_thumb .='<li><a class=\"thumbnail\" id=\"carousel-selector-'.$j.'\"><img width=\"100px\" height=\"74px\" src=\"'.$image->image_url.'\"></a></li>';\n $load_charts .= '<div class=\"item '.$active.'\" data-slide-number=\"'.$j.'\"><img src=\"'.$image->image_url.'\"></div>';\n $j++;\n }\n \n \n }\n //variable to display images slider\n $image_block ='<div role=\"tabpanel\" class=\"tab-pane\" id=\"craneimages\">\n <div class=\"col-sm-2\" id=\"slider-thumbs\">\n <!-- Bottom switcher of slider -->\n <ul class=\"hide-bullets\">'.$gallery_thumb.'</ul>\n </div>\n <div class=\"col-sm-10\">\n <div class=\"col-xs-12\" id=\"slider\">\n <!-- Top part of the slider -->\n <div class=\"row\">\n <div class=\"col-sm-12\" id=\"carousel-bounding-box\">\n <div class=\"carousel slide\" id=\"myCarousel\">\n <!-- Carousel items -->\n <div class=\"carousel-inner\">'.$gallery.'</div>\n <!-- Carousel nav -->\n <a class=\"left carousel-control\" href=\"#myCarousel\" role=\"button\" data-slide=\"prev\">\n <span class=\"glyphicon glyphicon-chevron-left\"></span>\n </a>\n <a class=\"right carousel-control\" href=\"#myCarousel\" role=\"button\" data-slide=\"next\">\n <span class=\"glyphicon glyphicon-chevron-right\"></span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>';\n //variable to display load charts if exists.\n if($loadchartcount >0)\n {\n $product_load_charts ='<div role=\"tabpanel\" class=\"tab-pane\" id=\"loadcharts\">\n <div class=\"col-sm-2\" id=\"slider-thumbs\">\n <!-- Bottom switcher of slider -->\n <ul class=\"hide-bullets\">'.$load_charts_thumb.'</ul>\n </div>\n <div class=\"col-sm-10\">\n <div class=\"col-xs-12\" id=\"slider\">\n <!-- Top part of the slider -->\n <div class=\"row\">\n <div class=\"col-sm-12\" id=\"carousel-bounding-box\">\n <div class=\"carousel slide\" id=\"load_chart_carousel\">\n <!-- Carousel items -->\n <div class=\"carousel-inner\">'.$load_charts.'</div>\n <!-- Carousel nav -->\n <a class=\"left carousel-control\" href=\"#load_chart_carousel\" role=\"button\" data-slide=\"prev\">\n <span class=\"glyphicon glyphicon-chevron-left\"></span>\n </a>\n <a class=\"right carousel-control\" href=\"#load_chart_carousel\" role=\"button\" data-slide=\"next\">\n <span class=\"glyphicon glyphicon-chevron-right\"></span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div><div class=\"clearfix\"></div>';\n }\n else\n {\n $product_load_charts ='<div role=\"tabpanel\" class=\"tab-pane\" id=\"loadcharts\">\n <center><h4>Load Charts Not Available</h4></center>\n </div><div class=\"clearfix\"></div>';\n }\n \n //condition to check which button to display \n if(Yii::$app->user->id != $product->user_id)\n {\n\t if($product->product_type == 0)\n \t$hirenowbutton = '<button type=\"button\" class=\"btn btn-bei\" onclick=\"order_now('.$product->product_id.',0);\">Hire Now</button>';\n else if($product->product_type == 1)\n \t$hirenowbutton = '<button type=\"button\" class=\"btn btn-bei\" onclick=\"order_now('.$product->product_id.',1);\">Buy Now</button>';\n else if($product->product_type == 2)\n \t$hirenowbutton = '<button type=\"button\" class=\"btn btn-bei\" onclick=\"order_now('.$product->product_id.',2);\">Hire / Buy</button>';\n }\n else\n {\n $hirenowbutton = '';\n }\n $data['title'] = $product_title;\n $data['navs'] = $product_navs;\n $data['details'] = $product_details;\n $data['images'] = $image_block;\n $data['load_charts'] = $product_load_charts;\n $data['hire_now_button'] = $hirenowbutton;\n $data['price_type'] = $place_holder_price_type;\n return $data;\n \n }catch (ErrorException $ex) {\n Yii::warning($ex->getMessage());\n }\n \n \n \n }",
"public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }",
"function get_product($catalog_id)\r\n {\r\n $query = \"select product.* , \r\n image.image_name from product\r\n left join image \r\n on image.image_id = product.product_image\r\n where product.catalog_name = '\".$catalog_id.\"' \r\n ORDER BY product.product_id DESC \";\r\n \r\n \r\n // echo $query;\r\n $result = $this->getResult($query);\r\n if ($result)\r\n { $total_product = 1; ?>\r\n <div class=\"row no-space\">\r\n <div class=\"span9 \">\r\n <div class=\"carousel jcarousel \" id=\"myCarousel\">\r\n <div class=\"carousel-inner\">\r\n <div class=\"item active\">\r\n <div class=\"row\">\r\n \r\n <?php while($product = mysql_fetch_object($result)): ?>\r\n \r\n <div class=\"span2\">\r\n <div class=\"product-menu-list\">\r\n <a class=\"product-menu-list-btn\" href=\"<?php echo $product->product_id; ?>\">\r\n <img src=\"<?php echo FONTEND_IMAGE_PATH.$product->image_name ;?>\" alt=\"\">\r\n <div><p><?php echo $product->product_name; ?></p></div>\r\n </a>\r\n </div>\r\n </div>\r\n \r\n <?php \r\n $total_product++;\r\n endwhile; ?>\r\n <!-- <div class=\"span2\">\r\n <div class=\"product-menu-list\">\r\n <a href=\"\"><img src=\"img/product/38635.jpg\" alt=\"\">\r\n <div><p>text</p></div>\r\n </a>\r\n </div>\r\n </div> -->\r\n \r\n\r\n </div> <!-- end row -->\r\n </div> <!-- end item --> \r\n </div> <!-- end carousel-inner -->\r\n <?php if($total_product > 5): ?>\r\n <a class=\"carousel-control left\" href=\"#myCarousel\" data-slide=\"prev\">‹</a>\r\n <a class=\"carousel-control right\" href=\"#myCarousel\" data-slide=\"next\">›</a>\r\n <? endif; ?>\r\n </div> <!-- end carousel jcarousel -->\r\n\r\n </div>\r\n </div> \r\n <?php \r\n \r\n }\r\n \r\n \r\n }",
"public function getSingleProduct($id){\r\n\r\n\t$query = \"SELECT p.*,c.catName,b.brandName\r\nFROM tbl_product as p,tbl_category as c, tbl_brand as b\r\nWHERE p.catId = c.catId AND p.brandId = b.brandId AND p.productId = '$id'\";\r\n\t$result = $this->db->select($query);\r\n\treturn $result;\r\n}",
"function relatedProductsSearch($product_type_id, $product_id)\n\t\t\t\t{\n\t\t\t\t$sql= 'SELECT product. *\n\t\t\t\tFROM product\n\t\t\t\tWHERE product.product_type_id = '.$product_type_id.'\n\t\t\t\tAND product.product_id != '.$product_id.'\n\t\t\t\tORDER BY product.product_id DESC';\n\t\t\t\t\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t}",
"function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }",
"public function products(){\n return $this->hasMany(InvoiceProduct::class);\n //->leftJoin('invoice_product','products.id','invoice_product.product_id');\n //return $this->belongsToMany(Product::class);\n }",
"function get_numeracion_by_producto($id,$p_num)\n{\n\t$ef = new Producto_numeracion();\n $sql=\"select p.id as cproducto_id,p.descripcion as tag, pn.numero_mm as talla, pn.id as \n numeracion_id\n from\n cproductos as p\n join cproductos_numeracion as pn\n on pn.cproducto_id=p.id\n where\n p.id='$id'\n and\n pn.id='$p_num'\n and\n p.estatus_general_id='1'\";\n\t//Buscar en la base de datos\n\t//$ef->where('cproducto_id', $id)->where('estatus_general_id',1)->order_by('numero_mm')->ge\n\n\t\n $ef->query($sql);\n if($ef->c_rows>0){\n\t\treturn $ef;\n\t} else {\n\t\treturn FALSE;\n\t}\n}",
"public function get_branch_products($branch_id)\n {\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // WHERE branch_id=$branch_id\n // GROUP BY p.product_id \"); \n\n $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,`pc`.`name` AS catName FROM product p LEFT JOIN branch_products bp ON (p.product_id = bp.product_id) LEFT JOIN branch b ON b.branch_id = bp.branch_id\n LEFT JOIN product_category pc ON pc.product_category_id = p.product_category_id WHERE bp.branch_id=$branch_id AND b.brand_id=(SELECT brand_id FROM branch b WHERE branch_id=$branch_id) GROUP BY p.product_id \");\n\n $result = $query->result_array();\n\n //$query = $this->db->get_where('branch_products', array('branch_products_id' => $id));\n // $rows = $query->num_rows();\n // echo 'ROWS:'.$rows;die;\n //$result = $query->result_array();\n // $str = $this->db->last_query();\n // echo $str;\n\n // $totalRows = $query->num_rows();\n\n // if( $totalRows > 0 )\n // {\n // $result = $query->result_array();\n // }\n // else\n // {\n // $query = $this->db->query(\" SELECT p.product_id, p.name AS product_name,p.price AS default_price,p.product_code AS productcode,bp.*,NULL AS is_available FROM product p\n // LEFT JOIN branch_products bp ON (p.product_id = bp.product_id)\n // GROUP BY p.product_id \"); \n // $result = $query->result_array(); \n // }\n\n return $result; \n }",
"function relatedProducts($people_cat_id, $product_type_id, $product_id)\n\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t$sql= 'SELECT product. *\n\t\t\t\tFROM product\n\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\tWHERE product.product_type_id = '.$people_cat_id.'\n\t\t\t\tAND product_people.people_cat_id = '.$product_type_id.'\n\t\t\t\tAND product.product_id != '.$product_id.'\n\t\t\t\tORDER BY product.product_id DESC';\n\t\t\t\t\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t\n\t\t\t\t}",
"public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}",
"function allproducts_get()\n\t{\n\t\t$is_exists=$this->user_model->get_joins('products',array('is_product'=>'Y'),'',array('catg_id','child_id','prod_detail','description','size','unit','mrp'));\n\t\t//print_r($is_exists);exit('u');\n\t\tif(!empty($is_exists))\n\t\t{\n\t\t\t$this->response(array('status'=>'true','message'=>$is_exists));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('status'=>'false','message'=>'No Product Found'),REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}",
"function getallproducts1($warehouseid){\n \n\n $products = $this->db->query(\"SELECT a.*, \n b.id AS productid, \n b.`name` AS productname, \n b.`main_image` AS productimage, \n b.`price` AS product_price, \n b.`tax` AS product_tax, \n b.`description` AS product_description, \n b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, \n c.`image` AS cat_image, \n c.`category_id` AS category_id,\n d.`category_id` AS subcategory_id,\n d.`name` AS subcat_name, \n d.`image` AS subcat_image,\n d.`parent_id` AS parent_id,\n d.`shared_category` AS shared_category \n FROM warehouse_products a \n LEFT JOIN products b ON a.product=b.`id` \n LEFT JOIN category c ON b.`category_id` = c.`category_id` \n LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` \n WHERE a.`warehouse` = \".$warehouseid.\" \n ORDER BY c.`name`, d.`name`\")->result();\n \n $sharedproducts=array();\n foreach($products as $product){\n if($product->shared_category !=null)\n array_push($sharedproducts, $product);\n }\n \n \n if(sizeof($products)>0){\n \n $this->db->query(\"TRUNCATE TABLE `tb_filteredproducts`\");\n \n foreach($products as $row) {\n $categoryimage=$row->cat_image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$row->id.\"',\n `warehouse` = '\".$row->warehouse.\"',\n `product` = '\".$row->product.\"',\n `quantity` = '\".$row->quantity.\"',\n `min_capacity` = '\".$row->min_capacity.\"',\n `max_capacity` = '\".$row->max_capacity.\"',\n `avail_qty` = '\".$row->avail_qty.\"',\n `created_at` = '\".$row->created_at.\"',\n `updated_at` = '\".$row->updated_at.\"',\n `productid` = '\".$row->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$row->productname).\"',\n `productimage` = '\".$row->productimage.\"',\n `product_price` = '\".$row->product_price.\"',\n `product_tax` = '\".$row->product_tax.\"',\n `product_description` = '\".$row->product_description.\"',\n `productuniqueid_forimages` = '\".$row->productuniqueid_forimages.\"',\n `cat_name` = '\".$row->cat_name.\"',\n `cat_image` = '\".$row->cat_image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$row->category_id.\"',\n `subcat_name` = '\".$row->subcat_name.\"',\n `subcategory_id` = '\".$row->subcategory_id.\"',\n `subcat_image` = '\".$row->subcat_image.\"',\n `parent_id` = '\".$row->parent_id.\"',\n `shared_category` = '\".$row->shared_category.\"';\";\n \n $this->db->query($query);\n \n }\n \n foreach($sharedproducts as $shared_product){ // for one shared product\n $sharedcategory_array= array();\n $sharedcategory_array=explode(\",\",$shared_product->shared_category);\n // print_r($shared_product);\n foreach($sharedcategory_array as $oneshared_category){\n if($oneshared_category !=$shared_product->category_id){ // if the shared category id item is not same with table id(current setted category id)\n // echo $oneshared_category;\n \n $selected_category_objectarray_from_categorytable = $this->db->where('category_id', $oneshared_category)->get('category')->result();\n \n if(sizeof($selected_category_objectarray_from_categorytable)>0){ // if the shared category is not deleted from category table\n $selected_category_object_from_categorytable=$selected_category_objectarray_from_categorytable[0];\n \n $categoryimage=$selected_category_object_from_categorytable->image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$shared_product->id.\"',\n `warehouse` = '\".$shared_product->warehouse.\"',\n `product` = '\".$shared_product->product.\"',\n `quantity` = '\".$shared_product->quantity.\"',\n `min_capacity` = '\".$shared_product->min_capacity.\"',\n `max_capacity` = '\".$shared_product->max_capacity.\"',\n `avail_qty` = '\".$shared_product->avail_qty.\"',\n `created_at` = '\".$shared_product->created_at.\"',\n `updated_at` = '\".$shared_product->updated_at.\"',\n `productid` = '\".$shared_product->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$shared_product->productname).\"',\n `productimage` = '\".$shared_product->productimage.\"',\n `product_price` = '\".$shared_product->product_price.\"',\n `product_tax` = '\".$shared_product->product_tax.\"',\n `product_description` = '\".$shared_product->product_description.\"',\n `productuniqueid_forimages` = '\".$shared_product->productuniqueid_forimages.\"',\n `cat_name` = '\".$selected_category_object_from_categorytable->name.\"',\n `cat_image` = '\".$selected_category_object_from_categorytable->image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$selected_category_object_from_categorytable->category_id.\"',\n `subcat_name` = '\".$shared_product->subcat_name.\"',\n `subcategory_id` = '\".$shared_product->subcategory_id.\"',\n `subcat_image` = '\".$shared_product->subcat_image.\"',\n `parent_id` = '\".$shared_product->parent_id.\"',\n `shared_category` = '\".$shared_product->shared_category.\"';\";\n \n $this->db->query($query);\n \n \n }\n }\n }\n } \n \n } \n \n \n $result = $this->db->query(\"SELECT * FROM `tb_filteredproducts` ORDER BY cat_name, subcat_name\")->result();\n return $result;\n }",
"public function getJobp($id=''){\t\t\n $this->db->select(\"jobspreview.*,package.name as package_name,package.price as package_price,industry.name as industry_name\");\n $this->db->join(\"package\",\"jobspreview.package_id=package.id\",\"left\"); \n $this->db->join(\"industry\",\"jobspreview.industry_id=industry.id\",\"left\"); \n $this->db->where(\"jobspreview.id\",$id); \n $result = $this->db->get('jobspreview')->result();\n //echo $this->db->last_query(); die(); \n return $result;\t\t\n}",
"function get_lowcat($product_id)\n {\n \t\t $database =& JFactory::getDBO();\n \t\t //najde kategoriu druhej alebo mensej urovne viac menej nahodne\n \t\t $sql = \"SELECT #__vm_category.category_id FROM #__vm_product_category_xref, #__vm_category, #__vm_category_xref WHERE #__vm_category_xref.category_child_id=#__vm_product_category_xref.category_id AND #__vm_category.category_publish='Y' AND #__vm_category.category_id=#__vm_category_xref.category_child_id and #__vm_category_xref.category_parent_id <> 0 AND #__vm_product_category_xref.product_id = '\".$product_id.\"' \";\n \t \n\t\t\t$database->setQuery($sql);\n\t\t\t\n\t\t\t//$res = $database->loadResult();\n\t\t\t$resA = $database->loadAssocList();\n\t\t\tif (!empty($resA))\n\t\t\t{\n\t\t\tforeach ($resA as $res)\n\t\t\t{\n\t\t\t \n\t\t\t {\n\t\t\t $arr = array();\n\t\t\t $cats = $this->build_cats($res['category_id'], $arr);\n\t\t\t //$x = end($cats);\n\t\t\t //var_dump($x);\n\t\t\t if (!empty($cats))\n\t\t\t // if (end($cats)!='262') IF YOU USE A CATEGORY SUCH AS LATEST PRODUCTS\n\t\t\t {\n\t\t\t //var_dump($res['category_id']); die();\n\t\t\t return $res['category_id'];\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\t//echo $product_id.'...cat...'.$res['category_id']; die();\n\t\t\t// nechame novinky ak inde nie je\n\t\t\treturn $res['category_id'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif (!isset($res) || ($res==false))\n\t\t\t{\n\t\t\t // ak podkategoria neexistuje, najde top kategoriu\n\t\t\t \t$sql = \"SELECT #__vm_category.category_id FROM #__vm_product_category_xref, #__vm_category, #__vm_category_xref WHERE #__vm_category_xref.category_child_id=#__vm_product_category_xref.category_id AND #__vm_category.category_publish='Y' AND #__vm_category.category_id=#__vm_category_xref.category_child_id AND #__vm_product_category_xref.product_id = '$product_id' LIMIT 0,1\";\n\t\t\t \t$database->setQuery($sql);\n\t\t\t\t$res = $database->loadResult();\n\t\t\t\treturn $res;\n\t\t\t}\n\n\t\t\treturn 0;\n\n }",
"function getparent(){\r\n\tglobal $con;\r\n\t$getAll = $con->prepare(\"SELECT * FROM categories WHERE parent = 0 ORDER BY ID ASC\");\r\n\t$getAll->execute();\t\r\n\t$parent = $getAll->fetchAll();\r\n\treturn $parent;\r\n}",
"public function product1(){\r\n\t\t$sql =\"SELECT * FROM `products`,`manufactures`,`protypes` WHERE manufactures.manu_ID = products.manu_ID AND protypes.type_ID = products.type_ID\";\r\n\t\t$result = self::$conn->query($sql);\r\n\t\treturn $this->getData($result);\r\n\t}",
"function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function listadoProductos(){\n\n$sql = \"select idProducto,desc_Prod,presentacion,tipoProd,stock,m.nomMarca,c.nomCategoria,estadoProd from producto as p inner join Categoria as c ON c.idCategoria=p.idCategoria inner join Marca as m ON m.idMarca=p.idMarca where estadoProd=1 order by desc_Prod asc\";\n\t\n\n\n\t\treturn Yii::app()->db->createCommand($sql)->queryAll();\n\t}",
"protected function productsAll()\n\t{\n\t\t$this->adapter->joinLeftCategoryFlat();\n\t\t$this->adapter->joinTaxonomy();\n\t\t$this->adapter->joinParentCategory();\t\t\t\t\t\t\n\t}",
"function load_category($parent)\n{\n$sql=\"SELECT * from yr14_category where parentid='\".$parent.\"' order by id\";\n$result=mysql_query($sql);\nif(!$result || mysql_num_rows($result)<=0)\nreturn 0;\nelse\nreturn $result;\n}"
] | [
"0.66640514",
"0.6497889",
"0.64591616",
"0.6380273",
"0.63108003",
"0.60890007",
"0.60820985",
"0.6040566",
"0.6034275",
"0.59665245",
"0.5910264",
"0.5884655",
"0.58806074",
"0.5864363",
"0.5824354",
"0.57905424",
"0.5744224",
"0.5731357",
"0.57016665",
"0.57014763",
"0.5701297",
"0.56909305",
"0.5677437",
"0.5638829",
"0.56287557",
"0.56262916",
"0.5617763",
"0.5603081",
"0.5600525",
"0.5587859"
] | 0.65871334 | 1 |
Sanitize key, removing spaces and replace them to underscore | protected function sanitize($key)
{
return strtolower(str_replace(' ', '_', $key));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sanitize_key( $key ) {\n\t$raw_key = $key;\n\t$key = strtolower( $key );\n\t$key = preg_replace( '/[^a-z0-9_\\-]/', '', $key );\n\n\t/**\n\t * Filter a sanitized key string.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $key Sanitized key.\n\t * @param string $raw_key The key prior to sanitization.\n\t */\n\treturn apply_filters( 'sanitize_key', $key, $raw_key );\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 }",
"protected function normalize($key)\n {\n return str_replace('_', '', strtoupper($key));\n }",
"protected function _normalizeKey($key)\n {\n $option = str_replace('_', ' ', strtolower($key));\n $option = str_replace(' ', '', ucwords($option));\n return $option;\n }",
"function sanitize_key($key)\n {\n }",
"function parseCleanKey($k){\r\n\t\tif($k<0){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$k = htmlspecialchars(urldecode($k));\r\n\t\t$k = preg_replace(\"/\\.\\./\" , \"\" , $k);\r\n\t\t$k = preg_replace(\"/\\_\\_(.+?)\\_\\_/\" , \"\" , $k);\r\n\t\t$k = preg_replace(\"/^([\\w\\.\\-\\_]+)$/\", \"$1\", $k);\r\n\t\treturn $k;\r\n\t}",
"public static function filterDataKey($key)\n {\n return preg_replace(\"/[^a-zA-Z0-9_]+/\", '_', $key);\n }",
"protected function sanitizeKey($key)\n {\n return $key;\n }",
"public static function normalizeKeyDelimiters($key)\r\n {\r\n return str_replace(array(' ', '_'), '-', $key);\r\n }",
"function _CleanKey($key) {\n\t\t$this->_Log('Cache: cleaning ' . ($key ?? '<NULL>') );\n\n\t\t$new_key = preg_replace( '/[^a-z0-9]+/', '-', strtolower( $key ?? '' ) );\n\n\t\treturn $new_key;\n\t}",
"public static function sanitizeCacheKey($key)\n {\n $chars = [\"{\",\"}\",\"(\",\")\",\"/\",\"\\\\\",\"@\",\":\"];\n $key = str_replace($chars, \"\", $key);\n\n return $key;\n }",
"public static function sanitizeCacheKey($key): string\n {\n $chars = [\"{\",\"}\",\"(\",\")\",\"/\",\"\\\\\",\"@\",\":\"];\n $key = str_replace($chars, \"\", $key);\n\n return $key;\n }",
"private function formatKey($key)\n {\n $key = ucwords(strtolower($key));\n $key = str_replace(' ', '', $key);\n return $key;\n }",
"public static function alm_filters_revert_underscore($key){\n\t \t// If value is _year, _month, _day or _author remove the '_'\n\t \t$key = ($key === '_year' || $key === '_month' || $key === '_day' || $key === '_author') ? str_replace('_', '', $key) : $key;\n\t \treturn $key;\n \t}",
"public static function alm_filters_replace_underscore($value){\n\t \t$underscore = strpos($value, '_');\n\t \tif($underscore){\n\t\t \t$charToReplace = substr($value, $underscore+1, 1);\n\t\t \t$value = str_replace('_'.$charToReplace, strToUpper($charToReplace), $value);\n\t \t}\n\n\t \t// If value is year, month or day add '_' before to prevent 404s. e.g. _year\n\t \t$value = ($value === 'year' || $value === 'month' || $value === 'day' || $value === 'author') ? '_'. $value : $value;\n\t \treturn $value;\n \t}",
"private function formatKey(string $key): string\n\t{\n\t\treturn str_replace('_', '-', strtolower($key));\n\t}",
"public function normaliseKey(string $key): string;",
"function unprefix( $key, $strip_underscores = true ) {\n\n\treturn utils\\unprefix_meta_key( $key, '_wpmoly_', $strip_underscores );\n}",
"public static function clear_key($k)\n\t{\n\t\tif(!$k)\n\t\t\treturn '';\n \t$k = htmlspecialchars(urldecode($k));\n \t$k = str_replace('..','',$k);\n \t$k = preg_replace('/\\_\\_(.+?)\\_\\_/','',$k);\n \t$k = preg_replace('/^([\\w\\.\\-\\_]+)$/','$1',$k);\n \treturn $k;\n\t}",
"function str_underscore($str)\n{\n return strtolower(preg_replace('/(?<=\\\\w)([A-Z]+)/', '_\\\\1', $str));\n}",
"private function _key($key) {\n if (empty($key)) {\n return false;\n }\n $key = preg_replace('/[\\s]+/', '_', strtolower(trim(str_replace(array(DIRECTORY_SEPARATOR, '/', '.'), '_', strval($key)))));\n return $key;\n }",
"function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }",
"function cap_sanitize_key_list ($key_list)\n{\n $keys = explode (' ', $key_list);\n $result = array ();\n foreach ($keys as $key) {\n $result[] = cap_sanitize_key ($key);\n }\n return implode (' ', $result);\n}",
"function remove_underscore($string)\n{\n return str_replace('_', ' ', $string);\n}",
"protected function normalizeKey($key)\r\n {\r\n if ($this->normalization & static::NORMALIZE_TRIM) {\r\n $key = trim($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_DELIMITERS) {\r\n $key = static::normalizeKeyDelimiters($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_CASE) {\r\n $key = strtolower($key);\r\n }\r\n\r\n if ($this->normalization & static::NORMALIZE_CANONICAL) {\r\n $key = static::canonicalizeKey($key);\r\n }\r\n\r\n return $key;\r\n }",
"private function _clean_input_keys($str) {\n\t\tif (!preg_match('/^[a-z0-9:_\\-\\/-\\\\\\\\*]+$/i', $str)) {\n\t\t\tlog_error('Disallowed Key Characters:' . $str);\n\t\t\texit ('Disallowed Key Characters:' . $str);\n\t\t}\n\n\t\treturn $str;\n\t}",
"function safe_name($name) {\n return preg_replace(\"/\\W/\", \"_\", $name);\n }",
"public static function camelCase2underscore(string $key): string\n {\n $str = lcfirst($key);\n return strtr($str, [\n 'A' => '_a', 'B' => '_b', 'C' => '_c', 'D' => '_d',\n 'E' => '_e', 'F' => '_f', 'G' => '_g', 'H' => '_h',\n 'I' => '_i', 'J' => '_j', 'K' => '_k', 'L' => '_l',\n 'M' => '_m', 'N' => '_n', 'O' => '_o', 'P' => '_p',\n 'Q' => '_q', 'R' => '_r', 'S' => '_s', 'T' => '_t',\n 'U' => '_u', 'V' => '_v', 'W' => '_w', 'X' => '_x',\n 'Y' => '_y', 'Z' => '_z',\n ]);\n }",
"static function spaceOrUnderscore( $pattern ) {\n\t\treturn str_replace( ' ', '[ _]', $pattern );\n\t}",
"function underscore(){\n\t\t$out = $this->_copy();\n\t\t$out->_String4 = mb_strtolower(preg_replace(\"/([a-z0-9\\p{Ll}])([A-Z\\p{Lu}])/u\",\"\\\\1_\\\\2\",$this->_String4));\n\t\treturn $out;\n\t}"
] | [
"0.78319865",
"0.763481",
"0.7522966",
"0.75154793",
"0.7513388",
"0.74508363",
"0.7443278",
"0.73540926",
"0.7339959",
"0.72198635",
"0.7205389",
"0.71277475",
"0.708133",
"0.7064286",
"0.69064254",
"0.6821983",
"0.677941",
"0.6736304",
"0.67110133",
"0.66038823",
"0.6601618",
"0.6594524",
"0.65874624",
"0.6586911",
"0.6561655",
"0.6515913",
"0.64981186",
"0.64634067",
"0.6456407",
"0.6401265"
] | 0.830038 | 0 |
Prepend output (HTML code or PHP code with tags) before the output (but after the namespace statement if present). | public function prependOutput($code)
{
$this->setOutput(
$this->hasNamespaceStatement($namespaceStatement, $output)
? $this->concatCode(
$this->closePhpCode($namespaceStatement),
$code,
$this->openPhpCode($output)
)
: $this->concatCode($code, $this->output)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prependCode($code)\n {\n return $this->prependOutput($this->closePhpCode($this->openPhpCode($code)));\n }",
"protected function transpileEndPrepend(): string\n {\n return '<?php $__env->stopPrepend(); ?>';\n }",
"public function prependNamespace($namespace, $hints);",
"public function PrependOutput(string $prepend = null) : self|string \n {\n if($prepend == null) return $this->prepend;\n else {\n $this->prepend = $prepend;\n return $this;\n }\n }",
"public function prependNamespace(string $namespace, $hints);",
"private function printHead()\n\t{\n\t\t$out = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\n\t\t$out .= $this->head . PHP_EOL;;\t\t\t\n\t\techo $out;\n\t}",
"function msdlab_pre_header(){\n print '<div class=\"pre-header\">\n <div class=\"wrap\">';\n do_action('msdlab_pre_header');\n print '\n </div>\n </div>';\n }",
"function yy_r14()\n {\n if ($this->text_is_php) {\n $this->compiler->prefix_code[] = $this->yystack[$this->yyidx + 0]->minor;\n $this->compiler->nocacheCode('', true);\n } else {\n // inheritance child templates shall not output text\n if (! $this->compiler->isInheritanceChild || $this->compiler->block_nesting_level > 0) {\n if ($this->strip) {\n $this->compiler->template_code->php('echo ')->string(preg_replace('![\\t ]*[\\r\\n]+[\\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor))->raw(\";\\n\");\n } else {\n $this->compiler->template_code->php('echo ')->string($this->yystack[$this->yyidx + 0]->minor)->raw(\";\\n\");\n }\n }\n }\n }",
"protected function transpilePrepend($expression): string\n {\n return \"<?php \\$__env->startPrepend{$expression}; ?>\";\n }",
"public function renderAjaxBodyBegin(&$output)\n\t{\n\t\t$html='';\n\t\t$replaceScripts='';\n\t\tif(isset($this->scriptFiles[self::POS_BEGIN])) {\n\t\t\tforeach($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('body').prepend\").\"\\n\";\n\t\t}\n\t\tif(isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_BEGIN])).\"\\n\";\n\t\t\n\t\tif($replaceScripts!=='') {\n\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t}\n\t\tif($html!=='') {\n\t\t\t$output=$html.$output;\n\t\t}\n\t}",
"protected function prepend_controls($out = '')\n\t{\n\t\t// Check if we are in 'line' context and if the control div has been added\n\t\tif ($this->line_opened === true && $this->controls_opened === false)\n\t\t{\n\t\t\t$out = '<div class=\"controls\">'.\"\\n\".$out;\n\t\t\t$this->controls_opened = true;\n\t\t}\n\t\treturn $out;\n\t}",
"function yy_r75(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; }",
"public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }",
"public final function startTag() : string\n {\n return $this->name ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') : '';\n }",
"public function prepend() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $arg = $arg->asHTML();\n }\n $this->content = $arg . $this->content;\n }\n return $this;\n }",
"public function stdWrap_prepend($content = '', $conf = [])\n {\n return $this->cObjGetSingle($conf['prepend'], $conf['prepend.'], '/stdWrap/.prepend') . $content;\n }",
"public function renderBodyBegin(&$output)\n\t{\n\t\t$html = '';\n\t\tif (isset($this->scriptFiles[self::POS_BEGIN]))\n\t\t{\n\t\t\tforeach ($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile) . \"\\n\";\n\t\t}\n\t\tif (isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=self::script(implode(\"\\n\", $this->scripts[self::POS_BEGIN])) . \"\\n\";\n\n\t\tif ($html !== '')\n\t\t{\n\t\t\t$count = 0;\n\t\t\t$output = preg_replace('/(<body\\b[^>]*>)/is', '$1<###begin###>', $output, 1, $count);\n\t\t\tif ($count)\n\t\t\t\t$output = str_replace('<###begin###>', $html, $output);\n\t\t\telse\n\t\t\t\t$output = $html . $output;\n\t\t}\n\t}",
"public function testPrepend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->prepend(\"Hello\")->prepend(\"World\");\n\n\t\t\t$this->assertEquals(\"WorldHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}",
"public function testPrependHtml() {\r\n\t\t$this->testObject->prependHtml ( '<div>test</div>' );\r\n\t\t$this->assertTrue ( '<div>test</div>' == $this->testObject->getPrependHtml (), 'incorrect prepended html found' );\r\n\t}",
"public function renderBodyBegin(&$output)\n\t{\n\t\t$html='';\n\t\tif(isset($this->scriptFiles[self::POS_BEGIN]))\n\t\t{\n\t\t\tforeach($this->scriptFiles[self::POS_BEGIN] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile).\"\\n\";\n\t\t}\n\t\tif(isset($this->scripts[self::POS_BEGIN]))\n\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_BEGIN])).\"\\n\";\n\n\t\tif($html!=='')\n\t\t{\n\t\t\t$count=0;\n\t\t\t$output=preg_replace('/(<body\\b[^>]*>)/is','$2<###begin###>',$output,1,$count);\n\t\t\tif($count)\n\t\t\t\t$output=str_replace('<###begin###>',$html,$output);\n\t\t\telse\n\t\t\t\t$output=$html.$output;\n\t\t}\n\t}",
"public function startContent() {\n ob_start();\n }",
"function HTML_StartHead(){\n\t\techo \"<!DOCTYPE html>\\n\";\n\t\techo \"<html>\\n\";\n\t\techo \"<head>\\n\";\n}",
"private function renderHead() {\n\t\t\n\t\t\t$this->outputLine('<head>');\n\t\t\t\n\t\t\tif ($this->_title != '') {\n\t\t\t\t$this->outputLine('\t<title>' . $this->_title . '</title>');\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('\t<base href=\"' . $this->_base . '\" />');\n\t\t\t\n\t\t\t$this->outputLine('\t<meta http-equiv=\"content-type\" content=\"' . $this->_contentType . '\" />');\n\t\t\t\n\t\t\t//Meta\n\t\t\tforeach ($this->_meta as $meta) {\n\t\t\t\t$this->outputLine('\t<meta name=\"' . $meta->name . '\" content=\"' . $meta->content . '\" />');\n\t\t\t}\n\t\t\t\n\t\t\t//CSS\n\t\t\tforeach ($this->_css as $css) {\n\t\t\t\t$this->outputLine(\"\t\" . $css);\n\t\t\t}\n\t\t\t\n\t\t\t//JS\n\t\t\tforeach ($this->_js as $js) {\n\t\t\t\t$this->outputLine(\"\t\" . $js);\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('</head>');\n\t\t\n\t\t}",
"public function removeNamespaceDeclarations() {\n\t\t$this->processedClassCode = preg_replace(self::PATTERN_NAMESPACE_DECLARATION, '', $this->processedClassCode);\n\t}",
"private function renderHead() {\n\t\t$head = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . PHP_EOL;\n\t\tif (!empty($this->stylesheets))\n\t\t\t$head .= implode(PHP_EOL, $this->stylesheets);\n\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$head .= $this->openTag('rss', array(\n\t\t\t\t\t\t\"version\" => \"2.0\",\n\t\t\t\t\t\t\"xmlns:content\" => \"http://purl.org/rss/1.0/modules/content/\",\n\t\t\t\t\t\t\"xmlns:atom\" => \"http://www.w3.org/2005/Atom\",\n\t\t\t\t\t\t\"xmlns:wfw\" => \"http://wellformedweb.org/CommentAPI/\")) . PHP_EOL;\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$head .= $this->openTag('rdf:RDF', array(\n\t\t\t\t\t\t\"xmlns:rdf\" => \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n\t\t\t\t\t\t\"xmlns\" => \"http://purl.org/rss/1.0/\",\n\t\t\t\t\t\t\"xmlns:dc\" => \"http://purl.org/dc/elements/1.1/\"\n\t\t\t\t\t)) . PHP_EOL;\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$head .= $this->openTag('feed', array(\"xmlns\" => \"http://www.w3.org/2005/Atom\")) . PHP_EOL;\n\t\t}\n\t\treturn $head;\n\t}",
"public static function header_output() {\n\t\tob_start();\n\n\t\tif ( self::options( 'header_type' ) == 'navbar-fixed-top' ) {\n\t\t\techo 'body{padding-top: 50px;}';\n\t\t}\n\n\t\tif ( ! display_header_text() ) {\n\t\t\techo '#site-title,.site-description{position: absolute;clip: rect(1px, 1px, 1px, 1px);}';\n\t\t} else {\n\t\t\tself::generate_css( '#site-title', 'color', 'header_textcolor', '#' );\n\t\t}\n\t\t$extra_css = apply_filters( 'maketador_header_output', ob_get_clean() );\n\t\tif ( ! empty( $extra_css ) ) {\n\t\t\techo '<style type=\"text/css\">' . $extra_css . '</style>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}",
"public abstract function add($prefix, $output);",
"public function startIndent() {\r\n\t\treturn '<div class=indent>';\r\n\t}",
"function yy_r163(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '\".$_tmp'.$this->prefix_number.'.\"'; $this->compiler->has_variable_string = true; }",
"public function renderAjaxHead(&$output) {\n\t\t/*\n\t\t$count=preg_match('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is',$output);\n\t\tif ($count){\n\t\t\t$this->renderHead($output);\n\t\t} else {\n\t\t*/\n\t\t\t$replaceScripts='';\n\t\t\t$html='';\n\t\t\tforeach($this->metaTags as $meta)\n\t\t\t\t$replaceScripts.=checkInsertReplaceMeta($meta).\"\\n\";\n\t\t\tforeach($this->linkTags as $link)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertLink($link).\"\\n\";\n\t\t\tforeach($this->cssFiles as $url=>$media)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertCssFile($url,$media).\"\\n\";\n\t\t\t\t\n\t\t\tforeach($this->css as $css)\n\t\t\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\t\t\tif($this->enableJavaScript) {\n\t\t\t\tif(isset($this->scriptFiles[self::POS_HEAD])) {\n\t\t\t\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('head').append\").\"\\n\";\n\t\t\t\t}\n\n\t\t\t\tif(isset($this->scripts[self::POS_HEAD]))\n\t\t\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n\t\t\t}\n\t\t\tif($replaceScripts!=='') {\n\t\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t\t}\n\t\t\tif($html!=='') {\n\t\t\t\t$output=$html.$output;\n\t\t\t}\n\t\t//}\n\t}"
] | [
"0.58757246",
"0.5805363",
"0.58006907",
"0.5750906",
"0.56097054",
"0.554297",
"0.54619336",
"0.5320644",
"0.52834266",
"0.52182925",
"0.5192875",
"0.5177417",
"0.51601654",
"0.5148874",
"0.51479465",
"0.5146182",
"0.5137702",
"0.512527",
"0.51183283",
"0.5111244",
"0.5107774",
"0.5084451",
"0.5070424",
"0.5064522",
"0.5045186",
"0.5034566",
"0.50327384",
"0.5018626",
"0.50058895",
"0.5004993"
] | 0.73823994 | 0 |
Check if the output contains a namespace statement at the beginning. | public function hasNamespaceStatement(&$namespaceStatement = '', &$afterCode = '')
{
if (preg_match('/^(<\?(?:php)?\s+namespace\s\S.*)(((?:;|\n|\?>)[\s\S]*)?)$/U', $this->output, $matches)) {
if (substr($matches[2], 0, 1) === ';') {
$matches[1] .= ';';
$matches[2] = substr($matches[2], 1);
}
$namespaceStatement = $matches[1];
$afterCode = $matches[2];
return true;
}
$afterCode = $this->output;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasNamespace() {\n return $this->_has(1);\n }",
"public function hasNamespace() {\n return ($this->namespace !== '');\n }",
"public function inNamespace()\n\t{\n\t\treturn false !== strrpos($this->name, '\\\\');\n\t}",
"public function isNamespace($in)\n {\n $elt = $this->getElement($in);\n\n return ($elt && ($elt['a'] & self::ELT_NAMESPACE));\n }",
"private static function hasNamespace($name)\n {\n return strpos($name, static::HINT_PATH_DELIMITER) > 0;\n }",
"public static function isEnabledNamespace() {\n\t\tglobal $wgAdConfig;\n\n\t\t$title = RequestContext::getMain()->getTitle(); // @todo FIXME filthy hack\n\t\tif ( !$title ) {\n\t\t\treturn false;\n\t\t}\n\t\t$namespace = $title->getNamespace();\n\n\t\tif ( in_array( $namespace, $wgAdConfig['namespaces'] ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function isInMainNamespace(): bool\n { if ($this->wikiPageAction->getNs() !== 0) {\n $this->log->notice(\"SKIP : page n'est pas dans Main (ns 0)\\n\");\n $this->db->skipArticle($this->title);\n\n return false;\n }\n return true;\n }",
"public function isMessageNamespace() {\n\t\tglobal $wgTranslateMessageNamespaces;\n\t\t$namespace = $this->getTitle()->getNamespace();\n\t\treturn in_array( $namespace, $wgTranslateMessageNamespaces );\n\t}",
"public function hasControllerNamespace()\r\n\t{\r\n\t\treturn !empty($this->controllerNamespace);\r\n\t}",
"public function hasCurrentSuccess()\n {\n return $this->hasCurrent(self::NAMESPACE_SUCCESS);\n }",
"public static function namespaceExist($namespace)\n {\n if (array_key_exists($namespace, $_SESSION)) {\n return true;\n }\n\n return false;\n }",
"public function namespaceExists ( $namespace ) {\n\n return false !== array_search($namespace, $this->_namespaces);\n }",
"public function hasPrefix()\n\t{\n\t\treturn $this->prefix !== null;\n\t}",
"public function genericGetVariablesSucceedsWithNamespaceTSFE() {}",
"protected function printNamespaceDeclarations(){\n \n $unique_namespaces = array();\n $output = '';\n \n foreach( $this->getNamespaceHeap() as $namespace ){\n \n $application_namespace = explode( '.', $namespace );\n \n for( $index = 0; $index < count( $application_namespace ); $index++ ){\n \n $namespace_name = implode( '.', array_slice($application_namespace, 0, $index + 1) );\n \n $unique_namespaces[$namespace_name] = null;\n\n }\n \n }\n \n $unique_namespaces = array_keys( $unique_namespaces );\n\n foreach( $unique_namespaces as $unique_namespace ){\n\n if( !preg_match('/\\\\./', $unique_namespace) ){\n\n $output .= 'var ';\n \n }\n \n $output .= $unique_namespace . ' = ' . $unique_namespace . ' || {};' . \"\\n\";\n\n }\n\n return $output;\n\n }",
"protected function hasNamespace($key)\n {\n return (bool)strpos($key, $this->nsSeparator);\n }",
"public function genericGetVariablesSucceedsWithNamespaceGP() {}",
"public function genericGetVariablesSucceedsWithNamespaceGP() {}",
"private function parseNamespace() {\n\n\t\t$namespace = '';\n\t\twhile (($token = $this->next())){\n\t\t\tif ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR) {\n\t\t\t\t$namespace .= $token[1];\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $namespace;\n\t}",
"private function isHeader(): bool\n {\n return $this->translation->getOriginal() === '' && $this->translation->getContext() === null;\n }",
"protected static function isNamespaced($className) {\n\t\t\t$result = strpos($className, '\\\\');\n\t\t\tif ($result !== false) {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}",
"public function hasNamespace($namespace)\n {\n return isset( $this->namespaces[ $namespace ] );\n }",
"public function testGetNamespace() {\n\t\t$session = $this->getSession();\n\t\t$this->assertSame('test', $session->getNamespace(), 'Namespace does not match');\n\t}",
"public function hasCurrentInfo()\n {\n return $this->hasCurrent(self::NAMESPACE_INFO);\n }",
"abstract protected function namespace(): string;",
"public static function inParsing()\n {\n return static::$process > 0;\n }",
"public function isEmpty()\r\n {\r\n return !isset($this->getNamespace()->{$this->getMember()});\r\n }",
"public function getNamespaceFromSource($code)\n {\n if (preg_match('/namespace\\s*([^;]+);/', $code, $m)==1) {\n return trim($m[1]);\n }\n\n return false;\n }",
"public function get_namespaces()\n {\n }",
"public function hasStart(){\n return $this->_has(2);\n }"
] | [
"0.6916824",
"0.6832139",
"0.6678534",
"0.58095455",
"0.5740581",
"0.571218",
"0.5710529",
"0.56909853",
"0.56116325",
"0.54563093",
"0.5415549",
"0.5394336",
"0.53494585",
"0.5325554",
"0.53163046",
"0.53065044",
"0.5304125",
"0.53023636",
"0.5142671",
"0.5140365",
"0.51137775",
"0.51114905",
"0.5070839",
"0.5069333",
"0.5049884",
"0.5047734",
"0.5025989",
"0.5023856",
"0.49943376",
"0.49921092"
] | 0.68481815 | 1 |
Test Case: Validate that the project has a title. | public function shouldHaveTitle()
{
// Arrange
$attributes = factory(Project::class)->raw([
'title' => '',
]);
// Action
$response = $this->post('/projects', $attributes);
// Assert
$response->assertSessionHasErrors('title');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProjectTitle();",
"public function testGettingTheTitle()\n {\n $this->assertEquals('title', $this->revision->getTitle());\n }",
"public function testAssignTitle()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }",
"public function testTitle()\n {\n $this->visit('/')\n ->see('Site title','title');\n }",
"public function set_title($title)\n\t{\n\t\tif (is_null($title)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Title Invalid!\");\n\t\t}\n\t\t$this->title = $title;\n\t}",
"public function testTitleErrors() {\n //Check the title is required\n $badData = $this->goodData;\n $badData['title'] = '';\n $this->assertFalse($this->Links->save($this->Links->newEntity($badData)));\n }",
"public function testNullTitle()\n {\n $this->browse(function (Browser $browser) {\n //Make a book to add \n $book = factory('App\\Book')->make();\n $book -> title = ' '; \n //Navigate to the create page and send the data\n $browser->visit('/api/books/create')\n ->type('title', $book->title)\n ->type('author', $book->author)\n ->press('Add');\n //Check we remain on the same page and an error is displayed.\n $browser->pause(500);\n $browser->assertPathIs('/api/books/create')->assertSee('The title field is required.');\n\n //Check the new book is not displayed\n $browser->visit('/api/books')\n ->assertDontSee($book->author);\n\n });\n\n }",
"public function it_should_have_a_title_that_contains_wizard()\n {\n // for example getTitle() should contain word 'dragon'\n $this->getTitle()->shouldMatch('/dragon/i');\n }",
"public function testTitle()\n {\n $this->markTestSkipped();\n }",
"public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }",
"public function testTitle()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's title is correct\n $this->assertTrue($feed->getTitle() instanceof Zend_Gdata_App_Extension_Title);\n $this->verifyProperty2(\n $feed,\n \"title\",\n \"text\",\n \"GData Ops Demo's Composite View\"\n );\n\n // Assert that all entry's have an Atom ID object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getTitle() instanceof Zend_Gdata_App_Extension_Title);\n }\n\n // Assert one of the entry's Titles\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"title\", \"text\", \"all day event may 24\");\n }",
"public function a_project_require_a_name()\n {\n $project = factory(Project::class)->raw(['name' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'name',\n ],\n ]);\n }",
"public function testGetTitle(){\n $this->assertSame(\"Ms./Mrs.\", Customer::getTitle(\"female\"));\n $this->assertSame(\"Mr.\", Customer::getTitle(\"male\"));\n $this->assertSame(\"\", Customer::getTitle(\"\"));\n $this->assertSame(\"\", Customer::getTitle(\"daererer\"));\n }",
"public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }",
"public function page_title_should_return_the_base_title_if_the_title_is_empty()\n {\n $this->assertEquals('Laracarte - List of artisans', page_title(''));\n }",
"public function validateTitle()\n {\n if (empty($this->_taintedData['title'])) {\n $this->_addErrorMessage(\"Please fill in the title\");\n\n return false;\n }\n\n $title = $this->_cleanData['title'];\n\n if (strlen($title) > 100) {\n $this->_addErrorMessage(\"Your talk title has to be 100 characters or less\");\n\n return false;\n }\n\n return true;\n }",
"function testNameAndTitleGeneration() {\n\t\t$file = $this->objFromFixture('File', 'asdf');\n\t\t$this->assertEquals('FileTest.txt', $file->Name);\n\t\t$this->assertNull($file->Title);\n\t\t\n\t\t/* However, if Name is set instead of Filename, then Title is set */\n\t\t$file = $this->objFromFixture('File', 'setfromname');\n\t\t$this->assertEquals(ASSETS_DIR . '/FileTest.png', $file->Filename);\n\t\t$this->assertEquals('FileTest', $file->Title);\n\t}",
"public function shouldHaveDescription()\n {\n // Arrange\n $attributes = factory(Project::class)->raw([\n 'description' => ''\n ]);\n\n // Action\n $response = $this->post('/projects', $attributes);\n\n // Assert\n $response->assertSessionHasErrors('description');\n }",
"private function check_title($title)\n {\n if(!empty($title))\n return true;\n else\n {\n $this->errors[] = 3; // empty title!\n return false;\n }\n }",
"private function validateProjectValues(\n string $title,\n string $url,\n string $folder\n ): bool {\n $valid = true;\n $v = Validator::make([], []);\n\n if (empty($title)) {\n $v->getMessageBag()\n ->add('title', 'Empty title');\n $valid = false;\n }\n if (empty($url)) {\n $v->getMessageBag()\n ->add('url', 'Empty url');\n $valid = false;\n }\n if (empty($folder)) {\n $v->getMessageBag()\n ->add('folder', 'Empty folder');\n $valid = false;\n }\n\n if (!UrlHelper::validate($url)) {\n $v->getMessageBag()\n ->add('url', 'Invalid url');\n $valid = false;\n }\n\n return $valid;\n }",
"public function validate_title( $valid, $title, $field, $input_name ) {\r\n\t\tglobal $post_id; //no value on ajax call / has value on submit\r\n\r\n\t\t$post_id_js = $_POST['custom_post_id'];\r\n\r\n\t // Bail early if value is already invalid.\r\n\t if( $valid !== true) {\r\n\t return $valid;\r\n\t }\r\n\r\n\t\t$dir = $this->create_downloads_dir();\r\n\t\t$slug = str_replace(\" \", \"-\", $title);\r\n\r\n\t\t$title_dir = $dir['reports_dir'].'/'.strtolower($slug);\r\n\r\n\t\t$title_exist = $this->check_if_title_exist($slug, $post_id_js);\r\n\r\n\t\tif($title_exist){\r\n\t\t\treturn __(\"Title already exist\");\r\n\t\t}\r\n\r\n\t\tif($post_id){\r\n\t\t\t$old_title = get_the_title($post_id);\r\n\t\t\t$old_title_slug = str_replace(\" \", \"-\", $old_title);\r\n\t\t\t$old_title_dir = $dir['reports_dir'].'/'.strtolower($old_title_slug);\r\n\t\t\t// wp_die($post_id);\r\n\t\t\tif($title != $old_title && $old_title && file_exists($old_title_dir)){\r\n\t\t\t\trename($old_title_dir, $title_dir);\r\n\t\t\t}else{\r\n\t\t\t\tif(!file_exists($title_dir)){ mkdir($title_dir, 0777); }\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t return $valid;\r\n\t}",
"public function validateTestCaseIdTitleUniqueness()\n {\n $dupes = [];\n foreach ($this->testCaseToTitleMappings as $newTitle => $files) {\n if (count($files) > 1) {\n $dupes[$newTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"TestCaseId and Title pairs must be unique:\\n\\n\";\n foreach ($dupes as $newTitle => $tests) {\n $testCaseTitleArray = explode(\": \", $newTitle);\n $testCaseId = $testCaseTitleArray[0];\n $title = $testCaseTitleArray[1];\n $message .= \"TestCaseId: '{$testCaseId}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }",
"public function testAdminCanNotAddAPageWithBlankTitle()\n {\n $params = [];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/blog/pages', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasErrors();\n\n $errors = session('errors');\n\n $this->assertEquals('The title field is required.', $errors->get('title')[0]);\n }",
"public function testIndexTitle()\n {\n\n // Add a page called \"title\".\n $page = $this->_simplePage(true, 'title');\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Should index title.\n $this->assertEquals('title', $document->title);\n\n }",
"public function checkUniqueTitle()\n {\n $this->viewBuilder()->layout(false);\n if($this->request->is('post')) {\n $data = $this->request->data;\n $result = $this->Titles->isTitleExist($data['name']);\n if(!empty($result)){\n echo \"false\";\n } else {\n echo \"true\";\n }\n }\n die;\n }",
"public function testEditTitleError() {\n\t\tRolesControllerTest::login($this);\n\n\t\t//データ生成\n\t\t$frameId = '181';\n\t\t$blockId = '181';\n\t\t$blockKey = 'block_' . $blockId;\n\t\t$roomId = '1';\n\n\t\t$data = array(\n\t\t\t'Frame' => array('id' => $frameId),\n\t\t\t'Block' => array('id' => $blockId, 'key' => $blockKey, 'room_id' => $roomId),\n\t\t\t'RssReader' => array(\n\t\t\t\t'key' => 'rss_reader_1',\n\t\t\t\t'url' => APP . 'Plugin' . DS . 'RssReaders' . DS . 'Test' . DS . 'Fixture' . DS . 'rss_v1.xml',\n\t\t\t\t'title' => '',\n\t\t\t\t'summary' => 'Edit summary',\n\t\t\t\t'link' => 'http://example.com',\n\t\t\t),\n\t\t\t'Comment' => array('comment' => 'Edit comment'),\n\t\t\tsprintf('save_%s', NetCommonsBlockComponent::STATUS_APPROVED) => '',\n\t\t);\n\n\t\t//テスト実行\n\t\t$ret = $this->testAction(\n\t\t\t'/rss_readers/rss_readers/edit/' . $frameId . '.json',\n\t\t\tarray(\n\t\t\t\t'method' => 'post',\n\t\t\t\t'data' => $data,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'return' => 'contents'\n\t\t\t)\n\t\t);\n\t\t$result = json_decode($ret, true);\n\n\t\t$this->assertArrayHasKey('code', $result, print_r($result, true));\n\t\t$this->assertEquals(400, $result['code'], print_r($result, true));\n\t\t$this->assertArrayHasKey('name', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('error', $result, print_r($result, true));\n\t\t$this->assertArrayHasKey('validationErrors', $result['error'], print_r($result, true));\n\t\t$this->assertArrayHasKey('title', $result['error']['validationErrors'], print_r($result, true));\n\n\t\tAuthGeneralControllerTest::logout($this);\n\t}",
"public function it_should_have_a_string_as_title()\n {\n // for example method getTitle() should return a string, if not it will be failed.\n $this->getTitle()->shouldBeString();\n }",
"public function testTitleExpected($url, $expectedTitle)\r\n {\t\r\n $p = new PageGrabber($url);\r\n\t$result = $p->get_title();\r\n\t\t\r\n\t$this->assertEquals($expectedTitle, $result);\r\n }",
"public function testTitleText() {\n // Confirm that the view has the normal title before making the view return\n // no result.\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n\n // Change the view to return no result.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Add a value which does not exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Euler',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_empty | Drupal');\n\n // Change the view to return a result instead.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Change to a value which does exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Ringo',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n }",
"public function testTitleMutator()\n {\n $data = [\n 'title' => strtolower($this->faker->sentence(rand(5, 10), $variableNbWords = true)),\n 'author' => strtolower($this->faker->name),\n ];\n\n $record = Book::create($data);\n\n if (ucfirst($data['title']) != $record->title || ucfirst($data['author']) != $record->author) {\n $this->assertTrue(false);\n }\n $this->assertTrue(true);\n }"
] | [
"0.71535224",
"0.70882756",
"0.6800982",
"0.6733853",
"0.66882277",
"0.66729856",
"0.66538966",
"0.663283",
"0.65382916",
"0.6493532",
"0.6470231",
"0.64035076",
"0.640006",
"0.63973784",
"0.6364185",
"0.63316715",
"0.62585",
"0.62511885",
"0.62008727",
"0.61617523",
"0.6118278",
"0.61099786",
"0.6106584",
"0.6094753",
"0.6062817",
"0.60593456",
"0.604611",
"0.60382104",
"0.60324883",
"0.59864134"
] | 0.7968348 | 0 |
Test Case: Validate that the project has a description. | public function shouldHaveDescription()
{
// Arrange
$attributes = factory(Project::class)->raw([
'description' => ''
]);
// Action
$response = $this->post('/projects', $attributes);
// Assert
$response->assertSessionHasErrors('description');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }",
"public function validateDescription()\n {\n if (empty($this->_cleanData['description'])) {\n $this->_addErrorMessage(\"Your description was missing\");\n\n return false;\n }\n\n return true;\n }",
"public function testCommandHasADescription()\n {\n self::assertNotEmpty($this->command->getDescription());\n }",
"public function __validate_description() {\n if (isset($this->initial_data['description'])) {\n $this->validated_data[\"description\"] = $this->initial_data['description'];\n } else {\n $this->validated_data[\"description\"] = \"\";\n }\n }",
"public function set_description($description)\n\t{\n\t\tif (is_null($description)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Description Invalid!\");\n\t\t}\n\t\t$this->description = $description;\n\t}",
"public function testGetDescription(): void\n {\n $this->class->setDescription($this->value);\n\n self::assertSame($this->value, $this->class->getDescription());\n }",
"public function testSetGetDescription()\n {\n $this->item->setDescription('A fine javelin, suitable for throwing at retreating enemies.');\n $this->assertEquals($this->item->getDescription(), 'A fine javelin, suitable for throwing at retreating enemies.');\n }",
"public function setProjectDescription($value)\n {\n return $this->set('ProjectDescription', $value);\n }",
"public function testAssignDescription()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }",
"public function testGetModDescription()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function test_create__with_description()\n {\n\n $testee = new ElementFactory();\n $expected = 'lorum ipsum';\n\n $spec = [\n 'attributes' => [\n 'type' => 'text',\n 'name' => 'test',\n ],\n 'description' => $expected\n ];\n\n $element = $testee->create($spec);\n\n static::assertSame($expected, $element->description());\n }",
"function validate() {\n\t\tif( !access_has_global_level( config_get( 'create_project_threshold' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Access denied to create projects',\n\t\t\t\tERROR_ACCESS_DENIED\n\t\t\t);\n\t\t}\n\n\t\tif( is_blank( $this->payload( 'name' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name cannot be empty',\n\t\t\t\tERROR_EMPTY_FIELD,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_project = $this->data['payload'];\n\n\t\t$this->name = $this->payload( 'name' );\n\t\t$this->description = $this->payload( 'description', '' );\n\t\t$this->inherit_global = $this->payload( 'inherit_global', true );\n\t\t$this->file_path = $this->payload( 'file_path', '' );\n\t\t$this->view_state = isset( $t_project['view_state'] ) ? mci_get_project_view_state_id( $t_project['view_state'] ) : config_get( 'default_project_view_status' );\n\t\t$this->status = isset( $t_project['status'] ) ? mci_get_project_status_id( $t_project['status'] ) : 10 /* development */;\n\t\t$this->enabled = $this->payload( 'enabled', true );\n\n\t\tif( !project_is_name_unique( $this->name ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name is not unique',\n\t\t\t\tERROR_PROJECT_NAME_NOT_UNIQUE,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_enum_values = MantisEnum::getValues( config_get( 'project_status_enum_string' ) );\n\t\tif( !in_array( $this->status, $t_enum_values ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project status',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'status' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->inherit_global ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project inherit global',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'inherit_global' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->enabled ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project enabled',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'enabled' )\n\t\t\t);\n\t\t}\n\t}",
"public function descriptionAction()\n {\n $module = $this->getModule();\n $config = Pi::config('', $module);\n\n if ($this->request->isPost()) {\n $data = $this->request->getPost();\n\n // Set form\n $form = new DescForm('solution-desc-form', 'html');\n $form->setInputFilter(new DescFilter);\n $form->setData($data);\n\n if ($form->isValid()) {\n $values = $form->getData();\n\n // Save\n $description = Pi::user()->data->set(0, 'solutions_description', $values['description']);\n\n } else {\n $message = _a('Invalid data, please check and re-submit.');\n }\n } else {\n $data['description'] = Pi::user()->data->get(0, 'solutions_description');\n if (empty($data['description'])) {\n $data['description'] = '<div style=\"font-size: 20px;\">Content is empty.</div>';\n }\n $form = new DescForm('solution-desc-form', 'html');\n $form->setData($data);\n $message = '';\n }\n\n $this->view()->assign('form', $form);\n $this->view()->assign('title', _a('Solutions Description'));\n $this->view()->assign('message', $message);\n $this->view()->setTemplate('solution-description');\n\n }",
"public function getDescriptionAction() {\n\n $project_id = $this->input->post('project_id');\n\n $response = $this->project_model->getDescription($project_id);\n\n echo $response[0]['description'];\n }",
"protected function checkDescription(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Description) && $this->_Description !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Description} is not a valid value for Description\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && strlen($this->_Description) > 30 ) {\n\t\t\t$inMessage .= \"Description cannot be more than 30 characters\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid && strlen($this->_Description) <= 1 ) {\n\t\t\t$inMessage .= \"Description must be more than 1 character\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}",
"public function testGetDescriptionDefault(): void\n {\n self::assertNull($this->class->getDescription());\n }",
"public function setDescription($description);",
"public function setDescription($description);",
"public function setDescription($description);",
"public function setDescription($description);",
"public function setDescription($description);",
"public function setDescription($description);",
"public function testProjectListCanBeGenerated()\n {\n $title = \"Test Name\";\n $description = \"A Test Project\";\n $image = \"TestImage.png\";\n $this->createTestProject($title, $description, $image);\n\n $title2 = \"Test Name2\";\n $description2 = \"A Test Project2\";\n $image2 = \"TestImage.png2\";\n $this->createTestProject($title2, $description2, $image2);\n\n $projectsApi = new ProjectList($this->getDb());\n $answer = $projectsApi->get();\n\n $items = $answer['items'];\n $this->assertCount(2, $items, \"Two projects were created, so there should be 2 entries in the array\");\n\n $project = $items[0];\n $this->assertEquals($title, $project['title']);\n $this->assertEquals($description, $project['description']);\n $this->assertEquals(\"Default\", $project['imageType']);\n }",
"public function testSetGetDescription()\n {\n $charge = new Charge();\n $charge->setDescription('Centurion Guarded Delivery via Horse');\n $this->assertEquals($charge->getDescription(), 'Centurion Guarded Delivery via Horse');\n unset($charge);\n }",
"public function testSetAndGetDescription()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Description\r\n $testObj->setDescription('Test Test Test Test');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that the Description field was updated\r\n $this->assertEquals('Test Test Test Test', $testObj->getDescription());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'Description');\r\n }",
"function isValidTaskDescription($taskDescription){\n if (strlen($taskDescription) <= 200){\n return true;\n }\n else{\n echo \"invalid taskDescription\";\n return false;\n }\n }",
"protected function checkDescription(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Description) && $this->_Description !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Description} is not a valid value for Description\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}",
"public function __construct($description)\n {\n $this->description = $description;\n }",
"function checkDescr($descr, $X_langArray) {\n\tglobal $errorField;\n\t\n\t//descr vuoto\n\tif (!isset($descr) || $descr == ''){\n\t\t$errorField .= \"&descrErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_EMPTY_DS_ERR']);\n\t}\n\telse if (strlen($descr) < 50 || strlen($descr) > 2000) {\n\t\t$errorField .= \"&descrErrMsg=\".urlencode($X_langArray['CREATE_COUNTRY_REV_DS_LENGTH_ERR']);\n\t}\n}",
"public function testDescription()\n {\n $description_original = \"This is the original \\\"description\\\".\";\n $description_received =\n MetaTags::setDescription($description_original,0)\n ->getDescription();\n\n // Make sure what we got back is what we put in. (not truncated)\n $this->assertEquals(\n $description_original,\n $description_received,\"The original description was not a match\"\n );\n\n // Do the same test, but with truncation turned on.\n $description_received =\n MetaTags::setDescription($description_original,10)\n ->getDescription();\n\n // Test to make sure truncation is working.\n $this->assertEquals(\n $description_received,\n MetaTags::truncateAtWord($description_original,10)\n );\n\n $tag_text = MetaTags::renderDescription(true)->__toString();\n $this->assertStringStartsWith(\"<meta \",$tag_text);\n $this->assertStringEndsWith(\">\",$tag_text);\n }"
] | [
"0.83257455",
"0.6658854",
"0.6538204",
"0.64926475",
"0.6483126",
"0.6443382",
"0.6401218",
"0.6279939",
"0.62030315",
"0.6143676",
"0.6071989",
"0.60656685",
"0.59975594",
"0.5943932",
"0.5922573",
"0.592254",
"0.5910526",
"0.5910526",
"0.5910526",
"0.5910526",
"0.5910526",
"0.5910526",
"0.5900232",
"0.58841515",
"0.58813095",
"0.587948",
"0.5867373",
"0.5840735",
"0.583622",
"0.5819227"
] | 0.8085601 | 1 |
Draw a control to show/hide this layer. | public function draw_toggle ()
{
echo $this->toggle_as_html ();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw_control($buffer, $ct)\r\n{\r\n\tcall_user_func(\"draw_\" . strtolower($ct->cclass), $buffer, $ct->caption, $ct->left, $ct->top, $ct->width, $ct->height, $ct->style, $ct->value);\r\n}",
"public function draw() {\r\n $g = $this->chart->getGraphics3D();\r\n $e = $g->getGraphics();\r\n\r\n $r = new Rectangle($this->x0,$this->y0,$this->x1-$this->x0,$this->y1-$this->y0);\r\n\r\n if($this->chart->getParent()!=null) {\r\n if ($this->bBrush != null && $this->bBrush->getVisible()) {\r\n $brushXOR = -1 ^ $this->bBrush->getColor()->getRGB();\r\n $e->setXORMode($this->Color->fromArgb($brushXOR));\r\n $e->fillRect($this->x0, $this->y0, $this->x1 - $this->x0, $this->y1 - $this->y0);\r\n\r\n if ($this->pen!= null && $this->pen->getVisible()) {\r\n $penXOR = -1 ^ $this->pen->getColor()->getRGB();\r\n $e->setXORMode($this->Color->fromArgb($penXOR));\r\n $e->drawRect($this->x0-1,$this->y0-1,$this->x1+1-$this->x0,$this->y1+1-$this->y0);\r\n }\r\n }\r\n else if($this->pen!= null && $this->pen->getVisible()) {\r\n $this->chart->invalidate();\r\n $g->setPen($this->getPen());\r\n $g->getBrush()->setVisible(false);\r\n $g->rectangle($r);\r\n $g->getBrush()->setVisible(true);\r\n }\r\n else {\r\n $this->chart->invalidate();\r\n $tmpColor = new Color();\r\n $tmpLineCap = new LineCap();\r\n $tmpDashStyle = new DashStyle();\r\n $g->setPen(new ChartPen($this->chart, $tmpColor->BLACK, true, 1, $tmpLineCap->BEVEL, $tmpDashStyle->DASH));\r\n $g->getBrush()->setVisible(false);\r\n $g->rectangle($r);\r\n $g->getBrush()->setVisible(true);\r\n }\r\n }\r\n }",
"protected function _draw_control_panel($extra_break = false)\n {\n $this->drawControlPanel($extra_break);\n }",
"protected function _drawStyle($style) {}",
"function drawStyle()\r\n\t{\r\n\t}",
"public function draw()\n {\n echo \"画一个 {$this->color->run()} 的正方形\";\n }",
"public function draw() {}",
"public function draw() {}",
"public function draw();",
"protected function buildControl()\n\t\t{\n\t\t\tswitch($this->getDisplayMode())\n\t\t\t{\n\t\t\t\tcase self::DISPLAYMODE_ICONS :\n\t\t\t\t\t$this->buildIconView();\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::DISPLAYMODE_LIST :\n\t\t\t\t\t$this->buildListView();\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::DISPLAYMODE_DETAILS :\n\t\t\t\t\t$this->buildDetailView();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstatic::fail(\"Unknown DisplayMode '%s'\", $this->getDisplayMode());\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"function paint()\r\n {\r\n echo \"$this->_canvas.paint();\\n\";\r\n }",
"function ControlFormDraw( $sControl, $raChangeParms = array() )\r\n /**************************************************************\r\n Draw a control in a <FORM> that propagates the component's parms.\r\n You should be able to have any number of these forms on your UI, and they'll all propagate each others' state via CtrlGlobal\r\n\r\n $raChangeParms : manage which parms are excluded, altered, or added. See marshalStateParms\r\n */\r\n {\r\n $s = \"<FORM action='{$this->raCompConfig['sFormAction']}' method='{$this->raCompConfig['sFormMethod']}'\"\r\n .(empty($this->raCompConfig['sFormTarget']) ? \"\" : \" target='{$this->raCompConfig['sFormTarget']}'\")\r\n .\">\"\r\n .$sControl\r\n .$this->EncodeHiddenFormParms( $raChangeParms )\r\n .\"</FORM>\";\r\n\r\n return( $s );\r\n }",
"function initControls()\n {\n\n $this->map->getControls()->getMaptype()->setDisplay((boolean) $this->showMapType);\n\n $this->map->getControls()->getMaptype()->setPosition($this->mapTypePosition);\n $this->map->getControls()->getMaptype()->setType($this->mapTypeType);\n\n $this->map->getControls()->getScale()->setDisplay((boolean) $this->showScale);\n $this->map->getControls()->getScale()->setPosition($this->scalePosition);\n\n $this->map->getControls()->getNavigation()->setDisplay((boolean) $this->showNavigation);\n\n $this->map->getControls()->getNavigation()->setPosition($this->navigationPosition);\n\n $this->map->getControls()->getNavigation()->setType($this->navigationType);\n\n\n $this->map->getControls()->getZoom()->setDisplay((boolean) $this->showZoom);\n $this->map->getControls()->getZoom()->setPosition($this->zoomPosition);\n $this->map->getControls()->getZoom()->setType($this->zoomType);\n\n $this->map->getControls()->getPan()->setDisplay((boolean) $this->showPan);\n $this->map->getControls()->getPan()->setPosition($this->panPosition);\n\n if ($this->initialMapType)\n {\n $this->map->setMaptype(new Tx_Listfeusers_Gmap_Maptype($this->initialMapType));\n }\n\n }",
"public function controls($display = true)\n {\n if($display) {\n $this->attributes['controls'] = true;\n } else {\n unset($this->attributes['controls']);\n }\n\n return $this;\n }",
"function beginDraw()\r\n {\r\n echo \"<script type=\\\"text/javascript\\\">\\n\";\r\n echo \" var cnv=findObj('$this->_object');\\n\";\r\n echo \" if (cnv==null) cnv=findObj('{$this->_object}_outer');\\n\";\r\n echo \" var $this->_canvas = new jsGraphics(cnv);\\n\";\r\n $this->_canvas= \" \" . $this->_canvas;\r\n }",
"public function draw()\n {\n echo 'Draw rectangle';\n }",
"public function draw()\n {\n echo 'Draw circle';\n }",
"function ShowBorder($exterior=true,$interior=true) {\n\t$this->pie_border = $exterior;\n\t$this->pie_interior_border = $interior;\n }",
"function wp_render_widget_control($id)\n {\n }",
"function _displayFormEditDraw($draw=\"\")\r\n\t{\r\n\t\t$utd =& $this->_utd;\r\n\t\t$ut =& $this->_ut;\r\n\r\n\t\t$utpage = new utPage('draws');\r\n\t\t$utpage->_page->addAction('onload', array('resize', 500, 360));\n\t\t$content =& $utpage->getPage();\r\n\t\t$form =& $content->addForm('fdraws', 'draws', KID_UPDATE);\r\n\t\t$form->setTitle('tEditDraw');\r\n\t\t$ranks = $this->_dt->getRanks();\r\n\r\n\t\tif (is_array($draw)) $infos = $draw;\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ( $draw != -1) $drawId = kform::getData();\r\n\t\t\telse $drawId = $draw;\r\n\t\t\t$infos = $utd->getDrawById($drawId);\r\n\t\t\tif ($infos['draw_id'] == -1)\r\n\t\t\t{\r\n\t\t\t\t$infos['draw_serial'] = kform::getData();\r\n\t\t\t\t$infos['draw_rankdefId'] = reset(array_keys($ranks));\r\n\t\t\t\t$form->setTitle('tNewDraw');\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Display warning if exist\r\n\t\tif (isset($infos['errMsg'])) $form->addWng($infos['errMsg']);\r\n\r\n\t\t// Initialize the field\r\n\t\t$form->addHide(\"drawId\", $infos['draw_id']);\r\n\r\n\t\t$serials = $utd->getSerialsList();\r\n\t\t$form->addCombo('drawSerial', $serials, $serials[$infos['draw_serial']]);\r\n\t\tif ($infos['draw_id'] == -1)\r\n\t\t{\r\n\t\t\t$discis[WBS_MS] = $ut->getLabel(WBS_MS);\r\n\t\t\t$discis[WBS_WS] = $ut->getLabel(WBS_WS);\r\n\t\t\t$discis[WBS_MD] = $ut->getLabel(WBS_MD);\r\n\t\t\t$discis[WBS_WD] = $ut->getLabel(WBS_WD);\r\n\t\t\t$discis[WBS_XD] = $ut->getLabel(WBS_XD);\r\n\t\t\t$form->addCombo('drawDisci', $discis, $infos['draw_disci']);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$form->addHide(\"drawDisci\", $infos['draw_disci']);\r\n\t\t\t$form->addInfo('drawDisciLabel', $ut->getLabel($infos['draw_disci']));\r\n\t\t\t$form->addInfo('drawPairs', $infos['draw_nbPairs']);\r\n\t\t}\r\n\r\n\t\tfor($i=WBS_CATAGE_POU; $i<=WBS_CATAGE_VET; $i++)\r\n\t\t$catages[$i] = $ut->getLabel($i);\r\n\t\t$kcombo =& $form->addCombo('drawCatage',\r\n\t\t$catages, $catages[$infos['draw_catage']]);\n\t\t$actions = array( 1 => array('changeCatage'));\n\t\t$kcombo->setActions($actions);\n\t\t// Numero des categories d'age\n\t\tswitch($infos['draw_catage'])\n\t\t{\n\t\t\tcase WBS_CATAGE_POU: $max = 0; break;\n\t\t\tcase WBS_CATAGE_SEN: $max = 0; break;\n\t\t\tcase WBS_CATAGE_VET: $max = 5; break;\n\t\t\tdefault: $max = 2; break;\n\t\t}\n\t\tfor($i=0; $i<=$max; $i++) $num[$i] = $i;\n\t\t$kcombo =& $form->addCombo('drawNumcatage', $num, $infos['draw_numcatage']);\n\t\t\t\r\n\t\tif (isset($ranks[$infos['draw_rankdefId']])) $sel = $ranks[$infos['draw_rankdefId']];\r\n\t\telse $sel = reset($ranks);\r\n\t\t$kcombo =& $form->addCombo('drawRank', $ranks, $sel);\r\n\r\n\t\t$kedit =& $form->addEdit('drawName', $infos['draw_name'], 29);\r\n\t\t$kedit->setMaxLength(50);\r\n\t\t$kedit =& $form->addEdit('drawStamp', $infos['draw_stamp'], 29);\r\n\t\t$kedit->setMaxLength(10);\r\n\r\n\t\t$elts=array('drawDisciLabel', 'drawPairs', 'drawSerial', 'drawCatage', 'drawNumcatage',\r\n\t\t 'drawRank', 'drawDisci', 'drawName', 'drawStamp');\r\n\t\t$form->addBlock(\"blkOne\", $elts);\r\n\r\n\t\t$form->addDiv('break', 'blkNewPage');\r\n\t\t$form->addBtn('btnRegister', KAF_SUBMIT);\r\n\t\t$form->addBtn('btnCancel');\r\n\t\t$elts=array('btnRegister', 'btnCancel');\r\n\t\t$form->addBlock('blkBtn', $elts);\r\n\r\n\t\t//Display the form\r\n\t\t$utpage->display();\r\n\t\texit;\r\n\t}",
"protected function _register_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'section_style',\n\t\t\tarray(\n\t\t\t\t'label' => esc_html__( 'Style', 'woocommerce-builder-elementor' ),\n\t\t\t\t'tab' => \\Elementor\\Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'wc_style_warning',\n\t\t\t[\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::RAW_HTML,\n\t\t\t\t'raw' => esc_html__( 'This is the preview mode of the builder, this widget may not show properly you should view the result in the Product Page and The style of this widget is often affected by your theme and plugins. If you experience any such issue, try to switch to a basic theme and deactivate related plugins.', 'woocommerce-builder-elementor' ),\n\t\t\t\t'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',\n\t\t\t]\n\t\t);\n\t\t\n\n\t\t$this->end_controls_section();\n\n\t}",
"protected function generateGraphic() {}",
"public function draw()\n {\n return;\n }",
"function controls()\n\t{\n\t}",
"function draw(callable $callback)\n {\n $callback($this);\n\n return $this;\n }",
"public function &draw_show_hide_button($in_tag, $in_value = false)\n {\n $text = \"\";\n\n if (!$this->isShowing($in_tag)) {\n $text .= '<TD>';\n //$text .= '<input class=\"reportico-maintain-tab-menu-but-unsel reportico-submit\" type=\"submit\" name=\"submit_'.$in_tag.\"_SHOW\".'\" value=\"'.$in_value.'\">';\n $text .= '<input size=\"1\" style=\"visibility:hidden\" class\"reportico-submit\" type=\"submit\" name=\"unshown_' . $in_tag . '\" value=\"\">';\n $text .= '</TD>';\n } else {\n $text .= '<TD>';\n //$text .= '<input class=\"reportico-maintain-tab-menu-but-sel\" type=\"submit\" name=\"submit_'.$in_tag.\"_SHOW\".'\" value=\"'.$in_value.'\">';\n $text .= '<input size=\"1\" style=\"visibility:hidden\" class\"reportico-submit\" type=\"submit\" name=\"shown_' . $in_tag . '\" value=\"\">';\n $text .= '</TD>';\n }\n return $text;\n\n }",
"public function draw($canvas)\n {\n }",
"public function draw($canvas)\n {\n }",
"public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }",
"public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }"
] | [
"0.5348689",
"0.5283098",
"0.5161275",
"0.49148992",
"0.47804546",
"0.4765552",
"0.47641298",
"0.47641298",
"0.47612262",
"0.4706103",
"0.46131423",
"0.4598237",
"0.44832623",
"0.44379333",
"0.44325125",
"0.4385947",
"0.43674254",
"0.43544593",
"0.43535206",
"0.43508768",
"0.43448323",
"0.43281296",
"0.42934117",
"0.4271563",
"0.42692703",
"0.42358303",
"0.4225929",
"0.4225929",
"0.42253032",
"0.42253032"
] | 0.5656325 | 0 |
Check if there is no user in system before run install | private function checkinstallrequirement()
{
$userCount = Core_User::getUsers(array(), '', '', '', true);
if($userCount > 0)
return false;
else
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function check_user_installed()\n {\n if ($this->uid == 0) {\n return true;\n }\n\n $exists = $this->STOR->get_folder_id_from_path('waste');\n if (empty($exists)) {\n $this->create_user();\n }\n }",
"public static function isInstalled(){\n\t\treturn !empty(\\GO::config()->db_user);\n\t}",
"function installCheck() {\n // Check if user table exists for check.\n $result = $this->db->exec('SELECT name FROM sqlite_master WHERE type=\"table\" AND name=\"users\"');\n if (empty($result)) {\n $this->installSetupForm();\n } else {\n echo 'The site has already been installed.';\n }\n }",
"public function checkInstall()\n {\n if (($this->get('db') == '' || !file_exists($this->get('db'))) || $this->get('passwd') == '')\n {\n Misc::redirect('install.php');\n }\n }",
"protected function checkInstallToolPasswordNotSet() {}",
"public function hasInstall();",
"public function allow_auto_install()\n\t{\n\t\treturn TRUE;\n\t}",
"public function checkCLIuser() {}",
"function checkUser(){\n global $OPTION;\n if ('root' == trim(`whoami`)) {\n $OPTION['isRoot'] = true;\n }else{\n echo 'You have to exec command as root, but you loged in as ' . `whoami` . PHP_EOL;\n exit;\n };\n return true;\n}",
"protected function outputInstallToolNotEnabledMessageIfNeeded() {}",
"protected function outputInstallToolNotEnabledMessageIfNeeded() {}",
"protected static function isInstallToolSession() {}",
"function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}",
"function install_root_user() {\n $fields = array(\n 'username' => $site_config['adminUser'],\n 'password' => $site_config['adminPassword'],\n 'role' => DEFAULT_ADMIN_RID,\n 'email' => $site_config['adminEmail'],\n 'name' => $site_config['adminName'],\n 'language' => Session::get('lang'),\n 'active' => 1\n );\n $new_user = new User();\n if($new_user->create($fields)) {\n return true;\n }\n else {\n System::addMessage('error', rt('The site administrator could not be created. Please verify that your server meets the requirements for the application and that your database user has sufficient permissions ot make changes in the database'));\n }\n}",
"function drush_sandwich_make_me_a_sandwich_validate() {\n if (drush_is_windows()) {\n // $name = drush_get_username();\n // TODO: implement check for elevated process using w32api\n // as sudo is not available for Windows\n // http://php.net/manual/en/book.w32api.php\n // http://social.msdn.microsoft.com/Forums/en/clr/thread/0957c58c-b30b-4972-a319-015df11b427d\n }\n else {\n $name = posix_getpwuid(posix_geteuid());\n if ($name['name'] !== 'root') {\n return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.'));\n }\n }\n}",
"public function install()\n {\n // Install default\n if (!parent::install()) {\n return false;\n }\n\n if (!$this->registrationHook()) {\n return false;\n }\n\n if (!Configuration::updateValue('EPUL_USERNAME', '')\n || !Configuration::updateValue('EPUL_PASSWORD', '')\n ) {\n return false;\n }\n\n return true;\n }",
"protected function install_mail_user() {\n $this->prompt_info(\"Creating user accounts\", false);\n if ($this->create_system_user($this->MAIL_USER, $this->MAIL_USER_GROUP, null, $this->MAIL_USER_UID)) {\n $this->prompt_done();\n return true;\n } else {\n $this->prompt_last_error();\n }\n }",
"function AdminUsers_install()\n\t{\n\t}",
"function noUser() {\n\t}",
"private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }",
"public static function checkInstall() {\n\t\t\t// TODO: Something awesoem\n\t\t\tif(!file_exists(\"engine/values/mysql.values.php\")){\n\t\t\t\tLayoutManager::redirect(\"INSTALL.php\");\n\t\t\t} else if(file_exists(\"INSTALL.php\")){\n\t\t\t\tFileHandler::delete(\"INSTALL.php\");\n\t\t\t\techo \"<center><img src=\\\"images/warning.png\\\" height=14px border=0/> Please delete 'INSTALL.php'. It's unsafe to have this in the root directory.</center>\";\n\t\t\t} \n\t\t}",
"protected function beforeInstall(): bool\n {\n return true;\n }",
"public function isValidInstall() {\n\t\treturn $this->install !== null;\n\t}",
"public static function installToolEnableFileExists() {}",
"public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }",
"public function isSystemUser(): bool\n {\n return $this->system;\n }",
"function is_initial_install() : bool {\n\t// Support for PHPUnit & direct calls to install.php.\n\t// phpcs:ignore -- Ignoring requirement for isset on $_SERVER['PHP_SELF'] and wp_unslash().\n\tif ( php_sapi_name() === 'cli' && basename( $_SERVER['PHP_SELF'] ) === 'install.php' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! defined( 'WP_CLI' ) ) {\n\t\treturn false;\n\t}\n\n\t$runner = WP_CLI::get_runner();\n\n\t// Check it's the core command.\n\tif ( $runner->arguments[0] !== 'core' ) {\n\t\treturn false;\n\t}\n\n\t// If it's the is-installed command and --network is set then\n\t// allow MULTISITE to be defined.\n\tif ( $runner->arguments[1] === 'is-installed' && isset( $runner->assoc_args['network'] ) ) {\n\t\treturn false;\n\t}\n\n\t// Check it's an install related command.\n\t$commands = [ 'is-installed', 'install', 'multisite-install', 'multisite-convert' ];\n\tif ( ! in_array( $runner->arguments[1], $commands, true ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"protected function isInitialInstallationInProgress() {}",
"public function needs_installing() {\n\t\t$settings = red_get_options();\n\n\t\tif ( $settings['database'] === '' && $this->get_old_version() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function accountswitcher_is_installed()\n{\n\tglobal $db;\n\n\tif ($db->field_exists(\"as_uid\", \"users\") && $db->field_exists(\"as_canswitch\", \"usergroups\") && $db->field_exists(\"as_limit\", \"usergroups\"))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}"
] | [
"0.7581932",
"0.715836",
"0.7073247",
"0.6882467",
"0.6655213",
"0.66145295",
"0.64996564",
"0.6467071",
"0.6458869",
"0.6385002",
"0.63844544",
"0.6367339",
"0.63509744",
"0.6332938",
"0.6308024",
"0.6225235",
"0.62100196",
"0.6204143",
"0.6195796",
"0.61802447",
"0.61358196",
"0.6118471",
"0.6116351",
"0.6080407",
"0.60665",
"0.60573834",
"0.6051998",
"0.6040345",
"0.6011086",
"0.60069716"
] | 0.76897407 | 0 |
Returns the default area. | public function getDefault(): AreaContract; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getArea(){}",
"abstract protected function getArea();",
"public function getArea()\n {\n return $this->area;\n }",
"public function getArea()\n {\n return $this->area;\n }",
"public function getArea()\n {\n return $this->area;\n }",
"public function getMinArea();",
"public function getCurrentArea(): AreaContract;",
"public function getCoreArea()\n {\n return $this->coreArea;\n }",
"public function getArea(): ?string\n {\n return $this->Area ?? null;\n }",
"public function getMapArea()\n {\n return $this->mapArea;\n }",
"public function getMaxArea();",
"public function getUserDefaultAreaOfApplication()\n {\n $user = $this->getUser();\n\n return \\is_array($user->newsAreaOfApplication_default) ? $user->newsAreaOfApplication_default : [];\n }",
"function amap_ma_get_map_default_location() {\n $defaultlocation = trim(elgg_get_plugin_setting('map_default_location', AMAP_MA_PLUGIN_ID));\n\n return $defaultlocation;\n}",
"public function getAreaId()\n {\n return $this->area;\n }",
"function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}",
"public function getDefaultRegion() : ?string;",
"public function getAreaRegion()\n {\n return $this->area_region;\n }",
"function getArea(){\r\n return ($this->width * $this->height);\r\n }",
"public function area()\n {\n return $this->height * $this->width;\n }",
"public function getArea()\n {\n return 1 / 2 * $this->side1 * $this->getHeight();\n }",
"public function getAreaID() {\n return $this->get(self::AREAID);\n }",
"public function getConfineArea() {\n return $this->_confine; \n }",
"public function getAreaId()\n {\n return $this->areaId;\n }",
"public function getAreaName()\n {\n return $this->area_name;\n }",
"public function getAreaDeep()\n {\n return $this->area_deep;\n }",
"public function getArea(){\n return $this -> side * $this -> side;\n }",
"public function getBaseArea() {\n return parent::getRadius() * parent::getRadius() * pi();\n }",
"public function getAreaCdArea()\n {\n return $this->area_cd_area;\n }",
"public function getViewArea() {}",
"function area() { return ($this->max->x() - $this->min->x()) * ($this->max->y() - $this->min->y()); }"
] | [
"0.71531254",
"0.703821",
"0.70051736",
"0.70051736",
"0.70051736",
"0.6843785",
"0.6804903",
"0.6653907",
"0.6632202",
"0.6630729",
"0.6630361",
"0.6607033",
"0.6565798",
"0.65325135",
"0.64702046",
"0.64623237",
"0.63978213",
"0.6356822",
"0.6306662",
"0.6298281",
"0.6276246",
"0.627603",
"0.62747276",
"0.62616265",
"0.62125564",
"0.6194754",
"0.61932266",
"0.61362904",
"0.60943025",
"0.606851"
] | 0.778171 | 0 |
Checks if the route has area. | public function hasAreaInUri(): bool; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasAreas()\n\t{\n\t\treturn count($this->getAreas()) > 0 ? true : false;\n\t}",
"public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}",
"public function hasMapareas(){\n return $this->_has(30);\n }",
"public function hasRoute(): bool;",
"public function hasArea(string $name): bool {\n $area = $this->areas()->firstWhere('area_define_name', $name);\n\n return \\is_object($area);\n }",
"public function Pareas(){\n if($this->empleado->cargo->permisoscargo->areas) return true;\n return false;\n }",
"public function hasRoute(): bool\n {\n return isset($this->route);\n }",
"protected function isAdminArea(RouteMatched $event)\n {\n if ($action = $event->route->getAction()) {\n return config('administrator.prefix') === Arr::get($action, 'prefix');\n }\n\n return false;\n }",
"public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}",
"public function isMyArea($idArea){\n if($idArea == $this->empleado->id_area) return true;\n return false;\n }",
"function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}",
"function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is an admin or not see if they have a token set.\n\t\t* This is an extra safe-guard so an admin user can disable the xmlapi altogether and not have any 'backdoor' sort of access.\n\t\t*/\n\t\tif ($area == 'xmlapi') {\n\t\t\tif ($this->xmlapi && $this->xmltoken != null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->isListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'segments') {\n\t\t\tif ($this->isSegmentAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($this->getSegmentAdminType() == 'a') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'users') {\n\t\t\tif ($this->isUserAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'templates') {\n\t\t\tif ($this->isTemplateAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->group->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->group->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far \n\t\t// (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t/**\n\t\t * If you can manage an area, you can edit the area too.\n\t\t * \n\t\t * This excludes \"Subscribers\" where there is a special permission \n\t\t * called manage that is used to give \"view\" access to users\n\t\t */\n\t\tif ($area != 'subscribers' && $subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n /**\n * As Dynamic Content only has one general permission across the \n * application. We put this condition to filter it.\n */\n\t\tif ($area == 'dynamiccontenttags') {\n\t\t\t$subarea = 'general';\n\t\t}\n\n\t\tif (in_array($subarea, $this->group->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists' || $area == 'segments') {\n\t\t\t\tif (in_array($id, $this->group->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// since we're checking a specific item, if they don't have access to it already, they don't have access to it\n\t\t\t\t// so deny access.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// if we happen to pass in an id for something other than templates or lists, then return true.\n\t\t\t\t// we've already checked they have access to the area with the in_array check above.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function isValidRoute($route) {\n \n return $route == 'campus' ||\n $route == 'extended' ||\n $route == 'nathanBisk' ||\n $route == 'downtown';\n}",
"private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }",
"public static function isValidArea($area)\n {\n $areas = self::getAreas();\n return array_search($area, array_column($areas, 'area')) !== FALSE;\n }",
"public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }",
"public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }",
"function userIsAreaAdmin() {\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->areaAdmin(Yawp::authUsername(), $this->area);\n\t}",
"public function isBackendArea(): bool;",
"public function isFrontendArea(): bool;",
"public function isOnRoute(): bool\n {\n $lang = $this->grav['language']->getActive();\n\n $path = $this->grav['uri']->rootUrl() ?: '/';\n $routes = $this->config->get('plugins.' . $this->name . '.routes');\n\n foreach ($routes as $route) {\n ['blog' => $blog, 'items' => $items] = $route;\n if ($path === $blog || str_starts_with($path, $items)) {\n if ($lang) {\n $route['blog'] = '/' . $lang . $route['blog'];\n $route['items'] = '/' . $lang . $route['items'];\n }\n $this->routes = $route;\n\n return true;\n }\n }\n\n return false;\n }",
"function is_outlet()\n {\n return $this->testFlag('Outlet');\n }",
"public function hasOverviewMapControl()\n {\n return $this->overviewMapControl !== null;\n }",
"public static function isAllowed( string $route ): ?bool {\n\n\t\t$a = null;\n\n\t\tforeach( main_nodes as $k => $v ) {\n\n\t\t\tif( $v['route'] === $route ) {\n\n\t\t\t\t$a = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $a;\n\n\t}",
"function getArea(){}",
"public function testOutsideAnyArea()\n {\n $lat = '37.70772645289051';\n $long = '-124.74426269531249';\n \n // When I query\n $response = $this->call('GET', \"/gatekeeper/here/$lat/$long\");\n $json = json_decode($response->getContent());\n \n // Then I get ok,\n $this->assertResponseStatus(200);\n \n // And I am not marked as being in any zone,\n $this->assertEquals($json->isInAnyZone, false);\n \n // And I have no service\n $this->assertEquals($json->hasService, false);\n $this->assertEquals($json->AvailableServices, new \\stdClass() );\n }",
"public function hasRegion() : bool;",
"abstract protected function getArea();",
"public function hasLocations()\n {\n return !empty($this->locations);\n }"
] | [
"0.7603163",
"0.69949114",
"0.69821006",
"0.6713858",
"0.65964144",
"0.6544885",
"0.6253558",
"0.61429286",
"0.6127362",
"0.6124531",
"0.6122773",
"0.6086456",
"0.6034936",
"0.6012592",
"0.596994",
"0.5922196",
"0.589419",
"0.58625555",
"0.585383",
"0.58433014",
"0.58283865",
"0.580866",
"0.5782834",
"0.576414",
"0.5760383",
"0.5753309",
"0.5743579",
"0.57196885",
"0.56931484",
"0.56810486"
] | 0.7533639 | 1 |
Gets an area object based on the current authentication and URI.. | public function getCurrentArea(): AreaContract; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}",
"function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }",
"public function getAreaID() {\n return $this->get(self::AREAID);\n }",
"public function getArea($areaId) {\n $methods = array(\"areas\", $areaId);\n return $this->get($methods);\n }",
"function getArea(){}",
"public function getAreaId()\n {\n return $this->area;\n }",
"public function getAuthority() {}",
"public function getAuthority();",
"public function getAreaId()\n {\n return $this->areaId;\n }",
"abstract protected function getArea();",
"protected function get_authority()\n {\n }",
"protected function get_authority()\n {\n }",
"public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}",
"public function getAuthority()\n {\n }",
"public function getAuthority()\n {\n }",
"public function getDefault(): AreaContract;",
"public static function area($area)\n\t{\n\t //return the first to the last item :)\n\t\t$clean = explode('/',$area);\n\t\tarray_pop($clean);\n $area = array_pop($clean);\n\t\treturn $area;\n\t\t\n\t}",
"public function getArea($areaId = -1) {\r\r\n //check $areaId is numeric\r\n if (!is_numeric($areaId) || ($areaId == -1) ){\r\n\t\t\t\techo 'Only numeric parameters.';\r\n\t\t\t\texit;\r\r\n }\r\r\n\r\n $select = $this->select()->where(\"area_code = ?\",$areaId);\r\t\t\r\n $result = $this->_db->fetchRow($select);\t\r\n return ($result == false) ? false : $result = $result;\t\r\r\n }",
"public function getAcl()\n {\n if (!isset($this->persistent->acl)) {\n\n $acl = new AclList();\n\n $acl->setDefaultAction(Acl::DENY);\n\n $config = $this->getDi()->getConfig();\n\n $roles = $config->acl->roles;\n foreach ($roles as $name => $description) {\n $acl->addRole(new Role($name, $description));\n }\n \n //Private area resources\n $privateResources = $config->acl->resources->private->toArray();\n foreach ($privateResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Public area resources\n $publicResources = $config->acl->resources->public->toArray();\n foreach ($publicResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Grant access to public areas to all roles\n foreach ($roles as $name => $description) {\n foreach ($publicResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow($name, $resource, $action);\n }\n }\n }\n\n //Grant access to private area to role admin\n foreach ($privateResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('admin', $resource, $action);\n }\n }\n\n //The acl is stored in session, APC would be useful here too\n $this->persistent->acl = $acl;\n }\n\n return $this->persistent->acl;\n }",
"public function getArea($area_id) {\n $query = $this->db->query(\"SELECT a.area_id,a.code,a.status,a.name,c.city_id,z.zone_id,coun.country_id FROM \" . DB_PREFIX . \"area a LEFT JOIN \" . DB_PREFIX . \"city c on (c.city_id=a.city_id) LEFT JOIN \" . DB_PREFIX . \"zone z on (z.zone_id=c.zone_id) LEFT JOIN \" . DB_PREFIX . \"country coun on (coun.country_id=z.country_id) WHERE area_id = '\" . (int) $area_id . \"'\");\n\n return $query->row;\n }",
"public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"public function getByIdOrDefault(string $id): AreaContract;",
"function getArea($area)\n {\n $areas = array();\n if(isset($this->areas[$area])){\n ksort($this->areas[$area]);\n $areas = $this->areas[$area];\n }\n return $areas;\n }",
"public static function getAreaByName($name) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select MAX(idArea) as idArea from area where nameArea like '$name'\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"public function getArea()\n {\n return $this->area;\n }",
"public function getArea()\n {\n return $this->area;\n }",
"public function getArea()\n {\n return $this->area;\n }",
"function particulararea($id)\n\t{\n\t\t$getarea=\"SELECT * from area where id = $id\";\n\t\t$ggetareadata = $this->get_results( $getarea );\n\t\treturn $ggetareadata;\n\t}",
"public function authority() : string;",
"public function authority() : string;"
] | [
"0.71639353",
"0.5839835",
"0.58337224",
"0.57626384",
"0.5714214",
"0.56563824",
"0.5603818",
"0.5573664",
"0.55681014",
"0.5548246",
"0.5512833",
"0.55104506",
"0.54429555",
"0.5393728",
"0.5393728",
"0.5348709",
"0.53483814",
"0.5346598",
"0.5346179",
"0.5306775",
"0.52887",
"0.52742946",
"0.52562267",
"0.5253057",
"0.52424854",
"0.52424854",
"0.52424854",
"0.52402496",
"0.5234226",
"0.5234226"
] | 0.61644125 | 1 |
Returns collection of frontend areas. | public function getFrontendAreas(): AreasCollection; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBackendAreas(): AreasCollection;",
"public function getAreas(): AreasCollection;",
"function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }",
"function getAreas () {\n return $this->templateParser->getAreas();\n }",
"public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }",
"public function index()\n {\n $areas = Area::orderBy('area')->get();\n return view('main.expedition.area.index')->withAreas($areas);\n }",
"public function index()\n {\n $areas = Area::all();\n \n return view('areas', compact('areas'));\n }",
"public function index()\n {\n //\n $areas = Area::all();\n return view('backend.area.index', compact('areas'));\n }",
"public function panelAreas(): Collection {\n return $this->areas()->map(\n function ($area) {\n if (! $area instanceof Model) {\n throw new \\Exception('['.__LINE__.']['.__FILE__.']');\n }\n\n return PanelService::make()->get($area);\n }\n );\n }",
"public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"public function index()\n {\n $subareas = subarea::all();\n return response($subareas,200);\n }",
"function get_duo_areas() {\n \t\n }",
"public function index()\n {\n $areas = Area::all();\n return view ('config.areas.index', compact('areas'));\n }",
"public function index()\n {\n $areas = Area::orderBy('id', 'DESC')->paginate(10);\n\n return view('admin.areas.index')->with('areas', $areas);\n }",
"public function index()\n {\n $contentAreas = Content_Area::all();\n\n return view('content_areas.index', compact('contentAreas'));\n }",
"public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }",
"public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}",
"public function index()\n {\n $areas = Area::all();\n return view('area.index', compact('areas'));\n }",
"public function index()\n {\n\n $totalAreas = Area::count();\n\n return view('catalogos.areas.index')->with(compact('totalAreas'));\n }",
"public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }",
"public function get_widget_areas() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( ! empty( $this->widget_areas ) ) {\n\t\t\t\treturn $this->widget_areas;\n\t\t\t}\n\n\t\t\t// Get widget areas saved in theem mod\n\t\t\t$widget_areas = wprt_get_mod( 'widget_areas' );\n\n\t\t\t// If theme mod isn't empty set to class widget area var\n\t\t\tif ( ! empty( $widget_areas ) && is_array( $widget_areas ) ) {\n\t\t\t\t$this->widget_areas = array_unique( array_merge( $this->widget_areas, $widget_areas ) );\n\t\t\t}\n\n\t\t\t// Return widget areas\n\t\t\treturn $this->widget_areas;\n\t\t}",
"public function index()\n {\n $areas = DB::table('areas')->get();\n\n return view('admin.areas.index', [ 'areas' => $areas]);\n }",
"private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }",
"public function getIndex()\n {\n $areas = new stdClass();\n $areas->default = 'site';\n\n $areas->panels = new stdClass();\n $areas->panels->site = new stdClass();\n $areas->panels->site->name = 'Site';\n $areas->panels->site->id = 'site';\n $areas->panels->site->link = 'admin/site';\n\n $areas->panels->user = new stdClass();\n $areas->panels->user->name = 'Users';\n $areas->panels->user->id = 'users';\n $areas->panels->user->link = 'admin/user';\n\n $this->setViewData('areas', $areas);\n }",
"public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}",
"public function index()\n {\n return TareaResource::collection(Tarea::with('categorias')->get());\n }",
"public function index()\n {\n $title = \"All Area Picket\";\n $areas = $this->repository->getAll();\n return view('areas.index', compact('title', 'areas'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $areaIns = $em->getRepository('BrooterAdminBundle:AreaIn')->findAll();\n\n return $this->render('areain/index.html.twig', array(\n 'areaIns' => $areaIns,\n ));\n }",
"public function index()\n {\n //$sub_area = Sub_area::all();\n //Listar relaciones con foreach EagerLoading\n $sub_area = Sub_area::with('areas')->get();\n //dd($area = $sub_area->areas());\n\n return view('sub_area.index',['sub_area' => $sub_area]);\n }",
"public function index()\n {\n if(!auth()->user()->can('ver areas'))\n return response ()->view ('errors.403');\n $areas = Areas::all();\n return view('RRHH/areas', compact('areas',$areas));\n }"
] | [
"0.8302107",
"0.768433",
"0.7483156",
"0.67402995",
"0.65598005",
"0.6485121",
"0.64217377",
"0.6399152",
"0.63838756",
"0.6331877",
"0.6327003",
"0.6270569",
"0.624795",
"0.6233313",
"0.6231023",
"0.6228049",
"0.61884534",
"0.6188238",
"0.60617375",
"0.6052353",
"0.5984779",
"0.5982425",
"0.59765816",
"0.5970407",
"0.5957227",
"0.5936749",
"0.5886044",
"0.58649963",
"0.58543134",
"0.5848863"
] | 0.8913702 | 0 |
Returns collection of backend areas. | public function getBackendAreas(): AreasCollection; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFrontendAreas(): AreasCollection;",
"function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }",
"public function getAreas(): AreasCollection;",
"public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"function getAreas () {\n return $this->templateParser->getAreas();\n }",
"public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}",
"private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }",
"public function panelAreas(): Collection {\n return $this->areas()->map(\n function ($area) {\n if (! $area instanceof Model) {\n throw new \\Exception('['.__LINE__.']['.__FILE__.']');\n }\n\n return PanelService::make()->get($area);\n }\n );\n }",
"public function index()\n {\n //\n $areas = Area::all();\n return view('backend.area.index', compact('areas'));\n }",
"public function get_widget_areas() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( ! empty( $this->widget_areas ) ) {\n\t\t\t\treturn $this->widget_areas;\n\t\t\t}\n\n\t\t\t// Get widget areas saved in theem mod\n\t\t\t$widget_areas = wprt_get_mod( 'widget_areas' );\n\n\t\t\t// If theme mod isn't empty set to class widget area var\n\t\t\tif ( ! empty( $widget_areas ) && is_array( $widget_areas ) ) {\n\t\t\t\t$this->widget_areas = array_unique( array_merge( $this->widget_areas, $widget_areas ) );\n\t\t\t}\n\n\t\t\t// Return widget areas\n\t\t\treturn $this->widget_areas;\n\t\t}",
"public function index()\n {\n $areas = Area::all();\n return view ('config.areas.index', compact('areas'));\n }",
"public function index()\n {\n $areas = Area::all();\n \n return view('areas', compact('areas'));\n }",
"public static function obtenerAreas()\n {\n $consulta = \"SELECT * FROM areas\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }",
"function get_duo_areas() {\n \t\n }",
"public function getAreas($moduleName) {\n $areas = $this->luAdmin->perm->getAreas();\n return $areas;\n }",
"public function index()\n {\n $subareas = subarea::all();\n return response($subareas,200);\n }",
"public function index()\n {\n $contentAreas = Content_Area::all();\n\n return view('content_areas.index', compact('contentAreas'));\n }",
"public function index()\n {\n $areas = Area::orderBy('area')->get();\n return view('main.expedition.area.index')->withAreas($areas);\n }",
"public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }",
"public function index()\n {\n $areas = Area::all();\n return view('area.index', compact('areas'));\n }",
"public function index()\n {\n $areas = DB::table('areas')->get();\n\n return view('admin.areas.index', [ 'areas' => $areas]);\n }",
"public function index()\n {\n $areas = Area::orderBy('id', 'DESC')->paginate(10);\n\n return view('admin.areas.index')->with('areas', $areas);\n }",
"public function index()\n {\n\n $totalAreas = Area::count();\n\n return view('catalogos.areas.index')->with(compact('totalAreas'));\n }",
"public function index()\n {\n $title = \"All Area Picket\";\n $areas = $this->repository->getAll();\n return view('areas.index', compact('title', 'areas'));\n }",
"public function getRegions() {\n $query = <<<SQL\n SELECT\n *\n FROM\n region\nSQL;\n\t\t\n\t\treturn $this->DB->execute($query);\n }",
"public static function get_all_regions() {\r\n $DB = new \\Nefuzz\\Php\\DBC();\r\n $result = ($DB)->query_to_array(\"\r\n SELECT *\r\n FROM regions;\r\n \",'',[]);\r\n $DB->quit();\r\n return $result;\r\n }",
"public function isBackendArea(): bool;",
"public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}",
"public function selectallAreas()\n {\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Area ORDER BY Position ASC \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }"
] | [
"0.7982292",
"0.7863667",
"0.7485426",
"0.67022675",
"0.6593737",
"0.64866",
"0.64379495",
"0.63639337",
"0.6276418",
"0.61409205",
"0.6113982",
"0.6099114",
"0.60839504",
"0.6070243",
"0.60538787",
"0.5982377",
"0.5981833",
"0.59129614",
"0.58314604",
"0.58313364",
"0.5829481",
"0.58068717",
"0.5794942",
"0.5779072",
"0.5741784",
"0.5726398",
"0.5722805",
"0.5707307",
"0.5701471",
"0.56510574"
] | 0.8922755 | 0 |
Checks if the current area belongs to the Frontend Areas. | public function isFrontendArea(): bool; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isBackendArea(): bool;",
"public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}",
"public function hasAreas()\n\t{\n\t\treturn count($this->getAreas()) > 0 ? true : false;\n\t}",
"public function is_frontend_editor_page() {\n\t\tif ( is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tif (\n\t\t\t// Layouts frontend editor\n\t\t\tisset( $_GET['toolset_editor'] )\n\t\t\t// Beaver Builder frontend editor\n\t\t\t|| isset( $_GET['fl_builder'] )\n\t\t\t// CRED frontend editor pages, when discoverable\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static function isFrontEnd()\n {\n return parse_url(Url::to('@web'))['path'] !== '/admin';\n }",
"protected function isFrontend() {}",
"protected function isFrontendEditActive() {}",
"protected function isFrontendEditActive() {}",
"public function isEnvironmentInFrontendMode() {}",
"public function Pareas(){\n if($this->empleado->cargo->permisoscargo->areas) return true;\n return false;\n }",
"public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }",
"function is_tabber_tabs_area_active( $index ){\n global $wp_registered_sidebars;\n\n $widgetcolums = wp_get_sidebars_widgets();\n\t\t \n if ($widgetcolums[$index]) return true;\n \n\treturn false;\n}",
"public function isMyArea($idArea){\n if($idArea == $this->empleado->id_area) return true;\n return false;\n }",
"public function isFrontendProtected() {\n return ($this->protection & FRONTEND_PROTECTION) >= 1;\n }",
"function biagiotti_mikado_is_header_widget_area_active( $area ) {\n\t\t\n\t\tif ( empty( $area ) || ! in_array( $area, array( 'one', 'two' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_header_widget_area_' . $area . '_meta', true );\n\t\t$is_active = false;\n\t\t\n\t\tif ( get_post_meta( $page_id, 'mkdf_disable_header_widget_areas_meta', 'true' ) !== 'yes' ) {\n\t\t\tif ( is_active_sidebar( 'mkdf-header-widget-area-' . $area ) && empty( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $is_active;\n\t}",
"public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}",
"public function getFrontendAreas(): AreasCollection;",
"public function is_on_dashboard() {\n return ($this->page->pagelayout == 'mydashboard');\n }",
"public function isFrontendEnabled()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_FRONTEND_QUOTATION_VISIBILITY,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"function cinerama_edge_dashboard_page() {\n\t\treturn is_page_template('user-dashboard.php');\n\t}",
"public function isFrontendEditingActive() {}",
"private function set_currFilterIsArea()\n {\n // 3.9.24, 120604, dwildt+\n if ( empty( $this->pObj->objCal->arr_area ) )\n {\n $this->bool_currFilterIsArea = false;\n return;\n }\n // 3.9.24, 120604, dwildt+\n // SWITCH current tableField is a filter with areas\n // Set class var $bool_currFilterIsArea\n switch ( in_array( $this->curr_tableField, array_keys( $this->pObj->objCal->arr_area ) ) )\n {\n case( true ):\n $this->bool_currFilterIsArea = true;\n break;\n case( false ):\n default:\n $this->bool_currFilterIsArea = false;\n break;\n }\n // Set class var $bool_currFilterIsArea\n // SWITCH current tableField is a filter with areas\n\n return;\n }",
"public static function isBackEnd()\n {\n return parse_url(Url::to('@web'))['path'] === '/admin';\n }",
"public function canShowTab()\n {\n if (!$this->getPage()->getId()\n || !Mage::helper('gri_cms/hierarchy')->isEnabled()\n || !Mage::getSingleton('admin/session')->isAllowed('cms/hierarchy'))\n {\n return false;\n }\n return true;\n }",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }",
"function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is an admin or not see if they have a token set.\n\t\t* This is an extra safe-guard so an admin user can disable the xmlapi altogether and not have any 'backdoor' sort of access.\n\t\t*/\n\t\tif ($area == 'xmlapi') {\n\t\t\tif ($this->xmlapi && $this->xmltoken != null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->isListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'segments') {\n\t\t\tif ($this->isSegmentAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($this->getSegmentAdminType() == 'a') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'users') {\n\t\t\tif ($this->isUserAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'templates') {\n\t\t\tif ($this->isTemplateAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->group->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->group->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far \n\t\t// (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t/**\n\t\t * If you can manage an area, you can edit the area too.\n\t\t * \n\t\t * This excludes \"Subscribers\" where there is a special permission \n\t\t * called manage that is used to give \"view\" access to users\n\t\t */\n\t\tif ($area != 'subscribers' && $subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n /**\n * As Dynamic Content only has one general permission across the \n * application. We put this condition to filter it.\n */\n\t\tif ($area == 'dynamiccontenttags') {\n\t\t\t$subarea = 'general';\n\t\t}\n\n\t\tif (in_array($subarea, $this->group->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists' || $area == 'segments') {\n\t\t\t\tif (in_array($id, $this->group->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// since we're checking a specific item, if they don't have access to it already, they don't have access to it\n\t\t\t\t// so deny access.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// if we happen to pass in an id for something other than templates or lists, then return true.\n\t\t\t\t// we've already checked they have access to the area with the in_array check above.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"protected function isFrontendMode()\n {\n return TYPO3_MODE == 'FE';\n }",
"public function hasArea(string $name): bool {\n $area = $this->areas()->firstWhere('area_define_name', $name);\n\n return \\is_object($area);\n }",
"public static function canDisplayEstateAgentsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ESTATE_AGENT);\n\t}",
"function userIsAreaAdmin() {\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->areaAdmin(Yawp::authUsername(), $this->area);\n\t}"
] | [
"0.7264344",
"0.65700805",
"0.6398109",
"0.63687813",
"0.618559",
"0.61806226",
"0.6110364",
"0.6110364",
"0.60622245",
"0.6055879",
"0.60200214",
"0.595142",
"0.5877826",
"0.58299637",
"0.5816312",
"0.5805617",
"0.5796868",
"0.57897466",
"0.57710737",
"0.575129",
"0.5743461",
"0.56553525",
"0.56487817",
"0.56476456",
"0.56398356",
"0.56123763",
"0.5603064",
"0.5602145",
"0.55947655",
"0.5593116"
] | 0.79931414 | 0 |
Checks if the current area belongs to the Backend Areas. | public function isBackendArea(): bool; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isFrontendArea(): bool;",
"public function hasAreas()\n\t{\n\t\treturn count($this->getAreas()) > 0 ? true : false;\n\t}",
"public function isBackendContext() {}",
"function is_tabber_tabs_area_active( $index ){\n global $wp_registered_sidebars;\n\n $widgetcolums = wp_get_sidebars_widgets();\n\t\t \n if ($widgetcolums[$index]) return true;\n \n\treturn false;\n}",
"public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}",
"public function isBackend();",
"public function isAdminBackend()\n {\n /* @var $owner Controller */\n $owner = $this->owner;\n $url = $owner->getRequest()->getURL();\n if (strpos($url, 'admin/') === 0) {\n return true;\n }\n if (strpos($url, 'dev/') === 0) {\n return true;\n }\n // Because keep-alive pings done through ajax could trigger requirements loading\n if (strpos($url, 'Security/ping') === 0) {\n return true;\n }\n if (\n $owner instanceof LeftAndMain ||\n $owner instanceof DevelopmentAdmin ||\n $owner instanceof DatabaseAdmin ||\n (class_exists('DevBuildController') && $owner instanceof DevBuildController)\n ) {\n return true;\n }\n\n return false;\n }",
"function biagiotti_mikado_is_header_widget_area_active( $area ) {\n\t\t\n\t\tif ( empty( $area ) || ! in_array( $area, array( 'one', 'two' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$page_id = biagiotti_mikado_get_page_id();\n\t\t$custom_menu_widget_area = get_post_meta( $page_id, 'mkdf_custom_header_widget_area_' . $area . '_meta', true );\n\t\t$is_active = false;\n\t\t\n\t\tif ( get_post_meta( $page_id, 'mkdf_disable_header_widget_areas_meta', 'true' ) !== 'yes' ) {\n\t\t\tif ( is_active_sidebar( 'mkdf-header-widget-area-' . $area ) && empty( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t} else if ( ! empty( $custom_menu_widget_area ) && is_active_sidebar( $custom_menu_widget_area ) ) {\n\t\t\t\t$is_active = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $is_active;\n\t}",
"public static function isBackEnd()\n {\n return parse_url(Url::to('@web'))['path'] === '/admin';\n }",
"function userIsAreaAdmin() {\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->areaAdmin(Yawp::authUsername(), $this->area);\n\t}",
"public function isEnvironmentInBackendMode() {}",
"public function getBackendAreas(): AreasCollection;",
"public function Pareas(){\n if($this->empleado->cargo->permisoscargo->areas) return true;\n return false;\n }",
"public function canUserAssignAreaOfApplication()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::areasOfApplication', $user->alexf, true);\n }",
"public function isMyArea($idArea){\n if($idArea == $this->empleado->id_area) return true;\n return false;\n }",
"public static function isAdminBackend()\n {\n return session_name() === 'eSIdAdm';\n }",
"public function getIsBackend()\n {\n if ($this->_isBackend === null) {\n $this->_isBackend = strpos($this->controllerNamespace, 'backend') === false ? false : true;\n }\n\n return $this->_isBackend;\n }",
"public function isBackendProtected() {\n return ($this->protection & BACKEND_PROTECTION) >= 1;\n }",
"public function isAllowed()\n {\n if ($this->appState->getAreaCode() == self::AREA_BACKEND) {\n return false;\n }\n\n $userAgentList = $this->helperData->getUserAgentList();\n $userAgent = $this->geoipHelperHttp->getHttpUserAgent();\n if (!empty($userAgentList) && $userAgent) {\n foreach ($userAgentList as $agent) {\n $agent = str_replace(['*', '/'], ['.*', '\\/'], $agent);\n if (preg_match(\"/{$agent}$/i\", $userAgent)) {\n return false;\n }\n }\n }\n\n $request = $this->request;\n $exceptionUrls = $this->helperData->getExceptionUrls();\n if (!empty($exceptionUrls)) {\n $requestString = $request->getRequestString();\n foreach ($exceptionUrls as $url) {\n $url = str_replace('*', '.*?', $url);\n if (preg_match('!^' . $url . '$!i', $requestString)) {\n return false;\n }\n }\n }\n\n return true;\n }",
"public function hasArea(string $name): bool {\n $area = $this->areas()->firstWhere('area_define_name', $name);\n\n return \\is_object($area);\n }",
"private function set_currFilterIsArea()\n {\n // 3.9.24, 120604, dwildt+\n if ( empty( $this->pObj->objCal->arr_area ) )\n {\n $this->bool_currFilterIsArea = false;\n return;\n }\n // 3.9.24, 120604, dwildt+\n // SWITCH current tableField is a filter with areas\n // Set class var $bool_currFilterIsArea\n switch ( in_array( $this->curr_tableField, array_keys( $this->pObj->objCal->arr_area ) ) )\n {\n case( true ):\n $this->bool_currFilterIsArea = true;\n break;\n case( false ):\n default:\n $this->bool_currFilterIsArea = false;\n break;\n }\n // Set class var $bool_currFilterIsArea\n // SWITCH current tableField is a filter with areas\n\n return;\n }",
"public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}",
"function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is an admin or not see if they have a token set.\n\t\t* This is an extra safe-guard so an admin user can disable the xmlapi altogether and not have any 'backdoor' sort of access.\n\t\t*/\n\t\tif ($area == 'xmlapi') {\n\t\t\tif ($this->xmlapi && $this->xmltoken != null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->isListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'segments') {\n\t\t\tif ($this->isSegmentAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($this->getSegmentAdminType() == 'a') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'users') {\n\t\t\tif ($this->isUserAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'templates') {\n\t\t\tif ($this->isTemplateAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->group->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->group->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far \n\t\t// (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t/**\n\t\t * If you can manage an area, you can edit the area too.\n\t\t * \n\t\t * This excludes \"Subscribers\" where there is a special permission \n\t\t * called manage that is used to give \"view\" access to users\n\t\t */\n\t\tif ($area != 'subscribers' && $subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n /**\n * As Dynamic Content only has one general permission across the \n * application. We put this condition to filter it.\n */\n\t\tif ($area == 'dynamiccontenttags') {\n\t\t\t$subarea = 'general';\n\t\t}\n\n\t\tif (in_array($subarea, $this->group->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists' || $area == 'segments') {\n\t\t\t\tif (in_array($id, $this->group->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// since we're checking a specific item, if they don't have access to it already, they don't have access to it\n\t\t\t\t// so deny access.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// if we happen to pass in an id for something other than templates or lists, then return true.\n\t\t\t\t// we've already checked they have access to the area with the in_array check above.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function isBackendActive():bool\n {\n return false;\n }",
"public function isAllowedBindingBetweenAreas($subscriberArea, $providerArea)\n {\n $subscriberTypes = [];\n $subscriberCategory = '';\n if ($this->hookCollector->hasSubscriber($subscriberArea)) {\n $subscriberTypes = $this->hookCollector->getSubscriber($subscriberArea)->getEvents(); // array('hookType' => 'eventName')\n $subscriberTypes = array_keys($subscriberTypes);\n $subscriberCategory = $this->hookCollector->getSubscriber($subscriberArea)->getCategory();\n }\n\n if (empty($subscriberTypes)) {\n return false;\n }\n\n foreach ($subscriberTypes as $subscriberType) {\n if (!$this->hookCollector->hasProvider($providerArea)) {\n continue;\n }\n\n $providerTypes = $this->hookCollector->getProvider($providerArea)->getProviderTypes();\n $providerCategory = $this->hookCollector->getProvider($providerArea)->getCategory();\n foreach (array_keys($providerTypes) as $providerType) {\n if ($subscriberCategory == $providerCategory && $subscriberType == $providerType) {\n return true;\n }\n }\n }\n\n return false;\n }",
"public function hasMapareas(){\n return $this->_has(30);\n }",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }",
"public function isAllowedBindingBetweenAreas($subscriberArea, $providerArea)\n {\n if ($this->hookCollector->hasSubscriber($subscriberArea)) {\n $subscriberTypes = $this->hookCollector->getSubscriber($subscriberArea)->getEvents(); // array('hookType' => 'eventName')\n $subscriberTypes = array_keys($subscriberTypes);\n $subscriberCategory = $this->hookCollector->getSubscriber($subscriberArea)->getCategory();\n } else {\n // @deprecated\n $subscriberEntities =\n $this->em->getRepository(Entity\\HookSubscriberEntity::class)\n ->findBy(['sareaid' => $subscriberArea]);\n $subscriberTypes = [];\n foreach ($subscriberEntities as $hookSubscriberEntity) {\n $subscriberTypes[] = $hookSubscriberEntity->getHooktype();\n $subscriberCategory = $hookSubscriberEntity->getCategory(); // will all be same\n }\n }\n\n if (!$subscriberTypes) {\n return false;\n }\n\n foreach ($subscriberTypes as $subscriberType) {\n if ($this->hookCollector->hasProvider($providerArea)) {\n $providerTypes = $this->hookCollector->getProvider($providerArea)->getProviderTypes();\n $providerCategory = $this->hookCollector->getProvider($providerArea)->getCategory();\n foreach (array_keys($providerTypes) as $providerType) {\n if ($subscriberCategory == $providerCategory && $subscriberType == $providerType) {\n return true;\n }\n }\n } else {\n // @deprecated\n $hookProvider =\n $this->em->createQueryBuilder()->select('t')\n ->from(Entity\\HookProviderEntity::class, 't')\n ->where('t.pareaid = ?1 AND t.hooktype = ?2 AND t.category = ?3')\n ->setParameters([\n 1 => $providerArea,\n 2 => $subscriberType,\n 3 => $subscriberCategory\n ])\n ->getQuery()\n ->getArrayResult();\n\n if ($hookProvider) {\n return true;\n }\n }\n }\n\n return false;\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Lof_Outlet::outlet_edit');\n }",
"public function hasAreaInUri(): bool;"
] | [
"0.7092595",
"0.6393919",
"0.63526136",
"0.62928677",
"0.6259223",
"0.6258937",
"0.62406784",
"0.6200967",
"0.6059259",
"0.60461396",
"0.60113114",
"0.5998781",
"0.59457684",
"0.59419745",
"0.592258",
"0.5914644",
"0.58738714",
"0.58577",
"0.58510315",
"0.58357435",
"0.58194125",
"0.5815955",
"0.5800219",
"0.5741587",
"0.5732603",
"0.5720405",
"0.57201123",
"0.57123756",
"0.5685248",
"0.5656048"
] | 0.8198973 | 0 |
Returns a collection with areas. | public function getAreas(): AreasCollection; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFrontendAreas(): AreasCollection;",
"public function getBackendAreas(): AreasCollection;",
"function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }",
"public function panelAreas(): Collection {\n return $this->areas()->map(\n function ($area) {\n if (! $area instanceof Model) {\n throw new \\Exception('['.__LINE__.']['.__FILE__.']');\n }\n\n return PanelService::make()->get($area);\n }\n );\n }",
"public static function getAllAreas() {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query('select * from area');\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = count($result);\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }",
"function getAreas () {\n return $this->templateParser->getAreas();\n }",
"function get_duo_areas() {\n \t\n }",
"public function getCollection();",
"public function getCollection();",
"public function getCollection();",
"public function getCollection();",
"public function area() {\n $area = Area::pluck('description', 'id');\n\n // Return area\n echo json_encode($area);\n }",
"public static function obtenerAreas()\n {\n $consulta = \"SELECT * FROM areas\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public static function ADMIN_AREA_GET_AREA_LIST(){\n\t $SQL_String = \"SELECT * FROM area_main WHERE _keep=1 ORDER BY ano ASC;\";\n\t return $SQL_String;\n\t}",
"public function getCollection() ;",
"private function _getAreas() \r\n {\r\n $values = explode(\",\", Mage::getStoreConfig('cms/banners/areas'));\r\n $areas = array();\r\n\r\n foreach ($values as $value) {\r\n $areas[] = array('value' => $value, 'label' => $value);\r\n }\r\n $areas[] = array('value' => 'category', 'label' => 'categoria');\r\n\r\n return $areas;\r\n }",
"public function areasDetails()\n {\n return $this->hasManyThrough(FilterPracticeArea::class, CandidateSubSpecialism::class, 'candidate_id', 'id', 'id', 'area_id');\n }",
"public function selectallAreas()\n {\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Area ORDER BY Position ASC \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }",
"public static function collection()\n {\n $jsoLoader = new JsonLoader(new ISO3166CountryFactory());\n\n return new Collection($jsoLoader->load(__DIR__.'/../data/iso3166.json'));\n }",
"public function index()\n {\n $areas = Area::all();\n \n return view('areas', compact('areas'));\n }",
"public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}",
"public function asCollection();",
"public function index()\n {\n $areas = Area::orderBy('area')->get();\n return view('main.expedition.area.index')->withAreas($areas);\n }",
"protected function makeResourcesCollection()\n {\n return collect($this->load())->map(function ($item, $key) {\n $item['slug'] = $key;\n\n $item['name'] = Str::studly($key);\n\n $item['is_global'] = (isset($item['is_global']) && $item['is_global']);\n\n return $item;\n });\n }",
"public function areas($id = null){\n $data['areas'] = [];\n if( request()->ajax() ){\n $data['areas'] = getAreas($id)->toSelect(0, 'Select Area');\n }\n\n return $data;\n }",
"public function getBlocks(): Collection;",
"public function index()\n {\n $areas = Area::all();\n return view('area.index', compact('areas'));\n }",
"public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }",
"public function index(Request $request)\n {\n $areones = AreaOne::all();\n // cache()->remember('areaones',99999, function () use ($areones) {\n // });\n // return cache()->get('areaones');\n return new AreaOneCollection($areones);\n }"
] | [
"0.79317886",
"0.7533631",
"0.7391379",
"0.67795515",
"0.6763452",
"0.6625361",
"0.65923315",
"0.6533913",
"0.6423929",
"0.6423929",
"0.6423929",
"0.6423929",
"0.6415804",
"0.6271613",
"0.62576985",
"0.62463355",
"0.61914504",
"0.6172695",
"0.61725247",
"0.6172076",
"0.6145999",
"0.6023834",
"0.60089433",
"0.5999341",
"0.5919236",
"0.59058374",
"0.5884907",
"0.588208",
"0.5878706",
"0.5869764"
] | 0.86310095 | 0 |
Returns an area object based on ID. Default area returns if not found the desired one. | public function getByIdOrDefault(string $id): AreaContract; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function particulararea($id)\n\t{\n\t\t$getarea=\"SELECT * from area where id = $id\";\n\t\t$ggetareadata = $this->get_results( $getarea );\n\t\treturn $ggetareadata;\n\t}",
"public function getArea($area_id) {\n $query = $this->db->query(\"SELECT a.area_id,a.code,a.status,a.name,c.city_id,z.zone_id,coun.country_id FROM \" . DB_PREFIX . \"area a LEFT JOIN \" . DB_PREFIX . \"city c on (c.city_id=a.city_id) LEFT JOIN \" . DB_PREFIX . \"zone z on (z.zone_id=c.zone_id) LEFT JOIN \" . DB_PREFIX . \"country coun on (coun.country_id=z.country_id) WHERE area_id = '\" . (int) $area_id . \"'\");\n\n return $query->row;\n }",
"public function getArea($areaId) {\n $methods = array(\"areas\", $areaId);\n return $this->get($methods);\n }",
"public function getArea($areaId = -1) {\r\r\n //check $areaId is numeric\r\n if (!is_numeric($areaId) || ($areaId == -1) ){\r\n\t\t\t\techo 'Only numeric parameters.';\r\n\t\t\t\texit;\r\r\n }\r\r\n\r\n $select = $this->select()->where(\"area_code = ?\",$areaId);\r\t\t\r\n $result = $this->_db->fetchRow($select);\t\r\n return ($result == false) ? false : $result = $result;\t\r\r\n }",
"function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}",
"public function getAreaId()\n {\n return $this->area;\n }",
"public function getAreaID() {\n return $this->get(self::AREAID);\n }",
"public function edit($id)\n {\n $areaone = AreaOne::find($id);\n return new ResourcesAreaOne($areaone);\n }",
"public function getIdArea() {\n return $this->_id; \n }",
"public function getAreaId()\n {\n return $this->areaId;\n }",
"public function show($id)\n {\n $area = Area::findOrFail($id);\n return response()->json($area);\n }",
"public function getCurrentArea(): AreaContract;",
"public static function getAreaId($id)\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM areas WHERE id_area = ?\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($id));\n // Capturar primera fila del resultado\n $row = $comando->fetch(PDO::FETCH_ASSOC);\n return $row;\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }",
"public static function getAreasById($id) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select * from area where idArea = $id\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"public function getcity_area($id)\n {\n $data = $this->addcity->with(['Area'])->find($id);\n //dd($data);\n return $data;\n }",
"public function show($id)\n {\n $area = Area::where('status', 'a')->find($id); \n \n return response()->json($area, 200);\n }",
"public function getDefault(): AreaContract;",
"public function getPlaceByID( $id );",
"public function get_area($id=0){\n $areas = Area::where('city_id', $id)->orderBy('name', 'asc')->get();\n $output = '';\n if(count($areas)>0){\n $output .= '<option value=\"\">Select area</option>';\n foreach($areas as $area){\n $output .='<option '. (Session::get('area') == $area->id ? \"selected\" : \"\" ).' value=\"'.$area->id.'\">'.$area->name.'</option>';\n }\n }\n echo $output;\n }",
"function getArea(){}",
"public function show($id)\n {\n $area = Area::findOrFail($id);\n\n return view('area.show', compact('area'));\n }",
"public function area()\n {\n return $this->belongsTo('App\\Models\\Area', 'area_id', 'id');\n }",
"public function edit($id)\n { \n $area = Areas::FindOrFail($id);\n return response()->json($area);\n }",
"public function show($id)\n {\n $subareas = subarea::findOrFale($id);\n\n if ($subareas) {\n return response($subareas,200);\n }\n return response($id,404);\n }",
"public static function getRecAreaByRecAreaId(\\PDO $pdo, $recAreaId): ?recArea {\n\t\ttry {\n\t\t\t$recAreaId = self::validateUuid($recAreaId);\n\t\t} catch(\\InvalidArgumentException | \\RangeException | \\Exception | \\TypeError $exception) {\n\t\t\tthrow(new \\PDOException($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t// creating query template\n\t\t$query = \"SELECT recAreaId,recAreaDescription,recAreaDirections, recAreaImageUrl,recAreaLat,recAreaLong,recAreaMapUrl,recAreaName FROM recArea WHERE recAreaId = :recAreaId\";\n\t\t$statement = $pdo->prepare($query);\n\t\t//binding the recAreaId to the placeholders in the template\n\t\t$parameters = [\"recAreaId\" => $recAreaId->getBytes()];\n\t\t$statement->execute($parameters);\n\t\t//retrieve the recArea from mySQL\n\t\ttry {\n\t\t\t$recArea = null;\n\t\t\t$statement->setFetchMode(\\PDO::FETCH_ASSOC);\n\t\t\t$row = $statement->fetch();\n\t\t\tif($row !== false) {\n\t\t\t\t$recArea = new RecArea($row[\"recAreaId\"], $row[\"recAreaDescription\"], $row[\"recAreaDirections\"], $row[\"recAreaImageUrl\"], $row[\"recAreaLat\"], $row[\"recAreaLong\"], $row[\"recAreaMapUrl\"], $row[\"recAreaName\"]);\n\t\t\t}\n\t\t} catch(\\Exception $exception) {\n\t\t\t//if the new row cannot be converted, throw it again\n\t\t\tthrow (new \\PDOException($exception->getMessage(), 0, $exception));\n\t\t}\n\t\treturn ($recArea);\n\t}",
"public function obtener($id)\n {\n $this->db->join('Usuarios','Usuarios.u_id=Areas.a_director');\n $this->db->where('a_id',(int)$id);\n return $this->db->get('Areas')->row();\n }",
"public static function getFilteredArea($area_id)\n {\n\n $areas = DB::table('areas')->where('id', '<>', $area_id)->get();\n\n return $areas;\n }",
"public function ElementalAreaIfExists()\n {\n if ($this->owner->hasExtension(ElementalPageExtension::class)) {\n return $this->owner->ElementalArea();\n }\n return ElementalArea::create();\n }",
"public static function getAreaByName($name) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select MAX(idArea) as idArea from area where nameArea like '$name'\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}",
"abstract protected function getArea();"
] | [
"0.6818367",
"0.68054247",
"0.675593",
"0.66526365",
"0.6623228",
"0.65929544",
"0.6525969",
"0.6503645",
"0.64695245",
"0.64217967",
"0.63493794",
"0.63383394",
"0.63373303",
"0.6288028",
"0.62364167",
"0.61606807",
"0.61251014",
"0.598079",
"0.5980592",
"0.59436256",
"0.592889",
"0.59254795",
"0.58976775",
"0.5817726",
"0.58057594",
"0.57961094",
"0.5733179",
"0.5731252",
"0.5720976",
"0.57025695"
] | 0.79509115 | 0 |
Apply discount/coupon on subscription | function applyDiscountOnSubscription($subscriptionId = null)
{
$db = new db();
$db->makeConnection();
if($subscriptionId != null)
{
\Stripe\Stripe::setApiKey(STRPIE_CLIENT_SECRET);
$date = date('Y-m-d 00:00:00');
$discountTotal = 0;
// Select plan having trial periods on
// $query = "SELECT price FROM billing_products BP INNER JOIN user_subscription_items USI ON BP.plan_id = USI.plan_id WHERE BP.trial_period != 0 AND USI.subscription_id = '{$subscriptionId}' AND USI.coupon_trial_from <= '{$date}' AND USI.coupon_trial_to >= '{$date}'";
$query = "SELECT price FROM billing_products BP INNER JOIN user_subscription_items USI ON BP.plan_id = USI.plan_id WHERE BP.trial_period != 0 AND USI.subscription_id = '{$subscriptionId}' AND USI.coupon_trial_from <= '{$date}' AND USI.coupon_trial_to > '{$date}' AND USI.status = '1'";
$res = $db->query($query);
if($db->numRows($res))
{
while ($rs = mysqli_fetch_array($res))
{
$discountTotal += $rs['price'];
}
//
if($discountTotal)
{
// Fetch if coupon exist, otherwise create
$couponId = 'OFF-'.$discountTotal;
try {
// Retrieve coupon
$coupon = \Stripe\Coupon::retrieve($couponId);
} catch (\Stripe\Error\Base $e) {
// Create coupon
$coupon = \Stripe\Coupon::create([
'id' => $couponId,
'amount_off' => ($discountTotal*100),
'currency' => 'SEK',
'duration' => 'once',
// 'duration' => 'repeating',
// 'duration_in_months' => 3,
]);
}
// Apply coupon on subscription
if($coupon)
{
try {
// Update subscription
\Stripe\Subscription::update(
$subscriptionId,
['coupon' => $coupon->id]
);
} catch (\Stripe\Error\Base $e) {}
}
}
else
{
try {
$sub = \Stripe\Subscription::retrieve($subscriptionId);
if( isset($sub->discount) && ($sub->discount != null) )
{
$sub->deleteDiscount();
}
} catch (\Stripe\Error\Base $e) {}
}
}
else
{
try {
$sub = \Stripe\Subscription::retrieve($subscriptionId);
if( isset($sub->discount) && ($sub->discount != null) )
{
$sub->deleteDiscount();
}
} catch (\Stripe\Error\Base $e) {}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function applyCoupon()\n {\n // check if the current coupon we are trying to apply is associated to a booking.\n // if it is, we will have to calculate the discount based on the the used coupon.\n if ($this->booking->isUsingCoupon($this->coupon)) {\n $this->coupon = $this->getUsedCoupon();\n }\n\n // if this coupon is not the one that's associated to the booking, we will\n // need to ensure the coupon meets the application criteria.\n if ($this->coupon instanceof Coupon && !$this->canApplyCoupon()) return;\n\n $couponInformation = ['beforeDiscount' => $this->discountedPeriodsTotal];\n $this->discountedPeriodsTotal = $this->coupon->apply($this->discountedPeriodsTotal);\n $couponInformation['afterDiscount'] = $this->discountedPeriodsTotal;\n $couponInformation['coupon'] = $this->coupon;\n $this->appliedCoupon = $couponInformation;\n }",
"function _apply_discount($coupon)\n\t{\n\t\t$this->database->SaveCheatCode($coupon);\n\t\t$discount_percentage = 0;\n\t\t$coupon_info = $this->database->GetDiscountCoupon($coupon);\n\n\t\t//Run some conditional-check for code\n\t\tif($this->_can_apply_code($coupon_info))\n\t\t{\n\t\t\t$discount_percentage = $this->_getDiscount($coupon);\n\t\t\t$this->cart->apply_discount($coupon, $discount_percentage);\n\t\t}\n\n\t\t$this->_notify_discount_applied($discount_percentage, $coupon_info);\n\n\t}",
"public function discountBifurcation(Varien_Event_Observer $observer)\n {\n $rule = $observer->getEvent()->getRule();\n $result = $observer->getEvent()->getResult();\n $itemId = $observer->getEvent()->getItem()->getItemId();\n //set Unique key\n $curUnique= $rule->getRuleId().'_'.$itemId;\n //check if Mage registry unique call set\n if(Mage::registry('uniqueCall')!==null){\n //if check in array\n $uniqueCalls = Mage::registry('uniqueCall');\n if( in_array($curUnique,$uniqueCalls)){\n return;\n }else{\n //unset existing registry. also take existing array in variable\n Mage::unregister('uniqueCall');\n $uniqueCalls[]= $curUnique ;\n //set registry again with new array include $uniqueCall into it\n Mage::register('uniqueCall',$uniqueCalls);\n }\n }else{\n //set registry again with new array include $uniqueCall into it\n $array = array();\n $array[]=$rule->getRuleId().'_'.$itemId;\n Mage::register('uniqueCall',$array);\n\n } \n\n //condition for the Promotional coupons\n if ( $rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON ) {\n $promotionDiscount = 0;\n $promotionDiscount = Mage::registry('promotion');\n if (Mage::registry('promotion')!==null){\n Mage::unregister('promotion');\n }\n if (Mage::registry('promo_lable')!==null){\n Mage::unregister('promo_lable');\n }\n $promotionDiscount += $result->getDiscountAmount();\n Mage::register('promotion', $promotionDiscount);\n Mage::register('promo_lable',$rule->getName());\n } elseif ( $rule->getCouponType() == self::COUPON_TYPE_FUE_GENERATED ) {\n $couponDiscount = 0;\n $couponDiscount = Mage::registry('coupon');\n if(Mage::registry('coupon')!==null){\n Mage::unregister('coupon');\n }\n //sum up all the values of discounted coupons\n $couponDiscount += $result->getDiscountAmount();\n Mage::register('coupon',$couponDiscount);\n }\n $quote = $observer->getEvent()->getQuote();\n $quoteAddress = $observer->getEvent()->getAddress();\n //set discounted coupons and promotional coupons amount in quote\n $quote->setCouponDiscount(Mage::registry('coupon'));\n $quote->setPromotionalDiscount(Mage::registry('promotion'));\n\n if (Mage::getStoreConfig('promodiscount/promodiscount/use_default')) {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n } else {\n if (Mage::registry('promo_lable')) {\n $quote->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }\n \n $quoteAddress->setCouponDiscount(Mage::registry('coupon'));\n $quoteAddress->setPromotionalDiscount(Mage::registry('promotion'));\n if (Mage::registry('promo_lable')) {\n $quoteAddress->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quoteAddress->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }",
"function learndash_apply_coupon(): void {\n\tif (\n\t\tempty( $_POST['nonce'] ) ||\n\t\t! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'learndash-coupon-nonce' ) ||\n\t\tempty( $_POST['post_id'] ) ||\n\t\t! is_user_logged_in() ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Invalid request.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( empty( $_POST['coupon_code'] ) ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Please enter the coupon code.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$product = Product::find( (int) $_POST['post_id'] );\n\n\tif ( ! $product ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Product not found.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if the coupon code is valid.\n\n\t$coupon_code = sanitize_text_field( wp_unslash( $_POST['coupon_code'] ) );\n\n\t$coupon_validation_result = learndash_check_coupon_is_valid( $coupon_code, $product->get_id() );\n\n\tif ( ! $coupon_validation_result['is_valid'] ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => $coupon_validation_result['error'],\n\t\t\t)\n\t\t);\n\t}\n\n\t// Check if we are processing the \"subscribe\" pricing.\n\n\tif ( $product->is_price_type_subscribe() ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Subscriptions are not supported for now.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t// Process an action.\n\n\ttry {\n\t\t$product_pricing = $product->get_pricing();\n\t} catch ( Learndash_DTO_Validation_Exception $e ) {\n\t\twp_send_json_error(\n\t\t\tarray(\n\t\t\t\t'message' => __( 'Something went wrong.', 'learndash' ),\n\t\t\t)\n\t\t);\n\t}\n\n\t$coupon = learndash_get_coupon_by_code( $coupon_code );\n\t$discounted_price = learndash_calculate_coupon_discounted_price( $coupon->ID, $product_pricing->price );\n\t$discount = ( $product_pricing->price - $discounted_price ) * -1;\n\n\t$price = $discounted_price;\n\tif ( ! learndash_is_zero_decimal_currency( learndash_get_currency_code() ) ) {\n\t\t$price = intval( $price * 100 );\n\t}\n\n\tlearndash_attach_coupon( $product->get_id(), $coupon->ID, $product_pricing->price, $discounted_price );\n\n\twp_send_json_success(\n\t\tarray(\n\t\t\t'coupon_code' => $coupon_code,\n\t\t\t'discount' => esc_html(\n\t\t\t\tlearndash_get_price_formatted( $discount )\n\t\t\t),\n\t\t\t'total' => array(\n\t\t\t\t'value' => $discounted_price,\n\t\t\t\t'stripe_value' => $price,\n\t\t\t\t'formatted' => esc_html(\n\t\t\t\t\tlearndash_get_price_formatted( $discounted_price )\n\t\t\t\t),\n\t\t\t),\n\t\t\t'message' => __( 'Coupon applied.', 'learndash' ),\n\t\t)\n\t);\n}",
"public static function subscriptionDiscountAdded($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountAdded', $callback);\n }",
"public function apply_coupon_subscription(Request $request) {\n\n $validator = Validator::make($request->all(), [\n 'coupon_code' => 'required|exists:coupons,coupon_code', \n 'subscription_id'=>'required|exists:subscriptions,id' \n ], array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n \n if ($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n $response_array = array('success' => false, 'error_messages'=>$error_messages , 'error_code' => 101);\n\n return response()->json($response_array);\n }\n \n\n $model = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($model) {\n\n if ($model->status) {\n\n $user = User::find($request->id);\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $model)->getData();\n\n if(strtotime($model->expiry_date) >= strtotime(date('Y-m-d'))) {\n\n if ($check_coupon->success) {\n\n if(strtotime($model->expiry_date) >= strtotime(date('Y-m-d'))) {\n\n $subscription = Subscription::find($request->subscription_id);\n\n if($subscription) {\n\n if($subscription->status) {\n\n $amount_convertion = $model->amount;\n\n if ($model->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($model->amount, $subscription->amount), 2);\n\n }\n\n if ($subscription->amount > $amount_convertion && $amount_convertion > 0) {\n\n $amount = $subscription->amount - $amount_convertion;\n \n $response_array = ['success'=> true, \n 'data'=>[\n 'remaining_amount'=>(string) $amount,\n 'coupon_amount'=> (string) $amount_convertion,\n 'coupon_code'=>$model->coupon_code,\n 'original_coupon_amount'=>(string) ($model->amount_type == PERCENTAGE ? $model->amount.'%' : Setting::get('currency').$model->amount)\n ]];\n\n } else {\n\n // $response_array = ['success'=> false, 'error_messages'=>Helper::get_error_message(156), 'error_code'=>156];\n $amount = 0;\n $response_array = ['success'=> true, \n 'data'=>[\n 'remaining_amount'=>(string) $amount,\n 'coupon_amount'=> (string) $amount_convertion,\n 'coupon_code'=>$model->coupon_code,\n 'original_coupon_amount'=>(string) ($model->amount_type == PERCENTAGE ? $model->amount.'%' : Setting::get('currency').$model->amount)\n ]];\n\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(170), 'error_code'=>170];\n\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(169), 'error_code'=>169];\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(173), 'error_code'=>173];\n\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>$check_coupon->error_messages];\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(173), 'error_code'=>173];\n }\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(168), 'error_code'=>168];\n }\n\n\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(167), 'error_code'=>167];\n\n }\n\n return response()->json($response_array);\n\n }",
"protected function _applyCoupon($coupon, $price)\n {\n\n $db = & JFactory::getDBO();\n $user = & JFactory::getUser();\n $sid = JRequest::getInt('sid');\n\n // Update used time for this coupon\n $sql = 'UPDATE #__jms_coupons' .\n ' SET used_time = used_time + 1' .\n ' WHERE code = \"' . $coupon . '\"'\n ;\n $db->setQuery($sql);\n $db->query();\n\n // Get coupon information\n $sql = 'SELECT *' .\n ' FROM #__jms_coupons' .\n ' WHERE code = \"' . $coupon . '\"'\n ;\n $db->setQuery($sql);\n $row = $db->loadObject();\n\n // Make coupon history for this current user\n $sql = 'INSERT INTO #__jms_coupon_subscrs' .\n ' VALUES (\"\", ' . $user->get('id') . ', ' . $row->id . ', ' . $sid . ', NOW(), ' . $price . ', ' . $row->discount . ', ' . $row->discount_type . ', ' . $row->recurring . ', ' . $row->num_recurring . ')'\n ;\n $db->setQuery($sql);\n $db->query();\n\n // Discount based on amount\n if ($row->discount_type == 2)\n {\n $new = round(($row->discount - $price), 2);\n if ($new < 0) $new = 0;\n $sql = 'UPDATE #__jms_coupons' .\n ' SET discount = ' . $new .\n ' WHERE code = \"' . $coupon . '\"'\n ;\n $db->setQuery($sql);\n $db->query();\n\n $out = $price - $row->discount;\n if ($out < 0) $out = 0;\n $out = round($out, 2);\n } else\n {\n $out = $price - ($price * ($row->discount / 100));\n $out = round($out, 2);\n }\n return $out;\n }",
"public function AssignDiscount()\n\t{\t\n\t}",
"function wp_aff_handle_woocommerce_subscription_payment($order) {\n if (!is_object($order)) {\n $order = new WC_Order($order);\n }\n\n $order_id = $order->id;\n $total = $order->order_total;\n $shipping = $order->get_total_shipping();//get_shipping();\n $sale_amount = $total - $shipping;\n $txn_id = $order_id . \"_\" . date(\"Y-m-d\"); //Add the subscription charge date to make this unique\n $item_id = \"\";\n $buyer_email = $order->billing_email;\n $buyer_name = $order->billing_first_name . \" \" . $order->billing_last_name;\n \n $referrer = get_post_meta($order_id, '_wp_aff_ap_id', true);\n if(empty($referrer)){\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - couldn't get referrer ID from cookie. Checking IP address...\", true);\n $ip_address = get_post_meta($order_id, '_customer_ip_address', true);\n if (empty($ip_address)) {\n wp_affiliate_log_debug(\"WooCommerce Subscription Affiliate integration - customer IP address is missing in WooCommerce order.\", false);\n return;\n }\n $referrer = wp_aff_get_referrer_id_from_ip_address($ip_address);\n }\n \n $order_status = $order->status;\n\n //apply filter for coupon check\n $referrer = apply_filters('aff_woo_before_awarding_commission_filter', $referrer, $order);\n\n $debug_data = \"WooCommerce subscripiton payment - Commission tracking debug data: \" . $referrer . \"|\" . $sale_amount . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $ip_address . \"|\" . $buyer_name;\n wp_affiliate_log_debug($debug_data, true);\n\n if (!empty($referrer)) {\n wp_aff_award_commission_unique($referrer, $sale_amount, $txn_id, $item_id, $buyer_email, '', '', $buyer_name);\n } else {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - This is not an affiliate referred sale!\", true);\n }\n}",
"function pp_edd_auto_apply_discount() {\n\n\tif ( function_exists( 'edd_is_checkout' ) && edd_is_checkout() ) {\n\n\t\tif ( ! edd_cart_has_discounts() && edd_is_discount_valid( 'BFCM2016', '', false ) ) {\n\t\t\tedd_set_cart_discount( 'BFCM2016' );\n\t\t}\n\n\t}\n\n}",
"private function calculateSubscription()\n {\n $subscription = new Subscription();\n $result = $subscription->getById($this->subscription['name'])[0];\n if ($result === FALSE) {\n $this->subscription['final_price'] = \"0.00\";\n } else {\n $result['date'] = $this->subscription['date'];\n $result['days'] = $subscription->calculateAmountOfDays($this->subscription['date']);\n $result['total'] += $result['price_per_day'] * $result['days'];\n $this->subtotal += $result['total'];\n }\n\n $this->subscription = $result;\n\n }",
"public function applyCartDiscount(Varien_Event_Observer $observer)\n { \n try\n { \n $bundle_product_ids = [];\n $quote_product_ids = [];\n $cookieValue = Mage::getModel('core/cookie')->get('ivid');\n $userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()->addFieldToFilter('increasingly_visitor_id',$cookieValue);\n $items = $observer->getEvent()->getQuote()->getAllItems();\n $eligibleProducts = [];\n $discount = 0;\n foreach ($items as $item) {\n array_push($quote_product_ids, $item->getProductId());\n }\n foreach ($userBundleCollection as $bundle) {\n //First Bundle products\n $bundle_product_ids = explode(',', $bundle->getProductIds()); \n $productsIds = array_intersect($quote_product_ids, $bundle_product_ids);\n if(count($productsIds) == count($bundle_product_ids) )\n $discount += $bundle->getDiscountPrice();\n }\n\n if($discount > 0){\n $quote=$observer->getEvent()->getQuote();\n $quoteid=$quote->getId();\n $discountAmount=$discount;\n if($quoteid) { \n if($discountAmount>0) {\n $total=$quote->getBaseSubtotal();\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n \n\n $canAddItems = $quote->isVirtual()? ('billing') : ('shipping'); \n foreach ($quote->getAllAddresses() as $address) {\n\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n\n $address->collectTotals();\n\n $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());\n\n $quote->setSubtotalWithDiscount(\n (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()\n );\n $quote->setBaseSubtotalWithDiscount(\n (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()\n );\n\n $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n\n $quote ->save(); \n\n $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->save(); \n\n\n if($address->getAddressType()==$canAddItems) {\n //echo $address->setDiscountAmount; exit;\n $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);\n $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);\n $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);\n $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);\n if($address->getDiscountDescription()){\n $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));\n $address->setDiscountDescription($address->getDiscountDescription().', Custom Discount');\n $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));\n }else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Custom Discount');\n $address->setBaseDiscountAmount(-($discountAmount));\n }\n $address->save();\n }//end: if\n } //end: foreach\n //echo $quote->getGrandTotal();\n\n foreach($quote->getAllItems() as $item){\n //We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat=$item->getPriceInclTax()/$total;\n $ratdisc=$discountAmount*$rat;\n $item->setDiscountAmount(($item->getDiscountAmount()+$ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount()+$ratdisc) * $item->getQty())->save(); \n }\n } \n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n\n }",
"public function pay_now(Request $request) {\n\n try {\n \n DB::beginTransaction();\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'subscription_id'=>'required|exists:subscriptions,id',\n 'payment_id'=>'required',\n 'coupon_code'=>'nullable|exists:coupons,coupon_code',\n ), array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n\n if ($validator->fails()) {\n // Error messages added in response for debugging\n $errors = implode(',',$validator->messages()->all());\n\n throw new Exception($errors, 101);\n\n } else {\n\n $user = User::find($request->id);\n\n $subscription = Subscription::find($request->subscription_id);\n\n $total = $subscription->amount;\n\n $coupon_amount = 0;\n\n $coupon_reason = '';\n\n $is_coupon_applied = COUPON_NOT_APPLIED;\n\n if ($request->coupon_code) {\n\n $coupon = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($coupon) {\n \n if ($coupon->status == COUPON_INACTIVE) {\n\n $coupon_reason = tr('coupon_inactive_reason');\n\n } else {\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $coupon)->getData();\n\n if ($check_coupon->success) {\n\n $is_coupon_applied = COUPON_APPLIED;\n\n $amount_convertion = $coupon->amount;\n\n if ($coupon->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($coupon->amount, $subscription->amount), 2);\n\n }\n\n\n if ($amount_convertion < $subscription->amount) {\n\n $total = $subscription->amount - $amount_convertion;\n\n $coupon_amount = $amount_convertion;\n\n } else {\n\n // throw new Exception(Helper::get_error_message(156),156);\n\n $total = 0;\n\n $coupon_amount = $amount_convertion;\n \n }\n\n // Create user applied coupon\n\n if($check_coupon->code == 2002) {\n\n $user_coupon = UserCoupon::where('user_id', $user->id)\n ->where('coupon_code', $request->coupon_code)\n ->first();\n\n // If user coupon not exists, create a new row\n\n if ($user_coupon) {\n\n if ($user_coupon->no_of_times_used < $coupon->per_users_limit) {\n\n $user_coupon->no_of_times_used += 1;\n\n $user_coupon->save();\n\n }\n\n }\n\n } else {\n\n $user_coupon = new UserCoupon;\n\n $user_coupon->user_id = $user->id;\n\n $user_coupon->coupon_code = $request->coupon_code;\n\n $user_coupon->no_of_times_used = 1;\n\n $user_coupon->save();\n\n }\n\n } else {\n\n $coupon_reason = $check_coupon->error_messages;\n \n }\n\n }\n\n } else {\n\n $coupon_reason = tr('coupon_delete_reason');\n }\n }\n\n $model = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)\n ->orderBy('id', 'desc')->first();\n\n $user_payment = new UserSubscription();\n\n if ($model) {\n\n if (strtotime($model->expiry_date) >= strtotime(date('Y-m-d H:i:s'))) {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime(\"+{$subscription->plan} months\", strtotime($model->expiry_date)));\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n $user_payment->payment_id = $request->payment_id;\n $user_payment->user_id = $request->id;\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = PAID_STATUS;\n\n $user_payment->payment_mode = PAYPAL;\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n \n if($user_payment->save()) {\n\n if ($user) {\n\n $user->user_type = 1;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $response_array = ['success'=>true, \n 'message'=>tr('payment_success'), \n 'data'=>[\n 'id'=>$request->id,\n 'token'=>$user_payment->user ? $user_payment->user->token : '',\n ]];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n }\n\n }\n\n DB::commit();\n\n return response()->json($response_array, 200);\n\n } catch(Exception $e) {\n\n DB::rollback();\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return response()->json($response_array);\n\n }\n\n }",
"public function manage_smart_coupon_credit_used( $coupon = '', $discount = 0, $cart_contains_subscription = false, $calculation_type = '' ) {\n\t\t\tif ( is_object( $coupon ) && $coupon instanceof WC_Coupon ) {\n\n\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t$coupon_code = $coupon->get_code();\n\t\t\t\t} else {\n\t\t\t\t\t$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';\n\t\t\t\t}\n\n\t\t\t\tif ( $cart_contains_subscription ) {\n\t\t\t\t\tif ( WCS_SC_Compatibility::is_wcs_gte( '2.0.10' ) ) {\n\t\t\t\t\t\tif ( $this->is_wc_greater_than( '3.1.2' ) ) {\n\t\t\t\t\t\t\t$coupon_discount_totals = WC()->cart->get_coupon_discount_totals();\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_totals ) || ! is_array( $coupon_discount_totals ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_totals = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_totals[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] = $discount;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] += $discount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tWC()->cart->set_coupon_discount_totals( $coupon_discount_totals );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coupon_discount_amounts = ( is_object( WC()->cart ) && isset( WC()->cart->coupon_discount_amounts ) ) ? WC()->cart->coupon_discount_amounts : array();\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_amounts ) || ! is_array( $coupon_discount_amounts ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_amounts = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( empty( $coupon_discount_amounts[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] = $discount;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] += $discount;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tWC()->cart->coupon_discount_amounts = $coupon_discount_amounts;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( WCS_SC_Compatibility::is_wcs_gte( '2.0.0' ) ) {\n\t\t\t\t\t\tWC_Subscriptions_Coupon::increase_coupon_discount_amount( WC()->cart, $coupon_code, $discount );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWC_Subscriptions_Cart::increase_coupon_discount_amount( $coupon_code, $discount );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( $this->is_wc_greater_than( '3.1.2' ) ) {\n\t\t\t\t\t\t$coupon_discount_totals = WC()->cart->get_coupon_discount_totals();\n\t\t\t\t\t\tif ( empty( $coupon_discount_totals ) || ! is_array( $coupon_discount_totals ) ) {\n\t\t\t\t\t\t\t$coupon_discount_totals = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $coupon_discount_totals[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] = $discount;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coupon_discount_totals[ $coupon_code ] += $discount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWC()->cart->set_coupon_discount_totals( $coupon_discount_totals );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$coupon_discount_amounts = ( is_object( WC()->cart ) && isset( WC()->cart->coupon_discount_amounts ) ) ? WC()->cart->coupon_discount_amounts : array();\n\t\t\t\t\t\tif ( empty( $coupon_discount_amounts ) || ! is_array( $coupon_discount_amounts ) ) {\n\t\t\t\t\t\t\t$coupon_discount_amounts = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( empty( $coupon_discount_amounts[ $coupon_code ] ) ) {\n\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] = $discount;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coupon_discount_amounts[ $coupon_code ] += $discount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWC()->cart->coupon_discount_amounts = $coupon_discount_amounts;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( isset( WC()->session->reload_checkout ) ) { // reload_checkout is triggered when customer is registered from checkout.\n\t\t\t\t\tunset( WC()->cart->smart_coupon_credit_used ); // reset store credit used data for re-calculation.\n\t\t\t\t}\n\n\t\t\t\t$smart_coupon_credit_used = ( is_object( WC()->cart ) && isset( WC()->cart->smart_coupon_credit_used ) ) ? WC()->cart->smart_coupon_credit_used : array();\n\n\t\t\t\tif ( empty( $smart_coupon_credit_used ) || ! is_array( $smart_coupon_credit_used ) ) {\n\t\t\t\t\t$smart_coupon_credit_used = array();\n\t\t\t\t}\n\t\t\t\tif ( empty( $smart_coupon_credit_used[ $coupon_code ] ) || ( $cart_contains_subscription && ( 'combined_total' === $calculation_type || 'sign_up_fee_total' === $calculation_type ) ) ) {\n\t\t\t\t\t$smart_coupon_credit_used[ $coupon_code ] = $discount;\n\t\t\t\t} else {\n\t\t\t\t\t$smart_coupon_credit_used[ $coupon_code ] += $discount;\n\t\t\t\t}\n\t\t\t\tWC()->cart->smart_coupon_credit_used = $smart_coupon_credit_used;\n\n\t\t\t}\n\t\t}",
"public static function subscriptionDiscountUpdated($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountUpdated', $callback);\n }",
"public function apply_coupon_from_session() {\n\n\t\t\t$cart = ( is_object( WC() ) && isset( WC()->cart ) ) ? WC()->cart : null;\n\n\t\t\tif ( empty( $cart ) || WC()->cart->is_empty() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tif ( 0 === $user_id ) {\n\t\t\t\t$unique_id = ( ! empty( $_COOKIE['sc_applied_coupon_profile_id'] ) ) ? wc_clean( wp_unslash( $_COOKIE['sc_applied_coupon_profile_id'] ) ) : ''; // phpcs:ignore\n\t\t\t\t$applied_coupon_from_url = ( ! empty( $unique_id ) ) ? get_option( 'sc_applied_coupon_profile_' . $unique_id, array() ) : array();\n\t\t\t} else {\n\t\t\t\t$applied_coupon_from_url = get_user_meta( $user_id, 'sc_applied_coupon_from_url', true );\n\t\t\t}\n\n\t\t\tif ( empty( $applied_coupon_from_url ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $applied_coupon_from_url as $index => $coupon_code ) {\n\t\t\t\tWC()->cart->add_discount( trim( $coupon_code ) );\n\t\t\t\tunset( $applied_coupon_from_url[ $index ] );\n\t\t\t}\n\n\t\t\tif ( 0 === $user_id ) {\n\t\t\t\tupdate_option( 'sc_applied_coupon_profile_' . $unique_id, $applied_coupon_from_url, 'no' );\n\t\t\t} else {\n\t\t\t\tupdate_user_meta( $user_id, 'sc_applied_coupon_from_url', $applied_coupon_from_url );\n\t\t\t}\n\n\t\t}",
"public function applyGlobalDiscount($discount_rate)\n {\n }",
"function apply_cart_discounts_after_tax() {\t\n\t\t\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\tdo_action( 'cmdeals_cart_discount_after_tax_' . $coupon->type, $coupon );\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_cart\" :\n\t\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + $coupon->amount;\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\t\tcase \"percent\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = (round( $this->cart_contents_total + $this->tax_total , 2) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + $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\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t}",
"public static function subscriptionDiscountChanged($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountChanged', $callback);\n }",
"public function getDiscountRefunded();",
"public function set_credits_discountamount($observer)\n {\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//Mage::log(Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig() . \" configuration settings \");\n//Mage::log($array2);\n $session = Mage::getSingleton('checkout/session');\n if(Mage::helper('customer')->isLoggedIn()) {\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $customer_group=Mage::getModel('customer/group')->load(Mage::getSingleton('customer/session')->getCustomerGroupId())->getCustomerGroupCode();\n}\n \n$val1 = Mage::getSingleton('adminhtml/session')->getValue();\nif(isset($val1))\n{\n$amt1 = array();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['totalCredits'];\n$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n}\nelse{\n$amt1 = array();\n $quote = Mage::getModel('checkout/cart')->getQuote();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['discountCredits'];\n}\n $isvirtual=0;\n foreach($quote->getAllItems() as $item){\n if($item->getIsVirtual()==1) {\n $isvirtual=1;\n }\n if(Mage::getModel('catalog/product')->load($item->getProductId())->getTypeId()=='customproduct'){\n $isvirtual=1;\n }\n }\n$total=$quote->getGrandTotal(); \n\n$subTotal = $quote->getSubtotal();\n//Mage::log($quote->getGrandTotal().\"this is grand total store credit\");\n//Mage::log($quote->getSubtotal().\"this is sub total\");\n\n if (!Mage::helper('kartparadigm_storecredit')->getTaxEnabled()){\n$tax = $quote->getShippingAddress()->getData('tax_amount');\n}\n if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){\n$shippingPrice = $quote->getShippingAddress()->getShippingAmount();\n}\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n//echo $expirydate;\n//echo $nowdate;\n$balance;\n//echo $amt;\n$amt2;\n $amt1;\n \n\nif(isset($amt)){\n/*---------------------Calculating Default Currency Value----------------------- */\n$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\n $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n if ($baseCurrencyCode != $currentCurrencyCode) {\n $amt2 = Mage::helper('directory')->currencyConvert($amt1, $baseCurrencyCode, $currentCurrencyCode);\n }\n else{\n $amt2 = $amt1; \n }\n // $amt2 = Mage::helper('core')->currency($amt1, true, false);\n//Mage::log($amt1.\" = amount = \".$amt2 );\n//----------------------------------------------------------------\nif($total > $amt2) {\nif(($total - $tax - $shippingPrice) > $amt2){\n$discountAmount = $amt2;\n$balance = $totalCredits - $amt;\n}else{\n $discountAmount = $subTotal;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\n}\nelse {\n$discountAmount = $total - $tax - $shippingPrice;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\nMage::getSingleton('core/session')->setBalance($balance);\n\nMage::getSingleton('checkout/session')->setDiscount($totalCredits - $balance);\n$msg = \"Current Credits In Your Account : \" . $balance;\nMage::getSingleton('core/session')->setCredits($msg);\n if ($discountAmount > 0) {\n\n\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseDiscount = $discountAmount/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseDiscount = $discountAmount;\n } \n $total = $quote->getBaseSubtotal();\n $data1 = $quote->getData();\n // Mage::log($data1['entity_id'].\"quote id\");\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');\n foreach($quote->getAllAddresses() as $address) {\n $data = $address->getData();\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n $address->collectTotals();\n $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());\n $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());\n $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());\n $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n $quote->setEntityId($data1['entity_id'])->save();\n $quote->setSubtotalWithDiscount($quote->getSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $baseDiscount)->setEntityId($data1['entity_id'])->save();\n if ($address->getAddressType() == $canAddItems) {\n $address->setSubtotalWithDiscount((float)$data['subtotal_with_discount'] - $discountAmount);\n $address->setGrandTotal((float)$data['grand_total'] - $discountAmount);\n $address->setBaseSubtotalWithDiscount((float)$data['base_subtotal_with_discount'] - $baseDiscount);\n $address->setBaseGrandTotal((float)$data['base_grand_total'] - $baseDiscount);\n if ($data['discount_description']) {\n $address->setDiscountAmount(($data['discount_amount'] - $discountAmount));\n $address->setDiscountDescription($data['discount_description'] . ', Store Credits');\n $address->setBaseDiscountAmount(($data['base_discount_amount'] - $baseDiscount));\n }\n else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Store Credits');\n $address->setBaseDiscountAmount(-($baseDiscount));\n }\n $address->setAddressId($data['address_id'])->save();\n }\n }\n foreach($quote->getAllItems() as $item) {\n\n // We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat = $item->getPriceInclTax() / $quote->getSubtotal();\n $rat1 = $item->getBasePriceInclTax() / $quote->getBaseSubtotal();\n $ratdisc = $discountAmount * $rat;\n $ratdisc1 = $baseDiscount * $rat1;\n//Mage::log($item->getDiscountAmount().\"include tax\".$item->getBaseDiscountAmount());\n // Mage::log($item->getDiscountAmount().\"discount storecredit\");\n$idata = $item->getData();\n Mage::log($item->getDiscountAmount().\"discount amount credit\");\n $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc1) * $item->getQty())->save();\n }\n }else if($totalCredits == 0){\n\n$msg = \"Sorry You Have No Credits In Your Account\";\nMage::getSingleton('core/session')->setCredits($msg);\n}\n \n \n } \n }",
"public function couponPostAction()\n {\n /** @var Divante_OpenLoyalty_Model_Quote $quote */\n $quote = $this->_getQuote();\n\n $this->resetLoyaltyInUse();\n\n /** @var Mage_Core_Helper_Data $helperCore */\n $helperCore = Mage::helper('core');\n \n /**\n * No reason continue with empty shopping cart\n */\n if (!$quote->getItemsCount()\n || !$this->_validateFormKey()) {\n $this->_goBack();\n\n return;\n }\n\n /** @var string $couponCode */\n $couponCode = (string) $this->getRequest()->getParam('coupon_code');\n \n if ($this->getRequest()->getParam(self::REMOVE_PARAM) == 1) {\n $couponCode = '';\n }\n \n $oldCouponCode = $quote->getCouponCode();\n\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n $this->_goBack();\n \n return;\n }\n\n try {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n $quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\n ->unsetLoyaltyDiscount()\n ->collectTotals()\n ->save();\n\n if (strlen($couponCode)) {\n if ($couponCode == $quote->getCouponCode()) {\n $this\n ->_getSession()\n ->addSuccess(\n $this->__(\n 'Coupon code \"%s\" was applied.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n } else {\n $this\n ->_getSession()\n ->addError(\n $this->__(\n 'Coupon code \"%s\" is not valid.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n }\n } else {\n $this\n ->_getSession()\n ->addSuccess($this->__('Coupon code was canceled.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this\n ->_getSession()\n ->addError($e->getMessage());\n } catch (Exception $e) {\n $this\n ->_getSession()\n ->addError($this->__('Cannot apply the coupon code.'));\n Mage::logException($e);\n }\n\n $this->_goBack();\n }",
"protected abstract function applyCoupon($coupon_code);",
"function apply_15_percent_coupon() {\n\t\tglobal $woocommerce;\n\n\t\t$coupon_code = '15percent'; // your coupon code here\n\t\tif ( $_POST['coupon_code'] != '' ) {\n\t\t\t$woocommerce->cart->remove_coupon( $coupon_code );\n\n\t\t\treturn;\n\t\t}\n\t\tif ( $woocommerce->cart->has_discount( $coupon_code ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( count( $woocommerce->cart->get_applied_coupons() ) == 0 ) {\n\t\t\t$woocommerce->cart->add_discount( $coupon_code );\n\t\t}\n\t}",
"public function stripe_payment(Request $request) {\n\n try {\n\n DB::beginTransaction();\n\n $validator = Validator::make($request->all(), \n array(\n 'subscription_id' => 'required|exists:subscriptions,id',\n 'coupon_code'=>'exists:coupons,coupon_code',\n ), array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n\n if($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n throw new Exception($error_messages, 101);\n\n } else {\n\n $subscription = Subscription::find($request->subscription_id);\n\n $user = User::find($request->id);\n\n if ($subscription) {\n\n $total = $subscription->amount;\n\n $coupon_amount = 0;\n\n $coupon_reason = '';\n\n $is_coupon_applied = COUPON_NOT_APPLIED;\n\n if ($request->coupon_code) {\n\n $coupon = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($coupon) {\n \n if ($coupon->status == COUPON_INACTIVE) {\n\n $coupon_reason = tr('coupon_inactive_reason');\n\n } else {\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $coupon)->getData();\n\n if ($check_coupon->success) {\n\n $is_coupon_applied = COUPON_APPLIED;\n\n $amount_convertion = $coupon->amount;\n\n if ($coupon->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($coupon->amount, $subscription->amount), 2);\n\n }\n\n\n if ($amount_convertion < $subscription->amount) {\n\n $total = $subscription->amount - $amount_convertion;\n\n $coupon_amount = $amount_convertion;\n\n } else {\n\n // throw new Exception(Helper::get_error_message(156),156);\n\n $total = 0;\n\n $coupon_amount = $amount_convertion;\n \n }\n\n // Create user applied coupon\n\n if($check_coupon->code == 2002) {\n\n $user_coupon = UserCoupon::where('user_id', $user->id)\n ->where('coupon_code', $request->coupon_code)\n ->first();\n\n // If user coupon not exists, create a new row\n\n if ($user_coupon) {\n\n if ($user_coupon->no_of_times_used < $coupon->per_users_limit) {\n\n $user_coupon->no_of_times_used += 1;\n\n $user_coupon->save();\n\n }\n\n }\n\n } else {\n\n $user_coupon = new UserCoupon;\n\n $user_coupon->user_id = $user->id;\n\n $user_coupon->coupon_code = $request->coupon_code;\n\n $user_coupon->no_of_times_used = 1;\n\n $user_coupon->save();\n\n }\n\n } else {\n\n $coupon_reason = $check_coupon->error_messages;\n \n }\n\n }\n\n } else {\n\n $coupon_reason = tr('coupon_delete_reason');\n }\n }\n\n if ($user) {\n\n $check_card_exists = User::where('users.id' , $request->id)\n ->leftJoin('cards' , 'users.id','=','cards.user_id')\n ->where('cards.id' , $user->card_id)\n ->where('cards.is_default' , DEFAULT_TRUE);\n\n if($check_card_exists->count() != 0) {\n\n $user_card = $check_card_exists->first();\n\n if ($total <= 0) {\n\n \n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n if (strtotime($previous_payment->expiry_date) >= strtotime(date('Y-m-d H:i:s'))) {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime(\"+{$subscription->plan} months\", strtotime($previous_payment->expiry_date)));\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = \"free plan\";\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = 1;\n\n $user_payment->amount = $total;\n\n $user_payment->payment_mode = CARD;\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n \n if ($user) {\n\n $user->user_type = 1;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n \n \n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $stripe_secret_key = Setting::get('stripe_secret_key');\n\n $customer_id = $user_card->customer_id;\n\n if($stripe_secret_key) {\n\n \\Stripe\\Stripe::setApiKey($stripe_secret_key);\n\n } else {\n\n throw new Exception(Helper::error_message(902), 902);\n\n }\n\n try{\n\n $user_charge = \\Stripe\\Charge::create(array(\n \"amount\" => $total * 100,\n \"currency\" => \"usd\",\n \"customer\" => $customer_id,\n ));\n\n $payment_id = $user_charge->id;\n $amount = $user_charge->amount/100;\n $paid_status = $user_charge->paid;\n\n if($paid_status) {\n\n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n $expiry_date = $previous_payment->expiry_date;\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime($expiry_date. \"+\".$subscription->plan.\" months\"));\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = $payment_id;\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = PAID_STATUS;\n\n $user_payment->payment_mode = CARD;\n\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n if ($user) {\n\n $user->user_type = SUBSCRIBED_USER;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n\n \n\n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $response_array = array('success' => false, 'error_messages' => Helper::error_message(903) , 'error_code' => 903);\n\n throw new Exception(Helper::error_message(903), 903);\n\n }\n\n \n } catch(\\Stripe\\Error\\RateLimit $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch(\\Stripe\\Error\\Card $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\InvalidRequest $e) {\n // Invalid parameters were supplied to Stripe's API\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Authentication $e) {\n\n // Authentication with Stripe's API failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\ApiConnection $e) {\n\n // Network communication with Stripe failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Base $e) {\n // Display a very generic error to the user, and maybe send\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (Exception $e) {\n // Something else happened, completely unrelated to Stripe\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\StripeInvalidRequestError $e) {\n\n Log::info(print_r($e,true));\n\n throw new Exception($e->getMessage(), 903);\n \n \n }\n\n\n }\n\n } else {\n \n throw new Exception(Helper::error_message(901), 901);\n \n }\n\n } else {\n\n throw new Exception(tr('no_user_detail_found'));\n \n }\n\n } else {\n\n throw new Exception(Helper::error_message(901), 901);\n\n } \n\n \n }\n\n DB::commit();\n\n return response()->json($response_array , 200);\n\n } catch (Exception $e) {\n\n DB::rollback();\n\n $error = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$error, 'error_code'=>$code];\n\n return response()->json($response_array);\n }\n \n }",
"public function coupon()\n\t{\n\t\t$session = JFactory::getSession();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call coupon method of model to apply coupon\n\t\t$valid = $model->coupon();\n\t\t$cart = $session->get('cart');\n\t\t$this->modifyCalculation($cart);\n\t\t$this->_carthelper->cartFinalCalculation(false);\n\n\t\t// Store cart entry in db\n\t\t$this->_carthelper->carttodb();\n\n\t\t// If coupon code is valid than apply to cart else raise error\n\t\tif ($valid)\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = JText::_('COM_REDSHOP_COUPON_CODE_IS_NOT_VALID');\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link, $msg);\n\t\t}\n\t}",
"public function applyCoupon($coupon)\n {\n $this->assertCustomerExists();\n\n $customer = $this->asStripeCustomer();\n\n $customer->coupon = $coupon;\n\n $customer->save();\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 }",
"protected function applyDiscounts()\n {\n $discounts = $this->booking->bookingDiscounts;\n $this->discountedPeriodsTotal = $this->periodsTotal;\n $discountedTotal = $this->periodsTotal;\n\n if (!$discounts) return;\n\n // Apply discounts based on the order of discount sequence.\n foreach ($this->discountSequence as $sequence) {\n // Filter discounts so that we don't have to loop through all of them.\n $filteredDiscounts = $discounts->where('type', $sequence);\n\n $methodName = \"apply\" . Str::studly($sequence) . \"Discount\";\n\n // Apply and store discount information.\n foreach ($filteredDiscounts as $filteredDiscount) {\n $discountInformation = ['beforeDiscount' => $discountedTotal];\n $discountedTotal = $this->$methodName($discountedTotal, $filteredDiscount);\n $discountInformation['afterDiscount'] = $discountedTotal;\n\n if (!$this->discountApplied($discountInformation['beforeDiscount'], $discountInformation['afterDiscount'])) {\n continue;\n }\n\n $discountInformation['discount'] = $filteredDiscount;\n $this->appliedDiscounts[] = $discountInformation;\n }\n }\n\n $this->discountedPeriodsTotal = $discountedTotal;\n }",
"public function subscriptions_payment_apple_pay(Request $request) {\n\n try {\n\n DB::beginTransaction();\n\n $validator = Validator::make($request->all(), \n array(\n 'subscription_id' => 'required|exists:subscriptions,id',\n 'coupon_code'=>'exists:coupons,coupon_code',\n 'payment_mode' => 'required|in:'.APPLE_PAY,\n 'token_id' => 'required'\n ), array(\n 'coupon_code.exists' => tr('coupon_code_not_exists'),\n 'subscription_id.exists' => tr('subscription_not_exists'),\n ));\n\n if($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n throw new Exception($error_messages, 101);\n\n }\n\n $subscription = Subscription::find($request->subscription_id);\n\n if(!$subscription) {\n\n throw new Exception(Helper::error_message(901), 901);\n \n }\n\n $user = User::find($request->id);\n\n if(!$user) {\n\n throw new Exception(tr('no_user_detail_found'));\n \n }\n\n $total = $subscription->amount;\n\n $coupon_amount = 0;\n\n $coupon_reason = '';\n\n $is_coupon_applied = COUPON_NOT_APPLIED;\n\n if ($request->coupon_code) {\n\n $coupon = Coupon::where('coupon_code', $request->coupon_code)->first();\n\n if ($coupon) {\n \n if ($coupon->status == COUPON_INACTIVE) {\n\n $coupon_reason = tr('coupon_inactive_reason');\n\n } else {\n\n $check_coupon = $this->check_coupon_applicable_to_user($user, $coupon)->getData();\n\n if ($check_coupon->success) {\n\n $is_coupon_applied = COUPON_APPLIED;\n\n $amount_convertion = $coupon->amount;\n\n if ($coupon->amount_type == PERCENTAGE) {\n\n $amount_convertion = round(amount_convertion($coupon->amount, $subscription->amount), 2);\n\n }\n\n\n if ($amount_convertion < $subscription->amount) {\n\n $total = $subscription->amount - $amount_convertion;\n\n $coupon_amount = $amount_convertion;\n\n } else {\n\n // throw new Exception(Helper::get_error_message(156),156);\n\n $total = 0;\n\n $coupon_amount = $amount_convertion;\n \n }\n\n // Create user applied coupon\n\n if($check_coupon->code == 2002) {\n\n $user_coupon = UserCoupon::where('user_id', $user->id)\n ->where('coupon_code', $request->coupon_code)\n ->first();\n\n // If user coupon not exists, create a new row\n\n if ($user_coupon) {\n\n if ($user_coupon->no_of_times_used < $coupon->per_users_limit) {\n\n $user_coupon->no_of_times_used += 1;\n\n $user_coupon->save();\n\n }\n\n }\n\n } else {\n\n $user_coupon = new UserCoupon;\n\n $user_coupon->user_id = $user->id;\n\n $user_coupon->coupon_code = $request->coupon_code;\n\n $user_coupon->no_of_times_used = 1;\n\n $user_coupon->save();\n\n }\n\n } else {\n\n $coupon_reason = $check_coupon->error_messages;\n \n }\n\n }\n\n } else {\n\n $coupon_reason = tr('coupon_delete_reason');\n }\n }\n\n if ($total <= 0) {\n\n \n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n if (strtotime($previous_payment->expiry_date) >= strtotime(date('Y-m-d H:i:s'))) {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime(\"+{$subscription->plan} months\", strtotime($previous_payment->expiry_date)));\n\n } else {\n\n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+{$subscription->plan} months\"));\n\n }\n\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = \"free plan\";\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = 1;\n\n $user_payment->amount = $total;\n\n $user_payment->payment_mode = APPLE_PAY;\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n \n if ($user) {\n\n $user->user_type = 1;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n \n \n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $stripe_secret_key = Setting::get('stripe_secret_key');\n\n if($stripe_secret_key) {\n\n \\Stripe\\Stripe::setApiKey($stripe_secret_key);\n\n } else {\n\n throw new Exception(Helper::error_message(902), 902);\n\n }\n\n try{\n\n $user_charge = \\Stripe\\Charge::create(array(\n \"amount\" => $total * 100,\n \"currency\" => \"usd\",\n \"source\" => $request->token_id,\n ));\n\n $payment_id = $user_charge->id;\n $amount = $user_charge->amount/100;\n $paid_status = $user_charge->paid;\n\n if($paid_status) {\n\n $previous_payment = UserSubscription::where('user_id' , $request->id)\n ->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n $user_payment = new UserSubscription;\n\n if($previous_payment) {\n\n $expiry_date = $previous_payment->expiry_date;\n $user_payment->expiry_date = date('Y-m-d H:i:s', strtotime($expiry_date. \"+\".$subscription->plan.\" months\"));\n\n } else {\n \n $user_payment->expiry_date = date('Y-m-d H:i:s',strtotime(\"+\".$subscription->plan.\" months\"));\n }\n\n\n $user_payment->payment_id = $payment_id;\n\n $user_payment->user_id = $request->id;\n\n $user_payment->subscription_id = $request->subscription_id;\n\n $user_payment->status = PAID_STATUS;\n\n $user_payment->payment_mode = APPLE_PAY;\n\n\n // Coupon details\n\n $user_payment->is_coupon_applied = $is_coupon_applied;\n\n $user_payment->coupon_code = $request->coupon_code ? $request->coupon_code :'';\n\n $user_payment->coupon_amount = $coupon_amount;\n\n $user_payment->subscription_amount = $subscription->amount;\n\n $user_payment->amount = $total;\n\n $user_payment->coupon_reason = $is_coupon_applied == COUPON_APPLIED ? '' : $coupon_reason;\n\n\n if ($user_payment->save()) {\n\n if ($user) {\n\n $user->user_type = SUBSCRIBED_USER;\n\n $user->amount_paid += $total;\n\n $user->expiry_date = $user_payment->expiry_date;\n\n $now = time(); // or your date as well\n\n $end_date = strtotime($user->expiry_date);\n\n $datediff = $end_date - $now;\n\n $user->no_of_days = ($user->expiry_date) ? floor($datediff / (60 * 60 * 24)) + 1 : 0;\n\n if ($user_payment->amount <= 0) {\n\n $user->one_time_subscription = 1;\n }\n\n if ($user->save()) {\n\n $data = ['id' => $user->id , 'token' => $user->token, 'no_of_account'=>$subscription->no_of_account , 'payment_id' => $user_payment->payment_id];\n\n $response_array = ['success' => true, 'message'=>tr('payment_success') , 'data' => $data];\n\n } else {\n\n\n throw new Exception(tr('user_details_not_saved'));\n \n }\n\n } else {\n\n throw new Exception(tr('user_not_found'));\n \n }\n\n \n\n } else {\n\n throw new Exception(tr(Helper::error_message(902)), 902);\n\n }\n\n\n } else {\n\n $response_array = array('success' => false, 'error_messages' => Helper::error_message(903) , 'error_code' => 903);\n\n throw new Exception(Helper::error_message(903), 903);\n\n }\n\n \n } catch(\\Stripe\\Error\\RateLimit $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch(\\Stripe\\Error\\Card $e) {\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\InvalidRequest $e) {\n // Invalid parameters were supplied to Stripe's API\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Authentication $e) {\n\n // Authentication with Stripe's API failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\ApiConnection $e) {\n\n // Network communication with Stripe failed\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\Error\\Base $e) {\n // Display a very generic error to the user, and maybe send\n \n throw new Exception($e->getMessage(), 903);\n\n } catch (Exception $e) {\n // Something else happened, completely unrelated to Stripe\n\n throw new Exception($e->getMessage(), 903);\n\n } catch (\\Stripe\\StripeInvalidRequestError $e) {\n\n Log::info(print_r($e,true));\n\n throw new Exception($e->getMessage(), 903);\n \n \n }\n\n\n }\n \n DB::commit();\n\n return response()->json($response_array , 200);\n\n } catch (Exception $e) {\n\n DB::rollback();\n\n $error = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$error, 'error_code'=>$code];\n\n return response()->json($response_array);\n }\n \n }"
] | [
"0.67926526",
"0.6785508",
"0.67720866",
"0.6667279",
"0.6549684",
"0.65437543",
"0.65316623",
"0.6530725",
"0.65135664",
"0.6509255",
"0.6507628",
"0.6461083",
"0.64513326",
"0.64356816",
"0.63701975",
"0.635742",
"0.6281496",
"0.6249001",
"0.6246762",
"0.6207004",
"0.6201372",
"0.6199059",
"0.6170138",
"0.6136765",
"0.6114615",
"0.6107935",
"0.6096809",
"0.6096442",
"0.60867333",
"0.6043579"
] | 0.83097464 | 0 |
Get the upload record associated with the post. | public function upload()
{
return $this->hasOne(Upload::class, 'id', 'upload_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUpload()\n {\n return $this->upload;\n }",
"public function getUpload() {\n\t\treturn $this->loadMediaUploadView();\n\t}",
"public function getUploadId()\n {\n return $this->data['upload_id'];\n }",
"public function getUploadField()\n {\n return $this->component->getUploadField($this->gridField);\n }",
"public function getUploadField()\n {\n return $this->component->getUploadField($this->gridField);\n }",
"public function getRecord()\n {\n $entry = $this->getEntry();\n if ($entry) {\n return $entry->getRecord();\n }\n }",
"public function getCdUpload()\n {\n return $this->cd_upload;\n }",
"public function getUploadField()\n {\n return $this->component->bulkUploadField($this->gridField);\n }",
"public function getEntity() {\n return $this->file;\n }",
"public function get_post() {\n\n return $this->_post;\n }",
"public function getFile()\r\n\t{\r\n\t\t// This if statement allows for you to continue using this class AFTER insert\r\n\t\t// basically it will only get the file if you plan on using it further which means that\r\n\t\t// otherwise it omits at least one database call each time\r\n\t\tif($this->_id instanceof ObjectID && !$this->_file instanceof GridFSDownload){\r\n\t\t\treturn $this->_file = $this->getCollection()->get($this->_id);\r\n\t\t}\r\n\t\treturn $this->_file;\r\n\t}",
"public function get_postcard() {\n return Attachment::get( $this->get_postcard_id() ) ?: false;\n }",
"function get_current_post_attachments() {\n return get_post_attachments(get_queried_object_id());\n }",
"public function getPost()\n {\n return $this->hasOne(PostForm::className(), ['_id' => 'post_id']);\n }",
"public function getPost()\n {\n return $this->post;\n }",
"public function getPost(): Post\n {\n return $this->post;\n }",
"public function getAttachment()\n {\n return $this->attachment;\n }",
"public function getAttachment()\n {\n return $this->attachment;\n }",
"public function getAttachment()\n {\n return $this->attachment;\n }",
"public function get()\n {\n return $this->object = get_post($this->id);\n }",
"public function getUploadThumbnail(): ?File\n {\n return $this->uploadThumbnail;\n }",
"public function getCaminhoUpload()\n {\n return $this->caminhoUpload;\n }",
"public function uploads()\n\t{\n\t\treturn $this->hasOne('App\\CepUploads','upload_id','cep_ref_upload_id');\n\t}",
"public function getUploader()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\treturn $sfUsers::fetchUser($this->uploader);\n\t}",
"public function uploader()\n {\n return $this->belongsTo(Admin::class, 'admin_id');\n }",
"protected function getUploadedResource()\n {\n if ($this->getMappingResultsForProperty()->hasErrors()) {\n return null;\n }\n if (is_callable([$this, 'getValueAttribute'])) {\n $resource = $this->getValueAttribute();\n } else {\n // @deprecated since 7.6 will be removed once 6.2 support is removed\n $resource = $this->getValue(false);\n }\n if ($resource instanceof FileReference) {\n return $resource;\n }\n return $this->propertyMapper->convert($resource, FileReference::class);\n }",
"public function the_post() {\r\n\t\treturn $this->query->the_post();\r\n\t}",
"public function getPost()\n {\n return $this->hasOne(Post::className(), ['id' => 'post_id']);\n }",
"protected function get_record()\n\t{\n\t\treturn $this->key ? parent::get_record() : null;\n\t}",
"public function attachment()\n\t{\n\t\tif (!isset($this->_attachment))\n\t\t{\n\t\t\t$this->_attachment = ForumModelAttachment::getInstance(0, $this->get('id'));\n\t\t}\n\t\treturn $this->_attachment;\n\t}"
] | [
"0.68857557",
"0.6286055",
"0.6051548",
"0.58886594",
"0.58886594",
"0.5852826",
"0.5711179",
"0.57106704",
"0.5685754",
"0.5643944",
"0.5630983",
"0.560322",
"0.55935234",
"0.553235",
"0.551803",
"0.55074775",
"0.5504258",
"0.5504258",
"0.5504258",
"0.5497092",
"0.5493714",
"0.54833424",
"0.54574555",
"0.54516643",
"0.54054713",
"0.53783983",
"0.5369654",
"0.532614",
"0.52980936",
"0.5280023"
] | 0.6689858 | 1 |
Gets the fieldId The name of the field for this credential. e.g, username or password or phoneNumber. This is defined by the application. Must match what is in the html field on singleSignOnSettings/password object. | public function getFieldId()
{
if (array_key_exists("fieldId", $this->_propDict)) {
return $this->_propDict["fieldId"];
} else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdentifier()\n {\n return static::FIELD_ID;\n }",
"public function getIdFieldName()\n {\n return $this->_idFieldName;\n }",
"public function get_field_key() {\n\t\treturn $this->get_field_attr( 'field_key' );\n\t}",
"public function get_field_id() {\n\t\treturn $this->get_field_attr( 'id' );\n\t}",
"public function get_field_name();",
"public function getIdField()\n {\n return $this->idField;\n }",
"public function get_field_id($field_name)\n {\n }",
"public function getIdFieldName()\n {\n if (empty($this->_idFieldName)) {\n Virtual::throwException('Empty identifier field name');\n }\n\n return $this->_idFieldName;\n }",
"public function getIDField(): string {\n\t\treturn $this->idField;\n\t}",
"public function getFieldName($field_name)\n {\n\n return sfConfig::get('app_sf_guard_plugin_profile_'.$field_name.'_name', $field_name);\n }",
"public function getIdField()\n {\n return !empty($this->idField) ? $this->idField : $this->getManager()->getIdField();\n }",
"public function getIdentifierField();",
"function getFieldID() {\n\t\treturn $this->iFieldID;\n\t}",
"public function getField(): string\n {\n return $this->field;\n }",
"public function getSingleIdentifierFieldName(): string;",
"public function getUserFieldDetails($userfieldId) {\n\t\t\n\t\t// Get a db connection.\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t \n\t\t$query->select($db->quoteName(array('name', 'registration', 'account')));\n\t\t$query->from($db->quoteName('#__virtuemart_userfields'));\n\t\t$query->where($db->quoteName('virtuemart_userfield_id') . ' = ' . $db->quote($userfieldId));\n\n\t\t$db->setQuery($query);\n\t\t$userfield = $db->loadObject();\n\t\t\n\t\treturn $userfield;\n\t}",
"public function getDbFieldName($field_name);",
"public function getIdField() : string\n {\n return 'id';\n }",
"public function getRecordIdFieldName()\n {\n $metadata = $this->exportMetaData();\n $recordIdFieldName = $metadata[0]['field_name'];\n return $recordIdFieldName;\n }",
"public function getFieldName() {\r\n return $this->_fieldName;\r\n }",
"public function getFieldName() {\n return $this->fieldName;\n }",
"public function getFieldName()\n {\n return $this->fieldName;\n }",
"public function getFieldName()\n {\n return $this->fieldName;\n }",
"public function getFieldName()\n {\n return $this->fieldName;\n }",
"public function getIdFieldName()\n {\n return $this->prototype->getIdFieldName();\n }",
"public function getField()\n {\n $value = $this->name;\n if (null != $this->field) {\n $value = $this->field;\n }\n return $value;\n }",
"public function fieldName()\n\t{\n\t\tif(strpos($this->key, '_id'))\n\t\t{\n\t\t\treturn str_replace('_id', '', $this->key);\n\t\t}\n\n\t\treturn $this->key;\n\t}",
"public function getFieldName($field) {\n return $field['name'];\n }",
"public function getFieldName() {}",
"public function getFieldContactID()\n\t{\n\t\treturn $this->GetDAL()->GetField(DotCoreContactMemberDAL::CONTACT_MEMBER_ID);\n\t}"
] | [
"0.68584794",
"0.67467034",
"0.67020285",
"0.6701952",
"0.6701457",
"0.65741616",
"0.6547263",
"0.6527757",
"0.65267694",
"0.651781",
"0.6510918",
"0.6506219",
"0.6423867",
"0.6386912",
"0.6270117",
"0.6203322",
"0.61606234",
"0.6155901",
"0.61408395",
"0.6105079",
"0.61022156",
"0.60850364",
"0.60850364",
"0.60850364",
"0.6077963",
"0.6063874",
"0.6054282",
"0.6053043",
"0.6039884",
"0.6024095"
] | 0.69585454 | 0 |
/ creation d'un lot catalogue | function createCatalog($ar){
$rs = selectQueryGetAll('select count(distinct categ) as nb from '.$this->wtscatalog);
$p= new XParam($ar, array('prdconf'=>NULL,
'categ'=>'Lot '.($rs[0]['nb']+1),
'wtspool'=>NULL, 'wtsticket'=>NULL, 'wtsperson'=>NULL));
$added = 0;
$prdconf = $p->get('prdconf');
$categ = $p->get('categ');
$tapool = $p->get('tapool');
$wtspool = $p->get('wtspool');
$tatickets = $p->get('ticket');
$tapersons = $p->get('person');
$wtstickets = $p->get('wtsticket');
$wtspersons = $p->get('wtsperson');
$lar = array('_options'=>array('local'=>true),
'tplentry'=>TZR_RETURN_DATA,
'tapool'=>$tapool,
'wtspool'=>$wtspool,
'categ'=>$categ,
'prdconf'=>$prdconf,
);
// on génère les produits pour les combinaison selectionnées de valeurs tatickets/tapools
foreach($tatickets as $it=>$taticketoid){
$lar['wtsticket'] = NULL;
$lar['taticket'] = $taticketoid;
if (isset($wtstickets[$it]))
$lar['wtsticket']= $wtstickets[$it];
foreach($tapersons as $ip=>$tapersonoid){
$lar['wtsperson'] = NULL;
$lar['taperson'] = $tapersonoid;
if (isset($wtspersons[$ip]))
$lar['wtsperson'] = $wtspersons[$ip];
// creation de la ligne
$added+=1;
$this->dswtscatalog->procInput($lar);
}
}
$mess = $added.' produits ajoutés';
XShell::setNextData('message', $mess);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preCreateCatalog($ar){\n // lot\n $rs = selectQueryGetAll('select count(distinct categ) as nb from '.$this->wtscatalog);\n $newval = 'Groupe '.($rs[0]['nb']+1);\n $fdl = new XShortTextDef();\n $fdl->field = 'categ';\n $fdl->table = $this->wtscatalog;\n $fdl->fieldcount = '32';\n $fdl->compulsory = 1;\n $fvl = $fdl->edit($newval);\n XShell::toScreen2('br', 'ocateg', $fvl);\n // configuration\n $fdl = new XLinkDef();\n $fdl->field = 'prdconf';\n $fdl->table = $this->wtscatalog;\n $fdl->target = $this->wtsprdconf;\n $fdl->fieldcount = '1';\n $fdl->compulsory = 0;\n $fvl = $fdl->edit();\n XShell::toScreen2('br', 'oprdconf', $fvl);\n // liste des secteurs wts\n $fdl = new XLinkDef();\n $fdl->field = 'wtspool';\n $fdl->table = $this->wtscatalog;\n $fdl->target = $this->wtspool;\n $fdl->fieldcount = '1';\n $fdl->compulsory = 0;\n $fdl->checkbox = 0;\n $fvl = $fdl->edit();\n XShell::toScreen2('br', 'owtspool', $fvl);\n // liste des personnes wts\n $this->dswtsperson->browse(array('selectedfields'=>'all', 'tplentry'=>'br_wtsperson', 'pagesize'=>999));\n // liste des forfaits wts\n $this->dswtsticket->browse(array('selectedfields'=>'all', 'tplentry'=>'br_wtsticket', 'pagesize'=>999));\n // liste des pools ta\n $bpools = $this->dstapool->browse(array('selectedfields'=>'all', 'tplentry'=>'br_pool', 'pagesize'=>999));\n // liste des tickets ta par pool ta\n $tickets = array();\n foreach($bpools['lines_oid'] as $poid){\n $tickets[] = $this->dstaticket->browse(array('selectedfields'=>'all', 'tplentry'=>TZR_RETURN_DATA, 'pagesize'=>999,\n 'select'=>$this->dstaticket->select_query(array('cond'=>array('tapool'=>array('=', $poid))))\n )\n );\n }\n XShell::toScreen2('br', 'ticket', $tickets);\n // liste des types de personnes ta\n $this->dstaperson->browse(array('selectedfields'=>'all', 'tplentry'=>'br_person', 'pagesize'=>999));\n // date de recherche\n $fd = new XDateDef();\n $fd->field = 'validfrom';\n $r = $fd->edit(date('Y-m-d'));\n XShell::toScreen2('br', 'ovalidfrom', $r);\n }",
"public function catalogo(){\n \n $inicio['recomendado'] = $this->carga_recomendado();\n $inicio['categorias'] = $this->carga_menu_categorias();\n $this->Plantilla(\"catalogo\", $inicio);\n \n }",
"public function catalogos() \n\t{\n\t}",
"function create_catalogs($catalog)\r\n {\r\n $this->valid_catalog = new stdClass;\r\n $this->invalid_catalog = new stdClass;\r\n $this->validated_catalog = new stdClass;\r\n foreach ($catalog as $k => $v) {\r\n if ($v == \"invalid number\") {\r\n $this->invalid_catalog->name[] = $k;\r\n $this->invalid_catalog->number = $this->invalid_number;\r\n } elseif($k == ''){\r\n $this->invalid_catalog->invalid_name[] = $k;\r\n $this->invalid_catalog->number_of_invalid_name[] = $v;\r\n }\r\n else {\r\n $this->valid_catalog->name[] = $k;\r\n $this->valid_catalog->number[] = $v;\r\n $this->validated_catalog->validated_name[]= $k;\r\n $this->validated_catalog->validated_number[]= $this->transformTelNum($v, $this->outputformat);;\r\n }\r\n }\r\n $this->invalid_catalog->invalidline = $this->invalid_line;\r\n }",
"public function manageCatalog()\r\n {\r\n foreach ($this->data as $line) {\r\n if (count($line) > 2 || ($line[0] == '' && $line[1] == '')) {\r\n $this->invalid_line[] = implode(\";\", $line);\r\n } else {\r\n foreach ($line as $k => $v) {\r\n if ($this->getType($v) == \"name\") {\r\n $name[] = $v;\r\n } elseif ($this->getType($v) == \"number\") {\r\n $v = str_replace(\" \", \"\", trim($v));\r\n $number[] = $v;\r\n $validatednumber[] = $this->validateTelNum($v);\r\n } elseif ($this->getType($v) == \"empty\") {\r\n if ($this->getType($this->temp) == \"name\") {\r\n $v = str_replace(\" \", \"\", trim($v));\r\n $number[] = $v;\r\n $validatednumber[] = $this->validateTelNum($v);\r\n } else{\r\n $name[] = $v;\r\n }\r\n }\r\n $this->temp = $v;\r\n }\r\n }\r\n }\r\n $this->raw_catalog = array_combine($name, $number); // array me ola ta onomata kai ta noumera opws erxetai apo to arxeio\r\n $this->tempcatalog = array_combine($name, $validatednumber); // array me ola ta onomata kai \"invalid number\" opou einai lathos to noumero \r\n $this->create_catalogs($this->tempcatalog);\r\n /*foreach (array_keys($this->tempcatalog, \"invalid number\") as $k => $v) {\r\n $invalidname[] = $v;\r\n $invalidnumber[] = $this->raw_catalog[$v];\r\n $this->invalidcatalog = array_combine($invalidname, $invalidnumber); //aray me onomata kai \"invalid number\" mono\r\n unset($this->tempcatalog[$v]); // kopsimo twn \"invalid number\"\r\n }\r\n foreach ($this->tempcatalog as $k => $v) {\r\n if ($k == '') {\r\n unset($this->tempcatalog[$k]);\r\n $this->invalidcatalog += array($k => $v);\r\n \r\n }\r\n }\r\n $this->invalidcatalog += array('invalid line' => $this->invalid_line);*/\r\n //foreach ($this->tempcatalog as $k => $v) {\r\n /*foreach ($this->valid_catalog->number as $k => $v) {\r\n $finalnumber[] = $this->transformTelNum($v, $this->outputformat);\r\n $final_name[] = $k;\r\n if ($this->order == \"names\") {\r\n $this->finalcatalog = array_combine($final_name, $finalnumber); //array me onomata kai noumera se morfh pou edwse o xrhsths\r\n } else {\r\n $this->finalcatalog = array_combine($finalnumber, $final_name); //array me onomata kai noumera se morfh pou edwse o xrhsths\r\n }\r\n }*/\r\n $this->Catalogs = new ArrayObject();\r\n $this->Catalogs[\"rawcatalog\"] = $this->raw_catalog;\r\n $this->Catalogs[\"validcatalog\"] = $this->valid_catalog;\r\n $this->Catalogs[\"invalidcatalog\"] = $this->invalid_catalog;\r\n $this->Catalogs[\"validatedcatalog\"] = $this->validated_catalog;\r\n return $this->Catalogs;\r\n //return array($this->finalcatalog, $this->invalid_catalog);\r\n }",
"public function createCarte()\n {\n $this->utils->Restreindre($this->userConnecter->admin, $this->utils->Est_autoriser(9, $this->userConnecter->profil));\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $data['profession'] = $this->utils->professions();\n $data['typepiece'] = $this->utils->typepiece();\n $data['pays'] = $this->utils->listePays();\n $data['nationalites'] = $this->utils->nationalites();\n $data['regions'] = $this->utils->allRegionByPays();\n $paramsview = array('view' => 'compte/new-carte');\n $this->view($paramsview, $data);\n }",
"static public function ctrHistorial(){\n\n\t\t// FACTURAS\n\t\t$tabla = \"cta\";\n\t\t$respuesta = ModeloVentas::mdlHistorial($tabla);\n\t\t\n\n\t\tforeach ($respuesta as $key => $value) {\n\n\t\t\t// veo los items de la factura\n\t\t\t$tabla = \"ctaart\";\n\t\t\t$repuestos = ModeloVentas::mdlHistorialCta_art($tabla,$value['idcta']);\n\t\t\t\n\t\t\t$productos='';\n\n\t\t\tfor($i = 0; $i < count($repuestos)-1; $i++){\n\t\t\t\t\n\t\t\t\t$productos = '{\"id\":\"'.$repuestos[$i][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[$i][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[$i][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[$i][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[$i][\"precio\"].'\"},';\n\t\t\t}\n\n\t\t\t$productos = $productos . '{\"id\":\"'.$repuestos[count($repuestos)-1][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[count($repuestos)-1][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[count($repuestos)-1][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\"}';\n\n\t\t\t$productos =\"[\".$productos.\"]\";\n\t\t\t\n\t\t\techo '<pre>'; print_r($productos); echo '</pre>';\n\t\t\t\n\t\t\t// datos para cargar la factura\n\t\t\t$tabla = \"ventas\";\n\t\t\t$datos = array(\"id_vendedor\"=>1,\n\t\t\t\t\t\t \"fecha\"=>$value['fecha'],\n\t\t\t\t\t\t \"id_cliente\"=>$value[\"idcliente\"],\n\t\t\t\t\t\t \"codigo\"=>$key,\n\t\t\t\t\t\t \"nrofc\"=>$value[\"nrofc\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($value[\"obs\"]),\n\t\t\t\t\t\t \"productos\"=>$productos,\n\t\t\t\t\t\t \"impuesto\"=>0,\n\t\t\t\t\t\t \"neto\"=>0,\n\t\t\t\t\t\t \"total\"=>$value[\"importe\"],\n\t\t\t\t\t\t \"adeuda\"=>$value[\"adeuda\"],\n\t\t\t\t\t\t \"obs\"=>\"\",\n\t\t\t\t\t\t \"metodo_pago\"=>$value[\"detallepago\"],\n\t\t\t\t\t\t \"fechapago\"=>$value['fecha']);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\t\t\t\n\n\t\t}\n\t\t\n\t\treturn $respuesta;\n\n\t\t\n\t\t\n\t}",
"private function construct_xml_contain(){\r\n global $CFG;\r\n $xml = new SimpleXMLElement('<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.'<!DOCTYPE root [<!ENTITY nbsp \" \">]>'.'<catalogue/>');\r\n\r\n foreach($this->offers as $offer){\r\n $resource_link = '';\r\n if (OfferCourse::isCentralizedRessourcesAvailable()) {\r\n if(isset($offer->thumbnailid) && $offer->thumbnailid != null){\r\n $DBC = get_centralized_db_connection();\r\n $cr_resource = $DBC->get_record('cr_resources', array('resourceid'=>$offer->thumbnailid));\r\n $resource_link = \"\";\r\n if($cr_resource){\r\n $url_resource = '/'.$CFG->centralizedresources_media_types['indexthumb'].'/'.$cr_resource->cleanname;\r\n $resource_link = get_resource_centralized_secure_url($url_resource, $cr_resource->hashname.$cr_resource->createdate, $CFG->secure_link_timestamp_image);\r\n }\r\n }\r\n }\r\n $formation = $xml->addChild('formation');\r\n if (isset($resource_link)){\r\n $formation->addChild('image', htmlspecialchars($resource_link));\r\n }\r\n $formation->addChild('nom_parcours', htmlspecialchars($offer->fullname));\r\n if (isset($offer->domain_name)){\r\n $formation->addChild('domaine', htmlspecialchars($offer->domain_name));\r\n }\r\n if (isset($offer->publics)){\r\n $formation->addChild('public', htmlspecialchars($offer->publics));\r\n }\r\n if (isset($offer->col_name)){\r\n $formation->addChild('collection', htmlspecialchars($offer->col_name));\r\n }\r\n if (isset($offer->authors)){\r\n $formation->addChild('formateur', htmlspecialchars($offer->authors));\r\n }\r\n if (isset($offer->summary)){\r\n $description = strip_tags($offer->summary,'');\r\n $formation->addChild('description', htmlspecialchars($description));\r\n }\r\n if (isset($offer->objectif)){\r\n $objectif = strip_tags($offer->objectif,'');\r\n $formation->addChild('objectifs', htmlspecialchars($objectif));\r\n }\r\n if (isset($offer->tps_en_presence)){\r\n $temps_presence = OfferCourse::string_format_time($offer->tps_en_presence);\r\n if($temps_presence == null){\r\n $temps_presence = get_string('no_lead_time_attendance', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_presence', htmlspecialchars($temps_presence));\r\n }\r\n if (isset($offer->tps_a_distance)){\r\n $temps_distance = OfferCourse::string_format_time($offer->tps_a_distance);\r\n if($temps_distance == null){\r\n $temps_distance = get_string('no_lead_time_remote', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_distance', htmlspecialchars($temps_distance));\r\n }\r\n if (isset($offer->validateby)){\r\n $formation->addChild('validation', htmlspecialchars($offer->validateby));\r\n }\r\n if (isset($offer->aca_name)){\r\n $formation->addChild('origine', OfferCourse::string_format_origine_offers($offer->aca_name));\r\n }\r\n if (isset($offer->timepublished)){\r\n $updatedate = (isset($offer->timepublished)?date('YmdHis',$offer->timepublished):date('YmdHis',$offer->updatedate));\r\n $formation->addChild('date_publication', $updatedate);\r\n }\r\n $formation->addChild('url', $offer->courseurl);\r\n }\r\n\r\n $this->xml_structure = $xml->asXML();\r\n }",
"public function create()\n {\n $data = [];\n $data['breadcrumb_header'] = AppServiceProvider::get_breadcrumb_header();\n\n $data['categories'] = Category::pluck('title', 'id')->all();\n $data['tags'] = Tag::all();\n\n\n //Получаем список атрибутов\n $data['attrs'] = [];\n $results = AttributeCategory::where(['type'=> 0])->get();\n foreach ($results as $result) {\n $items = Attribute::where('category_id', $result->id)->get();\n $data['attrs'][] = [\n 'id' => $result->id,\n 'title' => $result->title,\n 'items' => $items,\n ];\n }\n $data['attrs_dop'] = [];\n // 1 - это дополнительные атрибуты\n $results = AttributeCategory::where(['type'=> 1])->get();\n foreach ($results as $result) {\n $items = Attribute::where('category_id', $result->id)->get();\n\n $data['attrs_dop'][] = [\n 'id' => $result->id,\n 'title' => $result->title,\n 'items' => $items,\n ];\n }\n\n $data['brands'] = CarBrand::all();\n\n return view('admin.lots.create', $data);\n }",
"public function run()\n {\n $catalog = new \\App\\Catalog(['name' => 'Thời trang nam']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang nữ']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang đôi']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang cho bé']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thời trang tổng hợp']);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đầm nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo khoác nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo thun nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Quần nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Chân váy', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Quần Short Nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đồ lót & Đồ ngủ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đầm bầu', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Đồ bơi nữ', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Thắt lưng', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nữ')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo khoác nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo thun nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo Cardigan nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Áo sơ mi', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n $catalog = new \\App\\Catalog(['name' => 'Áo len', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Quần nam', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n\n $catalog = new \\App\\Catalog(['name' => 'Cà vạt & nơ bướm', 'parent_id' => \\App\\Catalog::findIdByName('Thời trang nam')]);\n $catalog->save();\n }",
"public function getCatalog() {}",
"protected function createObjects() {\n\t\t$this->lblId = $this->mctHut->lblId_Create();\n\t\t$this->lstPosition = $this->mctHut->lstPosition_Create();\n\t\t$this->txtName = $this->mctHut->txtName_Create();\n\t}",
"function create(){\n // cls_hermes_plugin::cls_hermes_plugin($options); \nglobal $xoopsModuleConfig, $xoopsDB;\n\n //------------------------------------------- \n $decomodele = $this->name;\n $sql = \"('{$decomodele}', 'content','multiline',0,01,'12',''),\n ('{$decomodele}', 'type','list',0,02,'|css|html|text','');\";\n\n \n //--------------------------------------------------\n cls_decoration:: createModele($decomodele, $sql);\n //-------------------------------------------------- \n\n\n}",
"function panier2bdd() {\n\t// if (!empty($_SESSION['dims']['userid']) && !empty($_SESSION['catalogue']['panier'])) {\n\tif (!empty($_SESSION['dims']['userid'])) {\n\t\tinclude_once DIMS_APP_PATH.'/modules/catalogue/include/class_panier.php';\n\t\t$panier = new cata_panier();\n\t\t$panier->open($_SESSION['dims']['userid']);\n\t\t$panier->articles = array();\n\n\t\t$panier->fields['libelle'] = '';\n\t\t$panier->fields['id_user'] = $_SESSION['dims']['userid'];\n\t\t$panier->fields['id_module'] = $_SESSION['dims']['moduleid'];\n\n\t\tif (isset($_SESSION['catalogue']['panier'])) {\n\t\t\tforeach ($_SESSION['catalogue']['panier']['articles'] as $ref => $values) {\n\t\t\t\t$panier->articles[] = array(\n\t\t\t\t\t'ref' \t\t\t=> $ref,\n\t\t\t\t\t'qte' \t\t\t=> $values['qte'],\n\t\t\t\t\t'forced_price' \t=> (isset($values['forced_price']) ? $values['forced_price'] : 'NULL')\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$panier->save();\n\t}\n}",
"function createProduct($nome, $categoria, $descricao, $quantidade, $preco, $foto) {\n return [\n 'id' => hash('sha256', uniqid(\"\")), // gera um idenficador unico para o registro\n 'nome' => $nome,\n 'categoria' => $categoria, \n 'descricao' => $descricao,\n 'quantidade' => $quantidade,\n 'preco' => $preco, \n 'foto' => $foto\n ];\n}",
"function getNewClotures($id_ag, $date) {\n global $dbHandler, $global_id_agence;\n $db = $dbHandler->openConnection();\n $sql = \"SELECT id_cpte, id_prod, devise, id_ag, num_complet_cpte, id_titulaire, solde_clot, raison_clot, date_ouvert FROM ad_cpt WHERE date_clot = '$date' AND id_ag = $global_id_agence\";\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n }\n $newClot = array ();\n while ($tmprow = $result->fetchrow()){\n $newClot[$tmprow[0]][\"id_cpte\"] = $tmprow[0];\n $newClot[$tmprow[0]][\"id_prod\"] = $tmprow[1];\n $newClot[$tmprow[0]][\"devise\"] = $tmprow[2];\n $newClot[$tmprow[0]][\"id_ag\"] = $tmprow[3];\n $newClot[$tmprow[0]][\"num_complet_cpte\"] = $tmprow[4];\n $newClot[$tmprow[0]][\"id_titulaire\"] = $tmprow[5];\n $newClot[$tmprow[0]][\"solde_clot\"] = $tmprow[6];\n $newClot[$tmprow[0]][\"raison_clot\"] = $tmprow[7];\n $newClot[$tmprow[0]][\"date_ouvert\"] = $tmprow[8];\n }\n $dbHandler->closeConnection(true);\n return $newClot;\n}",
"function ciniki_artcatalog_trackingAdd(&$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 'artcatalog_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Artcatalog Item'), \n 'name'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Name'), \n 'external_number'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Number'), \n 'start_date'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'type'=>'date', 'name'=>'Start'), \n 'end_date'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'type'=>'date', 'name'=>'End'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Notes'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n if( $args['artcatalog_id'] == '0' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.artcatalog.39', 'msg'=>'No artcatalog item specified'));\n }\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.trackingAdd'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n if( isset($args['name']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n $args['permalink'] = ciniki_core_makePermalink($ciniki, $args['name'] . '-' . ($args['start_date']==''?'0000-00-00':$args['start_date']));\n }\n\n //\n // Update tracking\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n return ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.artcatalog.place', $args);\n}",
"public function CrearNuevaCompra($datos){\n $ArrayIdProducto=$datos->ArrayIdProducto;\n $ArrayCantidadCompraProducto=$datos->ArrayCantidadCompraProducto;\n $ArrayPrecioProductoUnidad=$datos->ArrayPrecioProductoUnidad;\n \n \n //extraemos el precio de venta del repositorio\n $PrecioCompraTotal=$this->CompraRepository->PrecioTotalCompra($ArrayCantidadCompraProducto,$ArrayPrecioProductoUnidad);\n //Registramos la compra con los datos generales y extraemos el id de la compra que servira para llenar el detalle de la compra\n $compra_id= $this->CompraRepository->RegistrarCompraDatosGenerales($datos,$PrecioCompraTotal);\n\n \n //while que permite registrar los detalles de la venta \n $contador=0;\n while($contador<count($ArrayIdProducto)){\n //llamamos a metode para llenar los detalles de la compra pasando el id d ela compra \n $this->CompraRepository->RegistrarCompraDetalles($compra_id,$ArrayIdProducto[$contador],$ArrayCantidadCompraProducto[$contador],$ArrayPrecioProductoUnidad[$contador]);\n //Funcion que permite actualizar el stock de los productos \n $this->CompraRepository->ActualizarStockDisminuir($ArrayIdProducto[$contador],$ArrayCantidadCompraProducto[$contador]);\n $contador++;\n }\n\n \n \n \n \n }",
"public function RicercaPerIngredienti(){\n $pm = FPersistentManager::getInstance();\n $cibi = $pm->loadAllObjects();\n $view = new VRicerca();\n $view->mostraIngredienti($cibi);\n }",
"public function producto(){\n\t \t$this->load->template('catalogo_producto');\n\t }",
"public function run()\n {\n // CATEGORIA POSTRES\n\n $catalogo = new Catalogue();\n $catalogo->titulo = \"Enrollado de Chirimoya\";\n $catalogo->categoria = \"postres\";\n $catalogo->descripcion = \"Bizcochuelo de vainilla, relleno con tres capas, manjar, chantilly y pulpa de chirimoya, cubierto con fudge. Pídelo en su versión de 6 a 8 porciones.\";\n $catalogo->imagen = \"enrolladochirimoya.jpg\";\n $catalogo->save();\n\n $catalogo1 = new Catalogue();\n $catalogo1->titulo = \"Cheescake de zarzamoras\";\n $catalogo1->categoria = \"postres\";\n $catalogo1->descripcion = \"Una base de galleta rellena de una crema de queso y trozos de zarzamoras con el dulce clásico del cheescake, cubierto con mermelada y frutos.\";\n $catalogo1->imagen = \"cheescake.jpg\";\n $catalogo1->save();\n\n $catalogo2 = new Catalogue();\n $catalogo2->titulo = \"Crema Volteada\";\n $catalogo2->categoria = \"postres\";\n $catalogo2->descripcion = \"La más cremosa versión horneada con caramelo y un delicioso aroma a vainilla. Pídela desde 22cms\";\n $catalogo2->imagen = \"cremavolteada.jpg\";\n $catalogo2->save();\n\n $catalogo3 = new Catalogue();\n $catalogo3->titulo = \"Explosión de fresas\";\n $catalogo3->categoria = \"postres\";\n $catalogo3->descripcion = \"Bizcochuelo de vainilla embebido en un almíbar de fresas con licor, rellena con una capa de mermelada de fresas hecha en casa, una segunda capa de chantilly con fresas en trozos; cubierta en chantilly y decorada con fresas maceradas en jalea.\";\n $catalogo3->imagen = \"explosionfresa.jpg\";\n $catalogo3->save();\n\n $catalogo4 = new Catalogue();\n $catalogo4->titulo = \"Tarta de durazno\";\n $catalogo4->categoria = \"postres\";\n $catalogo4->descripcion = \"Una galleta horneada rellena con una crema pastelera de vainilla, cubierta con duraznos en jalea.\";\n $catalogo4->imagen = \"tartadurazno.jpg\";\n $catalogo4->save();\n\n $catalogo5 = new Catalogue();\n $catalogo5->titulo = \"Tartaleta de Fresas\";\n $catalogo5->categoria = \"postres\";\n $catalogo5->descripcion = \"Una galleta horneada rellena con una crema pastelera de vainilla, cubierta con fresas en jalea y decorada con copos de chantilly.\";\n $catalogo5->imagen = \"tartaletafresa.jpg\";\n $catalogo5->save();\n\n $catalogo6 = new Catalogue();\n $catalogo6->titulo = \"Torta húmeda de chocolate\";\n $catalogo6->categoria = \"postres\";\n $catalogo6->descripcion = \"Queque húmedo de chocolate embebido en un almíbar de chocolate, rellena con dos capas de fudge, cubierta con fudge. Pídela desde su versión mini (10 porciones).\";\n $catalogo6->imagen = \"tortahumeda.jpg\";\n $catalogo6->save();\n\n $catalogo7 = new Catalogue();\n $catalogo7->titulo = \"Tres Leches\";\n $catalogo7->categoria = \"postres\";\n $catalogo7->descripcion = \"Un suave bizcochuelo de vainilla o chocolate, embebido en nuestra deliciosa preparación de tres leches, rellena y cubierta de chantilly y envuelta en una deliciosa corona de chocolate bitter. Pídela desde su versión mini (10 porciones)\";\n $catalogo7->imagen = \"tresleches.jpg\";\n $catalogo7->save();\n\n\n //BODAS\n\n\n $catalogo8 = new Catalogue();\n $catalogo8->titulo = \"Naked\";\n $catalogo8->categoria = \"bodas\";\n $catalogo8->descripcion = \"Una torta en tendencia, pese a su sencillez luce super elegante, decorada con flores naturales o de tela.\";\n $catalogo8->imagen = \"naked.jpg\";\n $catalogo8->save();\n\n $catalogo9 = new Catalogue();\n $catalogo9->titulo = \"Azul\";\n $catalogo9->categoria = \"bodas\";\n $catalogo9->descripcion = \"Si deseas tematizar una torta y salir del blanco convencional he aquí la idea principal, una hermosa torta de bodas con azul metalizado.\";\n $catalogo9->imagen = \"azul.jpg\";\n $catalogo9->save();\n\n \n $catalogo10 = new Catalogue();\n $catalogo10->titulo = \"B&A\";\n $catalogo10->categoria = \"bodas\";\n $catalogo10->descripcion = \"Una torta ejecutada para la celebración de Bodas de Oro, aplicaciones de fondant.\";\n $catalogo10->imagen = \"bya.jpg\";\n $catalogo10->save();\n\n $catalogo11 = new Catalogue();\n $catalogo11->titulo = \"Love Gaby\";\n $catalogo11->categoria = \"bodas\";\n $catalogo11->descripcion = \"Una delicada versión que incluye acolchado, perlas y rosas, predominando el color perla\";\n $catalogo11->imagen = \"lovegaby.jpg\";\n $catalogo11->save();\n\n \n $catalogo12 = new Catalogue();\n $catalogo12->titulo = \"Love Volados\";\n $catalogo12->categoria = \"bodas\";\n $catalogo12->descripcion = \"Hermosa versión de bodas con flores y unos volados que envuelven todo el pastel para un efecto diferente. Aplicaciones en fondant\";\n $catalogo12->imagen = \"lovevolado.jpg\";\n $catalogo12->save();\n\n $catalogo13 = new Catalogue();\n $catalogo13->titulo = \"Siluetas\";\n $catalogo13->categoria = \"bodas\";\n $catalogo13->descripcion = \"Una idea para personalizar tu boda, usando siluetas de los novios en fotos reales, hará de ese recuerdo algo muy especial.\";\n $catalogo13->imagen = \"silueta.jpg\";\n $catalogo13->save();\n\n \n $catalogo14 = new Catalogue();\n $catalogo14->titulo = \"Mesa de Postres\";\n $catalogo14->categoria = \"bodas\";\n $catalogo14->descripcion = \"Una idea para complementar tu recepción una mesa completa de mini postres para el deleite de tus invitados.\";\n $catalogo14->imagen = \"mesapostre.jpg\";\n $catalogo14->save();\n\n //INFANTILES\n\n $catalogo15 = new Catalogue();\n $catalogo15->titulo = \"Mario Bross\";\n $catalogo15->categoria = \"infantiles\";\n $catalogo15->descripcion = \"El fontanero engreído de niños y adultos. Torta de 20 porciones\";\n $catalogo15->imagen = \"mariobross.jpg\";\n $catalogo15->save();\n\n \n $catalogo16 = new Catalogue();\n $catalogo16->titulo = \"Mickey\";\n $catalogo16->categoria = \"infantiles\";\n $catalogo16->descripcion = \"Aunque pasen los años este ratón seguirá robando el corazón de nuestros pequeños. Torta de 30 porciones (2 pisos) la cabecita de Mickey en chocolate forrado.\";\n $catalogo16->imagen = \"mickey.jpg\";\n $catalogo16->save();\n\n $catalogo17 = new Catalogue();\n $catalogo17->titulo = \"Spiderman\";\n $catalogo17->categoria = \"infantiles\";\n $catalogo17->descripcion = \"El super héroe favorito de muchos. Torta de 30 porciones\";\n $catalogo17->imagen = \"spiderman.jpg\";\n $catalogo17->save();\n\n \n $catalogo18 = new Catalogue();\n $catalogo18->titulo = \"Unicornio\";\n $catalogo18->categoria = \"infantiles\";\n $catalogo18->descripcion = \"Llevando a un mundo de sueños, color y fantasía. Torta de 20 porciones\";\n $catalogo18->imagen = \"unicornio.jpg\";\n $catalogo18->save();\n\n $catalogo19 = new Catalogue();\n $catalogo19->titulo = \"Hot Wheels\";\n $catalogo19->categoria = \"infantiles\";\n $catalogo19->descripcion = \"Para los amantes de la velocidad y por supuesto para los coleccionistas. Torta de 3 pisos (80 porciones)\";\n $catalogo19->imagen = \"hotwheels.jpg\";\n $catalogo19->save();\n\n \n $catalogo20 = new Catalogue();\n $catalogo20->titulo = \"Jasmine\";\n $catalogo20->categoria = \"infantiles\";\n $catalogo20->descripcion = \"Una princesa con el temperamento de su mascota. Torta de 2 pisos (50 porciones)\";\n $catalogo20->imagen = \"jasmine.jpg\";\n $catalogo20->save();\n\n $catalogo21 = new Catalogue();\n $catalogo21->titulo = \"Angry Birds\";\n $catalogo21->categoria = \"infantiles\";\n $catalogo21->descripcion = \"El clásico juego que conquistó a grandes y pequeños. Torta de 20 porciones\";\n $catalogo21->imagen = \"angrybirds.jpg\";\n $catalogo21->save();\n\n \n $catalogo22 = new Catalogue();\n $catalogo22->titulo = \"Blanca Nieves\";\n $catalogo22->categoria = \"infantiles\";\n $catalogo22->descripcion = \"No podría faltar nuestra primera princesa Disney. Temática blanca nieves, torta de 4 pisos (110 porciones) y dulces tematizados.\";\n $catalogo22->imagen = \"blancanieve.jpg\";\n $catalogo22->save();\n\n\n // Bocaditos\n\n\n $catalogo23 = new Catalogue();\n $catalogo23->titulo = \"Alfajores de Maicena\";\n $catalogo23->categoria = \"bocaditos\";\n $catalogo23->descripcion = \"Dos galletitas de maicena con una fina y delicada consistencia que se deshace en la boca rellenas con manjar de leche.\";\n $catalogo23->imagen = \"alfajore.jpg\";\n $catalogo23->save();\n\n \n $catalogo24 = new Catalogue();\n $catalogo24->titulo = \"Empanaditas de carne\";\n $catalogo24->categoria = \"bocaditos\";\n $catalogo24->descripcion = \"Una Deliciosa masa saladita rellena de un guiso con carne, pasas, ají amarillo, llevadas al horno. No podrás parar de comerlas.\";\n $catalogo24->imagen = \"empanada.jpg\";\n $catalogo24->save();\n\n $catalogo25 = new Catalogue();\n $catalogo25->titulo = \"Enrolladitos de hot dog\";\n $catalogo25->categoria = \"bocaditos\";\n $catalogo25->descripcion = \"Masa de hojaldre rellena de hot dog de ternera, llevada al horno, simplemente Yumi¡¡¡.\";\n $catalogo25->imagen = \"enrollado.jpg\";\n $catalogo25->save();\n\n \n $catalogo26 = new Catalogue();\n $catalogo26->titulo = \"Fresas Crocantes\";\n $catalogo26->categoria = \"bocaditos\";\n $catalogo26->descripcion = \"Dulces fresas cubiertas en chocolate bitter, la combinación de ambos ingredientes al paladar no tiene descripción.\";\n $catalogo26->imagen = \"fresacrocante.jpg\";\n $catalogo26->save();\n\n $catalogo27 = new Catalogue();\n $catalogo27->titulo = \"Mini pye de manzana\";\n $catalogo27->categoria = \"bocaditos\";\n $catalogo27->descripcion = \"Un clásico postre en un bocado, la deliciosa galletita se mezcla con el sabor de aquella manzana horneada con canela, azúcar y clavo.\";\n $catalogo27->imagen = \"minipye.jpg\";\n $catalogo27->save();\n\n \n $catalogo28 = new Catalogue();\n $catalogo28->titulo = \"Trufas de chocolate\";\n $catalogo28->categoria = \"bocaditos\";\n $catalogo28->descripcion = \"Pequeñas bolitas elaboradas con galletas, castañas y un toquecito de licor, cubiertas con una capita de chocolate bitter.\";\n $catalogo28->imagen = \"trufas.jpg\";\n $catalogo28->save();\n\n $catalogo29 = new Catalogue();\n $catalogo29->titulo = \"Rolatines de jamón y queso\";\n $catalogo29->categoria = \"bocaditos\";\n $catalogo29->descripcion = \"Pequeños piononos de pan pulman relleno de jamón y queso en rolatines.\";\n $catalogo29->imagen = \"rolatines.jpg\";\n $catalogo29->save();\n\n \n $catalogo30 = new Catalogue();\n $catalogo30->titulo = \"Petit pan con pollo\";\n $catalogo30->categoria = \"bocaditos\";\n $catalogo30->descripcion = \"Clásico sandwish y el favorito de muchos, un suave pancito de yema relleno de pollo deshilachado con apio y mayonesa de la casa.\";\n $catalogo30->imagen = \"petit.jpg\";\n $catalogo30->save();\n\n\n \n\n }",
"private function createViewProducto()\n {\n $this->addView('ListProductoSample', 'ProductoSample', 'products', 'fas fa-cubes');\n $this->addSearchFields('ListProductoSample', ['referencia', 'descripcion', 'observaciones']);\n $this->addOrderBy('ListProductoSample', ['referencia'], 'reference');\n $this->addOrderBy('ListProductoSample', ['descripcion'], 'description');\n $this->addOrderBy('ListProductoSample', ['precio'], 'price');\n $this->addOrderBy('ListProductoSample', ['stockfis'], 'stock');\n $this->addOrderBy('ListProductoSample', ['actualizado'], 'update-time');\n\n $manufacturers = $this->codeModel::all('fabricantes', 'codfabricante', 'nombre');\n $this->addFilterSelect('ListProductoSample', 'codfabricante', 'manufacturer', 'codfabricante', $manufacturers);\n\n $families = $this->codeModel::all('familias', 'codfamilia', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codfamilia', 'family', 'codfamilia', $families);\n\n $taxes = $this->codeModel::all('impuestos', 'codimpuesto', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codimpuesto', 'tax', 'codimpuesto', $taxes);\n\n $this->addFilterCheckbox('ListProductoSample', 'nostock', 'no-stock', 'nostock');\n $this->addFilterCheckbox('ListProductoSample', 'bloqueado', 'locked', 'bloqueado');\n $this->addFilterCheckbox('ListProductoSample', 'secompra', 'for-purchase', 'secompra');\n $this->addFilterCheckbox('ListProductoSample', 'sevende', 'for-sale', 'sevende');\n $this->addFilterCheckbox('ListProductoSample', 'publico', 'public', 'publico');\n }",
"private function new_articulo()\n {\n $this->template = FALSE;\n \n $art0 = new articulo();\n $art0->referencia = $_POST['referencia'];\n if( $art0->exists() )\n {\n $this->results[] = $art0->get($_POST['referencia']);\n }\n else\n {\n $art0->descripcion = $_POST['descripcion'];\n $art0->codfamilia = $_POST['codfamilia'];\n $art0->set_impuesto($_POST['codimpuesto']);\n \n if( $art0->save() )\n {\n $this->results[] = $art0;\n }\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }",
"private function crear_get()\n {\n $item = $this->ObtenNewModel();\n\t\t$lModel = new CicloModel(); \n \n //Pasamos a la vista toda la información que se desea representar\n\t\t$data['TituloPagina'] = \"Añadir un grupo\";\n\t\t$data[\"Model\"] = $item;\n\t\t$data[\"ComboCiclos\"] = $lModel->ObtenerTodos();\n\n //Finalmente presentamos nuestra plantilla\n\t\theader (\"content-type: application/json; charset=utf-8\");\n $this->view->show($this->_Nombre.\"/crear.php\", $data);\n\t}",
"public function catalogoInsert($genero, $servicio, $categoria, $descripcion, $detalle, $foto, $precio)\n {\n $sql = \"INSERT INTO catalogo (cod_genero,cod_servicio,cod_categoria,descripcion,detalle,foto,precio)\n VALUES ('$genero','$servicio','$categoria','$descripcion','$detalle','$foto','$precio')\";\n\n if (mysqli_query($this->open(), $sql)) {\n echo \"<script> alert('Registrado Correctamente') </script>\";\n } else {\n echo \"<script> alert('Error de Registro')\";\n }\n\n $this->catalogoSelect();\n }",
"function GetTabPrestation($projet)\n {\n //Ajout d'une catégorie de prestationj\n $btnNew = new Button(BUTTON);\n $btnNew->Value = $this->Core->GetCode(\"Devis.NewCategory\");\n $btnNew->OnClick = \"DevisAction.ShowAddCategory(\". $projet->IdEntite.\");\";\n\n $html .= $btnNew->Show();\n\n //Recuperation des articles\n $category = new DevisPrestationCategory($this->Core);\n $category->AddArgument(new Argument(\"Apps\\Devis\\Entity\\DevisPrestationCategory\", \"ProjetId\", EQUAL, $projet->IdEntite ));\n $categorys = $category->GetByArg();\n\n if(count($categorys) > 0)\n {\n //Ligne D'entete\n $html .= \"<div class='category'>\";\n $html .= \"<div class='blueTree'><b>\".$this->Core->GetCode(\"Devis.Libelle\").\"</b></div>\";\n\n $html .= \"</div>\"; \n\n foreach($categorys as $category)\n {\n $html .= \"<div class='category'>\";\n $html .= \"<div >\".$category->Libelle->Value.\"</div>\";\n\n //Lien pour afficher le détail\n $icEdit = new EditIcone();\n $icEdit->OnClick = \"DevisAction.ShowAddCategory(\". $projet->IdEntite.\", \".$category->IdEntite.\");\";\n $html .= \"<div >\".$icEdit->Show().\"</div>\";\n\n //Ajout de prestation\n $icAdd = new AddIcone($this->Core);\n $icAdd->Title = $this->Core->GetCode(\"Devis.AddPrestation\");\n $icAdd->OnClick = \"DevisAction.ShowAddPrestation(\".$category->IdEntite.\");\";\n\n $html .= \"<div >\".$icAdd->Show();\n $html .= $this->GetPrestation($category); \n\n $html .= \"</div>\";\n\n //Suppression\n $icDelete = new DeleteIcone();\n $icDelete->OnClick = \"DevisAction.DeleteCategory(this, '\".$category->IdEntite.\"')\";\n $html .= \"<div >\".$icDelete->Show().\"</div>\";\n\n $html .= \"</div>\";\n }\n }\n\n return new Libelle($html);\n }",
"public function traitementCategorie() {\n\n $this->data .= '<div class=\"boutique-droite\">';\n if(isset($_GET['categorie']))\n {\n $donnees = Database::query(\"SELECT id_produit,reference,titre,photo,prix FROM produit WHERE categorie=?\", array($_GET['categorie']));\n foreach($donnees as $key2 =>$produit)\n {\n $this->data .= '<div class=\"boutique-produit\">';\n $this->data .= \"<h3>$produit[titre]</h3>\";\n $this->data .= \"<a href=\\\"fiche_produit.php?id_produit=$produit[id_produit]\\\"><img src=\\\"$produit[photo]\\\" width=\\\"130\\\" height=\\\"100\\\" /></a>\";\n $this->data .= \"<p>$produit[prix] €</p>\";\n $this->data .= '<a href=\"fiche_produit.php?id_produit=' . $produit['id_produit'] . '\">Voir la fiche</a>';\n $this->data .= '</div>';\n }\n }\n $this->data .= '</div></div>';\n }",
"function defCatalog($name,$type = \"DIR\",$container = null){\n if(!isset($container)){\n $container = [\n defCatalog(\"manageA\",\"FUN\",[])\n ];\n }\n assert(is_array($container));\n assert(is_string($name));\n assert($type == \"DIR\" || $type == \"FUN\");\n return [\n \"name\"=>$name,\n \"type\"=>$type,\n \"container\"=>$container,\n ];\n}",
"public function __construct(){\n\t\t\t$this->productoDetalleModelo = new productoDetalleModelo;\n\t\t\t$this->productoFavoritoControlador = new productoFavoritoControlador();\n\t\t\t$this->productoEstrellaControlador = new productoEstrellaControlador();\n\t\t\t$this->productoCarritoControlador = new productoCarritoControlador();\n\t\t}",
"static public function ctrCrearVenta(){\n\n\t\t\n\t\tif(isset($_POST[\"nuevaVenta\"])){\n\n\t\t\t/*=============================================\n\t\t\tACTUALIZAR LAS COMPRAS DEL CLIENTE Y REDUCIR EL STOCK Y AUMENTAR LAS VENTAS DE LOS PRODUCTOS\n\t\t\t=============================================*/\n\n\t\t\t$listaProductos = json_decode($_POST[\"listaProductos\"], true);\n\t\t\t\n\n\t\t\t// $totalProductosComprados = array();\n\n\t\t\tforeach ($listaProductos as $key => $value) {\n\n\t\t\t\t// TRAER EL STOCK\n\t\t\t\t$tablaProductos = \"productos\";\n\n\t\t\t $item = \"id\";\n\t\t\t $valor = $value[\"id\"];\n\t\t\t $orden = \"id\";\n\n\t\t\t\t$stock = ModeloProductos::mdlMostrarProductos($tablaProductos, $item, $valor, $orden);\n\t\t\t\t\n\t\t\t\t// VER QUE TIPO DE STOCK TIENE\n\t\t\t\t$item = \"id\";\n\t\t\t $valor = $stock[\"id_categoria\"];\n\n\t\t\t $categorias = ControladorCategorias::ctrMostrarCategorias($item, $valor);\n\t\t\t echo '<pre>'; print_r($categorias); echo '</pre>';\n\n\t\t\t\t// SUMAR UNA VENTA\n\t\t\t $item1a = \"ventas\";\n\t\t\t\t$valor1a = $value[\"cantidad\"] + $stock[\"ventas\"];\n\n\t\t\t\t$nuevasVentas = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1a, $valor1a, $valor);\n\t\t\t\t\n\t\t\t\tif($categorias[\"movimiento\"]==\"SI\"){\n\t\t\t\t\t// SUMAR STOCK\n\t\t\t\t $item1b = \"stock\";\n\t\t\t\t\t$valor1b = $stock[\"stock\"]-$value[\"cantidad\"];\n\n\t\t\t\t\t$nuevoStock = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1b, $valor1b, $value[\"id\"]);\n\t\t\t\t\t\n\t\t\t\t} \n\n\t\t\t}\n\t\t\t\n\n\t\t\t$tablaClientes = \"clientes\";\n\n\t\t\t$item = \"id\";\n\t\t\t$valor = $_POST[\"seleccionarCliente\"];\n\n\t\t\t$traerCliente = ModeloClientes::mdlMostrarClientes($tablaClientes, $item, $valor);\n\t\t\t\n\n\t\t\t$item1a = \"compras\";\n\t\t\t$valor1a = $traerCliente[\"compras\"]+1;\n\n\t\t\t$comprasCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1a, $valor1a, $valor);\n\n\t\t\t$item1b = \"ultima_compra\";\n\n\t\t\t\n\t\t\t$fecha = date('Y-m-d');\n\t\t\t$hora = date('H:i:s');\n\t\t\t$valor1b = $fecha.' '.$hora;\n\n\t\t\t$fechaCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1b, $valor1b, $valor);\n\n\t\t\t/*=============================================\n\t\t\tFORMATEO LOS DATOS\n\t\t\t=============================================*/\t\n\n\t\t\t$fecha = explode(\"-\",$_POST[\"fecha\"]); //15-05-2018\n\t\t\t$fecha = $fecha[2].\"-\".$fecha[1].\"-\".$fecha[0];\n\n\t\t\tif ($_POST[\"listaMetodoPago\"]==\"CTA.CORRIENTE\"){\n\t\t\t\t\n\t\t\t\t$adeuda=$_POST[\"totalVenta\"];\n\n\t\t\t\t$fechapago=\"0000-00-00\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$adeuda=0;\n\n\t\t\t\t$fechapago = $fecha;\n\t\t\t}\n\n\t\t\t\n\n\t\t\t/*=============================================\n\t\t\tGUARDAR LA COMPRA\n\t\t\t=============================================*/\t\n\n\t\t\t$tabla = \"ventas\";\n\n\n\n\t\t\t$datos = array(\"id_vendedor\"=>$_POST[\"idVendedor\"],\n\t\t\t\t\t\t \"fecha\"=>$fecha,\n\t\t\t\t\t\t \"id_cliente\"=>$_POST[\"seleccionarCliente\"],\n\t\t\t\t\t\t \"codigo\"=>$_POST[\"nuevaVenta\"],\n\t\t\t\t\t\t \"nrofc\"=>$_POST[\"nrocomprobante\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($_POST[\"busqueda\"]),\n\t\t\t\t\t\t \"productos\"=>$_POST[\"listaProductos\"],\n\t\t\t\t\t\t \"impuesto\"=>$_POST[\"nuevoPrecioImpuesto\"],\n\t\t\t\t\t\t \"neto\"=>$_POST[\"nuevoPrecioNeto\"],\n\t\t\t\t\t\t \"total\"=>$_POST[\"totalVenta\"],\n\t\t\t\t\t\t \"adeuda\"=>$adeuda,\n\t\t\t\t\t\t \"obs\"=>strtoupper($_POST[\"obs\"]),\n\t\t\t\t\t\t \"metodo_pago\"=>$_POST[\"listaMetodoPago\"],\n\t\t\t\t\t\t \"fechapago\"=>$fechapago);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t/*=============================================\n\t\t\t\tCOMPARA EL NUMERO DE COMPROBANTE\n\t\t\t\t=============================================*/\n\t\t\t\t $nrofc = intval($_POST[\"nrocomprobante\"]);\n\n\t\t\t\t //ULTIMO NUMERO DE COMPROBANTE\n\t\t\t\t $item = \"nombre\";\n\t\t\t\t $valor = \"REGISTRO\";\n\n\t\t\t\t $nroComprobante = ControladorVentas::ctrUltimoComprobante($item, $valor);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t if($nrofc==$nroComprobante[\"numero\"]){\n\n\t\t\t\t \t$tabla=\"nrocomprobante\";\n\n\t\t\t\t\t$nrofc=$nrofc+1;\n\n\t\t\t\t \t$datos = array(\"nombre\"=>$valor,\n\t\t\t\t\t\t \"numero\"=>$nrofc);\n\n\t\t\t\t \t\n\t\t\t\t \tModeloVentas::mdlAgregarNroComprobante($tabla, $datos);\n\t\t\t\t }\n\n\t\t\t\t \n\t\t\t\t $nroComprobante = substr($_POST[\"nuevaVenta\"],8);\n\n\t\t\t\t //ULTIMO NUMERO DE COMPROBANTE\n\t\t\t\t $item = \"nombre\";\n\t\t\t\t $valor = \"FC\";\n\n\t\t\t\t $registro = ControladorVentas::ctrUltimoComprobante($item, $valor);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t if($nroComprobante==$registro[\"numero\"]){\n\n\t\t\t\t \t$tabla=\"nrocomprobante\";\n\n\t\t\t\t\t$nroComprobante=$nroComprobante+1;\n\n\t\t\t\t \t$datos = array(\"nombre\"=>$valor,\n\t\t\t\t\t\t \"numero\"=>$nroComprobante);\n\n\t\t\t\t \t\n\t\t\t\t \tModeloVentas::mdlAgregarNroComprobante($tabla, $datos);\n\t\t\t\t }\n\n\n\n\n\t\t\t\techo'<script>\n\n\t\t\t\tlocalStorage.removeItem(\"rango\");\n\n\t\t\t\t\n\n\t\t\t\t\t\t\t\twindow.location = \"ventas\";\n\n\n\t\t\t\t</script>';\n\n\n\t\t\t}\n\n\t\t }\n\n\t}"
] | [
"0.74085134",
"0.689524",
"0.6711217",
"0.62744534",
"0.6160358",
"0.5952195",
"0.58899945",
"0.5806396",
"0.5796995",
"0.57410246",
"0.5710859",
"0.5672943",
"0.5601688",
"0.5583919",
"0.55301535",
"0.55263233",
"0.54898703",
"0.5486411",
"0.5461777",
"0.54476166",
"0.5421867",
"0.54165155",
"0.5406588",
"0.5391986",
"0.53726757",
"0.53716254",
"0.5369639",
"0.5357329",
"0.5341829",
"0.53410083"
] | 0.75418735 | 0 |
/ browse d'une table de base | function browseTable($ar){
$p = new XParam($ar, array('tplentry'=>'br'));
$boid = $p->get('boid');
$tplentry = $p->get('tplentry');
$options = $p->get('options');
$x = XDataSource::objectFactory8($boid);
$lar = array('options'=>$options, '_options'=>array('local'=>true), 'pagesize'=>9999, 'first'=>0, 'selectedfields'=>'all', 'tplentry'=>$tplentry);
$x->browse($lar);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTable();",
"public function getTable();",
"public function getTable();",
"public function getTable();",
"public function getTable();",
"public function getTable();",
"public function getTable();",
"public function getTable();",
"abstract public function getTable();",
"abstract public function getTable();",
"public function getTableBase();",
"abstract protected function getTable();",
"public function baseTable();",
"public function index()\n {\n return parent::getTable($this->columns, $this->url, 'table', 'Data Penjualan');\n }",
"public abstract function getDbTable();",
"public static function getTable();",
"static function loadDb($table) {\n $tab = new self($table);\n $cols = stdDB::selectArray(\"SHOW COLUMNS FROM `$table`\");\n foreach($cols as $col)\n $tab->cols[$col['Field']] = new schemaColumn($col['Field'],$col['Type'],\n $col['Null'], $col['Default'], $col['Extra']);\n $rows = stdDB::selectArray(\"SHOW INDEX FROM `$table`\");\n $idxrow = array(); $idxs = array();\n foreach($rows as $row){\n $idxrow[$row[\"Key_name\"]][] = $row[\"Column_name\"];\n $idxs[$row[\"Key_name\"]] = $row;\n }\n foreach($idxs as $k=>$row) {\n $tab->idx[$k] = new schemaIndex($k, $idxrow[$k],\n $row['Non_unique'], $row['Sub_part']);\n }\n return $tab;\n }",
"public function getTable() {}",
"public function getTable() {}",
"public function getTable() {}",
"public function fullDataBase()\n {\n print \"<table cellpadding='10' border=solid bordercolor=black>\";\n print\"<tr>\n <td>ROW</td> <td>EXCHANGE</td>\n <td>NAME</td> <td>IPO</td>\n <td>SYMBOL</td> <td>PRICE</td>\n <td>CAP</td> <td>UPDATED</td>\n <td>SECTOR</td> <td>INDUSTRY</td>\n </tr>\";\n $sql = \"SELECT * FROM companies ORDER BY ipodate DESC, cap DESC\";\n\n foreach ($this->conn->query($sql) as $row) {\n print \"<tr> <td nowrap>\";\n print $row['id'] . \"</td><td nowrap>\";\n print $row['stockexchange'] . \"</td><td nowrap>\";\n print $row['name'] . \"</td><td nowrap>\";\n print $row['ipodate'] . \"</td><td nowrap>\";\n print $row['symbol'] . \"</td><td nowrap>\";\n print $row['price'] . \"</td><td nowrap>\";\n print $row['cap'] . \"</td><td nowrap>\";\n print $row['created_at'] . \"</td><td nowrap>\";\n print $row['sector'] . \"</td><td nowrap>\";\n print $row['industry'] . \"</td></tr>\";\n }\n print \"</table>\";\n }",
"public function getTableRaw();",
"public function getTable()\r\n {\r\n }",
"public function admin_get_tables() {}",
"public function admin_get_tables() {}",
"public function table($table);",
"public function table($table);",
"public function getTable()\n {\n\n }",
"function tablaRuta($Nombre){\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::tablaRegistro($Nombre, $query);\r\n\t\r\n }",
"function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }"
] | [
"0.69066596",
"0.69066596",
"0.69066596",
"0.69066596",
"0.69066596",
"0.69066596",
"0.69066596",
"0.68663263",
"0.6788869",
"0.6788869",
"0.6784087",
"0.67251194",
"0.6706494",
"0.6637506",
"0.6529571",
"0.652892",
"0.64077574",
"0.63447714",
"0.6343819",
"0.63433725",
"0.63203216",
"0.6298187",
"0.62713903",
"0.6199823",
"0.61987853",
"0.6179875",
"0.6179875",
"0.6155111",
"0.6151348",
"0.6147333"
] | 0.7221671 | 0 |
/ charger les pool | private function loadPools($clearbefore){
if ($clearbefore){
updateQuery('truncate '.$this->tapool);
}
$wtpsi = $this->getAWTPSI();
$rs = $wtpsi->doGetPools(array());
foreach($rs as $i=>$o){
if ($o->NERRORNO != 0){
XLogs::critical(get_class($this)." erreur lecture des pools : ${$o->SZERRORMESSAGE}");
continue;
}
$newoid = sprintf($this->tapool.':%06d%06d', $o->NPROJECTNO, $o->NPOOLNO);
// recherche du pool via poolno et projet
$rs1 = selectQuery($this->dstapool->select_query(array('cond'=>array('prjno'=>array('=', $o->NPROJECTNO), 'poolno'=>array('=', $o->NPOOLNO)))));
if ($rs1 && $rs1->RowCount() > 0){
// on a deja
} else {
// ajout du pool
$this->dstapool->procInput(array('_options'=>array('local'=>true),
'newoid'=>$newoid,
'oid'=>$newoid,
'prjno'=>addslashes($o->NPROJECTNO),
'poolno'=>addslashes($o->NPOOLNO),
'talabel'=>addslashes($o->SZPOOL)
)
);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPools()\r\n\t{\r\n\t\treturn $this->pools;\r\n\t}",
"public function getPools()\n\t{\n\t\t$pools = array();\n\t\t$result = '';\n\t\t\n\t\tswitch( $this->db_link->getDriver() )\n\t\t{\n\t\t\tcase 'sqlite':\n\t\t\tcase 'mysql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM Pool\";\n\t\t\tbreak;\n\t\t\tcase 'pgsql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM pool\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$result = $this->db_link->runQuery($query);\n\t\tforeach( $result->fetchAll() as $pool )\n\t\t\t$pools[] = $pool;\n\n\t\treturn $pools;\n\t}",
"public function getPoolSize();",
"static public function master_pool()\n\t{\n\t\trequire( LOCAL_DOCUMENT_ROOT.\"/configure/db.php\" );\n\t\treturn $master_pool[ array_rand( $master_pool ) ];\n\t}",
"public function reqPool()\n {\n }",
"public function keyPoolRefill();",
"public function __construct($pool = [])\n {\n \n $this->pool = $pool;\n\n }",
"function getPools() {\n\n include_once 'pool.php';\n\n $result = new pool();\n $authenticate = $result->getPools();\n\n // checking if bookings have been gotten from database\n if (!$authenticate) {\n echo \"Error getting pool data\";\n return;\n }\n\n $row = $result->fetch();\n if (!$row) {\n echo \"unable to get pool data\";\n return;\n } else {\n\t\t\techo '{\"result\":1,\"pool\":[';\n\t\t\twhile ($row) {\n\t\t\t\techo json_encode($row);\n\t\t\t\t$row = $result->fetch();\n\t\t\t\t\tif ($row) {\n\t\t\t\t\t\techo ',';\n\t\t\t\t\t}\n\t\t\t}\n\t\t\techo ']}';\n\t\t\t\t// echo $row['user_username'];\n\t\t\t\t// $row = $result->fetch();\n\t\t\t}\n }",
"public function actionInitPool()\r\n {\r\n echo 1;\r\n exit();\r\n ini_set('max_execution_time', 0);\r\n\r\n $prizeType = Config::find()->all();\r\n foreach ($prizeType as $k => $v) {\r\n\r\n if ($v->praisenumber > 0) {\r\n for ($i = 0; $i < $v->praisenumber; $i++) {\r\n $model = new PrizePool();\r\n $model->aid = $v->id;\r\n $model->save();\r\n unset($model);\r\n }\r\n echo $v->praisename;\r\n }\r\n\r\n }\r\n\r\n echo '~All OK!!!';\r\n }",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearRelatedInstancePool()\n {\n }",
"public static function clearRelatedInstancePool()\n\t{\n\t}",
"public static function clearRelatedInstancePool()\n\t{\n\t}",
"public function ConcurrentRequestsUsingPool()\n {\n CalcTime::start();\n\n $client = new Client();\n\n// $requests = function ($total) {\n// $uri = 'http://apiv4.yundun.cn/';\n// for ($i = 0; $i < $total; $i++) {\n// yield new Request('GET', $uri);\n// }\n// };\n\n $requests = function ($total) use ($client) {\n $uri = 'http://apiv4.yundun.cn/';\n for ($i = 0; $i < $total; $i++) {\n yield function () use ($client, $uri) {\n return $client->getAsync($uri);\n };\n }\n };\n\n\n $pool = new Pool($client, $requests(100), [\n 'concurrency' => 100,\n 'fulfilled' => function ($response, $index) {\n // this is delivered each successful response\n echo 'index:' . $index . \"\\n\";\n echo \"fulfilled\\n\";\n },\n 'rejected' => function ($reason, $index) {\n // this is delivered each failed request\n echo 'index:' . $index . \"\\n\";\n echo \"rejected\\n\";\n },\n ]);\n\n // Initiate the transfers and create a promise\n $promise = $pool->promise();\n\n // Force the pool of requests to complete.\n $promise->wait();\n\n CalcTime::end();\n CalcTime::echoUseTime(__FUNCTION__);\n }",
"public function initPools()\r\n\t{\r\n\t\tforeach (array_keys($this->getPools()) as $key) {\r\n\t\t\t$this->initPool($key);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}",
"public function __destruct(){\n if (!empty($this->_connPool)){\n foreach ($this->_connPool as $conn){\n $this->close($conn);\n }\n }\n }",
"function process_pools_disp($host_data, $edit=false)\n{\n $i = 0;\n $table = \"\";\n\n\n $arr = array ('command'=>'pools','parameter'=>'');\n $pool_arr = send_request_to_host($arr, $host_data);\n\n if ($pool_arr != null)\n {\n while (isset($pool_arr['POOLS'][$i]))\n {\n $table .= process_pool_disp($pool_arr['POOLS'][$i], $edit);\n $i++;\n }\n }\n return $table;\n}",
"function &getAvailableQuestionpools($use_obj_id = false, $could_be_offline = false, $showPath = FALSE, $permission = \"read\")\n\t{\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php\";\n\t\treturn ilObjSurveyQuestionPool::_getAvailableQuestionpools($use_obj_id, $could_be_offline, $showPath, $permission);\n\t}",
"private function createProjectPool() {\n //TODO\n }",
"private function removeExpiredCarpools()\n {\n $this->db->query(CaronaDAO::QUERY_SET_EXPIRED_CARPOOLS);\n\n $this->db->execute();\n error_log(\"Erro: \" . $this->db->getError());\n\n }",
"function preparePool()\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t\t$this->checkForDistributionSpecificPackageFunction('PKG_preparePool', $I18N_distrHasNoFunctionForPreparingAPool);\n\t\n\t\t// Check, if there are errors (some can be generated by set functions)\n\t\tif (!$this->hasErrors())\n\t\t{\n\t\t\tPKG_preparePool($this->getPoolRelease(), $this->getPoolDistribution(), $this->getPoolArch(), $this->getPoolName(), $this->getPoolDir());\n\t\t\treturn(true);\n\t\t}\n\t\telse\n\t\t\treturn(false);\n\t}",
"public function keypoolrefill(){\n return $this->bitcoin->keypoolrefill();\n }",
"private function loadDistributors() {\n\t\t\n\t\t\t$sql = \"SELECT dst_id FROM dst_cmp WHERE cmp_id='$companyID'\";\n\t\t\t\n\t\t\t$rawResult = $gremlin->query($sql);\n\t\t\t\n\t\t\tforeach($rawResult as $newCont) {\n\t\t\t\n\t\t\t\t$newDist = new Company($newCont);\n\t\t\t\n\t\t\t\t$this->distributors[] = $newDist;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}",
"public function getSvrPool()\n {\n return $this->get(self::SVR_POOL);\n }",
"function delete_ip_pool() {\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"SELECT IP_POOL_ID from OLT_IP_POOLS where IP_POOL_ID = '$this->id'\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t\twhile ($row = $result->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\tif ($row[\"IP_POOL_ID\"])\r\n\t\t\t\t$error = (\"ERROR: THIS ip_pool IS ASSIGNED TO OLT, Please remove ip_pool from OLT and then try to Delete it again!\");\r\n\t\t\t\treturn $error;\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$conn->db->query(\"DELETE FROM IP_POOL where ID='$this->id'\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t}"
] | [
"0.6658752",
"0.6601869",
"0.6526298",
"0.6368762",
"0.61773854",
"0.6162004",
"0.6159385",
"0.6028109",
"0.5927746",
"0.59254056",
"0.59254056",
"0.59254056",
"0.59254056",
"0.59254056",
"0.59254056",
"0.59254056",
"0.5921524",
"0.5921524",
"0.5759101",
"0.57302046",
"0.5692695",
"0.56919336",
"0.56642854",
"0.56407005",
"0.5598263",
"0.55864656",
"0.5529127",
"0.54612404",
"0.5461104",
"0.5458859"
] | 0.6814248 | 0 |
/ charger les types de tickets | private function loadTicketTypes($clearbefore=0){
if ($clearbefore == 1){
updateQuery('truncate '.$this->tatickettype);
}
$wtpsi = $this->getAWTPSI();
$rs = $wtpsi->doGetTicketTypes(array());
foreach($rs as $i=>$o){
if ($o->NERRORNO != 0){
XLogs::critical(get_class($this)." erreur lecture des types de tickets : ${$o->SZERRORMESSAGE}");
continue;
}
// recherche du pool via projectno et persontypeno
$rs1 = selectQuery($this->dstapool->select_query(array('cond'=>array('prjno'=>array('=', $o->NPROJECTNO), 'poolno'=>array('=', $o->NPOOLNO)))));
if (!$rs1 || ($rs1->RowCount() == 0)){
// pool inconnu - devrait pas, on a deja charge les pools
XLogs::critical(get_class($this)." ticket type sur pool inconnu {$o->NPROJECTNO} {$o->NPOOLNO}");
continue;
}
$ors1 = $rs1->Fetch();
// recherche du type de ticket dans notre table
$rs2 = selectQuery($this->dstaticket->select_query(array('cond'=>array('tapool'=>array('=', $ors1['KOID']), 'ttno'=>array('=', $o->NTICKETTYPENO)))));
if ($rs2 && $rs2->RowCount() > 0){
// on a deja
} else {
$newoid = sprintf($this->tatickettype.':%06d', $o->NTICKETTYPENO); // erreur il faut le pool
$rsc = selectQueryGetAll('select koid from '.$this->tatickettype.' where koid=\''.$newoid.'\'');
if (count($rsc)>0){
$newoid = sprintf($this->tatickettype.':%06d%03d', $o->NTICKETTYPENO, $o->NPOOLNO);
}
// ajout
$nb = 0;
if (preg_match('/^([0-9]+).*$/', $o->SZTICKETTYPE, $resm)){
$nb = $resm[1];
}
$this->dstaticket->procInput(array('_options'=>array('local'=>true),
'newoid'=>$newoid,
'oid'=>$newoid,
'tapool'=>$ors1['KOID'],
'ttno'=>addslashes($o->NTICKETTYPENO),
'talabel'=>addslashes($o->SZTICKETTYPE),
'label'=>'',
'jours'=>$nb,
)
);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _getTicketTypes()\n {\n return [\n [\n 'label' => 'PayPal',\n 'value' => $this->Tickets->find('all')\n ->where([\n 'paid' => 1,\n 'type' => 'paypal'\n ])\n ->count()\n ], [\n 'label' => 'Permanence',\n 'value' => $this->Tickets->find('all')\n ->where([\n 'paid' => 1,\n 'type' => 'perm'\n ])\n ->count()\n ]\n ];\n }",
"protected function getTypes() {}",
"public function onGetTypes($type = null)\n\t{\n\t\t// The name of the hubtype\n\t\t$hubtype = 'ticket';\n\n\t\tif (isset($type) && $type == $hubtype)\n\t\t{\n\t\t\treturn $hubtype;\n\t\t}\n\t\telseif (!isset($type))\n\t\t{\n\t\t\treturn $hubtype;\n\t\t}\n\t}",
"public function geefTickets() {\n $klant_id = $_SESSION['gebruiker']->geefKlant_id();\n $sql = 'SELECT * FROM `tickets` WHERE `klant_id` = :klant_id';\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':klant_id', $klant_id);\n $stmnt->execute();\n $tickets = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Ticket');\n return $tickets;\n }",
"public function Tickets() {\n\t$filter = array(\"Status\"=>\"Open\");\n\treturn self::get_tickets($filter);\n\t\n \n \n \n \n\t}",
"public function geefEscalatiesTickets() {\n $klant_id = $_SESSION['gebruiker']->geefKlant_id();\n $sql = 'SELECT * FROM `tickets` WHERE `escalatie` != \"\" AND `klant_id` = :klant_id';\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':klant_id', $klant_id);\n $stmnt->execute();\n $tickets = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Ticket');\n return $tickets;\n }",
"public function get_types()\n {\n }",
"public function onTickettypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}",
"public function getTickets(){\n $sql = \"SELECT idChap, chapter, titleChap, DATE_FORMAT(dateChap, 'Le %d-%m-%Y à %k:%i') AS dateChap, DATE_FORMAT(dateChapUpdate, 'Le %d-%m-%Y à %k:%i') AS dateChapUpdate, contentChap FROM chapitres ORDER BY chapter DESC\";\n $tickets = $this->executeRequest($sql);\n return $tickets;\n }",
"public static function getTypes()\n {\n return TourType::find()\n ->where(['pid' => null]);\n }",
"public static function get_possible_types()\n {\n }",
"public static function get_possible_types()\n {\n }",
"public static function get_possible_types()\n {\n }",
"public function getByType($type)\n {\n return fractal($this->ticket->getTickets($type), new TicketTransformer)->toArray();\n }",
"public function equipment_type(){\n\t\t\t$equip_type_qry = $this->db->prepare(\"SELECT * FROM truck_type WHERE status = '1'\");\n\t\t\t$equip_type_qry->execute();\n\t\t\t$fetch= array();\n\t\t\twhile($equip_type_row = $equip_type_qry->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$fetch[]=$equip_type_row;\n\t\t\t}\n\t\t\treturn $fetch;\n\t\t}",
"function getTickets()\r\n\t{\r\n\t\t// get account tickets\r\n\t\treturn $this->call_API('getTickets');\r\n\t}",
"function getTypeslist ()\r\n\t{\r\n\t\t$query = 'SELECT id, name'\r\n\t\t\t\t. ' FROM #__flexicontent_types'\r\n\t\t\t\t. ' WHERE published = 1'\r\n\t\t\t\t. ' ORDER BY name ASC'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$types = $this->_db->loadObjectList();\r\n\t\treturn $types;\r\n\t}",
"public function geefGeslotenTickets() {\n $klant_id = $_SESSION['gebruiker']->geefKlant_id();\n $sql = 'SELECT * FROM `tickets` WHERE `status` = \"gesloten\" AND `klant_id` = :klant_id';\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':klant_id', $klant_id);\n $stmnt->execute();\n $tickets = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Ticket');\n return $tickets;\n }",
"public function getAllIssueTypes()\n { \n $this->uri = \"/rest/api/\".$this->getApiVersion().\"/issuetype/\";\n $this->method = \"GET\";\n }",
"public function getTissueTypesList() {\n return $this->_get(12);\n }",
"public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();",
"public static function getPriceTypes() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName('a.id', 'value'));\n\t\t$query->select($db->quoteName('a.name', 'text'));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_price_types', 'a'));\n\t\t\n\t\tif (JFactory::getUser()->guest) {\n\t\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t}\n\t\t\n\t\t$db->setQuery($query);\n\t\treturn $db->loadObjectList();\n\t}",
"function getProductTypes(){\n\t\t$id = $_GET['id'];\n\t\t$elem_id = $_GET['elem_id'];\n\t\t$wc = $this->getWc($id);\n\t\t$types = array();\n\t\tforeach ($wc as $k=>$v){\n\t\t\t$types[$v['ptid']] = true;\n\t\t}\n\t\tif ($elem_id){\n\t\t\t$elem = $this->getWc($id, $elem_id);\n\t\t\tunset($types[$elem['ptid']]);\n\t\t}\n\t\t$sql = \"SELECT id, name FROM product_types WHERE visible > 0 AND id NOT IN ('\".implode(\"', '\", array_keys($types)).\"')\";\n\t\t$rows = sql_getRows($sql, true);\n\t\treturn $rows;\n\t}",
"public function getValidTickets() {\n\n try {\n $select = $this->select()\n ->from(array('t' => 'ticket_system'), array('t.ticket_id', 't.code', 't.bonus_amt', 't.valid_from', 't.valid_upto', 't.limitation', 't.status'))\n ->setIntegrityCheck(false)\n ->joinLeft(array('con' => 'contests'), 't.ticket_id = con.ticket_id', array(\"con.con_status\"))\n ->where('con.con_status = ?', '0')\n ->order('t.ticket_id DESC');\n\n\n $result = $this->getAdapter()->fetchAll($select);\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n if ($result) :\n return $result;\n endif;\n\n\n\n // echo \"<pre>\"; print_r($result); echo \"</pre>\"; die;\n }",
"public static function getTypes($type) {\n switch($type) {\n case \"users\":\n $users_info = array(\"users_login\" => \"login\",\n \"password\" => \"password\",\n \"users_email\" => \"email\",\n \"language\" => \"languages_NAME\",\n \"users_name\" => \"name\",\n \"users_surname\" => \"surname\",\n \"active\" => \"active\",\n \"user_type\" => \"user_type\",\n \"registration_date\" => \"timestamp\");\n return $users_info;\n case \"users_to_courses\":\n return array(\"users_login\" => \"users_login\",\n \"courses_name\" => \"courses.name\",\n \"course_start_date\" => \"users_to_courses.from_timestamp\",\n \"course_user_type\" => \"users_to_courses.user_type\",\n \"course_completed\" => \"users_to_courses.completed\",\n \"course_comments\" => \"users_to_courses.comments\",\n \"course_score\" => \"users_to_courses.score\",\n \"course_active\" => \"users_to_courses.active\",\n \"course_end_date\" => \"users_to_courses.to_timestamp\");\n case \"users_to_groups\":\n return array(\"users_login\" => \"users_login\",\n \"group_name\" => \"groups.name\");\n }\n }",
"public function get_desired_types();"
] | [
"0.732879",
"0.6269827",
"0.6264867",
"0.62002033",
"0.61863744",
"0.61833805",
"0.6107673",
"0.60294855",
"0.60167056",
"0.6013962",
"0.59638894",
"0.59638894",
"0.59638894",
"0.59616095",
"0.593306",
"0.5914709",
"0.5898617",
"0.5890796",
"0.5847659",
"0.5806183",
"0.58031285",
"0.578291",
"0.578291",
"0.578291",
"0.578291",
"0.57726777",
"0.573957",
"0.57151026",
"0.5700354",
"0.5689065"
] | 0.6889689 | 1 |
/ charger les types de personnes | private function loadPersonTypes($clearbefore=0){
if ($clearbefore){
updateQuery('truncate '.$this->tapersontype);
}
$wtpsi = $this->getAWTPSI();
$rs = $wtpsi->doGetPersonTypes(array());
foreach($rs as $i=>$o){
if ($o->NERRORNO != 0){
XLogs::critical(get_class($this)." erreur lecture des types de personnes : ${$o->SZERRORMESSAGE}");
continue;
}
$newoid = sprintf($this->tapersontype.':%06d', $o->NPERSONTYPENO);
// recherche du type de personne via person type no
$rs1 = selectQuery($this->dstaperson->select_query(array('cond'=>array('ptno'=>array('=', $o->NPERSONTYPENO)))));
if ($rs1 && $rs1->RowCount() > 0){
// on a deja
} else {
// ajout
$this->dstaperson->procInput(array('_options'=>array('local'=>true),
'ptno'=>addslashes($o->NPERSONTYPENO),
'oid'=>$newoid,
'newoid'=>$newoid,
'talabel'=>addslashes($o->SZPERSONTYPE)
)
);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function erp_get_people_types() {\n return apply_filters( 'erp_people_types', [] );\n}",
"protected function getTypes() {}",
"public function get_types()\n {\n }",
"public function get_desired_types();",
"public static function get_possible_types()\n {\n }",
"public static function get_possible_types()\n {\n }",
"public static function get_possible_types()\n {\n }",
"public function iN_CreatorTypes() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_creators WHERE creator_status = '1'\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();",
"public function get_personnel_types()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('personnel_type_name', 'ASC');\n\t\t$query = $this->db->get('personnel_type');\n\t\t\n\t\treturn $query;\n\t}",
"public static function getTypes($type) {\n switch($type) {\n case \"users\":\n $users_info = array(\"users_login\" => \"login\",\n \"password\" => \"password\",\n \"users_email\" => \"email\",\n \"language\" => \"languages_NAME\",\n \"users_name\" => \"name\",\n \"users_surname\" => \"surname\",\n \"active\" => \"active\",\n \"user_type\" => \"user_type\",\n \"registration_date\" => \"timestamp\");\n return $users_info;\n case \"users_to_courses\":\n return array(\"users_login\" => \"users_login\",\n \"courses_name\" => \"courses.name\",\n \"course_start_date\" => \"users_to_courses.from_timestamp\",\n \"course_user_type\" => \"users_to_courses.user_type\",\n \"course_completed\" => \"users_to_courses.completed\",\n \"course_comments\" => \"users_to_courses.comments\",\n \"course_score\" => \"users_to_courses.score\",\n \"course_active\" => \"users_to_courses.active\",\n \"course_end_date\" => \"users_to_courses.to_timestamp\");\n case \"users_to_groups\":\n return array(\"users_login\" => \"users_login\",\n \"group_name\" => \"groups.name\");\n }\n }",
"public static function getTypes($type) {\n switch($type) {\n case \"users\":\n $users_info = array(\"users_login\" => \"login\",\n \"password\" => \"password\",\n \"users_email\" => \"email\",\n \"language\" => \"languages_NAME\",\n \"users_name\" => \"name\",\n \"users_surname\" => \"surname\",\n \"active\" => \"active\",\n \"user_type\" => \"user_type\",\n \"registration_date\" => \"timestamp\");\n return $users_info;\n case \"users_to_courses\":\n return array(\"users_login\" => \"users_login\",\n \"courses_name\" => \"course_name\",\n \"course_start_date\" => \"from_timestamp\",\n \"course_user_type\" => \"user_type\",\n \"course_completed\" => \"completed\",\n \"course_comments\" => \"comments\",\n \"course_score\" => \"score\",\n \"course_active\" => \"active\",\n \"course_end_date\" => \"to_timestamp\");\n case \"users_to_groups\":\n return array(\"users_login\" => \"users_login\",\n \"group_name\" => \"groups.name\");\n }\n }",
"public function list_of($type)\n {\n }",
"public static function getTypes();",
"function get_field_types()\n {\n }",
"public static function getUserTypeDescription()\n {\n $className = get_called_class();\n return array(\n 'PROPERTY_TYPE' => 'S',\n 'USER_TYPE' => self::USER_TYPE,\n 'DESCRIPTION' => 'Покупаемость',\n 'GetPublicEditHTML' => array($className, 'getPublicEditHTML'),\n 'GetPublicViewHTML' => array($className, 'getPublicViewHTML'),\n 'GetPropertyFieldHtml' => array($className, 'getPropertyFieldHtml'),\n 'GetAdminListViewHTML' => array($className, 'getAdminListViewHTML'),\n 'CheckFields' => array($className, 'checkFields'),\n 'GetLength' => array($className, 'getLength'),\n 'ConvertToDB' => array($className, 'convertToDB'),\n 'ConvertFromDB' => array($className, 'convertFromDB'),\n 'AddFilterFields' => array($className, 'addFilterFields'),\n );\n }",
"public function get_types()\n\t{\n\t\treturn array();\n\t}",
"protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }",
"public function getTypeUsers(){\n $query = \"SELECT * FROM rol\";\n return $this->consulta($query);\n }",
"public function getUserTypes()\n {\n $main_actions = [\n 'type' => \\adminer\\lang('Create type'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n ];\n\n // From db.inc.php\n $userTypes = \\adminer\\support(\"type\") ? \\adminer\\types() : [];\n $details = [];\n foreach($userTypes as $userType)\n {\n $details[] = [\n 'name' => \\adminer\\h($userType),\n ];\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }",
"private function loadTypes() {\n \n if(!empty($this->types)) return;\n \n $this->types = $this->doctrine\n ->getManager()\n ->getRepository('FenchyNoticeBundle:Type')\n ->getFilterTypes();\n }",
"public static function getCandidates($type);",
"function getType() ;",
"function getType() ;",
"function getType() ;",
"function getUserTypes() {\n return array(self::HOME => self::HOME,\n self::CLINIC => self::CLINIC);\n }",
"private function get_posted_person_types( $product ) {\n $post_data = wp_unslash( $_POST ); // phpcs:ignore\n $person_types = array();\n\n if ( isset( $post_data['person_id'] ) && isset( $post_data['_wc_booking_has_persons'] ) ) {\n $person_ids = $post_data['person_id'];\n $person_menu_order = $post_data['person_menu_order'];\n $person_name = $post_data['person_name'];\n $person_cost = $post_data['person_cost'];\n $person_block_cost = $post_data['person_block_cost'];\n $person_description = $post_data['person_description'];\n $person_min = $post_data['person_min'];\n $person_max = $post_data['person_max'];\n $max_loop = max( array_keys( $post_data['person_id'] ) );\n\n for ( $i = 0; $i <= $max_loop; $i ++ ) {\n if ( ! isset( $person_ids[ $i ] ) ) {\n continue;\n\t\t\t\t}\n $person_id = absint( $person_ids[ $i ] );\n $person_type = new \\WC_Product_Booking_Person_Type( $person_id );\n $person_type->set_props(\n array(\n 'name' => wc_clean( stripslashes( $person_name[ $i ] ) ),\n 'description' => wc_clean( stripslashes( $person_description[ $i ] ) ),\n 'sort_order' => absint( $person_menu_order[ $i ] ),\n 'cost' => wc_clean( $person_cost[ $i ] ),\n 'block_cost' => wc_clean( $person_block_cost[ $i ] ),\n 'min' => wc_clean( $person_min[ $i ] ),\n 'max' => wc_clean( $person_max[ $i ] ),\n 'parent_id' => $product->get_id(),\n )\n );\n $person_types[] = $person_type;\n }\n }\n return $person_types;\n }"
] | [
"0.71190315",
"0.6791145",
"0.6602424",
"0.65821797",
"0.6441488",
"0.6441488",
"0.6441488",
"0.63681716",
"0.63536155",
"0.63536155",
"0.63536155",
"0.63536155",
"0.622103",
"0.6186636",
"0.61758435",
"0.61592954",
"0.60903585",
"0.6069656",
"0.60397035",
"0.6015194",
"0.601241",
"0.6000981",
"0.5989597",
"0.59816927",
"0.59080696",
"0.5897819",
"0.58971316",
"0.589562",
"0.58707386",
"0.58706474"
] | 0.7029266 | 1 |
/ instace des WTPSI | function getAWTPSI(){
if ($this->wtps == NULL){
if ($this->wtpsiusecpny == 1){
$this->wtps = TAWTPSI::objectFactory(array('wsdl'=>$this->wtpsiwsdl,
'cpnylogin'=>1,
'username'=>$this->wtpsiusername,
'userpassword'=>$this->wtpsixmlpasswd,
'wtplogin'=>$this->wtpsiwtplogin,
'wtpusername'=>$this->wtpsicontactuser,
'wtppassword'=>$this->wtpsicontactpasswd
));
} else {
$this->wtps = TAWTPSI::objectFactory(array('user'=>$this->wtpsiwtplogin,
'pwd'=>$this->wtpsicontactpasswd,
'wsdl'=>$this->wtpsiwsdl));
}
}
return $this->wtps;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAWTPSIAddsOn(){\n if ($this->wtpsaddson == NULL){\n $this->wtpsaddson = TAWTPSIAddsOn::objectFactory(array('user'=>$this->wtpsiwtplogin,\n 'pwd'=>$this->wtpsicontactpasswd,\n 'wsdl'=>$this->wtpsiaddonswsdl));\n }\n return $this->wtpsaddson;\n }",
"public function __construct() {\n\t\n parent::__construct();\n\t\t\n self::_initTags(); //extend ipp server tags\t\t\t\n\t\t\n\t\t$this->server_version = '1.0'; //IPP server version\n\t\t$this->ipp_version = '1.0'; //1.1 or 1.0\n\t\t$this->ipp_version_auto = true; //auto change ipp version depending on ipp client\n\t\t\n\t\tswitch ($this->ipp_version) {\n\t\t case '1.1' : $this->ipp_version_x8 = chr(0x01) . chr(0x01); \n\t\t break;\n\t\t case '1.0' :\n\t\t default :\n\t\t $this->ipp_version_x8 = chr(0x01) . chr(0x00);//'1.0';//NOT 1.1 ..WILL NOT WORK IN WINDOWS\n\t\t}\n\t\t\n\t\t$this->clientoutput = new stdClass();\t\t\n }",
"function __construct() {\n\t\t$wsdlURL = \"https://hc.mercurydev.net/tws/transactionservice.asmx?WSDL\";\n\t\t$this->wsClient = new SoapClient($wsdlURL);\n\t}",
"function qmwConnect() {\n\ttry {\n\t\t$soap = new PerceptionSoap($GLOBALS['CFG']->perception_server_domain, array(\n\t\t\t\t\"qmwise_webshare_name\"\t\t=>\t$GLOBALS['CFG']->perception_webshare,\n\t\t\t\t\"perception_server_port\"\t=>\t$GLOBALS['CFG']->perception_hostport,\n\t\t\t\t\"security_client_id\"\t\t=>\t$GLOBALS['CFG']->perception_use_security ? $GLOBALS['CFG']->perception_client_id : null,\n\t\t\t\t\"security_checksum\"\t\t\t=>\t$GLOBALS['CFG']->perception_use_security ? $GLOBALS['CFG']->perception_checksum : null,\n\t\t\t\t\"trust_use\"\t\t\t\t\t=>\t$GLOBALS['CFG']->perception_use_trust,\n\t\t\t\t\"trust_key\"\t\t\t\t\t=>\t$GLOBALS['CFG']->perception_use_trust ? $GLOBALS['CFG']->perception_trustedkey : null,\n\t\t\t\t\"trust_encoding\"\t\t\t=>\t$GLOBALS['CFG']->perception_encoding,\n\t\t\t\t\"debug\"\t\t\t\t\t\t=>\t$GLOBALS['CFG']->debug\t\t\t\t\n\t\t\t));\n\t\treturn $soap;\n\t} catch(Exception $e) {\n\t\tthrow $e;\n\t}\n}",
"public function __construct()\n\t\t{\n\t\t\t// Setup the required variables for the Protx Vps Direct checkout module\n\n\t\t\t$this->_languagePrefix = \"ProtxVspDirect\";\n\t\t\t$this->_id = \"checkout_vspdirect\";\n\t\t\t$this->_image = \"protx_logo.gif\";\n\n\t\t\tparent::__construct();\n\n\t\t\t$this->requiresSSL = true;\n\t\t\t$this->_currenciesSupported = array(\"GBP\");\n\t\t\t$this->_cardsSupported = array ('VISA','AMEX','MC', 'DINERS', 'DISCOVER', 'SOLO','MAESTRO','SWITCH','LASER');\n\t\t\t$this->_liveTransactionURL = 'https://ukvps.protx.com';\n\t\t\t$this->_testTransactionURL = 'https://ukvpstest.protx.com';\n\t\t\t$this->_liveTransactionURI = '/vspgateway/service/vspdirect-register.vsp';\n\t\t\t$this->_testTransactionURI = '/vspgateway/service/vspdirect-register.vsp';\n\t\t\t$this->_curlSupported = true;\n\t\t\t$this->_fsocksSupported = true;\n\t\t}",
"public function _construct()\n {\n $this->_init('wsu_taxtra/taxtrareports');\n }",
"public function __construct() {\n $this->xot = XotData::make();\n $this->register_type = (string) $this->xot->register_type;\n }",
"function ClienteWSInmuebles(){\n $this->auth = new ClienteWSAuthAgencia();\n }",
"public function __construct()\n\t{\n\t\t$this->api = new ApiDirect('fio');\n\n\t}",
"public function __construct() {\n $this->server = new nusoap_server();\n // Define the method as a PHP function\n }",
"public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }",
"public function initOptions() {\n parent::initOptions();\n $this->_options->setOpt(\"WTPSI Company ID\",'wtpsicpnyid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI XML ID\",'wtpsixmlid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI UserName\",'wtpsiusername','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Password\",'wtpsixmlpasswd','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WTP Login\",'wtpsiwtplogin','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI User Contact\",'wtpsicontactuser','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Contact Password \",'wtpsicontactpasswd','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI POSNO \",'wtpsiposno','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"Utiliser le login company\",'wtpsiusecpny','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WSDL \",'wtpsiwsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Add-Ons WSDL \",'wtpsiaddonswsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP : allproj\",'wtpvalidationallproj','boolean',array('compulsory'=>true), false ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP 64 bits\", 'wtp64bits', 'boolean',array('compulsory'=>true), false ,'EPassLibre');\n }",
"function wc_pip() {\n\n\treturn \\WC_PIP::instance();\n}",
"public function Create() {\n\t\tparent::Create();\t\n\t\t//These lines are parsed on Symcon Startup or Instance creation\n\t\t//You cannot use variables here. Just static values.\n\t\t$this->RegisterPropertyString(\"login\", \"\");\t\t\n\t\t$this->RegisterPropertyString(\"password\", \"\");\n\t\t$this->RegisterPropertyString(\"user\", \"\");\n\t\t$this->RegisterPropertyString(\"serverversion\", \"exV15\");\n\t\t$this->RegisterPropertyString(\"host\", \"\");\n\t\t$this->RegisterPropertyString(\"search\", \"URLAUB!!!, Urlaub!!!, Urlaub !!!, URLAUB !!!, Urlaub, URLAUB, Vacation - Confirmed\");\n\t\t$this->RegisterPropertyString(\"timeframe\", \"today\");\n\t\t$this->RegisterPropertyString(\"starttime\",\"00:00:00\");\n\t\t$this->RegisterPropertyString(\"endtime\",\"23:59:00\");\n\t}",
"public function init()\n {\n\t\t$this->_temporizador = new Trf1_Admin_Timer ();\n\t\t$this->_temporizador->Inicio ();\n\t\t\n $this->view->titleBrowser = 'e-Sosti';\n }",
"function __construct($trumpia_xml)\n\t{\n\t\techo \"xml string is valid<br>\";\n\t\t$this->time_stamp = date(\"m-d-Y H:i:s\");\n\t\t$this->push_id = $trumpia_xml->PUSH_ID[0];\n\t\t$this->inbound_id = $trumpia_xml->INBOUND_ID[0];\n\t\t$this->subscription_uid = $trumpia_xml->SUBSCRIPTION_UID[0];\n\t\t$this->phone_number = $trumpia_xml->PHONENUMBER[0];\n\t\t$this->keyword = $trumpia_xml->KEYWORD[0];\n\t\t$this->data_capture = $trumpia_xml->DATA_CAPTURE[0];\n\t\t$this->contents = $trumpia_xml->CONTENTS[0];\n\t\t$this->attachment = $trumpia_xml->ATTACHMENT[0];\n\t\t$this->dataset_id = $trumpia_xml->DATASET_ID[0];\n\t\t$this->dataset_name = $trumpia_xml->DATASET_NAME[0];\t\n\t}",
"public function __construct($ifspParam){\n $this->ifsp = $ifspParam;\n }",
"public function init()\n {\n $this->wxService = new WxService();\n parent::init();\n }",
"function wtsCheckWTP($ar){\n $p = new XParam($ar, array('mode'=>'a', 'b'=>0, 'f'=>1));\n $mode = $p->get('mode');\n $bonus = $p->get('b');\n $fidelite = $p->get('f');\n $chipid = $p->get('chipid');\n $accno = $p->get('accno');\n $crc = $p->get('crc');\n // cas ski data à faire (? non fait !)\n $wtp = strtoupper($chipid.'-'.$crc.'-'.$accno);\n $r = array('ok'=>0, 'bonus'=>array('points'=>0, 'jours'=>0));\n\n $kwtp = $this->modresort->knownEPLWTP(array($chipid, $crc, $accno));\n if ($kwtp['ok'] == 1 && $this->modresort->expiredWTP($wtp)){\n $r['ok'] = 0;\n $r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_wtpexpire');\n }\n // wtp valide : points bonus eventuels - ceux du panier si il y en a\n if ($kwtp['ok'] == 1){\n $r['ok'] = 1;\n if ($bonus == 1 && $kwtp['eplwtpoid'] != NULL){\n $rs = $this->modloyalty->getCardPoints($kwtp['eplwtpoid']);\n $r['bonus']['points'] = $rs['points'];\n $caddie = $this->getCaddie();\n if (isset($caddie['bonusbycards'][$wtp])){\n $jours = $caddie['bonusbycards'][$wtp];\n if ($jours > 0){\n $jpoints = $this->modloyalty->getPointsFromJours($jours);\n $r['bonus']['points'] = $r['bonus']['points'] - $jpoints;\n }\n }\n $r['bonus']['jours'] = $this->modloyalty->getJoursBonus($r['bonus']['points']);\n }\n if ($this->modresort->expiredWTP($wtp)){\n\t$r['ok'] = 0;\n\t$r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_wtpexpire');\n }\n } else {\n // check de la carte 'temoin' pour assurer que c'est pas service indisponible\n if (defined('EPL_TA_CHECKWTPCARD')){\n\tif (!$this->modresort->checkWTP(explode('-', EPL_TA_CHECKWTPCARD))){\n\t $r['errormess'] = $GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_serviceindisponible');\n\t if (empty($r['errormess']))\n\t $r['errormess'] = '[Service indisponible, veuillez réessayer dans quelques instants]';\n\t $r['ok'] = 0;\n\t}\n }\n }\n if ($mode == 'a')\n die(json_encode($r));\n return $r;\n }",
"public function Create() {\n parent::Create();\n\n\t\t\t$this->RegisterPropertyString(\"Password\", \"\");\n\n\t\t\t$this->RegisterPropertyString(\n\t\t\t\t'RadioStations', '[{\"position\":1,\"station\":\"NDR2 Niedersachsen\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/800c150e9a6b16078a4a3b3b5aee0672\"},\n\t\t\t\t{\"position\":2,\"station\":\"MDR Jump\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/0888328132708be0905731457bba8ae0\"},\n\t\t\t\t{\"position\":3,\"station\":\"Inselradio Mallorca\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/14f799071150331b9a7994ca8c61f8c7\"}]'\n );\n\n $this->RegisterPropertyBoolean(\"HideVolume\",false);\n $this->RegisterPropertyBoolean(\"HideTitle\",false);\n $this->RegisterPropertyBoolean(\"HideTimeElapsed\",false);\n\n\t\t\t$this->RegisterTimer(\"KeepAliveTimer\", 1000, 'MPDP_KeepAlive($_IPS[\\'TARGET\\']);');\n\t\t}",
"public function __construct($_regType = NULL,$_regDt = NULL,$_dtType = NULL,$_postAddr = NULL,$_regStatusCode = NULL,$_registrationNum = NULL,$_message = NULL)\n {\n MicrobiltWsdlClass::__construct(array('RegType'=>$_regType,'RegDt'=>$_regDt,'DtType'=>$_dtType,'PostAddr'=>$_postAddr,'RegStatusCode'=>$_regStatusCode,'RegistrationNum'=>$_registrationNum,'Message'=>$_message),false);\n }",
"function __construct() {\n\t\tWP_Http::_getTransport();\n\t\tWP_Http::_postTransport();\n\t}",
"public function __construct()\n\t{\n\t\t$this->registry\t\t= ipsRegistry::instance();\n\t\t$this->DB\t\t\t= $this->registry->DB();\n\t\t$this->settings\t\t=& $this->registry->fetchSettings();\n\t\t$this->lang\t\t\t= $this->registry->getClass('class_localization');\n\t}",
"static function generarServicioL($par){\n\n\t\tif($par==\"T\"){\n\t\trequire_once('../SERVIDOR/lib/nusoap.php');\n\t\t}else{\n\t\trequire_once('SERVIDOR/lib/nusoap.php');\n\t\t}\n\n\t\t$host = 'http://localhost/Final2k16/SERVIDOR/ws.php?wsdl';\t\n \n $client = new nusoap_client($host);\n $err = $client->getError();\n if ($err) {\n die();\n return '<h2>ERROR EN LA CONSTRUCCION DEL WS:</h2><pre>' . $err . '</pre>';\n }\n return $client;\n\n\t}",
"public function Create()\n {\n parent::Create();\n \n //These lines are parsed on Symcon Startup or Instance creation\n //You cannot use variables here. Just static values.\n $this->RegisterPropertyString(\"IPAddress\", \"\");\n $this->RegisterPropertyInteger(\"DefaultVolume\", 15);\n $this->RegisterPropertyBoolean(\"GroupCoordinator\", false);\n $this->RegisterPropertyBoolean(\"GroupForcing\", false);\n $this->RegisterPropertyBoolean(\"MuteControl\", false);\n $this->RegisterPropertyBoolean(\"LoudnessControl\", false);\n $this->RegisterPropertyBoolean(\"BassControl\", false);\n $this->RegisterPropertyBoolean(\"TrebleControl\", false);\n $this->RegisterPropertyString(\"FavoriteStation\", \"\");\n $this->RegisterPropertyString(\"WebFrontStations\", \"<all>\");\n $this->RegisterPropertyString(\"RINCON\", \"\");\n \n }",
"private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n // for TYPO3 3.8.0+: enable storage of last built SQL query in $this->debug_lastBuiltQuery for all query building functions of class t3lib_DB\n $this->store_lastBuiltQuery = true;\n \n // get basic extension configuration incl. GSA DB access data from localconf.php (extension configuration in Extension Manager)\n $extConfArr = tx_pttools_div::returnExtConfArray('pt_gsasocket');\n \n $this->logEnabled = $extConfArr['logEnabled'];\n $this->logDirPath = $extConfArr['logDirPath'];\n $this->logAdminEmail = $extConfArr['logAdminEmail'];\n $this->logHostName = $extConfArr['logHostName'];\n if (isset($extConfArr['useGsaTablesInTypo3Database'])) {\n $this->useGsaTablesInTypo3Database = (boolean)$extConfArr['useGsaTablesInTypo3Database'];\n }\n \n // get database connection data\n if ($extConfArr['useGsaTablesInTypo3Database'] == false) {\n // use external GSA database\n $this->host = $extConfArr['dbGSAhost'];\n $this->database = $extConfArr['dbGSAname'];\n $this->user = $extConfArr['dbGSAuser']; \n $this->pass = $extConfArr['dbGSApwd'];\n // allow individual database intialization\n $TYPO3setDBinit = $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']; \n $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] = $extConfArr['dbGSAsetDBinit']; // this will be used now for GSA DB initialization in t3lib_db::sql_pconnect() below\n } else {\n // use TYPO3 database (constants used below are defined in t3lib/config_default.php)\n $this->host = TYPO3_db_host;\n $this->database = TYPO3_db;\n $this->user = TYPO3_db_username; \n $this->pass = TYPO3_db_password;\n }\n \n // connect to database server and select database\n tx_pttools_assert::isNotEmptyString($this->host, array('message'=>'No database host found for GSA DB.'));\n tx_pttools_assert::isNotEmptyString($this->database, array('message'=>'No database name found for GSA DB.'));\n tx_pttools_assert::isNotEmptyString($this->user, array('message'=>'No database user found for GSA DB.')); // note: password my be empty, this is not an error\n $php_errormsg = '';\n $this->connection = @$this->sql_pconnect($this->host, $this->user, $this->pass);\n if ($this->connection == false) {\n throw new tx_pttools_exception('Could not connect to database server', 0, $php_errormsg);\n }\n $this->selectDbResult = $this->sql_select_db($this->database);\n if ($this->selectDbResult == false) {\n throw new tx_pttools_exception('Could not select database', 1, $this->sql_error());\n }\n \n // trace results\n trace('Connected successfully to GSA-DB: '.($extConfArr['useGsaTablesInTypo3Database'] == true ? '***** Using TYPO3 DB for GSA tables! *****' : 'Using additional GSA database.'));\n trace($this->connection, 0, '$this->connection');\n trace($this->selectDbResult, 0, '$this->selectDbResult');\n \n // re-set original TYPO3 database intialization if overwritten for an external GSA database\n if ($extConfArr['useGsaTablesInTypo3Database'] == false) {\n $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] = $TYPO3setDBinit; // perform all other connects with original TYPO3 setting\n }\n \n }",
"function AGILETELECOM()\n {\n Provider::Provider(); //call base class constructor\n $this->_name = 'AGILETELECOM';\n $this->_file = basename( __FILE__ );\n\n $this->_params['smstype']\t\t= 'file.sms'; //default params\n $this->_params['smsgateway'] \t= 'H'; \t\t//default params\n\t\t$this->_params['smsuser'] \t\t= 'user'; \t//default params\n\t\t$this->_params['smspassword']\t= 'password'; //default params\n }",
"function __construct($username, $password, $wsdl) {\r\n\t\t\t$this->_username=$username;\r\n\t\t\t$this->_password=$password;\r\n\t\t\t$this->_wsdl = $wsdl;\r\n\t\t\t\r\n\t\t\t// Setting up SOAP ready headers with authentication\r\n\t\t\t$WSSEAuth = new SoapVar(array('ns1:Username' => $this->_username,'ns1:Password' => $this->_password),\r\n\t\t\t\t\t\t\t\t\tSOAP_ENC_OBJECT,NULL,$this->_strWSSENS,NULL, $this->_strWSSENS);\r\n\t\t\t$WSSEToken = new clsWSSEToken($WSSEAuth);\r\n\t\t\t$SoapVarWSSEToken = new SoapVar($WSSEToken,SOAP_ENC_OBJECT,NULL,$this->_strWSSENS,NULL,$this->_strWSSENS);\r\n\t\t\t$SoapVarHeaderVal=new SoapVar($SoapVarWSSEToken,SOAP_ENC_OBJECT,NULL,$this->_strWSSENS,NULL,$this->_strWSSENS);\r\n\t\t\t$SoapHeader = new SoapHeader($this->_strWSSENS,'Security',$SoapVarHeaderVal,true);\r\n\t\t\t\r\n\t\t\t$context = stream_context_create(array(\r\n\t\t 'ssl' => array(\r\n\t\t 'verify_peer' => false,\r\n\t\t 'verify_peer_name' => false,\r\n\t\t 'allow_self_signed' => true\r\n\t \t\t \t)\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t// Creating the SOAP client \r\n\t\t\t$this->_SoapClient = new SoapClient($this->_wsdl, array(\r\n\t\t\t\t\"trace\" => 1, \r\n\t\t\t\t\"stream_context\" => $context\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t$this->_SoapClient->__setSoapHeaders(array($SoapHeader));\r\n\t\t}",
"public function init() {\n\t\t$this->_temporizador = new Trf1_Admin_Timer ();\n\t\t$this->_temporizador->Inicio ();\n\t\t\n $this->view->titleBrowser = 'e-Sosti - Sistema de Atendimento a Solicitações de TI';\n $this->view->module = $this->getRequest()->getModuleName();\n $this->view->controller = $this->getRequest()->getControllerName();\n $this->view->action = $this->getRequest()->getActionName();\n }",
"public function __construct() {\n\t\tself::$IP = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : \"127.0.0.1\"; \t\t\n\t\tself::$SETTINGS = array(\n\t\t\tnew SecuritySetting(1, \"SITE_LOAD\", 20, \"1 MINUTE\"),\n\t\t\tnew SecuritySetting(2, \"ACTION_HANDLER\", 15, \"1 MINUTE\"),\n\t\t\tnew SecuritySetting(3, \"LOGIN_ATTEMPT\", 7, \"10 MINUTE\"),\n\t\t\tnew SecuritySetting(4, \"EMAIL\", 5, \"1 MINUTE\"),\n\t\t\tnew SecuritySetting(5, \"CHANGE_PASSWORD\", 5, \"20 MINUTE\"),\n\t\t\tnew SecuritySetting(6, \"REGISTRATIONS\", 15, \"30 MINUTE\"),\n\t\t\tnew SecuritySetting(7, \"FORUM_POST\", 5, \"30 SECOND\"),\n\t\t\tnew SecuritySetting(8, \"MESSAGE_CENTRE\", 10, \"1 MINUTE\")\n\t\t);\n\t}"
] | [
"0.61785626",
"0.55700535",
"0.55467254",
"0.55089617",
"0.5493206",
"0.54186076",
"0.53854",
"0.53367203",
"0.532515",
"0.53076303",
"0.5287357",
"0.52626115",
"0.52144355",
"0.51818913",
"0.5180667",
"0.5177764",
"0.51580375",
"0.5153518",
"0.51520914",
"0.51497084",
"0.5120447",
"0.512015",
"0.5111752",
"0.5101447",
"0.5099174",
"0.5094452",
"0.508737",
"0.50848955",
"0.5078817",
"0.5067151"
] | 0.7157683 | 0 |
/ instace des WTPSI AddOns | function getAWTPSIAddsOn(){
if ($this->wtpsaddson == NULL){
$this->wtpsaddson = TAWTPSIAddsOn::objectFactory(array('user'=>$this->wtpsiwtplogin,
'pwd'=>$this->wtpsicontactpasswd,
'wsdl'=>$this->wtpsiaddonswsdl));
}
return $this->wtpsaddson;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct() {\n $this->plugin_dir = plugin_dir_path(__FILE__);\n $this->icon_dir = $this->plugin_dir . 'images/icons/';\n\n $this->plugin_url = plugins_url('',__FILE__);\n $this->icon_url = $this->plugin_url . 'images/icons/';\n $this->admin_page = admin_url() . 'admin.php?page=' . $this->plugin_dir;\n\n $this->base_name = plugin_basename(__FILE__);\n\n $this->prefix = ADPRESS_PREFIX;\n\n $this->_configure();\n $this->_includes();\n \n // Extra help : attach the packages\n //\n $this->wpcsl->extrahelp = new ADPRESS_Extra_Help(\n array(\n 'parent' => $this->wpcsl\n )\n ); \n }",
"function wdtAddOnsEnqueue()\n{\n WDTTools::wdtUIKitEnqueue();\n\n wp_enqueue_style('wdt-add-ons-css', WDT_CSS_PATH . 'admin/addons.css', array(), WDT_CURRENT_VERSION);\n\n wp_enqueue_script('wdt-common');\n wp_enqueue_script('wdt-doc-js');\n wp_enqueue_script('wdt-addons-tms-store-checkout', WDT_JS_PATH . 'wpdatatables/wdt.store.checkout.js', array('jquery'), 1.12, true);\n\n wp_localize_script('wdt-addons-tms-store-checkout', 'tmsStore', ['url' => WDT_STORE_URL]);\n}",
"public function winespace_welcome_addons() {\n\t\trequire_once( get_template_directory() . '/inc/admin/welcome-screen/sections/add-ons.php' );\n\t}",
"public static function init() {\n\t\tadd_filter('gb_addons', array(get_class(),'gb_merchant_meta_addon'), 10, 1);\n\t}",
"public function init() {\n\n\t\t\t// WPML String Translation plugin exist check\n\t\t\tif ( defined( 'WPML_ST_VERSION' ) ) {\n\t\t\t\tadd_filter( 'wpml_elementor_widgets_to_translate', array( $this, 'add_translatable_nodes' ) );\n\t\t\t\tadd_filter( 'jet-woo-builder/current-template/template-id', array( $this, 'jet_woo_builder_modify_template_id' ) );\n\t\t\t}\n\n\t\t\t// Polylang Translation plugin exist check\n\t\t\tif ( class_exists( 'Polylang' ) ) {\n\t\t\t\trequire jet_woo_builder()->plugin_path( 'includes/lib/compatibility/packages/polylang.php' );\n\t\t\t}\n\n\t\t}",
"static protected function setup_extensions()\n\t{\n\t\treturn array('anavaro/eventmedals');\n\t}",
"public function init() {\n\t\t$this->define_constants();\n\t\t$this->load_dependencies();\n\t\tdo_action( 'wprmprc_init' );\n\t\tadd_filter( 'wprm_addon_active', array( $this, 'addon_active' ), 10, 2 );\n\t}",
"function customs()\n\t{\n\t\t$custom = $this->ipsclass->load_class( ROOT_PATH.'mod_install/'.$this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'].'.php', $this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'] );\n\t\t$custom->xml_array =& $this->xml_array;\n\t\t\n\t\tif ( $this->ipsclass->input['un'] )\n\t\t{\n\t\t\t$custom->uninstall();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$custom->install();\n\t\t}\n\t}",
"public function __construct() {\n\n\t\t// Define constants\n\t\tadd_action( 'plugins_loaded', array( &$this, 'wpl_toolskit_define_constants' ), 1 );\n\n\t\t// Load language file\n\t\tadd_action( 'plugins_loaded', array( &$this, 'wpl_toolskit_load_textdomain' ), 2 );\n\n\t\tadd_action( 'after_setup_theme', array( &$this, 'wpl_toolskit_includes'), 3 );\n\n\t\tadd_action( 'after_setup_theme', array( &$this, 'wpl_toolskit_instances'), 4 );\n\t\t\n\t\t// Add Setings Link\n\t\tadd_filter( 'plugin_action_links_'.plugin_basename(__FILE__), array( &$this, 'wpl_toolskit_links' ), 1 );\n\n\t}",
"function tb_addTagBeepToWpAdmin() { \r\n //add in /settings manu\r\n add_options_page(\"tagBeep uptime\", \"tagBeep uptime\", 8, \"tagBeepUptimeMonitor\", \"tb_load_tagBeepAdmin\"); \r\n //add in the /plugins menu\r\n add_plugins_page(\"tagBeep uptime\", \"tagBeep uptime\", 8, \"tagBeepUptimeMonitorPlugin\", \"tb_load_tagBeepAdmin\"); \r\n}",
"function owa_install() {\r\n\r\n\tdefine('OWA_INSTALLING', true);\r\n\t\r\n\t$params = array();\r\n\t//$params['do_not_fetch_config_from_db'] = true;\r\n\r\n\t$owa = owa_getInstance($params);\r\n\t$owa->setSetting('base', 'cache_objects', false);\t\r\n\t$public_url = get_bloginfo('wpurl').'/wp-content/plugins/owa/';\r\n\t\r\n\t$install_params = array('site_id' => md5(get_settings('siteurl')), \r\n\t\t\t\t\t\t\t'name' => get_bloginfo('name'),\r\n\t\t\t\t\t\t\t'domain' => get_settings('siteurl'), \r\n\t\t\t\t\t\t\t'description' => get_bloginfo('description'),\r\n\t\t\t\t\t\t\t'action' => 'base.installEmbedded',\r\n\t\t\t\t\t\t\t'db_type' => 'mysql',\r\n\t\t\t\t\t\t\t'db_name' => DB_NAME,\r\n\t\t\t\t\t\t\t'db_host' => DB_HOST,\r\n\t\t\t\t\t\t\t'db_user' => DB_USER,\r\n\t\t\t\t\t\t\t'db_password' => DB_PASSWORD,\r\n\t\t\t\t\t\t\t'public_url' => $public_url\r\n\t\t\t\t\t\t\t);\r\n\t\r\n\t$owa->handleRequest($install_params);\r\n}",
"function __construct() {\r\n\t\t/**\tAppel des scripts et styles pour le module digirisk dans la partie administration / Include styles and scripts for backend\t*/\r\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'admin_assets' ) );\r\n\t\t/**\tAppel des scripts communs pour le module digirisk / Include common styles and scripts\t*/\r\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'common_js' ) );\r\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'common_js' ) );\r\n\r\n\t\t/*\tCréation du menu dans l'administration pour le module digirisk / Create the administration menu for digirisk plugin */\r\n\t\tadd_action('admin_menu', array( &$this, 'admin_menu' ) );\r\n\r\n\t\t/**\tAppel des scripts de mise à jour automatique de la base de données / Call automatic database structure update\t*/\r\n\t\tif ( digirisk_options::getDbOption('base_evarisk') > 1 ) {\r\n\t\t\tadd_action('admin_init', array( 'digirisk_install', 'update_digirisk' ) );\r\n\t\t}\r\n\t}",
"public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}",
"public function initOptions() {\n parent::initOptions();\n $this->_options->setOpt(\"WTPSI Company ID\",'wtpsicpnyid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI XML ID\",'wtpsixmlid','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI UserName\",'wtpsiusername','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Password\",'wtpsixmlpasswd','text',array('compulsory'=>false), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WTP Login\",'wtpsiwtplogin','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI User Contact\",'wtpsicontactuser','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Contact Password \",'wtpsicontactpasswd','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI POSNO \",'wtpsiposno','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"Utiliser le login company\",'wtpsiusecpny','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI WSDL \",'wtpsiwsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"WTPSI Add-Ons WSDL \",'wtpsiaddonswsdl','text',array('compulsory'=>true), NULL ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP : allproj\",'wtpvalidationallproj','boolean',array('compulsory'=>true), false ,'EPassLibre');\n $this->_options->setOpt(\"VALIDATION des WTP 64 bits\", 'wtp64bits', 'boolean',array('compulsory'=>true), false ,'EPassLibre');\n }",
"private function __construct() {\n\t\t$plugin = Tribe__Events__Main::instance();\n\n\t\tadd_action( 'admin_menu', array( $this, 'register_menu_item' ) );\n\t\tadd_action( 'current_screen', array( $this, 'action_request' ) );\n\t\tadd_action( 'init', array( $this, 'init' ) );\n\n\t\t// check if the license is valid each time the page is accessed\n\t\tadd_action( 'tribe_aggregator_page_request', array( $this, 'check_for_license_updates' ) );\n\n\t\t// filter the plupload default settings to remove mime type restrictions\n\t\tadd_filter( 'plupload_default_settings', array( $this, 'filter_plupload_default_settings' ) );\n\n\t\t// Setup Tabs Instance\n\t\t$this->tabs = Tribe__Events__Aggregator__Tabs::instance();\n\n\t\ttribe_notice( 'tribe-aggregator-legacy-import-plugins-active', array( $this, 'notice_legacy_plugins' ), 'type=warning' );\n\t}",
"public function action_init()\n\t{\n\t\t$this->add_template( 'addon_preview', dirname(__FILE__) . '/templates/addon_preview.php' );\n\t\t$this->add_template( 'addon', dirname(__FILE__) . '/templates/addon.php' );\n\t\t\n\t\t$this->add_rule('\"retrieve_addonlist\"', 'retrieve_addonlist');\n\t\t$this->add_rule('\"install_addons\"', 'install_addons');\n\n\t}",
"public function addExtAddon($addon);",
"function setup() {\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 21 );\n\t\tadd_action( 'admin_init', array( $this, 'maybe_add_pagination' ) );\n\n\t\tadd_action( 'appthemes_addons_mp_popular', array( $this, 'display_addons_mp_table' ), 10, 2 );\n\t\tadd_action( 'appthemes_addons_mp_new', array( $this, 'display_addons_mp_table' ), 10, 2 );\n\t\tadd_action( 'appthemes_addons_mp_updated', array( $this, 'display_addons_mp_table' ), 10, 2 );\n\t}",
"function get_entry_points()\n\t{\n\t\treturn array('misc'=>'XML_DATA_MANAGEMENT');\n\t}",
"function wlms_plugin_install()\n{\n wlms_create_table();\n wlms_settings_data();\n}",
"function mediawikiinstall($o){\n\t\n\t\t//$o->extract(\"confirmaccount\", \"extensions/\");\n\t\t$o->sr(\"LocalSettings.php\", \"#Add\\s*more\\s*configuration\\s*options\\s*below.#\", \"End of automatically generated settings. \\n\\n \\$wgGroupPermissions['*']['edit'] = false; \\n\\n \\$wgGroupPermissions['*']['createpage'] = false; \\n\\n \\$wgEmailConfirmToEdit = true;\");\n\t}",
"function register_vc_add_on(){\r\n\r\n vc_map( array(\r\n \"name\" => $this->name,\r\n \"base\" => $this->id,\r\n \"icon\" => $this->icon,\r\n \"description\" => $this->description,\r\n \"weight\" => 1,\r\n\r\n \"wrapper_height\"=> 'full',\r\n\r\n \"category\" => __( 'BetterMag Addons', 'better-studio' ),\r\n \"params\" => array(\r\n\r\n array(\r\n \"type\" => 'textfield',\r\n \"admin_label\" => true,\r\n \"heading\" => __( 'Title', 'better-studio' ),\r\n \"param_name\" => 'title',\r\n \"value\" => $this->defaults['title'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"heading\" => __( 'Show Title?', 'better-studio'),\r\n \"param_name\" => 'show_title',\r\n \"value\" => $this->defaults['show_title'],\r\n ),\r\n array(\r\n 'heading' => __( 'Instructions', 'better-studio' ),\r\n 'param_name' => 'help',\r\n 'type' => 'bf_info',\r\n 'value' => __('<ol>\r\n <li>Copy the link to you facebook page</li>\r\n <li>Paste it in the \"Link to you Facebook page\" input box below</li>\r\n </ol>\r\n ', 'better-studio' ),\r\n 'state' => 'open',\r\n 'info-type' => 'help',\r\n 'section_class' => 'widefat',\r\n ),\r\n array(\r\n \"type\" => 'textfield',\r\n \"admin_label\" => true,\r\n \"heading\" => __( 'Link to you Facebook page', 'better-studio' ),\r\n \"param_name\" => 'url',\r\n \"value\" => $this->defaults['url'],\r\n ),\r\n array(\r\n \"type\" => 'bf_select',\r\n \"heading\" => __( 'Style', 'better-studio' ),\r\n \"param_name\" => 'style',\r\n 'section_class' => 'style-floated-left',\r\n \"admin_label\" => true,\r\n \"options\" => array(\r\n 'light' => __( 'Light Schema', 'better-studio' ),\r\n 'dark' => __( 'Style Schema', 'better-studio' ),\r\n ),\r\n \"value\" => $this->defaults['style'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Posts?', 'better-studio' ),\r\n \"param_name\" => 'show_posts',\r\n \"value\" => $this->defaults['show_posts'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show faces?', 'better-studio' ),\r\n \"param_name\" => 'show_faces',\r\n \"value\" => $this->defaults['show_faces'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Header?', 'better-studio' ),\r\n \"param_name\" => 'show_header',\r\n \"value\" => $this->defaults['show_header'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Border?', 'better-studio' ),\r\n \"param_name\" => 'show_border',\r\n \"value\" => $this->defaults['show_border'],\r\n ),\r\n\r\n\r\n )\r\n ) );\r\n\r\n }",
"function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }",
"public static function _register()\n {\n self::assignElements([\n 'ListingDurations' => ['type' => 'ListingDurationDefinitionsType', 'xmlns' => self::XMLNS],\n 'ShippingTermsRequired' => ['type' => 'ShippingTermRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferEnabled' => ['type' => 'BestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DutchBINEnabled' => ['type' => 'DutchBINEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UserConsentRequired' => ['type' => 'UserConsentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'HomePageFeaturedEnabled' => ['type' => 'HomePageFeaturedEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackEnabled' => ['type' => 'ProPackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BasicUpgradePackEnabled' => ['type' => 'BasicUpgradePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ValuePackEnabled' => ['type' => 'ValuePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ProPackPlusEnabled' => ['type' => 'ProPackPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdFormatEnabled' => ['type' => 'AdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferCounterEnabled' => ['type' => 'BestOfferCounterEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoDeclineEnabled' => ['type' => 'BestOfferAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSpecialitySubscription' => ['type' => 'LocalMarketSpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketRegularSubscription' => ['type' => 'LocalMarketRegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPremiumSubscription' => ['type' => 'LocalMarketPremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketNonSubscription' => ['type' => 'LocalMarketNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressEnabled' => ['type' => 'ExpressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressPicturesRequired' => ['type' => 'ExpressPicturesRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ExpressConditionRequired' => ['type' => 'ExpressConditionRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'MinimumReservePrice' => ['type' => 'MinimumReservePriceDefinitionType', 'xmlns' => self::XMLNS],\n 'TransactionConfirmationRequestEnabled' => ['type' => 'TCREnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerContactDetailsEnabled' => ['type' => 'SellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreInventoryEnabled' => ['type' => 'StoreInventoryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeTransactionalEnabled' => ['type' => 'SkypeMeTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SkypeMeNonTransactionalEnabled' => ['type' => 'SkypeMeNonTransactionalEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesRegular' => ['type' => 'LocalListingDistancesRegularDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesSpecialty' => ['type' => 'LocalListingDistancesSpecialtyDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalListingDistancesNonSubscription' => ['type' => 'LocalListingDistancesNonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPaymentMethodEnabled' => ['type' => 'ClassifiedAdPaymentMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdShippingMethodEnabled' => ['type' => 'ClassifiedAdShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdBestOfferEnabled' => ['type' => 'ClassifiedAdBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCounterOfferEnabled' => ['type' => 'ClassifiedAdCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoDeclineEnabled' => ['type' => 'ClassifiedAdAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByPhoneEnabled' => ['type' => 'ClassifiedAdContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByEmailEnabled' => ['type' => 'ClassifiedAdContactByEmailEnabledDefintionType', 'xmlns' => self::XMLNS],\n 'SafePaymentRequired' => ['type' => 'SafePaymentRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPayPerLeadEnabled' => ['type' => 'ClassifiedAdPayPerLeadEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemSpecificsEnabled' => ['type' => 'ItemSpecificsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PaisaPayFullEscrowEnabled' => ['type' => 'PaisaPayFullEscrowEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNIdentifierEnabled' => ['type' => 'ISBNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCIdentifierEnabled' => ['type' => 'UPCIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANIdentifierEnabled' => ['type' => 'EANIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BrandMPNIdentifierEnabled' => ['type' => 'BrandMPNIdentifierEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BestOfferAutoAcceptEnabled' => ['type' => 'BestOfferAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdAutoAcceptEnabled' => ['type' => 'ClassifiedAdAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeNorthAmericaEnabled' => ['type' => 'CrossBorderTradeNorthAmericaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeGBEnabled' => ['type' => 'CrossBorderTradeGBEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CrossBorderTradeAustraliaEnabled' => ['type' => 'CrossBorderTradeAustraliaEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalBuyerProtectionEnabled' => ['type' => 'PayPalBuyerProtectionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'BuyerGuaranteeEnabled' => ['type' => 'BuyerGuaranteeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CombinedFixedPriceTreatmentEnabled' => ['type' => 'CombinedFixedPriceTreatmentEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'GalleryFeaturedDurations' => ['type' => 'ListingEnhancementDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'INEscrowWorkflowTimeline' => ['type' => 'INEscrowWorkflowTimelineDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequired' => ['type' => 'PayPalRequiredDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAdFormatEnabled' => ['type' => 'EBayMotorsProAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByPhoneEnabled' => ['type' => 'EBayMotorsProContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPhoneCount' => ['type' => 'EBayMotorsProPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByAddressEnabled' => ['type' => 'EBayMotorsProContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProStreetCount' => ['type' => 'EBayMotorsProStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCompanyNameEnabled' => ['type' => 'EBayMotorsProCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProContactByEmailEnabled' => ['type' => 'EBayMotorsProContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProBestOfferEnabled' => ['type' => 'EBayMotorsProBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoAcceptEnabled' => ['type' => 'EBayMotorsProAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProAutoDeclineEnabled' => ['type' => 'EBayMotorsProAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProPaymentMethodCheckOutEnabled' => ['type' => 'EBayMotorsProPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProShippingMethodEnabled' => ['type' => 'EBayMotorsProShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProCounterOfferEnabled' => ['type' => 'EBayMotorsProCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'eBayMotorsProSellerContactDetailsEnabled' => ['type' => 'EBayMotorsProSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAdFormatEnabled' => ['type' => 'LocalMarketAdFormatEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByPhoneEnabled' => ['type' => 'LocalMarketContactByPhoneEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPhoneCount' => ['type' => 'LocalMarketPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByAddressEnabled' => ['type' => 'LocalMarketContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketStreetCount' => ['type' => 'LocalMarketStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCompanyNameEnabled' => ['type' => 'LocalMarketCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketContactByEmailEnabled' => ['type' => 'LocalMarketContactByEmailEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketBestOfferEnabled' => ['type' => 'LocalMarketBestOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoAcceptEnabled' => ['type' => 'LocalMarketAutoAcceptEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketAutoDeclineEnabled' => ['type' => 'LocalMarketAutoDeclineEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketPaymentMethodCheckOutEnabled' => ['type' => 'LocalMarketPaymentMethodCheckOutEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketShippingMethodEnabled' => ['type' => 'LocalMarketShippingMethodEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketCounterOfferEnabled' => ['type' => 'LocalMarketCounterOfferEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'LocalMarketSellerContactDetailsEnabled' => ['type' => 'LocalMarketSellerContactDetailsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdPhoneCount' => ['type' => 'ClassifiedAdPhoneCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdContactByAddressEnabled' => ['type' => 'ClassifiedAdContactByAddressEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdStreetCount' => ['type' => 'ClassifiedAdStreetCountDefinitionType', 'xmlns' => self::XMLNS],\n 'ClassifiedAdCompanyNameEnabled' => ['type' => 'ClassifiedAdCompanyNameEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'SpecialitySubscription' => ['type' => 'SpecialitySubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'RegularSubscription' => ['type' => 'RegularSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'PremiumSubscription' => ['type' => 'PremiumSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'NonSubscription' => ['type' => 'NonSubscriptionDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyEnabled' => ['type' => 'ReturnPolicyEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'HandlingTimeEnabled' => ['type' => 'HandlingTimeEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PayPalRequiredForStoreOwner' => ['type' => 'PayPalRequiredForStoreOwnerDefinitionType', 'xmlns' => self::XMLNS],\n 'ReviseQuantityAllowed' => ['type' => 'ReviseQuantityAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'RevisePriceAllowed' => ['type' => 'RevisePriceAllowedDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurationsEnabled' => ['type' => 'StoreOwnerExtendedListingDurationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'StoreOwnerExtendedListingDurations' => ['type' => 'StoreOwnerExtendedListingDurationsDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentMethod' => ['type' => 'PaymentMethodDefinitionType', 'xmlns' => self::XMLNS],\n 'Group1MaxFlatShippingCost' => ['type' => 'Group1MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group2MaxFlatShippingCost' => ['type' => 'Group2MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'Group3MaxFlatShippingCost' => ['type' => 'Group3MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCostCBTExempt' => ['type' => 'MaxFlatShippingCostCBTExemptDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxFlatShippingCost' => ['type' => 'MaxFlatShippingCostDefinitionType', 'xmlns' => self::XMLNS],\n 'VariationsEnabled' => ['type' => 'VariationsEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AttributeConversionEnabled' => ['type' => 'AttributeConversionEnabledFeatureDefinitionType', 'xmlns' => self::XMLNS],\n 'FreeGalleryPlusEnabled' => ['type' => 'FreeGalleryPlusEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'FreePicturePackEnabled' => ['type' => 'FreePicturePackEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ItemCompatibilityEnabled' => ['type' => 'ItemCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxItemCompatibility' => ['type' => 'MaxItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'MinItemCompatibility' => ['type' => 'MinItemCompatibilityDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionEnabled' => ['type' => 'ConditionEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ConditionValues' => ['type' => 'ConditionValuesDefinitionType', 'xmlns' => self::XMLNS],\n 'ValueCategory' => ['type' => 'ValueCategoryDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductCreationEnabled' => ['type' => 'ProductCreationEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EANEnabled' => ['type' => 'EANEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ISBNEnabled' => ['type' => 'ISBNEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'UPCEnabled' => ['type' => 'UPCEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'CompatibleVehicleType' => ['type' => 'CompatibleVehicleTypeDefinitionType', 'xmlns' => self::XMLNS],\n 'MaxGranularFitmentCount' => ['type' => 'MaxGranularFitmentCountDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentOptionsGroup' => ['type' => 'PaymentOptionsGroupEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'ShippingProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'PaymentProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyProfileCategoryGroup' => ['type' => 'ProfileCategoryGroupDefinitionType', 'xmlns' => self::XMLNS],\n 'VINSupported' => ['type' => 'VINSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'VRMSupported' => ['type' => 'VRMSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'SellerProvidedTitleSupported' => ['type' => 'SellerProvidedTitleSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'DepositSupported' => ['type' => 'DepositSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'GlobalShippingEnabled' => ['type' => 'GlobalShippingEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'AdditionalCompatibilityEnabled' => ['type' => 'AdditionalCompatibilityEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'PickupDropOffEnabled' => ['type' => 'PickupDropOffEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DigitalGoodDeliveryEnabled' => ['type' => 'DigitalGoodDeliveryEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'EpidSupported' => ['type' => 'EpidSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'KTypeSupported' => ['type' => 'KTypeSupportedDefinitionType', 'xmlns' => self::XMLNS],\n 'ProductRequiredEnabled' => ['type' => 'ProductRequiredEnabledDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsAcceptedValues' => ['type' => 'DomesticReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsAcceptedValues' => ['type' => 'InternationalReturnsAcceptedDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsDurationValues' => ['type' => 'DomesticReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsDurationValues' => ['type' => 'InternationalReturnsDurationDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticReturnsShipmentPayeeValues' => ['type' => 'DomesticReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'InternationalReturnsShipmentPayeeValues' => ['type' => 'InternationalReturnsShipmentPayeeDefinitionType', 'xmlns' => self::XMLNS],\n 'DomesticRefundMethodValues' => ['type' => 'DomesticRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'InternationalRefundMethodValues' => ['type' => 'InternationalRefundMethodCodeType', 'xmlns' => self::XMLNS],\n 'ReturnPolicyDescriptionEnabled' => ['type' => 'ReturnPolicyDescriptionEnabledDefinitionType', 'xmlns' => self::XMLNS]\n ], parent::NAME);\n\n self::assignAttributes([]);\n }",
"function install() {\n\t\tsafe_query('DELETE FROM '.safe_pfx('txp_prefs').' WHERE name LIKE \"wlk_phsb_%\"');\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_notifications_instant',val = '1',type = '1',event = 'wlk_phsb',html = 'yesnoradio',position = '10',user_name = ''\");\n\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_phsb_endpoints',val = '\".implode(\"\\n\", $this->vars['endpoints']).\"',type = '1',event = 'wlk_phsb',html = 'wlk_phsb_textarea',position = '60',user_name = ''\");\n\t}",
"function addWPActions ()\n\t{\n\t\t//Frontend\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontendEnqueues' ), 1 );\n\t\tadd_shortcode( 'imperial-document-upload', array( $this, 'drawDocumentUploadShortcode' ) );\n\t\t\n\n\t}",
"public static function init() {\n\t\tadd_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 20 );\n\t\tadd_action( 'wp_ajax_wprm_wpurp_nutrition', array( __CLASS__, 'ajax_wpurp_nutrition' ) );\n\t}",
"function insta_f_install(){\n}",
"private function add_hooks(){\n\t\n\t\tadd_action( 'plugin_action_links_' . UCLACOMPONENTSWP_PLUGIN_BASE, array( $this, 'add_plugin_action_link' ), 20 );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend_scripts_and_styles' ), 20 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_public_scripts_and_styles' ), 20 );\n\t\n\t}",
"function initialize() {\n \t$this->addon = $this->slplus->addon( 'power' );\n $this->settings = new SLP_Settings( array(\n 'name' => SLPLUS_NAME . ' - ' . __( 'Pages' , 'slp-power' ),\n 'form_action' => admin_url() . 'admin.php?page=slp-pages'\n ) );\n SLP_Power_Text_Pages_Tab::get_instance();\n }"
] | [
"0.6000555",
"0.57204646",
"0.57073635",
"0.56994313",
"0.56773365",
"0.5673357",
"0.5672344",
"0.5651897",
"0.5647044",
"0.5629927",
"0.56260824",
"0.5613327",
"0.559047",
"0.5581401",
"0.55772233",
"0.5565469",
"0.55610055",
"0.5556372",
"0.55525196",
"0.5547311",
"0.5544613",
"0.5538304",
"0.55323035",
"0.5518237",
"0.55113554",
"0.5504575",
"0.5496238",
"0.54865754",
"0.54832166",
"0.54828894"
] | 0.72144175 | 0 |
Show the Job Builder mini SPA | public function show()
{
return view(
'manager/job-builder-root'
)->with([
'title' => Lang::get('manager/job_builder.title'),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Job $job)\n {\n //\n }",
"public function getShow($jobtitle)\n\t{\n\t\t// redirect to the frontend\n\t}",
"public function index()\n\t{\n\t\treturn view('sanatorium/job::index');\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}",
"public function getJobseekerDashboard()\n {\n return view('jobseeker::jobseeker.dashboard');\n }",
"public function index()\n {\n $jobs = Job::all();\n return view(\"admin.jobs\", compact(\"jobs\"));\n }",
"public function index()\n {\n $jobs = \\App\\Job::all();\n\n return view('home', compact('jobs'));\n }",
"public function index()\n {\n $lists = $this->jobRepository->getListJob(20);\n foreach ($lists as $key => $item) {\n $lists[$key]->cate = $this->categoryRepository->find($item->category_id);\n $lists[$key]->author = $this->getAuthor($item->user_id);\n }\n\n return view('admin::jobs.job_list', compact('lists'));\n }",
"public function index()\n {\n $jobs = Job::where('status', 0)\n ->where('company_id', '!=', Auth::user()->id)\n ->orderBy('id', 'DESC')->get();\n $colorAvt = ['#e1663f', '#558ed5', '#92d050'];\n $tabActive = 'job';\n\n $technicals = config('resources.technical_skill');\n $postions = config('resources.position');\n $levels = config('resources.level');\n return view('job.index', compact('jobs', 'colorAvt', 'tabActive', 'levels', 'postions', 'technicals'));\n }",
"public function show(PaintJob $paintJob)\n {\n //\n }",
"public function dashboard()\n { \n return view('jobposter.dashboard');\n }",
"public function viewJob()\n {\n $result = Job::paginate(50);\n return view('data.list_job', ['job' => $result]);\n }",
"public function index()\n {\n $data['jobs'] = $this->admin_m->getRecords();\n\n $data['content'] = 'admin/adminJobs';\n $this->load->view('components/template', $data);\n }",
"public function show_box()\n\t\t{\n\t\t\techo '<div id=\"mfn-wrapper\">';\n\t\t\t\techo '<input type=\"hidden\" name=\"mfn-builder-nonce\" value=\"'. wp_create_nonce('mfn-builder-nonce') .'\" />';\n\t\t\t\tmfn_builder_show();\n\t\t\techo '</div>';\n\t\t}",
"public function show();",
"public function show();",
"public function show();",
"public function show();",
"public function index()\n {\n return view('app.user.job.index');\n }",
"public function index()\n {\n $Jobs = JobResource::collection(Jobs::where('active', '=', 1)->orderBy('id', 'desc')->paginate(50));\n return view('home')->with(compact(\"Jobs\"));\n }",
"public function applicationDetailAction() {\n $job_id = $this->_getParam('job_id');\n $this->view->applicationDetail = Engine_Api::_()->getItem('sitereview_job', $job_id);\n }",
"public function index()\n {\n $id = Auth::user()->id;\n $items = Job::with(['user'])->where('user_id', '=', $id)->get();\n return view('pages.admin.job.index',compact('items'));\n }",
"public function index()\n {\n //\n $jobs = Job::all();\n return view('admin.job.index',[\n 'jobs'=>$jobs\n ]);\n }",
"public function show(Job $job)\n {\n \n return view('pages.admin.job.show',compact('job'));\n }",
"public function show() {\n \n }",
"function showStart() {\n $starturl = $this->action . '?mode=eligible';\n $extra = array('starturl' => $starturl);\n $output = $this->outputBoilerplate('start.html', $extra);\n return $output;\n }",
"public function actionIndex(){ \n echo 'REST API';\n //echo \\admin\\components\\GoogleURLShortner::widget([\"url\" => \"http://www.google.com\"]);\n }",
"function register_gather_ua_jobs_tools_page() {\n\tadd_management_page( __( 'Gather UA Jobs', GATHER_UA_JOBS_TEXT_DOMAIN ), __( 'Gather UA Jobs', GATHER_UA_JOBS_TEXT_DOMAIN ), 'edit_posts', 'gather-ua-jobs', 'print_gather_ua_jobs_tools_page' );\n\n}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}"
] | [
"0.6665023",
"0.6536361",
"0.63888204",
"0.6380171",
"0.62925464",
"0.61752284",
"0.6144173",
"0.610938",
"0.60875916",
"0.60807264",
"0.6065288",
"0.6047928",
"0.6037091",
"0.6018285",
"0.6015556",
"0.6015556",
"0.6015556",
"0.6015556",
"0.6010017",
"0.60046476",
"0.6001178",
"0.59930414",
"0.59461296",
"0.59387434",
"0.5938212",
"0.5937609",
"0.59320587",
"0.5924406",
"0.5922281",
"0.5922281"
] | 0.7357492 | 0 |
$n | $n+1 sets rightmost zero bit to 1 ($n | $n+1) + 1 sets all bits after second zero to 0 and second zero to 1 combining these terms with XOR (^) gives leading zeros until second rightmost zero of original term and then only 1s adding 1 again turns all 1s to zeros and adds only one 1 in front of them moving to the right one position returns the exact position of the second rightmost 0 Example: $n = 37 = 100101 $n | $n + 1 = 100111 ($n | $n + 1) + 1 = 101000 XOR of the above = 001111 +1 to that = 010000 >> 1 = 001000 | function secondRightmostZeroBit($n) {
return ((($n | $n+1) ^ (($n | $n + 1) + 1)) + 1) >> 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function getMaskOnes(int $n): int {\n // so (1 << 63) - 1 gets converted to float and loses precision (leading to incorrect result)\n // 2. (1 << 64) - 1 works fine, because (1 << 64) === 0 (it overflows) and -1 is exactly what we want\n // (`php -r 'var_dump(decbin(-1));'` => string(64) \"111...11\")\n $bit = 1 << $n;\n return $bit === PHP_INT_MIN ? ~$bit : $bit - 1;\n }",
"function num1BitsSecondSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n for ($c = 0; $number; $number >>= 1) {\n $c += $number & 1;\n }\n\n return $c;\n}",
"function num1BitsFirstSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n $countOf1 = 0;\n\n do {\n\n if ($number & 1) {\n ++$countOf1;\n }\n\n } while ($number = $number >> 1);\n\n return $countOf1;\n}",
"function flippingBits($n)\n{\n return $n ^ 0xFFFFFFFF;\n}",
"function num1BitsThirdSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n for ($c = 0; $number; $c++) {\n $number &= $number - 1;\n }\n\n return $c;\n}",
"function decbinx($d,$n)\r\n\t{\r\n\t\t$bin = decbin($d);\r\n\t\t$sbin = strlen($bin);\r\n\t\tfor($j = 0; $j < $n - $sbin; $j++)\r\n \t\t\t$bin = \"0$bin\";\r\n\t\treturn $bin;\r\n\t}",
"function ROR($binner, $shift)\n{\n $length = strlen($binner);\n for ($i = 0; $i < $shift; $i++) {\n $x = substr($binner, -1);\n $temp = $x . substr($binner, 0, $length - 1);\n $binner = $temp;\n }\n}",
"function computeParityEraseLowestSetBit($number)\n{\n if (!is_int($number)) {\n throw new \\InvalidArgumentException('$number must be an integer');\n }\n\n $bitwiseHelper = new BitwiseHelper();\n $number = $bitwiseHelper->eraseSignBit($number);\n $result = 0;\n\n while ($number) {\n $result ^= 1;\n $number &= ($number - 1);\n }\n\n return $result;\n}",
"function next_pow($number)\n{\n if($number < 2) return 1;\n for($i = 0 ; $number > 1 ; $i++)\n {\n $number = $number >> 1;\n }\n return 1<<($i+1);\n}",
"static function powerOfTwo($n)\n { \n if ($n >= 0 && $n < 31) {\n $pow = 2**$n;\n $all = 0; $count = 1;\n while($all != $pow)\n {\n $all = 2** $count;\n echo $all.\"\\n\";\n $count++;\n }\n } else {\n echo \"enter value between 0 to 31\".\"\\n\";\n Utility::powerOfTwo();\n }\n \n }",
"function _binxor($l, $r)\n {\n $x = (($l < 0) ? (float)($l + 4294967296) : (float)$l)\n ^ (($r < 0) ? (float)($r + 4294967296) : (float)$r);\n\n return (float)(($x < 0) ? $x + 4294967296 : $x);\n }",
"function variant_xor($left, $right) {}",
"function mirrorBits($a) {\n return bindec(strrev(decbin($a)));\n}",
"function toBinary($n1)\n {\n $n = $n1;\n $binaryNum = array();\n\n $i = 0;\n while ($n > 0) {\n\n $binaryNum[$i] = $n % 2;\n $n = (int) ($n / 2);\n $i++;\n }\n echo \"Binary representation of \" . $n1 . \" is : \";\n\n for ($j = $i - 1; $j >= 0; $j--) {\n echo $binaryNum[$j];\n }\n }",
"function solution($N) {\n $binStr = decbin($N);\n $binStr = preg_replace(['/^0+/', '/0+$/'], '',$binStr);\n $zeros = explode('1', $binStr);\n $zeros = array_map(function ($zero) {\n return strlen($zero);\n }, $zeros);\n return max($zeros);\n}",
"public function getIncrementBy2($n){\n\t\t$hasil= array();\n\t\t$data=1;\n\t\tfor ($i=0; $i < $n ; $i++) {\n\t\t\t$hasil[$i]=$data;\n\t\t\t$data=$data+2;\n\t\t}\n\t\treturn $hasil;\n\t}",
"private static function scan1($bites) {\n if ($bites == 0) {\n return self::HASH_LENGTH - self::HASH_K;\n }\n\n $offset = floor(log($bites, 2));\n $offset = self::HASH_LENGTH - self::HASH_K - $offset;\n\n return $offset;\n }",
"function ROL($binner, $shift)\n{\n $length = strlen($binner);\n for ($i = 0; $i < $shift; $i++) {\n $x = substr($binner, 0, 1);\n $temp = substr($binner, 1, $length - 1) . $x;\n $binner = $temp;\n }\n\n return $binner;\n}",
"public function getOddAndReverse($n){\n\t\t$result = array();\n\t\t$data = 0;\n\t\tfor($i = 0; $i < $n; $i++){\n\t\t\t//collect to result array\n\t\t\t$result[$i] = $data;\n\t\t\t\n\t\t\tif($i <= ($n-1)/2-1){\n\t\t\t\t$data = $data + 2;\n\t\t\t} else {\n\t\t\t\t$data = $data - 2;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public static function getNextTwoPower($number) {\n $result = $number - 1;//Subtract 1 to handle the case that we are already a power of 2\n $result |= $result >> 1;//shift all bits to 1\n $result |= $result >> 2;//shift all bits to 1\n $result |= $result >> 4;//shift all bits to 1\n $result |= $result >> 8;//shift all bits to 1\n $result |= $result >> 16;//Support up to 32bit integer or 0x8000_0000\n return $result + 1;\n }",
"function nprimo($n)\n {\n $primo=true;\n \n $i=2;\n while (($i< $n) & ($primo)){\n \n if($n%$i==0) {\n $primo=false;\n }\n $i++;\n }\n return $primo;\n }",
"function _rshift($integer, $n) {\r\n if (0xffffffff < $integer || -0xffffffff > $integer) {\r\n $integer = fmod($integer, 0xffffffff + 1);\r\n }\r\n\r\n // convert to unsigned integer\r\n if (0x7fffffff < $integer) {\r\n $integer -= 0xffffffff + 1.0;\r\n } elseif (-0x80000000 > $integer) {\r\n $integer += 0xffffffff + 1.0;\r\n }\r\n\r\n // do right shift\r\n if (0 > $integer) {\r\n $integer &= 0x7fffffff; // remove sign bit before shift\r\n $integer >>= $n; // right shift\r\n $integer |= 1 << (31 - $n); // set shifted sign bit\r\n } else {\r\n $integer >>= $n; // use normal right shift\r\n }\r\n\r\n return $integer;\r\n }",
"public function oddMask()\n {\n $low = (-($this->low & 1)) & 0xFFFFFFFF;\n $high = $low;\n return UInt64::newValue($high, $low);\n }",
"function collatzLength($n) {\n $chainLength = 0;\n while ($n != 1) {\n $chainLength++;\n if ($n % 2 == 0) {\n $n = $n / 2;\n } else {\n $n = 3 * $n + 1;\n }\n }\n return $chainLength + 1;\n}",
"function Fannkuch($n){\n $check = 0;\n $perm = array();\n $perm1 = array();\n $count = array();\n $maxPerm = array();\n $maxFlipsCount = 0;\n $m = $n - 1;\n\n for ($i=0; $i<$n; $i++) $perm1[$i] = $i;\n $r = $n;\n\n while (TRUE) {\n // write-out the first 30 permutations \n if ($check < 30){\n for($i=0; $i<$n; $i++) echo $perm1[$i]+1; \n echo \"\\n\";\n $check++;\n }\n\n while ($r != 1){ $count[$r-1] = $r; $r--; } \n if (! ($perm1[0]==0 || $perm1[$m] == $m)){ \n for($i=0; $i<$n; $i++) $perm[$i] = $perm1[$i]; \n $flipsCount = 0;\n\n while ( !(($k=$perm[0]) == 0) ) {\n $k2 = ($k+1) >> 1;\n for($i=0; $i<$k2; $i++) {\n $temp = $perm[$i]; $perm[$i] = $perm[$k-$i]; $perm[$k-$i] = $temp;\n }\n $flipsCount++;\n }\n\n if ($flipsCount > $maxFlipsCount) {\n $maxFlipsCount = $flipsCount;\n for($i=0; $i<$n; $i++) $maxPerm[$i] = $perm1[$i];\n }\n } \n\n while (TRUE) { \n if ($r == $n) return $maxFlipsCount;\n $perm0 = $perm1[0];\n $i = 0;\n while ($i < $r) {\n $j = $i + 1;\n $perm1[$i] = $perm1[$j];\n $i = $j;\n }\n $perm1[$r] = $perm0;\n\n $count[$r] = $count[$r] - 1;\n if ($count[$r] > 0) break;\n $r++;\n }\n }\n}",
"function addOneToNumberOptimized($arr) {\n // handle empty array\n if (empty($arr)) {\n return [1];\n }\n // remove forward padded zeros\n $arr = removeForwardZero($arr);\n // init carry variable to track forward carrys\n $carry = 0;\n // loop through array from back to front\n for ($i=sizeof($arr)-1; $i >= 0; $i--) { \n if ($i == sizeof($arr)-1) {\n $arr[$i]++;\n } else {\n $arr[$i] += $carry;\n $carry = 0;\n }\n if ($arr[$i] >= 10) {\n $arr[$i] %= 10; \n $carry = 1;\n } else {\n break;\n }\n }\n // if carry is 1 at the end, append a new 1 to forward of array\n if ($carry === 1) {\n array_unshift($arr, 1);\n }\n return $arr;\n}",
"private static function ShiftLeft( int|string|\\GMP $x, int $n ) : \\GMP\n\t{\n\t\treturn gmp_mul( $x, gmp_pow( 2, $n ) );\n\t}",
"private static function ShiftRight( int|string|\\GMP $x, int $n ) : \\GMP\n\t{\n\t\treturn gmp_div_q( $x, gmp_pow( 2, $n ) );\n\t}",
"function fb($n)\n {\n if ($n == 0) \n {\n \treturn 0;\n }\n elseif ($n < 3 and $n!==0) \n {\n return 1; \n }\n else \n {\n return (fb($n-1) + fb($n-2));\n }\n }",
"protected function BinaryXOR( $strBin1, $strBin2 )\n\t{\n\t\t$strBinaryFinal = '';\n\t\tfor( $intPos = 1 ; $intPos <= \\strlen( $strBin1 ) ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\tswitch( substr( $strBin1, intval( $intPos ) - 1, 1 ) )\n\t\t\t{\n\t\t\t\tcase substr( $strBin2, intval( $intPos ) - 1, 1 ) :\n\t\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\t$strBinaryFinal = $strBinaryFinal . \"1\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $strBinaryFinal;\n\t}"
] | [
"0.62852633",
"0.6116158",
"0.6056246",
"0.6055227",
"0.60162616",
"0.57413346",
"0.55304277",
"0.5477094",
"0.5446826",
"0.5413623",
"0.53752816",
"0.53333426",
"0.53181046",
"0.52793753",
"0.5232766",
"0.51740205",
"0.5160071",
"0.5099801",
"0.5079656",
"0.50759155",
"0.5041144",
"0.503121",
"0.5020721",
"0.50112003",
"0.4995265",
"0.49617624",
"0.49477643",
"0.49469203",
"0.49142325",
"0.49093655"
] | 0.7070557 | 0 |
assigns values to template variables by reference | function AssignByRef($tpl_var, &$value)
{
$this->_smarty->assign_by_ref($tpl_var, $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setTemplateVariables() {}",
"public function assignTemplateVariable($varName, $varValue);",
"function set_var($name, $value){ // set the template variable\n\tif (func_num_args()> 2){\n\t\tif (!$this->in_vars($name)) $this->vars[$name] = array();\n\t\t$this->vars[$name][func_get_arg(2)] = $value;\n\t} else $this->vars[$name] = $value;\n}",
"function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}",
"public static function assignByRef($key,&$value) {\r\n\t\tself::$_smarty->assignByRef($key,$value);\r\n\t}",
"public function setDataIntoTemplate($reference,$data) {\n\t$this->assign($reference,$data);\n }",
"private function assignValues() {\n $this->setIndicators('value');\n\n $leftIndicator = $this->sugarTemplateIndicators['valueLeft'] . $this->sugarTemplateIndicators['valueSeparator'];\n $rightIndicator = $this->sugarTemplateIndicators['valueSeparator'] . $this->sugarTemplateIndicators['valueRight'];\n\n foreach ($this->assignedValues as $tag => $value) {\n $this->rootContent = str_replace($leftIndicator . $tag . $rightIndicator, $value, $this->rootContent);\n }\n }",
"public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }",
"function assignToView($variable_name, $variable_value = null) {\r\n $template_engine = Angie::getTemplateEngine();\r\n if(is_array($variable_name)) {\r\n foreach($variable_name as $k => $v) {\r\n $template_engine->assignToView($k, $v);\r\n } // foreach\r\n } else {\r\n $template_engine->assignToView($variable_name, $variable_value);\r\n } // if\r\n }",
"protected function setVarToTemplates()\n {\n $this->templates->set_tpl($this->varName, $this->checkNewCommondaty());\n }",
"function set($name, $value) {\n $args = func_get_args();\n $cnt = count($args);\n // we check for odd number of args => missing values...\n if ($cnt % 2 == 0 && $cnt >= 2 ) {\n for ($i=0; $i < $cnt; $i += 2) {\n $name = $args[$i];\n $value = $args[$i + 1];\n $this->vars[$name] = ($value instanceof Template) ? $value->fetch() : $value;\n }\n } \n }",
"function prepare_vars_for_template_usage()\n {\n }",
"public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }",
"function setRef($name, &$value) {\n $this->vars[$name] =& $value; //is_object($value) ? $value->fetch() : $value;\n }",
"public function replaceTemplateVars($new_vars = array()){\n\t\t$this->template_data = $new_vars;\n\t}",
"public function set($var, $value){\n\t\t\t$this->template_vars[$var] = $value;\n\t\t}",
"function Assign($tpl_var, $value = null)\n {\n $this->_smarty->assign( $tpl_var, $value );\n }",
"public static function assignTemplate($key,$t) {\r\n\t\tself::assign($key,self::fetch($t));\r\n\t}",
"function testSetVariable()\n {\n $result = $this->tpl->setTemplate('{placeholder1} {placeholder2} {placeholder3}', true, true);\n if (PEAR::isError($result)) {\n $this->assertTrue(false, 'Error setting template: '. $result->getMessage());\n }\n // \"scalar\" call\n $this->tpl->setVariable('placeholder1', 'var1');\n // array call\n $this->tpl->setVariable(array(\n 'placeholder2' => 'var2',\n 'placeholder3' => 'var3'\n ));\n $this->assertEquals('var1 var2 var3', $this->tpl->get());\n }",
"function assign_global($key, $value = null)\n\t{\n\t\t\tforeach ($this->data as $k => $v)\t // iterate through data\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (get_class($v) == 'Template') // if data is template object\n\t\t\t\t{\n\t\t\t\t\t$v->assign($key, $value);\t // assign to it\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->assign($key, $value);\t\t // assign to this template also\n\t}",
"private function setVarToTemplate()\n\t{\n\t\t$this->view->set('grid', $this->gridState);\n\n\t\t// Set variable with shot message to template\n\t\t$this->view->set('shotMessage', $this->shotMessage);\n\n\t\t// Set variable with final message to template\n\t\t$this->view->set('finalMessage', $this->finalMessage);\n\n\t\t// Set variable with grid row count to template\n\t\t$this->view->set('gridRowCount', $this->gridRow);\n\n\t\t// Set variable with grid colum count to template\n\t\t$this->view->set('gridColCount', $this->gridCol);\n\t}",
"function xTemplateAssign($name, $value) {\n\n if(!isset($this->xTemplate)) {\n $this->createXTemplate();\n }\n $this->xTemplate->assign($name, $value);\n\n}",
"public function assignVar($name, $value) {\n $this->tpl_vars[$name] = $value;\n }",
"protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }",
"public function render()\n {\n $name = $this->arguments['name'];\n $value = $this->arguments['value'];\n\n if (null === $value) {\n $value = $this->renderChildren();\n }\n if (false === strpos($name, '.')) {\n if (true === $this->templateVariableContainer->exists($name)) {\n $this->templateVariableContainer->remove($name);\n }\n $this->templateVariableContainer->add($name, $value);\n } elseif (1 === substr_count($name, '.')) {\n $parts = explode('.', $name);\n $objectName = array_shift($parts);\n $path = implode('.', $parts);\n if (false === $this->templateVariableContainer->exists($objectName)) {\n return;\n }\n $object = $this->templateVariableContainer->get($objectName);\n try {\n ObjectAccess::setProperty($object, $path, $value);\n // Note: re-insert the variable to ensure unreferenced values like arrays also get updated\n $this->templateVariableContainer->remove($objectName);\n $this->templateVariableContainer->add($objectName, $object);\n } catch (\\Exception $error) {\n return;\n }\n }\n }",
"function assign_to($tpl, $key, $value = null)\n\t{\n\t\t$this->data[$tpl]->assign($key, $value);\n\t}",
"function getTemplateVariableContainer() ;",
"public function set($n,$v){\n\t\t$this->Template->set($n, $v);\n\t}",
"public function assign($name, $value = null) {\r\n\t\t\t$this->templateVariables[$name] = $value;\r\n\t\t\treturn $this;\r\n\t\t}",
"function AppendByRef($tpl_var, &$value, $merge=false)\n {\n $this->_smarty->append_by_ref($tpl_var, $value, $merge);\n }"
] | [
"0.66164047",
"0.6479167",
"0.64723015",
"0.639003",
"0.6382429",
"0.63544494",
"0.63020086",
"0.6299898",
"0.62878853",
"0.6169415",
"0.60753727",
"0.60349894",
"0.5933269",
"0.59175247",
"0.5907796",
"0.5884635",
"0.58379257",
"0.5804054",
"0.5797334",
"0.5778417",
"0.5778294",
"0.5777552",
"0.5696977",
"0.5695641",
"0.5694028",
"0.5665632",
"0.56602204",
"0.5655181",
"0.5654497",
"0.5647542"
] | 0.68295246 | 0 |
appends values to template variables by reference | function AppendByRef($tpl_var, &$value, $merge=false)
{
$this->_smarty->append_by_ref($tpl_var, $value, $merge);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addVariables($tvs = array());",
"public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }",
"function AssignByRef($tpl_var, &$value)\n {\n $this->_smarty->assign_by_ref($tpl_var, $value);\n }",
"public function append($var, $value) {\n\t\tif (isset($this->tpl_vars[$var])) {\n\t\t\tif (!is_array($this->tpl_vars[$var])) {\n\t\t\t\tsettype($this->tpl_vars[$var], 'array');\n\t\t\t}\n\t\t\t$this->tpl_vars[$var][] = $value;\n\t\t} else {\n\t\t\t$this->tpl_vars[$var] = array($value);\n\t\t}\n\t}",
"function Append($tpl_var, $value=null, $merge=false)\n {\n $this->_smarty->append( $tpl_var, $value, $merge );\n }",
"public static function assignByRef($key,&$value) {\r\n\t\tself::$_smarty->assignByRef($key,$value);\r\n\t}",
"public function addVariable($tv);",
"public function replaceTemplateVars($new_vars = array()){\n\t\t$this->template_data = $new_vars;\n\t}",
"function cps_changeset_publish_batch_variables(&$context) {\n $item = $context['results']['entity'];\n foreach ($item->variables as $name => $value) {\n db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();\n }\n cache_clear_all('variables', 'cache_bootstrap');\n $context['message'] = t('Publishing variables');\n}",
"function array_capture ($array){\n\t $this->template = array_merge($this->template, $array);\n\t}",
"function set_var($name, $value){ // set the template variable\n\tif (func_num_args()> 2){\n\t\tif (!$this->in_vars($name)) $this->vars[$name] = array();\n\t\t$this->vars[$name][func_get_arg(2)] = $value;\n\t} else $this->vars[$name] = $value;\n}",
"public function addVariable($name, $value);",
"protected function _injectTplVariable()\r\n {\r\n $oConfig = oxRegistry::getConfig();\r\n $sTplVariableName = $oConfig->getConfigParam('sTplVariable');\r\n if ($sTplVariableName) {\r\n $oConfig->getActiveView()->addTplParam($sTplVariableName, $this->getToxid());\r\n }\r\n }",
"public function assignTemplateVariable($varName, $varValue);",
"public function insertVars($vars) {\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}",
"function attendance_template_variables($record) {\n $templatevars = array(\n '/%coursename%/' => $record->coursename,\n '/%courseid%/' => $record->courseid,\n '/%userfirstname%/' => $record->firstname,\n '/%userlastname%/' => $record->lastname,\n '/%userid%/' => $record->userid,\n '/%warningpercent%/' => $record->warningpercent,\n '/%attendancename%/' => $record->aname,\n '/%cmid%/' => $record->cmid,\n '/%numtakensessions%/' => $record->numtakensessions,\n '/%points%/' => $record->points,\n '/%maxpoints%/' => $record->maxpoints,\n '/%percent%/' => round($record->percent * 100),\n );\n $extrauserfields = \\core_user\\fields::get_name_fields();\n foreach ($extrauserfields as $extra) {\n $templatevars['/%'.$extra.'%/'] = $record->$extra;\n }\n $patterns = array_keys($templatevars); // The placeholders which are to be replaced.\n $replacements = array_values($templatevars); // The values which are to be templated in for the placeholders.\n // Array to describe which fields in reengagement object should have a template replacement.\n $replacementfields = array('emailsubject', 'emailcontent');\n\n // Replace %variable% with relevant value everywhere it occurs in reengagement->field.\n foreach ($replacementfields as $field) {\n $record->$field = preg_replace($patterns, $replacements, $record->$field);\n }\n return $record;\n}",
"public static function addVars($arr){\n self::$vars = array_merge(self::$vars, $arr);\n }",
"public function appendTemporaryValue($key, $value) {\n $this->entity->_exoComponent[$this->viewMode][$key][] = $value;\n return $this;\n }",
"function prepare_vars_for_template_usage()\n {\n }",
"public function addVar($key, $value)\n\t{\n\t\tswitch ($key) {\n\t\t\tcase 'variables':\n\t\t\t\t$this->vars['variables'] = array_merge($this->vars['variables'], $value);\n\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\tcase 'js':\n\t\t\t\tif (!empty($this->vars[$key])) {\n\t\t\t\t\t$this->vars[$key] .= ', '.$value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->vars[$key] = $value;\n\t\t\t\t}\t\t \n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->vars[$key] = $value;\n\t\t}\t\n\t}",
"public function append($values);",
"function getTemplateVariableContainer() ;",
"private function assignValues() {\n $this->setIndicators('value');\n\n $leftIndicator = $this->sugarTemplateIndicators['valueLeft'] . $this->sugarTemplateIndicators['valueSeparator'];\n $rightIndicator = $this->sugarTemplateIndicators['valueSeparator'] . $this->sugarTemplateIndicators['valueRight'];\n\n foreach ($this->assignedValues as $tag => $value) {\n $this->rootContent = str_replace($leftIndicator . $tag . $rightIndicator, $value, $this->rootContent);\n }\n }",
"function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}",
"function pagelines_less_var( $name, $value ){\n\t\n\tglobal $less_vars;\n\t\n\t$less_vars[$name] = $value;\n\t\n}",
"function assignToView($variable_name, $variable_value = null) {\r\n $template_engine = Angie::getTemplateEngine();\r\n if(is_array($variable_name)) {\r\n foreach($variable_name as $k => $v) {\r\n $template_engine->assignToView($k, $v);\r\n } // foreach\r\n } else {\r\n $template_engine->assignToView($variable_name, $variable_value);\r\n } // if\r\n }",
"protected function setTemplateVariables() {}",
"function smarty_function_sugar_replace_vars($params, &$smarty)\n{\n\tif(empty($params['subject'])) {\n\t $smarty->trigger_error(\"sugarvar: missing 'subject' parameter\");\n\t return;\n\t} \n\t$fields = empty($params['fields']) ? $smarty->get_template_vars('fields') : $params['fields'];\n $subject = replace_sugar_vars($params['subject'], $fields, !empty($params['use_curly']));\n\tif (!empty($params['assign']))\n\t{\n\t\t$smarty->assign($params['assign'], $subject);\n\t\treturn '';\n\t}\n\t\n\treturn $subject;\n}",
"protected function setVarToTemplates()\n {\n $this->templates->set_tpl($this->varName, $this->checkNewCommondaty());\n }",
"public function setVarsByReference(array &$value)\n {\n $this->_contents =& $value;\n return $this;\n }"
] | [
"0.6383608",
"0.582568",
"0.5783358",
"0.57092637",
"0.5691141",
"0.5566079",
"0.5545298",
"0.5543698",
"0.55160135",
"0.546763",
"0.5465623",
"0.54495597",
"0.5397482",
"0.5372851",
"0.5364306",
"0.536316",
"0.5343946",
"0.53392595",
"0.5325619",
"0.53142554",
"0.53100157",
"0.52992654",
"0.5298789",
"0.5289992",
"0.52776605",
"0.5275762",
"0.526423",
"0.5263509",
"0.5263365",
"0.5221771"
] | 0.7091639 | 0 |
clear the given assigned template variable. | function ClearAssign($tpl_var)
{
$this->_smarty->clear_assign( $tpl_var );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clear_assign($tpl_var)\n {\n $this->clearAssign($tpl_var);\n }",
"function unset_var($name){ // unset the template variable\n\tif (isset($this->vars[$name])) unset($this->vars[$name]);\n}",
"public function clearVars()\r\n {\r\n $this->_smarty->clearAllAssign();\r\n $this->assign('this', $this);\r\n }",
"public function clearAssign(Smarty_Internal_Data $data, $tpl_var)\n {\n if (is_array($tpl_var)) {\n foreach ($tpl_var as $curr_var) {\n unset($data->tpl_vars[ $curr_var ]);\n }\n } else {\n unset($data->tpl_vars[ $tpl_var ]);\n }\n\n return $data;\n }",
"function unset_template()\r\n\t{\r\n\t\t$this->_template = null;\r\n\t\t$this->set_mode(self::OUTPUT_MODE_NORMAL);\r\n\t}",
"private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}",
"public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}",
"public function __unset($key)\n {\n\t\t$this->_setSmartyMethod('clear_assign', array($key));\n //$this->_smarty()->clear_assign($key);\n }",
"public static function clear($key = null) {\n if (is_null($key)) {\n self::$vars = array();\n }\n else {\n unset(self::$vars[$key]);\n }\n }",
"public function __unset($key)\r\n {\r\n $this->_smarty->clearAssign($key);\r\n }",
"function destroy()\n\t{\n\t\t$this->_tpldata = array('.' => array(0 => array()));\n\t\t$this->vars = &$this->_tpldata['.'][0];\n\t\t$this->xs_started = 0;\n\t}",
"public function delTemplateData() {\r\n\t\t$this->templateData = [];\r\n\t}",
"public function removeVariable($tv);",
"function tagReset () {\n if (is_object($this->tptPointer)) \n $this->say($this->tptPointer->templateReset());\n }",
"function ClearAllAssign()\n {\n $this->_smarty->clear_all_assign();\n }",
"public function __unset($key) {\n\t\t$this->vars[$key] = '';\n\t}",
"public function testClearAllAssings()\n {\n $varsValues = $this->view->templateVars();\n $this->assertEquals(2, count($varsValues));\n \n // Clear the assings and get again.\n $this->view->clearAllAssign();\n $varsValues = $this->view->templateVars();\n \n $this->assertEquals(0, count($varsValues));\n }",
"public function clearTemplateCache()\n {\n $this->loadedTemplates = array();\n }",
"public function clear_menu( )\n {\n $this->variables = array();\n }",
"public function clear_cache($template=FALSE) {\n\t\tif (!$template) {\n\t\t\t$this->smarty->clear_all_cache();\n\t\t} else {\n\t\t\t$this->smarty->clear_cache($template);\n\t\t}\n\t}",
"function clear() {}",
"public function clear( );",
"public function clear()\n\t{\n\t\t$this->stmt = null;\n\t\t$this->str = null;\n\t}",
"function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;"
] | [
"0.7566433",
"0.7191758",
"0.6726413",
"0.67050195",
"0.6686058",
"0.66438085",
"0.6436306",
"0.6413052",
"0.634062",
"0.633813",
"0.6132039",
"0.6110073",
"0.5961733",
"0.59504163",
"0.59501046",
"0.5922669",
"0.5908307",
"0.585374",
"0.5843332",
"0.5801497",
"0.5779502",
"0.5758576",
"0.5755115",
"0.57455313",
"0.5738571",
"0.5738571",
"0.5738571",
"0.5738571",
"0.5738571",
"0.5738571"
] | 0.7491993 | 1 |
Registers modifier to be used in templates | function RegisterModifier($modifier, $modifier_impl)
{
$this->_smarty->register_modifier($modifier, $modifier_impl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setModifiersFromTags(): void\n {\n $hasFinalTag = count($this->getTags('final')) > 0;\n $hasProtectedTag = count($this->getTags('protected')) > 0;\n $hasPrivateTag = count($this->getTags('private')) > 0;\n $hasPublicTag = count($this->getTags('public')) > 0;\n $hasStaticTag = count($this->getTags('static')) > 0;\n $accessTags = $this->getTags('access');\n $hasAccessTag = count($accessTags) > 0;\n $flags = $this->modifiers ?? 0;\n\n if ($hasAccessTag) {\n $accessTag = strtolower(trim(implode('', $accessTags[0])));\n if ($accessTag === 'protected') {\n $hasProtectedTag = true;\n } elseif ($accessTag === 'private') {\n $hasPrivateTag = true;\n } elseif ($accessTag === 'public') {\n $hasPublicTag = true;\n }\n }\n\n if ($hasFinalTag) {\n $flags |= self::MODIFIER_FINAL;\n }\n if ($hasProtectedTag) {\n $flags |= self::MODIFIER_PROTECTED;\n }\n if ($hasPrivateTag) {\n $flags |= self::MODIFIER_PRIVATE;\n }\n if ($hasPublicTag) {\n $flags |= self::MODIFIER_PUBLIC;\n }\n if ($hasStaticTag) {\n $flags |= self::MODIFIER_STATIC;\n }\n\n $this->setModifiers($flags);\n }",
"public function addModifier($modifier): self\n {\n\t\t$this->modifiers[] = $modifier;\n\t\treturn $this;\n\t}",
"function apply_modifier($mod, $body){\n $modifier = 'modifier.'.$mod.'.php';\n if(($m_path = $this->find_path($modifier)) !== false){\n require_once($m_path);\n $mod_func = 'smarty_modifier_'.$mod;\n $body = $mod_func($body);\n //$post['applied_modifier'] = $mod;\n }\n return $body;\n }",
"public function modifier($modifiers, $overwrite = false);",
"protected function setModifier($modifier) {\n\t\tPHPParser_Node_Stmt_Class::verifyModifier ( $this->type, $modifier );\n\t\t$this->type |= $modifier;\n\t}",
"public function register() {\n\n\n Blade::directive('hasFeature', function ($expression) {\n return \"<?php if (app('switchover')->toggleValue({$expression}, false)) : ?>\";\n });\n\n \n Blade::directive('hasConditionalFeature', function ($expression) {\n\n $args = collect(explode(',', $expression))->map(function ($item) {\n return trim($item);\n });\n\n $name = $args->get(0);\n $context = join(', ', $args->slice(1)->toArray());\n \n return \"<?php if (app('switchover')->toggleValue({$name}, false, new \\Switchover\\Context({$context}))) : ?>\";\n });\n\n Blade::directive('endHasFeature', function () {\n return \"<?php endif; ?>\";\n });\n\n\n }",
"public function getModifier()\n {\n return $this->modifier;\n }",
"public function getModifier()\n {\n return $this->modifier;\n }",
"public function getModifier()\n {\n return $this->modifier;\n }",
"public function getModifier()\n {\n return $this->modifier;\n }",
"private function outputModifiers($sTag) {\n\t\t$m = $this->modifiers;\n\t\t$this->modifiers = array();\n\t\t$thisControl = $this->oBeaut->getControlSeq();\n\t\t$prevControl = $this->oBeaut->getControlSeq(1);\n\t\t\n\t\tif (($thisControl == T_CLASS || $prevControl == T_CLASS) && strtolower($sTag) != 'class') {\n\t\t\tif (! (isset($m['public']) || isset($m['protected']) || isset($m['private']))) {\n\t\t\t\t$m['public'] = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach (self::$modifierOrder as $modifier) {\n\t\t\tif (isset($m[$modifier])) {\n\t\t\t\t$this->oBeaut->add($modifier . ' ');\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->oBeaut->add($sTag . ' ');\n\t}",
"public function visitModifier(\n /*IModifier*/ $node) /*: mixed*/ {\n return $node->getName();\n }",
"public function addModifier(array &$modifiers, $type, $name) {\n $class = '';\n switch ($type) {\n case 'property':\n $original_class = '\\Drupal\\realistic_dummy_content_api\\includes\\RealisticDummyContentTextProperty';\n $attribute_type = $name;\n break;\n\n case 'field':\n $original_class = '\\Drupal\\realistic_dummy_content_api\\includes\\RealisticDummyContentValueField';\n $field_info = Framework::instance()->fieldInfoField($name);\n $attribute_type = $field_info['type'];\n break;\n\n default:\n return;\n }\n $class = $original_class;\n\n $info = [\n 'type' => $type,\n 'machine_name' => $attribute_type,\n 'entity' => $this->getEntity(),\n 'field_name' => $name,\n ];\n Framework::instance()->alter('realistic_dummy_content_attribute_manipulator', $class, $info);\n\n // PHPStan complains that \"Negated boolean expression is always false.\",\n // however it is technically possible for an alter hook to set the class\n // to NULL or something.\n // @phpstan-ignore-next-line\n if (!$class) {\n // third-parties might want to signal that certain fields cannot be\n // modified (they can be too complex for the default modifier and do not\n // yet have a custom modifier).\n return;\n }\n // @todo check if class is abstract\n elseif (class_exists($class)) {\n $modifier = new $class($this, $name);\n }\n else {\n // @phpstan-ignore-next-line\n \\Drupal::logger('realistic_dummy_content_api')->notice('Class does not exist: @c. This is probably because a third-party module has implemented realistic_dummy_content_api_realistic_dummy_content_attribute_manipular_alter() with a class that cannot be implemented. @original will used instead.', [\n '@c' => $class,\n '@original' => $original_class,\n ]);\n $modifier = new $original_class($this, $name);\n }\n\n if (isset($modifier)) {\n // It's OK to index by name because attributes and fields can never have\n // the same names.\n $modifiers[$name] = $modifier;\n }\n }",
"public function register()\n {\n /**\n * it helps to define variable in Blade using '@def' :: wahid \n */\n Blade::extend(function($value) {\n return preg_replace('/\\@def(.+)/', '<?php ${1}; ?>', $value);\n });\n }",
"public function setModifiers(int $modifiers): void\n {\n $this->modifiers = $modifiers;\n }",
"function testReplaceWithModifiers(){\n\t\t#mdx:replaceWithModifiers\n\t\tParam::get('style')\n\t\t\t->context(['style'=>'CamelCase'])\t\n\t\t\t->filters()\n\t\t\t->replace('/camelcase/i', 'under_scores');\n\n\t\t$output = Param::get('style')->process()->output;\n\t\t#/mdx var_dump($output)\n\n\t\t$this->assertEquals('under_scores',$output);\n\t}",
"function printModifier($modifer){\n if($modifer === \"public\"){\n echo \"+ \";\n }\n else if($modifer === \"private\"){\n echo \"- \";\n }\n else{\n echo \"# \";\n }\n }",
"private function getModifierConverter(): Closure\n {\n return function (Token $token) {\n $name = strtoupper($token->getValue());\n\n return constant(\"ReflectionMethod::IS_{$name}\");\n };\n }",
"public function registerMarkupTags()\n\t{\n\t\treturn [\n\t\t\t'functions' => [\n\t\t\t\t'image_field_path'\t\t\t\t\t\t=> ['AxC\\Framework\\Helpers\\ImageField', 'path'\t\t\t\t\t\t\t],\n\t\t\t\t'image_field_thumb'\t\t\t\t\t\t=> ['AxC\\Framework\\Helpers\\ImageField', 'thumb'\t\t\t\t\t\t\t],\n\t\t\t\t'image_field_path_settings'\t\t=> ['AxC\\Framework\\Helpers\\ImageField', 'pathFromSettings'\t],\n\t\t\t\t'image_field_thumb_settings'\t=> ['AxC\\Framework\\Helpers\\ImageField', 'thumbFromSettings'\t]\n\t\t\t]\n\t\t];\n\t}",
"private function registerDirectives()\n {\n $directives = require base_path('/Neputer/Supports/directives.php');\n\n collect($directives)->each(function ($item, $key) {\n Blade::directive($key, $item);\n });\n }",
"protected function registerExtension()\n {\n $this->app->make('view')->addExtension($this->app->make('twig.extension'), 'twig', function () {\n return $this->app->make('twig.engine');\n });\n }",
"public function hookActionDispatcher()\r\n {\r\n $this->context->smarty->registerPlugin('modifier', 'formaatButton', array('SmartyModifiersClass', 'formaatButton'));\r\n }",
"public function setModifiers($modifiers)\n {\n if (0 === ($modifiers & self::VISIBILITY_MODIFER_MASK)) {\n $modifiers |= self::MODIFIER_PUBLIC;\n }\n\n $this->modifiers = $modifiers;\n }",
"protected function registerBladeExtensions()\n {\n $this->app->afterResolving('blade.compiler', function (BladeCompiler $bladeCompiler) {\n // @role\n $bladeCompiler->directive('role', function ($role) {\n return \"<?php if(auth()->check() && auth()->user()->hasRole({$role})): ?>\";\n });\n $bladeCompiler->directive('endrole', function () {\n return '<?php endif; ?>';\n });\n // @owner\n $bladeCompiler->directive('owner', function ($id) {\n return \"<?php if(auth()->check() && auth()->user()->isOwner({$id})): ?>\";\n });\n $bladeCompiler->directive('endOwner', function () {\n return '<?php endif; ?>';\n });\n });\n }",
"public function registerMarkupTags()\n {\n return [\n 'functions' => [\n 'form_select_country' => ['RainLab\\Location\\Models\\Country', 'formSelect'],\n 'form_select_state' => ['RainLab\\Location\\Models\\State', 'formSelect']\n ]\n ];\n }",
"protected function setModifier($modifier, $line) {\n\t\tClassStatement::verifyModifier($this->type, $modifier, $line);\n\t\t$this->type |= $modifier;\n\t}",
"public function getAddTpl(){\n return $this->templates['add'];\n }",
"function yy_r68()\n {\n $this->_retvalue = $this->compiler->compileTag('Internal_Modifier', array(), array('value' => $this->yystack[$this->yyidx + - 1]->minor, 'modifier_list' => $this->yystack[$this->yyidx + 0]->minor));\n }",
"public function getBaseModifier()\n {\n return $this->getRequest()->getBaseModifier();\n }",
"public static function set()\n {\n add_filter( 'template_include', [ __CLASS__, 'add' ] );\n }"
] | [
"0.60812134",
"0.60806346",
"0.58428794",
"0.58326817",
"0.5765597",
"0.5507245",
"0.54941803",
"0.54941803",
"0.54941803",
"0.54941803",
"0.54858977",
"0.54552186",
"0.5378351",
"0.5375182",
"0.53622687",
"0.5288103",
"0.52584124",
"0.5245696",
"0.5225494",
"0.52151906",
"0.5162665",
"0.51271516",
"0.51170564",
"0.5087949",
"0.5025687",
"0.5018882",
"0.5007471",
"0.49890003",
"0.4981092",
"0.4945052"
] | 0.6727884 | 0 |
Registers a resource to fetch a template | function RegisterResource($type, $functions)
{
$this->_smarty->register_resource($type, $functions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function registerResource($id, $resource);",
"public function resourceTemplateCreate(Event $event){\n\n $request = $event->getParam('request');\n $operation = $request->getOperation();\n $em = $this->getServiceLocator()->get('Omeka\\EntityManager');\n\n\n if ($operation == 'create') {\n $resource_template = $event->getParam('entity');\n $teams = $em->getRepository('Teams\\Entity\\Team');\n foreach ($request->getContent()['o-module-teams:Team'] as $team_id):\n $team = $teams->findOneBy(['id'=>$team_id]);\n $trt = new TeamResourceTemplate($team,$resource_template);\n $em->persist($trt);\n endforeach;\n $em->flush();\n }\n\n }",
"abstract protected function createResource();",
"static private function registerResource(SimpleRdfResource $resource) {\r\n SimpleRdf::$resources[]=$resource;\r\n }",
"protected function registerResources(): void\n {\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'fairqueue');\n }",
"protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }",
"protected function registerResources()\n {\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'documentation');\n }",
"public function __construct(Template $resource)\n {\n parent::__construct($resource);\n }",
"protected function createResource()\n {\n $this->call('make:resource', array_filter([\n 'name' => $this->getNameInput().'Resource',\n ]));\n }",
"protected function registerResources()\n {\n $this->loadJsonTranslationsFrom(__DIR__ . '/../../resources/lang');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'knet');\n }",
"public function register()\n {\n Resource::withoutWrapping();\n }",
"protected function registerResources()\n {\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'laratrust');\n }",
"abstract protected function getNewResource();",
"public function get_resource();",
"protected function registerResources()\n {\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'a-review');\n $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'a-review');\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n $this->loadRoutesFrom(__DIR__ . '/../routes/web.php');\n }",
"abstract protected function initResource();",
"public function instantiateResource($resource, $directory = null);",
"protected function addResource(Resource $resource)\n {\n $this->view->addResource($resource);\n }",
"function get_template()\n {\n }",
"public function testCreatesTemplateAssemblyBasedOnResourceName()\n {\n $templateAssembly = $this->checkGeneratedTemplateAssembly();\n $this->assertEquals('FooResource.GET.html.php', $templateAssembly->getFile());\n }",
"public static function loadTemplateFromAPI(\\WP_REST_Request $req){\n $module = $req->get_param('module');\n $location = $req->get_param('location') ? $req->get_param('location') : 'default';\n $type = $req->get_param('type') ? $req->get_param('type') : 'default';\n $args = empty((array)$req->get_param('args')) ? [] : (array)$req->get_param('args');\n $args['load_as_buffer'] = true;\n $template = new self($module, $location, $type, $args);\n $template->isApi = true;\n $result['template'] = $template->loadTemplate();\n\n return $template->apiReturn($result);\n }",
"abstract public function resource($resource);",
"protected function _init_resource()\n\t{\n\t\t$resource_id = $this->request->param('id');\n\t\tif (!$resource_id)\n\t\t{\n\t\t\t$this->session->set('error', 'Invalid resource id');\n\t\t\t$this->request->redirect('/admin/resource');\n\t\t}\n\t\t\n\t\t// check if resource exists\n\t\t$this->resource = Sprig::factory('resource', array(\n\t\t\t'resource_id' => $resource_id\n\t\t));\n\t\t\n\t\t$this->resource->load();\n\t\tif (!$this->resource->loaded())\n\t\t{\n\t\t\t$this->session->set('error', 'Resource not found');\n\t\t\t$this->request->redirect('/admin/resource');\n\t\t}\n\t}",
"public function loadTemplate()\n\t\t{\n\t\t}",
"protected function registerResources(): void\n {\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'support-chat');\n }",
"public function resolve($template);",
"abstract public function resource();",
"public function registerResourceServer()\n {\n $this->app['oauth2.resource-server'] = $this->app->share(function ($app) {\n\n $server = $app->make('League\\OAuth2\\Server\\ResourceServer');\n\n $server->setRequest($app['request']);\n\n return $server;\n\n });\n }",
"protected function createResource()\n {\n $this->call('wizard:resource', [\n 'name' => $this->argument('name'),\n ]);\n }",
"function register(){\n echo Template::instance()->render('gatorLock/register.php');\n}"
] | [
"0.6490403",
"0.59619457",
"0.59231186",
"0.5901292",
"0.5896978",
"0.5744783",
"0.5728302",
"0.5714195",
"0.56429535",
"0.56036353",
"0.55760074",
"0.5564926",
"0.55027294",
"0.54903",
"0.5484976",
"0.54483396",
"0.5439616",
"0.5429816",
"0.5421999",
"0.54101574",
"0.5402479",
"0.5398544",
"0.53876925",
"0.5379686",
"0.537913",
"0.5365209",
"0.5358262",
"0.5355222",
"0.5353371",
"0.5308498"
] | 0.59629935 | 1 |
Registers a prefilter function to apply to a template before compiling | function RegisterPrefilter($function)
{
$this->_smarty->register_prefilter($function);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function register_prefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['pre'][$_name] = $function;\n}",
"function _add_template_loader_filters()\n {\n }",
"function RegisterPostfilter($function)\n {\n $this->_smarty->register_postfilter($function);\n }",
"function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}",
"public function addFilter(callable $filter);",
"function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }",
"function register_variablefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['variable'][$_name] = $function;\n}",
"function UnregisterPrefilter($function)\n {\n $this->_smarty->unregister_prefilter($function);\n }",
"function add_to_twig($twig){\n\t\t$twig->addExtension(new Twig_Extension_StringLoader());\n\t\t// $twig->addFilter('myfoo', new Twig_Filter_Function('myfoo'));\n\t\treturn $twig;\n\t}",
"function RegisterOutputfilter($function)\n {\n $this->_smarty->register_outputfilter($function);\n }",
"function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }",
"function add_to_twig( $twig ) {\n\t\t// $twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t// $twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"function add_filters()\n {\n }",
"private function setup_filters() {\n add_filter( 'timber/twig', function( $twig ) {\n\n // ped_icon()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'icon',\n [ __CLASS__, 'get_icon' ]\n ) );\n\n // ped_logo()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'logo',\n [ __CLASS__, 'get_logo' ]\n ) );\n\n return $twig;\n }, 99 );\n }",
"function register($metatype, callable $filefilter) {\n\t\tstatic::$filefilters[$metatype] = $filefilter;\n\t}",
"function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}",
"function _applyPrefilters ($text) {\r\n foreach ($this->_prefilters as $filter) {\r\n if (is_callable ($filter)) {\r\n $ntext = call_user_func ($filter, $text);\r\n if (is_string ($ntext)) {\r\n $text = $ntext;\r\n }\r\n }\r\n }\r\n return $text;\r\n }",
"public function filter_timber_twig_add_functions( $twig ) {\n // Function to check if doing email and alternate strings\n $twig->addFunction( new \\Twig_SimpleFunction( 'if_email', function( $email_str, $standard_str ) {\n if ( $this->is_email() ) {\n return $email_str;\n }\n return $standard_str;\n } ) );\n\n // Get the current Unix epoch time in milliseconds\n $twig->addFunction( new \\Twig_SimpleFunction( 'now', function() {\n return round( microtime( true ) * 1000 );\n } ) );\n\n // Add WordPress' checked() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'checked', function( $checked, $current = true ) {\n return checked( $checked, $current );\n } ) );\n\n // Add WordPress' selected() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'selected', function( $selected, $current = true ) {\n return selected( $selected, $current );\n } ) );\n\n // Add WordPress' disabled() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'disabled', function( $disabled, $current = true ) {\n return disabled( $disabled, $current );\n } ) );\n\n return $twig;\n }",
"public function register_filters() {\n\n\t\t}",
"function acf_enable_filters($filters = array())\n{\n}",
"protected function addTemplateFunctionConfigs()\n {\n // TODO: add twig template function configs\n }",
"public function test_add_filter_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, function() {\n return rand_str();\n } );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}",
"public function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );\n\t\treturn $twig;\n\t}",
"function acf_enable_filter($name = '')\n{\n}",
"public function filter_timber_twig_add_basic_filters( $twig ) {\n $function_names = [\n // PHP Functions\n 'addslashes', // http://php.net/manual/en/function.addslashes.php\n 'nl2br', // http://php.net/manual/en/function.nl2br.php\n\n // WordPress functions\n 'antispambot', // https://developer.wordpress.org/reference/functions/antispambot/\n 'esc_attr', // https://developer.wordpress.org/reference/functions/esc_attr/\n 'esc_html', // https://developer.wordpress.org/reference/functions/esc_html/\n 'esc_url', // https://developer.wordpress.org/reference/functions/esc_url/\n 'esc_js', // https://developer.wordpress.org/reference/functions/esc_js/\n 'esc_textarea', // https://developer.wordpress.org/reference/functions/esc_textarea/\n 'sanitize_email', // https://developer.wordpress.org/reference/functions/sanitize_email/\n ];\n foreach ( $function_names as $func ) {\n if ( function_exists( $func ) ) {\n $twig->addFilter( new \\Twig_SimpleFilter( $func, $func ) );\n }\n }\n return $twig;\n }",
"function filter_load() {\r\n\t\tadd_action( current_filter(), array( $this, 'setup_vars' ), 20 );\r\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'get_select' ) );\r\n\t\tadd_filter( \"manage_taxonomies_for_{$this->post_type}_columns\", array( $this, 'add_columns' ) );\r\n\t}",
"function add_to_twig($twig) {\n $twig->addExtension(new \\Twig_Extension_StringLoader());\n $twig->addFunction(new \\Twig_SimpleFunction('script', 'CodekippleWPTheme\\Timber\\Site\\script'));\n $twig->addFunction(new \\Twig_SimpleFunction('css', 'CodekippleWPTheme\\Timber\\Site\\css'));\n $twig->addFilter('body_class', new \\Twig_Filter_Function('CodekippleWPTheme\\Timber\\Site\\body_class'));\n\n return $twig;\n }"
] | [
"0.7772184",
"0.6464766",
"0.6291857",
"0.62652165",
"0.6119213",
"0.61075324",
"0.610526",
"0.59339553",
"0.59259903",
"0.5877378",
"0.58709174",
"0.58709174",
"0.58709174",
"0.58544",
"0.57992023",
"0.5778107",
"0.57774925",
"0.57272476",
"0.568918",
"0.56596994",
"0.5609149",
"0.5519953",
"0.5473757",
"0.54426384",
"0.5417593",
"0.5416106",
"0.54026705",
"0.53810006",
"0.5379099",
"0.5340714"
] | 0.77226025 | 1 |
Unregisters a prefilter function | function UnregisterPrefilter($function)
{
$this->_smarty->unregister_prefilter($function);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UnregisterPostfilter($function)\n {\n $this->_smarty->unregister_postfilter( $function );\n }",
"function UnregisterOutputfilter($function)\n {\n $this->_smarty->unregister_outputfilter($function);\n }",
"function remove_filter($hook_name, $callback, $priority = 10)\n {\n }",
"public function removeFilters();",
"public function remove()\n {\n foreach ($this->filters as $filter) {\n $filterWithoutAcceptedArguments = array_slice($filter, 0, 3);\n call_user_func_array($this->removeCallback, $filterWithoutAcceptedArguments);\n }\n }",
"function remove_all_filters($hook_name, $priority = \\false)\n {\n }",
"function remove_filter ($filter,$remove) \n{\n unset($filter[$remove]);\n return $filter;\n}",
"function RegisterPrefilter($function)\n {\n $this->_smarty->register_prefilter($function);\n }",
"public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function removeFilter($key);",
"public function remove_filter($hook_name, $callback, $priority)\n {\n }",
"public function removeAllFilters();",
"function acf_disable_filters()\n{\n}",
"function reset_filters()\r\n{\r\n\t//uitzoeken of het in js of php gedaan word\t\r\n}",
"protected function removeFilter($hook, $callback, $priority = 10)\n\t{\n\t\treturn remove_filter($hook,$callback,$priority);\n\t}",
"function clear_filters($filterName = null)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->clearFilters($filterName);\n }\n}",
"public function removeFilter(string $name);",
"function remove_anonymous_object_filter( $tag, $class, $method ){\n\t$filters = isset($GLOBALS['wp_filter'][ $tag ])? $GLOBALS['wp_filter'][ $tag ] : false;\n\n\tif (empty($filters)){\n\t\treturn;\n\t}\n\n\tforeach ( $filters as $priority => $filter )\n\t{\n\t\tforeach ( $filter as $identifier => $function )\n\t\t{\n\t\t\tif ( is_array( $function)\n\t\t\t\tand is_a( $function['function'][0], $class )\n\t\t\t\tand $method === $function['function'][1]\n\t\t\t)\n\t\t\t{\n\t\t\t\tremove_filter(\n\t\t\t\t\t$tag,\n\t\t\t\t\tarray ( $function['function'][0], $method ),\n\t\t\t\t\t$priority\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}",
"function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}",
"public function filter($function) {\n $this->_hash= array_filter($this->_hash, $function);\n }",
"public function test_remove_filter_priority() {\n $hook = rand_str();\n $function = rand_str();\n // Random priority but not 10\n do {\n $priority = rand( 1,100 );\n } while ( $priority == 10 );\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function, $priority );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertFalse( $removed );\n\n $removed = yourls_remove_filter( $hook, $function, $priority );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function removeFilter(string $name): void;",
"function dacig_deregister_filters( $status ) {\n\tremove_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tremove_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $status;\n}",
"function register_prefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['pre'][$_name] = $function;\n}",
"public function remove(FilterInterface ...$filters);",
"public function filterNot(callable $hof);",
"abstract public function filter(callable $func);",
"protected function remove_filter( $tag, $function_to_remove, $priority = 10 ) {\n\t\treturn \\remove_filter( $tag, [ $this, $function_to_remove ], $priority );\n\t}",
"public function unsetProvider();",
"public function removeFilter( string $tag, string $function, int $priority = 10, $replacement = false ): self\n {\n\n $this->filters[] = [\n 'tag' => $tag,\n 'function' => $function,\n 'priority' => $priority,\n 'replacment' => $replacement,\n ];\n\n return $this;\n\n }"
] | [
"0.71847147",
"0.6910196",
"0.68760026",
"0.6465871",
"0.62737244",
"0.61718947",
"0.6135773",
"0.6060782",
"0.6057684",
"0.60540015",
"0.60170066",
"0.5993051",
"0.5976774",
"0.59508926",
"0.5862169",
"0.58367765",
"0.5784914",
"0.5777473",
"0.5769011",
"0.5754283",
"0.57109743",
"0.5681446",
"0.56814355",
"0.56758916",
"0.56695",
"0.56681323",
"0.5629105",
"0.5623453",
"0.5583739",
"0.55522263"
] | 0.8121243 | 0 |
Registers a postfilter function to apply to a compiled template after compilation | function RegisterPostfilter($function)
{
$this->_smarty->register_postfilter($function);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UnregisterPostfilter($function)\n {\n $this->_smarty->unregister_postfilter( $function );\n }",
"public function _post_filter()\n {\n }",
"function RegisterOutputfilter($function)\n {\n $this->_smarty->register_outputfilter($function);\n }",
"function dacig_register_filters( $output ) {\n\tadd_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tadd_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $output;\n}",
"function register_prefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['pre'][$_name] = $function;\n}",
"function after_filter($action, $args) {\n }",
"function _applyPostfilters ($text) {\r\n foreach ($this->_postfilters as $filter) {\r\n if (is_callable ($filter)) {\r\n $ntext = call_user_func ($filter, $text);\r\n if (is_string ($ntext)) {\r\n $text = $ntext;\r\n }\r\n }\r\n }\r\n return $text;\r\n }",
"function RegisterPrefilter($function)\n {\n $this->_smarty->register_prefilter($function);\n }",
"function _add_template_loader_filters()\n {\n }",
"protected function postFilter($filterChain)\n {\n }",
"protected function register_filters(){\n\t\tadd_filter(\"the_content\", array($this, \"filter_single_content_after\"), 0);\n\t}",
"function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }",
"function smarty_postfilter_strip($compiled, &$smarty)\n{\n\treturn preg_replace('/<\\?php\\s+\\?>/', '', $compiled);\n}",
"function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}",
"function UnregisterOutputfilter($function)\n {\n $this->_smarty->unregister_outputfilter($function);\n }",
"function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }",
"public function afterFilter()\n\t{\n\n\t}",
"public function filter_timber_twig_add_functions( $twig ) {\n // Function to check if doing email and alternate strings\n $twig->addFunction( new \\Twig_SimpleFunction( 'if_email', function( $email_str, $standard_str ) {\n if ( $this->is_email() ) {\n return $email_str;\n }\n return $standard_str;\n } ) );\n\n // Get the current Unix epoch time in milliseconds\n $twig->addFunction( new \\Twig_SimpleFunction( 'now', function() {\n return round( microtime( true ) * 1000 );\n } ) );\n\n // Add WordPress' checked() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'checked', function( $checked, $current = true ) {\n return checked( $checked, $current );\n } ) );\n\n // Add WordPress' selected() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'selected', function( $selected, $current = true ) {\n return selected( $selected, $current );\n } ) );\n\n // Add WordPress' disabled() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'disabled', function( $disabled, $current = true ) {\n return disabled( $disabled, $current );\n } ) );\n\n return $twig;\n }",
"function did_filter($hook_name)\n {\n }",
"protected function after_filter()\n {\n $this->render('footer.php');\n }",
"function add_filters()\n {\n }",
"function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}",
"function register_variablefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['variable'][$_name] = $function;\n}",
"function UnregisterPrefilter($function)\n {\n $this->_smarty->unregister_prefilter($function);\n }",
"private function setup_filters() {\n add_filter( 'timber/twig', function( $twig ) {\n\n // ped_icon()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'icon',\n [ __CLASS__, 'get_icon' ]\n ) );\n\n // ped_logo()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'logo',\n [ __CLASS__, 'get_logo' ]\n ) );\n\n return $twig;\n }, 99 );\n }",
"function add_to_twig( $twig ) {\n\t\t// $twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t// $twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"public function get_name()\n {\n return 'post-filter';\n }",
"function register_block_core_post_template()\n {\n }",
"function add_to_twig($twig){\n\t\t$twig->addExtension(new Twig_Extension_StringLoader());\n\t\t// $twig->addFilter('myfoo', new Twig_Filter_Function('myfoo'));\n\t\treturn $twig;\n\t}",
"protected function executeRenderPostTransformHook() {}"
] | [
"0.6769889",
"0.67541254",
"0.64160013",
"0.61654174",
"0.6124806",
"0.6036429",
"0.5968456",
"0.5938088",
"0.58840364",
"0.5806517",
"0.5777778",
"0.5724347",
"0.567673",
"0.5592164",
"0.55697477",
"0.5513224",
"0.5494791",
"0.54361206",
"0.54172826",
"0.5411904",
"0.53983426",
"0.531215",
"0.52933365",
"0.5287966",
"0.5271787",
"0.52686703",
"0.5249521",
"0.5238338",
"0.52203834",
"0.5219524"
] | 0.7855613 | 0 |
Unregisters a postfilter function | function UnregisterPostfilter($function)
{
$this->_smarty->unregister_postfilter( $function );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UnregisterPrefilter($function)\n {\n $this->_smarty->unregister_prefilter($function);\n }",
"function UnregisterOutputfilter($function)\n {\n $this->_smarty->unregister_outputfilter($function);\n }",
"function remove_filter($hook_name, $callback, $priority = 10)\n {\n }",
"public function _post_filter()\n {\n }",
"function RegisterPostfilter($function)\n {\n $this->_smarty->register_postfilter($function);\n }",
"function after_filter($action, $args) {\n }",
"public function removeFilters();",
"public function afterFilter()\n\t{\n\n\t}",
"function dacig_deregister_filters( $status ) {\n\tremove_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tremove_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $status;\n}",
"function did_filter($hook_name)\n {\n }",
"function remove_anonymous_object_filter( $tag, $class, $method ){\n\t$filters = isset($GLOBALS['wp_filter'][ $tag ])? $GLOBALS['wp_filter'][ $tag ] : false;\n\n\tif (empty($filters)){\n\t\treturn;\n\t}\n\n\tforeach ( $filters as $priority => $filter )\n\t{\n\t\tforeach ( $filter as $identifier => $function )\n\t\t{\n\t\t\tif ( is_array( $function)\n\t\t\t\tand is_a( $function['function'][0], $class )\n\t\t\t\tand $method === $function['function'][1]\n\t\t\t)\n\t\t\t{\n\t\t\t\tremove_filter(\n\t\t\t\t\t$tag,\n\t\t\t\t\tarray ( $function['function'][0], $method ),\n\t\t\t\t\t$priority\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}",
"function remove_all_filters($hook_name, $priority = \\false)\n {\n }",
"protected function postFilter($filterChain)\n {\n }",
"function acf_disable_filters()\n{\n}",
"public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function remove()\n {\n foreach ($this->filters as $filter) {\n $filterWithoutAcceptedArguments = array_slice($filter, 0, 3);\n call_user_func_array($this->removeCallback, $filterWithoutAcceptedArguments);\n }\n }",
"function reset_filters()\r\n{\r\n\t//uitzoeken of het in js of php gedaan word\t\r\n}",
"public function postProcessResetFilterModules()\n {\n }",
"public function remove_filter($hook_name, $callback, $priority)\n {\n }",
"function doing_filter($hook_name = \\null)\n {\n }",
"public function removeAllFilters();",
"function remove_filter ($filter,$remove) \n{\n unset($filter[$remove]);\n return $filter;\n}",
"public function __destruct() {\n if (class_exists('\\Sleepy\\Hook')) {\n Hook::addAction($this->clean_class() . '_postprocess');\n }\n }",
"function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}",
"function RegisterOutputfilter($function)\n {\n $this->_smarty->register_outputfilter($function);\n }",
"public function remove_hooks()\n {\n }",
"public function remove_hooks()\n {\n }",
"public function test_remove_filter_priority() {\n $hook = rand_str();\n $function = rand_str();\n // Random priority but not 10\n do {\n $priority = rand( 1,100 );\n } while ( $priority == 10 );\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function, $priority );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertFalse( $removed );\n\n $removed = yourls_remove_filter( $hook, $function, $priority );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"function acf_disable_filter($name = '')\n{\n}",
"public function removeFilter(string $name): void;"
] | [
"0.7373712",
"0.7237464",
"0.7090996",
"0.7086772",
"0.70489526",
"0.6832474",
"0.6512555",
"0.6500213",
"0.6435823",
"0.6412622",
"0.6264999",
"0.626009",
"0.625832",
"0.62490124",
"0.62147146",
"0.6205635",
"0.610849",
"0.61025256",
"0.6054939",
"0.584667",
"0.582096",
"0.58061653",
"0.5791448",
"0.5747782",
"0.5728811",
"0.5726157",
"0.5726157",
"0.5722335",
"0.5706159",
"0.56873125"
] | 0.84386104 | 0 |
Registers an output filter function to apply to a template output | function RegisterOutputfilter($function)
{
$this->_smarty->register_outputfilter($function);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UnregisterOutputfilter($function)\n {\n $this->_smarty->unregister_outputfilter($function);\n }",
"function output_filter($value, array $params = null) {\n return trigger_hook('output', 'filter', $params, $value);\n}",
"public function register_output_filter($callback_impl, $filter_name = '')\n {\n if (empty($filter_name)) {\n $filter_name = substr(abs(crc32(microtime(true))), 0, 8);\n }\n $this->_OUTPUT_FILTERS[$filter_name] = $callback_impl;\n }",
"function RegisterPostfilter($function)\n {\n $this->_smarty->register_postfilter($function);\n }",
"function dacig_register_filters( $output ) {\n\tadd_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tadd_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $output;\n}",
"public function output_filter()\n\t{\n\t\tglobal $output;\n\t\t$this->output = &$output;\n\n\t\t$this->frontend = new Frontend();\n\t\t$this->module = $this->frontend->run();\n\n\t\tif (strstr($this->output, \"#fixemodule\")) {\n\t\t\t$this->output = $this->replace_placeholders($this->output);\n\t\t}\n\t}",
"function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}",
"function RegisterPrefilter($function)\n {\n $this->_smarty->register_prefilter($function);\n }",
"public function register_filters() {\n\n\t\t}",
"public function _apply_output_filters($text = '')\n {\n foreach ((array) $this->_OUTPUT_FILTERS as $cur_filter) {\n if (is_callable($cur_filter)) {\n $text = call_user_func($cur_filter, $text);\n }\n }\n return $text;\n }",
"function outputFilter($data, stdClass $context) {\n for ($i = 0, $n = count($this->filters); $i < $n; $i++) {\n $data = $this->filters[$i]->outputFilter($data, $context);\n }\n return $data;\n }",
"function UnregisterPostfilter($function)\n {\n $this->_smarty->unregister_postfilter( $function );\n }",
"function register_variablefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['variable'][$_name] = $function;\n}",
"public function addFilter(callable $filter);",
"function add_filters()\n {\n }",
"private function setup_filters() {\n add_filter( 'timber/twig', function( $twig ) {\n\n // ped_icon()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'icon',\n [ __CLASS__, 'get_icon' ]\n ) );\n\n // ped_logo()\n $twig->addFunction( new \\Twig_SimpleFunction( PEDESTAL_PREFIX . 'logo',\n [ __CLASS__, 'get_logo' ]\n ) );\n\n return $twig;\n }, 99 );\n }",
"function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }",
"function register($metatype, callable $filefilter) {\n\t\tstatic::$filefilters[$metatype] = $filefilter;\n\t}",
"public function register()\n {\n Filter::register();\n }",
"function test_function_filter() {\n\t\t$var = new LiquidVariable('var | test_function_filter');\n\t\t$this->context->set('var', 1000);\n\t\t$this->context->add_filters('test_function_filter');\n\t\t$this->assertIdentical('worked', $var->render($this->context));\t\t\n\t\t\n\t}",
"function preview_theme_ob_filter_callback($matches)\n {\n }",
"function after_filter($action, $args) {\n }",
"function _add_template_loader_filters()\n {\n }",
"public static function clearOutput(): void\n {\n rex_extension::register('OUTPUT_FILTER', static function (rex_extension_point $ep) {\n $ep->setSubject(false);\n });\n }",
"protected function applyOutputFilter($value)\n {\n $filter = $this->getFormFilter();\n if ($filter) {\n $value = $filter->outputFilter($value);\n }\n \n return $value;\n }",
"function register_prefilter($smarty, $function)\n{\n $_name = (is_array($function)) ? $function[0] : $function;\n $smarty->registered_filters['pre'][$_name] = $function;\n}",
"public function register()\n {\n $this->makeFilters();\n }",
"function UnregisterPrefilter($function)\n {\n $this->_smarty->unregister_prefilter($function);\n }",
"protected function register_filters(){\n\t\tadd_filter(\"the_content\", array($this, \"filter_single_content_after\"), 0);\n\t}",
"public function test_add_filter_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, function() {\n return rand_str();\n } );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}"
] | [
"0.69695884",
"0.6760678",
"0.6554958",
"0.62653446",
"0.6249732",
"0.62006086",
"0.58895683",
"0.58121794",
"0.570733",
"0.5635212",
"0.56115025",
"0.55993056",
"0.55610776",
"0.55592966",
"0.54478925",
"0.5439415",
"0.54207575",
"0.54160315",
"0.5382728",
"0.5358419",
"0.53568137",
"0.53444266",
"0.5330028",
"0.53129274",
"0.53093535",
"0.5269255",
"0.5254243",
"0.5205296",
"0.51323795",
"0.50968534"
] | 0.82037807 | 0 |
Unregisters an outputfilter function | function UnregisterOutputfilter($function)
{
$this->_smarty->unregister_outputfilter($function);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UnregisterPostfilter($function)\n {\n $this->_smarty->unregister_postfilter( $function );\n }",
"public static function clearOutput(): void\n {\n rex_extension::register('OUTPUT_FILTER', static function (rex_extension_point $ep) {\n $ep->setSubject(false);\n });\n }",
"function UnregisterPrefilter($function)\n {\n $this->_smarty->unregister_prefilter($function);\n }",
"function RegisterOutputfilter($function)\n {\n $this->_smarty->register_outputfilter($function);\n }",
"function output_filter($value, array $params = null) {\n return trigger_hook('output', 'filter', $params, $value);\n}",
"function remove_filter($hook_name, $callback, $priority = 10)\n {\n }",
"public function removeFilters();",
"public function removeAllFilters();",
"public function output_filter()\n\t{\n\t\tglobal $output;\n\t\t$this->output = &$output;\n\n\t\t$this->frontend = new Frontend();\n\t\t$this->module = $this->frontend->run();\n\n\t\tif (strstr($this->output, \"#fixemodule\")) {\n\t\t\t$this->output = $this->replace_placeholders($this->output);\n\t\t}\n\t}",
"public function register_output_filter($callback_impl, $filter_name = '')\n {\n if (empty($filter_name)) {\n $filter_name = substr(abs(crc32(microtime(true))), 0, 8);\n }\n $this->_OUTPUT_FILTERS[$filter_name] = $callback_impl;\n }",
"public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function filterNot(callable $hof);",
"function acf_disable_filters()\n{\n}",
"function reset_filters()\r\n{\r\n\t//uitzoeken of het in js of php gedaan word\t\r\n}",
"public function unregister() {\n // Normally, there are definitely wrappers set for the ALL filter. However,\n // in some cases involving many container rebuilds (e.g. BrowserTestBase),\n // $this->wrappers may be empty although wrappers are still registered\n // globally. Thus an isset() check is needed before iterating.\n if (isset($this->wrappers[StreamWrapperInterface::ALL])) {\n foreach (array_keys($this->wrappers[StreamWrapperInterface::ALL]) as $scheme) {\n stream_wrapper_unregister($scheme);\n }\n }\n }",
"function remove_filter ($filter,$remove) \n{\n unset($filter[$remove]);\n return $filter;\n}",
"function clear_filters($filterName = null)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->clearFilters($filterName);\n }\n}",
"function remove_all_filters($hook_name, $priority = \\false)\n {\n }",
"public function remove()\n {\n foreach ($this->filters as $filter) {\n $filterWithoutAcceptedArguments = array_slice($filter, 0, 3);\n call_user_func_array($this->removeCallback, $filterWithoutAcceptedArguments);\n }\n }",
"public function filter(callable $hof);",
"public function removeFilter(string $name);",
"public function removeFilter($key);",
"function after_filter($action, $args) {\n }",
"public function removeValuesFromOutputArray(){\n\t\ttry{\n\t\t\t$this->filteredOutput = array();\n\t\t} catch (Exception $e) {\n\t\t\terror_log($e->getMessage(),3,\"/var/tmp/error.log\");\n\t\t\terror_log(\"\\n\");\n\t\t}\n\t}",
"public function unregisterOperator($operator) {}",
"function filter($callback = null);",
"public function removeFilter(string $name): void;",
"public static function cleanOutputBuffers() {}",
"public function deactivate()\n {\n if (self::$active === $this)\n {\n // Unregister output gatherers\n Output_HTMLTag::pop_parent();\n ob_end_clean();\n\n // Unregister auto renderer\n $GLOBALS['auto_render']->unregister_handler(array(self::$active, 'flush'));\n self::$active = null;\n }\n }",
"function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}"
] | [
"0.7259042",
"0.7225813",
"0.71747553",
"0.69519657",
"0.6561708",
"0.6369017",
"0.6265941",
"0.60260963",
"0.59152585",
"0.5888677",
"0.58497226",
"0.57535046",
"0.5722606",
"0.56916356",
"0.56542957",
"0.5641386",
"0.5640007",
"0.5637433",
"0.5625069",
"0.5573695",
"0.5521978",
"0.5485828",
"0.5469849",
"0.54654896",
"0.5448683",
"0.5427135",
"0.54164946",
"0.53915584",
"0.53863835",
"0.5375077"
] | 0.854554 | 0 |
load a filter of specified type and name | function LoadFilter($type, $name)
{
$this->_smarty->load_filter($type, $name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadFilter($type, $name)\n {\n $this->sm->loadFilter($type, $name);\n }",
"public function getFilter(string $name);",
"public function filterLoad($asset) {}",
"private function loadFilters()\n {\n require __DIR__.'/filters.php';\n }",
"function xh_fetchFilter($filter_name)\r\n\t{\r\n\t}",
"public function attachFilter($name = '', $filter) {\n $this->filters[$name] = new $filter;\n }",
"public function load()\n\t{\n\t\t$this->options = apply_filters($this->filterName, get_option($this->filterName));\n\t}",
"public function createFilter();",
"public function addFilter($type, $value);",
"function register($metatype, callable $filefilter) {\n\t\tstatic::$filefilters[$metatype] = $filefilter;\n\t}",
"public function getFilter(string $name) : FilterInterface\n {\n return $this->getLoader()->getFilter($name);\n }",
"abstract public function getFilterClass();",
"public function setFilter(string $filter);",
"public function __construct(\\Shield\\Filter $filter)\n {\n $this->filter = $filter;\n $this->load();\n }",
"public function filterLoad(AssetInterface $asset)\n {\n\n }",
"function applyFilterOnResource( &$resource, $filter_name='', $options=array())\n {\n if (Image_Filter::loadFilter($filter_name)){\n $class = 'Image_Filter_'.$filter_name;\n call_user_func(array($class,'applyFilterOnResource'), $resource, $options);\n }\n }",
"public function filterByName($filter) {\n if (strlen($filter) > 0) {\n $this->calcData = array_filter($this->calcData, function($item) use ($filter) {\n if (strpos($item['name'], $filter) !== false) {\n return $item;\n }\n });\n }\n }",
"public function setFilter($filter){ }",
"public static function get($className) {\n $cache = FilterCache::getInstance();\n \n if(is_null($filter = $cache->get($className))) {\n $filter = FilterFactory::factory($className);\n $cache->add($filter);\n }\n \n return $filter;\n }",
"public function loadFilteredPolicy(Model $model, $filter) : void;",
"public function getFilter();",
"public function getFilter();",
"protected function addDefinedFilter($name, $type, $attributeIdentifier=null)\n {\n if (is_array($type)) {\n if (isset($type['type'])) {\n $attributeIdentifier = Arr::get($type, 'attribute');\n $type = Arr::get($type, 'type');\n } else{\n if (isset($type[1])) {\n $attributeIdentifier = $type[1];\n }\n $type = $type[0];\n }\n }\n if (!$attributeIdentifier) {\n $attributeIdentifier = $name;\n }\n if (!is_object($type)) {\n $operator = '=';\n $pre = array();\n $post = array();\n if (preg_match(\"|^([^:]+)((:([^:]+))+)?$|\", $attributeIdentifier, $matches)) {\n if (isset($matches[2])) {\n $ops = explode(\":\", substr($matches[2], 1));\n $attributeIdentifier = $matches[1];\n $inPre = true;\n foreach ($ops as $modifier) {\n if (in_array($modifier, \\Aplia\\Content\\Filter\\NestedFilter::$ops)) {\n $operator = $modifier;\n $inPre = false;\n } else if ($inPre) {\n $pre[] = $modifier;\n } else {\n $post[] = $modifier;\n }\n }\n if (!strlen($operator)) {\n $operator = '=';\n }\n }\n }\n\n if (preg_match(\"/^(.+):(.+)$/\", $attributeIdentifier, $matches)) {\n $attributeIdentifier = $matches[1];\n $operator = $matches[2];\n }\n $filterParams = array(\n 'contentAttribute' => $attributeIdentifier,\n 'operator' => $operator\n );\n if ($pre) {\n $filterParams['fieldModifiers'] = $pre;\n }\n if ($post) {\n $filterParams['valueModifiers'] = $post;\n }\n if ($type == 'int') {\n $filter = new IntegerFieldFilter($filterParams);\n } elseif ($type == 'bool') {\n $filter = new BoolFieldFilter($filterParams);\n } elseif ($type == 'string') {\n $filter = new StringFieldFilter($filterParams);\n } else {\n throw new FilterTypeError(\"Unsupported filter type: $type\");\n }\n } else {\n $filter = $type;\n }\n $this->filterTypes[$name] = $filter;\n $this->_nested = null;\n }",
"public function load($name);",
"function applyFilter( &$resource, $filter_name='', $options=array())\n {\n if (Image_Filter::loadFilter($filter_name)){\n $class = 'Image_Filter_'.$filter_name;\n call_user_func(array($class,'applyFilter'), $resource, $options);\n return true;\n }\n return false;\n }",
"protected function _loadFilter($filter, $options = null)\n {\n $instance = null;\n\n if (!empty($filter)) {\n $className = 'iPhorm_Filter_' . ucfirst($filter);\n if (class_exists($className)) {\n $instance = new $className($options);\n }\n }\n\n if ($instance == null) {\n throw new Exception(\"Filter '$filter' does not exist\");\n }\n\n return $instance;\n }",
"public function addFilter(FilterInterface $filter) : void\n {\n $this->getLoader()->addFilter($filter);\n }",
"abstract public function getFilterName();",
"function add_filters()\n {\n }",
"public function register_filters() {\n\n\t\t}"
] | [
"0.82831115",
"0.66329855",
"0.65270823",
"0.64686245",
"0.63967836",
"0.6263931",
"0.6214276",
"0.61723316",
"0.60469997",
"0.59775513",
"0.5914508",
"0.5875603",
"0.58725786",
"0.58587146",
"0.58570546",
"0.5819037",
"0.58065164",
"0.5792788",
"0.5751806",
"0.5688672",
"0.5672608",
"0.5672608",
"0.5664803",
"0.56432796",
"0.56332344",
"0.56039834",
"0.5593177",
"0.5578817",
"0.5534364",
"0.5518264"
] | 0.80405194 | 1 |
return a reference to a registered object | function &GetRegisteredObject($name) {
return $this->_smarty->get_registered_object($name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getInstance(): object;",
"public function get_instance() {\r\n\t\treturn $this->obj;\r\n\t}",
"public static function & GetInstance ();",
"public static function getInstance()\r\n\t{\r\n\t\tif ( empty( self::$instance ) )\r\n\t\t{\r\n\t\t\tself::$instance = new Registry();\r\n\t\t\t$object = self::$instance;\r\n\t\t\t$object->init();\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$instance;\r\n\t}",
"public function getInstance(): object\n {\n }",
"public function register($object);",
"public function getInstance(): mixed;",
"abstract public function get_instance();",
"public static function instance() {\n\t\tif (!Registry::exists($class=get_called_class())) {\n\t\t\t$ref=new \\Reflectionclass($class);\n\t\t\t$args=func_get_args();\n\t\t\tRegistry::set($class,\n\t\t\t\t$args?$ref->newinstanceargs($args):new $class);\n\t\t}\n\t\treturn Registry::get($class);\n\t}",
"static public function getInstance(){\r\n if(self::$_instance === NULL){\r\n self::$_instance = new Registry;\r\n }\r\n return self::$_instance;\r\n }",
"function get($object_name){\r\n if(isset($this->singleton_instances[$object_name]))\r\n return $this->singleton_instances[$object_name];\r\n \r\n $definition = parent::get($object_name);\r\n $this->singleton_instances[$object_name] = new lako_object($definition);\r\n return $this->singleton_instances[$object_name];\r\n }",
"public static function getInstance() {\n if(!self::$instance instanceof self) {\n self::$instance = new Registry;\n }\n return self::$instance;\n }",
"final public static function &instance() {\r\n\t\t\r\n\t\t$class = get_called_class();\r\n\t\tif(!isset(self::$instances[$class])) self::$instances[$class] = new $class;\r\n\t\treturn self::$instances[$class];\r\n\t\t\r\n\t}",
"private function registerObject(){\n \t$this->app->singleton(\\PenFramework\\Exceptions\\Handler::class);\n\n \t$this->app->singleton('pen_helper', function(){\n \t\treturn new \\PenFramework\\Library\\Helper();\n \t});\n\n \t$this->app->singleton('pen_loader', function(){\n \t\treturn new \\PenFramework\\Library\\Loader();\n \t});\n\n \t$this->app->singleton('pen_url', function(){\n \t\treturn new \\PenFramework\\Library\\PenUrl();\n \t});\n\n \t$this->app->singleton('pen_request', function(){\n \t\treturn new \\PenFramework\\Library\\PenRequest();\n \t});\n\n \t$this->app->singleton('pen_permission', function(){\n \t\treturn new \\PenFramework\\Library\\Permission();\n \t});\n\n \t$this->app->singleton('pen_config', function(){\n \t\treturn new \\PenFramework\\Library\\PenConfig();\n \t});\n\n \t$this->app->singleton('pen_language', function(){\n \t\treturn new \\PenFramework\\Library\\Language();\n \t});\n\n \t$this->app->singleton('pen_session', function(){\n \t\treturn new \\PenFramework\\Library\\PenSession();\n \t});\n\n \t$this->app->singleton('pen_validate', function(){\n \t\treturn new \\PenFramework\\Library\\Validate();\n \t});\n }",
"function get_instance()\r\n{\r\n\t\r\n}",
"public static function &get_instance()\n {\n return self::$instance;\n }",
"public function instance();",
"public function registerInstance($object) {\n $this->_pool->putref($object->hashCode(), $object);\n return TRUE;\n }",
"static function getInstance() {\n if (is_null(self::$instance)) {\n self::$instance = new Registry();\n }\n\n return self::$instance;\n }",
"public function getInstance() {\n\t\treturn $this->instance;\n\t}",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function getObject() {}",
"public function getObject() {}"
] | [
"0.70743287",
"0.6764894",
"0.6725573",
"0.66337436",
"0.6556568",
"0.65293354",
"0.64884645",
"0.6452232",
"0.64272535",
"0.6346797",
"0.63435245",
"0.6305692",
"0.63022596",
"0.62751055",
"0.6258482",
"0.62434673",
"0.62332594",
"0.6184605",
"0.6180519",
"0.6169918",
"0.6148395",
"0.6148395",
"0.6148395",
"0.6148395",
"0.6148395",
"0.6148395",
"0.6148395",
"0.6148395",
"0.6140098",
"0.6140098"
] | 0.74176 | 0 |
Test Tests the actionIndex method error resonse. | public function test_actionIndexError()
{
$expected_output = "HTTP/1.1 424 \n" .
"Content-type: application/json\n" .
'{"errors":{"general":["Not a proper http method type, please send a FILE"]}}';
$this->assertControllerResponse('actionIndex', '/create/', $expected_output);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test_IndexError(){\n\t\t$this->validateTestException(\n\t\t\t$this->fullURL,\n\t\t\t'GET',\n\t\t\t$this->data,\n\t\t\t'NotImplementedException',\n\t\t\t'index'\n\t\t);\n\t}",
"public function testIndexActionError() : void\n {\n $res = $this->controller->indexActionPost();\n $this->assertInternalType(\"array\", $res);\n\n list($json, $status) = $res;\n $this->assertEquals($json[\"message\"], \"Ingen IP address skickades.\");\n $this->assertEquals($status, 400);\n }",
"public function testIndexActionFail() : void\n {\n $this->di->request->setPost(\"ip\", \"1200:0000:AB00:1234:O000:2552:7777:1313\");\n\n $res = $this->controller->indexActionPost();\n $this->assertInternalType(\"array\", $res);\n\n list($json, $status) = $res;\n $this->assertEquals($json[\"valid\"], false);\n $this->assertEquals($status, 200);\n }",
"public function testIndexAction()\n {\n $request = $this->di->get(\"request\");\n $request->setServer(\"REMOTE_ADDR\", \"127.0.0.1\");\n $res = $this->controller->indexAction();\n $this->assertIsArray($res);\n\n $json = $res[0];\n $this->assertEquals(\"Oops, platsinformation saknas\", $json[\"err\"]);\n }",
"public function testIndexAction()\n {\n $res = $this->controller->indexAction();\n $this->assertIsObject($res);\n }",
"public function test_indexAction ( )\n {\n $params = array(\n 'action' => 'index',\n 'controller'=> 'index',\n 'module' => 'default'\n );\n\n $urlParams = $this->urlizeOptions($params);\n $url = $this->url($urlParams);\n $this->dispatch($url);\n\n // assertions\n $this->assertModule($urlParams['module']);\n $this->assertController($urlParams['controller']);\n $this->assertAction($urlParams['action']);\n }",
"public function testIndexAction()\n {\n $res = $this->controller->indexAction();\n $this->assertInternalType(\"object\", $res);\n $this->assertInstanceOf(ResponseUtility::class, $res);\n }",
"public function testIndexSuccess()\n {\n $this->setAdminSession();\n $this->get($this->indexUrl);\n $this->assertResponseOk();\n }",
"public function testIndexActionGetFail()\n {\n // Setup the controller\n $controller = new LocWeatherController();\n $controller->setDI($this->di);\n\n // Test the controller action\n $_GET[\"ip\"] = \"test.ip.not.real\";\n $res = $controller->indexActionGet();\n $body = $res->getBody();\n $this->assertStringContainsString(\"<h5 style='color:red;'>Vädret misslyckades att hämtas.</h5>\", $body);\n }",
"public function testIndexFailNotAdmin()\n {\n $this->setUserSession();\n $this->get($this->indexUrl);\n $this->assertRedirect('/');\n }",
"public function testActionIndex()\n {\n // Create five actions.\n factory(Action::class, 5)->create();\n\n $response = $this->getJson('api/v3/actions');\n $decodedResponse = $response->decodeResponseJson();\n\n $response->assertStatus(200);\n $this->assertEquals(5, $decodedResponse['meta']['pagination']['count']);\n }",
"public function testIndexActionCanBeAccessed()\n\t{\n\t\t$this->dispatch('/');\n\t\t$this->assertResponseStatusCode(200);\n\t\t$this->assertModuleName('DEC');\n\t\t$this->assertControllerName('DEC\\Controller\\Index');\n\t\t$this->assertControllerClass('IndexController');\n\t\t$this->assertMatchedRouteName('home');\n\t}",
"public function testIndex()\n {\n $this->get(route('index'))\n ->assertResponseStatus(200);\n }",
"public function testIndex()\n {\n $response = $this->action('GET', '\\Modules\\Admin\\Http\\Controllers\\FaqCategoryController@index');\n $this->assertResponseStatus(200, $response->status());\n $this->assertInstanceOf('Illuminate\\Http\\Response', $response);\n }",
"public function testIndexAction()\n {\n\n $res = $this->controller->indexAction();\n $this->assertInstanceOf(ResponseUtility::class, $res);\n //$this->assertStringEndsWith(\"active\", $res);\n }",
"public function test_bad_index_route()\n {\n //incorrect uri\n $response = $this->get('api/students/1234');\n $response->assertStatus(404);\n }",
"public function testIndexActionGet()\n {\n $res = $this->controller->indexActionGet();\n $this->assertContains(\"View all items\", $res->getBody());\n }",
"public function testIndexAction() : void\n {\n $this->di->request->setPost(\"ip\", \"2002:c0a8:101::42\");\n\n $res = $this->controller->indexActionPost();\n $this->assertInternalType(\"array\", $res);\n\n list($json, $status) = $res;\n $this->assertEquals($json[\"valid\"], true);\n $this->assertEquals($status, 200);\n }",
"public function testIndexActionCanBeAccessed()\n {\n $this->elasticsearchClientMock->expects($this->once())\n ->method('getIndexStats')\n ->will($this->returnValue(array()));\n\n $serviceManager = $this->controller->getServiceLocator();\n $serviceManager->setAllowOverride(true);\n $serviceManager->setService('ElasticsearchManager', $this->elasticsearchClientMock);\n\n $this->routeMatch->setParam('action', 'index');\n\n $result = $this->controller->dispatch($this->request);\n $response = $this->controller->getResponse();\n\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public function testIndexActionCanBeAccessed()\n {\n $this->dispatch('/venue');\n $this->assertResponseStatusCode(200);\n }",
"public function test_err404()\n {\n $this->request('GET', ['err404', 'index']);\n $this->assertResponseCode(404);\n }",
"public function testIndexActionIsOk(){\n $this->dispatch('/administrator/manage-supplier');\n $this->assertResponseCode(200);\n }",
"public function test_dispatchIndexAction ( )\n {\n $params = array(\n 'action' => 'index',\n 'controller'=> 'scales',\n 'module' => 'default'\n );\n\n $urlParams = $this->urlizeOptions($params);\n $url = $this->url($urlParams);\n $this->dispatch($url);\n\n // assertions\n $this->assertModule($urlParams['module']);\n $this->assertController($urlParams['controller']);\n $this->assertAction($urlParams['action']);\n\n }",
"public function testIndexActionCanBeAccessed()\n {\n $apartmentGeneralDao = $this->getApplicationServiceLocator()->get('dao_apartment_general');\n $apartment = $apartmentGeneralDao->fetchOne();\n\n $this->dispatch('/apartment/' . $apartment['id'] . '/inventory-range');\n $this->assertResponseStatusCode(200);\n\n $this->assertModuleName('apartment');\n $this->assertControllerName('controller_apartment_inventory_range');\n $this->assertControllerClass('InventoryRange');\n $this->assertActionName('index');\n $this->assertMatchedRouteName('apartment/inventory-range');\n }",
"public function testIndexTahun()\n\t{\n\t\t$response = $this->action('GET', 'TahunController@index');\n\t}",
"public function testGetActionMethodForIndexAction()\n {\n $application = new BasicTestApplication(FilePath::parse('/var/www/'));\n $request = new BasicTestRequest(Url::parse('http://www.domain.com/'), new Method('GET'));\n $response = new BasicTestResponse();\n $controller = new BasicTestController();\n $controller->processRequest($application, $request, $response, '', []);\n\n self::assertSame('indexAction', $controller->getActionMethod()->getName());\n }",
"public function test_getNotFound() {\n\t\t$this->testAction('/disease/index/1', array('method'=>'get'));\n\t}",
"public function test_listIndexAction ( )\n {\n $params = array(\n 'event_id' => 1,\n 'action' => 'list',\n 'controller'=> 'scales',\n 'module' => 'default'\n );\n\n $urlParams = $this->urlizeOptions($params);\n $url = $this->url($urlParams);\n $this->dispatch($url);\n\n // assertions\n $this->assertModule($urlParams['module']);\n $this->assertController($urlParams['controller']);\n $this->assertAction($urlParams['action']);\n\n }",
"public function testIndexMethodAuthorised()\n {\n $response = $this->actingAs($this->user)\n ->get($this->routeIndex);\n\n $response->assertStatus(200);\n $response->assertViewIs('pages.eventtype.index');\n }",
"public function testDispatchErrorNoAction()\n {\n $this->expectException(ResourceNotFoundException::class);\n\n $this->uut->dispatch($this->buildRequest('/unknown-action'));\n }"
] | [
"0.8301092",
"0.81969786",
"0.7672064",
"0.75928533",
"0.75710267",
"0.74921393",
"0.7352798",
"0.7274661",
"0.7235742",
"0.72279215",
"0.7203987",
"0.7203978",
"0.71928483",
"0.718473",
"0.71792525",
"0.7144754",
"0.71398324",
"0.70941406",
"0.70781696",
"0.70765716",
"0.7073462",
"0.69981843",
"0.69739294",
"0.6971501",
"0.69481486",
"0.69157606",
"0.6862777",
"0.68621385",
"0.6845079",
"0.6825212"
] | 0.8300544 | 1 |
Confirms that the asset images created are of same style as the actions passed in the post. | private function assertCreationEquals(Asset $asset) {
foreach ($_POST['actions'] as $action) {
if (count($asset->images) > 0)
{
$size_exists = false;
foreach ($asset->images as $image) {
if ($image->width <= $action[self::EXPECTED_WIDTH_KEY] + 1 &&
$image->width >= $action[self::EXPECTED_WIDTH_KEY] - 1 &&
$image->height <= $action[self::EXPECTED_HEIGHT_KEY] + 1 &&
$image->height >= $action[self::EXPECTED_HEIGHT_KEY] - 1) {
$size_exists = true;
}
}
$this->assertTrue($size_exists);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function input_actionAssetCreate()\n {\n return [\n [\n TestController::COMPARISON_DIRECTORY . '/contain_aspect_true.png',\n [\n 'actions' => [\n [\n Action_Image::NAME_KEY => \"original\",\n Action_Image::WIDTH_KEY => 1000,\n Action_Image::HEIGHT_KEY => 1000,\n Action_Image::KEEP_ASPECT_RATIO_KEY => true,\n Action_Image::PADDING_KEY => false,\n self::EXPECTED_WIDTH_KEY => 1000,\n self::EXPECTED_HEIGHT_KEY => 562\n ],\n [\n Action_Image::NAME_KEY => \"thumbnail\",\n Action_Image::WIDTH_KEY => 150,\n Action_Image::HEIGHT_KEY => 150,\n self::EXPECTED_WIDTH_KEY => 150,\n self::EXPECTED_HEIGHT_KEY => 150\n ]\n ]\n ]\n ],\n [\n TestController::COMPARISON_DIRECTORY . '/contain_aspect_true.png',\n [\n 'actions' => [\n [\n Action_Image::NAME_KEY => \"original\",\n Action_Image::WIDTH_KEY => 2000,\n Action_Image::HEIGHT_KEY => 2000,\n Action_Image::KEEP_ASPECT_RATIO_KEY => true,\n Action_Image::PADDING_KEY => false,\n self::EXPECTED_WIDTH_KEY => 2000,\n self::EXPECTED_HEIGHT_KEY => 1125\n ],\n [\n Action_Image::NAME_KEY => \"thumbnail\",\n Action_Image::WIDTH_KEY => 370,\n Action_Image::HEIGHT_KEY => 280,\n self::EXPECTED_WIDTH_KEY => 370,\n self::EXPECTED_HEIGHT_KEY => 280\n ],\n [\n Action_Image::NAME_KEY => \"thumbnail\",\n Action_Image::WIDTH_KEY => 152,\n Action_Image::HEIGHT_KEY => 154,\n self::EXPECTED_WIDTH_KEY => 152,\n self::EXPECTED_HEIGHT_KEY => 154\n ]\n ]\n ]\n ],\n [\n TestController::COMPARISON_DIRECTORY . '/eckroth-coffeehouse_conversation.txt',\n [\n 'actions' => [\n [\n Action_Document::NAME_KEY => \"coffeehouse_conversation\"\n ]\n ]\n ]\n ]\n ];\n }",
"public function actionVerifyImages()\n {\n $srcImgDir = Yii::getAlias('@frontend') . DIRECTORY_SEPARATOR .\n 'web' . DIRECTORY_SEPARATOR .\n 'images' . DIRECTORY_SEPARATOR .\n 'i1' . DIRECTORY_SEPARATOR;\n\n $dstImgDir = Yii::getAlias('@frontend') . DIRECTORY_SEPARATOR .\n 'web' . DIRECTORY_SEPARATOR .\n 'images' . DIRECTORY_SEPARATOR .\n 'product' . DIRECTORY_SEPARATOR;\n\n echo 'Checking missing images in: ' . $srcImgDir . ' to ' . $dstImgDir . PHP_EOL;\n\n $imgDst = glob($dstImgDir . '*.{jpg,JPG}', GLOB_BRACE);\n $cId = count($imgDst);\n if ($cId) {\n echo 'Found ' . $cId . ' in ' . $dstImgDir . ' folder '. PHP_EOL;\n }\n\n $imgSrc = glob($srcImgDir . '*.{jpg,JPG}', GLOB_BRACE);\n $cIs = count($imgSrc);\n if ($cIs) {\n echo 'Found ' . $cIs . ' in ' . $srcImgDir . ' folder '. PHP_EOL;\n\n $cOk = $cErr = $j = 0;\n foreach ($imgSrc as $i) {\n /* if ($j == 7) {\n break;\n } */\n $art = substr($i, strlen($srcImgDir) + 1, -4);\n echo 'Checking image ' . $i . ' Checking articul: ' . $art . PHP_EOL;\n\n $civQuery = CatalogItemVariant::find()\n ->where(['published' => 1]);\n $civ = $civQuery->andFilterWhere(['like', 'img_url', $art])\n ->asArray()\n ->all();\n\n // echo 'Found: ' . print_r($civ, 1) . PHP_EOL;\n if (!empty($civ[0]['img_url'])) {\n $bsDst = basename($civ[0]['img_url']);\n echo 'Checking destination file: ' . $dstImgDir . $bsDst . PHP_EOL;\n if (file_exists($dstImgDir . $bsDst)) {\n echo 'Skip destination file exists: ' . $dstImgDir . $bsDst . PHP_EOL;\n } else {\n if (copy($i, $dstImgDir . $bsDst)) {\n echo 'Copied ' . $i . ' to ' . $dstImgDir . $bsDst . PHP_EOL;\n $cOk ++;\n } else {\n echo 'Error: can`t copy ' . $i . ' to ' . $dstImgDir . $bsDst . PHP_EOL;\n $cErr ++;\n }\n }\n }\n $j ++;\n }\n }\n $imgDst2 = glob($dstImgDir . '*.{jpg,JPG}', GLOB_BRACE);\n $cId2 = count($imgDst2);\n if ($cId2) {\n echo 'Found ' . $cId2 . ' in ' . $dstImgDir . ' folder '. PHP_EOL;\n }\n echo 'Checked ' . $j . ' image files. Copied ' . $cOk . ' images. Image copy errors: ' . $cErr . PHP_EOL;\n }",
"function post_edit_style() {\n\n\t\t$icon_url = trailingslashit( plugin_dir_url( __FILE__ ) ) . 'assets/icon_lock.png';\n\t\t$icon_url_2x = trailingslashit( plugin_dir_url( __FILE__ ) ) . 'assets/[email protected]';\n\n\t\tif ( is_admin() && 'attachment' == get_current_screen()->id && $this->is_attachment_private( get_the_id() ) ) : ?>\n\n\t\t\t<style>\n\t\t\t\t#titlediv { padding-left: 60px; }\n\t\t\t\t#titlediv::before { content: ' '; display: block; height: 26px; width: 21px; background: url(<?php echo $icon_url; ?>) no-repeat center center; position: relative; float: left; margin-left: -40px; top: 4px; }\n\t\t\t\t@media only screen and ( -webkit-min-device-pixel-ratio : 1.5 ), only screen and ( min-device-pixel-ratio : 1.5 ) {\n\t\t\t\t\t#titlediv::before { background-image: url(<?php echo $icon_url_2x; ?>); }\n\t\t\t\t}\n\t\t\t</style>\n\n\t\t<?php endif;\n\n\t}",
"public function input_actionAsset()\n {\n $basic_test_name = 'basic_test' . time() . rand(0, 10000);\n $type_test_name = 'type_test' . time() . rand(0, 10000);\n $used_test_name = 'used_test' . time() . rand(0, 10000);\n\n return [\n [\n $basic_test_name,\n [\n 'uploaded_name' => $basic_test_name,\n ]\n ],\n [\n $type_test_name,\n [\n 'type' => AssetType::IMAGE,\n 'uploaded_name' => $type_test_name,\n ]\n ],\n [\n $used_test_name,\n [\n 'is_used' => Asset::IS_NOT_USED,\n 'type' => AssetType::IMAGE,\n 'uploaded_name' => $used_test_name,\n ]\n ]\n ];\n }",
"function checkImg(){\n global $postpath;\n return getimagesize($postpath) !== false;\n }",
"function /*test*/CreateActionNoRange(){\n //range box with the element's colour\n foreach($this->elements as $element){\n //The path of the image used to create the new image\n $imageCopySourceFile = $_SERVER[\"DOCUMENT_ROOT\"].'/C&C_Companion/pages/cards/templates/templateImages/'.$element->getName().'ActionRange.jpg';\n\n //The path of the image being created\n $imageCopyDestFile = $_SERVER[\"DOCUMENT_ROOT\"].'/C&C_Companion/pages/cards/templates/templateImages/'.$element->getName().'ActionNoRange.jpg';\n\n //Copy the contents of the old image to the new image's path\n copy($imageCopySourceFile, $imageCopyDestFile);\n\n //Create an image object from the new image's path\n $imageCopy = imagecreatefromjpeg($imageCopyDestFile);\n\n //Fill in the new image's range box\n $image = $this->actionFillInRange($imageCopy, $element);\n\n //Write the image object's contents to the destination file path\n imagejpeg($image, $imageCopyDestFile);\n }\n\n $this->assertTrue(true);\n }",
"public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }",
"function testCompatible(){\n\t\tif($this->$imageAsset[\"type\"] == \"image/jpeg\" || $_FILES[\"image_upload_box\"][\"type\"] == \"image/pjpeg\"){\t\n\t\t\t$this->imgType = 'jpg';\n\t\t}\t\t\n\t\t// if uploaded image was GIF\n\t\tif($this->$imageAsset[\"type\"] == \"image/gif\"){\t\n\t\t\t$this->imgType = 'gif';\n\t\t}\t\n\t\t// if uploaded image was PNG\n\t\tif($this->$imageAsset[\"type\"] == \"image/x-png\"){\n\t\t\t$this->imgType = 'png';\n\t\t}\n\t\telse {\n\t\t\t$this->imgType = 'invalid';\n\t\t}\n\t\t\n\t}",
"function hook_image_style_delete($style) {\n // Administrators can choose an optional replacement style when deleting.\n // Update the modules style variable accordingly.\n if (isset($style['old_name']) && $style['old_name'] == variable_get('mymodule_image_style', '')) {\n variable_set('mymodule_image_style', $style['name']);\n }\n}",
"public function actionCreate() {\n\n if (!\\Yii::$app->user->isGuest) {\n $model = new Cars();\n $model_images = new CarsImages();\n\n $old_model_id = Cars::find()->orderBy(['id' => SORT_DESC])->one();\n if (sizeof($old_model_id) < 1) {\n $project_id_for_images = 1;\n } else {\n $project_id_for_images = (int) $old_model_id->id + 1;\n }\n\n\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $post = Yii::$app->request->post();\n// die(var_dump($post));\n $size_of_features = sizeof($post['check']);\n $car_features = $post['check'];\n\n function manageImageInspection($image) {\n $image_extention = $image->extension;\n if ($image_extention == \"jpg\" || $image_extention == \"jpeg\" || $image_extention == \"png\") {\n if ($image->saveAs($full_path = dirname(__FILE__) . '/../../' . \"/frontend/web/media/inspection/original/\" . $inspection_image_name = $path = time() . \"_\" . Yii::$app->security->generateRandomString() . '.' . $image->extension)) {\n $array = array(0, 1);\n $waterMark_image = dirname(__FILE__) . '/../../' . \"/frontend/web/images/logo/logo_1.png\";\n// Image::watermark($full_path, $waterMark_image, $array)\n// ->resize(new Box(284, 251))\n// ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/284x251/\" . $path, ['quality' => 50]);\n\n\n $watermarkImage = '@webroot/images/watermark/watermark_arabic_dark.png';\n $image = $full_path;\n $newImage = Image::watermark($image, $watermarkImage);\n $newImage->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/inspection/arabic_dark/\" . $inspection_image_name);\n\n $watermarkImage = '@webroot/images/watermark/watermark_arabic_white.png';\n $image = $full_path;\n $newImage = Image::watermark($image, $watermarkImage);\n $newImage->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/inspection/arabic_white/\" . $inspection_image_name);\n\n\n $watermarkImage = '@webroot/images/watermark/watermark_english_dark.png';\n $image = $full_path;\n $newImage = Image::watermark($image, $watermarkImage);\n $newImage->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/inspection/english_dark/\" . $inspection_image_name);\n\n\n $watermarkImage = '@webroot/images/watermark/watermark_english_white.png';\n $image = $full_path;\n $newImage = Image::watermark($image, $watermarkImage);\n $newImage->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/inspection/english_white/\" . $inspection_image_name);\n\n\n\n//\n// $thumbnail = Image::thumbnail($full_path, $img_size, $img_size);\n// $size = $thumbnail->getSize();\n// if ($size->getWidth() < $img_size or $size->getHeight() < $img_size) {\n// $white = Image::getImagine()->create(new Box($img_size, $img_size));\n// $thumbnail = $white->paste($thumbnail, new Point($img_size / 2 - $size->getWidth() / 2, $img_size / 2 - $size->getHeight() / 2));\n// }\n// $thumbnail->save($save_path);\n\n\n\n\n\n\n\n\n\n\n\n\n return $path;\n } else {\n return \"error\";\n }\n } else {\n return \"not image\";\n }\n }\n\n function manageImage($image) {\n $image_extention = $image->extension;\n if ($image_extention == \"jpg\" || $image_extention == \"jpeg\" || $image_extention == \"png\") {\n if ($image->saveAs($full_path = dirname(__FILE__) . '/../../' . \"/frontend/web/media/original/\" . $path = time() . \"_\" . Yii::$app->security->generateRandomString() . '.' . $image->extension)) {\n\n Image::thumbnail($full_path, 284, 251)\n ->resize(new Box(284, 251))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/284x251/\" . $path);\n\n Image::thumbnail($full_path, 620, 485)\n ->resize(new Box(620, 485))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/620x485/\" . $path);\n\n Image::thumbnail($full_path, 115, 85)\n ->resize(new Box(115, 85))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/115x85/\" . $path);\n\n Image::thumbnail($full_path, 270, 150)\n ->resize(new Box(270, 150))\n ->save(dirname(__FILE__) . '/../../' . \"/frontend/web/media/270x150/\" . $path);\n\n\n return $path;\n } else {\n return \"error\";\n }\n } else {\n return \"not image\";\n }\n }\n\n $path = $model->image = UploadedFile::getInstance($model, \"image\");\n $inspection = $model->inspection = UploadedFile::getInstance($model, \"inspection\");\n $images = $model_images->images = UploadedFile::getInstances($model_images, 'images');\n\n\n if (($model->image)) {\n $manage_image = manageImage($model->image);\n if ($manage_image == \"not image\") {\n Yii::$app->session->setFlash('error', 'images must be image (jpg or jpeg or png');\n return $this->redirect(['projects/create']);\n } else if ($manage_image == \"error\") {\n Yii::$app->session->setFlash('error', 'Something went wrong, could not upload images');\n return $this->redirect(['projects/create']);\n } else {\n $model->image = $manage_image;\n Yii::$app->session->setFlash('success', 'image successfully uploaded!');\n }\n } else {\n Yii::$app->session->setFlash('error', 'image cannot be empty!');\n return $this->redirect(['projects/create']);\n }\n\n\n\n\n if (($model->inspection)) {\n $manage_image = manageImageInspection($model->inspection);\n if ($manage_image == \"not image\") {\n Yii::$app->session->setFlash('error', 'images must be image (jpg or jpeg or png');\n return $this->redirect(['projects/create']);\n } else if ($manage_image == \"error\") {\n Yii::$app->session->setFlash('error', 'Something went wrong, could not upload images');\n return $this->redirect(['projects/create']);\n } else {\n $model->inspection = $manage_image;\n Yii::$app->session->setFlash('success', 'image successfully uploaded!');\n }\n } else {\n Yii::$app->session->setFlash('error', 'image cannot be empty!');\n return $this->redirect(['projects/create']);\n }\n\n\n\n\n $array = \"\";\n $error_1 = \"\";\n $size_of_images = sizeof($images);\n for ($i = 0; $i < $size_of_images; $i++) {\n $upload_image = $images[$i];\n $manage_images = manageImage($upload_image);\n if ($manage_images == \"not image\") {\n Yii::$app->session->setFlash('error', $images[$i] . ' Not Image');\n } else if ($manage_images == \"error\") {\n Yii::$app->session->setFlash('error', $images[$i] . ' Error');\n } else {\n $model_images->car_id = $project_id_for_images;\n $new_image = $model_images->images = $manage_images;\n $save_into_images = Yii::$app->db->createCommand('INSERT INTO cars_images (car_id,images)\n\t\t\t\tVALUES (\n\t\t\t\t\"' . $project_id_for_images . '\",\n\t\t\t\t\"' . $new_image . '\")')\n ->execute();\n }\n }\n\n\n if ($size_of_features > 0) {\n foreach ($car_features as $car_feat => $features) {\n $save_into_features = Yii::$app->db->createCommand('INSERT INTO car_features (car_id,cat_id)\n\t\t\t\tVALUES (\n\t\t\t\t\"' . $project_id_for_images . '\",\n\t\t\t\t\"' . $features . '\")')\n ->execute();\n }\n }\n\n\n\n\n\n if (!$model->save()) {\n die(var_dump($model->errors));\n } else {\n return $model->slug;\n }\n return $this->redirect(['/cars']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->redirect('/login');\n }\n }",
"public function actionFixImageNames()\n {\n $prodImgDir = Yii::getAlias('@frontend') . DIRECTORY_SEPARATOR .\n 'web' . DIRECTORY_SEPARATOR .\n 'images' . DIRECTORY_SEPARATOR .\n 'product' . DIRECTORY_SEPARATOR;\n // $prImgs = glob($prodImgDir . '*.{jpg,JPG}', GLOB_BRACE);\n $prImgs = glob($prodImgDir . '*.{jpg}', GLOB_BRACE);\n $c = count($prImgs);\n $y = $x = $r = $n = 0;\n if ($c > 0) {\n foreach ($prImgs as $img) {\n $bN = basename($img);\n $art = substr($bN, 0, -4);\n if (strlen($art) > 16) {\n $art = substr($art, 0, 16);\n }\n if ($n <= 16 || $n == 19 || $n == 85 || $n == 159) {\n echo 'Skipped image ' . $n . '...' . PHP_EOL;\n $n ++;\n continue;\n }\n echo 'Checking image (' . $n . '): ' . $bN . ' check articul: ' . $art . PHP_EOL;\n\n $civQuery = CatalogItemVariant::find()\n ->where(['published' => 1]);\n $civ = $civQuery->andFilterWhere(['like', 'img_url', $art])\n ->asArray()\n ->one();\n if (!empty($civ['img_url'])) {\n // echo 'Found CIV: ' . var_export($civ, 1) . PHP_EOL;\n $bNok = basename($civ['img_url']);\n if ($bNok != $bN) {\n echo 'Base name OK: ' . $bNok . ' != ' . $bN . PHP_EOL;\n\n $oldName = $prodImgDir . $bN;\n $newName = $prodImgDir . $bNok;\n if (file_exists($newName)) {\n echo 'Destination file exists: ' . $newName . PHP_EOL;\n $x ++;\n } else {\n try {\n $oldName = escapeshellarg($oldName);\n $newName = escapeshellarg($newName);\n if (rename($oldName, $newName)) {\n echo 'Renamed image from: ' . $bN . ' to: ' . $bNok . PHP_EOL;\n $r ++;\n }\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), PHP_EOL;\n continue;\n }\n }\n \n } else {\n $y ++;\n }\n }\n $n ++;\n }\n echo 'Renamed ' . $r . ' images. Good names: ' . $y . '. Images exists: ' . $x . '.' . PHP_EOL;\n }\n }",
"public function images_done_resizing() {\r\n\t\treturn (int)$this->images_done === 1;\r\n\t}",
"public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }",
"private function sameImages($imageOne, $imageTwo)\n\t{\n\t\t$widthOne = imagesx($imageOne);\n\t\t$heightOne = imagesy($imageOne);\n\t\t$widthTwo = imagesx($imageTwo);\n\t\t$heightTwo = imagesy($imageTwo);\n\n\t\tif ($widthOne == $widthTwo && $heightOne == $heightTwo) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function actionCreate() {\n $post = new Post;\n $postDetails = array();\n for ($i = 0; $i < 2; $i++) {\n $postDetail = new PostDetail;\n if ($i == 0) {\n $postDetail->language = 'vi';\n } else {\n $postDetail->language = 'en';\n }\n $postDetails[] = $postDetail;\n }\n $message = ''; //show message to view\n $postImage = new PostImage;\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Post']) && isset($_POST['PostDetail'])) {\n $post->attributes = $_POST['Post'];\n $valid = true;\n foreach ($postDetails as $i => $postDetail) {\n $postDetail->attributes = $_POST['PostDetail'][$i];\n $postDetails[$i] = $postDetail;\n $valid = $postDetail->validate() && $valid;\n }\n if ($valid) {\n //get images and check\n $canSave = true;\n $images = CUploadedFile::getInstancesByName('path');\n if (isset($images) && count($images) > 0) {\n foreach ($images as $image => $pic) {\n $imageName = $this->renameImage($pic->name);\n /* if (PostImage::model()->existedImagePath('contents/uploads/images/post/' . $imageName)) {//check duplicated images path in database\n $message = '\"' . $imageName . '\":' . Yii::t('post', 'existedImageName');\n $canSave = false;\n break;\n } else { */\n if (strlen('contents/uploads/images/post/' . $imageName) > 255) {//check length of images name\n $message = '\"' . $imageName . '\":' . Yii::t('post', 'longImageName');\n $canSave = false;\n break;\n }\n }\n }\n if ($canSave) {\n //begin upload images\n $imagesName = array();\n foreach ($images as $image => $pic) {\n $imageName = $this->renameImage($pic->name);\n $path = Yii::getPathOfAlias('webroot.contents.uploads.images.post') . DIRECTORY_SEPARATOR . $imageName;\n if ($pic->saveAs($path)) {\n $imagesName[] = $imageName;\n }\n }\n //save model to database\n try {\n if ($post->save()) {\n foreach ($postDetails as $postDetail) {\n $postDetail->post_id = $post->id;\n $postDetail->save();\n }\n //create list product images\n foreach ($imagesName as $imageName) {\n $postImage = new PostImage;\n $postImage->post_id = $post->id;\n $postImage->path = 'contents/uploads/images/post/' . $imageName;\n $saved = $postImage->save();\n if (!$saved) {//if saving fail, delete uploaded images\n $path = Yii::getPathOfAlias('webroot.contents.uploads.images.post') . DIRECTORY_SEPARATOR . $imageName;\n unlink($path);\n }\n }\n Yii::app()->user->setFlash('message', Yii::t('post', 'successCreate'));\n $this->refresh();\n $this->redirect(array('create'));\n }\n } catch (Exception $ex) {\n echo $ex->getMessage();\n Yii::app()->user->setFlash('message', Yii::t('post', 'failCreate'));\n $this->redirect(array('list'));\n }\n }\n } else {\n $message = Yii::t('post', 'notValid');\n }\n }\n\n $this->render('create', array(\n 'message' => $message,\n 'post' => $post,\n 'postDetails' => $postDetails,\n 'postImage' => $postImage,\n ));\n }",
"public function test_actionAssetCreate($file_path = \"\", array $post = [])\n {\n $_FILES = [\n 'file' => [\n 'tmp_name' => $file_path,\n 'name' => 'Hello'\n ]\n ];\n\n $_POST = $post;\n\n $_SERVER['REDIRECT_URL'] = '/create/';\n ob_start();\n $controller = new $this->controller_name(rand(0,1000));\n Reflection::setProperty('allowGenerateHeader', $this->controller_name, $controller, false);\n Reflection::callMethod('actionIndex', $this->controller_name, [], $controller);\n $response = ob_get_contents();\n ob_end_clean();\n \n $json_response = str_replace(\"HTTP/1.1 200 OK\\n\", \"\", $response);\n $json_response = str_replace(\"Content-type: application/json\\n\", \"\", $json_response);\n $asset_json = json_decode($json_response);\n\n $this->assertTrue(Asset::model()->fileName($asset_json->public_url)->exists());\n \n if (Asset::model()->fileName($asset_json->public_url)->exists()) {\n $this->assertCreationEquals(Asset::model()->fileName($asset_json->public_url)->find());\n }\n }",
"function hook_image_style_save($style) {\n // If a module defines an image style and that style is renamed by the user\n // the module should update any references to that style.\n if (isset($style['old_name']) && $style['old_name'] == variable_get('mymodule_image_style', '')) {\n variable_set('mymodule_image_style', $style['name']);\n }\n}",
"protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( KISSIT_MAIN_PRODUCT_WATERMARK_SIZE == 0 ) {\n \tif ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n \t\treturn 'abort';\n \t} \n \tif (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n \t\treturn 'abort';\n \t}\n }\n }",
"public function is_valid_image() {\n\n if ( get_post_type( $this->slide->ID ) === 'attachment' ) {\n $image_id = $this->slide->ID;\n } else {\n $image_id = get_post_thumbnail_id( $this->slide->ID );\n }\n\n $meta = wp_get_attachment_metadata( $image_id );\n\n $is_valid = isset( $meta['width'], $meta['height'] );\n\n return apply_filters( 'metaslider_is_valid_image', $is_valid, $this->slide );\n }",
"function it_converts_the_image_with_an_additional_image_magick_command_for_every_style() {\n $this->beConstructedWith( 'image', [\n 'styles' => [\n 'small' => '240x240#'\n , 'medium' => '300x350#'\n , 'original' => '640x640>'\n ]\n , 'convert' => [\n 'small' => '-colorspace Gray'\n , 'medium' => '\\( +clone -sepia-tone 60% \\) -average'\n ]\n ]);\n $this->tmpName( 'small' )->shouldBeString();\n $this->tmpName( 'medium' )->shouldBeString();\n $this->tmpName( 'original' )->shouldBeString();\n }",
"public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}",
"function image_edit_apply_changes($image, $changes)\n {\n }",
"private function _generateStyles()\n\t{\n\t\t$flag = true;\n\n\t\tforeach($this->_options['styles'] as $style_name => $size)\n\t\t\t$flag = $flag && $this->_getStyleFor($size)->resize($this->path(), $this->path($style_name), $size);\n\n\t\treturn $flag;\n\t}",
"function _wp_image_editor_choose($args = array())\n {\n }",
"public function isTaskShouldApplyFilters(): bool\n {\n $this->consistencyCheck();\n\n if ($this->concat_fade_duration > 0) {\n return true;\n }\n \n if (! $this->isInputsHaveSameRatio()) {\n return true;\n }\n \n if ($this->isInputsFromDifferentCodecs()) {\n return true;\n }\n \n return false;\n }",
"protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n return 'abort';\n } \n if (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n return 'abort';\n }\n }",
"public function test_multi_resize_does_not_create() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$sizes_array = array(\n\t\t\tarray(\n\t\t\t\t'width' => 0,\n\t\t\t\t'height' => 0,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => 0,\n\t\t\t\t'height' => 0,\n\t\t\t\t'crop' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => null,\n\t\t\t\t'height' => null,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => null,\n\t\t\t\t'height' => null,\n\t\t\t\t'crop' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => '',\n\t\t\t\t'height' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => '',\n\t\t\t\t'height' => '',\n\t\t\t\t'crop' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => 0,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => 0,\n\t\t\t\t'crop' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => null,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => null,\n\t\t\t\t'crop' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'width' => '',\n\t\t\t\t'crop' => true,\n\t\t\t),\n\t\t);\n\n\t\t$resized = $imagick_image_editor->multi_resize( $sizes_array );\n\n\t\t// If no images are generated, the returned array is empty.\n\t\t$this->assertEmpty( $resized );\n\t}",
"public function can_add_a_submission_media_image_to_end_of_submission_collection_of_checked_answere()\n {\n $this->create_user('admin');\n\n // \"answere\" is missing\n $old_values = [\n \"challenge_id\" => $this->create(\"Challenge\", [\n \"game_type\" => \"text_answere\",\n \"game_id\" => $this->create(\"GameTextAnswere\")->id,\n \"playfield_type\" => \"city\",\n \"playfield_id\" => $this->create(\"City\")->id,\n ])->id,\n \"user_id\" => $this->create(\"User\")->id,\n \"answere\" => \"sadffasfaf adsf afds.\",\n \"score\" => 25000\n ];\n\n $old_checked_answere = $this->create(\"AnswereChecked\", $old_values);\n $this->file_factory($old_checked_answere, \"submission\", [\"submission1\", \"submission2\"]);\n \n $files = [\n \"submission\" => [\n UploadedFile::fake()->image(\"submission3.jpg\"),\n UploadedFile::fake()->image(\"submission4.jpg\"),\n ]\n ];\n\n // When\n $res = $this->json(\"PUT\",\"$this->api_base/checked/\".$old_checked_answere->id, $files);\n\n // Then\n $res->assertStatus(200)\n ->assertJsonCount(4, \"data.media_submission\"); // assert that 2 images have been added to submission\n\n // Check if db file media data urls actually exist as files in storage\n if($stored_header_files_array = $this->spread_media_urls($res->getData()->data->media_submission)){\n \\Storage::disk(\"test\")->assertExists($stored_header_files_array);\n }\n }",
"public function testS2imageShouldBeAdded()\n {\n $imageLabel = 'someText';\n $imageUrl = '';\n $expected = 0;\n $actual = imageShouldBeAdded($imageLabel, $imageUrl);\n $this->assertEquals($expected, $actual);\n }",
"public function inlineImageExists()\n {\n }"
] | [
"0.5793317",
"0.5506888",
"0.5014556",
"0.4869687",
"0.48685825",
"0.48450437",
"0.48221874",
"0.48076284",
"0.47942662",
"0.4712479",
"0.47090158",
"0.46488148",
"0.46439707",
"0.4640079",
"0.4604765",
"0.45923954",
"0.45641297",
"0.45557365",
"0.4533187",
"0.45283931",
"0.4503585",
"0.450249",
"0.45005652",
"0.4499296",
"0.44955716",
"0.44922864",
"0.4468963",
"0.44576922",
"0.44563285",
"0.44536096"
] | 0.5954099 | 0 |
Test snake function with dash delimiter. | public function testSnakeWithDashes(): void
{
foreach (static::$snakeDashes as $input => $expected) {
self::assertEquals($expected, (new Str())->snake($input, '-'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSnakeWithUnderscores(): void\n {\n $this->processSimpleTests('snake', static::$snakeUnderscore);\n }",
"public function snake($word);",
"public function testSnakeCase2()\n {\n $this->assertEquals(Str::snakeCase('foo bar'), 'foo_bar');\n }",
"public function testSnakeCase1()\n {\n $this->assertEquals(Str::snakeCase('étoile filante'), 'etoile_filante');\n }",
"function dashed($s) {\n return underscore($s, '-');\n }",
"public static function snake()\n {\n return self::generate('_');\n }",
"static function snake(string $s, string $delimiter = '_'): string {\n if (ctype_lower($s)) {\n return $s;\n }\n $s = preg_replace('/\\s+/u', '', ucwords($s));\n\n return static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $s));\n }",
"public function testStudly4()\n {\n $this->assertEquals(Str::studly('foo-bar'), 'FooBar');\n }",
"function testStartsWith2 ()\n\t{\n\t\t\t$input1 = \"Genevieve\";\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}",
"public static function snake($string)\n {\n $string = preg_replace('#([A-Z\\d]+)([A-Z][a-z])#', '\\1_\\2', self::camel($string));\n $string = preg_replace('#([a-z\\d])([A-Z])#', '\\1_\\2', $string);\n\n return strtolower(strtr($string, '-', '_'));\n }",
"public function getDashPattern() {}",
"public function snakeCase($input)\n {\n return strtolower(preg_replace('/(.)([A-Z])/', '$1-$2', $input));\n }",
"public function testCamelCase5()\n {\n $this->assertEquals(Str::camelCase('foo-bar'), 'fooBar');\n }",
"public function testStartsWith2()\n {\n $this->assertFalse(Str::startsWith('foo', 'y'));\n }",
"function snake_case($value, $delimiter = '_')\n\t{\n\t\treturn Illuminate\\Support\\Str::snake($value, $delimiter);\n\t}",
"public static function snakeCase($str) {}",
"public function testStartsWith1()\n {\n $this->assertTrue(Str::startsWith('foo', 'f'));\n }",
"function non_karakter($a){\n if(preg_match(\"/^[A-Za-z0-9 -]*$/\",$a)){\n return false;\n }\n return true;\n}",
"public static function snake($str)\n {\n return self::mechanize($str, '_');\n }",
"public function testRegressionIssue2UsernameRegexDoesntSupportHyphens()\n {\n $regex = TestableAtWrapper::getQueueRegex();\n $test_strings = [\n '17 Mon Nov 15 10:55:00 2010 a simon',\n '18 Mon Nov 15 10:55:00 2010 a simons-username',\n '2 2010-11-15 10:53 a root',\n '3 2010-11-15 10:54 a root-username-',\n ];\n $m = 0;\n foreach ($test_strings as $test) {\n $m += preg_match($regex, $test);\n }\n $this->assertSame($m, count($test_strings));\n }",
"public function alpha_dash($str): bool\n\t{\n return (bool)preg_match('#^[a-z0-9_-]+$#i', $str);\n }",
"function testStartsWith3 ()\n\t{\n\t\t\t$input1 = null;\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}",
"function testStartsWith6 ()\n\t{\n\t\t\t$input1 = \"Barry is a programmer\";\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertTrue (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}",
"function testStartsWith1 ()\n\t{\n\t\t\t$input1 = \"Barry\";\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertTrue (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}",
"function testStartsWith5 ()\n\t{\n\t\t\t$input1 = null;\n\t\t\t$input2 = null;\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}",
"function snake_case($value, $delimiter = '_')\n {\n return Str::snake($value, $delimiter);\n }",
"public function alphaNumericDashUnderscore($check) {\n // have to extract the value to make the function generic\n $value = array_values($check);\n $value = $value[0];\n \n return preg_match('/^[a-zA-Z0-9_ \\-]*$/', $value);\n }",
"public function testStartsWith3()\n {\n $this->assertFalse(Str::startsWith('foo', ''));\n }",
"static public function dasherize($str)\n\t{\n\t\t$str = lcfirst($str);\n\t\treturn strtolower(preg_replace('/([A-Z]+)/', '-$1', $str));\n\t}",
"function camelCaseToSnakeCase(string $input): string\n{\n return preg_replace('/[-\\.]/', '_', strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input)));\n}"
] | [
"0.68611574",
"0.6761117",
"0.62922984",
"0.62291056",
"0.6168118",
"0.61582583",
"0.6030664",
"0.5918212",
"0.59175646",
"0.5872404",
"0.58319354",
"0.5828152",
"0.5815072",
"0.58124965",
"0.57932174",
"0.57455605",
"0.5731739",
"0.57248795",
"0.5714138",
"0.5685054",
"0.56735826",
"0.5654446",
"0.56421703",
"0.56330955",
"0.5596561",
"0.55761707",
"0.5565488",
"0.5556226",
"0.5539602",
"0.55191904"
] | 0.74796385 | 0 |
Test snake function with underscore delimiter. | public function testSnakeWithUnderscores(): void
{
$this->processSimpleTests('snake', static::$snakeUnderscore);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function snake()\n {\n return self::generate('_');\n }",
"function underscore($s, $sep = '_') {\n\n $s = preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $s);\n $s = preg_replace('/([0-9])([a-z])/', '$1_$2', $s);\n $s = preg_replace('/([a-zA-Z])([0-9])/', '$1_$2', $s);\n $s = preg_replace('/[\\s_-]+/', $sep, $s);\n\n return strtolower($s);\n\n }",
"public function snake($word);",
"public function underscore($camelCasedWord);",
"function str_underscore($str)\n{\n return strtolower(preg_replace('/(?<=\\\\w)([A-Z]+)/', '_\\\\1', $str));\n}",
"function underscore($str) {\n return preg_replace('/[\\s]+/', '_', trim(extension_loaded('mbstring') ? mb_strtolower($str) : strtolower($str)));\n}",
"function alpha_underscore($str)\n\t{\n\t\treturn ( ! preg_match(\"/^([a-z0-9_])+$/i\", $str)) ? FALSE : TRUE;\n\t}",
"public function testSnakeCase2()\n {\n $this->assertEquals(Str::snakeCase('foo bar'), 'foo_bar');\n }",
"public static function underscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }",
"public static function snake($str)\n {\n return self::mechanize($str, '_');\n }",
"static public function underscore($str)\n\t{\n\t\t$str = lcfirst($str);\n\t\treturn strtolower(preg_replace('/([A-Z]+)/', '_$1', $str));\n\t}",
"public function testSnakeWithDashes(): void\n {\n foreach (static::$snakeDashes as $input => $expected) {\n self::assertEquals($expected, (new Str())->snake($input, '-'));\n }\n }",
"function toSnakeCase($string)\n{\n $regex = ['/([a-z\\d])([A-Z])/', '/([^_])([A-Z][a-z])/'];\n\n return strtolower(preg_replace($regex, '$1_$2', $string));\n}",
"function underscore(){\n\t\t$out = $this->_copy();\n\t\t$out->_String4 = mb_strtolower(preg_replace(\"/([a-z0-9\\p{Ll}])([A-Z\\p{Lu}])/u\",\"\\\\1_\\\\2\",$this->_String4));\n\t\treturn $out;\n\t}",
"protected function isUnderscoreName($string)\n {\n // If there are space in the name, it can't be valid.\n if (strpos($string, ' ') !== false) {\n return false;\n }\n\n // Remove the first _ if it exists. This is allowed\n // for very low level \"private\" internal functions.\n // Only need to check against _ because already looked for __\n if (preg_match('|^_|', $string) === 1) {\n $string = substr($string, 1);\n }\n\n $validName = true;\n $nameBits = explode('_', $string);\n\n if (preg_match('|^[a-z]|', $string) === 0) {\n // Name does not begin with a capital letter.\n $validName = false;\n } else {\n foreach ($nameBits as $bit) {\n if ($bit{0} !== strtolower($bit{0})) {\n $validName = false;\n break;\n }\n }\n }\n\n return $validName;\n\n }//end isUnderscoreName()\n\n /**\n * Processes the tokens outside the scope.\n *\n * @param PHP_CodeSniffer_File $phpcsFile The file being processed.\n * @param int $stackPtr The position where this token was\n * found.\n *\n * @return void\n */\n protected function processTokenOutsideScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n $functionName = $phpcsFile->getDeclarationName($stackPtr);\n if ($functionName === null) {\n return;\n }\n // disallow __function_name() \n if (preg_match('|^__|', $functionName) === 1) {\n $error = \"Function name \\\"$functionName\\\" cannot start with '__'.\";\n $phpcsFile->addError($error, $stackPtr);\n } else if ($this->isUnderscoreName($functionName) === false) {\n $error = \"Function name \\\"$functionName\\\" is not in underscore format\";\n $phpcsFile->addError($error, $stackPtr);\n }\n\n }//end processTokenOutsideScope()\n\n /**\n * Processes the tokens within the scope.\n *\n * @param PHP_CodeSniffer_File $phpcsFile The file being processed.\n * @param int $stackPtr The position where this token was\n * found.\n * @param int $currScope The position of the current scope.\n *\n * @return void\n */\n protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $currScope)\n {\n $methodName = $phpcsFile->getDeclarationName($stackPtr);\n if ($methodName === null) {\n // Ignore closures.\n return;\n }\n\n $className = $phpcsFile->getDeclarationName($currScope);\n\n // Is this a magic method. IE. is prefixed with \"__\".\n if (preg_match('|^__|', $methodName) !== 0) {\n $magicPart = substr($methodName, 2);\n if (in_array($magicPart, $this->magicMethods) === false) {\n $error = \"Method name \\\"$className::$methodName\\\" is invalid; only PHP magic methods should be prefixed with a double underscore\";\n $phpcsFile->addError($error, $stackPtr);\n }\n\n return;\n }\n\n $methodProps = $phpcsFile->getMethodProperties($stackPtr);\n $isPublic = ($methodProps['scope'] === 'private') ? false : true;\n $scope = $methodProps['scope'];\n $scopeSpecified = $methodProps['scope_specified'];\n\n // If the scope was specified on the method, then the method must be\n // camel caps and an underscore should be checked for. If it wasn't\n // specified, treat it like a public method and remove the underscore\n // prefix if there is one because we cant determine if it is private or\n // public.\n $testMethodName = $methodName;\n if ($scopeSpecified === false && $methodName{0} === '_') {\n $testMethodName = substr($methodName, 1);\n }\n\n // Elgg modification: force CodeSniffer to see all methods as public\n if (PHP_CodeSniffer::isCamelCaps($testMethodName, false, true, false) === false) {\n if ($scopeSpecified === true) {\n $error = ucfirst($scope).\" method name \\\"$className::$methodName\\\" is not in underscore and camel caps format\";\n } else {\n $error = \"Method name \\\"$className::$methodName\\\" is not in camel caps format\";\n }\n\n $phpcsFile->addError($error, $stackPtr);\n return;\n }\n\n }//end processTokenWithinScope()\n\n\n}",
"static function spaceOrUnderscore( $pattern ) {\n\t\treturn str_replace( ' ', '[ _]', $pattern );\n\t}",
"public function testSpaceIsRepresentedByUnderscore()\n {\n $encoder = new QpMimeHeaderEncoder();\n $this->assertEquals('a_b', $encoder->encodeString('a b'), 'Spaces can be represented by more readable underscores as per RFC 2047.');\n }",
"static function snake(string $s, string $delimiter = '_'): string {\n if (ctype_lower($s)) {\n return $s;\n }\n $s = preg_replace('/\\s+/u', '', ucwords($s));\n\n return static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $s));\n }",
"function camelCaseToUnderscore($str) {\n $str[0] = strtolower($str[0]);\n $func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n return preg_replace_callback('/([A-Z])/', $func, $str);\n }",
"function put_underscore($str, $lower = true)\n {\n if (!$lower) {\n return str_replace(' ', '_', $str);\n }\n return strtolower(str_replace(' ', '_', $str));\n }",
"public function testSnakeCase1()\n {\n $this->assertEquals(Str::snakeCase('étoile filante'), 'etoile_filante');\n }",
"public function useUnderscores() {\n return $this->_use_underscore;\n }",
"function validName($name) {\n \n return preg_replace('/\\s+/', '_',$name);\n\n}",
"public function underscore($word)\n\t{\n\t\treturn strtolower(preg_replace('/[^A-Z^a-z^0-9]+/','_',\n\t\t\t\tpreg_replace('/([a-zd])([A-Z])/','1_2',\n\t\t\t\t\tpreg_replace('/([A-Z]+)([A-Z][a-z])/','1_2',$word))));\n\t}",
"public static function underscore($word, $sep = '_', $strtolower = true)\n {\n $sep = empty($sep) ? '_' : $sep;\n $return = preg_replace('/[^A-Z^a-z^0-9]+/', $sep,\n preg_replace('/([a-z\\d])([A-Z])/','\\1_\\2',\n preg_replace('/([A-Z]+)([A-Z][a-z])/','\\1_\\2',$word)));\n return $strtolower ? strtolower($return) : $return;\n }",
"function snake_case($value, $delimiter = '_')\n\t{\n\t\treturn Illuminate\\Support\\Str::snake($value, $delimiter);\n\t}",
"function u_ ($s) {\n $out = preg_replace('/([^_])([A-Z])/', '$1_$2', $s);\n return 'u_' . strtolower($out);\n}",
"public static function snake(string $str, string $c = \"/\"): string {\n\t\t\treturn str_replace($c, \"_\", strtolower(trim($str, \"/\\\\ \")));\n\t\t}",
"public static function snakeCase($str) {}",
"public function camelCaseToLowerCaseUnderscoredDataProvider() {}"
] | [
"0.69975686",
"0.6944281",
"0.68872434",
"0.6786461",
"0.6759755",
"0.6683658",
"0.66639155",
"0.6581483",
"0.6554406",
"0.655261",
"0.6519515",
"0.6476716",
"0.642526",
"0.64116347",
"0.6402788",
"0.6363868",
"0.63379586",
"0.63342345",
"0.62720424",
"0.6247595",
"0.62353957",
"0.6233995",
"0.61579984",
"0.61500597",
"0.61384517",
"0.6088037",
"0.6086932",
"0.6071499",
"0.6063592",
"0.60526067"
] | 0.7959954 | 0 |
Initializes the Battleeffect Attaches itself to the Battle, or increases the duration of an existing (same) Battleeffect | public function initialize($battle, $hero, $enemy, $options = array()) {
$options = array_merge(
// The default options
array(
'autoAttach' => true,
'turns' => $this->turns,
),
// The specified options
$options
);
/**
* up to this point: hero = combatant who brought this effect into play
* adjust so that heroString is the owner of the buff/debuff
*/
if($this->buff) {
$this->heroString = $battle->getCombatantString($hero);
$this->enemyString = $battle->getCombatantString($enemy);
} else {
$this->heroString = $battle->getCombatantString($enemy);
$this->enemyString = $battle->getCombatantString($hero);
}
$this->active = true;
$this->turns = (!empty($options['turns']) ? $options['turns'] : 0);
if($this->blocks && $this->blockNumberOfBlocks > 0) {
$this->charges = $this->blockNumberOfBlocks;
}
/**
* Adds the effect in case it's not already active
* Unless the effect should only be active once per combatant,
* in which case the duration will be increased
*/
if($options['autoAttach']) {
if(!$this->singleton || !$battle->battleeffects->contains($this)) {
$battle->addEffect($this);
return "added";
} elseif ($this->increaseDuration) {
$battle->increaseEffectDuration($this);
return "increasedDuration";
}
}
return "notAdded";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addEffect($Effect) {\n $Effect->call(\"attachToBattle\", $this);\n $this->battleeffects->add($Effect);\n }",
"public function effect1()\n {\n }",
"abstract public function buildEffect();",
"public function increaseEffectDuration($Battleeffect, $sameHero = true) {\n $existingEffectIndex = $this->battleeffects->indexOf($Battleeffect, $sameHero);\n if($existingEffectIndex > -1) {\n $existingEffect = $this->battleeffects->itemAt($existingEffectIndex);\n $existingEffect->turns += $Battleeffect->turns;\n } else {\n // nothing or throw exception?\n }\n }",
"function stDogmaEffect() {\n $current_effect_type = self::getGameStateValue('current_effect_type');\n $current_effect_number = self::getGameStateValue('current_effect_number');\n $card_id = self::getGameStateValue('dogma_card_id');\n $card = self::getCardInfo($card_id);\n $qualified_effect = self::qualifyEffect($current_effect_type, $current_effect_number, $card);\n \n // Search for the first player who will undergo/share the effects, if any\n $first_player = self::getFirstPlayerUnderEffect($current_effect_type);\n if ($first_player === null) {\n // There is no player affected by the effect\n self::notifyGeneralInfo(\"<span class='minor_information'>\" . clienttranslate('Nobody is affected by the ${qualified_effect} of the card.') . \"</span>\", array(\n 'i18n' => array('qualified_effect'),\n 'qualified_effect' => $qualified_effect\n ));\n \n // End of the effect\n self::trace('dogmaEffect->interDogmaEffect');\n $this->gamestate->nextState('interDogmaEffect');\n return;\n }\n \n self::setGameStateValue('current_player_under_dogma_effect', $first_player);\n $this->gamestate->changeActivePlayer($first_player);\n \n // Begin the loop with this player\n self::trace('dogmaEffect->playerInvolvedTurn');\n $this->gamestate->nextState('playerInvolvedTurn');\n }",
"public function run()\n {\n $effects = ['chorus', 'delay', 'reverb'];\n\n foreach ($effects as $effect) {\n Effect::create(['name' => $effect]);\n }\n }",
"public function attachToBattle($battle) {\n $battle->onAfterRound = array($this, 'reactToOnAfterRound');\n if($this->blocks) {\n $battle->onBeforeAction = array($this, 'reactToOnBeforeAction');\n }\n }",
"public function __construct(){\n\n // Update the session keys for this object\n $this->session_key = 'BATTLES';\n $this->session_token = 'battle_token';\n $this->session_id = 'battle_id';\n $this->class = 'battle';\n $this->multi = 'battles';\n\n // Create any required sub-objects\n $this->queue['sound_effects'] = array();\n\n // Collect any provided arguments\n $args = func_get_args();\n\n // Collect current battle data from the function if available\n $this_battleinfo = isset($args[0]) ? $args[0] : array('battle_id' => 0, 'battle_token' => 'battle');\n\n // Now load the battle data from the session or index\n $this->battle_load($this_battleinfo);\n\n // Return true on success\n return true;\n\n }",
"public function start() {\n // Init stuff\n $this->combatantAID = $this->combatantA->id;\n $this->combatantBID = $this->combatantB->id;\n\n // Decide between pve and pvp\n if(get_class($this->combatantB) == \"Monster\") {\n $this->combatantB->call(\"getReadyForBattle\");\n $this->type = \"monster\";\n } else {\n $this->type = \"pvp\";\n }\n \n $this->state = \"ongoing\";\n $this->winnerType = 'undecided';\n \n $this->battleeffects = new BattleeffectList();\n \n \n if($this->type == \"pvp\") {\n // @todo Should players have first round battle messages?\n } else {\n $battleMsg = new Battlemessage(\n $this->combatantB->call(\"createFirstRoundCombatMessage\")\n );\n $this->log($this->combatantB, $battleMsg);\n }\n\n // Insert new DB record\n $this->insert();\n \n // Set ongoingBattleID for combattants\n $this->combatantA->ongoingBattleID = $this->id;\n if($this->type == \"pvp\") {\n $this->combatantB->ongoingBattleID = $this->id;\n // $this->combatantB->save();\n }\n \n $this->saveObjectState();\n }",
"public function setEffect( $effect ) {\n $this->effect = $effect;\n }",
"function stInterDogmaEffect() { $current_effect_type = self::getGameStateValue('current_effect_type');\n \n // Indicate the potential new (non-demand) dogma to come\n if ($current_effect_type == 0) { // I demand dogma : there is only one for this version of this game\n $current_effect_number = 1; // Switch on the first non-demand dogma, if exists\n }\n else {\n $current_effect_number = self::getGameStateValue('current_effect_number') + 1; // Next non-demand dogma, if exists\n }\n \n $card_id = self::getGameStateValue('dogma_card_id');\n $card = self::getCardInfo($card_id);\n \n // Check whether this new dogma exists actually or not\n if ($current_effect_number > 3 || $card['non_demand_effect_'.$current_effect_number] === null) {\n // No card has more than 3 non-demand dogma => there is no more effect\n // or the next non-demand-dogma effect is not defined\n \n $sharing_bonus = self::getGameStateValue('sharing_bonus');\n $launcher_id = self::getGameStateValue('active_player');\n \n // Stats\n $i_demand_effects = false;\n $executing_players = self::getExecutingPlayers();\n foreach($executing_players as $player_id => $stronger_or_equal) {\n if ($player_id == $launcher_id) {\n continue;\n }\n if ($stronger_or_equal) { // This player had effectively shared some dogma effects of the card\n self::incStat(1, 'sharing_effects_number', $player_id);\n }\n else { // The card had an I demand effect, and at least one player executed it with effects\n self::incStat(1, 'i_demand_effects_number', $player_id);\n $i_demand_effects = true;\n }\n\n }\n if ($i_demand_effects) {\n self::incStat(1, 'dogma_actions_number_with_i_demand', $launcher_id);\n }\n if ($sharing_bonus == 1) {\n self::incStat(1, 'dogma_actions_number_with_sharing', $launcher_id);\n }\n \n // Award the sharing bonus if needed\n if ($sharing_bonus == 1) {\n self::notifyGeneralInfo('<span class=\"minor_information\">${text}</span>', array('i18n'=>array('text'), 'text'=>clienttranslate('Sharing bonus.')));\n $player_who_launched_the_dogma = self::getGameStateValue('active_player');\n try {\n self::executeDraw($player_who_launched_the_dogma); // Draw a card with age consistent with player board\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::stInterDogmaEffect');\n self::trace('interDogmaEffect->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n }\n \n // The active player may have changed during the dogma. Reset it on the player whose turn was\n $this->gamestate->changeActivePlayer($launcher_id);\n \n // Reset player table\n self::resetPlayerTable();\n \n // [R] Disable the flags used when in dogma \n self::setGameStateValue('dogma_card_id', -1);\n self::setGameStateValue('current_effect_type', -1);\n self::setGameStateValue('current_effect_number', -1);\n self::setGameStateValue('sharing_bonus', -1);\n self::setGameStateValue('current_player_under_dogma_effect', -1);\n self::setGameStateValue('step', -1);\n self::setGameStateValue('step_max', -1);\n self::setGameStateValue('special_type_of_choice', -1);\n self::setGameStateValue('choice', -1);\n self::setGameStateValue('splay_direction', -1);\n self::setGameStateValue('n_min', -1);\n self::setGameStateValue('n_max', -1);\n self::setGameStateValue('solid_constraint', -1);\n self::setGameStateValue('owner_from', -1);\n self::setGameStateValue('location_from', -1);\n self::setGameStateValue('owner_to', -1);\n self::setGameStateValue('location_to', -1);\n self::setGameStateValue('bottom_to', -1);\n self::setGameStateValue('age_min', -1);\n self::setGameStateValue('age_max', -1);\n self::setGameStateValue('color_array', -1);\n self::setGameStateValue('with_icon', -1);\n self::setGameStateValue('without_icon', -1);\n self::setGameStateValue('not_id', -1);\n self::setGameStateValue('can_pass', -1);\n self::setGameStateValue('n', -1);\n self::setGameStateValue('id_last_selected', -1);\n self::setGameStateValue('age_last_selected', -1);\n self::setGameStateValue('color_last_selected', -1);\n self::setGameStateValue('score_keyword', -1);\n self::setGameStateValue('auxiliary_value', -1);\n for($i=1; $i<=9; $i++) {\n self::setGameStateInitialValue('nested_id_'.$i, -1);\n self::setGameStateInitialValue('nested_current_effect_number_'.$i, -1);\n }\n \n // End of this player action\n self::trace('interDogmaEffect->interPlayerTurn');\n $this->gamestate->nextState('interPlayerTurn');\n return;\n }\n \n // There is another (non-demand) effect to perform\n self::setGameStateValue('current_effect_type', 1);\n self::setGameStateValue('current_effect_number', $current_effect_number);\n \n // Jump to this effect\n self::trace('interDogmaEffect->dogmaEffect');\n $this->gamestate->nextState('dogmaEffect');\n }",
"public function __construct()\n {\n $this->battleground = new Battleground;\n $this->red = null;\n $this->blue = null;\n $this->reasonRed = null;\n $this->reasonBlue = null;\n }",
"public function applyDamage()\n\t\t{\n\t\t\tforeach ($this->_members as $member)\n\t\t\t{\n\t\t\t\tif ($member->_alive)\n\t\t\t\t{\n\t\t\t\t\t$member->takeDamage();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"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 }",
"function start()\n\t{\n\t\t$this->score = 0;\n\t\t$this->won = false;\n\t\t$this->over = false;\n\t}",
"public function takeDamage()\n\t\t{\n\t\t\tif ($this->_illness)\n\t\t\t{\n\t\t\t\t$this->_health -= $this->_damage; \n\t\t\t}\n\t\t}",
"public function hit()\n {\n $fight = $this->getDamage();\n $fight = $fight + 5;\n $this->setDamage($fight);\n\n }",
"public function __construct()\n\t{\n\t\t$this->game = new BowlingGame;\n\t}",
"public function damage_options_reset(){\n // Redfine the options variables as an empty array\n $this->damage_options = array();\n // Populate the array with defaults\n $this->damage_options = array();\n $this->damage_options['damage_header'] = $this->robot->robot_name.''s '.$this->ability_name;\n $this->damage_options['damage_frame'] = 'damage';\n $this->damage_options['ability_success_frame'] = 1;\n $this->damage_options['ability_success_frame_span'] = 1;\n $this->damage_options['ability_success_frame_offset'] = array('x' => 0, 'y' => 0, 'z' => 1);\n $this->damage_options['ability_failure_frame'] = 1;\n $this->damage_options['ability_failure_frame_span'] = 1;\n $this->damage_options['ability_failure_frame_offset'] = array('x' => 0, 'y' => 0, 'z' => 1);\n $this->damage_options['damage_kind'] = 'energy';\n $this->damage_options['damage_type'] = $this->ability_type;\n $this->damage_options['damage_type2'] = $this->ability_type2;\n $this->damage_options['damage_amount'] = $this->ability_damage;\n $this->damage_options['damage_amount2'] = $this->ability_damage2;\n $this->damage_options['damage_kickback'] = array('x' => 5, 'y' => 0, 'z' => 0);\n $this->damage_options['damage_percent'] = false;\n $this->damage_options['damage_percent2'] = false;\n $this->damage_options['damage_modifiers'] = true;\n $this->damage_options['success_rate'] = 'auto';\n $this->damage_options['failure_rate'] = 'auto';\n $this->damage_options['critical_rate'] = 10;\n $this->damage_options['critical_multiplier'] = 2;\n $this->damage_options['weakness_multiplier'] = 2;\n $this->damage_options['resistance_multiplier'] = 0.5;\n $this->damage_options['immunity_multiplier'] = 0;\n $this->damage_options['success_text'] = 'The ability hit!';\n $this->damage_options['failure_text'] = 'The ability missed…';\n $this->damage_options['immunity_text'] = 'The ability had no effect…';\n $this->damage_options['critical_text'] = 'It's a critical hit!';\n $this->damage_options['weakness_text'] = 'It's super effective!';\n $this->damage_options['resistance_text'] = 'It's not very effective…';\n $this->damage_options['weakness_resistance_text'] = ''; //\"It's a super effective resisted hit!';\n $this->damage_options['weakness_critical_text'] = 'It's a super effective critical hit!';\n $this->damage_options['resistance_critical_text'] = 'It's a critical hit, but not very effective…';\n // Update this ability's data\n $this->update_session();\n // Return the resuling array\n return $this->damage_options;\n }",
"public function __construct()\n {\n $this->dice = new DiceImage();\n $this->resetVariables();\n }",
"public function __construct()\n {\n $this->dice = new DiceImage();\n $this->resetVariables();\n }",
"public function getEffect() {\n return $this->effect;\n }",
"function __construct() {\n // initialize things when class is instantiated\n $this->id = rand(100, 1000000);\n echo \"The created animal was assigned an id of \" . $this->id . \"<br>\";\n Animal::$numberOfAnimals+=1;\n }",
"public function __construct()\n {\n $this->matchFinished = false;\n //$this->player1 = new Player('A');\n //$this->player2 = new Player('B');\n }",
"private function applyInfect($time, &$action_message, $skill_effect, $monster) {\n\t\tif(!empty($this->monsters[$monster['id']]['Monster']['debuffs']['infected'])) {\n\t\t\t$this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'] += rand($skill_effect['amount_min'], $skill_effect['amount_max']);\n\t\t\t$this->addActionMessage($action_message, 'debuff_gained', $this->monsters[$monster['id']]['Monster']['name'].' is Infected('.$this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'].').');\n\t\t}else{\n\t\t\t$this->monsters[$monster['id']]['Monster']['debuffs']['infected'] = [\n\t\t\t\t'stacks' => rand($skill_effect['amount_min'], $skill_effect['amount_max'])\n\t\t\t];\n\t\t\tif($this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'] == 1) {\n\t\t\t\t$this->addActionMessage($action_message, 'debuff_gained', $this->monsters[$monster['id']]['Monster']['name'].' is Infected.');\n\t\t\t}else{\n\t\t\t\t$this->addActionMessage($action_message, 'debuff_gained', $this->monsters[$monster['id']]['Monster']['name'].' is Infected('.$this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'].').');\n\t\t\t}\n\t\t}\n\t}",
"public function __construct(Skywars $plugin) {\n\t\t$this->plugin = $plugin;\n\t\t$plugin->getServer()->getPluginManager()->registerEvents($this, $plugin);\n\n\t\t$this->actionItemManager = new ActionItemManager($plugin);\n\n\n\n\t\t$plugin->getServer()->getScheduler()->scheduleRepeatingTask(new CooldownTickTask($plugin), 1);\n\t\t$plugin->getServer()->getScheduler()->scheduleRepeatingTask(new NotificationTickTask($plugin), 20);\n\n\t\t// heh, maybe this is a bit hacky, but why not do it like this?\n\t\t$livingClass = new ReflectionClass(\"\\\\pocketmine\\\\entity\\\\Living\");\n\t\t$this->attackTimeProperty = $livingClass->getProperty(\"attackTime\");\n\t\t$this->attackTimeProperty->setAccessible(true);\n\n\t\t$this->notifyId = Entity::$entityCount++;\n\t\t;\n\t}",
"public function __construct($one, $two)\n {\n echo \"<br />Creating battle simulator..\" . PHP_EOL;\n $this->_type = $this->setRandomTypeOfBattle();\n echo \"<br />Optimizing terrain...\" . PHP_EOL;\n $this->_turn = rand(0, 1);\n $this->_army1 = $one;\n $this->_army2 = $two;\n }",
"public function setMinDamage(){ $this->minDamage = 10; }",
"public function startBattle()\n {\n echo \"Starting battle.. <br />\";\n echo \"Type of this battle is: <i>\" . $this->_type . \"</i>.<br />\";\n echo \"\\t\\t<i>\" . $this->getTypeDescription() . \"</i><br/>\";\n \n $round = 0;\n while(!$this->battleFinished())\n {\n // prints information about current round:\n echo \"<br /><br />ROUND \" . $round++ . \" Attacker: <i>\";\n echo $this->getAttacker()->getName();\n echo \"</i>\\tDefender: <i>\";\n echo $this->getDefender()->getName() . \"</i>\";\n $this->status();\n \n $this->getAttacker()->fight($this, $this->getDefender());\n \n $this->changeTurn(); \n }\n \n // battle is over, print status and declare winner (if there is any) \n $this->status(); \n echo \"<br/><br/>The winner is: <b>\";\n echo $this->getWinner() . \"</b>!\" . PHP_EOL;\n }",
"private function attack()\n {\n $this->tempAttackerStats = $this->attacker->stats;\n $this->tempDefenderStats = $this->defender->stats;\n\n // 1. Before hit check, apply all luck modifying skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills, \n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 2. Check if attack is evaded\n $luck = $this->tempDefenderStats[Character::STAT_LUCK];\n if ($luck != 0 && $this->chance($luck)) {\n return $this->status = self::STATUS_MISSED;\n }\n\n // 3. Apply stat modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 4. Calculate the damage\n $strength = $this->tempAttackerStats[Character::STAT_STRENGTH];\n $defence = $this->tempDefenderStats[Character::STAT_DEFENCE];\n\n $this->damage = max(0, $strength - $defence);\n\n // 5. Apply damage modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_ATTACKER, $this->damage);\n }\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_DEFENDER, $this->damage);\n }\n );\n\n // 6. Apply the final damage\n $this->defender->stats[Character::STAT_HEALTH] =\n max(0, $this->defender->stats[Character::STAT_HEALTH] - $this->damage);\n\n $this->status = self::STATUS_COMPLETED;\n }"
] | [
"0.5735397",
"0.55760324",
"0.53802097",
"0.53462476",
"0.5302386",
"0.5204993",
"0.5204175",
"0.51896894",
"0.5131411",
"0.5121749",
"0.50694335",
"0.49684772",
"0.49374932",
"0.49102452",
"0.48864853",
"0.4853551",
"0.48373732",
"0.480392",
"0.48027736",
"0.4790001",
"0.4790001",
"0.47712263",
"0.47634292",
"0.47189435",
"0.47003454",
"0.46874616",
"0.4675308",
"0.466134",
"0.46602947",
"0.46581197"
] | 0.62219137 | 0 |
Returns a string that can be used as the ocntent of a popup for the Battleeffect | public function getPopup() {
if($this->blocks) {
return $this->desc . "<BR /> <BR />" .
"<b>Blocks" .
($this->charges > 0 ? " " . $this->charges . " more" : "") .
($this->blockActionTypes != "all" ? $this->blockActionTypes : "") . " actions" .
($this->blockChance < 1 ? " with a chance of " . floor($this->blockChance * 100) . "%" : "") .
($this->turns > 0 ? " within the next " . $this->turns . " rounds" : "") .
".";
}
return $this->desc;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function popUpString(Competition $competition)\n {\n $description =\n \"<b>\" . $competition->getName() . \"</b><br>Du \"\n . $this->ds->format($competition->getDateStart(), 'd-m') . \" au \"\n . $this->ds->format($competition->getDateEnd(), 'd-m') .\n \"<br> <a href='\" .\n $this->router->generate('competition_show', array('id' => $competition->getId())) .\n \"'>Voir cette compétition</a><br>\";\n\n if ($competition->getInChampionship())\n $description = $description . \"<img class='leaflet-popup-img' src='/webSport/web/img/cup.jpg'/>\";\n\n if ($competition->getCompetitorRegister() == 1)\n $description = $description . \"<img class='leaflet-popup-img' src='/webSport/web/img/canRegister.png'/>\";\n\n if ($competition->getCompetitorRegister() == 2)\n $description = $description . \"<img class='leaflet-popup-img' src='/webSport/web/img/race_start.png'/>\";\n\n $properties = array(\n 'name' => $competition->getName(),\n 'description' => $description,\n );\n\n $geometry = array(\n \"type\" => \"Point\",\n \"coordinates\" => array($competition->getLocation()->getY(), $competition->getLocation()->getX())\n );\n\n $feature = array(\n \"type\" => \"Feature\",\n \"properties\" => $properties,\n \"geometry\" => $geometry,\n );\n\n return $feature;\n }",
"public function getPopupHtml() { return $this->popHtml; }",
"public function getPopup() {}",
"public function toString()\n {\n return 'Take Payment Popup In Session Management. Every Element Visible Correctly.';\n }",
"public function toString()\n\t{\n\t\treturn \"Order History - Cancel Order - Popup Display: Pass\";\n\t}",
"function buildPopup(){\t\t\n\t\t$html = '';\n\t\t$html .= JDom::_('html.fly.bootstrap.modal', array(\n\t\t\t\t'domId' => 'fset_modal_form',\n\t\t\t\t'domClass' => 'popupform formFieldsContainer',\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'data-backdrop'=> 'static'\n\t\t\t\t\t),\n\t\t\t\t'title' => JText::_(\"JACTION_EDIT\")\n\t\t\t));\n\t\t\n\t\treturn $html;\n\t}",
"public function __toString()\r\n {\r\n return $this->buildEffect();\r\n }",
"public function gameOver()\n\t{\n\n\t\tif($this->checkForWin() == true) {\n\n\t\t\t$gameover = '<div id=\"overlay\" class=\"win\"><div>';\n\t\t\t$gameover .= '<h1 id=\"game-over-message\">Congratulations on guessing: ' . $this->phrase->activePhrase . '</h1>';\n\t\t\t$gameover .= '<form action=\"play.php\" method=\"POST\"><input type=\"submit\" value=\"Play again\" class=\"btn__reset\"></form>';\n\t\t\t$gameover .= '</div></div>';\n\n\t\t} elseif ($this->checkForLose() == true) {\n\n\t\t\t$gameover = '<div id=\"overlay\" class=\"lose\"><div>';\n\t\t\t$gameover .= '<h1 id=\"game-over-message\">The phrase was: ' . $this->phrase->activePhrase . '. Better luck next time!</h1>';\n\t\t\t$gameover .= '<form action=\"play.php\" method=\"POST\"><input type=\"submit\" value=\"Try again\" class=\"btn__reset\"></form>';\n\t\t\t$gameover .= '</div></div>';\n\t\n\t\t} else {\n\t\t\t$gameover = false;\n\t\t}\n\n\t\treturn $gameover;\n\n\t}",
"public function getPopupContent();",
"function toString(){\n\n $res = '<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" id=\"' . $this->my_id . '\" >' . \"\\n\";\n $res .=\"<tr><td>\\n\";\n $res .='<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" >' . \"\\n\";\n $res .=\"<tr>\\n\";\n $res .='<td><b><IMG SRC=\"plus.gif\" id=\"' . $this->my_id . 'img\" onclick=\"changepopup(1,' . \"'\" . $this->my_id . \"'\" . ')\">';\n\nif(!is_null($this->my_pic))$res .='<IMG SRC=\"' . $this->my_pic . '\" img\" onclick=\"changepopup(1,' . \"'\" . $this->my_id . \"'\" . ')\">';\n $res .='<FONT FACE=\"Arial\" SIZE=3 COLOR=\"#000000\">' . $this->title . '</FONT></b></td>' . \"\\n\";\n //$res .='<td bgcolor=\"#3300bb\" width=\"20\"><IMG SRC=\"popdown.gif\" onclick=\"changepopup(false,' . \"'\" . $this->my_id . \"'\" . ')\"></td>' . \"\\n\";\n //$res .='<td bgcolor=\"#3300bb\" width=\"20\"><IMG SRC=\"popup.gif\" onclick=\"changepopup(true,' . \"'\" . $this->my_id . \"'\" . ')\" ></td>' . \"\\n\";\n $res .=\"</tr></table>\\n\";\n $res .=\"</td></tr>\\n\";\n $res .='<tr><td>';\n $res .='';\n\n\n /*$tmp = count($this->arrayObj);\n for($i = 0 ; $i<$tmp ; $i++){\n \n\n if(is_object($this->arrayObj[$i])){\n\n $res .= \"<P>\" . $this->arrayObj[$i]->toString() . \"</P>\";\n \n }else{\n $res .= \"<P>\" . $this->arrayObj[$i] . \"</P>\";\n \n }\n }*/\n \n $res .= \"</td></tr></table>\";\n \n return $res;}",
"public function graphic()\n {\n return \"die-\" . $this->value;\n }",
"public function buildSubwindow()\n {\n return '<button type=\"menu\" ><![CDATA['.$this->content.']]></button>';\n }",
"public function message()\n {\n return 'This chest is in cool down. Try again later.';\n }",
"public function toString()\n\t{\n\t\treturn \"Customer on checkout page - New customer popup is closed\";\n\t}",
"public function getUiCallText() {\n return \"UCC Flash Project\";\n }",
"public abstract function getDatasetPopupHtml():string;",
"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}",
"public function BannerPickerPopUp()\n\t{\tob_start();\n\t\techo '<script type=\"text/javascript\">$().ready(function(){$(\"body\").append($(\".jqmWindow\"));$(\"#banner_modal_popup\").jqm();});</script>',\n\t\t\t'<!-- START instructor list modal popup --><div id=\"banner_modal_popup\" class=\"jqmWindow\" style=\"padding-bottom: 5px; width: 640px; margin-left: -320px; top: 10px; height: 600px; \"><a href=\"#\" class=\"jqmClose submit\">Close</a><div id=\"bannerModalInner\" style=\"height: 500px; overflow:auto;\"></div></div>';\n\t\treturn ob_get_clean();\n\t}",
"function draw_actions(){\r\n\t\t$out='';\r\n\r\n\t\tif(count($this->actions)>0){\r\n\r\n\t\t\t$out='<select id=\"'.$this->id.'_actions\" name=\"'.$this->id.'_actions\" onchange=\"'.$this->change_tags($this->actions_url).'\">';\r\n\r\n\t\t\tfor($i=0; $i<count($this->actions); $i++){\r\n\t\t\t\t$out.='<option value=\"'.$this->actions[$i][0].'\">'.$this->actions[$i][1].'</option>';\r\n\t\t\t}\r\n\r\n\t\t\t$out.='</select>';\r\n\r\n\t\t}\r\n\r\n\t\treturn $out;\r\n\t}",
"public function toString()\n {\n return \"Gift message is displayed for each items on order(s) view page on frontend correctly.\";\n }",
"function printAsideEspertoProfilo($img_profilo) {\r\n \r\n $img_profilo = '../' . $img_profilo;\r\n \r\n echo '<div class=\"tooltip-esperto\">';\r\n echo '<span class=\"tooltip-testo-esperto\">Utente esperto</span>';\r\n echo '<div class=\"profilo-img-container profilo-esperto\">' .\r\n '<img onclick=\"showModal(' . \"'modifica-immagine-profilo','post-container'\" . ')\"' .\r\n 'class=\"img-profilo-dim pointer\" src=\"' . $img_profilo .'\"' .\r\n 'alt=\"Immagine del profilo\"/>' . \r\n '<div class=\"aside-testo\">' . $_SESSION['nickname'] . '</div>' .\r\n '</div>';\r\n echo '</div>';\r\n}",
"function panelActionView($mang, $arrayOption = null, $arrayOption2 = null) {\n $str = \"\n\n\n\n\n\n\n\n\t\t\t\t<div id='panelAction' class='panelAction'>\n\n\n\n\n\n\n\n <div style='width:475px;float:left;\" . $arrayOption2[\"style\"] . \";height:17px;padding-top:5px;'>\" . $mang . \"</div>\n\n\n\n\n\n\n\n\t\t\t\t\t<div class='panelActionContent' style='\" . $arrayOption[\"style\"] . \"'>\n\n\n\n\n\n\n\n\t\t\t\t\t<table id='panelTable' cellpadding='0' cellspacing='0' width='200' align='right'>\n\n\n\n\n\n\n\n\t\t\t\t\t\t<tr>\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t<td class='cellAction1'>\" . selectIMG . \"</td><td class='cellAction'>\" . selectText . \"</td>\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t<td class='cellAction1'>\" . deleteIMG . \"</td><td class='cellAction'>\" . deleteText . \"</td><td class='cellAction1'>\" . viewIMG . \"</td><td class='cellAction11'>\" . viewText . \"</td>\n\n\n\n\n\n\n\n\t\t\t\t\t\t</tr>\n\n\n\n\n\n\n\n\t\t\t\t\t</table>\n\n\n\n\n\n\n\n\t\t\t\t\t</div>\n\n\n\n\n\n\n\n\t\t\t\t</div>\";\n return $str;\n }",
"function xstats_getShipFullDescription( $gameId, $shipId, $race, $picturesmall, $experience, $turn, $shipclass, $shipname) {\n//could be 0 if the ship is not destroyed at the end of the game\n if( $turn == 0 || $turn == xstats_getMaxTurn($gameId)) {\n $ownerIndex = xstats_getLastShipOwnerIndexAtTurn($gameId, $shipId );\n }else {\n $ownerIndex = xstats_getShipOwnerIndexAtTurn($gameId, $shipId, $turn);\n }\n return( xstats_getShipIconWithExp( $race, $picturesmall, $experience, $ownerIndex ).' <span>'.$shipclass.' ['.$shipname.'_'.$shipId.']</span>' );\n}",
"function cp_print_popUp($firstBtnValue,$title,$content,$btnType,$btnValue,$btnName){\r\n echo \"<span class='btn-wrapper'><label for='popup-first-btn' class='popup-btn btn'>$firstBtnValue</label></span>\",\r\n '<input id=\"popup-first-btn\" type=\"radio\" name=\"popup-conf\" class=\"popup-first-btn btn\" value=\"none\">',\r\n '<div class=\"popup-night\">',\r\n '<div class=\"popup-box\" >',\r\n \"<h4>$title</h4>\",\r\n \"<p>$content</p>\",\r\n '<input id=\"popup-exit\" type=\"radio\" name=\"popup-conf\">',\r\n '<label for=\"popup-exit\">×</label>',\r\n \"<span class='btn-wrapper'><input class='popup-final-btn btn' name='$btnName' value='$btnValue' type='$btnType'></span>\",\r\n '</div>',\r\n '</div> ';\r\n}",
"protected function _getPopupClass() {\n $classes = array();\n // Apply the template\n $classes[] = $this->_getTemplateClass();\n\n return implode(\" \", $classes);\n }",
"public function getTypeOfBattle()\n {\n return \"Type of this battle is: \" . $this->_type . \".<br />\";\n }",
"function toString(){\n\n $res = '<table border=\"0\" width=\"100%\" cellspacing=\"0\" id=\"' . $this->my_id . '\" >' . \"\\n\";\n $res .=\"<tr><td>\\n\";\n $res .='<table border=\"0\" width=\"100%\" cellspacing=\"0\">' . \"\\n\";\n $res .=\"<tr>\\n\";\n $res .='<td width=\"10\" background=\"field.gif\" > </td>' . \"\\n\";\n $res .='<td bgcolor=\"#3300bb\" ><b><FONT FACE=\"Arial\" SIZE=3 COLOR=\"#EEEEEE\">' . $this->title . '</FONT></b></td>' . \"\\n\";\n $res .='<td bgcolor=\"#3300bb\" width=\"20\"><IMG SRC=\"popdown.gif\" onclick=\"changepopup(false,' . \"'\" . $this->my_id . \"'\" . ')\"></td>' . \"\\n\";\n $res .='<td bgcolor=\"#3300bb\" width=\"20\"><IMG SRC=\"popup.gif\" onclick=\"changepopup(true,' . \"'\" . $this->my_id . \"'\" . ')\" ></td>' . \"\\n\";\n $res .=\"</tr></table>\\n\";\n $res .=\"</td></tr>\\n\";\n $res .='<tr><td bgcolor = \"#1100bb\">';\n $res .='';\n\n\n /*$tmp = count($this->arrayObj);\n for($i = 0 ; $i<$tmp ; $i++){\n \n\n if(is_object($this->arrayObj[$i])){\n\n $res .= \"<P>\" . $this->arrayObj[$i]->toString() . \"</P>\";\n \n }else{\n $res .= \"<P>\" . $this->arrayObj[$i] . \"</P>\";\n \n }\n }*/\n \n $res .= \"</td></tr></table>\";\n \n return $res;}",
"public function __toString() : string\n {\n $color = array_key_exists($this->getSuit(), SuitInterface::SUIT_COLOR)\n ? SuitInterface::SUIT_COLOR[$this->getSuit()]\n : 'black';\n return \"<span style='color: $color'>{$this->figure}{$this->suit}</span>\";\n }",
"function output()\n {\n $html = '';\n\n if( $this->course_id != -1 )\n {\n if( !empty($this->skype_name) )\n {\n $html .= \"\\n\\n\"\n . '<span id=\"skypeStatus\">' . \"\\n\"\n . '<!-- Skype \"My status\" button http://www.skype.com/go/skypebuttons -->' . \"\\n\"\n . '<script type=\"text/javascript\" src=\"http://download.skype.com/share/skypebuttons/js/skypeCheck.js\"></script>' . \"\\n\"\n . '<a href=\"skype:'.$this->skype_name.'?call\"><img src=\"http://mystatus.skype.com/smallclassic/'.$this->skype_name.'\"'\n . ' style=\"border: none;\" width=\"114\" height=\"20\" alt=\"'.get_lang('Skype status of course administrator').'\" /></a>' . \"\\n\";\n \n if( claro_is_allowed_to_edit() )\n {\n $html .= '<a href=\"'.get_module_url('CLSKYPE').'/edit.php\"><img src=\"'.get_icon_url('edit').'\" alt=\"'.get_lang('Modify').'\" /></a>' . \"\\n\";\n }\n \n $html .= '</span>' . \"\\n\\n\"; \n }\n elseif( claro_is_allowed_to_edit() )\n {\n $html .= '<a href=\"'.get_module_url('CLSKYPE').'/edit.php\" >'\n . '<img src=\"'.get_module_url('CLSKYPE').'/icon.png\" alt=\"\" align=\"top\" />'\n . get_lang('Configure Skype status notifier')\n . '</a>' . \"\\n\";\n }\n }\n\n return $html;\n }",
"public function bye(){\n return \"Bye... $this->dialogue\";\n }"
] | [
"0.631923",
"0.6104463",
"0.6072025",
"0.6067265",
"0.60236585",
"0.5861049",
"0.58421755",
"0.57494706",
"0.5739615",
"0.5586914",
"0.5559835",
"0.55369955",
"0.55255014",
"0.54983425",
"0.5479581",
"0.5450379",
"0.5446426",
"0.5441593",
"0.54314023",
"0.5430708",
"0.54068613",
"0.5401005",
"0.5399437",
"0.53945106",
"0.53887016",
"0.5374259",
"0.53680223",
"0.53613824",
"0.53555137",
"0.53477407"
] | 0.70814496 | 0 |
Returns an array with log details that can be part of a BattleMessage Includes id, name, buff, desc, and popup | public function getLogDetails() {
return array(
'id' => $this->id,
'name' => $this->name,
'buff' => $this->buff,
'desc' => $this->desc,
'popup' => $this->call("getPopup"),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLogMessages() {\n return $this -> log;\n }",
"public function getStatusLogMessages() {\n foreach($this->statusLogs as $log) {\n $log = explode(\",\", $log);\n $logMessage = &$log[0];\n $logTimestamp = &$log[1];\n $this->statusLogMessages[] = array($this->statusTemplates[ $logMessage ], date(\"Y:m:d h:i:s\", $logTimestamp));\n }\n\n return $this->statusLogMessages;\n }",
"public static function getLogs($userid=null, $gameID=null)\r\n\t{\t$ret = array();\r\n\t\r\n\t\t$con = db_connect();\r\n\t\tif($gameID!=null)\r\n\t\t{\r\n\t\t\t\t\r\n\t\t\t$statement = $con->prepare('Select building, user, card, custom_field_id, custom_field.text as fieldtext, icon, logger_id, timestamp, game, radius, lat, lon from logger left join location on logger.location=location.location_id left join custom_field on logger.text=custom_field.custom_field_id where game= ? ORDER BY timestamp DESC');\r\n\t\t\t$statement->execute(array($gameID));\r\n\t\t\t$result = $statement;\r\n\t\t\t\r\n\t\t\twhile($row = $result->fetch(PDO::FETCH_ASSOC))\r\n\t\t\t{\t\r\n\t\t\t\t//We need: User, Building, Game, Card, location, \r\n\t\t\t\t//We don't use the game in this context, because it would overload the json.\r\n\t\t\t\t$logger=new Log();\r\n\t\t\t\tif($row['building']!=null)\r\n\t\t\t\t\t$logger->building=Building::loadSelectedBuildingFromDB($row['building']);\r\n\t\r\n\t\t\t\tif($row['user']!=null)\t\r\n\t\t\t\t\t$logger->user=User::loadFromDB($row['user'],'normal');\r\n\t\r\n\t\t\t\tif($row['card']!=null)\r\n\t\t\t\t\t$logger->card=Card::loadSelectedCardFromDB($row['card']);\r\n\t\r\n\t\t\t\t\r\n\t\t\t\t$logger->Text=$row['fieldtext'];\r\n\t\t\t\t$logger->textID=$row['custom_field_id'];\r\n\t\t\t\t$logger->icon=$row['icon'];\r\n\t\t\t\t$logger->logID=$row['logger_id'];\r\n\t\t\t\t$logger->timestamp=$row['timestamp'];\r\n\t\t\t\t\r\n\t\t\t\tif($row['game'])\r\n\t\t\t\t\t$logger->game=$row['game'];\r\n\t\t\t\t\r\n\t\t\t\tif($row['lat'])\r\n\t\t\t\t{\r\n\t\t\t\t $loc = new Location();\r\n\t\t\t\t $loc->accu = $row['radius'];\r\n\t\t\t\t $loc->lat = $row['lat'];\r\n\t\t\t\t $loc->lon = $row['lon'];\r\n\t\t\t\t $logger->location = $loc;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$ret[] = $logger;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$con = null;\r\n\t\t\treturn $ret;\r\n\t\t}\r\n\t}",
"private static function humanizeLogs($logs)\n {\n if(count($logs) == 0) return $logs;\n\n //just snatch game id info from first avail log\n $gid = 0;\n for($i = 0; $i < count($logs) && !$gid; $i++)\n $gid = $logs[$i]->game_id;\n\n $item_list = dbconnection::queryArray(\"SELECT * FROM items WHERE game_id = '{$gid}';\");\n $item_map = array(); for($i = 0; $i < count($item_list); $i++) $item_map[$item_list[$i]->item_id] = $item_list[$i];\n $plaque_list = dbconnection::queryArray(\"SELECT * FROM plaques WHERE game_id = '{$gid}';\");\n $plaque_map = array(); for($i = 0; $i < count($plaque_list); $i++) $plaque_map[$plaque_list[$i]->plaque_id] = $plaque_list[$i];\n $dialog_list = dbconnection::queryArray(\"SELECT * FROM dialogs WHERE game_id = '{$gid}';\");\n $dialog_map = array(); for($i = 0; $i < count($dialog_list); $i++) $dialog_map[$dialog_list[$i]->dialog_id] = $dialog_list[$i];\n $dialog_script_list = dbconnection::queryArray(\"SELECT * FROM dialog_scripts WHERE game_id = '{$gid}';\");\n $dialog_script_map = array(); for($i = 0; $i < count($dialog_script_list); $i++) $dialog_script_map[$dialog_script_list[$i]->dialog_script_id] = $dialog_script_list[$i];\n $web_page_list = dbconnection::queryArray(\"SELECT * FROM web_pages WHERE game_id = '{$gid}';\");\n $web_page_map = array(); for($i = 0; $i < count($web_page_list); $i++) $web_page_map[$web_page_list[$i]->web_page_id] = $web_page_list[$i];\n $note_list = dbconnection::queryArray(\"SELECT * FROM notes WHERE game_id = '{$gid}';\");\n $note_map = array(); for($i = 0; $i < count($note_list); $i++) $note_map[$note_list[$i]->note_id] = $note_list[$i];\n $trigger_list = dbconnection::queryArray(\"SELECT * FROM triggers WHERE game_id = '{$gid}';\");\n $trigger_map = array(); for($i = 0; $i < count($trigger_list); $i++) $trigger_map[$trigger_list[$i]->trigger_id] = $trigger_list[$i];\n $instance_list = dbconnection::queryArray(\"SELECT * FROM instances WHERE game_id = '{$gid}';\");\n $instance_map = array(); for($i = 0; $i < count($instance_list); $i++) $instance_map[$instance_list[$i]->instance_id] = $instance_list[$i];\n $event_package_list = dbconnection::queryArray(\"SELECT * FROM event_packages WHERE game_id = '{$gid}';\");\n $event_package_map = array(); for($i = 0; $i < count($event_package_list); $i++) $event_package_map[$event_package_list[$i]->event_package_id] = $event_package_list[$i];\n $scene_list = dbconnection::queryArray(\"SELECT * FROM scenes WHERE game_id = '{$gid}';\");\n $scene_map = array(); for($i = 0; $i < count($scene_list); $i++) $scene_map[$scene_list[$i]->scene_id] = $scene_list[$i];\n $quest_list = dbconnection::queryArray(\"SELECT * FROM quests WHERE game_id = '{$gid}';\");\n $quest_map = array(); for($i = 0; $i < count($quest_list); $i++) $quest_map[$quest_list[$i]->quest_id] = $quest_list[$i];\n $tab_list = dbconnection::queryArray(\"SELECT * FROM tabs WHERE game_id = '{$gid}';\");\n $tab_map = array(); for($i = 0; $i < count($tab_list); $i++) $tab_map[$tab_list[$i]->tab_id] = $tab_list[$i];\n\n for($i = 0; $i < count($logs); $i++)\n {\n $l = $logs[$i];\n switch($l->event_type)\n {\n case 'NONE':\n $l->human = \"Null Log\";\n break;\n case 'LOG_IN':\n $l->human = \"User Logged In\";\n break;\n case 'BEGIN_GAME':\n $l->human = \"User Began Game\";\n break;\n case 'RESET_GAME':\n $l->human = \"User Reset Game\";\n break;\n case 'MOVE':\n $l->human = \"User Moved\";\n break;\n case 'RECEIVE_ITEM':\n $l->human = \"User Received {$l->qty} {$item_map[$l->content_id]->name} (Item)\";\n break;\n case 'LOSE_ITEM':\n $l->human = \"User Lost {$l->qty} {$item_map[$l->content_id]->name} (Item)\";\n break;\n case 'GAME_RECEIVE_ITEM':\n $l->human = \"Game Received {$l->qty} {$item_map[$l->content_id]->name} (Item)\";\n break;\n case 'GAME_LOSE_ITEM':\n $l->human = \"Game Lost {$l->qty} {$item_map[$l->content_id]->name} (Item)\";\n break;\n case 'GROUP_RECEIVE_ITEM':\n $l->human = \"Group Received {$l->qty} {$item_map[$l->content_id]->name} (Item)\";\n break;\n case 'GROUP_LOSE_ITEM':\n $l->human = \"Group Lost {$l->qty} {$item_map[$l->content_id]->name} (Item)\";\n break;\n case 'VIEW_TAB':\n $l->human = \"User Viewed {$tab_map[$l->content_id]->name} (Tab)\";\n break;\n case 'VIEW_INSTANCE':\n $l->human = \"User Viewed {$instance_map[$l->content_id]->name} (Instance)\";\n break;\n case 'VIEW_PLAQUE':\n $l->human = \"User Viewed {$plaque_map[$l->content_id]->name} (Plaque)\";\n break;\n case 'VIEW_ITEM':\n $l->human = \"User Viewed {$item_map[$l->content_id]->name} (Item)\";\n break;\n case 'VIEW_DIALOG':\n $l->human = \"User Viewed {$dialog_map[$l->content_id]->name} (Dialog)\";\n break;\n case 'VIEW_DIALOG_SCRIPT':\n $l->human = \"User Viewed {$dialog_script_map[$l->content_id]->text} (Dialog Script)\";\n break;\n case 'VIEW_WEB_PAGE':\n $l->human = \"User Viewed {$web_page_map[$l->content_id]->name} (Web Page)\";\n break;\n case 'VIEW_NOTE':\n $l->human = \"User Viewed {$note_map[$l->content_id]->name} (Note)\";\n break;\n case 'TRIGGER_TRIGGER':\n $l->human = \"User Triggered {$trigger_map[$l->content_id]->name} (Trigger)\";\n break;\n case 'CHANGE_SCENE':\n $l->human = \"User Changed {$scene_map[$l->content_id]->name} (Scene)\";\n break;\n case 'RUN_EVENT_PACKAGE':\n $l->human = \"User Ran {$event_package_map[$l->content_id]->name} (Event Package)\";\n break;\n case 'COMPLETE_QUEST':\n $l->human = \"User Completed {$quest_map[$l->content_id]->name} (Quest)\";\n break;\n case 'CREATE_NOTE':\n $l->human = \"User Created {$note_map[$l->content_id]->name} (Note)\";\n break;\n case 'GIVE_NOTE_LIKE':\n $l->human = \"User Liked {$note_map[$l->content_id]->name} (Note)\";\n break;\n case 'GET_NOTE_LIKE':\n $l->human = \"User Got Liked {$note_map[$l->content_id]->name} (Note)\";\n break;\n case 'GIVE_NOTE_COMMENT':\n $l->human = \"User Commented {$note_map[$l->content_id]->name} (Note)\";\n break;\n case 'GET_NOTE_COMMENT':\n $l->human = \"User Got Commented {$note_map[$l->content_id]->name} (Note)\";\n break;\n case 'UPLOAD_MEDIA_ITEM':\n $l->human = \"User Uploaded Media\";\n break;\n case 'UPLOAD_MEDIA_ITEM_IMAGE':\n $l->human = \"User Uploaded Image\";\n break;\n case 'UPLOAD_MEDIA_ITEM_AUDIO':\n $l->human = \"User Uploaded Audio\";\n break;\n case 'UPLOAD_MEDIA_ITEM_VIDEO':\n $l->human = \"User Uploaded Video\";\n break;\n case 'RECEIVE_WEBHOOK':\n $l->human = \"User Received Webhook\";\n break;\n case 'SEND_WEBHOOK':\n $l->human = \"User Sent Webhook\";\n break;\n }\n }\n return $logs;\n }",
"private function getMessageEventData(): array {\n $data = [\n \"type\" => \"message\",\n \"channel\" => \"C2147483705\",\n \"user\" => \"U2147483697\",\n \"text\" => \"Hello world\",\n \"ts\" => \"1355517523.000005\"\n ];\n if ( rand( 0, 1 ) == 0 ) {\n return $data;\n } else {\n $data[ 'edited' ] = [\n \"user\" => \"U2147483697\",\n \"ts\" => \"1355517536.000001\"\n ];\n return $data;\n }\n }",
"public function get_info() {\n\n\t\t$arr_info = array(\n\t\t\t'name' => _x( 'Plugin: WP Crontrol Logger', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t'description' => _x( 'Logs management of cron events', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t'name_via' => _x( 'Using plugin WP Crontrol', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t'capability' => 'manage_options',\n\t\t\t'messages' => array(\n\t\t\t\t'added_new_event' => _x( 'Added cron event \"{event_hook}\"', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'ran_event' => _x( 'Manually ran cron event \"{event_hook}\"', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'deleted_event' => _x( 'Deleted cron event \"{event_hook}\"', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'deleted_all_with_hook' => _x( 'Deleted all \"{event_hook}\" cron events', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'paused_hook' => _x( 'Paused the \"{event_hook}\" cron event hook', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'resumed_hook' => _x( 'Resumed the \"{event_hook}\" cron event hook', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'edited_event' => _x( 'Edited cron event \"{event_hook}\"', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'added_new_schedule' => _x( 'Added cron schedule \"{schedule_name}\"', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t\t'deleted_schedule' => _x( 'Deleted cron schedule \"{schedule_name}\"', 'PluginWPCrontrolLogger', 'simple-history' ),\n\t\t\t),\n\t\t);\n\n\t\treturn $arr_info;\n\t}",
"public function log(): array\r\n {\r\n return $this->activityRepository->getLogData();\r\n }",
"public function getBriefInfoMessages()\n {\n $array = imap_headers($this->imap);\n $newArray = [];\n foreach ($array as $key => $string) {\n $newArray[] = ['id'=>$key+1, 'info' => $string];\n };\n return $newArray;\n }",
"function get_ban_details() {\n\tglobal $db;\n\tglobal $attempted_user_id;\n\n\t$prepared = $db->prepare(\"\n\t\t\tSELECT date_time, until_date_time, reason\n\t\t\tFROM user_bans\n\t\t\tWHERE user_id = ? AND\n\t\t\t\tdate_time >= ALL (\n\t\t\t\t\t\tSELECT date_time\n\t\t\t\t\t\tFROM user_bans\n\t\t\t\t\t\tWHERE user_id = ?\n\t\t\t\t\t\t)\n\t\t\");\n\n\t$prepared->bind_param('ii', $attempted_user_id, $attempted_user_id);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\t$prepared->bind_result(\n\t\t$date_time,\n\t\t$until_date_time,\n\t\t$reason\n\t);\n\n\t$prepared->fetch();\n\n\t$prepared->free_result();\n\n\treturn (object) array(\n\t\t\t'date_time'\t\t\t=> $date_time,\n\t\t\t'until_date_time'\t=> $until_date_time,\n\t\t\t'reason'\t\t\t=> $reason\n\t\t);\n}",
"protected function get_legacy_logdata() {\n $name = $this->get_legacy_eventname();\n $url = preg_replace('/^.*\\/mod\\/reader\\//', '', $this->get_url());\n return array($this->courseid, 'reader', $name, $url, $this->objectid, $this->contextinstanceid);\n }",
"public function getLog()\n\t{\n\t\t$models = CWizardLog::model()->forSession($this->session)->findAll();\n\t\tfor ($log = array(); list(, $model) = each($models);\n\t\t $log[$model->action_id] = $model) ;\n\t\tif (!count($log))\n\t\t\t$log = array(new CWizardLog);\n\t\treturn $log;\n\t}",
"private function getWatchdogData() {\n $wd = array();\n if (\\Drupal::moduleHandler()->moduleExists('dblog')) {\n $result = db_select('watchdog', 'w')\n ->fields('w', array('wid', 'severity', 'type', 'message', 'timestamp'))\n ->condition('w.severity', array(RfcLogLevel::EMERGENCY, RfcLogLevel::CRITICAL), 'IN')\n ->condition('w.timestamp', REQUEST_TIME - 3600, '>')\n ->execute();\n\n while ($record = $result->fetchAssoc()) {\n $wd[$record['severity']] = $record;\n }\n }\n\n return $wd;\n }",
"function get_call_log()\r\n\t{\r\n\t\t$log_details=$this->db->query(\"SELECT a.msg,date_format(FROM_UNIXTIME(a.created_on),'%d/%m/%y %h:%i %p') as created_on,a.sender,c.franchise_name\r\n\t\t\t\t\t\t\t\t\tFROM pnh_sms_log a\r\n\t\t\t\t\t\t\t\t\tJOIN pnh_m_franchise_info c ON c.franchise_id=a.franchise_id\r\n\t\t\t\t\t\t\t\t\tWHERE c.is_suspended=0 AND `type`='CALL'\");\r\n\t\tif($log_details->num_rows())\r\n\t\t{\r\n\t\t\treturn $log_details ->result_array();\r\n\t\t\t\r\n\t\t}else\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t}",
"function getLog(){\n\t\t$log = $this->msgHandler->getLog();\n\t\treturn $this->translator->markupAttributes('div', $log, array('style'=>'overflow: scroll; height: 25%; width: 50%; margin: auto;'));\n\t}",
"public function getLogObjectData() : array {\n return [\n 'objId' => $this->_id,\n 'objName' => $this->scope\n ];\n }",
"public static function get_bot_activity ($bot_name)\n {\n $entries = [];\n foreach (static::$_log as $timestamp => $lines) {\n $matches = preg_grep(\"/^$bot_name /\", $lines);\n if ( count($matches) > 0 ) {\n $entries[] = array_shift($matches);\n }\n else {\n $entries[] = '';\n }\n }\n return $entries;\n }",
"public function allInfo() {\n return $this->infoMsg;\n }",
"function extractMessageArray($line)\r\n{\r\n\t$linearray = explode('||', $line);\r\n\r\n\t// Snag the unix timestamp and perform some date calculations\r\n\t$datetime = array_shift($linearray);\r\n\r\n\t// Time elapsed (e.g. 1.5 hours, 4 days, etc.)\r\n\t$age = duration_str(time() - $datetime, false, 2);\r\n\r\n\t// Long format date\r\n $date_full = date(\"l, d F Y\", $datetime);\r\n\r\n // Short format date\r\n $date = date('m/d/Y', $datetime);\r\n\r\n // Time of day\r\n $time = date('H:i', $datetime);\r\n\r\n // Day of week\r\n $day = date('l', $datetime);\r\n\r\n\t// Hour\r\n\t$hour = date('H', $datetime);\r\n\r\n // Next snag the name\r\n $name = array_shift($linearray);\r\n\r\n\t// Check for action or system notice\r\n\t$action = ($name{0} == '*') ? true : false;\r\n\t$notice = ($name{0} == '!') ? true : false;\r\n\r\n\tif ($action || $notice)\r\n\t\t$name = mb_substr($name, 1);\r\n\r\n\t// Now put the post back together\r\n\t$words = trim(implode(' ', $linearray));\r\n\r\n\t// return this mess of info\r\n\treturn array\r\n\t(\r\n\t\t'timestamp' => $datetime,\r\n\t\t'date_full' => $date_full,\r\n\t\t'date' => $date,\r\n\t\t'time' => $time,\r\n\t\t'day' => $day,\r\n\t\t'hour' => $hour,\r\n\t\t'age' => $age,\r\n\t\t'action' => $action,\r\n\t\t'notice' => $notice,\r\n\t\t'name' => $name,\r\n\t\t'text' => $words\r\n\t);\r\n}",
"function dblog_event($id) {\n $severity = watchdog_severity_levels();\n $result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = :id', array(':id' => $id))->fetchObject();\n if ($dblog = $result) {\n $rows = array(\n array(\n array('data' => t('Type'), 'header' => TRUE),\n t($dblog->type),\n ),\n array(\n array('data' => t('Date'), 'header' => TRUE),\n format_date($dblog->timestamp, 'long'),\n ),\n array(\n array('data' => t('User'), 'header' => TRUE),\n theme('username', array('account' => $dblog)),\n ),\n array(\n array('data' => t('Location'), 'header' => TRUE),\n l($dblog->location, $dblog->location),\n ),\n array(\n array('data' => t('Referrer'), 'header' => TRUE),\n l($dblog->referer, $dblog->referer),\n ),\n array(\n array('data' => t('Message'), 'header' => TRUE),\n theme('dblog_message', array('event' => $dblog)),\n ),\n array(\n array('data' => t('Severity'), 'header' => TRUE),\n $severity[$dblog->severity],\n ),\n array(\n array('data' => t('Hostname'), 'header' => TRUE),\n check_plain($dblog->hostname),\n ),\n array(\n array('data' => t('Operations'), 'header' => TRUE),\n $dblog->link,\n ),\n );\n $build['dblog_table'] = array(\n '#theme' => 'table',\n '#rows' => $rows,\n '#attributes' => array('class' => array('dblog-event')),\n );\n return $build;\n }\n else {\n return '';\n }\n}",
"public function getMessages()\n {\n $chat_info = $this->_Database->query(\"SELECT chat.*, users.user_name, users.staff_status FROM chat LEFT JOIN users ON users.user_id = chat.user_id ORDER BY chat_id DESC\", null, \"fetchAll\");\n return $chat_info;\n }",
"public function getLogs()\n {\n $lines = array();\n foreach ($this->logs as $l)\n $lines[] = $l[0] . \" \" . Logger::fillPlaceholders($l[1], $l[2]);\n $this->logs = array();\n return $lines;\n }",
"function get_data() {\n\t\t$stats = array();\n\t\t$fp = fopen('vrecohack.log', 'r');\n\t\twhile (($line = fgets($fp)) !== false) {\n\t\t\t// print_r($line);\n\t\t\tassert(strpos($line, '===START===') !== false);\n\t\t\t$request = unserialize(fgets($fp));\n\t\t\t# skip what we don't need yet\n\t\t\tfor ($i = 0; $i < 6; $i++) {\n\t\t\t\tfgets($fp);\n\t\t\t\t// $line = fgets($fp);\n\t\t\t\t// if (isset($line['REMOTE_ADDR'])) {\n\t\t\t\t// \t$ip = $line['REMOTE_ADDR'];\n\t\t\t\t// }\n\t\t\t}\n\t\t\tif (isset($request['action'])) {\n\t\t\t\t$step = $request['step'];\n\t\t\t\t$choice = $request['choice'];\n\t\t\t\t$stats[$step][$choice] += 1;\n\t\t\t}\n\t\t}\n\t\tfclose($fp);\n\t\treturn $stats;\n\t}",
"public function get_recent_visitors_log() {\n\t\t$current_log = get_option(self::$ROLES_LOG_KEY);\n\t\t$current_log = $current_log ? json_decode($current_log, true) : array();\n\n\t\tif (!empty($current_log)) {\n\t\t\tglobal $wp_roles;\n\t\t\t$roles = $wp_roles->get_names();\n\t\t\t$roles['guest'] = __('Guest', 'minerva-kb');\n\n\t\t\t$current_log = array_map(function($entry) use ($roles) {\n\t\t\t\t$entry_roles = array_map(function($role) use ($roles) {\n\t\t\t\t\treturn isset($roles[$role]) ? $roles[$role] : $role; // replace keys with names, if available\n\t\t\t\t}, explode('%', $entry));\n\n\t\t\t\treturn implode('/', $entry_roles);\n\t\t\t}, $current_log);\n\t\t}\n\n\t\treturn $current_log;\n\t}",
"public function getChatInfo(){\n $update = json_decode(file_get_contents(\"php://input\"), true);\n $chatID = $update[\"message\"][\"chat\"][\"id\"];\n $message = $update[\"message\"][\"text\"];\n $this->updateChatList($chatID);\n\n return array('chatID' => $chatID, 'message' => $message);\n }",
"public function info()\n {\n $info = [\n 'id' => $this->id,\n 'action' => $this->action,\n 'condition' => $this->condition,\n 'expressions' => $this->expressions,\n 'logMessageFormat' => $this->logMessageFormat,\n 'logLevel' => $this->logLevel,\n 'isFinalState' => $this->isFinalState,\n 'createTime' => $this->createTime,\n 'finalTime' => $this->finalTime,\n 'stackFrames' => array_map(function ($sf) {\n return $sf->info();\n }, $this->stackFrames),\n 'evaluatedExpressions' => array_map(function ($exp) {\n return $exp->info();\n }, $this->evaluatedExpressions),\n ];\n if ($this->labels) {\n $info['labels'] = $this->labels;\n }\n if ($this->userEmail) {\n $info['userEmail'] = $this->userEmail;\n }\n if ($this->location) {\n $info['location'] = $this->location->info();\n }\n if ($this->status) {\n $info['status'] = $this->status->info();\n }\n if ($this->variableTable) {\n $info['variableTable'] = $this->variableTable->info();\n }\n return $info;\n }",
"public function toLoguxResponse() : array\n {\n // Handle internal server error\n if (isset($this->_log['error'])) {\n return [[\n 'answer' => 'error',\n 'details' => $this->_log['error'],\n 'id' => $this->getId()\n ]];\n }\n\n $response = [];\n if ($this->_recepients) {\n $response[] = array_merge([\n 'answer' => 'resend',\n 'id' => $this->getId()\n ], $this->_recepients);\n }\n\n $response = array_merge($response, array_map(function ($logType) {\n return [\n 'answer' => $logType,\n 'id' => $this->getId()\n ];\n }, $this->_log));\n\n return $response;\n }",
"public function getLogData(): array {\n\t\t$data = [];\n\n\t\t$data['input_properties_count'] = $this->getInputPropertiesCount();\n\t\t$data['monitoring_point_id'] = $this->getMonitoringPointId();\n\t\t$data['user_id'] = $this->getUserId();\n\t\t$data['property_statistics'] = [];\n\n\t\tforeach ($this->getProperties() as $property) {\n\t\t\t$data['property_statistics'][] = [\n\t\t\t\t'symbol' => $property,\n\t\t\t\t'values_count' => $this->getPropertyValuesCount($property),\n\t\t\t\t'inserts' => $this->getPropertyInserts($property),\n\t\t\t\t'updates' => $this->getPropertyUpdates($property),\n\t\t\t\t'no_changes' => $this->getPropertyNoChanges($property),\n\t\t\t\t'min_time' => $this->getPropertyMinTimeFormatted($property),\n\t\t\t\t'max_time' => $this->getPropertyMaxTimeFormatted($property),\n\t\t\t];\n\t\t}\n\n\t\treturn $data;\n\t}",
"protected function getSqlLogs()\n {\n $logs = array();\n //$bindings = array();\n $i = 0;\n $previousLine = array();\n \n $sqlLogTitles = array('Doctrine_Connection_Mysql', 'Doctrine_Connection_Statement');\n foreach ($this->webDebug->getLogger()->getLogs() as $log)\n {\n // Store the log if it is not a doctrine query log\n if (!in_array($log['type'], $sqlLogTitles))\n {\n $previousLine[] = $log;\n continue;\n }\n\n // Add log info to the debug display list\n $y = $i;\n if(sizeof($previousLine) > 0)\n {\n $this->info[$y++] = $previousLine;\n $previousLine = array();\n }\n\n if (preg_match('/^.*?(\\b(?:SELECT|INSERT|UPDATE|DELETE)\\b.*)$/', $log['message'], $match))\n {\n // Extract the targeted table and update its uses counter\n $table = self::extractTableFromSQL($match[1]);\n if(!$this->tablesCalculated)\n {\n if(!array_key_exists($table, self::$tables))\n {\n self::$tables[$table] = '1';\n }\n else\n {\n self::$tables[$table]++;\n }\n }\n\n $logs[$i++] = array('log' => $this->formatSql($match[1]), 'table' => $table);\n\n //$bindings[$i - 1] = array();\n }\n /*else if (preg_match('/Binding (.*) at position (.+?) w\\//', $log['message'], $match))\n {\n $bindings[$i - 1][] = $match[2].' = '.$match[1];\n }*/\n }\n\n $logs = $this->reintroduceValuesIntoQueries($logs);\n\n if(!$this->tablesCalculated)\n {\n $this->tablesCalculated = true;\n }\n\n return $logs;\n }",
"public function getLog(): array\n {\n return $this->log;\n }",
"public function __debugInfo()\n {\n return array_merge(parent::__debugInfo(), [\n 'consumer_tag' => $this->consumerTag,\n 'delivery_tag' => $this->deliveryTag,\n 'redeliver' => $this->redeliver,\n 'exchange' => $this->exchange,\n 'routing_key' => $this->routingKey,\n 'channel_object_hash' => spl_object_hash($this->channel),\n ]);\n }"
] | [
"0.5992564",
"0.59583867",
"0.5849614",
"0.5846944",
"0.5765909",
"0.5758528",
"0.57425106",
"0.5703975",
"0.56327254",
"0.56302947",
"0.5580207",
"0.55665827",
"0.5514092",
"0.5499748",
"0.5498985",
"0.5496919",
"0.5432442",
"0.54047894",
"0.5381422",
"0.53557956",
"0.5353696",
"0.533947",
"0.53390527",
"0.53362",
"0.5335322",
"0.53320086",
"0.5309712",
"0.53067744",
"0.5295375",
"0.52803254"
] | 0.74417436 | 0 |
Attaches the Battleeffect to the Battle "Override" by specialness classes by using these commands: $battle>onBeforeAction = array($this, 'reactToOnBeforeAction'); $battle>onAfterAction = array($this, 'reactToOnAfterAction'); $battle>onBeforeDealingDamage = array($this, 'reactToOnBeforeDealingDamage'); $battle>onAfterDealingDamage = array($this, 'reactToOnAfterDealingDamage'); $battle>onBeforeTakingDamage = array($this, 'reactToOnBeforeTakingDamage'); $battle>onAfterTakingDamage = array($this, 'reactToOnAfterTakingDamage'); | public function attachToBattle($battle) {
$battle->onAfterRound = array($this, 'reactToOnAfterRound');
if($this->blocks) {
$battle->onBeforeAction = array($this, 'reactToOnBeforeAction');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addEffect($Effect) {\n $Effect->call(\"attachToBattle\", $this);\n $this->battleeffects->add($Effect);\n }",
"public function implement_all_effects()\n\t{\n\t\tforeach ($this->collection as $image)\n\t\t{\n\t\t\t$image->implement_effects();\n\t\t}\n\t}",
"public function applyBehaviors()\n {\n foreach ($this->behaviors as $behavior) {\n if (!$behavior->isEntityModified()) {\n $behavior->getEntityModifier()->modifyEntity();\n $behavior->setEntityModified(true);\n }\n }\n }",
"function Add_Ability_Bonuses(&$character1) {\r\n\t\t$positions = array(\"head\", \"neck\", \"torso\", \"cloak\", \"weaponr\", \"weaponl\", \"ringr\", \"ringl\", \"bracer\", \"belt\", \"feet\");\r\n\t\t$attributes = array(\"str\", \"dex\", \"con\", \"intel\", \"wis\", \"cha\");\r\n\t\tforeach($positions as $key=>$position) {\r\n\t\t\tforeach($attributes as $key=>$attrib) {\r\n\t\t\t\tif(!empty($_SESSION['modifiers'][$position][$attrib])) \r\n\t\t\t\t{\r\n\t\t\t\t\t$character1[$attrib] = $character1[$attrib] + $_SESSION['modifiers'][$position][$attrib];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function hooks()\n {\n foreach ($this->getActions() as $key => $action) {\n switch (true) {\n case $action instanceof HooksAdminInterface:\n if (is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksFrontInterface:\n if (!is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksInterface:\n $action->hooks();\n break;\n }\n }\n }",
"public function effect1()\n {\n }",
"public static function ability_function_forward_attack($objects, $target_options, $damage_options, $recovery_options, $effect_options = array()){\n\n // Define defaults for undefined target options\n if (!isset($target_options['stat_kind'])){ $target_options['stat_kind'] = 'energy'; }\n if (!isset($target_options['robot_frame'])){ $target_options['robot_frame'] = 'shoot'; }\n if (!isset($target_options['robot_kickback'])){ $target_options['robot_kickback'] = array(0, 0, 0); }\n if (!isset($target_options['ability_frame'])){ $target_options['ability_frame'] = 0; }\n if (!isset($target_options['ability_offset'])){ $target_options['ability_offset'] = array(110, 0, 10); }\n if (!isset($target_options['ability_text'])){ $target_options['ability_text'] = '{this_robot_name} uses the {this_ability_name}!'; }\n\n // Define defaults for undefined damage options\n if (!isset($damage_options['robot_frame'])){ $damage_options['robot_frame'] = 'damage'; }\n if (!isset($damage_options['robot_kickback'])){ $damage_options['robot_kickback'] = array(10, 0, 0); }\n if (!isset($damage_options['ability_sucess_frame'])){ $damage_options['ability_sucess_frame'] = 4; }\n if (!isset($damage_options['ability_success_offset'])){ $damage_options['ability_success_offset'] = array(-90, 0, 10); }\n if (!isset($damage_options['ability_success_text'])){ $damage_options['ability_success_text'] = 'The {this_ability_name} hit the target!'; }\n if (!isset($damage_options['ability_failure_frame'])){ $damage_options['ability_failure_frame'] = 4; }\n if (!isset($damage_options['ability_failure_offset'])){ $damage_options['ability_failure_offset'] = array(-100, 0, -10); }\n if (!isset($damage_options['ability_failure_text'])){ $damage_options['ability_failure_text'] = 'The {this_ability_name} missed...'; }\n\n // Define defaults for undefined recovery options\n if (!isset($recovery_options['robot_frame'])){ $recovery_options['robot_frame'] = 'taunt'; }\n if (!isset($recovery_options['robot_kickback'])){ $recovery_options['robot_kickback'] = array(0, 0, 0); }\n if (!isset($recovery_options['ability_sucess_frame'])){ $recovery_options['ability_sucess_frame'] = 4; }\n if (!isset($recovery_options['ability_success_offset'])){ $recovery_options['ability_success_offset'] = array(-45, 0, 10); }\n if (!isset($recovery_options['ability_success_text'])){ $recovery_options['ability_success_text'] = 'The {this_ability_name} was absorbed by the target!'; }\n if (!isset($recovery_options['ability_failure_frame'])){ $recovery_options['ability_failure_frame'] = 4; }\n if (!isset($recovery_options['ability_failure_offset'])){ $recovery_options['ability_failure_offset'] = array(-100, 0, -10); }\n if (!isset($recovery_options['ability_failure_text'])){ $recovery_options['ability_failure_text'] = 'The {this_ability_name} had no effect on the target...'; }\n\n // Define defaults for undefined effect options\n if (!isset($effect_options['stat_kind'])){ $effect_options = false; }\n else {\n if (!isset($effect_options['damage_text'])){ $effect_options['damage_text'] = '{this_robot_name}\\'s stats were damaged!'; }\n if (!isset($effect_options['recovery_text'])){ $effect_options['recovery_text'] = '{this_robot_name}\\'s stats improved!'; }\n if (!isset($effect_options['effect_chance'])){ $effect_options['effect_chance'] = 50; }\n }\n\n // Extract all objects into the current scope\n extract($objects);\n\n // Define Search and replace object strings for replacing\n $search_replace = array();\n $search_replace['this_player_name'] = $this_player->print_player_name();\n $search_replace['this_robot_name'] = $this_robot->print_robot_name();\n $search_replace['target_player_name'] = $target_player->print_player_name();\n $search_replace['target_robot_name'] = $target_robot->print_robot_name();\n $search_replace['this_ability_name'] = $this_ability->print_ability_name();\n\n // Run the obtion arrays through the parsing function\n $target_options = self::parse_string_variables($search_replace, $target_options);\n $damage_options = self::parse_string_variables($search_replace, $damage_options);\n $recovery_options = self::parse_string_variables($search_replace, $recovery_options);\n if (!empty($effect_options)){\n $effect_options = self::parse_string_variables($search_replace, $effect_options);\n }\n\n // Update target options for this ability\n $this_ability->target_options_update(array(\n 'frame' => $target_options['robot_frame'],\n 'kickback' => $target_options['robot_kickback'],\n 'success' => array(\n $target_options['ability_frame'],\n $target_options['ability_offset'][0],\n $target_options['ability_offset'][1],\n $target_options['ability_offset'][2],\n $target_options['ability_text']\n )\n ));\n\n // Update damage options for this ability\n $this_ability->damage_options_update(array(\n 'kind' => $target_options['stat_kind'],\n 'frame' => $damage_options['robot_frame'],\n 'kickback' => $damage_options['robot_kickback'],\n 'success' => array(\n $damage_options['ability_sucess_frame'],\n $damage_options['ability_success_offset'][0],\n $damage_options['ability_success_offset'][1],\n $damage_options['ability_success_offset'][2],\n $damage_options['ability_success_text']\n ),\n 'failure' => array(\n $damage_options['ability_failure_frame'],\n $damage_options['ability_failure_offset'][0],\n $damage_options['ability_failure_offset'][1],\n $damage_options['ability_failure_offset'][2],\n $damage_options['ability_failure_text']\n )\n ));\n\n // Update recovery options for this ability\n $this_ability->recovery_options_update(array(\n 'kind' => $target_options['stat_kind'],\n 'frame' => $recovery_options['robot_frame'],\n 'kickback' => $recovery_options['robot_kickback'],\n 'success' => array(\n $recovery_options['ability_sucess_frame'],\n $recovery_options['ability_success_offset'][0],\n $recovery_options['ability_success_offset'][1],\n $recovery_options['ability_success_offset'][2],\n $recovery_options['ability_success_text']\n ),\n 'failure' => array(\n $damage_options['ability_failure_frame'],\n $damage_options['ability_failure_offset'][0],\n $damage_options['ability_failure_offset'][1],\n $damage_options['ability_failure_offset'][2],\n $damage_options['ability_failure_text']\n )\n ));\n\n\n // Target the opposing robot with this ability\n $this_robot->trigger_target($target_robot, $this_ability);\n\n // Attempt to inflict damage on the opposing robot\n $stat_damage_amount = $this_ability->ability_damage;\n $target_robot->trigger_damage($this_robot, $this_ability, $stat_damage_amount);\n\n // Only apply a secondary affect if one was defined\n if (!empty($effect_options)){\n\n // Define the stat property strings\n $robot_stat_prop = 'robot_'.$effect_options['stat_kind'];\n\n // Trigger effect if target isn't disabled and ability was successful and chance\n if (\n $target_robot->robot_status != 'disabled' &&\n $this_ability->ability_results['this_result'] != 'failure' &&\n $this_ability->ability_results['this_amount'] > 0 &&\n $target_robot->$robot_stat_prop > 0 &&\n ($effect_options['effect_chance'] == 100 || $this_battle->critical_chance($effect_options['effect_chance']))\n ){\n\n // Define the default damage options for the stat effect\n $this_ability->damage_options_update(array(\n 'kind' => $effect_options['stat_kind'],\n 'frame' => 'defend',\n 'percent' => true,\n 'kickback' => array(10, 0, 0),\n 'success' => array(9, 0, 0, -10, $effect_options['damage_text']),\n 'failure' => array(9, 0, 0, -9999, '')\n ));\n\n // Define the default recovery options for the stat effect\n $this_ability->recovery_options_update(array(\n 'kind' => $effect_options['stat_kind'],\n 'frame' => 'taunt',\n 'percent' => true,\n 'kickback' => array(0, 0, 0),\n 'success' => array(9, 0, 0, -10, $effect_options['recovery_text']),\n 'failure' => array(9, 0, 0, -9999, '')\n ));\n\n // Calculate the exact damage amount and trigger it on the target\n $trigger_options = array('apply_modifiers' => false);\n $stat_damage_amount = ceil($target_robot->$robot_stat_prop * ($this_ability->ability_damage2 / 100));\n $target_robot->trigger_damage($this_robot, $this_ability, $stat_damage_amount, true, $trigger_options);\n }\n\n }\n\n // Return true on success\n return true;\n\n }",
"function stDogmaEffect() {\n $current_effect_type = self::getGameStateValue('current_effect_type');\n $current_effect_number = self::getGameStateValue('current_effect_number');\n $card_id = self::getGameStateValue('dogma_card_id');\n $card = self::getCardInfo($card_id);\n $qualified_effect = self::qualifyEffect($current_effect_type, $current_effect_number, $card);\n \n // Search for the first player who will undergo/share the effects, if any\n $first_player = self::getFirstPlayerUnderEffect($current_effect_type);\n if ($first_player === null) {\n // There is no player affected by the effect\n self::notifyGeneralInfo(\"<span class='minor_information'>\" . clienttranslate('Nobody is affected by the ${qualified_effect} of the card.') . \"</span>\", array(\n 'i18n' => array('qualified_effect'),\n 'qualified_effect' => $qualified_effect\n ));\n \n // End of the effect\n self::trace('dogmaEffect->interDogmaEffect');\n $this->gamestate->nextState('interDogmaEffect');\n return;\n }\n \n self::setGameStateValue('current_player_under_dogma_effect', $first_player);\n $this->gamestate->changeActivePlayer($first_player);\n \n // Begin the loop with this player\n self::trace('dogmaEffect->playerInvolvedTurn');\n $this->gamestate->nextState('playerInvolvedTurn');\n }",
"public function applyDamage()\n\t\t{\n\t\t\tforeach ($this->_members as $member)\n\t\t\t{\n\t\t\t\tif ($member->_alive)\n\t\t\t\t{\n\t\t\t\t\t$member->takeDamage();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"private function attack()\n {\n $this->tempAttackerStats = $this->attacker->stats;\n $this->tempDefenderStats = $this->defender->stats;\n\n // 1. Before hit check, apply all luck modifying skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills, \n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 2. Check if attack is evaded\n $luck = $this->tempDefenderStats[Character::STAT_LUCK];\n if ($luck != 0 && $this->chance($luck)) {\n return $this->status = self::STATUS_MISSED;\n }\n\n // 3. Apply stat modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 4. Calculate the damage\n $strength = $this->tempAttackerStats[Character::STAT_STRENGTH];\n $defence = $this->tempDefenderStats[Character::STAT_DEFENCE];\n\n $this->damage = max(0, $strength - $defence);\n\n // 5. Apply damage modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_ATTACKER, $this->damage);\n }\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_DEFENDER, $this->damage);\n }\n );\n\n // 6. Apply the final damage\n $this->defender->stats[Character::STAT_HEALTH] =\n max(0, $this->defender->stats[Character::STAT_HEALTH] - $this->damage);\n\n $this->status = self::STATUS_COMPLETED;\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 reactToOnAfterTakingDamage($event) { }",
"public function ability() {\n\n $this->startMove(3, 0.2);\n echo \"THE ENGINE IS OVERHEATED!\\n\";\n $this->switchEngine();\n\n\n\n\n }",
"public function effect($effect)\n {\n $args = array_slice(func_get_args(), 1);\n\n if($effect instanceof PictureEffect)\n {\n $this->effect[] = $effect;\n }\n else\n {\n $effectClass = \"Palette\\\\Effect\\\\\" . $effect;\n\n if(class_exists($effectClass))\n {\n $reflection = new ReflectionClass($effectClass);\n $this->effect[] = $reflection->newInstanceArgs($args);\n }\n else\n {\n throw new Exception('Unknown Palette effect instance');\n }\n }\n }",
"public function reactToOnBeforeTakingDamage($event) { }",
"public function reactToOnBeforeDealDamage($event) { }",
"public function hit()\n {\n $fight = $this->getDamage();\n $fight = $fight + 5;\n $this->setDamage($fight);\n\n }",
"abstract public function buildEffect();",
"public function setEffect( $effect ) {\n $this->effect = $effect;\n }",
"public function set_hooks() {\n\t\t\t$this->hook_prefix = photonfill_hook_prefix();\n\n\t\t\t// Override Photon arg.\n\t\t\tadd_filter( $this->hook_prefix . '_photon_image_downsize_array', array( $this, 'set_photon_args' ), 5, 2 );\n\t\t\tadd_filter( $this->hook_prefix . '_photon_image_downsize_string', array( $this, 'set_photon_args' ), 5, 2 );\n\n\t\t\t// If we're using the photonfill_bypass_image_downsize, we skip downsize, and now need to\n\t\t\t// ensure the Photon args are being set (but with a lower priority).\n\t\t\tif ( apply_filters( 'photonfill_bypass_image_downsize', false ) ) {\n\t\t\t\tadd_filter( $this->hook_prefix . '_photon_pre_args', array( $this, 'set_photon_args' ), 4, 3 );\n\t\t\t}\n\n\t\t\t// Transform our Photon url.\n\t\t\tadd_filter( $this->hook_prefix . '_photon_pre_args', array( $this, 'transform_photon_url' ), 5, 1 );\n\t\t}",
"public function OnAllAction() {\n\n // get current action\n $HookName= current_filter();\n $HookNameParts= explode(' (', $HookName);\n $SearchName= isset($HookNameParts[1]) ? $HookNameParts[0] : $HookName;\n\n // find profiles containing that action and execute invalidation\n foreach($this->Profiles as $Name => $Profile) {\n if (in_array($SearchName, $Profile['InvalidatingActions'])) {\n $this->GetDealer($Name)->Invalidate($HookName);\n }\n }\n\n // search in group actions and trigger custom action if found\n foreach($this->GroupActions as $Name => $List) {\n if (in_array($HookName, $List)) {\n //$this->Log(\"[GroupAction: {$Name}] triggered by action: {$HookName}\");\n do_action(\"$Name ($HookName)\");\n }\n }\n }",
"public function applyAbilityOverrides ()\n {\n $class = new ReflectionClass($this->getItem()->getBaseItem());\n $baseItem = $class->newInstance();\n if (is_iterable($this->getItem()->getItemAbilities())) {\n foreach ($this->getItem()->getItemAbilities() as $itemAbility) {\n if ($this->attunedLevel >= $itemAbility->getAttunementLevelRequired()) {\n foreach ($itemAbility->getAbility()->getAbilityPartial() as $abilityPartial) {\n if ($abilityPartial instanceof AbilityOverride) {\n try {\n $key = Tools::snakeCaseToCamelCase($abilityPartial->getOverrideKey(), false);\n $property = $baseItem->getProperty($key);\n $property->setAccessible(true);\n if ($abilityPartial->isAppend()) {\n $property->setValue($this->getItem()->getBaseItem(), Tools::append($property->getValue(), $abilityPartial->getValue()));\n } else {\n $property->setValue($this->getItem()->getBaseItem(), $abilityPartial->getValue());\n }\n unset ($abilityPartial);\n } catch (\\Exception $exception) {\n continue;\n }\n }\n }\n }\n }\n }\n return $this;\n }",
"public function initialize($battle, $hero, $enemy, $options = array()) {\n $options = array_merge(\n // The default options\n array(\n 'autoAttach' => true,\n 'turns' => $this->turns,\n ),\n // The specified options\n $options\n ); \n\n /**\n * up to this point: hero = combatant who brought this effect into play\n * adjust so that heroString is the owner of the buff/debuff\n */\n if($this->buff) {\n $this->heroString = $battle->getCombatantString($hero);\n $this->enemyString = $battle->getCombatantString($enemy);\n } else {\n $this->heroString = $battle->getCombatantString($enemy);\n $this->enemyString = $battle->getCombatantString($hero);\n }\n \n $this->active = true;\n $this->turns = (!empty($options['turns']) ? $options['turns'] : 0);\n\n if($this->blocks && $this->blockNumberOfBlocks > 0) {\n $this->charges = $this->blockNumberOfBlocks;\n }\n \n /**\n * Adds the effect in case it's not already active\n * Unless the effect should only be active once per combatant,\n * in which case the duration will be increased\n */\n if($options['autoAttach']) {\n if(!$this->singleton || !$battle->battleeffects->contains($this)) {\n $battle->addEffect($this);\n return \"added\";\n } elseif ($this->increaseDuration) {\n $battle->increaseEffectDuration($this);\n return \"increasedDuration\";\n }\n }\n return \"notAdded\";\n }",
"protected function set_hooks() {\n\t\t// Compatibility with Cart Notices plugin\n\t\tadd_filter('wc_cart_notices_order_thresholds', array($this, 'wc_cart_notices_order_thresholds'), 20);\n\t\tadd_action('wc_cart_notices_process_notice_before', array($this, 'wc_cart_notices_process_notice_before'), 20);\n\t}",
"public function reactToOnBeforeAction($event) {\n if($this->blocks &&\n $this->active &&\n !$event->action->blocked &&\n $event->action->battlePhase == \"offense\" &&\n ($this->buff == ($event->sender->getCombatantString($event->hero) == $this->enemyString))) {\n \n if($this->blockChance != 1) {\n $rand = mt_rand(0,100);\n if($rand > $this->blockChance * 100) {\n return;\n }\n }\n \n if($event->action->call(\"setBlocked\")) {\n $this->charges --;\n \n $battleMsg = new Battlemessage($this->call(\"getMsgBlock\"));\n $event->sender->log($event->hero, $battleMsg);\n \n if($this->charges == 0) {\n $this->active = false;\n\n $battleMsg = new Battlemessage($this->msgExpire);\n $event->sender->log($event->hero, $battleMsg);\n }\n }\n }\n }",
"function execute($modifier = null)\n {\n $owner = $this->getOwner();\n $target = $this->getTarget();\n\n $originalDamageToDeal = $owner->getStrength() - $target->getDefence();\n\n if($originalDamageToDeal < 0 ) {\n $originalDamageToDeal = 0;\n }\n\n $damageToDeal = $originalDamageToDeal;\n\n $defenseSkills = $target->getDefenceSkills();\n\n foreach ($defenseSkills as $defenseSkill) {\n if(get_class($defenseSkill) != get_class($this)) {\n $defenseSkill->setOwner($target);\n $defenseSkill->setTarget($owner);\n $damageToDeal = $defenseSkill->execute($damageToDeal);\n }\n }\n\n if($target->isLucky()) {\n UI::actionMessage(\" {$this->getTarget()->getName()} got lucky. {$this->getOwner()->getName()} missed \");\n $damageToDeal = 0;\n } else {\n UI::actionMessage(\" {$this->getOwner()->getName()} hit {$this->getTarget()->getName()} for {$damageToDeal} damage\");\n }\n\n $targetOriginalHealth = $target->getHealth();\n $targetNewHealth = $targetOriginalHealth - $damageToDeal;\n\n\n\n $target->setHealth($targetNewHealth);\n\n }",
"private function hooks() {\n // stripe non3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_non_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_non_3ds' ], 10, 3 );\n\n // process 3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_3ds_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_3ds' ], 10, 3 );\n }",
"public function behaviors() {\n return array(\"application.components.SpecialnessBehavior\");\n }",
"private function hooks() {\n\t\t// Register rewrite tags.\n\t\tadd_action( 'wct_add_rewrite_tags', array( $this, 'add_rewrite_tags' ) );\n\n\t\t// Register the rewrite rules\n\t\tadd_action( 'wct_add_rewrite_rules', array( $this, 'add_rewrite_rules' ) );\n\n\t\t// Register the permastructs\n\t\tadd_action( 'wct_add_permastructs', array( $this, 'add_permastructs' ) );\n\t}",
"function stInterDogmaEffect() { $current_effect_type = self::getGameStateValue('current_effect_type');\n \n // Indicate the potential new (non-demand) dogma to come\n if ($current_effect_type == 0) { // I demand dogma : there is only one for this version of this game\n $current_effect_number = 1; // Switch on the first non-demand dogma, if exists\n }\n else {\n $current_effect_number = self::getGameStateValue('current_effect_number') + 1; // Next non-demand dogma, if exists\n }\n \n $card_id = self::getGameStateValue('dogma_card_id');\n $card = self::getCardInfo($card_id);\n \n // Check whether this new dogma exists actually or not\n if ($current_effect_number > 3 || $card['non_demand_effect_'.$current_effect_number] === null) {\n // No card has more than 3 non-demand dogma => there is no more effect\n // or the next non-demand-dogma effect is not defined\n \n $sharing_bonus = self::getGameStateValue('sharing_bonus');\n $launcher_id = self::getGameStateValue('active_player');\n \n // Stats\n $i_demand_effects = false;\n $executing_players = self::getExecutingPlayers();\n foreach($executing_players as $player_id => $stronger_or_equal) {\n if ($player_id == $launcher_id) {\n continue;\n }\n if ($stronger_or_equal) { // This player had effectively shared some dogma effects of the card\n self::incStat(1, 'sharing_effects_number', $player_id);\n }\n else { // The card had an I demand effect, and at least one player executed it with effects\n self::incStat(1, 'i_demand_effects_number', $player_id);\n $i_demand_effects = true;\n }\n\n }\n if ($i_demand_effects) {\n self::incStat(1, 'dogma_actions_number_with_i_demand', $launcher_id);\n }\n if ($sharing_bonus == 1) {\n self::incStat(1, 'dogma_actions_number_with_sharing', $launcher_id);\n }\n \n // Award the sharing bonus if needed\n if ($sharing_bonus == 1) {\n self::notifyGeneralInfo('<span class=\"minor_information\">${text}</span>', array('i18n'=>array('text'), 'text'=>clienttranslate('Sharing bonus.')));\n $player_who_launched_the_dogma = self::getGameStateValue('active_player');\n try {\n self::executeDraw($player_who_launched_the_dogma); // Draw a card with age consistent with player board\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::stInterDogmaEffect');\n self::trace('interDogmaEffect->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n }\n \n // The active player may have changed during the dogma. Reset it on the player whose turn was\n $this->gamestate->changeActivePlayer($launcher_id);\n \n // Reset player table\n self::resetPlayerTable();\n \n // [R] Disable the flags used when in dogma \n self::setGameStateValue('dogma_card_id', -1);\n self::setGameStateValue('current_effect_type', -1);\n self::setGameStateValue('current_effect_number', -1);\n self::setGameStateValue('sharing_bonus', -1);\n self::setGameStateValue('current_player_under_dogma_effect', -1);\n self::setGameStateValue('step', -1);\n self::setGameStateValue('step_max', -1);\n self::setGameStateValue('special_type_of_choice', -1);\n self::setGameStateValue('choice', -1);\n self::setGameStateValue('splay_direction', -1);\n self::setGameStateValue('n_min', -1);\n self::setGameStateValue('n_max', -1);\n self::setGameStateValue('solid_constraint', -1);\n self::setGameStateValue('owner_from', -1);\n self::setGameStateValue('location_from', -1);\n self::setGameStateValue('owner_to', -1);\n self::setGameStateValue('location_to', -1);\n self::setGameStateValue('bottom_to', -1);\n self::setGameStateValue('age_min', -1);\n self::setGameStateValue('age_max', -1);\n self::setGameStateValue('color_array', -1);\n self::setGameStateValue('with_icon', -1);\n self::setGameStateValue('without_icon', -1);\n self::setGameStateValue('not_id', -1);\n self::setGameStateValue('can_pass', -1);\n self::setGameStateValue('n', -1);\n self::setGameStateValue('id_last_selected', -1);\n self::setGameStateValue('age_last_selected', -1);\n self::setGameStateValue('color_last_selected', -1);\n self::setGameStateValue('score_keyword', -1);\n self::setGameStateValue('auxiliary_value', -1);\n for($i=1; $i<=9; $i++) {\n self::setGameStateInitialValue('nested_id_'.$i, -1);\n self::setGameStateInitialValue('nested_current_effect_number_'.$i, -1);\n }\n \n // End of this player action\n self::trace('interDogmaEffect->interPlayerTurn');\n $this->gamestate->nextState('interPlayerTurn');\n return;\n }\n \n // There is another (non-demand) effect to perform\n self::setGameStateValue('current_effect_type', 1);\n self::setGameStateValue('current_effect_number', $current_effect_number);\n \n // Jump to this effect\n self::trace('interDogmaEffect->dogmaEffect');\n $this->gamestate->nextState('dogmaEffect');\n }"
] | [
"0.6034177",
"0.5703318",
"0.5430372",
"0.53918564",
"0.53503305",
"0.5343876",
"0.5309884",
"0.5247773",
"0.5238688",
"0.52343744",
"0.5212914",
"0.5143583",
"0.51361203",
"0.51241255",
"0.51205343",
"0.5099951",
"0.50934225",
"0.5068831",
"0.5036999",
"0.5025582",
"0.4993948",
"0.49910533",
"0.4975206",
"0.49638972",
"0.49455392",
"0.4932589",
"0.490455",
"0.48837578",
"0.4877106",
"0.48360327"
] | 0.649531 | 0 |
Detaches the Battleeffect from the Battle "Override" by specialness classes by using these commands: | public function detachFromBattle($battle) {
$battle->detachEventHandler("onAfterRound", array($this, 'reactToOnAfterRound'));
if($this->blocks) {
$battle->detachEventHandler("onBeforeAction", array($this, 'reactToOnBeforeAction'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _deactivate() {}",
"public function stop() {\n if($this->combatantA->hp > 0) {\n $this->winnerType = \"player\";\n $this->winnerID = $this->combatantAID;\n } elseif ($this->combatantB->hp > 0) {\n $this->winnerType = ($this->type == \"pvp\" ? \"player\" : \"monster\");\n $this->winnerID = $this->combatantBID;\n } else {\n $this->winnerType = \"draw\";\n }\n\n // Bounty + XP\n if($this->type == \"monster\" && $this->combatantB->hp <= 0) {\n $loot = $this->combatantB->dropItems($this->combatantA->getDropItemPerc());\n $this->combatantA->gainItems($loot);\n \n $contact = $this->combatantB->dropContact($this->combatantA->getDropContactPerc());\n $this->combatantA->gainContact($contact, \"battle\");\n\n /**\n * monster->xp can be defined to deviate from the standard\n * attack / 2 xp reward\n */\n if(isset($this->combatantB->xp)) {\n $this->combatantA->gainXp($this->combatantB->xp, \"battle\");\n } else {\n $this->combatantA->gainXp($this->combatantB->attack / 4, \"battle\");\n }\n }\n\n $this->combatantA->ongoingBattleID = null;\n if($this->type == \"pvp\") {\n // @todo Message to PVP enemy\n $this->combatantB->ongoingBattleID = null;\n }\n\n $this->state = \"resolved\";\n $this->objectState = \"\";\n\n /**\n * ToDo: why does backupbehavior think that no attribute changed\n * if we set ongoingBattleID to null?\n */\n // $this->combatantA->save();\n $this->combatantA->update();\n if($this->type == \"pvp\") {\n $this->combatantB->save();\n }\n\n $this->update();\n $this->reconstructCombatants();\n \n // Notify the world about this result\n $event = new BattleEvent($this);\n $this->combatantA->onFinishedBattle($event);\n if($this->type == \"pvp\") {\n $this->combatantB->onFinishedBattle($event);\n }\n }",
"public function __sleep() {\n if($this->type == \"pvp\") {\n $this->combatantA = null;\n $this->combatantB = null;\n } else {\n $this->combatantA = null;\n }\n \n /**\n * This is ugly, but you can't remove items from a CList while cycling \n * through the list with foreach. The iterator's $_i for the current \n * position is not updated. Apparently, this is how it should be. Weird.\n */\n $toDelete = array();\n foreach($this->battleeffects as $battleeffect) {\n if(!$battleeffect->active) {\n $toDelete[] = $battleeffect;\n }\n }\n foreach($toDelete as $deletee) {\n $deletee->detachFromBattle($this);\n $this->battleeffects->remove($deletee);\n }\n \n return parent::__sleep();\n }",
"public function unequip()\n {\n $this->equipped = 0;\n $this->Update();\n self::Log('unequpped', $this->char_id);\n }",
"public function takeDamage()\n\t\t{\n\t\t\tif ($this->_illness)\n\t\t\t{\n\t\t\t\t$this->_health -= $this->_damage; \n\t\t\t}\n\t\t}",
"abstract public function deactivate();",
"public function removeBehavior($name) {\n\t\t$this->Behaviors->unload($name);\n\t}",
"function unextend() {\n if ($this->observation) {\n $this->observation->cancel();\n $this->observation = NULL;\n }\n }",
"function fuzzloc_unload() {\n\n\tunregister_hook('post_local', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_post_hook');\n\tunregister_hook('feature_settings', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings');\n\tunregister_hook('feature_settings_post', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings_post');\n\n\n\tlogger(\"removed fuzzloc\");\n}",
"static function vimm_accessibility_deactivate() {\n\n\t}",
"protected function uninstallCustom(): void\n {\n }",
"function deactivation_hook() {\n\n\t}",
"protected function uninstallCustom() : void\n {\n }",
"public function unSetInheritance(){\n\t\t$pdo = Env::getDbConnectionForShare();\n\t\t$this->delete($pdo);\n\t\tself::updateInheritancesCache();\n\t}",
"protected function deactivateSelf() {}",
"function tear_down() {\n\t\tglobal $current_screen;\n\t\tparent::tear_down();\n\t\t$current_screen = $this->current_screen;\n\t}",
"public function detachAllEventHandlers($effect) {\n $eventNames = array(\"onBeforeAction\", \"onAfterAction\", \"onBeforeDealDamage\", \"onAfterDealtDamage\");\n foreach($eventNames as $eventName) {\n $this->detachEventHandler($eventName, array($effect, \"reactTo\" . ucfirst($eventName)));\n $this->detachEventHandler($eventName, array($effect->asa(\"special\"), \"reactTo\" . ucfirst($eventName)));\n }\n }",
"abstract public function Drop();",
"public function reactToOnAfterDealtDamage($event) { }",
"protected abstract function do_down();",
"public function tear_down() {\n\t\tremove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );\n\t\tparent::tear_down();\n\t}",
"public function remove_hooks()\n {\n }",
"public function remove_hooks()\n {\n }",
"public function clearBehaviors()\n\t{\n\t\tif($this->_m!==null)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $name=>$behavior)\n\t\t\t\t$this->detachBehavior($name);\n\t\t\t$this->_m=null;\n\t\t}\n\t}",
"public function unsetSpecialEquipPref($index)\n {\n unset($this->specialEquipPref[$index]);\n }",
"public function execute_deactivation_hooks() {\r\n }",
"public function unbind($interface, $targetClass = null);",
"public function powerDown()\n {\n if ($this->motor_power)\n $this->motor_power->setValue(0);\n }",
"public function hookDisable(): void\n {\n $this->say(\"Executing the Plugin's disable hook...\");\n $this->_exec(\"php ./src/hook_disable.php\");\n }",
"public function suspendBehavior($className, $temporary_config = null) {\n\t\tforeach ($this->model->behaviors() as $key => $behav) {\n\t\t\tif ($behav['class'] == $className) {\n\t\t\t\t$this->suspendedBehaviors[$className] = $behav;\n\t\t\t\t$this->model->detachBehavior($key);\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.53706574",
"0.5362536",
"0.52852505",
"0.5224216",
"0.5178185",
"0.5167428",
"0.51049465",
"0.50802654",
"0.50493205",
"0.5048803",
"0.5039382",
"0.50392824",
"0.50332105",
"0.5024569",
"0.50047076",
"0.49797508",
"0.4979701",
"0.49771777",
"0.49736163",
"0.49208584",
"0.48858598",
"0.48809662",
"0.48809662",
"0.48804203",
"0.48755467",
"0.48620853",
"0.48530442",
"0.4852439",
"0.48489487",
"0.48377225"
] | 0.606289 | 0 |
Checks if a battle action is blocked by this Battleeffect If buff: Block enemy's actions; if debuff: block hero's actions "Override" and extend by SpecialnessBehavior classes as necessary | public function reactToOnBeforeAction($event) {
if($this->blocks &&
$this->active &&
!$event->action->blocked &&
$event->action->battlePhase == "offense" &&
($this->buff == ($event->sender->getCombatantString($event->hero) == $this->enemyString))) {
if($this->blockChance != 1) {
$rand = mt_rand(0,100);
if($rand > $this->blockChance * 100) {
return;
}
}
if($event->action->call("setBlocked")) {
$this->charges --;
$battleMsg = new Battlemessage($this->call("getMsgBlock"));
$event->sender->log($event->hero, $battleMsg);
if($this->charges == 0) {
$this->active = false;
$battleMsg = new Battlemessage($this->msgExpire);
$event->sender->log($event->hero, $battleMsg);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function attack()\n {\n $this->tempAttackerStats = $this->attacker->stats;\n $this->tempDefenderStats = $this->defender->stats;\n\n // 1. Before hit check, apply all luck modifying skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills, \n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_LUCK && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 2. Check if attack is evaded\n $luck = $this->tempDefenderStats[Character::STAT_LUCK];\n if ($luck != 0 && $this->chance($luck)) {\n return $this->status = self::STATUS_MISSED;\n }\n\n // 3. Apply stat modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_ATTACKER,\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat != Character::STAT_LUCK\n && $skill->stat != Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n array($this, 'applySkill'),\n Skill::TARGET_DEFENDER,\n );\n\n // 4. Calculate the damage\n $strength = $this->tempAttackerStats[Character::STAT_STRENGTH];\n $defence = $this->tempDefenderStats[Character::STAT_DEFENCE];\n\n $this->damage = max(0, $strength - $defence);\n\n // 5. Apply damage modifier skills\n $skills = array_filter($this->attacker->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_ATTACK;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_ATTACKER, $this->damage);\n }\n );\n\n $skills = array_filter($this->defender->character->skills, function (Skill $skill) {\n return $skill->stat == Character::STAT_DAMAGE\n && $skill->type == Skill::TYPE_DEFENCE;\n });\n array_walk(\n $skills,\n function (Skill $skill, $key) {\n $this->applyDamageSkill($skill, Skill::TARGET_DEFENDER, $this->damage);\n }\n );\n\n // 6. Apply the final damage\n $this->defender->stats[Character::STAT_HEALTH] =\n max(0, $this->defender->stats[Character::STAT_HEALTH] - $this->damage);\n\n $this->status = self::STATUS_COMPLETED;\n }",
"public function is_blocked_to(Character $character)\n {\n return false;\n }",
"public function stop() {\n if($this->combatantA->hp > 0) {\n $this->winnerType = \"player\";\n $this->winnerID = $this->combatantAID;\n } elseif ($this->combatantB->hp > 0) {\n $this->winnerType = ($this->type == \"pvp\" ? \"player\" : \"monster\");\n $this->winnerID = $this->combatantBID;\n } else {\n $this->winnerType = \"draw\";\n }\n\n // Bounty + XP\n if($this->type == \"monster\" && $this->combatantB->hp <= 0) {\n $loot = $this->combatantB->dropItems($this->combatantA->getDropItemPerc());\n $this->combatantA->gainItems($loot);\n \n $contact = $this->combatantB->dropContact($this->combatantA->getDropContactPerc());\n $this->combatantA->gainContact($contact, \"battle\");\n\n /**\n * monster->xp can be defined to deviate from the standard\n * attack / 2 xp reward\n */\n if(isset($this->combatantB->xp)) {\n $this->combatantA->gainXp($this->combatantB->xp, \"battle\");\n } else {\n $this->combatantA->gainXp($this->combatantB->attack / 4, \"battle\");\n }\n }\n\n $this->combatantA->ongoingBattleID = null;\n if($this->type == \"pvp\") {\n // @todo Message to PVP enemy\n $this->combatantB->ongoingBattleID = null;\n }\n\n $this->state = \"resolved\";\n $this->objectState = \"\";\n\n /**\n * ToDo: why does backupbehavior think that no attribute changed\n * if we set ongoingBattleID to null?\n */\n // $this->combatantA->save();\n $this->combatantA->update();\n if($this->type == \"pvp\") {\n $this->combatantB->save();\n }\n\n $this->update();\n $this->reconstructCombatants();\n \n // Notify the world about this result\n $event = new BattleEvent($this);\n $this->combatantA->onFinishedBattle($event);\n if($this->type == \"pvp\") {\n $this->combatantB->onFinishedBattle($event);\n }\n }",
"public function attack($mob_obj){\t\t\r\n\t\t// Disable champion from other things while attacking\r\n\t\t$this->addEffect('Disable', Array('duration' => $this->attackSpeed()));\r\n\t\treturn $mob_obj->receiveDamage($this->base_attack_damage + ((1 - $this->level) * $this->attack_damage_per_level), 'armor', $this->stats());\t\r\n\t\t\t\r\n\t}",
"function receiveAttack($enemy_id, $attackType, $combatStyle) {\n\t\t//combat styles marked with + are implemented against humans\n\t\t$enemy = new Obj($this->mysqli, $enemy_id);\n\t\t$enemy->getBasicData();\n\t\t$enemy->getName();\n\t\t$atype = new AnimalType($this->mysqli, $enemy->secondary);\n\t\t$result_str = \"\";\n\t\t$mybody = new Obj($this->mysqli, $this->bodyId);\n\t\t$mybody->getBasicData();\n\t\t\n\t\t$combat = $this->checkCurrentCombat();\n\t\t\n\t\t$bodypart = \"bung\";\n\t\t$weapon = \"weapon\";\n\t\t\n\t\t$attack_types1 = array(\n\t\t\t1 => \"bites #VICTIM in the $bodypart\",\n\t\t\t2 => \"claws at #VICTIM''s $bodypart\",\n\t\t\t3 => \"kicks #VICTIM in the $bodypart\",\n\t\t\t4 => \"tramples #VICTIM\",\n\t\t\t5 => \"headbutts #VICTIM in the $bodypart\",\n\t\t\t6 => \"gores #VICTIM in the $bodypart with its horn\",\n\t\t\t7 => \"tears at #VICTIM''s $bodypart with its teeth\",\n\t\t\t8 => \"strangles #VICTIM\",\n\t\t\t9 => \"punches #VICTIM in the $bodypart\",\n\t\t\t10 => \"hits #VICTIM in the $bodypart with $weapon\",\n\t\t\t11 => \"throws $weapon at #VICTIM''s $bodypart\",\n\t\t\t12 => \"pecks at #VICTIM''s $bodypart\"\n\t\t);\n\t\t\n\t\t$attack_types2 = array(\n\t\t\t1 => \"bite #VICTIM\",\n\t\t\t2 => \"claw at #VICTIM\",\n\t\t\t3 => \"kick #VICTIM\",\n\t\t\t4 => \"trample #VICTIM\",\n\t\t\t5 => \"headbutt #VICTIM\",\n\t\t\t6 => \"gore #VICTIM with its horn\",\n\t\t\t7 => \"tear at #VICTIM with its teeth\",\n\t\t\t8 => \"strangle #VICTIM\",\n\t\t\t9 => \"punch #VICTIM\",\n\t\t\t10 => \"hit #VICTIM with $weapon\",\n\t\t\t11 => \"throw $weapon at #VICTIM\",\n\t\t\t12 => \"peck at #VICTIM\"\n\t\t);\n\t\t\n\t\t$info = $this->bodyPartTargeter(100, 1, $combatStyle);//later on falter will depend on skills\n\t\tif (!$info) {\n\t\t\t$result_str = \"The \" . $enemy->name . \" tries to \" . $attack_types2[$attackType] . \" but misses.\";\n\t\t\t$this->recordCombatEvent($combat, $result_str, $enemy->uid, $this->bodyId, 2);\n\t\t\treturn 200;\n\t\t}//Enemy missed\n\t\t//to do: what if it's not an animal?\n\t\t$severing = $atype->getAttribute(56);\n\t\t$piercing = $atype->getAttribute(57);\n\t\t$crushing = $atype->getAttribute(58);\n\t\t$broken = 0;\n\t\t$efficiency = rand(50,125);\n\t\tif ($efficiency==125&&rand(0,99)==99) $efficiency = 150;\n\t\tif ($severing>0&&($attackType==2||$attackType==7)) {\n\t\t\t$severing = round($severing*$efficiency/100);\n\t\t\t$bleed_type = 1;\n\t\t\t$bleed_level = round($severing/30);\n\t\t\t$bodypart = $info[0][\"name\"];\n\t\t\tif (bbetween($info[0][\"sever\"], 0, $severing)) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", severing it from the rest of #VICTIM''s body.\";\n\t\t\t\t$depth = 9;\n\t\t\t\tif ($bleed_level<3) $bleed_level = 3;\n\t\t\t\tif ($info[0][\"id\"]<4) $info[1] = true;//instakill\n\t\t\t\tif (ibetween($info[0][\"id\"], 18, 27)) $info[2] = $true;//crippled\n\t\t\t\t$broken = 2;\n\t\t\t}\n\t\t\telse if (($info[0][\"sever\"]*0.90)<=$severing&&$info[0][\"sever\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \" so that it''s hanging by a shred.\";\n\t\t\t\t$depth = 8;\n\t\t\t\tif ($bleed_level<3) $bleed_level = 3;\n\t\t\t\tif (ibetween($info[0][\"id\"], 18, 27)) $info[2] = $true;//crippled\n\t\t\t\t$broken = 2;\n\t\t\t}\n\t\t\telse if (($info[0][\"sever\"]*0.55)<=$severing&&$info[0][\"sever\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", severing it halfway.\";\n\t\t\t\t$depth = 7;\n\t\t\t\tif ($bleed_level<3) $bleed_level = 3;\n\t\t\t\tif (ibetween($info[0][\"id\"], 18, 27)) $info[2] = $true;//crippled\n\t\t\t}\n\t\t\telse if (($info[0][\"sever\"]*0.40)<=$severing&&$info[0][\"sever\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", causing a deep gash\";\n\t\t\t\tif ($info[0][\"bone\"]<0&&$info[0][\"bone\"]*-1<=$severing) {\n\t\t\t\t\t$result_str .= \" and exposing bone.\";\n\t\t\t\t\t$depth = 5;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$result_str .= \".\";\n\t\t\t\t\t$depth = 4;\n\t\t\t\t}\n\t\t\t\tif ($bleed_level<2) $bleed_level = 2;\n\t\t\t}\n\t\t\telse if (($info[0][\"sever\"]*0.20)<=$severing&&$info[0][\"sever\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", causing a considerable gash\";\n\t\t\t\tif ($info[0][\"bone\"]<0&&$info[0][\"bone\"]*-1<=$severing) {\n\t\t\t\t\t$result_str .= \" and exposing bone.\";\n\t\t\t\t\t$depth = 5;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$result_str .= \", reaching into the muscle.\";\n\t\t\t\t\t$depth = 4;\n\t\t\t\t}\n\t\t\t\tif ($bleed_level<2) $bleed_level = 2;\n\t\t\t}\n\t\t\telse if (($info[0][\"sever\"]*0.10)<=$severing&&$info[0][\"sever\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", reaching into the subcutaneous fat layer.\";\n\t\t\t\t$depth = 3;\n\t\t\t}\n\t\t\telse if (($info[0][\"sever\"]*0.05)<=$severing&&$info[0][\"sever\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", causing a shallow wound.\";\n\t\t\t\t$depth = 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", barely scratching you.\";\n\t\t\t\t$depth = 1;\n\t\t\t}\n\t\t}\n\t\telse if ($crushing>0&&($attackType==3||$attackType==4||$attackType==5||$attackType==8||$attackType==9)) {\n\t\t\t$bodypart = $info[0][\"name\"];\n\t\t\t$crushing = round($crushing*$efficiency/100);\n\t\t\t$bleed_type = 2;\n\t\t\tif ($info[0][\"crush\"]<=$crushing&&$info[0][\"crush\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", totally shattering it.\";\n\t\t\t\t$depth = 8;\n\t\t\t\t$bleed_level = 6;\n\t\t\t\t$broken = 4;\n\t\t\t\t$bleed_type = 3;\n\t\t\t}\n\t\t\telse if (($info[0][\"crush\"]*0.75)<=$crushing&&$info[0][\"crush\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", breaking it badly.\";\n\t\t\t\t$depth = 7;\n\t\t\t\t$bleed_level = 5;\n\t\t\t\t$broken = 3;\n\t\t\t}\n\t\t\telse if (($info[0][\"crush\"]*0.50)<=$crushing&&$info[0][\"crush\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", causing a fracture.\";\n\t\t\t\t$depth = 7;\n\t\t\t\t$bleed_level = 5;\n\t\t\t\t$broken = 2;\n\t\t\t}\n\t\t\telse if (($info[0][\"crush\"]*0.40)<=$crushing&&$info[0][\"crush\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", causing serious internal bleeding.\";\n\t\t\t\t$depth = 5;\n\t\t\t\t$bleed_level = 4;\n\t\t\t}\n\t\t\telse if (($info[0][\"crush\"]*0.20)<=$crushing&&$info[0][\"crush\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", which will certainly cause a big bruise.\";\n\t\t\t\t$depth = 4;\n\t\t\t\t$bleed_level = 3;\n\t\t\t}\n\t\t\telse if (($info[0][\"crush\"]*0.10)<=$crushing&&$info[0][\"crush\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", which is going to leave a bruise.\";\n\t\t\t\t$depth = 3;\n\t\t\t\t$bleed_level = 2;\n\t\t\t}\n\t\t\telse if ($info[0][\"crush\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", which might cause a small bruise.\";\n\t\t\t\t$depth = 1;\n\t\t\t\t$bleed_level = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", which is likely to cause slight internal bleeding in the surrounding tissues.\";\n\t\t\t\t$depth = 2;\n\t\t\t\t$bleed_level = 2;\n\t\t\t}\n\t\t}\n\t\telse if ($piercing>0&&($attackType==1||$attackType==6||$attackType==12)) {\n\t\t\t$bodypart = $info[0][\"name\"];\n\t\t\t$piercing = round($piercing*$efficiency/100);\n\t\t\t$bleed_type = 1;\n\t\t\tif ($info[0][\"pierce\"]<=$piercing&&$info[0][\"pierce\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", which goes all the way through.\";\n\t\t\t\t$depth = 6;\n\t\t\t\t$bleed_level = 6;\n\t\t\t\tif ((strpos($info[0][\"name\"], 'artery') !== false)||(strpos($info[0][\"name\"], 'heart') !== false)) $bleed_level = 10;\n\t\t\t}\n\t\t\telse if (($info[0][\"pierce\"]*0.50)<=$piercing&&$info[0][\"pierce\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", which sinks about halfway through.\";\n\t\t\t\t$depth = 4;\n\t\t\t\t$bleed_level = 5;\n\t\t\t\tif (strpos($info[0][\"name\"], 'heart') !== false) $bleed_level = 9;\n\t\t\t}\n\t\t\telse if (($info[0][\"pierce\"]*0.40)<=$piercing&&$info[0][\"pierce\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \" causing a deep wound\";\n\t\t\t\tif ($info[0][\"bone\"]<0&&$info[0][\"bone\"]*-1<=$piercing) {\n\t\t\t\t\t$result_str .= \" and colliding with bone.\";\n\t\t\t\t\t$depth = 5;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$result_str .= \".\";\n\t\t\t\t\t$depth = 4;\n\t\t\t\t}\n\t\t\t\t$bleed_level = 4;\n\t\t\t\tif (strpos($info[0][\"name\"], 'heart') !== false) $bleed_level = 8;\n\t\t\t}\n\t\t\telse if (($info[0][\"pierce\"]*0.2)<=$piercing&&$info[0][\"pierce\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \", causing a considerable wound.\";\n\t\t\t\t$depth = 3;\n\t\t\t\t$bleed_level = 3;\n\t\t\t\tif (strpos($info[0][\"name\"], 'heart') !== false) $bleed_level = 7;\n\t\t\t}\n\t\t\telse if (($info[0][\"pierce\"]*0.1)<=$piercing&&$info[0][\"pierce\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \" but the damage is only superficial.\";\n\t\t\t\t$depth = 2;\n\t\t\t\t$bleed_level = 2;\n\t\t\t}\n\t\t\telse if ($info[0][\"pierce\"]>0) {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \" but it doesn't hurt that much.\";\n\t\t\t\t$depth = 1;\n\t\t\t\t$bleed_level = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \" not really causing any damage\";\n\t\t\t\t$depth = 0;\n\t\t\t}\n\t\t}\n\t\telse $result_str = \"The \" . $enemy->name . \" \" . $attack_types1[$attackType] . \" but surprisingly (or not?) it doesn't cause any damage. Maybe there''s something wrong with it?\";//this shouldn't actually be possible because it shouldn't allow picking weapons that aren't weapons\n\t\t\n\t\tif (isset($bleed_type)&&isset($bleed_level)&&isset($depth)) {\n\t\t\t$curTime = new Time($this->mysqli);\n\t\t\t$sql = \"INSERT INTO `wounds` (`objectFK`, `bodypart`, `depth`, `bleed_level`, `bleed_type`, `broken`, `datetime`, `minute`) VALUES ('$this->bodyId', '\" . $info[0][\"id\"] . \"', '$depth', '$bleed_level', '$bleed_type', '$broken', '\" . $curTime->dateTime . \"', '\" . $curTime->minute . \"')\";\n\t\t\t$this->mysqli->query($sql);\n\t\t\t$result = $this->mysqli->insert_id;\n\t\t\tif (!$result) {\n\t\t\t\t//para(\"Something went wrong and the wound couldn't be recorded.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($info[2]) {\n\t\t\t$result_str .= \"#VICTIM is crippled by the attack.\";\n\t\t\t$mybody->setAttribute(60, 1);\n\t\t\t$mybody->setAttribute(61, 1);//sprawled\n\t\t}\n\t\tif ($info[3]) {\n\t\t\t$result_str .= \"#VICTIM feels lightheaded.\";\n\t\t\t$mybody->setAttribute(59, 1);//concussion\n\t\t}\n\t\tif ($info[1]) $result_str .= \"#VICTIM passes out.\";\n\t\t\n\t\t\n\t\t\n\t\t$result_str = str_replace(\"bung\", $info[0][\"name\"], $result_str);\n\t\t\n\t\t$this->recordCombatEvent($combat, $result_str, $enemy->uid, $this->bodyId, 2);\n\t\t\n\t\treturn 100;\n\t}",
"public function apply_block_supports()\n {\n }",
"public function onUseItem(PlayerInteractEvent $event) {\n\t\tif (!$event->getPlayer()->canPlaceBreakBlocks()) {\n\t\t\t$event->setCancelled(true);\n\t\t}\n\t\tif ($event->getFace() === 0xff) {\n\t\t\treturn;\n\t\t}\n\t\t$b = $event->getBlock();\n\t\t$area = $event->getPlayer()->currentArea;\n\t\tif ($b->x < $area->centerX - $area->kickSize || $b->z < $area->centerZ - $area->kickSize ||\n\t\t\t\t$b->x > $area->centerX + $area->kickSize || $b->z > $area->centerZ + $area->kickSize) {\n\t\t\t$event->setCancelled(true);\n\t\t\t$event->getPlayer()->sendLocalizedMessage(\"PLACE_BLOCK_ERROR\", array(), TextFormat::RED);\t\t\n\t\t\treturn;\n\t\t}\n\t}",
"public function hasAttack(){\r\n return $this->_has(5);\r\n }",
"public function receiveAttack($attack)\n {\n\n if (isset($this->_protector) && $this->_protector->_shield > 0) {\n $attackUnderTheShield = $this->_protector->reduceShield($attack);\n\n if ($attackUnderTheShield < 0) {\n parent::receiveAttack(abs($attackUnderTheShield));\n }\n } else {\n parent::receiveAttack($attack);\n }\n }",
"public function hasAttack(){\r\n return $this->_has(8);\r\n }",
"public function isBlocked()\n {\n return $this->getStatus() == self::STATUS_BLOCKED;\n }",
"function battle($type,$adress) \n{\n global $player;\n global $smarty;\n global $enemy;\n global $arrehp;\n global $db;\n if ($player -> hp <= 0) \n {\n error (NO_LIFE);\n }\n $enemy1 = $db -> Execute(\"SELECT * FROM `monsters` WHERE `id`=\".$player -> fight);\n $span = ($enemy1 -> fields['level'] / $player -> level);\n if ($span > 2) \n {\n $span = 2;\n }\n $expgain = ceil(rand($enemy1 -> fields['exp1'],$enemy1 -> fields['exp2']) * $span);\n $goldgain = ceil(rand($enemy1 -> fields['credits1'],$enemy1 -> fields['credits2']) * $span);\n $enemy = array(\"strength\" => $enemy1 -> fields['strength'], \n \"agility\" => $enemy1 -> fields['agility'], \n \"speed\" => $enemy1 -> fields['speed'], \n \"endurance\" => $enemy1 -> fields['endurance'], \n \"hp\" => $enemy1 -> fields['hp'], \n \"name\" => $enemy1 -> fields['name'], \n \"id\" => $enemy1 -> fields['id'], \n \"exp1\" => $enemy1 -> fields['exp1'], \n \"exp2\" => $enemy1 -> fields['exp2'], \n \"level\" => $enemy1 -> fields['level'],\n\t\t \"lootnames\" => explode(\";\", $enemy1->fields['lootnames']),\n\t\t \"lootchances\" => explode(\";\", $enemy1->fields['lootchances']));\n if ($type == 'T') \n {\n if (!isset ($_POST['action'])) \n {\n turnfight ($expgain,$goldgain,'',$adress);\n } \n else \n {\n turnfight ($expgain,$goldgain,$_POST['action'],$adress);\n }\n } \n else \n {\n fightmonster ($enemy,$expgain,$goldgain,1);\n }\n $fight = $db -> Execute(\"SELECT `fight`, `hp` FROM `players` WHERE `id`=\".$player -> id);\n if ($fight -> fields['fight'] == 0) \n {\n if ($type == 'T')\n\t {\n\t $player->energy --;\n\t if ($player -> energy < 0) \n\t {\n\t\t$player -> energy = 0;\n\t }\n\t $db -> Execute(\"UPDATE `players` SET `energy`=\".$player->energy.\" WHERE `id`=\".$player->id);\n\t }\n if ($player -> location == 'Góry') \n {\n if ($fight -> fields['hp'] > 0)\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"explore.php?akcja=gory\\\">\".A_REFRESH.\"</a><br />\");\n }\n else\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"gory.php\\\">\".A_REFRESH.\"</a><br />\");\n }\n }\n if ($player -> location == 'Las') \n {\n if ($fight -> fields['hp'] > 0)\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"explore.php\\\">\".A_REFRESH.\"</a><br />\");\n }\n else\n {\n $smarty -> assign (\"Link\", \"<br /><br /><a href=\\\"las.php\\\">\".A_REFRESH.\"</a><br />\");\n }\n }\n }\n $fight -> Close();\n $enemy1 -> Close();\n}",
"public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }",
"protected function applyFinalEffects(\n PhabricatorLiskDAO $object,\n array $xactions) {\n // with a message to the effect of \"alincoln resolved blocking task Txxx.\"\n $unblock_xaction = null;\n foreach ($xactions as $xaction) {\n switch ($xaction->getTransactionType()) {\n case ManiphestTaskStatusTransaction::TRANSACTIONTYPE:\n $unblock_xaction = $xaction;\n break;\n }\n }\n\n if ($unblock_xaction !== null) {\n $blocked_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(\n $object->getPHID(),\n ManiphestTaskDependedOnByTaskEdgeType::EDGECONST);\n if ($blocked_phids) {\n // In theory we could apply these through policies, but that seems a\n // little bit surprising. For now, use the actor's vision.\n $blocked_tasks = id(new ManiphestTaskQuery())\n ->setViewer($this->getActor())\n ->withPHIDs($blocked_phids)\n ->needSubscriberPHIDs(true)\n ->needProjectPHIDs(true)\n ->execute();\n\n $old = $unblock_xaction->getOldValue();\n $new = $unblock_xaction->getNewValue();\n\n foreach ($blocked_tasks as $blocked_task) {\n $parent_xaction = id(new ManiphestTransaction())\n ->setTransactionType(\n ManiphestTaskUnblockTransaction::TRANSACTIONTYPE)\n ->setOldValue(array($object->getPHID() => $old))\n ->setNewValue(array($object->getPHID() => $new));\n\n if ($this->getIsNewObject()) {\n $parent_xaction->setMetadataValue('blocker.new', true);\n }\n\n id(new ManiphestTransactionEditor())\n ->setActor($this->getActor())\n ->setActingAsPHID($this->getActingAsPHID())\n ->setContentSource($this->getContentSource())\n ->setContinueOnNoEffect(true)\n ->setContinueOnMissingFields(true)\n ->applyTransactions($blocked_task, array($parent_xaction));\n }\n }\n }\n\n return $xactions;\n }",
"public function getIsBlock();",
"public function isBlocked()\n {\n if ($this->status == 2) {\n return true;\n } else {\n return false;\n }\n }",
"public function isBlocked() : bool {\n return $this->delivery_status === WebhookEvent::EVENT_BLOCKED;\n }",
"public function ban();",
"public function ban(User $mod, User $user) {\n return $mod->getLastStatus()->status == 'moderator' && \n $user->getLastStatus()->status != 'moderator' && \n $user->getLastStatus()->status != 'banned';\n }",
"public function block(User $user,User $target){\n if ($user->hasRole('superadmin') && !$target->hasRole('superadmin')){\n return true;\n }\n //admin only can block user\n else if($user->hasRole('admin') && $target->hasRole('user')){\n return true;\n }\n }",
"function ipban()\n\t{\n\t\tglobal $ilance, $ilcrumbs, $navcrumb, $phrase, $ilconfig, $ilpage, $show, $maintenancemessage, $login_include;\n\t\n\t\t($apihook = $ilance->api('ipban_constructor_start')) ? eval($apihook) : false;\n\t\n\t\t// #### IP BLOCKER #############################################\n\t\t$ipaddress = IPADDRESS;\n\t\tif ($this->ip_address_banned($ipaddress))\n\t\t{\n\t\t\tdie($phrase['_you_have_been_banned_from_the_marketplace']);\n\t\t}\n\t\t// #### MAINTENANCE MODE #######################################\n\t\tif ($ilconfig['maintenance_mode'] AND (empty($_SESSION['ilancedata']['user']['userid']) OR !empty($_SESSION['ilancedata']['user']['userid']) AND $_SESSION['ilancedata']['user']['isadmin'] == '0'))\n\t\t{\n\t\t\t// supress maintenance mode if we're viewing admin cp, logging into site or payment notifications are being called\n\t\t\tif (defined('LOCATION') AND (LOCATION == 'admin' OR LOCATION == 'login' OR LOCATION == 'ipn'))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (ip_address_excluded($ipaddress))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (strrchr($ilconfig['maintenance_excludeurls'], ', '))\n\t\t\t{\n\t\t\t\t$scripts = explode(', ', $ilconfig['maintenance_excludeurls']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$scripts = preg_split('#\\s+#', $ilconfig['maintenance_excludeurls'], -1, PREG_SPLIT_NO_EMPTY);\n\t\t\t}\n\t\t\tif (count($scripts) > 0)\n\t\t\t{\n\t\t\t\t$currentscript = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '';\n\t\t\t\tforeach ($scripts AS $script)\n\t\t\t\t{\n\t\t\t\t\tif (preg_match(\"/$script/i\", $currentscript))\n\t\t\t\t\t{\n\t\t\t\t\t\t// found a script that should be excluded while we're still in maintenance mode...\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$area_title = '{_maintenance_mode_temporarily_unavailable}';\n\t\t\t$page_title = '{_template_metatitle} | ' . SITE_NAME;\n\t\t\t$navcrumb = array (\"$ilpage[main]\" => '{_maintenance_mode_temporarily_unavailable}');\n\t\t\tprint_notice('{_maintenance_mode}', '{' . $ilconfig['maintenance_message'] . '}', HTTP_SERVER . $ilpage['main'], '{_main_menu}');\n\t\t\texit();\n\t\t}\n\t\t// #### PUBLIC OR PRIVATE FACING MARKETPLACE ###################\n\t\tif ($ilconfig['publicfacing'] == 0 AND (empty($_SESSION['ilancedata']['user']['userid']) OR $_SESSION['ilancedata']['user']['userid'] == 0) AND (empty($_SESSION['ilancedata']['user']['isadmin']) OR $_SESSION['ilancedata']['user']['isadmin'] == '0'))\n\t\t{\n\t\t\tif (defined('LOCATION') AND (LOCATION == 'admin' OR LOCATION == 'login' OR LOCATION == 'ipn' OR LOCATION == 'registration' OR LOCATION == 'ajax' OR LOCATION == 'attachment'))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (ip_address_excluded($ipaddress))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$area_title = SITE_NAME;\n\t\t\t$page_title = '{_template_metatitle} | ' . SITE_NAME;\n\t\t\t$navcrumb = array (\"$ilpage[main]\" => '{_private_marketplace}');\n\t\t\tprint_notice('{_private_marketplace}', \"{_please} <span class=\\\"blue\\\"><a href=\\\"\" . HTTPS_SERVER . $ilpage['login'] . \"\\\">{_sign_in}</a></span> {_or} <span class=\\\"blue\\\"><a href=\\\"\" . HTTPS_SERVER . $ilpage['registration'] . \"\\\">{_register}</a></span>. {_this_is_a_private_marketplace}.\", HTTPS_SERVER . $ilpage['login'], '{_sign_in}');\n\t\t\texit();\n\t\t}\n\t}",
"abstract public function getAttack();",
"public function hasIgnoredefense(){\r\n return $this->_has(31);\r\n }",
"public function hasIgnoredefense(){\r\n return $this->_has(34);\r\n }",
"public function hasFireAttack(){\r\n return $this->_has(20);\r\n }",
"function isBanned()\n {\n if ( $this->getVar( 'level' ) == 6 ) {\n return true;\n }\n return false;\n }",
"function attack($eunik,$bdamage) \n{\n global $smarty;\n global $player;\n global $db;\n global $zmeczenie;\n global $enemy;\n global $amount;\n $number1 = $_POST['monster'] - 1;\n $number = \"mon\".$number1;\n $gwtbr = 0;\n $gatak = 0;\n if (isset ($_SESSION['exhaust'])) \n {\n $zmeczenie = $_SESSION['exhaust'];\n }\n $arrEquip = $player -> equipment();\n if (!$arrEquip[0][0] && !$arrEquip[1][0]) \n {\n $smarty -> assign(\"Message\", NO_WEAPON);\n $smarty -> display('error1.tpl');\n }\n if ($arrEquip[0][0]) \n {\n if ($arrEquip[0][3] == 'D') \n {\n $arrEquip[0][2] = $arrEquip[0][2] + $arrEquip[0][8];\n }\n if ($player -> clas == 'Wojownik' || $player -> clas == 'Barbarzyńca') \n {\n $stat['damage'] = (($player -> strength + $arrEquip[0][2]) + $player -> level);\n } \n else \n {\n $stat['damage'] = ($player -> strength + $arrEquip[0][2]);\n }\n if ($player -> attack < 1) \n {\n $krytyk = 1;\n }\n if ($player -> attack > 5) \n {\n $kr = ceil($player -> attack / 100);\n $krytyk = (5 + $kr);\n } \n else \n {\n $krytyk = $player -> attack;\n }\n $name = \"bronią\";\n\t$strAtype = 'melee';\n }\n if ($arrEquip[11][0])\n {\n\t$stat['damage'] += (($arrEquip[11][2] + $player->strength) + $player->level);\n\t$name = \"obiema brońmi\";\n }\n if ($arrEquip[1][0]) \n {\n $bonus = $arrEquip[1][2] + $arrEquip[6][2];\n\tif ($arrEquip[6][3] == 'D')\n\t {\n\t $bonus += $arrEquip[6][8];\n\t }\n $bonus2 = (($player -> strength / 2) + ($player->agility / 2));\n if ($player -> clas == 'Wojownik' || $player -> clas == 'Barbarzyńca') \n {\n $stat['damage'] = (($bonus2 + $bonus) + $player -> level);\n } \n else \n {\n $stat['damage'] = ($bonus2 + $bonus);\n }\n if ($player -> shoot < 1) \n {\n $krytyk = 1;\n }\n if ($player -> shoot > 5) \n {\n $kr = ceil($player -> shoot / 100);\n $krytyk = (5 + $kr);\n } \n else \n {\n $krytyk = $player -> shoot;\n }\n if (!$arrEquip[6][0]) \n {\n $stat['damage'] = 0;\n }\n $name = \"strzałą\";\n\t$strAtype = 'ranged';\n }\n if (!isset($stat['damage']))\n {\n $stat['damage'] = 0;\n }\n if ($player -> clas == 'Rzemieślnik')\n {\n $stat['damage'] = $stat['damage'] - ($stat['damage'] / 4);\n }\n if ($bdamage == 2) \n {\n $stat['damage'] = $stat['damage'] * 2;\n }\n if ($bdamage == 1) \n {\n $stat['damage'] = $stat['damage'] + ($stat['damage'] / 2);\n $eunik = $eunik - ($eunik / 10);\n }\n if ($bdamage == 3) \n {\n $stat['damage'] = $stat['damage'] - ($stat['damage'] / 2);\n $eunik = $eunik + ($eunik / 10);\n }\n $rzut2 = (rand(1,($player -> level * 10)));\n $stat['damage'] = ($stat['damage'] + $rzut2);\n $stat['damage'] = ($stat['damage'] - $enemy['endurance']);\n if ($stat['damage'] < 1) \n {\n $stat['damage'] = 0;\n }\n if ($arrEquip[0][0] && $gwtbr > $arrEquip[0][6]) \n {\n\t$stat['damage'] = 0;\n\tif ($arrEquip[11][6] > $gwtbr)\n\t {\n\t $stat['damage'] += (($arrEquip[11][2] + $player->strength) + $player->level);\n\t }\n\t$krytyk = 1;\n }\n if ($arrEquip[11][0] && $gwtbr > $arrEquip[11][6]) \n {\n\t$stat['damage'] = 0;\n\tif ($arrEquip[0][6] > $gwtbr)\n\t {\n\t $stat['damage'] += (($arrEquip[0][2] + $player->strength) + $player->level);\n\t }\n\t$krytyk = 1;\n }\n if ($arrEquip[1][0] && ($gwtbr > $arrEquip[1][6] || $gwtbr > $arrEquip[6][6])) \n {\n $stat['damage'] = 0;\n $krytyk = 1;\n }\n if ($arrEquip[1][0] && !$arrEquip[6][0]) \n {\n $stat['damage'] = 0;\n $krytyk = 1;\n }\n $ehp = $_SESSION[$number];\n if ($ehp <= 0)\n {\n $smarty -> assign(\"Message\", ERROR);\n $smarty -> display('error1.tpl');\n $gwtbr = $gwtbr + 1;\n }\n if ($arrEquip[1][0]) \n {\n $eunik = $eunik * 2;\n }\n if ($ehp > 0 && $player -> hp > 0) \n {\n if ($arrEquip[0][0]) \n {\n $zmeczenie = $zmeczenie + $arrEquip[0][4];\n } \n\telseif ($arrEquip[1][0]) \n {\n $zmeczenie = $zmeczenie + $arrEquip[1][4];\n }\n\tif ($arrEquip[11][0])\n\t {\n\t $zmeczenie += $arrEquip[11][4];\n\t }\n $szansa = rand(1, 100);\n if ($eunik >= $szansa && $szansa < 97) \n {\n $smarty -> assign (\"Message\", \"<b>\".$enemy['name'].\"</b> \".ENEMY_DODGE.\"!<br />\");\n $smarty -> display ('error1.tpl');\n if ($arrEquip[1][0]) \n {\n $gwtbr = ($gwtbr + 1);\n }\n } \n\telseif ($zmeczenie <= $player -> cond) \n {\n if ($arrEquip[0][0] || $arrEquip[1][0] || $arrEquip[11][0]) \n\t {\n\t\t$gwtbr++;\n\t\t$rzut = rand(1, 1000) / 10;\n\t\t$intRoll = rand(1, 100);\n\t\t$arrLocations = array('w tułów', 'w głowę', 'w kończynę');\n\t\t$intHit = rand(0, 2);\n\t\tif ($krytyk >= $rzut && $intRoll <= $krytyk && $player->fight != 999) \n\t\t {\n\t\t $gatak++;\n\t\t $ehp = 0;\n\t\t $smarty->assign(\"Message\", showcritical($arrLocations[$intHit], $strAtype, 'pve', $enemy['name']));\n\t\t }\n\t\telse\n\t\t {\n\t\t $ehp -= $stat['damage'];\n\t\t $smarty -> assign (\"Message\", YOU_ATTACK1.\" \".$name.\" <b>\".$enemy['name'].\"</b> \".$arrLocations[$intHit].\" \".INFLICT.\" <b>\".$stat['damage'].\"</b> \".DAMAGE.\"! (\".$ehp.\" \".LEFT.\")</font><br />\");\n\t\t if ($stat['damage'] > 0) \n\t\t {\n\t\t\t$gatak = ($gatak + 1);\n\t\t }\n\t\t }\n\t\t$smarty -> display ('error1.tpl');\n\t }\n }\n }\n $_SESSION[$number] = $ehp;\n if ($arrEquip[0][0]) \n {\n gainability($player -> id, $player -> user, 0, $gatak, 0, $player -> mana, $player -> id, 'weapon');\n lostitem($gwtbr, $arrEquip[0][6], YOU_WEAPON, $player -> id, $arrEquip[0][0], $player -> id, HAS_BEEN1, $player->level);\n }\n if ($arrEquip[11][0])\n {\n\tif (!$arrEquip[0][0])\n\t {\n\t gainability($player -> id, $player -> user, 0, $gatak, 0, $player -> mana, $player -> id, 'weapon');\n\t }\n\tlostitem($gwtbr, $arrEquip[11][6], YOU_WEAPON, $player -> id, $arrEquip[11][0], $player -> id, HAS_BEEN1, $player->level);\n }\n if ($arrEquip[1][0]) \n {\n gainability($player -> id, $player -> user, 0, $gatak, 0, $player -> mana, $player -> id, 'bow');\n lostitem($gwtbr, $arrEquip[1][6], YOU_WEAPON, $player -> id, $arrEquip[1][0], $player -> id, HAS_BEEN1, $player->level);\n lostitem($gwtbr, $arrEquip[6][6], YOU_QUIVER, $player -> id, $arrEquip[6][0], $player -> id, HAS_BEEN1, $player->level);\n }\n $_SESSION['exhaust'] = $zmeczenie;\n}",
"private function applyInfect($time, &$action_message, $skill_effect, $monster) {\n\t\tif(!empty($this->monsters[$monster['id']]['Monster']['debuffs']['infected'])) {\n\t\t\t$this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'] += rand($skill_effect['amount_min'], $skill_effect['amount_max']);\n\t\t\t$this->addActionMessage($action_message, 'debuff_gained', $this->monsters[$monster['id']]['Monster']['name'].' is Infected('.$this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'].').');\n\t\t}else{\n\t\t\t$this->monsters[$monster['id']]['Monster']['debuffs']['infected'] = [\n\t\t\t\t'stacks' => rand($skill_effect['amount_min'], $skill_effect['amount_max'])\n\t\t\t];\n\t\t\tif($this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'] == 1) {\n\t\t\t\t$this->addActionMessage($action_message, 'debuff_gained', $this->monsters[$monster['id']]['Monster']['name'].' is Infected.');\n\t\t\t}else{\n\t\t\t\t$this->addActionMessage($action_message, 'debuff_gained', $this->monsters[$monster['id']]['Monster']['name'].' is Infected('.$this->monsters[$monster['id']]['Monster']['debuffs']['infected']['stacks'].').');\n\t\t\t}\n\t\t}\n\t}",
"public function attack(Character $target) {\n $rand = rand(1, 100);\n if ($rand < 10 ) {\n $status = $this->potion(); // On regénère la vie !\n }\n else if ($rand > 10 && $rand < 25) {\n $status = $this->diablotin($target); // diablotin\n }\n else if ($rand > 25 && $rand < 37) {\n $status = $this->siphonAme($target); // Siphon d'Ames\n }\n else if ($rand > 37 && $rand < 65) {\n $status = $this->drainVie($target); // Drain de vie\n }\n else if ($rand > 65 && $rand < 85) {\n $status = $this->gangreFeu($target); // GangreFeu\n }\n else{\n $status = $this->coupBaguette($target); // Attaque à la baguette !\n }\n return $status;\n }",
"public function hasFireAttack(){\r\n return $this->_has(17);\r\n }"
] | [
"0.5783276",
"0.5361477",
"0.5286241",
"0.5276812",
"0.51689386",
"0.5086634",
"0.5077476",
"0.50732356",
"0.50585276",
"0.50259596",
"0.50109994",
"0.50036454",
"0.49991325",
"0.4981347",
"0.4973806",
"0.4952765",
"0.493337",
"0.49172273",
"0.49167368",
"0.4907985",
"0.48989463",
"0.48972565",
"0.4896613",
"0.48811448",
"0.48789582",
"0.48750672",
"0.48591542",
"0.48296154",
"0.4818889",
"0.48026785"
] | 0.58765244 | 0 |
Get the cas general. | public function getCasGeneral() {
return $this->casGeneral;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetGeneral(){\r\r\n\t\treturn self::$general;\r\r\n\t}",
"public function setCasGeneral($casGeneral) {\n $this->casGeneral = $casGeneral;\n return $this;\n }",
"public function getCasKonec()\n {\n return $this->cas_konec;\n }",
"public function getProdGeneral()\n {\n return $this->prod_general;\n }",
"public function casos()\n\t{\n\t\treturn $this->hasOne('App\\Caso');\n\t}",
"public function getGiroComercial()\n {\n return $this->giroComercial;\n }",
"public function getGeneralInformation() {\n\t\tif (!$this->hasDetails) {\n\t\t\t$this->injectDetails();\n\t\t}\n\t\treturn $this->generalInformation;\n\t}",
"public function get_comercial(){\n\t\t\treturn $this->comercial;\n\t\t}",
"public static function getGeneralConfig(){\n\t\tif(CoreConfig::$config == null){\n\t\t\tCoreConfig::getConfig();\n\t\t\tCoreConfig::$config['Core']['url'] = CoreConfig::getUrl();\n\t\t\tCoreConfig::$config['Core']['localUrl'] = CoreConfig::getLocalUrl();\n\t\t}\n\t\tif(!empty(CoreConfig::$config['Core'])) {\n\n\t\t\treturn CoreConfig::$config['Core'];\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}",
"public function getEstadoCaso(){\r\n\t\t\treturn $this->estadoCaso;\r\n\t\t}",
"public function getCLSa() {\n\t\treturn $this->clsa;\n\t}",
"public function getCertificationSociale() {\n return $this->certificationSociale;\n }",
"public static function getUser() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::getUser();\t\t\n\t}",
"public function getCardanoSpecific()\n {\n return $this->cardano_specific;\n }",
"function getClinicalServices() {\n return array(self::MEDONC => self::MEDONC);\n }",
"private function cas_init()\n {\n session_name((isset($this->config[ 'session_name' ]) ? $this->config[ 'session_name' ] : 'CASAuth'));\n // initialize CAS client\n $this->configureCasClient();\n $this->configureSslValidation();\n $this->detect_authentication();\n\n // set service URL for authorization with CAS server\n //\\phpCAS::setFixedServiceURL();\n if ( ! empty($this->config[ 'cas_service' ])) {\n phpCAS::allowProxyChain(new \\CAS_ProxyChain_Any);\n }\n // set login and logout URLs of the CAS server\n phpCAS::setServerLoginURL($this->config[ 'cas_login_url' ]);\n phpCAS::setServerLogoutURL($this->config[ 'cas_logout_url' ]);\n }",
"function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Estudiantegeneral',$k,$v); }",
"public function getMontantGeneral() {\n return $this->montantGeneral;\n }",
"public function getSectoreconomicoAccion()\n\t{\n\t\treturn $this->sectoreconomicoAccion;\n\t}",
"function getContact()\n\t{\n\t\treturn $this->Info['Contact'];\n\t}",
"public function getBasicDocumentInfo()\n {\n return $this->get(self::BASICDOCUMENTINFO);\n }",
"function get_rad_general($conn, $header_id) {\n\t$query_general = \"SELECT * FROM rad_general WHERE header_id = \" . $header_id;\n\t$gen = exec_query($conn, $query_general);\n\tif (count($gen) > 0) {\n\t\treturn $gen[0];\n\t} else {\n\t\treturn NULL;\n\t}\n}",
"public function getSac()\n {\n return $this->sac;\n }",
"public function getCategoriaPrincipal(){\n return $this->categoriaPrincipal;\n }",
"public function getCasMsg()\n {\n return $this->casErrorCode;\n }",
"public function getClient()\n {\n $options = array(\n 'hostname' => 'login.unl.edu',\n 'port' => 443,\n 'uri' => 'cas'\n );\n \n $protocol = new \\SimpleCAS_Protocol_Version2($options);\n\n /**\n * We need to customize the request to use CURL because \n * php5.4 and ubuntu systems can't verify ssl connections \n * without specifying a CApath. CURL does this automatically\n * based on the system, but openssl does not.\n * \n * It looks like this will be fixed in php 5.6\n * https://wiki.php.net/rfc/tls-peer-verification\n */\n $request = new \\HTTP_Request2();\n $request->setConfig('adapter', 'HTTP_Request2_Adapter_Curl');\n $protocol->setRequest($request);\n\n return \\SimpleCAS::client($protocol);\n }",
"function get_clase_vista()\n {\n switch ($this->accion) {\n case 'index': \n case 'mostrar_clases': \n case 'filtrar': return 'vista_materias';\n case 'planilla': return 'vista_planilla';\n case 'resumen': return 'vista_resumen';\n case 'generar_pdf': return 'vista_planilla';\n default: return 'vista_edicion_asistencias';\n }\n }",
"public function checkCitatbCasos()\n {\n $sql = \"SELECT cs.id_cita FROM citas c INNER JOIN casos cs ON c.id = cs.id_cita INNER JOIN detalle_solicitud d ON c.id_detalle = d.id_detalle WHERE d.id_detalle = ?\";\n $params = array($this->id_detalle);\n return Database::getRow($sql, $params);\n }",
"public function getSectoreconomicofecha()\n\t{\n\t\treturn $this->sectoreconomicofecha;\n\t}",
"public function GetGeneralType() {\n\t\tif (in_array($this->GetType(),array(PROFILE_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_SUMMERCAMP, \n\t\t\t\t\t\t\t\t\t\t\tPROFILE_VOLUNTEER_PROJECT, \n\t\t\t\t\t\t\t\t\t\t\tPROFILE_SEASONALJOBS, \n\t\t\t\t\t\t\t\t\t\t\tPROFILE_TEACHING))) {\n\t\t\treturn PROFILE_COMPANY;\n\t\t}\n\t\tif (in_array($this->GetType(),array(PROFILE_PLACEMENT,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_VOLUNTEER,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_TOUR,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_JOB))) {\r\n\t\t\treturn PROFILE_PLACEMENT;\r\n\t\t}\r\n\t\t\n\t}"
] | [
"0.633392",
"0.6318595",
"0.5409211",
"0.52573943",
"0.5230733",
"0.5213706",
"0.5152318",
"0.50966704",
"0.503519",
"0.5013966",
"0.4983723",
"0.49139723",
"0.49107486",
"0.49010175",
"0.48332527",
"0.48034492",
"0.4790462",
"0.4786852",
"0.47512",
"0.4750631",
"0.473891",
"0.47030815",
"0.47005838",
"0.4692318",
"0.46861342",
"0.4682534",
"0.4664267",
"0.46488628",
"0.46447587",
"0.46417183"
] | 0.8459706 | 0 |
Get the cas particulier. | public function getCasParticulier() {
return $this->casParticulier;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCasGeneral() {\n return $this->casGeneral;\n }",
"public function getCompte()\n {\n return $this->compte;\n }",
"public function getCouleur()\n {\n return $this->couleur;\n }",
"public function getCasKonec()\n {\n return $this->cas_konec;\n }",
"public function getRefNafSousClasse()\n {\n return $this->refnafsousclasse;\n }",
"public function casos()\n\t{\n\t\treturn $this->hasOne('App\\Caso');\n\t}",
"public function getCesta()\n {\n return $this->cesta;\n }",
"public function getCesta()\n {\n return $this->cesta;\n }",
"public function getCartouche()\n {\n return $this->hasOne(Cartouche::className(), ['diffuseur_id' => 'id']);\n }",
"public function cercaReferti() {\r\n $fReferto = USingleton::getInstance(\"FReferto\");\r\n return $fReferto->cercaRefertiClinica($this->getPartitaIVAClinica());\r\n }",
"public function getCadence(){\n return $this->cadence;\n }",
"public function getCareer();",
"public function getCorVeiculo()\n {\n return $this->corVeiculo;\n }",
"public function getCriado()\n {\n return $this->criado;\n }",
"public function getCriado()\n {\n return $this->criado;\n }",
"public function getCedente() {\n return $this->oCedente;\n }",
"public function getCarrito()\n {\n return $this->carrito;\n }",
"public function getCoForense()\n\t{\n\t\treturn $this->co_forense;\n\t}",
"public function getSocietetierce()\n {\n return $this->societetierce;\n }",
"public function get_comercial(){\n\t\t\treturn $this->comercial;\n\t\t}",
"public function getIdClase()\n {\n return $this->idClase;\n }",
"public function getCoParticipante()\n\t{\n\t\treturn $this->co_participante;\n\t}",
"public function getCoInformeForense()\n\t{\n\t\treturn $this->co_informe_forense;\n\t}",
"public function getCasStart()\n {\n return $this->cas_start;\n }",
"public function curso()\r\r\n\t{\r\r\n\t\treturn $this->has_one('Curso');\r\r\n\t}",
"public function getCalle()\n {\n return $this->calle;\n }",
"public function getSectoreconomicofecha()\n\t{\n\t\treturn $this->sectoreconomicofecha;\n\t}",
"public function get_course()\n {\n return $this->get_foreign_property(self::FOREIGN_PROPERTY_COURSE, Course::class_name());\n }",
"public static function getCompteur() {\n return self::$_compteur;\n }",
"public function getCarrera() {\n return $this->carrera;\n }"
] | [
"0.6405096",
"0.59782565",
"0.5962028",
"0.5926583",
"0.5914043",
"0.5906814",
"0.58201253",
"0.58201253",
"0.57620597",
"0.5753108",
"0.5727857",
"0.57263404",
"0.57148445",
"0.5708429",
"0.5708429",
"0.5687175",
"0.56838506",
"0.5646992",
"0.56384844",
"0.56322414",
"0.5566346",
"0.55652314",
"0.55516374",
"0.55510575",
"0.55479455",
"0.55475235",
"0.5536446",
"0.55323297",
"0.5530773",
"0.5528645"
] | 0.7487219 | 0 |
Get the categorie sal. | public function getCategorieSal() {
return $this->categorieSal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCategoria()\n {\n return $this->categoria;\n }",
"public function getCategoria()\n {\n return $this->categoria;\n }",
"public function getCategoria()\n {\n return $this->categoria;\n }",
"public function get_categorie(){\n\t\treturn $this->search_categorie;\n\t}",
"public function getCategorie()\n {\n return $this->categorie;\n }",
"function getCodigoCategoria()\n {\n return $this->CodigoCategoria;\n }",
"public function get_categoria() {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"SELECT * FROM tm_categoria WHERE est=1\";\n $sql=$conectar->prepare($sql);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n\n }",
"public function getCategoria()\n {\n return \"Cliente com Risco\";\n }",
"public function getCategory() {}",
"function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }",
"public function getCategoria()\n {\n return \"Cliente com alta credibilidade\";\n }",
"public function getCategoria() {\n $query = $this->db->get('tb_categoria');\n //Retorna em formato de array\n return $query->result();\n }",
"public function getCategory();",
"public function getCategory();",
"public function get_tipo_cat()\n { \n \n \n $this->db->select(\"distinct(cve_tipo_categoria), nom_tipo_cat\");\n\n $this->db->order_by('nom_tipo_cat','asc');\n $query = $this->db->get('ccategoria');\n \n $data_cat=0;\n $data_cat = array();\n foreach ($query->result_array() as $row)\n {\n \n $data_cat[$row['cve_tipo_categoria']] = $row['nom_tipo_cat']; \n }\n $query->free_result();\n\n return $data_cat; \n\n }",
"public function getCodeStatutCateg() {\n return $this->codeStatutCateg;\n }",
"public function getCategory(): string;",
"public function getCategory()\n {\n }",
"public function getIdCategoria()\n {\n return $this->id_categoria;\n }",
"public function getIdCategoria()\n {\n return $this->id_categoria;\n }",
"public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }",
"public function getIdcategoria()\n {\n return $this->idcategoria;\n }",
"public function cargarcategoria()\n {\n \treturn Cont_Categoria::whereRaw(\" jerarquia ~ '*{1}' \")\n \t\t\t\t\t\t\t->orderBy('jerarquia', 'asc')\n \t\t\t\t\t\t\t->get();\n \t;\t\n }",
"public function getCategorias(){\n\t\t$sql = \"SELECT * FROM tipo_producto ORDER BY nombre_tipo_prod\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}",
"public function getSouscategorie()\n {\n $oSouscategorie = CSouscategorie::getById($this->souscategorie_id);\n return $oSouscategorie;\n }",
"public function get_kategori()\n\t{\n\t\t$hasil = $this->db->get(\"kategori\")->result();\n\t\treturn $hasil;\n\t}",
"public function getCategoria_id()\n {\n return $this->categoria_id;\n }",
"public function getIdKategoria() {\n return $this->idKategoria;\n }",
"public function getCategoria()\n {\n return \"Cliente padrão\";\n }",
"public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}"
] | [
"0.7529514",
"0.75197506",
"0.75197506",
"0.7384365",
"0.73526245",
"0.7218605",
"0.7062545",
"0.7048052",
"0.701572",
"0.69436413",
"0.69364935",
"0.6917824",
"0.6910216",
"0.6910216",
"0.6868139",
"0.6855592",
"0.6791043",
"0.67451745",
"0.6710636",
"0.6710636",
"0.67004937",
"0.67003727",
"0.66978",
"0.66734296",
"0.66601014",
"0.66388243",
"0.6637561",
"0.6611961",
"0.66104746",
"0.657907"
] | 0.83384925 | 0 |
Get the code etablissement. | public function getCodeEtablissement() {
return $this->codeEtablissement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCode()\n {\n return $this->__get(\"code\");\n }",
"public function get_code() {\n\t\treturn $this->code;\n\t}",
"function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->getValueObject('code');\n }",
"public function getcode()\n {\n return $this->code;\n }",
"function getCode()\r\n {\r\n return $this->code;\r\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }"
] | [
"0.77920943",
"0.77684504",
"0.77357835",
"0.7726078",
"0.7698331",
"0.769732",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686",
"0.7676686"
] | 0.7969973 | 1 |
Get the date debut paternite. | public function getDateDebutPaternite() {
return $this->dateDebutPaternite;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDateDebut();",
"public function getDateDebut() {\n\t\t\t$d = DateTime::createFromFormat(\"Y-m-d\", $this->attributs['dateDebut']);\n\t\t\tif ($d == false)\n\t\t\t\tdie(\"date de début '\".$this->attributs['dateDebut'].\"' non valide pour être une date\");\n\t\t\treturn $d;\n\t\t}",
"function getDay()\r\n {\r\n return $this->dia;\r\n }",
"public function getDatePattern() {\r\n\t\treturn $this->datePattern;\r\n\t}",
"public function getDate($date=null){\n\t\treturn date_format($this->createDate($date),\"d\");\n\t}",
"public function getFechaModificacionPD( ){\n\t\t \treturn $this->fechaModificacionPD;\n\t\t }",
"function getdatepattern($date) {\n if (preg_match('/\\d{2}\\/\\d{2}\\/\\d{4}/',$date)){\n $dtpattern = \"'%m/%d/%Y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{1,2}\\/\\d{4}/',$date)) {\n $dtpattern = \"'%m/%e/%Y \";\n }\n elseif (preg_match('/\\d{1,2}\\/\\d{1,2}\\/\\d{4}/',$date)) {\n $dtpattern = \"'%c/%e/%Y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{2}\\/\\d{2}/',$date)){\n $dtpattern = \"'%m/%d/%y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{1,2}\\/\\d{2}/',$date)) {\n $dtpattern = \"'%m/%e/%y \";\n }\n elseif (preg_match('/\\d{1,2}\\/\\d{1,2}\\/\\d{2}/',$date)) {\n $dtpattern = \"'%c/%e/%y \";\n }\n \n return $dtpattern;\n }",
"public function getDoDate()\n {\n return $this->data['fields']['do_date'];\n }",
"public function get_date_permastruct()\n {\n }",
"public function getDate();",
"public function getDate();",
"function primer_dia_periodo() {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n \n }",
"public function getDATE_DEPOT()\n {\n return $this->DATE_DEPOT;\n }",
"function obtener_dia($fecha) {\r\nreturn(substr($fecha,8,2));\r\n}",
"public function get_taplicacion_procesos_fecha_desde(): string {\n return $this->taplicacion_procesos_fecha_desde;\n }",
"public function findSaneparDate(){\n $data = $this->sanepar->findSaneparDate();\n foreach($data as $dt){\n $data[$dt] = substr($dt,0,4) . '/' . substr($dt,4,5);\n }\n return $data;\n }",
"public static function getDateFormat()\n {\n return self::$settings[0];\n }",
"function dateFR($date){\n $date = explode(\"/\", $date);\n return $date[2].\"/\".$date[1].\"/\".$date[0];\n}",
"private function get_date_page() {\n\t\tif ( ! $this->is_template_supported( 'is_date' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn add_query_arg( 'year', gmdate( 'Y' ), home_url( '/' ) );\n\t}",
"function helper_dateFormat($date)\n {\n $separator= strpos($date, \"/\");\n if($separator === false){\n $date=explode(\"-\", trim($date));\n $date= $date[2].\"/\".$date[1].\"/\".$date[0];\n }else{\n $date=explode(\"/\", trim($date));\n $date= $date[2].\"-\".$date[1].\"-\".$date[0];\n }\n return $date;\n \n }",
"public function getDay()\n {\n return $this->_getDateValue('d');\n }",
"public function getModDate();",
"public function getDay(): string\n {\n return $this->toLocalizedString('d');\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 }",
"public function getFechaCreacionPD( ){\n\t\t \treturn $this->fechaCreacionPD;\n\t\t }",
"private function dateDuJour(){\n return date(\"Y-m-d\");\n }",
"public function fecha();",
"public function getDateDebut(): ?DateTime {\n return $this->dateDebut;\n }",
"public function getDateDebut(): ?DateTime {\n return $this->dateDebut;\n }",
"public function get_search_date($date){\n\t\t$expl_date = explode('/', $date);\n\t\treturn $expl_date[2].'-'.$expl_date[1];\n\t}"
] | [
"0.7539114",
"0.7094053",
"0.66743064",
"0.65799296",
"0.65707743",
"0.6541628",
"0.6504244",
"0.64483064",
"0.63986385",
"0.63628274",
"0.63628274",
"0.6350492",
"0.63423914",
"0.6299575",
"0.62929595",
"0.62209624",
"0.61026835",
"0.6098385",
"0.6092148",
"0.6084089",
"0.60789144",
"0.60723335",
"0.6059239",
"0.60386586",
"0.60360575",
"0.6028314",
"0.601206",
"0.6006414",
"0.6006414",
"0.600122"
] | 0.7957948 | 0 |
Get the date naissance employe. | public function getDateNaissanceEmploye() {
return $this->dateNaissanceEmploye;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDateNaissanceEnfant() {\n return $this->dateNaissanceEnfant;\n }",
"public function getDateNaissance()\n {\n return $this->date_naissance;\n }",
"public function getDateEmprunt()\n {\n return $this->dateEmprunt;\n }",
"public function getDateNaissance() \n {\n return $this->dateNaissance;\n }",
"public function getDatenaissance()\n {\n return $this->date_naissance;\n }",
"public function getDateNaiss()\n {\n return $this->dateNaiss;\n }",
"public function getDateNaiss() {\n return $this->dateNaiss;\n }",
"public function getDate_naissance_user()\r\n {\r\n return $this->date_naissance_user;\r\n }",
"public function getDateEn() {\n return $this->date;\n }",
"public function getDateEcheance(): ?string {\n return $this->dateEcheance;\n }",
"public function getDateSeance() {\r\n return $this->dateSeance;\r\n }",
"public function getDateDebut();",
"public function getDataEmissao()\n {\n if ($this->data_emissao) {\n return $this->data_emissao->format('d/m/Y');\n }\n return null;\n }",
"public function getDateEcriture(): DateTime\n {\n return $this->date_ecriture;\n }",
"public function getEdad()\n {\n $dateOfBirth = $this->getFechaNac();\n $today = date(\"Y-m-d\");\n $diff = date_diff(date_create($dateOfBirth), date_create($today));\n return (int)$diff->format('%y');\n\n }",
"function getDay()\r\n {\r\n return $this->dia;\r\n }",
"public function getDATE_DEPOT()\n {\n return $this->DATE_DEPOT;\n }",
"public function getReportedDate();",
"public function getDateEntree() {\n return $this->dateEntree;\n }",
"function datum_nu() {\n\t\t//\n\t\t$datestring \t\t\t\t= \"%d-%m-%Y\" ; \n\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\n\t\treturn date($datestring, $time);\n\t\t//-----/\n\t}",
"public function getQuestionnaireDate() {\r\n\t\t\treturn $this->_arrQuestionnaireDate;\r\n\t\t}",
"public function setDateNaissanceEmploye(DateTime $dateNaissanceEmploye = null) {\n $this->dateNaissanceEmploye = $dateNaissanceEmploye;\n return $this;\n }",
"public function getFechaNacimiento() {\n\t\treturn $this->fechaNacimiento;\n\t}",
"public function getDate() {\n return ($this->date1_reduced === $this->date2_reduced) ? $this->date1_reduced: $this->date1_reduced . \"- \" . $this->date2_reduced;\n }",
"public function getDateFinContrat() {\n return $this->dateFinContrat;\n }",
"public function getFechaVencimientoEstudianteDocumento( ){\n\t\t\treturn $this->fechaVencimientoEstudianteDocumento;\n\t\t}",
"public function getDate_en_ligne()\n {\n return $this->date_en_ligne;\n }",
"public function getNacAttribute()\n {\n return date(\"d/m/Y\", strtotime($this->fecha_nacimiento));\n }",
"public function getExpdate()\n {\n return $this->expdate;\n }",
"public function getFechaNacimiento()\n {\n return $this->fecha_nacimiento;\n }"
] | [
"0.7243417",
"0.7177636",
"0.7153885",
"0.71016335",
"0.70923674",
"0.6991168",
"0.68874466",
"0.66628057",
"0.6595865",
"0.64287716",
"0.6417571",
"0.6311442",
"0.62785",
"0.62435293",
"0.62262625",
"0.6182001",
"0.61490434",
"0.61438185",
"0.6134532",
"0.61174935",
"0.61091214",
"0.61038446",
"0.6102607",
"0.60927474",
"0.60864854",
"0.60788065",
"0.6074673",
"0.60661846",
"0.60298336",
"0.60293394"
] | 0.853909 | 0 |
Get the date naissance enfant. | public function getDateNaissanceEnfant() {
return $this->dateNaissanceEnfant;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDateNaiss()\n {\n return $this->dateNaiss;\n }",
"public function getDateNaissance()\n {\n return $this->date_naissance;\n }",
"public function getDateNaissanceEmploye() {\n return $this->dateNaissanceEmploye;\n }",
"public function getDatenaissance()\n {\n return $this->date_naissance;\n }",
"public function getDateNaiss() {\n return $this->dateNaiss;\n }",
"public function getDateNaissance() \n {\n return $this->dateNaissance;\n }",
"public function getDateEn() {\n return $this->date;\n }",
"public function getDate_en_ligne()\n {\n return $this->date_en_ligne;\n }",
"public function getDateDebut();",
"function datum_nu() {\n\t\t//\n\t\t$datestring \t\t\t\t= \"%d-%m-%Y\" ; \n\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\n\t\treturn date($datestring, $time);\n\t\t//-----/\n\t}",
"public function getDate_naissance_user()\r\n {\r\n return $this->date_naissance_user;\r\n }",
"public function getfechaentrega()\r\n {\r\n return $this->fechaentrega;\r\n }",
"public function getDateEmbauche() \n {\n return $this->dateEmbauche;\n }",
"public function getDateEmbauche() {\n return $this->dateEmbauche;\n }",
"public function getDateDebut() {\n\t\t\t$d = DateTime::createFromFormat(\"Y-m-d\", $this->attributs['dateDebut']);\n\t\t\tif ($d == false)\n\t\t\t\tdie(\"date de début '\".$this->attributs['dateDebut'].\"' non valide pour être une date\");\n\t\t\treturn $d;\n\t\t}",
"public function getFechaNacimiento() {\n\t\treturn $this->fechaNacimiento;\n\t}",
"private function dateDuJour(){\n return date(\"Y-m-d\");\n }",
"private function date()\n {\n $pubDate = $this->article->Journal->JournalIssue->PubDate;\n \n if (isset($pubDate->MedlineDate)) {\n $date = (string)$pubDate->MedlineDate;\n } else {\n $date = implode(' ', (array)$pubDate);\n }\n \n return $date;\n }",
"public function getNacAttribute()\n {\n return date(\"d/m/Y\", strtotime($this->fecha_nacimiento));\n }",
"public function fechaVigencia() // funcion que suma fecha usada para años biciestos\n\t{\n\n\t\t$fecha = $_GET['fecha'];\n\t\t$nuevafecha = strtotime('+365 day', strtotime($fecha));\n\t\t$nuevafecha = date('Y-m-d', $nuevafecha);\n\t\treturn $nuevafecha;\n\t}",
"function getFecha(){\n\t\t$anio = date(\"Y\");\n\t\t$dia = date(\"j\");\n\t\t$mes = date(\"m\");\n\t\t$fechactual = $anio.\"-\".$mes.\"-\".$dia;\n\t\treturn $fechactual;\n\t}",
"function datum_nu2() {\n //\n\t\t\t$datestring \t\t\t\t= \"%Y-%m-%d\" ; \n\t\t\t$time \t\t\t\t\t\t= time();\t\t\t\n\t\t\treturn mdate($datestring, $time);\n\t}",
"protected function getJour()\n{\nreturn substr($this->getDateSysteme(), 8, 2);\t\n}",
"public function getDateEcheance(): ?string {\n return $this->dateEcheance;\n }",
"public function getDateEmprunt()\n {\n return $this->dateEmprunt;\n }",
"public function getIngAttribute()\n {\n return date(\"d/m/Y\", strtotime($this->fecha_ingreso));\n }",
"function fecha($cadena){\n\t\treturn date($cadena);\n\t}",
"public function getFechaNacimiento()\n {\n return $this->fecha_nacimiento;\n }",
"function getDateJour()\n {\n return $this->formatDateDBversLocal(date('Y-m-d'));\n }",
"public function getFechaConversionEnergetica(){\n return $this->fechaConversionEnergetica;\n }"
] | [
"0.7512473",
"0.75080717",
"0.7395183",
"0.73594064",
"0.7337562",
"0.7324058",
"0.72760427",
"0.7159078",
"0.7054945",
"0.7036829",
"0.68552494",
"0.68008226",
"0.67763877",
"0.6747776",
"0.6722611",
"0.6709568",
"0.6709434",
"0.66936415",
"0.6635982",
"0.66233915",
"0.6611846",
"0.66107994",
"0.6606663",
"0.65976995",
"0.65703166",
"0.6553753",
"0.65381247",
"0.65177333",
"0.6496446",
"0.64838743"
] | 0.8442179 | 0 |
Get the dern j. | public function getDernJ() {
return $this->dernJ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getJour()\n{\nreturn substr($this->getDateSysteme(), 8, 2);\t\n}",
"public function getJadwalDdtk()\n {\n return $this->jadwal_ddtk;\n }",
"public function getDateDernJMens() {\n return $this->dateDernJMens;\n }",
"function JD($year, $month, $day)\n {\n // ref: J. Meeus, Astronomical Algorithms\n $y = $year; $m = $month; $d = $day;\n if ($m <= 2) {\n $y = $y - 1;\n $m = $m + 12;\n }\n $a = floor($y/100);\n $b = 2 - $a + floor($a/4);\n $JD = floor(365.25*($y+4716)) + floor(30.6001*($m+1)) + $d + $b - 1524.5;\n return $JD;\n }",
"function getJulianDate()\r\n {\r\n return Data_Calc::dataJuliana($this->dia, $this->mes, $this->ano);\r\n }",
"function get_jt($j){\n\t\t$type = \"Private Job\";\n\t\tswitch($j){\n\t\t\tcase \"BJ\": $type = \"Bus Jobs\"; break;\n\t\t\tcase \"VM\": $type = \"Vehicle Maintain\"; break;\n\t\t\tcase \"M\": $type = \"Institute Maintainance\"; break;\n\t\t\tcase \"TRG\": $type = \"Training (Full Time)\"; break;\n\t\t\tcase \"PRG\": $type = \"Training (Part Time)\"; break;\n\t\t\tcase \"PR\": $type = \"Production\"; break;\n\t\t\tcase \"STC\": $type = \"Special Training Course\"; break;\n\t\t\tcase \"VTI\": $type = \"Borella Institute\"; break;\n\t\t\tcase \"DP\": $type = \"Director Bunglow\"; break;\n\t\t}\n\t\treturn $type;\n\t}",
"function getDateJour()\n {\n return $this->formatDateDBversLocal(date('Y-m-d'));\n }",
"public function getFrmCode($j)\n {\n // elseif ($j == 2) $kode_frm = 'FRM-09b' ;\n // elseif ($j == 3) $kode_frm = 'FRM-10' ;\n // elseif ($j == 4) $kode_frm = 'FRM-11' ;\n // elseif ($j == 5) $kode_frm = 'FRM-12' ;\n // elseif ($j == 6) $kode_frm = 'FRM-13' ;\n // elseif ($j == 7) $kode_frm = 'FRM-14' ;\n // elseif ($j == 8) $kode_frm = 'FRM-15' ;\n // elseif ($j == 9) $kode_frm = 'FRM-16' ;\n // elseif ($j == 10) $kode_frm = 'FRM-17' ;\n // return $kode_frm;\n echo \"2\";\n }",
"public function getJambanDifabel()\n {\n return $this->jamban_difabel;\n }",
"function getJname()\n {\n return 'phpbb31';\n }",
"public function getD()\n {\n return $this->D;\n }",
"public function getNummer() {\n\t\treturn $this->nummer;\n\t}",
"public function getJadwalKesehatan()\n {\n return $this->jadwal_kesehatan;\n }",
"private function j() {\n }",
"function getDateJhjjmmtt() {\n\t\n\t$date \t= getdate();\n\t$year \t= $date['year'];\n\t$mon \t= $date['mon'];\n $day\t\t= $date['mday'];\n \n\tif( $mon < \"10\" ) \t\t$mon = \"0\".$mon;\n\tif( $day < \"10\" )\t\t$day = \"0\".$day;\n\t\n\t$moddate \t= $year.$mon.$day;\n\n\treturn $moddate;\n}",
"public function getD() {}",
"public function getLede(): string\n {\n return $this->lede;\n }",
"public function getACerminJambanP()\n {\n return $this->a_cermin_jamban_p;\n }",
"public function getActualJadwal()\n {\n return $this->actualJadwal;\n }",
"private function getTijd($datum_tijd) {\n date_default_timezone_set('Europe/London');\n $tijd = date('H:i', strtotime($datum_tijd));\n return $tijd;\n }",
"function islamic_to_jd($mo,$da,$yr) {\n\t\treturn ( $da + ceil(29.5*($mo-1)) + ($yr-1)*354 +\n\t\t\tfloor((3+(11*$yr))/30)+ ISLAMIC_EPOCH - 1);\n\t}",
"public function getTipeJamban()\n {\n return $this->tipe_jamban;\n }",
"public function getThnDibangun()\n {\n return $this->thn_dibangun;\n }",
"function getDay()\r\n {\r\n return $this->dia;\r\n }",
"public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }",
"static function hijriToJulian($month, $day, $year) {\n return ($day + ceil(29.5 * ($month - 1)) + ($year - 1) * 354 + floor((3 + (11 * $year)) / 30) + HIJRI_EPOCH) - 1;\n }",
"public function getPanjRengM()\n {\n return $this->panj_reng_m;\n }",
"public function getMerk() \t\t\t{\treturn $this->merk;\t}",
"private function getDatum($datum_tijd) {\n date_default_timezone_set('Europe/London');\n setlocale(LC_ALL, 'nl_NL');\n $datum = strftime('%e %B %Y', strtotime($datum_tijd));\n return $datum;\n }",
"public function getPanjang()\n {\n return $this->panjang;\n }"
] | [
"0.69270754",
"0.62822056",
"0.6098791",
"0.60705477",
"0.60369456",
"0.5831282",
"0.5827111",
"0.5782242",
"0.5692093",
"0.5647546",
"0.5601024",
"0.55979085",
"0.5578962",
"0.55594116",
"0.5530348",
"0.55302525",
"0.54943615",
"0.54936814",
"0.5488831",
"0.5473183",
"0.545897",
"0.5455072",
"0.5429395",
"0.5420839",
"0.5414503",
"0.54127693",
"0.54025006",
"0.54023886",
"0.537946",
"0.5370689"
] | 0.8037811 | 0 |
Get the dispense travail. | public function getDispenseTravail() {
return $this->dispenseTravail;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTravailTemp() {\n return $this->travailTemp;\n }",
"public function setDispenseTravail($dispenseTravail) {\n $this->dispenseTravail = $dispenseTravail;\n return $this;\n }",
"public function getCodeMedecineTravail() {\n return $this->codeMedecineTravail;\n }",
"public function getEtabLieuTravail() {\n return $this->etabLieuTravail;\n }",
"public function getSiretLieuTrav() {\n return $this->siretLieuTrav;\n }",
"public function getIdLieuTravail() {\n return $this->idLieuTravail;\n }",
"public function showTrails()\n {\n return $this->load->model('Trail')->fetchTrails();\n }",
"public function getCodeUniteTempsTravail() {\n return $this->codeUniteTempsTravail;\n }",
"public function getTravelSector()\n {\n return $this->travelSector;\n }",
"public function getTravelSector()\n {\n return $this->travelSector;\n }",
"public function getCodeTravail(): ?string {\n return $this->codeTravail;\n }",
"public function getTelevision()\n {\n return $this->television;\n }",
"public function getOfficeT()\n {\n return $this->office_t;\n }",
"public function getTicket()\n {\n return $this->ticket;\n }",
"public function getTicket()\n {\n return $this->ticket;\n }",
"public function getTrip()\n {\n return isset($this->trip) ? $this->trip : null;\n }",
"public function getCustpo()\n {\n return $this->custpo;\n }",
"public function getCollisimoLaPoste()\n\t{\n\t\treturn $this->em->getRepository(\"VPMTransporteurBundle:Transporteur\")->findOneByNom(\"Colissimo La Poste\");\n\t}",
"public function getPriceTransport()\n {\n return isset($this->priceTransport) ? $this->priceTransport : null;\n }",
"public function getCofficeT()\n {\n return $this->coffice_t;\n }",
"public function getFreeTier()\n {\n return $this->free_tier;\n }",
"public function getTravailEffectif(): ?float {\n return $this->travailEffectif;\n }",
"public function getTreinen()\n {\n return $this->treinen;\n }",
"public function getExercice()\n {\n return $this->ligne->getSousCategorie()->getCategorie()->getBudget()->getExercice();\n }",
"public function getVenta()\r\n {\r\n return $this->_venta;\r\n }",
"public function getToiletCount()\n {\n return $this->toiletCount;\n }",
"public function getTitolareClinica() {\r\n return $this->_titolareClinica;\r\n }",
"public function getRaisonSocLieuTrav() {\n return $this->raisonSocLieuTrav;\n }",
"public function getTierItem()\n {\n return $this->getItem()->getTierItem();\n }",
"public function getBureauDistributeurLieuTrav() {\n return $this->bureauDistributeurLieuTrav;\n }"
] | [
"0.6525956",
"0.6442547",
"0.62703556",
"0.6174497",
"0.58505577",
"0.58198637",
"0.5750352",
"0.5749795",
"0.5731538",
"0.5731538",
"0.56425065",
"0.5496034",
"0.5486302",
"0.54676",
"0.54676",
"0.54338205",
"0.5422359",
"0.54079294",
"0.53944284",
"0.5391913",
"0.5383659",
"0.53506935",
"0.5347605",
"0.5308743",
"0.52864057",
"0.5255359",
"0.5254164",
"0.52524084",
"0.5247088",
"0.5240371"
] | 0.8750044 | 0 |
Get the etbl adresse1. | public function getEtblAdresse1() {
return $this->etblAdresse1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEtblAdresse2() {\n return $this->etblAdresse2;\n }",
"public function getEtblAdresse2() {\n return $this->etblAdresse2;\n }",
"public function getAddress1()\n {\n return $this->fv_address1;\n }",
"public function getEmpAdresse1() {\n return $this->empAdresse1;\n }",
"public function getAddress1()\r\n {\r\n return $this->_address1;\r\n }",
"public function getEtblAdresse3() {\n return $this->etblAdresse3;\n }",
"public function getAddress1()\n {\n return $this->address1;\n }",
"public function getAddress1()\n {\n return $this->address1;\n }",
"public function getAddress1()\n {\n return parent::getValue('address1');\n }",
"public function getAddressLine1(): ?string;",
"public function get_address_1( $context = 'view' ) {\n\t\treturn $this->get_prop( 'address_1', $context );\n\t}",
"public function getStreetAddress1()\n {\n return $this->street_address_1;\n }",
"public function setEtblAdresse1($etblAdresse1) {\n $this->etblAdresse1 = $etblAdresse1;\n return $this;\n }",
"public function setEtblAdresse1($etblAdresse1) {\n $this->etblAdresse1 = $etblAdresse1;\n return $this;\n }",
"public function getAddress1()\n {\n return $this->getValue('nb_icontact_prospect_address_1');\n }",
"public function getAddressLine2(): ?string;",
"public function getEmpAdresse2() {\n return $this->empAdresse2;\n }",
"public function getAddr()\n {\n return $this->get(self::_ADDR);\n }",
"public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }",
"public function get_adresse();",
"public function getReqAddress1()\n\t{\n\t\treturn $this->req_address1;\n\t}",
"public function getAddr()\n {\n return $this->addr->getAddr();\n }",
"public function getAddress2()\n {\n return parent::getValue('address2');\n }",
"public function getOrganizationAddress1() :string {\n\t\treturn($this->organizationAddress1);\n\t}",
"private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}",
"public function getAddress2()\n {\n\n return $this->fv_address2;\n }",
"public function getAddress();",
"public function getAddress();",
"public function getAddressLine3(): ?string;",
"public function getAddr() : string\n {\n return $this->addr;\n }"
] | [
"0.73686236",
"0.73686236",
"0.71714777",
"0.7094793",
"0.7007656",
"0.6930471",
"0.6909322",
"0.6909322",
"0.6900906",
"0.67263323",
"0.66795975",
"0.6645541",
"0.66182274",
"0.66182274",
"0.65734017",
"0.6533087",
"0.6385606",
"0.63059896",
"0.62818587",
"0.6278872",
"0.6270116",
"0.6261021",
"0.6236516",
"0.6213414",
"0.61958396",
"0.6194757",
"0.61917305",
"0.61917305",
"0.6191272",
"0.6190516"
] | 0.80821997 | 1 |
Get the etbl adresse2. | public function getEtblAdresse2() {
return $this->etblAdresse2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAddress2()\n {\n\n return $this->fv_address2;\n }",
"public function getAddress2()\n\t{\n\t\treturn $this->address2;\n\t}",
"public function getEtblAdresse1() {\n return $this->etblAdresse1;\n }",
"public function getEtblAdresse1() {\n return $this->etblAdresse1;\n }",
"public function getAddress2()\r\n {\r\n return $this->_address2;\r\n }",
"public function getAddress2()\n {\n return $this->address2;\n }",
"public function getAddress2()\n {\n return $this->address2;\n }",
"public function getAddress2()\n {\n return $this->address2;\n }",
"public function getEmpAdresse2() {\n return $this->empAdresse2;\n }",
"public function getAddress2()\n {\n return parent::getValue('address2');\n }",
"public function get_address_2( $context = 'view' ) {\n\t\treturn $this->get_prop( 'address_2', $context );\n\t}",
"public function getStreetAddress2()\n {\n return $this->street_address_2;\n }",
"public function getEtblAdresse3() {\n return $this->etblAdresse3;\n }",
"public function getAddress2()\n {\n return $this->getValue('nb_icontact_prospect_address_2');\n }",
"public function getAddressLine2(): ?string;",
"public function setEtblAdresse2($etblAdresse2) {\n $this->etblAdresse2 = $etblAdresse2;\n return $this;\n }",
"public function setEtblAdresse2($etblAdresse2) {\n $this->etblAdresse2 = $etblAdresse2;\n return $this;\n }",
"public function getAddress2()\n {\n return $this->getParameter('billingAddress2');\n }",
"public function getPayerAddressStreet2() {\n\t\treturn $this->_getField(self::$PAYER_ADDRESS_STREET_2);\n\t}",
"public function getShippingAddress2()\n {\n return $this->getParameter('shippingAddress2');\n }",
"function &street2( )\n {\n return $this->Street2;\n }",
"public function getShipaddress2()\n {\n return $this->shipaddress2;\n }",
"public function getReqAddress2()\n\t{\n\t\treturn $this->req_address2;\n\t}",
"public function getEmpAdresse1() {\n return $this->empAdresse1;\n }",
"public function getBillingAddress2()\n {\n return $this->getParameter('billingAddress2');\n }",
"public function getStreet2(): ?string\n {\n return $this->_street2;\n }",
"public function getOrganizationAddress2() :?string {\n\t\treturn($this->organizationAddress2);\n\t}",
"public function getAddressLine1(): ?string;",
"public function getApplicantAddressTwo()\n {\n return $this->getProperty('applicant_address_two');\n }",
"public function getBilladdress2()\n {\n return $this->billaddress2;\n }"
] | [
"0.7431549",
"0.73629504",
"0.7295891",
"0.7295891",
"0.723625",
"0.71854764",
"0.71854764",
"0.71854764",
"0.71709996",
"0.7154719",
"0.71006495",
"0.70446587",
"0.69195265",
"0.68635994",
"0.68282074",
"0.6732893",
"0.6732893",
"0.6698613",
"0.655096",
"0.6514884",
"0.6429976",
"0.64118576",
"0.63699687",
"0.63074523",
"0.6231387",
"0.62224895",
"0.6202252",
"0.6186835",
"0.6181583",
"0.6131031"
] | 0.82021344 | 1 |
Get the etbl adresse3. | public function getEtblAdresse3() {
return $this->etblAdresse3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAddressLine3(): ?string;",
"public function getEtblAdresse2() {\n return $this->etblAdresse2;\n }",
"public function getEtblAdresse2() {\n return $this->etblAdresse2;\n }",
"public function setEtblAdresse3($etblAdresse3) {\n $this->etblAdresse3 = $etblAdresse3;\n return $this;\n }",
"public function getEtblAdresse1() {\n return $this->etblAdresse1;\n }",
"public function getEtblAdresse1() {\n return $this->etblAdresse1;\n }",
"public function getAddr()\n {\n return $this->get(self::_ADDR);\n }",
"public function getaddress(){\n $address = $this->_run('getaddress');\n return $address;\n }",
"public function getAddressLine2(): ?string;",
"public function getBilladdress3()\n {\n return $this->billaddress3;\n }",
"private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}",
"public function getAddr()\n {\n return $this->addr->getAddr();\n }",
"public function getAddress();",
"public function getAddress();",
"public function getAddressLine1(): ?string;",
"public function get_adresse();",
"public function getOldAddress(): string\n {\n return $this->old_address;\n }",
"public function getAddr() : string\n {\n return $this->addr;\n }",
"public function getAddress() {}",
"public function getCodeRef3() {\n return $this->codeRef3;\n }",
"public function getAddress2()\n {\n\n return $this->fv_address2;\n }",
"public function getAddr()\n {\n return $this->addr;\n }",
"public function x_AVM_DE_GetExternalIPv6Address()\n {\n $result = $this->client->X_AVM_DE_GetExternalIPv6Address();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }",
"public function getTelefone3()\n {\n return $this->telefone3;\n }",
"public static function addressExtendedAddress()\n {\n return new TextNode('address_extended_address');\n }",
"public function getAddress()\n\t{\n\t\treturn $this->data['address'];\n\t}",
"public function getAddress2()\n {\n return parent::getValue('address2');\n }",
"public function getAddress2()\n\t{\n\t\treturn $this->address2;\n\t}",
"public function getAddress()\n {\n $res = $this->getEntity()->getAddress();\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()->getAddress();\n\t\t}\n return $res;\n }",
"public function getAddress() {\n\t\t$address = current($this->getAddresses()->toArray());\n\t\treturn $address;\n\t}"
] | [
"0.6737898",
"0.6538779",
"0.6538779",
"0.6535877",
"0.651964",
"0.651964",
"0.5945514",
"0.588931",
"0.5858207",
"0.5842814",
"0.57581216",
"0.5730754",
"0.5711425",
"0.5711425",
"0.5709995",
"0.5687225",
"0.56675434",
"0.5667391",
"0.56423074",
"0.5632281",
"0.5622185",
"0.5603617",
"0.5596224",
"0.55899256",
"0.55574316",
"0.5550826",
"0.5510637",
"0.54982555",
"0.54931474",
"0.5481421"
] | 0.8108999 | 0 |
Get the etbl raison sociale. | public function getEtblRaisonSociale() {
return $this->etblRaisonSociale;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRaisonSociale(): ?string {\n return $this->raisonSociale;\n }",
"public function getRELIGION()\r\n {\r\n return $this->RELIGION;\r\n }",
"public function getRoe()\n {\n return $this->roe;\n }",
"public function getLibelleEcr() {\n return $this->libelleEcr;\n }",
"public function getLr() {}",
"public function getLogradouro() {\n\n return $this->sLogradouro;\n }",
"public function getRia()\n {\n /*if (!$this->hasRole('ROLE_CLIENT')) {\n throw new \\Exception(\"User has not role: ROLE_CLIENT\");\n }*/\n\n return $this->getProfile() ? $this->getProfile()->getRia() : null;\n }",
"public function getRaisonSocLieuTrav() {\n return $this->raisonSocLieuTrav;\n }",
"public function getReel()\n {\n return $reel;\n }",
"public function getLogradouro()\n\t{\t\n\t\t/**\n\t\t * retorna logradouro\n\t\t * @return logradouro\n\t\t */\n\t\treturn $this->logradouro;\n\t}",
"public function getSocietetierce()\n {\n return $this->societetierce;\n }",
"public function getRaisonSocial()\n {\n return $this->raisonSocial;\n }",
"public function getRutEmisor()\n {\n return $this->rutEmisor;\n }",
"public function getRii()\n {\n return Mage::registry('current_rii');\n }",
"public function getUr() {}",
"public function getSiretLieuTrav() {\n return $this->siretLieuTrav;\n }",
"public function getLrc()\n\t{\n\t\treturn self::fetchData(null,null,'lrclink');\n\t}",
"public function getRDN()\n\t{\n\t\treturn $this->rdn;\n\t}",
"public function getSlr()\n {\n return $this->slr;\n }",
"public function getCRRAInstitution()\n {\n return $this->fields['institution'][0];\n\n }",
"public function getOrganismeRetraite() {\n return $this->organismeRetraite;\n }",
"public function getUnCompteRendu($id){\n\t\t$req = \"select * from praticien P,rapport_visite R, visiteur V where R.RAP_NUM='$id' and P.PRA_NUM=R.PRA_NUM and r.vis_matricule = v.vis_matricule\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetch();\n\t\treturn $ligne;\n\t}",
"public function getR() {}",
"function getRSO($rso_id, $db){\n\n\t$temp = $db->query(\"SELECT rso.name AS name, rso.description as description, rso_type.type as type, rso.joinable as joinable\n\t\tFROM rso, rso_type\n\t\tWHERE (rso.rid) = '\" . $rso_id . \"' \n\t\t\t&& (rso_type.rtid) = (rso.rtid)\");\n\t//echo '<pre>', var_dump($temp), '</pre>';\n\t$rso = $temp->fetch_assoc();\n\treturn $rso;\n}",
"public function getLandid()\n {\n return $this->landId;\n }",
"public function getResidence()\n {\n return $this->residence;\n }",
"public function getRuolo() {\n return $this->ruolo;\n }",
"public function get_persR()\n {\n return $this->_persR;\n }",
"public function getRaithSeinar()\n {\n \tif (null === $this->raithSeinar)\n \t{\n \t $path = __DIR__ . '/vcards/RaithSeinar.vcf';\n \n $parser = new VCardParser();\n $vcards = $parser->importFromFile($path);\n \n $this->assertCount(1, $vcards);\n\t $this->raithSeinar = $vcards[0];\n \t}\n\treturn $this->raithSeinar;\n }",
"public function getRaithSeinar()\n {\n \tif (null === $this->raithSeinar)\n \t{\n \t $path = __DIR__ . '/vcards/RaithSeinar.vcf';\n \n $parser = new VCardParser();\n $vcards = $parser->importFromFile($path);\n \n $this->assertCount(1, $vcards);\n\t $this->raithSeinar = $vcards[0];\n \t}\n\treturn $this->raithSeinar;\n }"
] | [
"0.63757163",
"0.62943554",
"0.6279772",
"0.61899835",
"0.6187282",
"0.61674",
"0.6153965",
"0.6150915",
"0.6102437",
"0.6083804",
"0.6019967",
"0.5985366",
"0.5972386",
"0.5893089",
"0.58350533",
"0.581507",
"0.58088726",
"0.5792924",
"0.57837355",
"0.57773775",
"0.5755186",
"0.5744202",
"0.5742615",
"0.5713526",
"0.56925714",
"0.569101",
"0.56860954",
"0.5682242",
"0.5676197",
"0.5676197"
] | 0.7177869 | 1 |
Get the etbl tel. | public function getEtblTel() {
return $this->etblTel;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTel()\n {\n return $this->tel;\n }",
"public function getTel()\n {\n return $this->tel;\n }",
"public function getTel()\n {\n return $this->tel;\n }",
"public function getTel()\n {\n return $this->tel;\n }",
"public function getTel()\n {\n return $this->Tel;\n }",
"public function get_tel()\n {\n return $this->_tel;\n }",
"public function getEmpTel() {\n return $this->empTel;\n }",
"public function getTelEnseignantRef()\n {\n return $this->telEnseignantRef;\n }",
"public function getTelContact() {\n return $this->telContact;\n }",
"public function setEtblTel($etblTel) {\n $this->etblTel = $etblTel;\n return $this;\n }",
"public function setEtblTel($etblTel) {\n $this->etblTel = $etblTel;\n return $this;\n }",
"public function getTel_user()\r\n {\r\n return $this->tel_user;\r\n }",
"function tel( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_TEL,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}",
"public function getTel_partner()\n {\n return $this->tel_partner;\n }",
"public function getTelephone() : string {\n return $this->telephone;\n }",
"public function get_telephone();",
"public function getTelephone() {}",
"public function getTelefono()\n\t\t{\n\t\treturn $this->telefono;\n\t\t}",
"public static function tel(string $tel, $text = null, array $attr = []): string\n {\n $number = preg_replace('![^0-9\\+]+!', '', $tel);\n\n if (empty($text) === true) {\n $text = $tel;\n }\n\n return static::link('tel:' . $number, $text, $attr);\n }",
"public function getTelephone() {\n\t\treturn $this->telephone;\n\t}",
"public function getTelefono() {\n\t\treturn $this->telefono;\n\t}",
"public function getTelephone()\n {\n return $this->telephone;\n }",
"public function getTelephone()\n {\n return $this->telephone;\n }",
"public function getTelephone()\n {\n return $this->telephone;\n }",
"public function getTelephone()\n {\n return $this->telephone;\n }",
"public function getTelephone()\n {\n return $this->telephone;\n }",
"public function getTelephone()\n {\n return $this->telephone;\n }",
"public function getTipRtbus() {\n return $this->get(self::TIP_RTBUS);\n }",
"public function setTel($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->tel !== $v) {\n $this->tel = $v;\n $this->modifiedColumns[] = EventPeer::TEL;\n }\n\n\n return $this;\n }",
"public function getTelefono()\n {\n return $this->telefono;\n }"
] | [
"0.7857775",
"0.7857775",
"0.7857775",
"0.7857775",
"0.7819503",
"0.7751758",
"0.7387757",
"0.6645414",
"0.6611341",
"0.6595298",
"0.6595298",
"0.6390126",
"0.6331194",
"0.62941515",
"0.61949635",
"0.6172509",
"0.61381674",
"0.608239",
"0.608111",
"0.60134804",
"0.600996",
"0.60001993",
"0.60001993",
"0.60001993",
"0.60001993",
"0.60001993",
"0.60001993",
"0.5979302",
"0.5935323",
"0.58942926"
] | 0.8216661 | 1 |
Get the intitule compte. | public function getIntituleCompte() {
return $this->intituleCompte;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCompte()\n {\n return $this->compte;\n }",
"public static function getCompteur() {\n return self::$_compteur;\n }",
"public function getComplemento() {\n return $this->sComplemento;\n }",
"public function getComplemento() {\n return $this->sComplemento;\n }",
"public function getIdCompra()\r\n {\r\n return $this->idCompra;\r\n }",
"public function getComptes()\n {\n return $this->comptes;\n }",
"public function getTipoCompra(){\n return $this->iTipoCompra;\n }",
"public function get_component() : string\n {\n return $this->component;\n }",
"public function getComContenu()\n {\n return $this->Com_contenu;\n }",
"public function getIdOrdenCompra() {\n return $this->id_orden_compra;\n }",
"public function component()\n {\n return $this->component;\n }",
"public function getCelular()\n\t{\n\t\treturn $this->celular;\n\t}",
"public function getNumcompte()\n {\n return $this->numcompte;\n }",
"public function getNumcompte()\n {\n return $this->numcompte;\n }",
"public function getCompteVentilation(): ?string {\n return $this->compteVentilation;\n }",
"public function getIntituleChoix()\n {\n return $this->intituleChoix;\n }",
"public function getComponent()\n\t{\n\t\treturn $this->component;\n\t}",
"public function get_compte(){retrun($id_local_compte); }",
"function getComps()\n {\n return $this->comps;\n }",
"public function get_comercial(){\n\t\t\treturn $this->comercial;\n\t\t}",
"public function getCoInformeIncidente()\n\t{\n\t\treturn $this->co_informe_incidente;\n\t}",
"public function getC()\n {\n return $this->C;\n }",
"public function getConta() {\n return $this->conta;\n }",
"public function getComplaints()\n {\n return $this->hasOne(Complaint::className(), ['id_complaint' => 'id_complaints']);\n }",
"public function getCodeCollaborateurClot() {\n return $this->codeCollaborateurClot;\n }",
"public function getComposition()\n {\n return $this->composition;\n }",
"public function getCLINICA()\r\n {\r\n return $this->CLINICA;\r\n }",
"public function get_compartment(){\n $this->compartment = array_shift(Compartment::find_all(\" WHERE dead_no = '{$this->id}' LIMIT 1\"));\n if ($this->compartment) {\n return $this->compartment->description;\n } else {\n return \"Not specified\";\n }\n }",
"public function getCoInformeDepuracion()\n\t{\n\t\treturn $this->co_informe_depuracion;\n\t}",
"public function getControlador()\n\t\t{\n\t\t\treturn $this->controlador;\n\t\t}"
] | [
"0.7726448",
"0.7607681",
"0.6796081",
"0.67921114",
"0.67636853",
"0.65694416",
"0.6445466",
"0.638061",
"0.6252318",
"0.6220353",
"0.6214302",
"0.6205332",
"0.61990476",
"0.61990476",
"0.6189939",
"0.6110333",
"0.6097744",
"0.6069794",
"0.6063932",
"0.60314196",
"0.60282296",
"0.60251766",
"0.6015045",
"0.6003281",
"0.5951909",
"0.5939822",
"0.5927621",
"0.59207666",
"0.5918617",
"0.5893823"
] | 0.8354833 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.